public void Show() { if (GuideEnabled && !showing) { Debug.Log("Current Step:" + GuideManagerData.CurrentStep); showing = true; var guide = Instantiate(Resources.Load <GameObject>(GuidePrefab), GameObject.Find("Canvas").transform); guideController = guide.GetComponent <GuideController>(); var path = string.Format("{0}/{1}", LoadRelativePath, GuideManagerData.CurrentGuideLevelData.GuideDataPath); guideController.GuideText = Instantiate(Resources.Load(path)) as TextAsset; guideController.Generate(); var customControllerName = string.Format("{0}Controller", guideController.name); var customControllerType = Type.GetType(string.Format("{0}, Assembly-CSharp", customControllerName)); if (customControllerType != null) { guideCustomController = guideController.gameObject.AddComponent(customControllerType) as GuideCustomInterface; } guideController.name = string.Format("Level {0} Step {1}", GuideManagerData.CurrentLevel, GuideManagerData.CurrentStep); GuideManagerData.CurrentGuideData = guideController.GuideData; GameMainManager.Instance.netManager.MakePointInGuide(LevelLoader.instance.level, GuideManagerData.CurrentStep, (ret, res) => { }); } }
private void Initialize() { guideController = null; guideCustomController = null; showing = false; GuideManagerData.CurrentStep = 1; }