예제 #1
0
    void OnTriggerStay2D(Collider2D other)
    {
        RocketController parentController = GetComponentInParent <RocketController>();
        Character        enemy            = other.GetComponent <Character>();


        if (enemy != null && !GameObject.ReferenceEquals(enemy, parentController.GetLauncherGameObject()) && parentController.hasBeenTriggered)
        {
            enemy.GetDamaged(aoeDamage, parentController.GetLauncherGameObject());
            Destroy(gameObject);
            Destroy(parentController.gameObject);
        }
    }