Exemplo n.º 1
0
 /// <inheritdoc/>
 public override void OnUpdate()
 {
     base.OnUpdate();
     if (showSetup)
     {
         var distToPart = Vector3.Distance(
             FlightGlobals.ActiveVessel.transform.position, part.transform.position);
         var setupEvent = PartModuleUtils.GetEvent(this, SetupEvent);
         if (setupEvent == null || distToPart > setupEvent.unfocusedRange)
         {
             showSetup = false;
         }
     }
     if (activated)
     {
         delay -= TimeWarp.deltaTime;
         if (delay < 1 && !sndTimeEnd.isPlaying)
         {
             sndTimeEnd.Play();
         }
         if (delay < 0)
         {
             sndTimeStart.Stop();
             sndTimeLoop.Stop();
             Explode(part.transform.position);
         }
     }
 }
Exemplo n.º 2
0
        void SetupEvents()
        {
            var e = PartModuleUtils.GetEvent(this, TestEvent);

            e.active = true; // Activates the event.
        }