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);
    }
Esempio n. 3
0
 public static void AddDeathObject(DeathObject obj)
 {
     _objects[(int)LAYER_ORDER.OTHERS].Add(obj);
 }
Esempio n. 4
0
 public static void RemoveDeathObject(DeathObject obj)
 {
     _objects[(int)LAYER_ORDER.OTHERS].Remove(obj);
 }