Commit 42c0c26b authored by Marcel's avatar Marcel
Browse files

Merge remote-tracking branch 'origin/master'

parents 2e63aefd eb281138
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CamController : MonoBehaviour
{
public Cinemachine.CinemachineTargetGroup targetGroup;
private GroupController groupController;
public float moveTime = 1f;
private float MoveWeightActive { get; set; }
private float MoveWeightGroup { get; set; }
public bool FocusChange { get; set; }
// Start is called before the first frame update
void Start()
{
}
public void initTargets(GroupController group)
{
groupController = group;
targetGroup.m_Targets = new Cinemachine.CinemachineTargetGroup.Target[groupController.PlayableLemmings.Length + 1];
targetGroup.m_Targets[0].target = groupController.gameObject.transform;
targetGroup.m_Targets[0].weight = 1;
targetGroup.m_Targets[0].radius = 5;
for (int i = 1; i < targetGroup.m_Targets.Length; i++)
{
targetGroup.m_Targets[i].target = groupController.PlayableLemmings[i - 1].transform;
targetGroup.m_Targets[i].radius = 5;
targetGroup.m_Targets[i].weight = 0;
}
}
// Update is called once per frame
void FixedUpdate()
{
if (groupController.IsGroupSelected && FocusChange)
{
FocusGroup();
}
else if(!groupController.IsGroupSelected && FocusChange)
{
FocusActive();
}
}
void FocusGroup()
{
targetGroup.m_Targets[0].weight += moveTime / 10;
targetGroup.m_Targets[groupController.ActiveLemmingIndex + 1].weight -= moveTime / 10;
if (targetGroup.m_Targets[0].weight >= 1 && targetGroup.m_Targets[groupController.ActiveLemmingIndex + 1].weight <= 0)
{
FocusChange = false;
targetGroup.m_Targets[0].weight = 1;
targetGroup.m_Targets[groupController.ActiveLemmingIndex + 1].weight = 0;
}
}
void FocusActive()
{
targetGroup.m_Targets[0].weight -= moveTime / 10;
targetGroup.m_Targets[groupController.ActiveLemmingIndex + 1].weight += moveTime / 10;
if (targetGroup.m_Targets[0].weight <= 1 && targetGroup.m_Targets[groupController.ActiveLemmingIndex + 1].weight >= 0)
{
FocusChange = false;
targetGroup.m_Targets[0].weight = 0;
targetGroup.m_Targets[groupController.ActiveLemmingIndex + 1].weight = 1;
}
}
}
fileFormatVersion: 2
guid: 0241a119435c3e241aa9b7ff997c88a9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: c19c210c3ac92924881a5aea7f191249
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Coffin
serializedVersion: 5
m_AnimatorParameters:
- m_Name: Speed
m_Type: 1
m_DefaultFloat: 0.1
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
- m_Name: InGroup
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 1
m_Controller: {fileID: 0}
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
m_StateMachine: {fileID: 1107314248428966116}
m_Mask: {fileID: 0}
m_Motions: []
m_Behaviours: []
m_BlendingMode: 0
m_SyncedLayerIndex: -1
m_DefaultWeight: 0
m_IKPass: 0
m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000}
--- !u!1101 &1101473257875923716
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 3
m_ConditionEvent: Speed
m_EventTreshold: 0.1
- m_ConditionMode: 1
m_ConditionEvent: InGroup
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 1102680288473046446}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &1101962465888774054
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 4
m_ConditionEvent: Speed
m_EventTreshold: 0.1
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 1102347607766676748}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.75
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &1102347607766676748
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Idle
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: 1101473257875923716}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 0448db77cef472642bf5e37e0ac31192, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1102 &1102680288473046446
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Walk
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: 1101962465888774054}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 161f01b2b44e2ad43902466b168de7b1, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1107 &1107314248428966116
AnimatorStateMachine:
serializedVersion: 5
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Base Layer
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: 1102680288473046446}
m_Position: {x: 240, y: 36, z: 0}
- serializedVersion: 1
m_State: {fileID: 1102347607766676748}
m_Position: {x: 240, y: 108, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 50, y: 20, z: 0}
m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: 1102347607766676748}
fileFormatVersion: 2
guid: 16e3c73e0c404274d90b2f59a9fe4d45
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 9100000
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Idle
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves:
- curve:
- time: 0
value: {fileID: 21300000, guid: 861f8fa53c3e7b545b57ac28cbc9194b, type: 3}
attribute: m_Sprite
path:
classID: 212
script: {fileID: 0}
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 0
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
pptrCurveMapping:
- {fileID: 21300000, guid: 861f8fa53c3e7b545b57ac28cbc9194b, type: 3}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.016666668
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []
fileFormatVersion: 2
guid: 0448db77cef472642bf5e37e0ac31192
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Walk
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves:
- curve:
- time: 0
value: {fileID: 21300000, guid: 6a42da18c3e8ac34381318ee77c2fa18, type: 3}
- time: 0.25
value: {fileID: 21300000, guid: 3cbd032fa7494de4daa45c9cf1d6db9f, type: 3}
- time: 0.5
value: {fileID: 21300000, guid: 861f8fa53c3e7b545b57ac28cbc9194b, type: 3}
- time: 0.75
value: {fileID: 21300000, guid: 3cbd032fa7494de4daa45c9cf1d6db9f, type: 3}
attribute: m_Sprite
path:
classID: 212
script: {fileID: 0}
m_SampleRate: 4
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 0
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
pptrCurveMapping:
- {fileID: 21300000, guid: 6a42da18c3e8ac34381318ee77c2fa18, type: 3}
- {fileID: 21300000, guid: 3cbd032fa7494de4daa45c9cf1d6db9f, type: 3}
- {fileID: 21300000, guid: 861f8fa53c3e7b545b57ac28cbc9194b, type: 3}
- {fileID: 21300000, guid: 3cbd032fa7494de4daa45c9cf1d6db9f, type: 3}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 1
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []
fileFormatVersion: 2
guid: 161f01b2b44e2ad43902466b168de7b1
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:
......@@ -17,21 +17,51 @@ AnimationClip:
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves: []
m_SampleRate: 60
m_PPtrCurves:
- curve:
- time: 0
value: {fileID: 21300000, guid: 4d230d5868fda24428e56fbdd0cd66fa, type: 3}
- time: 0.2
value: {fileID: 21300000, guid: 29b973dd7ecc0ae4f8b05955dc79b812, type: 3}
- time: 0.4
value: {fileID: 21300000, guid: 6f25b7c20c10cff43b3a66517327f8f5, type: 3}
- time: 0.6
value: {fileID: 21300000, guid: 9cb057f43bc01b74eb4088ef190a2b69, type: 3}
- time: 1
value: {fileID: 21300000, guid: 0d9d34bbea0f87d4694b27cb6aa5f086, type: 3}
- time: 1.2
value: {fileID: 21300000, guid: f2cf7fedc76de5a4ea7024bf307e1bf0, type: 3}
attribute: m_Sprite
path:
classID: 212
script: {fileID: 0}
m_SampleRate: 5
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings: []
pptrCurveMapping: []
genericBindings:
- serializedVersion: 2
path: 0
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
pptrCurveMapping:
- {fileID: 21300000, guid: 4d230d5868fda24428e56fbdd0cd66fa, type: 3}
- {fileID: 21300000, guid: 29b973dd7ecc0ae4f8b05955dc79b812, type: 3}
- {fileID: 21300000, guid: 6f25b7c20c10cff43b3a66517327f8f5, type: 3}
- {fileID: 21300000, guid: 9cb057f43bc01b74eb4088ef190a2b69, type: 3}
- {fileID: 21300000, guid: 0d9d34bbea0f87d4694b27cb6aa5f086, type: 3}
- {fileID: 21300000, guid: f2cf7fedc76de5a4ea7024bf307e1bf0, type: 3}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 1
m_StopTime: 1.4000001
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
......
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: JumpDown
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves:
- curve:
- time: 0
value: {fileID: 21300000, guid: 40270091e3a7fcd48bfbac76ceed35e3, type: 3}
attribute: m_Sprite
path:
classID: 212
script: {fileID: 0}
m_SampleRate: 1
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 0
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
pptrCurveMapping:
- {fileID: 21300000, guid: 40270091e3a7fcd48bfbac76ceed35e3, type: 3}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 1
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []
fileFormatVersion: 2
guid: 0a768d0f4eb7cf4428ca78f6b9d718cf
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: JumpUp
serializedVersion: 6
m_Legacy: 0