public void InitTaskInfo(int taskId, int times, int mathches)
        {
            sTaskId   = taskId;
            sTimes    = times;
            sMathches = mathches;
            data      = ConfigReader.GetGuideHelpInfo(sTaskId);
            switch (taskId)
            {
            case 20001:    //cp enough to buy
                curCheckBase = new SecondaryTaskCpEnoughCheck();
                break;

            case 20002:    //hp less back to city
                curCheckBase = new SecondaryTaskHpLessCheck();
                break;

            case 20003:
                curCheckBase = new SecondaryTaskFullFuryCheck();
                break;

            case 20004:
                curCheckBase = new SecondaryTaskOpenShopCheck();
                break;

            default:
                GameMethod.DebugError("Secondary task not define");
                break;
            }
            if (curCheckBase != null)
            {
                curCheckBase.OnEnter(this);
            }
        }
        public void InitFinishTask(int task, int matches)
        {
            GuideHelpData data = ConfigReader.GetGuideHelpInfo(task);

            if (data == null || data.helpMatches <= matches)
            {
                return;
            }
            if (taskDic.ContainsKey(task))
            {
                GameMethod.DebugError("secondary guide repeat");
                return;
            }
            SecondaryTaskInfo taskInfo = new SecondaryTaskInfo();

            taskInfo.InitTaskInfo(task, 0, matches);
            taskDic.Add(task, taskInfo);
        }
예제 #3
0
        public void OnEnter()
        {
            objParent = SecondaryGuideManager.Instance.CreateParentPrefab();

            if (objParent == null)
            {
                GameMethod.DebugError("secondary effect ui parent is null");
                return;
            }
            for (int i = 0; i < helpData.helpObjPathList.Count; i++)
            {
                string     path = helpData.helpObjPathList.ElementAt(i);
                GameObject obj  = objParent.transform.Find(path).gameObject;
                obj.SetActive(true);
                objList.Add(obj);
            }
            timeStart = DateTime.Now;
            isCheck   = true;
        }
예제 #4
0
        //
        public void initAreaCircle()
        {
            //if (SceneGuideTaskManager.Instance().IsNewsGuide() == SceneGuideTaskManager.SceneGuideType.NoGuide)
            //    return;
            if (RealEntity == null)
            {
                return;
            }

            if (CircleArea == null)
            {
                string path = GameConstDefine.LoadGameOtherEffectPath;
                //GameObject obj = Resources.Load(path + "guangquan_fanwei") as GameObject;
                ResourceUnit objUnit = ResourcesManager.Instance.loadImmediate(path + "guangquan_fanwei", ResourceType.PREFAB);
                GameObject   obj     = objUnit.Asset as GameObject;

                if (obj == null)
                {
                    GameMethod.DebugError("CircleArea obj null");
                    return;
                }

                //root = GameObject.Instantiate (obj) as GameObject;
                CircleArea = GameObject.Instantiate(obj) as GameObject;
                CircleArea.transform.parent   = RealEntity.GetTransform();
                CircleArea.transform.position = RealEntity.GetTransform().position + new Vector3(0.0f, 0.2f, 0.0f);
                EventCenter.AddListener(EGameEvent.eGameEvent_LocalPlayerRange, UpdataRange);
                CircleArea.transform.localRotation = Quaternion.Euler(new Vector3(0.0f, 0.0f, 0.0f));
            }
            CapsuleCollider capsule = RealEntity.GetComponent <CapsuleCollider>();

            if (capsule)
            {
                capsule.enabled = false;
            }
        }