using vnxbqy.UI; using System.Collections; using System.Collections.Generic; using UnityEngine; public class TaskType : MonoBehaviour { [SerializeField] List MysteriousTaskID = new List(); TaskModel m_TaskModel; TaskModel taskmodel { get { return m_TaskModel ?? (m_TaskModel = ModelCenter.Instance.GetModel()); } } public bool m_TypeBool = true; public int TaskID = 0; void Start() { } void Update() { } public void IsMysteriousTask() { if (MysteriousTaskID.Contains(TaskID)) { if (this.gameObject.GetComponent() != null) { this.gameObject.GetComponent().IdList = new int[]{104 }; this.gameObject.GetComponent().Z_UnLockType = FunctionUnlockType.Normal; FunctionUnlockFlyObjectTargetCenter.Register(FunctionUnlockType.Normal, new int[] { 104 }, this.gameObject.GetComponent()); } else { FunctionUnlockFlyObjectTarget functionUnlockFlyObjectTarget = this.gameObject.AddComponent(); functionUnlockFlyObjectTarget.IdList= new int[] { 104 }; functionUnlockFlyObjectTarget.Z_UnLockType = FunctionUnlockType.Normal; FunctionUnlockFlyObjectTargetCenter.Register(FunctionUnlockType.Normal, new int[] { 104 }, functionUnlockFlyObjectTarget); } } else { if (this.gameObject.GetComponent() != null) { DestroyObject(this.gameObject.GetComponent()); } } } public void IsGameObjectName(int TaskID) { if (taskmodel.allMissionDict.ContainsKey(TaskID)) { switch (taskmodel.allMissionDict[TaskID].Type) { case 0://主线 this.gameObject.name = "Main_" + TaskID; break; case 1://支线 case 2: case 4: case 5: case 17: this.gameObject.name = "Branch_" + TaskID; break; case 3://本源法宝 this.gameObject.name = "SourceFB_" + TaskID; break;//成就任务 case 15: this.gameObject.name = "Achievement_" + TaskID; break; case 6://赏金 case 7: case 8: case 9: case 10: this.gameObject.name = "MoneyReward_" + TaskID; break; case 11://仙盟 case 12: this.gameObject.name = "FairyAu_" + TaskID; break; } } } public void ClearTaskName() { this.gameObject.name = "Task_PoolObject"; } }