コード例 #1
0
    // Use this for initialization
    void Start()
    {
        playerDataArray = new List <PlayerStruct> ();

        P1Field = GameObject.Find("P1").GetComponent <InputField>();
        P2Field = GameObject.Find("P2").GetComponent <InputField>();
        P3Field = GameObject.Find("P3").GetComponent <InputField>();
        P4Field = GameObject.Find("P4").GetComponent <InputField>();

        //if (!isClient)
        {
            roomName = tempName;
        }


        P1Field.text = playerOneField;
        P2Field.text = playerTwoField;
        P3Field.text = playerThreeField;
        P4Field.text = playerFourField;

        P1Field.GetComponentInParent <GameDataHolder>().isSelected = playerStructure1.selected;
        P2Field.GetComponentInParent <GameDataHolder>().isSelected = playerStructure2.selected;
        P3Field.GetComponentInParent <GameDataHolder>().isSelected = playerStructure3.selected;
        P4Field.GetComponentInParent <GameDataHolder>().isSelected = playerStructure4.selected;
    }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        //print("From lobby : " + SelectPlayField.whichBoard);
        if (!isServer)
        {
            CoinManager.DeductCoins(JoinAmount);
            CoinManager.justDeductedCoins = JoinAmount;
        }

        playerDataArray = new List <PlayerStruct> ();

        P1Field = GameObject.Find("P1").GetComponent <InputField>();
        P2Field = GameObject.Find("P2").GetComponent <InputField>();
        P3Field = GameObject.Find("P3").GetComponent <InputField>();
        P4Field = GameObject.Find("P4").GetComponent <InputField>();

        //if (!isClient)
        {
            roomName = tempName;
        }


        P1Field.text = playerOneField;
        P2Field.text = playerTwoField;
        P3Field.text = playerThreeField;
        P4Field.text = playerFourField;

        P1Field.GetComponentInParent <GameDataHolder>().isSelected = playerStructure1.selected;
        P2Field.GetComponentInParent <GameDataHolder>().isSelected = playerStructure2.selected;
        P3Field.GetComponentInParent <GameDataHolder>().isSelected = playerStructure3.selected;
        P4Field.GetComponentInParent <GameDataHolder>().isSelected = playerStructure4.selected;
        GameObject.Find("AudioManager").GetComponent <LudoLoader>().LevelLoadScreen = loadingScreen;


        //Display which board was chosen in the lobby scene
        if (!isServer)
        {
            BoardName.text = SelectPlayField.SelectedBoardName;
            print("Selected board : " + SelectPlayField.SelectedBoardName.Length + "yyyy" + BoardName.text + "KKKKK");
            if (SelectPlayField.SelectedBoardName == "Classic")
            {
                print("00000");
                SelectedBoardImage.sprite = boardImages [0];
            }
            else if (SelectPlayField.SelectedBoardName == "Ruins")
            {
                print("11111");
                SelectedBoardImage.sprite = boardImages [1];
            }
        }
        else
        {
            SelectedBoardImage.sprite = boardImages [SelectPlayField.whichBoard];
            BoardName.text            = boardNames[SelectPlayField.whichBoard];
        }
    }