public override void Process(CyclopsDecoyLaunch decoyLaunchPacket) { GameObject cyclops = GuidHelper.RequireObjectFrom(decoyLaunchPacket.Guid); CyclopsDecoyManager decoyManager = cyclops.RequireComponent <CyclopsDecoyManager>(); using (packetSender.Suppress <CyclopsChangeSilentRunning>()) { decoyManager.Invoke("LaunchWithDelay", 3f); decoyManager.decoyLaunchButton.UpdateText(); decoyManager.subRoot.voiceNotificationManager.PlayVoiceNotification(decoyManager.subRoot.decoyNotification, false, true); decoyManager.subRoot.BroadcastMessage("UpdateTotalDecoys", decoyManager.decoyCount, SendMessageOptions.DontRequireReceiver); CyclopsDecoyLaunchButton decoyLaunchButton = cyclops.RequireComponent <CyclopsDecoyLaunchButton>(); decoyLaunchButton.StartCooldown(); } }
public void LaunchDecoy(NitroxId id) { GameObject cyclops = NitroxEntity.RequireObjectFrom(id); CyclopsDecoyManager decoyManager = cyclops.RequireComponent <CyclopsDecoyManager>(); using (packetSender.Suppress <CyclopsChangeSilentRunning>()) { decoyManager.Invoke(nameof(CyclopsDecoyManager.LaunchWithDelay), 3f); decoyManager.decoyLaunchButton.UpdateText(); decoyManager.subRoot.voiceNotificationManager.PlayVoiceNotification(decoyManager.subRoot.decoyNotification, false, true); decoyManager.subRoot.BroadcastMessage("UpdateTotalDecoys", decoyManager.decoyCount, SendMessageOptions.DontRequireReceiver); CyclopsDecoyLaunchButton decoyLaunchButton = cyclops.RequireComponent <CyclopsDecoyLaunchButton>(); decoyLaunchButton.StartCooldown(); } }