/// <summary> /// Initializes the values associated to this character instance. </summary> protected virtual void Awake() { Initialization(); _coordinates = GetComponent <Transform>(); _controller = GetComponent <CharacterController>(); _rigidbody = GetComponent <Rigidbody>(); charStats = GetComponent <BaseCharacterClassicStats>(); charMoveSet = GetComponent <CharacterMovesetModule>(); //primaryWeapon = transform.GetComponentInChildren<>(); }
// [SerializeField] bool invincible; // [SerializeField] bool sneaking; // [SerializeField] bool stunned; // [SerializeField] bool running; // [SerializeField] bool defending; // [SerializeField] bool countering; #endregion #region Setup protected override void OnAwake() { base.OnAwake(); stats = GetComponent <BaseCharacterClassicStats> (); moveSet = GetComponent <CharacterMovesetModule> (); //used to access actions for state activation equipment = GetComponent <BaseEquipmentLoadoutModule> (); _animation = GetComponent <MeshRenderer> (); armed = false; attacking = false; // sneaking = false; // // stunned = false; // running = false; // defending = false; // countering = false; }
/// <summary> /// Initializes the values associated to this character instance. </summary> protected virtual void Awake() { Initialization(); _coordinates = GetComponent<Transform>(); _controller = GetComponent<CharacterController>(); _rigidbody = GetComponent<Rigidbody>(); charStats = GetComponent<BaseCharacterClassicStats>(); charMoveSet = GetComponent<CharacterMovesetModule>(); //primaryWeapon = transform.GetComponentInChildren<>(); }
protected override void OnAwake() { base.OnAwake (); stats = GetComponent<BaseCharacterClassicStats> (); moveSet = GetComponent<CharacterMovesetModule> (); //used to access actions for state activation equipment = GetComponent<BaseEquipmentLoadoutModule> (); _animation = GetComponent<MeshRenderer> (); armed = false; attacking = false; // sneaking = false; // // stunned = false; // running = false; // defending = false; // countering = false; }
protected override void OnAwake() { base.OnAwake (); user = GetComponent<BaseCharacter> (); stats = GetComponent<CharacterStats> (); moveSet = GetComponent<CharacterMovesetModule> (); //used to access actions for state activation // _animation = transform.Find ("Renderer").GetComponent<SkinnedMeshRenderer>(); _animation = user.oldCharAnimation; input = GetComponent<BaseInputModule> (); armed = false; attacking = false; running = false; }
/// <summary> /// Initializes the values associated to this character instance. </summary> protected virtual void Awake() { //Unity Components _coordinates = GetComponent<Transform>(); _controller = GetComponent<CharacterController>(); _rigidbody = GetComponent<Rigidbody>(); //Basic Character Components charAnimation = GetComponent<Animator> (); if (charAnimation != null) charAnimation.SetLayerWeight (1, 1); charStats = GetComponent<CharacterStats> (); charMoveSet = GetComponent<CharacterMovesetModule> (); oldCharAnimation = transform.Find ("Renderer").GetComponent<SkinnedMeshRenderer>().material; if (oldCharAnimation == null) Debug.LogError (name+"'s material is null"); // GetComponentInChildren<MeshRenderer> ().material; //Add specialized character components switch (charType) { case CharacterType.Player: charState = gameObject.AddComponent <CharacterStateMachine> (); //dictates character's moveset and availble actions charInput = gameObject.AddComponent <PlayerInput> (); //dictates characters focus and behaviour break; case CharacterType.Enemy: charState = gameObject.AddComponent <EnemyStateModule> (); charInput = gameObject.AddComponent <AIInput> (); break; default: break; } }