コード例 #1
0
        public void RegistThinkCondition(List <int> conditionIDs)
        {
            for (int i = 0; i < conditionIDs.get_Count(); i++)
            {
                Condition condition = DataReader <Condition> .Get(conditionIDs.get_Item(i));

                if (condition != null)
                {
                    if (condition.occasion != 0)
                    {
                        if (!this.conditionTable.ContainsKey((ConditionType)condition.occasion))
                        {
                            this.conditionTable.Add((ConditionType)condition.occasion, new List <ConditionItem>());
                        }
                        ThinkConditionItem thinkConditionItem = new ThinkConditionItem();
                        thinkConditionItem.conditionData     = condition;
                        thinkConditionItem.isUseTriggerTimes = (condition.count != 0);
                        thinkConditionItem.leftTimes         = condition.count;
                        this.conditionTable.get_Item((ConditionType)condition.occasion).Add(thinkConditionItem);
                    }
                }
            }
        }
コード例 #2
0
 protected void TriggerThinkCondition(ThinkConditionItem item)
 {
     this.owner.LastTriggerConditionMessage = item;
     this.owner.LastTriggerConditionID      = item.conditionData.conditionId;
     this.owner.GetAIManager().TryThink();
 }