コード例 #1
0
 public void AddFailedDestination(Vector3 destination)
 {
     for (int index = 0; index < this._failedDestinationMemory.Count; ++index)
     {
         BaseNpcMemory.FailedDestinationInfo failedDestinationInfo = this._failedDestinationMemory[index];
         Vector3 vector3 = Vector3.op_Subtraction(failedDestinationInfo.Destination, destination);
         if ((double)((Vector3) ref vector3).get_sqrMagnitude() <= 0.100000001490116)
         {
             failedDestinationInfo.Time           = Time.get_time();
             this._failedDestinationMemory[index] = failedDestinationInfo;
             return;
         }
     }
     this._failedDestinationMemory.Add(new BaseNpcMemory.FailedDestinationInfo()
     {
         Time        = Time.get_time(),
         Destination = destination
     });
 }
コード例 #2
0
        public void AddFailedDestination(Vector3 destination)
        {
            for (int i = 0; i < this._failedDestinationMemory.Count; i++)
            {
                BaseNpcMemory.FailedDestinationInfo item = this._failedDestinationMemory[i];
                if ((item.Destination - destination).sqrMagnitude <= 0.1f)
                {
                    item.Time = Time.time;
                    this._failedDestinationMemory[i] = item;
                    return;
                }
            }
            List <BaseNpcMemory.FailedDestinationInfo> failedDestinationInfos = this._failedDestinationMemory;

            BaseNpcMemory.FailedDestinationInfo failedDestinationInfo = new BaseNpcMemory.FailedDestinationInfo()
            {
                Time        = Time.time,
                Destination = destination
            };
            failedDestinationInfos.Add(failedDestinationInfo);
        }