コード例 #1
0
 /// <summary>
 /// 横方向の入力が行われた時の処理
 /// </summary>
 private void InputHorizontal()
 {
     if (StageEditUtility.GetRightKeyDown())
     {
         cellNum.x++;
         if (cellNum.x == cells.x)
         {
             cellNum.x = 0;
         }
         SelectGridObject(cellNum);
     }
     else if (StageEditUtility.GetLeftKeyDown())
     {
         cellNum.x--;
         if (cellNum.x == -1)
         {
             cellNum.x = cells.x - 1;
         }
         SelectGridObject(cellNum);
     }
 }
コード例 #2
0
 /// <summary>
 /// 縦方向の入力が行われた時の処理
 /// </summary>
 private void InputVertical()
 {
     if (StageEditUtility.GetUpKeyDown())
     {
         cellNum.y++;
         if (cellNum.y == cells.y)
         {
             cellNum.y = 1;
         }
         SelectGridObject(cellNum);
     }
     else if (StageEditUtility.GetDownKeyDown())
     {
         cellNum.y--;
         if (cellNum.y == 0)
         {
             cellNum.y = cells.y - 1;
         }
         SelectGridObject(cellNum);
     }
 }
コード例 #3
0
    /// <summary>
    /// ステージエディット時のキー入力処理
    /// </summary>
    private void EditorInput()
    {
        if (!isCreateStage)
        {
            return;
        }
        if (EventSystem.current.currentSelectedGameObject?.GetComponent <InputField>() != null)
        {
            return;
        }

        if (Input.GetKeyDown(KeyCode.I))
        {
            isOnMenu = !isOnMenu;
            menuCanvas.SetActive(!menuCanvas.activeSelf);
            editCanvas.SetActive(!editCanvas.activeSelf);
        }
        if (isOnMenu)
        {
            return;
        }
        CheakKeyDownForMoveKey();

        if (isLeftShiftKey && Input.GetKeyDown(KeyCode.E))
        {
            ChangeToggleForEnemyEdit();
        }

        if (Input.GetKeyDown(KeyCode.L))
        {
            SelectObjectAllChange();
        }

        SetOrDeleteStageObject();

        RangeSelection();

        if (Input.GetKeyDown(KeyCode.Tab))
        {
            ChangeStageObject();
        }

        if (Input.GetKeyDown(KeyCode.R))
        {
            GameObject obj = guideObj.transform.GetChild(1).gameObject;

            if (isLeftShiftKey)
            {
                (guideObj, stageObjAngle) = StageEditUtility.RotationX(obj, guideObj, stageObjAngle);
            }
            else
            {
                (guideObj, stageObjAngle) = StageEditUtility.RotationY(obj, guideObj, stageObjAngle);
            }
        }

        if (isLeftAltKey && isLeftAltKey)
        {
            if (Input.GetMouseButtonDown(0))
            {
                GameObject obj = guideObj.transform.GetChild(1).gameObject;
                (guideObj, stageObjAngle) = StageEditUtility.RotationZ(obj, guideObj, stageObjAngle);
            }
        }

        if (IsInputAnyKey)
        {
            return;
        }
        InputHorizontal();
        InputVertical();
        InputDepth();
    }