Пример #1
0
        public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
        {
            playerPos                  = GameObject.FindGameObjectWithTag("Player").transform;
            temperamentData            = animator.GetComponent <TemperamentData>();
            animationData              = animator.GetComponent <AnimationData>();
            aiSettingData              = animator.GetComponent <AiSettingData>();
            wayPointData               = animator.GetComponent <WayPointData>();
            attackRange                = TemperamentManager.CombatTriggerRange(temperamentData.CombatStyle);
            moodRange                  = TemperamentManager.MoodTriggerRange(temperamentData.Mood);
            animatorOverrideController = new AnimatorOverrideController(animator.runtimeAnimatorController);

            //animatorOverrideController["Walking"] = animationData.AttackAnimation;

            clipOverrides = new AnimationClipOverrides(animatorOverrideController.overridesCount);
            animatorOverrideController.GetOverrides(clipOverrides);


            clipOverrides["Idle"]      = animationData.IdleAnimation;
            clipOverrides["Walking"]   = animationData.WalkAnimation;
            clipOverrides["Running"]   = animationData.RunAnimation;
            clipOverrides["Attacking"] = animationData.AttackAnimation;
            clipOverrides["Death"]     = animationData.DeathAnimation;
            animatorOverrideController.ApplyOverrides(clipOverrides);
            animator.runtimeAnimatorController = animatorOverrideController;
        }
Пример #2
0
 private void OnDrawGizmos()
 {
     // Draw a yellow sphere at the transform's position
     if (TemperamentManager.CombatTriggerRange(CombatStyle) != 0)
     {
         Gizmos.color = Color.blue;
         Gizmos.DrawWireSphere(transform.position, TemperamentManager.CombatTriggerRange(CombatStyle));
     }
     if (TemperamentManager.MoodTriggerRange(Mood) != 0)
     {
         Gizmos.color = Color.red;
         Gizmos.DrawWireSphere(transform.position, TemperamentManager.MoodTriggerRange(Mood));
     }
 }