public override void HandleDeath() { DeathObject deathObject = Instantiate(deathObjectPrefab, transform.position, Quaternion.identity); deathObject.lookDirection = GetComponent <EnemyController>().movementVector; Destroy(gameObject); }
public override void HandleDeath() { DeathObject deathObject = Instantiate(deathObjectPrefab, transform.position, Quaternion.identity); deathObject.lookDirection = GetComponentInChildren <Weapon>().shootDirection; //фикс даст эффекта gameObject.GetComponent <RigidbodyMover>().SetMovementVector(Vector2.zero); gameObject.SetActive(false); //Нельзя дестроить если нужен invoke //Destroy(gameObject); Invoke("RestartLevel", 5f); }
public static void AddDeathObject(DeathObject obj) { _objects[(int)LAYER_ORDER.OTHERS].Add(obj); }
public static void RemoveDeathObject(DeathObject obj) { _objects[(int)LAYER_ORDER.OTHERS].Remove(obj); }