private void TryTurnOn(CompanionSphere.Companion companion) { if (!turnOnSequenceActive) { Add(new Coroutine(TurnOnSequence(companion))); } }
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; }
public void Deactivate() { turnOnSequenceActive = false; slottedCompanion = null; switchComponent.Deactivate(); }