public void RemoveEnemyComponent <T>() { if (typeof(T) == typeof(EnemyPatrol)) { enemyPatrol = null; } else if (typeof(T) == typeof(EnemyChase)) { enemyChase = null; } else if (typeof(T) == typeof(EnemyManipulate)) { enemyManipulate = null; } }
public void AddEnemyComponent <T>() { if (typeof(T) == typeof(EnemyPatrol)) { enemyPatrol = GetComponent <EnemyPatrol> (); } else if (typeof(T) == typeof(EnemyChase)) { enemyChase = GetComponent <EnemyChase> (); } else if (typeof(T) == typeof(EnemyManipulate)) { enemyManipulate = GetComponent <EnemyManipulate> (); } }