public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { GroundControl = GroundControl ?? animator.GetComponentInChildren <GroundControl>(); if (GroundControl == null) { return; } if (Acceleration != UnchangedValue) { GroundControl.Acceleration = Acceleration; } if (Deceleration != UnchangedValue) { GroundControl.Deceleration = Deceleration; } if (TopSpeed != UnchangedValue) { GroundControl.TopSpeed = TopSpeed; } if (MinSlopeGravitySpeed != UnchangedValue) { GroundControl.MinSlopeGravitySpeed = MinSlopeGravitySpeed; } }
public override void Start() { base.Start(); GroundControl = Manager.Get <GroundControl>(); if (SkidSound != null) { SkidSoundSource = SoundManager.Instance.CreateAudioSource(); SkidSoundSource.clip = SkidSound; SkidSoundSource.name = "Skid Sound"; SkidSoundSource.transform.SetParent(gameObject.transform); } }
public override void Start() { base.Start(); Duck = Manager.Get <Duck>(); GroundControl = Manager.Get <GroundControl>(); if (ChargeSound == null) { return; } ChargeAudioSource = new GameObject { name = "Charge Audio Source" }.AddComponent <AudioSource>(); ChargeAudioSource.clip = ChargeSound; ChargeAudioSource.transform.SetParent(transform); }
public override void OnManagerAdd() { GroundControl = Manager.Get <GroundControl>(); }