Пример #1
0
 void Item_ch()
 {
     if (ItemUI_Ch == true)
     {
         box_tr();
         pm.mouse_O();
     }
     else if (ItemUI_Ch == false)
     {
         box_fa();
         pm.mouse_C();
     }
 }
Пример #2
0
    //box関連
    public void Box_UI()
    {
        PlayerMov pm = GetComponent <PlayerMov>();

        if (boxUI && hit == 1 || doorUI && hit == 2)
        {
            TextUI.gameObject.SetActive(true);
        }
        else if (!boxUI && hit == 0 || !doorUI && hit == 0)
        {
            TextUI.gameObject.SetActive(false);
        }
        if (Input.GetKeyDown("space") && !boxOC && hit == 1)
        {
            boxOC     = true;
            ItemUI_Ch = true;
            pm.mouse_O();
            slotGrit.HitBox = true;
            slotGrit.BoxInventory();
        }
        else if (Input.GetKeyDown("space") && boxOC && hit == 1)
        {
            boxOC           = false;
            ItemUI_Ch       = false;
            slotGrit.HitBox = false;
            pm.mouse_C();
        }
        if (boxOC)
        {
            pm.speed = 0;
            Item_ch();
            inBox_tr();
        }
        else if (!boxOC)
        {
            pm.speed = 3;
            Item_ch();
            outBox();
        }
    }