示例#1
0
        //--------------------------------------------------------------------------------------------------------------



        protected override void Awake()
        {
            base.Awake();

            characterBrain = GetComponent <CharacterBrain>();
            if (characterBrain == null)
            {
                Debug.Log("\"CharacterBrain\" component is missing.");
            }


            foreach (Transform child in transform)
            {
                characterAnimation = child.GetComponent <CharacterAnimation>();
                if (characterAnimation != null)
                {
                    break;
                }
            }

            if (characterAnimation == null)
            {
                Debug.Log("\"CharacterAnimation\" component is missing, if you want to use the character animations add this component to a child " +
                          "(the one that is animated). If not, ignore this message.");
            }


            movementController.Initialize(gameObject);
            poseController.Initialize(gameObject);

            InitializeAbilities();
        }
示例#2
0
        protected virtual void Awake()
        {
            Transform parent = transform.parent;


            characterMotor = parent.GetComponent <CharacterMotor>();
            if (characterMotor == null)
            {
                Debug.Log("\"CharacterMotor\" component is missing, Does the root object contain this component?");
            }

            characterController2D = parent.GetComponent <CharacterController2D>();
            if (characterController2D == null)
            {
                Debug.Log("\"CharacterController2D\" component is missing, Does the parent contain this component?");
            }

            characterBrain = parent.GetComponent <CharacterBrain>();
            if (characterBrain == null)
            {
                Debug.Log("\"CharacterBrain\" component is missing, Does the parent contain this component?");
            }


            animator = gameObject.GetOrAddComponent <Animator>();

            if (animator == null)
            {
                Debug.Log("The Animator component is Missing");
            }
            else if (animator.runtimeAnimatorController == null)
            {
                Debug.Log("The Runtime animator controller is Missing");
            }
        }
示例#3
0
        protected virtual void Awake()
        {
            characterBrain = GetComponent <CharacterBrain>();
            // characterMotor = GetComponent<CharacterMotor>();
            characterBody         = GetComponent <CharacterBody>();
            characterController2D = GetComponent <CharacterController2D>();

            movementController = characterController2D.MovementController;
            poseController     = characterController2D.PoseController;
        }
示例#4
0
        //--------------------------------------------------------------------------------------------------------------



        protected override void Awake()
        {
            base.Awake();

            characterBrain = GetComponent <CharacterBrain>();
            if (characterBrain == null)
            {
                Debug.Log("\"CharacterBrain\" component is missing.");
            }


            movementController.Initialize(gameObject);
            poseController.Initialize(gameObject);

            InitializeAbilities();
        }