예제 #1
0
    void TriggerEffect(Effect effect)
    {
        Ray        ray = LevelController.Instance.MainCamera.ScreenPointToRay(Input.mousePosition);
        RaycastHit hit;

        if (!Physics.Raycast(ray, out hit, Mathf.Infinity, clickableLayer))
        {
            return;
        }

        if (effect == Effect.Lightining)
        {
            IAttackable attackable = hit.collider.GetComponent <IAttackable>();
            attackable?.StruckedByLightning();
        }
        else
        {
            IDousable dousable = hit.collider.GetComponent <IDousable>();
            dousable?.RainedOn();
        }
    }
예제 #2
0
 public void SplashWater(IDousable enemy)
 {
     enemy.Douse("Holy Water"); // Kills with holy water
 }