Exemple #1
0
 public void RollingStockListener(Collider collider)
 {
     if (collider.CompareTag("Engine"))
     {
         HitEngine = collider.GetComponent <Engine> ();
         if (!HitEngine.IsPlayer)
         {
             TempEngine          = PlayerEngine;
             TempEngine.IsPlayer = false;
             //set outlines
             TempEngine.EngineRS.Model.DefaultOutline();
             PlayerEngine          = HitEngine;
             PlayerEngine.IsActive = true;
             PlayerEngine.IsPlayer = true;
             ccc.Target            = PlayerEngine.EngineRS;
             ccc.UpdateCameraTarget();
             IndicationManager.Instance.engine = PlayerEngine;
             SetPlayerEngineInComposition();
         }
         SetViewer(PlayerEngine.EngineRS);
         PlayerEngine.EngineRS.Model.HighLightEngineOutline();
         if (tempRollingStock != null)
         {
             tempRollingStock.Model.DefaultOutline();
             tempRollingStock = null;
         }
         EventManager.EngineChanged();
     }
     else if (collider.CompareTag("RollingStock"))
     {
         rollingStock = collider.GetComponent <RollingStock> ();
         SetViewer(rollingStock);
         if (tempRollingStock != null && !tempRollingStock.Equals(rollingStock))
         {
             tempRollingStock.Model.DefaultOutline();
         }
         tempRollingStock = rollingStock;
     }
 }