Ejemplo n.º 1
0
        public override float GetScore(BaseContext c)
        {
            object obj;

            if (IsRoamReady.Evaluate(c))
            {
                obj = 1;
            }
            else
            {
                obj = null;
            }
            return((float)obj);
        }
 public static void NavigateToTopologyPreference(BaseContext c)
 {
     if (IsRoamReady.Evaluate(c) && c.AIAgent.IsNavRunning())
     {
         if (NavigateToOperator.NavigateInDirOfBestSample(c, NavPointSampler.SampleCount.Eight, 4f, NavPointSampler.SampleFeatures.DiscourageSharpTurns | NavPointSampler.SampleFeatures.TopologyPreference | NavPointSampler.SampleFeatures.RangeFromSpawn, c.AIAgent.GetStats.MinRoamRange, c.AIAgent.GetStats.MaxRoamRange))
         {
             float maxRoamDelay = c.AIAgent.GetStats.MaxRoamDelay - c.AIAgent.GetStats.MinRoamDelay;
             float single       = UnityEngine.Random.@value * maxRoamDelay / maxRoamDelay;
             float single1      = c.AIAgent.GetStats.RoamDelayDistribution.Evaluate(single) * maxRoamDelay;
             c.NextRoamTime = Time.realtimeSinceStartup + c.AIAgent.GetStats.MinRoamDelay + single1;
             return;
         }
         NavigateToOperator.NavigateToRandomLoc(c);
     }
 }
Ejemplo n.º 3
0
 public static void NavigateToRandomLoc(BaseContext c)
 {
     if (!IsRoamReady.Evaluate(c) || !c.AIAgent.IsNavRunning())
     {
         return;
     }
     if (NavigateToOperator.NavigateInDirOfBestSample(c, NavPointSampler.SampleCount.Eight, 4f, NavPointSampler.SampleFeatures.DiscourageSharpTurns | NavPointSampler.SampleFeatures.RangeFromSpawn, c.AIAgent.GetStats.MinRoamRange, c.AIAgent.GetStats.MaxRoamRange))
     {
         float num1 = c.AIAgent.GetStats.MaxRoamDelay - c.AIAgent.GetStats.MinRoamDelay;
         float num2 = Random.get_value() * num1 / num1;
         float num3 = c.AIAgent.GetStats.RoamDelayDistribution.Evaluate(num2) * num1;
         c.NextRoamTime = Time.get_realtimeSinceStartup() + c.AIAgent.GetStats.MinRoamDelay + num3;
     }
     else
     {
         NavigateToOperator.NavigateToSpawn(c);
     }
 }