//-------------------------------------------------------------------------------------------------------------- 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(); }
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"); } }
protected virtual void Awake() { characterBrain = GetComponent <CharacterBrain>(); // characterMotor = GetComponent<CharacterMotor>(); characterBody = GetComponent <CharacterBody>(); characterController2D = GetComponent <CharacterController2D>(); movementController = characterController2D.MovementController; poseController = characterController2D.PoseController; }
//-------------------------------------------------------------------------------------------------------------- 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(); }