void Awake() { Random.InitState(0); changeScene = GetGlobalObject.FindAndGetComponent <ChangeScenes>(this.gameObject, "Global"); //Check whether its sandbox or multiplayer. //If it is single player, generate the default map. //else, generate data and send over and generate again after taking. if (Sandbox == true) { Debug.Log("Tile is at" + theTileMap.ConvertTileToWorld(new Vector2(1, 1))); theObj = GameObject.Instantiate(PlayerPrefab, theTileMap.ConvertTileToWorld(new Vector2(1, 1)), Quaternion.identity) as GameObject; Player genericplayer = theObj.GetComponent <Player>(); genericplayer.thePlayerData.CreatePlayerData("Generic Player", 0); //CurrentPlayer.Instance.ThePlayer = genericplayer; } Shop.SetActive(true); Game.SetActive(false); ReadyText.SetActive(false); CurrentPlayer.Instance.GetHPIcons(HPIconsParent); CurrentPlayer.Instance.DigPowerUI = NumberOfDigs; CurrentPlayer.Instance.controller = this; MoneyShop = GameObject.Find("Money").GetComponent <Text>(); KillTrackSystem.Instance.theUI = KDObject; }
// Use this for initialization void Start() { changeScene = GetGlobalObject.FindAndGetComponent <ChangeScenes>(this.gameObject, "Global"); }