Ejemplo n.º 1
0
    /// <summary>
    /// 任务接口实现对象的加载函数
    /// </summary>
    partial void Load_INowTaskState()
    {
        iGameState         = GameState.Instance.GetEntity <IGameState>();
        iInteractiveState  = GameState.Instance.GetEntity <IInteractiveState>();
        iNowTaskStateEvent = GameState.Instance.GetEntity <INowTaskStateEvent>();
        //metaTasksData = DataCenter.Instance.GetMetaData<MetaTasksData>();
        //当前可以做的任务,包括正在做的和可以接取的
        List <TaskMap.RunTimeTaskInfo> todoList = runtimeTaskData.GetAllToDoList();

        //从中将其分类
        runTimeTaskInfos_Start = todoList.Where(temp => temp.IsStart).ToList();
        runTimeTaskInfos_Wait  = todoList.Where(temp => !temp.IsStart).ToList();
        //将正在做的任务分类(方便检测)
        checkPostionRunTimeDic = new Dictionary <int, TaskMap.RunTimeTaskInfo>();
        checkNPCRunTimeDic     = new Dictionary <int, TaskMap.RunTimeTaskInfo>();
        checkMonsterRunTimeDic = new Dictionary <int, TaskMap.RunTimeTaskInfo>();
        checkGoodsRunTimeDic   = new Dictionary <int, TaskMap.RunTimeTaskInfo>();
        checkSpecialRunTimeDic = new Dictionary <int, TaskMap.RunTimeTaskInfo>();
        runTimeTaskInfos_Start.ForEach(temp => SetStartTaskCheckClassify(temp));
        //触发事件
        foreach (TaskMap.RunTimeTaskInfo runTimeTaskInfo in todoList)
        {
            iNowTaskStateEvent.TriggeringEvents(runTimeTaskInfo);
        }
    }
Ejemplo n.º 2
0
    void Start()
    {
        sceneStateData     = DataCenter.Instance.GetEntity <SceneStateDatas>();
        iGameState         = GameState.Instance.GetEntity <IGameState>();
        iNowTaskStateEvent = GameState.Instance.GetEntity <INowTaskStateEvent>();
        object data = sceneStateData.GetData(StateID, iGameState.SceneName);

        if (data == null || !data.GetType().Equals(typeof(bool)))
        {
            doorState = false;
        }
        else
        {
            doorState = (bool)data;
        }
        //注册
        iNowTaskStateEvent.RegistTaskEvent(TaskMap.Enums.EnumTaskEventType.Trigger, EventTriggerCallBack);
        if (doorState)
        {
            OpenDoor();
        }
    }