Exemple #1
0
    void Awake()
    {
        systems          = GetComponentsInChildren <ShipSystem> ();
        autoWeaponSystem = GetComponentInChildren <AutoWeaponSystem> ();
        flightSystem     = GetComponentInChildren <FlightSystem> ();
        detectionSystem  = GetComponentInChildren <DetectionSystem> ();
        cargoSystem      = GetComponentInChildren <CargoSystem> ();
        tradeSystem      = GetComponentInChildren <TradeSystem> ();
        if (flightSystem != null)
        {
            flightSystem.MyBody = GetComponent <Rigidbody> ();            // Ужас!
        }

        if (detectionSystem != null && autoWeaponSystem != null)
        {
            autoWeaponSystem.SubscribeToDetectionSystem(detectionSystem);
        }
        if (tradeSystem != null && cargoSystem != null)
        {
            tradeSystem.SubscribeToCargoSystem(cargoSystem);
        }
    }
Exemple #2
0
 public void SubscribeToCargoSystem(CargoSystem cargoSystem)
 {
     this.cargoSystem = cargoSystem;
 }