void Start() { hpSysytem = gameObject.GetComponent<HPSysytem>(); damageSystem = gameObject.GetComponent<DamageSystem>(); enemyAnim = gameObject.GetComponent<EnemyAnimController>(); FindHumans(); }
void Start() { #region Init if (gameObject.GetComponent <HPSysytem>() == null) { gameObject.AddComponent <HPSysytem>(); } if (gameObject.GetComponent <DamageSystem>() == null) { gameObject.AddComponent <DamageSystem>(); } if (gameObject.GetComponent <EffectController>() == null) { gameObject.AddComponent <EffectController>(); } if (hpSysytem == null) { hpSysytem = GetComponent <HPSysytem>(); } if (damageSystem == null) { damageSystem = GetComponent <DamageSystem>(); } if (effectController == null) { effectController = GetComponent <EffectController>(); } #endregion if (gameObject.GetComponent <AgrSystem>() != null) { agrSystem = GetComponent <AgrSystem>(); } }