public static void Create(GameObject gameObject, Color color, Vector2 position, TowerBase tower, float damage, GameObject target, ISet <GameObject> prevTargets = null) { var projectile = Instantiate(gameObject, position, Quaternion.identity).GetComponent <Projectile>(); projectile._color = color; projectile._tower = tower; projectile._damage = damage; if (prevTargets != null) { projectile._prevTargets.UnionWith(prevTargets); } projectile._target = target; }
private void Start() { _base = GetComponent <TowerBase>(); }