コード例 #1
0
        void comButtonClick()
        {
            if (RCSBuildAid.Enabled)
            {
                /* plugin enabled, CoM button is for toggle marker visibility */
                bool visible = !CoM.GetComponent <MarkerVisibility> ().GeneralToggle;
                CoM.GetComponent <MarkerVisibility> ().GeneralToggle  = visible;
                DCoM.GetComponent <MarkerVisibility> ().GeneralToggle = visible;
                ACoM.GetComponent <MarkerVisibility> ().GeneralToggle = visible;

                /* we need the CoM to remain active, but we can't stop the editor from
                 * deactivating it when the CoM toggle button is used, so we toggle it now so is
                 * toggled again by the editor. That way it will remain active. */

                Log.Info("comButtonClick, setting to: " + !CoM.activeInHierarchy);
                CoM.SetActive(!CoM.activeInHierarchy);
            }

            if (!RCSBuildAid.Enabled)
            {
                /* restore CoM visibility, so the regular CoM toggle button works. */
                var markerVisibility = CoM.GetComponent <MarkerVisibility> ();
                if (markerVisibility != null)
                {
                    markerVisibility.Show();
                }
            }
        }
コード例 #2
0
 void activateMarkers(bool value)
 {
     Log.Info("activateMarkers, setting to: " + value);
     CoM.SetActive(value);
     DCoM.SetActive(value);
     ACoM.SetActive(value);
 }
コード例 #3
0
        void comButtonClick()
        {
            bool markerEnabled = !CoM.activeInHierarchy; /* toggle com */

            if (userEnable)
            {
                bool visible = !CoM.GetComponent <MarkerVisibility> ().GeneralToggle;
                CoM.GetComponent <MarkerVisibility> ().GeneralToggle  = visible;
                DCoM.GetComponent <MarkerVisibility> ().GeneralToggle = visible;
                ACoM.GetComponent <MarkerVisibility> ().GeneralToggle = visible;

                /* we need the CoM to remain active, but we can't stop the editor from
                 * deactivating it when the CoM toggle button is used, so we toggle it now so is
                 * toggled again by the editor. That way it will remain active. */
                CoM.SetActive(markerEnabled);
            }

            if (!userEnable && markerEnabled)
            {
                /* restore CoM visibility, so the regular CoM toggle button works. */
                var markerVisibility = CoM.GetComponent <MarkerVisibility> ();
                if (markerVisibility != null)
                {
                    markerVisibility.Show();
                }
            }
        }
コード例 #4
0
 void activateMarkers(bool value)
 {
     CoM.SetActive(value);
     DCoM.SetActive(value);
     ACoM.SetActive(value);
     if (value && (RCSBuildAid.Mode == PluginMode.Parachutes))
     {
         CoD.SetActive(true);
     }
     else
     {
         CoD.SetActive(false);
     }
 }
コード例 #5
0
        public static void SetActive(bool enabled)
        {
            userEnable = enabled;
            CoM.SetActive(enabled);
            DCoM.SetActive(enabled);
            ACoM.SetActive(enabled);

            if (enabled)
            {
                events.OnPluginEnabled(true);
            }
            else
            {
                events.OnPluginDisabled(true);
            }
        }
コード例 #6
0
ファイル: RCSBuildAid.cs プロジェクト: zajc3w/RCSBuildAid
        public static void SetActive(bool value)
        {
            userEnable = value;
            CoM.SetActive(value);
            DCoM.SetActive(value);
            ACoM.SetActive(value);

            if (value)
            {
                Events.OnPluginEnabled(true);
            }
            else
            {
                Events.OnPluginDisabled(true);
            }
            Events.OnPluginToggled(value, true);
        }
コード例 #7
0
        public static void SetActive(bool value)
        {
            Log.Info("SetActive, setting to: " + value);
            userEnable = value;
            CoM.SetActive(value);
            DCoM.SetActive(value);
            ACoM.SetActive(value);

            if (value)
            {
                Events.OnPluginEnabled(true);
            }
            else
            {
                Events.OnPluginDisabled(true);
            }
            Events.OnPluginToggled(value, true);
        }
コード例 #8
0
        void setSoftActive(bool enabled)
        {
            /* for disable the plugin temporally without changing what the user set */
            softEnable = enabled;
            bool pluginEnabled = Enabled;

            CoM.SetActive(pluginEnabled);
            DCoM.SetActive(pluginEnabled);
            ACoM.SetActive(pluginEnabled);
            if (pluginEnabled)
            {
                events.OnPluginEnabled(false);
            }
            else
            {
                events.OnPluginDisabled(false);
            }
        }
コード例 #9
0
ファイル: RCSBuildAid.cs プロジェクト: zajc3w/RCSBuildAid
        void setSoftActive(bool value)
        {
            /* for disable the plugin temporally without changing what the user set */
            softEnable = value;
            bool pluginEnabled = Enabled;

            CoM.SetActive(pluginEnabled);
            DCoM.SetActive(pluginEnabled);
            ACoM.SetActive(pluginEnabled);
            if (pluginEnabled)
            {
                Events.OnPluginEnabled(false);
            }
            else
            {
                Events.OnPluginDisabled(false);
            }
            Events.OnPluginToggled(value, false);
        }
コード例 #10
0
ファイル: MarkerManager.cs プロジェクト: zajc3w/RCSBuildAid
 void activateMarkers(bool value)
 {
     CoM.SetActive(value);
     DCoM.SetActive(value);
     ACoM.SetActive(value);
 }