private void Spawns() { foreach (var point in points) { var bulletObj = ObjectPool.GetObject("Spawn", "SkillBullets"); var bullet = bulletObj.GetComponent <Spawn>(); bullet.Target = Target; bullet.gameObjectName = gameObjectName; bullet.point = point; bullet.Launch(point, Vector2.zero); } ObjectPool.RecycleObject(this.gameObject); }
private IEnumerator SpawnCoroutine() { yield return(spawning); var enemy = ObjectPool.GetObject(gameObjectName, "Entities"); enemy.transform.position = point; Behavior behavior = enemy.GetComponent <Behavior>(); if (behavior != null) { behavior.SetVariableValue("TrackTarget", Target); behavior.EnableBehavior(); behavior.Start(); } ObjectPool.RecycleObject(this.gameObject); }