public override void InitializeGUI() { if (base._mIsLoaded) { return; } base._mIsLoaded = true; _mRootTransform = this.transform; _mRootTransform.parent = Globals.Instance.MGUIManager.MGUICamera.transform; _mRootTransform.localPosition = new Vector3(0, 0, 10f); // Traverse all children int childCount = this.transform.GetChildCount(); for (int i = 0; i < childCount; ++i) { Transform child = this.transform.GetChild(i); TipsContent content = child.GetComponent <TipsContent>(); content.Init(); _mTipsContentList.Add(content.GetType().Name, content); } base.GUILevel = 1; }
private void LoadGameData() { string filePath = Application.streamingAssetsPath + "/tips.json"; if (File.Exists(filePath)) { string dataAsJson = File.ReadAllText(filePath); tipsContent = JsonUtility.FromJson <TipsContent> (dataAsJson); } }