Exemple #1
0
        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;
            }
        }
Exemple #2
0
        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);
            }
        }
Exemple #3
0
        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);
        }
Exemple #4
0
 public override void OnManagerAdd()
 {
     GroundControl = Manager.Get <GroundControl>();
 }