// public ParticleSystem hitEffect; #endregion protected virtual void Awake() { isDead = false; stateManager = GetComponent <StateManager>(); if (stateManager == null) { Debug.LogError(gameObject.ToString() + ": No state manager found!"); } moveBody = this.GetComponent <MoveBodyScript>(); if (moveBody == null) { Debug.LogError(gameObject.ToString() + ": No move body script found!"); } if (hitEffect != null) { hitEffects = hitEffect.GetComponentsInChildren <ParticleSystem>(); for (int i = 0; i < hitEffect.transform.childCount; i++) { if (hitEffect.transform.GetChild(i).CompareTag("permanentBlood")) { hitEffectPermanent = hitEffect.transform.GetChild(i).gameObject; break; } } } }
// public ParticleSystem hitEffect; #endregion protected virtual void Awake() { stateManager = GetComponent <StateManager>(); if (stateManager == null) { Debug.LogError(gameObject.ToString() + ": No state manager found!"); } moveBody = this.GetComponent <MoveBodyScript>(); if (moveBody == null) { Debug.LogError(gameObject.ToString() + ": No move body script found!"); } }
void Awake() { stateManager = this.GetComponent <StateManager>(); if (stateManager == null) { Debug.LogError(gameObject.ToString() + ": No state manager found!"); } moveBody = this.GetComponent <MoveBodyScript>(); if (moveBody == null) { Debug.LogError(gameObject.ToString() + ": No move body script found!"); } // Tells the game manager that this is the player, so AI scripts can more easily find the player. GameManager.SetPlayer(this.gameObject); }