예제 #1
0
        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;
        }
예제 #2
0
 private void Start()
 {
     _base = GetComponent <TowerBase>();
 }