IEnumerator StartAction(GuideData guideData, Interactable interactable) { Interactable.isLock = true; yield return(new WaitForSeconds((float)guideData.delay)); if (interactable != null) { interactable.isIgnoreLock = true; } onProcess(curData, interactable); }
public void Init(int progress, GuideDataConfig config, Action <GuideData, Interactable> onProcess, Action <GuideData> onExecutedComplate) { this.config = config; this.onProcess = onProcess; this.onExecutedComplate = onExecutedComplate; //取得新手引导的配置文件转化成可用数据结构 //判断是否开启新手引导(curData为null时就没有开启新手引导) //设置currData curData = config.SetProgress(progress); if (curData != null) { curData.delay = 0; UnityEngine.Debug.Log("启用新手引导:" + curData.progress.ToString()); } }
/// <summary> /// 执行了点击或者滑动等可交互控件的行为 /// </summary> /// <param name="id"></param> public void Executed(Interactable interactable) { if (!enable) { return; } UnityEngine.Debug.Log("执行交互:" + interactable.id); if (curData.interact_id == interactable.id) { onExecutedComplate(curData); Interactable.isLock = false; interactable.isIgnoreLock = false; curData = config.next; Process(); } }