public void LaunchRocket(bool autoFocus)
        {
            ushort eventID = m_currentEventID;

            Singleton <SimulationManager> .instance.AddAction(delegate
            {
                // The original code contains the method for auto focusing, so the detour is needed only when "AutoFocus" is not checked.
                if (!autoFocus)
                {
                    RocketLaunchAIDetour.Deploy();
                }

                rocketLaunchAI.Activate(eventID, ref Singleton <EventManager> .instance.m_events.m_buffer[eventID]);

                if (!autoFocus)
                {
                    RocketLaunchAIDetour.Revert();
                }
            });
        }
Example #2
0
 public override void OnReleased()
 {
     base.OnReleased();
     RocketLaunchAIDetour.Revert();
 }
Example #3
0
 public override void OnCreated(ILoading loading)
 {
     base.OnCreated(loading);
     RocketLaunchAIDetour.Deploy();
 }