Пример #1
0
	void AddStrategy(AgentStrategy strategy)
	{
		strategyList.Add(strategy);
		strategy.actor = actor;
		strategy.source = actor.transform;
	}
Пример #2
0
	void Reevaluate(float deltaTime)
	{

		if( reevaluateTimer.Tick(deltaTime) )
		{
			strategy = null;
		}
		if( strategy == null )
		{
			int bestGoodness = -100;
			Scan(0, true);
			for(int i=0; i<strategyList.Count; ++i)
			{
				int goodness = strategyList[i].GetGoodness();
				if( goodness > bestGoodness )
				{
					strategy = strategyList[i];
					bestGoodness = goodness;
				}
			}
			Decide(0,true);

		}
	}