Exemple #1
0
    public void AddWorldUIData(GameObject worldUIObject, WorldDinoUI worldDinoUI)
    {
        WorldUIData[] newWorldUIs = new WorldUIData[worldUIs.Length + 1];
        for (int i = 0; i < worldUIs.Length; i++)
        {
            newWorldUIs[i] = worldUIs[i];
        }

        WorldUIData data = new WorldUIData(worldUIObject, worldDinoUI);

        newWorldUIs[newWorldUIs.Length - 1] = data;

        worldUIs = newWorldUIs;
    }
Exemple #2
0
    private void CreatePlayerWorldUI(int playerNumber, int playerViewer)
    {
        PlayerData data = players[playerNumber - 1];

        PlayerData viewerdata = players[playerViewer - 1];

        // Create world UI object
        GameObject  worldUIObject = (GameObject)Instantiate(dinoWorldUIPrefab, data.dinoObject.transform);
        WorldDinoUI worldDinoUI   = worldUIObject.GetComponent <WorldDinoUI>();

        // Configure world UI object
        worldDinoUI.gameCharacter    = data.dinoCharacter;
        worldDinoUI.playerCamera     = viewerdata.playerCamera;
        worldDinoUI.playerNumber     = viewerdata.playerNumber;
        worldDinoUI.dinoPlayerNumber = data.playerNumber;

        // Enable the object
        worldUIObject.SetActive(true);

        // Add it to the player data.
        data.AddWorldUIData(worldUIObject, worldDinoUI);
    }
Exemple #3
0
 public WorldUIData(GameObject worldUIObject, WorldDinoUI worldDinoUI)
 {
     this.worldUIObject = worldUIObject;
     this.worldDinoUI   = worldDinoUI;
 }