/// <summary> /// Start is called on the frame when a script is enabled just before /// any of the Update methods is called the first time. /// </summary> void Start() { if (this == player) { playerTransform = player.transform; hpManager = player.GetComponentInChildren <PlayerHealthManager>(); physics = player.GetComponentInChildren <PlayerPhysics>(); movementModifier = player.GetComponentInChildren <PlayerMovementModifier>(); clipManager = player.GetComponentInChildren <PlayerClipManager>(); graphicsManager = player.GetComponentInChildren <PlayerGraphicsManager>(); playerController = player.GetComponentInChildren <PlayerControllerScript>(); playerAudio = player.GetComponentInChildren <PlayerAudioSource>(); } }
private void Awake() { Animator = GetComponent <Animator>(); SmbLoco = Animator.GetBehaviour <LocomotionCSMB>(); SmbWeapon = Animator.GetBehaviour <WeaponCSMB>(); SmbLookIK = Animator.GetBehaviour <LookIKCSMB>(); SmbCover = Animator.GetBehaviour <CoverCSMB>(); SmbThrow = Animator.GetBehaviour <ThrowCSMB>(); SmbGroundedCheck = Animator.GetBehaviour <GroundedCheckSMB>(); footSoundFx = new FootPlanting(footStepFx, GetComponent <Animator>()); health = GetComponent <Health>(); playerPhysic = new PlayerPhysics(GetComponent <Rigidbody>(), this); }