private void AddShowObjTaskList(int index, CTaskManagerData taskData)
        {
            int showTaskId = taskData.SonTaskIdSet.ElementAt(index);
            CGameObjectShowTask showTask = ConfigReader.GetObjShowTaskInfo(showTaskId);
            bool show = showTask.EndShow == 1? true:false;

            if (showObjDic.ContainsKey(showTask.Path))
            {
                ShowObjInfo info = showObjDic[showTask.Path];
                info.show = show;
                showObjDic[showTask.Path] = info;
            }
            else
            {
                ShowObjInfo info = new ShowObjInfo();
                info.show   = show;
                info.TaskId = showTaskId;
                showObjDic.Add(showTask.Path, info);
            }
        }
        private void ShowObj()
        {
            for (int i = 0; i < showObjDic.Count; i++)
            {
                int taskId = showObjDic.ElementAt(i).Value.TaskId;
                CGameObjectShowTask showTask = ConfigReader.GetObjShowTaskInfo(taskId);
                if (showTask == null)
                {
                    Debug.LogError("GuideShowObjTask 找不到任務 Id" + taskId);
                }
                Transform btnParent = null;
                switch (showTask.PathType)
                {
                case UIPathType.UIGuideType:
                    if (UINewsGuide.Instance != null)
                    {
                        btnParent = UINewsGuide.Instance.transform;
                    }
                    break;

                case UIPathType.UIPlayType:
//                         if (UIPlay.Instance != null)
//                         {
//                             btnParent = UIPlay.Instance.transform;
//                         }
                    break;
                }
                if (btnParent == null)
                {
                    Debug.LogError("GuideShowObjTask = " + taskId + "挂点不存在");
                }
                GameObject objShow = btnParent.Find(showTask.Path).gameObject;
                if (objShow == null)
                {
                    Debug.LogError("GuideShowObjTask 找不到物體 Id" + taskId);
                }
                objShow.SetActive(showObjDic.ElementAt(i).Value.show);
                //  Debug.LogError("objShow = " + objShow.name + "value = " + showObjDic.ElementAt(i).Value.show);
            }
        }
예제 #3
0
        public GuideShowObjTask(int task, GuideTaskType type, GameObject mParent)
            : base(task, type, mParent)
        {
            //读取数据
            showTask = ConfigReader.GetObjShowTaskInfo(task);
            if (showTask == null)
            {
                Debug.LogError("GuideShowObjTask 找不到任務 Id" + task);
            }
            Transform btnParent = null;

            switch (showTask.PathType)
            {
            case UIPathType.UIGuideType:
                if (UINewsGuide.Instance != null)
                {
                    btnParent = UINewsGuide.Instance.transform;
                }
                break;

            case UIPathType.UIPlayType:
//                     if (UIPlay.Instance != null)
//                     {
//                         btnParent = UIPlay.Instance.transform;
//                     }
                break;
            }
            if (btnParent == null)
            {
                Debug.LogError("GuideShowObjTask = " + task + "挂点不存在");
            }
            objShow = btnParent.Find(showTask.Path).gameObject;
            if (objShow == null)
            {
                Debug.LogError("GuideShowObjTask 找不到物體 Id" + task);
            }
        }