private void ShowTalkObj(int wordID, string teachID, int stepID, bool saveToserver = false) { Transform targetTran = Globals.Instance.M3DItemManager.EZ3DItemParent; UIButton dialogBtn = null; if (mTalkTargetObj == null) { mTalkTargetObj = (GameObject)Instantiate(mTalkObjectPrefab) as GameObject; mTalkTargetObj.transform.parent = targetTran; mTalkTargetObj.transform.localPosition = new Vector3(0, 0, 10); mTalkTargetObj.transform.localScale = Vector3.one; dialogBtn = mTalkTargetObj.transform.Find("BG").GetComponent <UIButton>(); UIEventListener.Get(dialogBtn.gameObject).onClick += OnTalkBtnClick; } if (dialogBtn == null) { dialogBtn = mTalkTargetObj.transform.Find("BG").GetComponent <UIButton>(); } TeachStepInfo teachInfo = new TeachStepInfo(); teachInfo.teachID = teachID; teachInfo.stepID = stepID; teachInfo.saveToserver = saveToserver; dialogBtn.Data = teachInfo; NGUITools.SetActive(mTalkTargetObj, true); UILabel uiLabel = mTalkTargetObj.transform.Find("UILable").GetComponent <UILabel>(); uiLabel.text = Globals.Instance.MDataTableManager.GetWordText(wordID); GUIBeginnersGuide.Hide(); }
private void NewTeachX21() { string key = "x21"; int value = NewGetTeachStep(key); if (value > 0) { mIsOpenTeach = false; GUIBeginnersGuide.Hide(); if (NewGetTeachStep("x01") == 0) { NewWriteSaveData("x01", TeachFinishedValue); } } }
// 处理按钮点击// public void NewTriggerSave(string _fullName, int type, float val = 0.0f) { string key = ""; int curStep = 0; int nextStep = 0; JianTouObject tCurJianTouObject = null; for (int i = 0; i < mJianTouNameList.Count; i++) { JianTouObject tJianTouObject = mJianTouNameList[i]; if (tJianTouObject.JianTouName == _fullName + tJianTouObject.Key + tJianTouObject.Value) { tCurJianTouObject = tJianTouObject; if (getGUIBeginnerGuide() != null && !tJianTouObject.IsCloseGuide) { getGUIBeginnerGuide().HideArrowBootMode(); } else { GUIBeginnersGuide.Hide(); } key = tJianTouObject.Key; curStep = tJianTouObject.Value; if (curStep == TeachFinishedValue) { curStep = TeachFinishedValue - 1; nextStep = TeachFinishedValue; if (getGUIBeginnerGuide() != null) { if (tJianTouObject.IsCloseGuide) { getGUIBeginnerGuide().HideArrowBootMode(); } else { GUIBeginnersGuide.Hide(); } } } else if (curStep == TeachXunHuanValue) { NewWriteSaveData(key, 0); mJianTouNameList.RemoveAt(i); return; } else { nextStep = curStep + 1; } mJianTouNameList.RemoveAt(i); break; } } if (nextStep == 0 || curStep == 0) { return; } if (nextStep > curStep) { NewWriteSaveData(key, nextStep, tCurJianTouObject.IsSaveToServer); NewRefreshAllTeach(); } }