void Start()
        {
            characterInitialForward = CharacterActor.Forward;

            if (currentState != null)
            {
                currentState.EnterBehaviour(0f, currentState);

                if (CanCurrentStateOverrideAnimatorController)
                {
                    Animator.runtimeAnimatorController = currentState.RuntimeAnimatorController;
                }
            }
        }
Exemple #2
0
        public override void Initialize(CharacterActor characterActor)
        {
            base.Initialize(characterActor);

            characterActor = this.GetComponentInBranch <CharacterActor>();
            CharacterBrain = this.GetComponentInBranch <CharacterActor, CharacterBrain>();

            characterInitialForward = characterActor.Forward;

            InitializeAnimation();

            AddAndInitializeStates();

            if (currentState != null)
            {
                currentState.EnterBehaviour(0f, currentState);

                if (Animator != null && currentState.RuntimeAnimatorController != null)
                {
                    Animator.runtimeAnimatorController = currentState.RuntimeAnimatorController;
                }
            }
        }