コード例 #1
0
    //TODO: Create the players and ai objects when entering main game scene for enabling / disabling later
    void CreatePlayers()
    {
        textManager = FindObjectOfType <PlayerJoinTextHandler>();
        textManager.GetPlayers(playerOneIsIn, playerTwoIsIn, screenlayingDown);

        //Spawn Players
        playerOne = Instantiate(playerGameobject, leftStartPosition, ref_LeftRotation);
        playerOne.transform.eulerAngles = new Vector3(0, 0, -90);
        playerOne.SetActive(false);

        playerTwo = Instantiate(playerGameobject, rightStartPosition, ref_RightRotation);
        playerTwo.transform.eulerAngles = new Vector3(0, 0, 90);
        playerTwo.SetActive(false);

        //Spawn AI
        aiOne = Instantiate(aIGameobject, leftStartPosition, ref_LeftRotation);
        aiOne.transform.eulerAngles = new Vector3(0, 0, -90);

        aiTwo = Instantiate(aIGameobject, rightStartPosition, ref_RightRotation);
        aiTwo.transform.eulerAngles = new Vector3(0, 0, 90);
    }
コード例 #2
0
 void CreatePlayers()
 {
     textaManeger = FindObjectOfType <PlayerJoinTextHandler>();
     textaManeger.GetPlayers(playerOneIsIn, playerTwoIsIn, screenlayingDown);
     if (playerOneIsIn)
     {
         playerOne = Instantiate(playerGameobject, startPosiotion1, ref_StartRotation1);
     }
     else
     {
         playerOne = Instantiate(aIGameobject, startPosiotion1, ref_StartRotation1);
     }
     playerOne.transform.eulerAngles = new Vector3(0, 0, -90);
     if (playerTwoIsIn)
     {
         playerTwo = Instantiate(playerGameobject, startPosiotion2, ref_StartRotation2);
     }
     else
     {
         playerTwo = Instantiate(aIGameobject, startPosiotion2, ref_StartRotation2);
     }
     playerTwo.transform.eulerAngles = new Vector3(0, 0, 90);
 }