Ejemplo n.º 1
0
        public MechJebModuleScriptActionWhile(MechJebModuleScript scriptModule, MechJebCore core, MechJebModuleScriptActionsList actionsList) : base(scriptModule, core, actionsList, NAME)
        {
            actions        = new MechJebModuleScriptActionsList(core, scriptModule, this, actionsList.getDepth() + 1);
            condition      = new MechJebModuleScriptCondition(scriptModule, core, this);
            sBorder        = new GUIStyle();
            sBorder.border = new RectOffset(1, 1, 1, 1);
            Texture2D background = new Texture2D(16, 16, TextureFormat.RGBA32, false);

            for (int x = 0; x < background.width; x++)
            {
                for (int y = 0; y < background.height; y++)
                {
                    if (x == 0 || x == 15 || y == 0 || y == 15)
                    {
                        background.SetPixel(x, y, Color.yellow);
                    }
                    else
                    {
                        background.SetPixel(x, y, Color.clear);
                    }
                }
            }
            background.Apply();
            sBorder.normal.background   = background;
            sBorder.onNormal.background = background;
            sBorder.padding             = new RectOffset(1, 1, 1, 1);
        }
        public MechJebModuleScriptActionIf(MechJebModuleScript scriptModule, MechJebCore core, MechJebModuleScriptActionsList actionsList) : base(scriptModule, core, actionsList, NAME)
        {
            actionsThen     = new MechJebModuleScriptActionsList(core, scriptModule, this, actionsList.getDepth() + 1);
            actionsElse     = new MechJebModuleScriptActionsList(core, scriptModule, this, actionsList.getDepth() + 1);
            condition       = new MechJebModuleScriptCondition(scriptModule, core, this);
            sBorderY        = new GUIStyle();
            sBorderY.border = new RectOffset(1, 1, 1, 1);
            sBorderG        = new GUIStyle();
            sBorderG.border = new RectOffset(1, 1, 1, 1);
            sBorderR        = new GUIStyle();
            sBorderR.border = new RectOffset(1, 1, 1, 1);
            Texture2D backgroundY = new Texture2D(16, 16, TextureFormat.RGBA32, false);
            Texture2D backgroundG = new Texture2D(16, 16, TextureFormat.RGBA32, false);
            Texture2D backgroundR = new Texture2D(16, 16, TextureFormat.RGBA32, false);

            for (int x = 0; x < backgroundY.width; x++)
            {
                for (int y = 0; y < backgroundY.height; y++)
                {
                    if (x == 0 || x == 15 || y == 0 || y == 15)
                    {
                        backgroundY.SetPixel(x, y, Color.yellow);
                        backgroundG.SetPixel(x, y, Color.green);
                        backgroundR.SetPixel(x, y, Color.red);
                    }
                    else
                    {
                        backgroundY.SetPixel(x, y, Color.clear);
                        backgroundG.SetPixel(x, y, Color.clear);
                        backgroundR.SetPixel(x, y, Color.clear);
                    }
                }
            }
            backgroundY.Apply();
            backgroundG.Apply();
            backgroundR.Apply();
            sBorderY.normal.background   = backgroundY;
            sBorderY.onNormal.background = backgroundY;
            sBorderG.normal.background   = backgroundG;
            sBorderG.onNormal.background = backgroundG;
            sBorderR.normal.background   = backgroundR;
            sBorderR.onNormal.background = backgroundR;
            sBorderY.padding             = new RectOffset(1, 1, 1, 1);
            sBorderG.padding             = new RectOffset(1, 1, 1, 1);
            sBorderR.padding             = new RectOffset(1, 1, 1, 1);
        }
Ejemplo n.º 3
0
 public MechJebModuleScriptActionWaitFor(MechJebModuleScript scriptModule, MechJebCore core, MechJebModuleScriptActionsList actionsList) : base(scriptModule, core, actionsList, NAME)
 {
     condition = new MechJebModuleScriptCondition(scriptModule, core, this);
 }