Пример #1
0
    void Start()
    {
        Cursor.visible   = true;
        Cursor.lockState = CursorLockMode.None;
        player           = transform.parent.gameObject;

        playerScript = gameObject.GetComponentInParent <PlayerNetworkMode>();
        useJoystick  = playerScript.UseJoystick;
        Debug.Log("aaa" + useJoystick);
        if (!useJoystick)
        {
            cameraKeyXName    = "Mouse X";
            cameraKeyYName    = "Mouse Y";
            rotateCameraSpeed = 100;
        }
    }
Пример #2
0
    private void SplitMode()
    {
        switch (currentGameState)
        {
        case GAME_STATE.SELECT_PLAYER:
            SelectPlayer();

            if (isStart)
            {
                currentGameState = GAME_STATE.INITIALIZE_DATA;
            }
            break;

        case GAME_STATE.INITIALIZE_DATA:
            Vector3 player1Pos = GetRespawnPoint().transform.position;
            player1Pos.y = 0;
            Vector3 player2Pos = GetRespawnPoint().transform.position;
            player2Pos.y = 0;
            playerOne    = Instantiate(playerObject, player1Pos, Quaternion.identity);

            SKILL_TYPE skill = SKILL_TYPE.SKILL1;
            //  プレイヤー1初期化
            if (playerImgs[indexLeft].name == "RED")
            {
                skill = SKILL_TYPE.SKILL1;
            }
            else if (playerImgs[indexLeft].name == "BLUE")
            {
                skill = SKILL_TYPE.SKILL2;
            }
            else if (playerImgs[indexLeft].name == "GREEN")
            {
                skill = SKILL_TYPE.SKILL3;
            }
            else if (playerImgs[indexLeft].name == "YELLOW")
            {
                skill = SKILL_TYPE.SKILL4;
            }

            playerOneScript = playerOne.GetComponent <PlayerNetworkMode>();
            //playerOneScript.Create(PLAYER_NUMBER.ONE, skill, false);

            selectPanel.SetActive(false);
            currentGameState = GAME_STATE.IN_GAME;
            break;

        case GAME_STATE.IN_GAME:
            if (Time.frameCount % 2 == 0)
            {
                UpdateUI();
            }

            if (playerOneScript.IsDeath)
            {
                winText.text = "Blue Player Win!";
                isFinished   = true;
            }

            if (isFinished)
            {
                winText.enabled  = true;
                currentGameState = GAME_STATE.END_GAME;
            }
            break;

        case GAME_STATE.END_GAME:
            break;

        default:
            break;
        }
    }