コード例 #1
0
 private void TryTurnOn(CompanionSphere.Companion companion)
 {
     if (!turnOnSequenceActive)
     {
         Add(new Coroutine(TurnOnSequence(companion)));
     }
 }
コード例 #2
0
 private IEnumerator TurnOnSequence(CompanionSphere.Companion companion)
 {
     turnOnSequenceActive = true;
     companion.RunUseCoroutine(Center);
     while (!companion.Activated && companion.Activating)
     {
         yield return(null);
     }
     if (!switchComponent.Activated && companion.Activated)
     {
         companion.Slot   = this;
         slottedCompanion = companion;
         Add(new SoundSource("event:/game/general/touchswitch_any"));
         if (Activate())
         {
             SoundEmitter.Play("event:/game/general/touchswitch_last_oneshot");
             Add(new SoundSource("event:/game/general/touchswitch_last_cutoff"));
         }
     }
     turnOnSequenceActive = false;
 }
コード例 #3
0
 public void Deactivate()
 {
     turnOnSequenceActive = false;
     slottedCompanion     = null;
     switchComponent.Deactivate();
 }