Пример #1
0
    void KeyboardInput()
    {
        if (Input.GetKey(KeyCode.LeftArrow))
        {
            cam.transform.position += new Vector3(-cameraSpeed, 0f);
        }
        if (Input.GetKey(KeyCode.RightArrow))
        {
            cam.transform.position += new Vector3(cameraSpeed, 0f);
        }
        if (Input.GetKey(KeyCode.UpArrow))
        {
            cam.transform.position += new Vector3(0f, cameraSpeed);
        }
        if (Input.GetKey(KeyCode.DownArrow))
        {
            cam.transform.position += new Vector3(0f, -cameraSpeed);
        }


        if (Input.GetKeyDown(KeyCode.F1))
        {
            isRelationSetting      = false;
            cam.transform.position = new Vector3(0f, 0f, cam.transform.position.z);
        }
        else if (Input.GetKeyDown(KeyCode.F2))
        {
            isRelationSetting = true;
            Vector3 vec = createManager.relationSettingMainBlock.transform.position;
            vec.z = cam.transform.position.z;
            cam.transform.position = vec;
        }
        else if (Input.GetKeyDown(KeyCode.F5))
        {
            if (isSelectMode == false)
            {
                createManager.selectBlockList.Clear();
            }
            else
            {
                foreach (Block block in createManager.selectBlockList)
                {
                    block.gameObject.GetComponent <SpriteRenderer>().color = cReset;
                }
            }
            isSelectMode = !isSelectMode;
        }
        else if (Input.GetKeyDown(KeyCode.F9))
        {
            createManager.StageBlockReset();
            foreach (Block block in Block.BlockList)
            {
                block.BlockUpdate();
            }

            isTestMode = !isTestMode;
        }


        float camSize = cam.orthographicSize - Input.mouseScrollDelta.y;

        if (camSize > 0)
        {
            cam.orthographicSize = camSize;
        }
    }