コード例 #1
0
    public void OnMouseLeftClick(ItemEnum itemInHand)
    {
        Vector2    mousePosition       = UF.GetMousePos();
        GameObject somethingUnderMouse = UF.FetchGameObject(UF.GetMousePos(), LayerMask.GetMask("Interractable"));

        if (somethingUnderMouse == null) //Jos hiiren alla ei ole mitään niin liikutaan
        {
            PlayerMovement.instance.Move(mousePosition);
        }
        else
        {
            somethingUnderMouse.GetComponent <Interractable>().GiveActivationCommand(itemInHand);
        }
    }