Esempio n. 1
0
 /// <summary>
 /// 怪物集合的开始方法
 /// 用于注册场景切换
 /// </summary>
 partial void Start_IMonsterCollection()
 {
     thisSceneCanCheckMonsterObjList = new List <GameObject>();
     allMonsterObjDic           = new Dictionary <MonsterDataInfo, List <GameObject> >();
     runTaskStruct_CheckMonster = TaskTools.Instance.GetRunTaskStruct();
     GameState.Instance.Registor <IGameState>(IGameStateChanged_In_IMonsterCollection);
 }
Esempio n. 2
0
    /// <summary>
    /// 获取一个任务
    /// </summary>
    /// <returns></returns>
    public RunTaskStruct GetRunTaskStruct()
    {
        RunTaskStruct.RunTaskStructHandle runTaskStructHandle = null;
        RunTaskStruct runTaskStruct = new RunTaskStruct(nextID++, (handle) => runTaskStructHandle = handle);

        if (runTaskStructHandle != null)
        {
            taskHandleDic.Add(runTaskStruct, runTaskStructHandle);
            runTaskStructHandle.runTaskStateAction = RunTaskState;
        }
        taskDic.Add(runTaskStruct.id, runTaskStruct);
        return(runTaskStruct);
    }
Esempio n. 3
0
 public void Start()
 {
     npcIDToTalkShowStructDic = new Dictionary <int, TalkShowStruct>();
     npcIDToShowObjDic        = new Dictionary <int, GameObject>();
     GameState.Instance.Registor <INowTaskState>(INowTaskStateChanged);
     iGameState         = GameState.Instance.GetEntity <IGameState>();
     iPlayerState       = GameState.Instance.GetEntity <IPlayerState>();
     blackTexture       = Resources.Load <Texture2D>("Sprites/black");
     dialogueStructData = DataCenter.Instance.GetMetaData <DialogueStructData>();
     talkShowExplanObj  = Resources.Load <GameObject>("UI/NPCTalkCanvas");
     npcData            = DataCenter.Instance.GetMetaData <NPCData>();
     //获取一个执行任务过程对象
     runTaskStruct = TaskTools.Instance.GetRunTaskStruct();
 }
Esempio n. 4
0
 /// <summary>
 /// 运行任务的状态
 /// </summary>
 /// <param name="target">运行任务的对象</param>
 /// <param name="state">设置任务的状态</param>
 private void RunTaskState(RunTaskStruct target, bool state)
 {
     if (state)
     {
         if (!taskList.Contains(target))
         {
             taskList.Add(target);
         }
     }
     else
     {
         taskList.Remove(target);
     }
 }
Esempio n. 5
0
    /// <summary>
    /// 移除指定的任务
    /// 可以直接传入任务对象
    /// </summary>
    /// <param name="id">任务的id</param>
    public void RemoveRunTaskStruct(int id)
    {
        if (id < 0 || !taskDic.ContainsKey(id))
        {
            return;
        }
        RunTaskStruct runTaskStruct = taskDic[id];

        taskDic.Remove(id);
        if (taskHandleDic.ContainsKey(runTaskStruct))
        {
            taskHandleDic.Remove(runTaskStruct);
        }
        taskList.Remove(runTaskStruct);
    }
Esempio n. 6
0
 public void Start()
 {
     Instance      = this;
     runTaskStruct = TaskTools.Instance.GetRunTaskStruct();
 }
 /// <summary>
 /// 伤害状态接口实现对象的的还是函数
 /// </summary>
 partial void Start_IDamageState()
 {
     runTaskStruct_Charge       = TaskTools.Instance.GetRunTaskStruct();
     runTaskStruct_NormalAttack = TaskTools.Instance.GetRunTaskStruct();
 }
Esempio n. 8
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="target">目标</param>
 public RunTaskStructHandle(RunTaskStruct target)
 {
     this.target = target;
 }