示例#1
0
 void ForgetPointOfInterestIfInactiveOrOnDifferentLayer()
 {
     if (currentPointOfInterest == null) { return; }
     if (!currentPointOfInterest.gameObject.activeInHierarchy) {
         currentPointOfInterest = null;
         return;
     }
     var layer = currentPointOfInterest.gameObject.layer;
     if (world.CurrentSlice.layer != layer) { currentPointOfInterest = null; }
 }
示例#2
0
 void OnTriggerEnter2D(Collider2D other)
 {
     var point = other.gameObject.GetComponent<PointOfInterest>();
     if (point == null) { return; }
     if (point.gameObject.layer != world.CurrentSlice.layer) { return; }
     currentPointOfInterest = point;
     SaveCameraLastAbsolutePosition();
 }
示例#3
0
 void OnTriggerExit2D(Collider2D other)
 {
     var point = other.gameObject.GetComponent<PointOfInterest>();
     if (point == null) { return; }
     if (point != currentPointOfInterest) { return; }
     currentPointOfInterest = null;
 }