Example #1
0
 // Start is called before the first frame update
 protected override void Start()
 {
     gameController     = GameObject.Find("GameController").GetComponent <GameController>();
     bagSlots.cellSize  = new Vector2(Screen.width * 16 / 192, Screen.height * 16 / 108);
     infoSlots.cellSize = new Vector2(Screen.width * 0.0625f, Screen.height * 11 / 108);
     if (gameController.connector.localPlayerInfo.sex)
     {
         sexEquipString += "m/";
     }
     else
     {
         sexEquipString += "f/";
     }
     StartCoroutine(WaitAndLoad());
     base.Start();
     mpl = this.FindChildObject("MainPlayerPreview").GetComponent <PlayerPreviewLoader>();
     mpl.LoadFromInfo(gameController.GetLocalPlayerInfo());
 }
 public void OnEnable()
 {
     if (gameController == null)
     {
         gameController   = GameObject.Find("GameController").GetComponent <GameController>();
         bagGrid.cellSize = new Vector2(Screen.width * 16 / 192, Screen.height * 16 / 108);
         foreach (GridLayoutGroup infs in infoGrid)
         {
             infs.cellSize = new Vector2(Screen.width * 0.0625f, Screen.height * 11 / 108);
         }
     }
     LoadStats();
     StartCoroutine(WaitAndLoad());
     if (mpl == null)
     {
         mpl = this.FindChildObject("MainPlayerPreview").GetComponent <PlayerPreviewLoader>();
     }
     mpl.LoadFromInfo(gameController.GetLocalPlayerInfo());
 }
Example #3
0
    void Start()
    {
        if (gameController == null)
        {
            gameController = GameObject.Find("GameController").GetComponent <GameController>();
        }

        if (loginPanel == null)
        {
            loginPanel = GameObject.Find("LoginPanel");
        }
        if (mainPanel == null)
        {
            mainPanel = GameObject.Find("MainPanel");
        }
        if (countUpUI == null)
        {
            countUpUI = GameObject.Find("CountUpUI");
        }
        if (loadingScreen == null)
        {
            loadingScreen = GameObject.Find("LoadingScreen");
        }
        if (mainPlayerPreview == null)
        {
            mainPlayerPreview = GameObject.Find("MainPlayerPreview").GetComponent <PlayerPreviewLoader>();
        }
        StartCoroutine(ShowLoginScreen());
        // if(yourTurnPanel == null)
        //     yourTurnPanel = GameObject.Find("YourTurnPanel");


        // if(healthText == null)
        //     healthText = GameObject.Find("HealthText").GetComponent<Text>();
        // if (propDict == null){
        //     propDict = new Dictionary<string, int>()
        //     {
        //         {"X2",10001},{"X1",10002},{"S3",10003},{"P50",10004},
        //         {"P40",10005},{"P30",10006},{"P20",10007},{"P10",10008}
        //     };
        // }
    }