Ejemplo n.º 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; }
 }
Ejemplo n.º 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();
 }
Ejemplo n.º 3
0
 void OnTriggerExit2D(Collider2D other)
 {
     var point = other.gameObject.GetComponent<PointOfInterest>();
     if (point == null) { return; }
     if (point != currentPointOfInterest) { return; }
     currentPointOfInterest = null;
 }