예제 #1
0
 public RangeIntersectionCalculator(RangeObjectV2 RangeObject, CoreInteractiveObject TrackedInteractiveObject)
 {
     this.AssociatedRangeObject                 = RangeObject;
     this.TrackedInteractiveObject              = TrackedInteractiveObject;
     this.sightModuleMovementChangeTracker      = new BlittableTransformChangeListenerManager(true, true);
     this.inRangeCollidersMovementChangeTracker = new BlittableTransformChangeListenerManager(true, true);
     this.RangeIntersectionCalculatorV2UniqueID = _rangeIntersectionCalculatorManager.OnRangeIntersectionCalculatorV2ManagerCreation(this);
     RangeIntersectionCalculationManagerV2.ManualCalculation(new List <RangeIntersectionCalculator>()
     {
         this
     }, forceCalculation: true);
 }
예제 #2
0
        public void GizmoTick()
        {
#if UNITY_EDITOR
            if (Application.isPlaying)
            {
                foreach (var RangeIntersectionCalculatorV2 in this.AllRangeIntersectionCalculatorV2)
                {
                    RangeIntersectionCalculationManagerV2.Get().TryGetRangeintersectionResult(RangeIntersectionCalculatorV2, out bool isInsideRange);
                    Color lineColor = isInsideRange ? Color.green : Color.red;
                    var   oldColor  = Handles.color;
                    Handles.color = lineColor;
                    Handles.DrawLine(RangeIntersectionCalculatorV2.GetAssociatedRangeObject().GetTransform().WorldPosition, RangeIntersectionCalculatorV2.TrackedInteractiveObject.InteractiveGameObject.GetTransform().WorldPosition);
                    Handles.color = oldColor;
                }
            }
#endif
        }