Ejemplo n.º 1
0
        private void TestControls()
        {
            GUILayout.BeginArea(new Rect(10, 10, 200, 300));
            GUILayout.BeginHorizontal("box");

            if (_ropeEntity != null)
            {
                _ropeEntity.ElasticModulus = GUILayout.HorizontalScrollbar(_ropeEntity.ElasticModulus, 0.02F, 0.12F, 1.2F, GUILayout.Width(100));
                GUILayout.Label(string.Format("Elastic Modulus: {0}", Mathf.Round(_ropeEntity.ElasticModulus * 100f) / 100f));
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal("box");
            if (GUILayout.Button("Create object"))
            {
                PrimitiveType primitive = PrimitiveType.Cube;
                var           rndVal    = Random.value;
                if (rndVal < 0.5f)
                {
                    primitive = PrimitiveType.Cube;
                }
                //else if (rndVal < 0.7)
                //    primitive = PrimitiveType.Sphere;
                else if (rndVal < 1)
                {
                    primitive = PrimitiveType.Cylinder;
                }
                //primitive = PrimitiveType.Sphere;
                NewObject(primitive);
            }
            GUILayout.EndHorizontal();
            GUILayout.EndArea();
        }
Ejemplo n.º 2
0
    public void In(
        [FriendlyName("Value", "The position of the draggable thumb, which can be changed by the user.")]
        ref float Value,

        [FriendlyName("Left Value", "The value at the left end of the scrollbar.")]
        [DefaultValue(0f), SocketState(false, false)]
        float LeftValue,

        [FriendlyName("Right Value", "The value at the right end of the scrollbar.")]
        [DefaultValue(10f), SocketState(false, false)]
        float RightValue,

        [FriendlyName("Thumb Size", "The size of the thumb relative to the scrollbar.")]
        [DefaultValue(1f), SocketState(false, false)]
        float ThumbSize,

        [FriendlyName("Style", "The style to use for the scrollbar background. If left out, the \"horizontalscrollbar\" style from the current GUISkin is used.")]
        [DefaultValue(""), SocketState(false, false)]
        string Style,

        [FriendlyName("Options", "An optional list of layout parameters.  Any values passed in here will override settings defined by the style.")]
        [SocketState(false, false)]
        GUILayoutOption[] Options
        )
    {
        GUIStyle scrollbarStyle = (string.IsNullOrEmpty(Style) ? GUI.skin.horizontalScrollbar : GUI.skin.GetStyle(Style));

        Value = GUILayout.HorizontalScrollbar(Value, ThumbSize, LeftValue, RightValue, scrollbarStyle, Options);
    }
Ejemplo n.º 3
0
    void ShowCompression()
    {
        GUILayout.BeginHorizontal();
        GUILayout.TextField("正在解压!!!!!!!!");
        GUILayout.EndHorizontal();

        GUILayout.Space(10);

        GUILayout.BeginHorizontal();
        GUILayout.Label(string.Format("文件数量{0}进度", "解压"));
        GUILayout.HorizontalScrollbar(
            0, CompressionStageResult.CurrentCount,
            0, CompressionStageResult.FileCount,
            GUILayout.Width(500));
        GUILayout.TextField(string.Format("{0}/{1}",
                                          CompressionStageResult.CurrentCount,
                                          CompressionStageResult.FileCount));
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.Label(string.Format("Bytes{0}进度", "解压"));
        GUILayout.HorizontalScrollbar(
            0, CompressionStageResult.CurrentSize,
            0, CompressionStageResult.TotalSize,
            GUILayout.Width(500));
        GUILayout.TextField(string.Format("{0}/{1}",
                                          CompressionStageResult.CurrentSize,
                                          CompressionStageResult.TotalSize));
        GUILayout.EndHorizontal();
    }
Ejemplo n.º 4
0
 void DoMyWindow2(int windowID)
 {
     GUILayout.Label("3D Graphics Settings");
     GUILayout.BeginVertical();
     GUILayout.BeginHorizontal();
     blnToggleState = GUILayout.Toggle(blnToggleState, "Soft Shadows");
     blnToggleState = GUILayout.Toggle(blnToggleState, "Particle Effects");
     GUILayout.EndHorizontal();
     GUILayout.BeginHorizontal();
     blnToggleState = GUILayout.Toggle(blnToggleState, "Enemy Shadows");
     blnToggleState = GUILayout.Toggle(blnToggleState, "Object Glow");
     GUILayout.EndHorizontal();
     GUILayout.EndVertical();
     GUILayout.BeginVertical();
     GUILayout.Button("Im a Button");
     GUILayout.TextField("Im a textfield");
     GUILayout.TextArea("Im a textfield\nIm the second line\nIm the third line\nIm the fourth line");
     blnToggleState = GUILayout.Toggle(blnToggleState, "Im a Toggle button");
     GUILayout.EndVertical();
     GUILayout.BeginVertical();
     //Sliders
     GUILayout.BeginHorizontal();
     fltSliderValue = GUILayout.HorizontalSlider(fltSliderValue, 0.0f, 1.1f, GUILayout.Width(128));
     fltSliderValue = GUILayout.VerticalSlider(fltSliderValue, 0.0f, 1.1f, GUILayout.Height(50));
     GUILayout.EndHorizontal();
     //Scrollbars
     GUILayout.BeginHorizontal();
     fltScrollerValue = GUILayout.HorizontalScrollbar(fltScrollerValue, 0.1f, 0.0f, 1.1f, GUILayout.Width(128));
     fltScrollerValue = GUILayout.VerticalScrollbar(fltScrollerValue, 0.1f, 0.0f, 1.1f, GUILayout.Height(90));
     GUILayout.Box("Im\na\ntest\nBox");
     GUILayout.EndHorizontal();
     GUILayout.EndVertical();
     GUI.DragWindow();
 }
Ejemplo n.º 5
0
    void OnGUI()
    {
        GUILayout.Label("frame:" + frameCount, style);
        GUILayout.Label("press w,s,a,d to move.");
        GUILayout.Label("press UpArrow,LeftArrow,RightArrow,DownArrow to rotate.");
        GUILayout.Label("light red");
        lightColor.r = GUILayout.HorizontalScrollbar(lightColor.r, 0.1f, 0, 1, GUILayout.Width(200));
        GUILayout.Label("light green");
        lightColor.g = GUILayout.HorizontalScrollbar(lightColor.g, 0.1f, 0, 1, GUILayout.Width(200));
        GUILayout.Label("light blue");
        lightColor.b = GUILayout.HorizontalScrollbar(lightColor.b, 0.1f, 0, 1, GUILayout.Width(200));

        GUILayout.Label("Shore line intensity:");
        shoreLineIntensity = GUILayout.HorizontalScrollbar(shoreLineIntensity, 0.2f, 0, 5f, GUILayout.Width(200));

        GUILayout.Label("alpha:");
        alpha = GUILayout.HorizontalScrollbar(alpha, 0.1f, 0, 1f, GUILayout.Width(200));


        mirrorReflection.enableMirrorReflection = GUILayout.Toggle(mirrorReflection.enableMirrorReflection, "Mirror reflection");

        if (mirrorReflection.enableMirrorReflection)
        {
            GUILayout.Label("Reflection intensity:");
            reflectionIntensity = GUILayout.HorizontalScrollbar(reflectionIntensity, 0.1f, 0, 1f, GUILayout.Width(200));
        }

        mirrorReflection.alpha = alpha;
    }
Ejemplo n.º 6
0
    public static void OnGUI()
    {
        GUI.backgroundColor  = Color.green;
        EMCli.FocusOnEnable  = GUILayout.Toggle(EMCli.FocusOnEnable, autofocus);
        EMCli.VisibleOnStart = GUILayout.Toggle(EMCli.VisibleOnStart, strVisibleOnStart);

        GUILayout.BeginHorizontal();
        layoutWidth = GUILayout.HorizontalScrollbar(layoutWidth, 20, 200, 1920);
        GUILayout.TextArea(layoutWidth.ToString(), GUILayout.MaxWidth(90));
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        layoutHeight = GUILayout.HorizontalScrollbar(layoutHeight, 20, 200, 1920);
        GUILayout.TextArea(layoutHeight.ToString(), GUILayout.MaxWidth(90));
        GUILayout.EndHorizontal();

        ApplyChangesIfModified();

        if (GUILayout.Button("Reset size"))
        {
            layoutWidth  = 320;
            layoutHeight = 430;
        }
        else if (GUILayout.Button("Save preferences"))
        {
            SavePrefs();
        }
        else if (GUILayout.Button("Load preferences"))
        {
            LoadPrefs();
        }
        GUI.DragWindow();
    }
Ejemplo n.º 7
0
        protected override void OnGUI()
        {
#if MOCK
            Console.WriteLine("ScrollBar: {0}", Value);
#else
            float oldValue = Value;
            float newValue = oldValue;
            switch (Type.Value)
            {
            case ScrollBarTypeEnum.Horizontal:
                newValue = GUILayout.HorizontalScrollbar(oldValue, Size, MinValue, MaxValue, GetLayoutOptions());
                break;

            case ScrollBarTypeEnum.Vertical:
                newValue = GUILayout.VerticalScrollbar(oldValue, Size, MinValue, MaxValue, GetLayoutOptions());
                break;
            }

            Value.Value = newValue;
            if (Value.LastSetResult != DataOperationResultEnum.Unchanged)
            {
                OnChange.Invoke(new JankyEventArgs <float>(Context.WindowID, Name, oldValue, newValue));
            }
#endif
        }
Ejemplo n.º 8
0
    void Billboard()
    {
        EditorGUILayout.Space();
        EditorGUILayout.Space();
        GUILayout.Label("Culling BillBoard Mode", EditorStyles.boldLabel);
        T4MCache.BilBocclusion = (OccludeBy)EditorGUILayout.EnumPopup("Mode", T4MCache.BilBocclusion, GUILayout.Width(340));

        EditorGUILayout.Space();
        EditorGUILayout.Space();


        GUILayout.Label("BillBoard Rotation Axis", EditorStyles.boldLabel);
        T4MCache.BillBoardAxis = (BillbAxe)EditorGUILayout.EnumPopup("Axis", T4MCache.BillBoardAxis, GUILayout.Width(340));
        EditorGUILayout.Space();
        EditorGUILayout.Space();

        GUILayout.Label("BillBoard Update Interval in Seconde", EditorStyles.boldLabel, GUILayout.Width(400));
        GUILayout.BeginHorizontal();
        GUILayout.Label("(less value = less performance)", GUILayout.Width(300));
        T4MConfig.BillInterval = EditorGUILayout.FloatField(T4MConfig.BillInterval, GUILayout.Width(50));
        GUILayout.EndHorizontal();
        EditorGUILayout.Space();
        EditorGUILayout.Space();
        GUILayout.BeginHorizontal();
        GUILayout.Label("Maximum View Distance", EditorStyles.boldLabel, GUILayout.Width(298));
        T4MConfig.BillboardDist = EditorGUILayout.FloatField(T4MConfig.BillboardDist, GUILayout.Width(50));
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        T4MConfig.BillboardDist = GUILayout.HorizontalScrollbar(T4MConfig.BillboardDist, 0.0f, 0f, 200f, GUILayout.Width(350));
        GUILayout.FlexibleSpace();
        GUILayout.EndHorizontal();
        GUILayout.FlexibleSpace();
        GUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();

        Texture Swap;
        string  buttonBill;

        if (T4MCache.billActivate)
        {
            buttonBill = "DEACTIVATE";
            Swap       = (Texture)AssetDatabase.LoadAssetAtPath(T4MConfig.T4MEditorFolder + "Img/on.png", typeof(Texture));
        }
        else
        {
            buttonBill = "ACTIVATE";
            Swap       = (Texture)AssetDatabase.LoadAssetAtPath(T4MConfig.T4MEditorFolder + "Img/off.png", typeof(Texture));
        }


        if (GUILayout.Button(buttonBill, GUILayout.Width(100), GUILayout.Height(30)))
        {
            ActivateDeactivateBillBoard();
        }
        GUILayout.Label(Swap, GUILayout.Width(75), GUILayout.Height(30));
        GUILayout.FlexibleSpace();
        GUILayout.EndHorizontal();
        GUILayout.FlexibleSpace();
    }
Ejemplo n.º 9
0
 void DoMyWindow(int windowID)
 {
     GUILayout.BeginVertical();
     GUILayout.Label("Im a Label");
     GUILayout.Space(8);
     GUILayout.Button("Im a Button");
     GUILayout.TextField("Im a textfield");
     GUILayout.TextArea("Im a textfield\nIm the second line\nIm the third line\nIm the fourth line");
     blnToggleState = GUILayout.Toggle(blnToggleState, "Im a Toggle button");
     GUILayout.EndVertical();
     GUILayout.BeginVertical();
     //Sliders
     GUILayout.BeginHorizontal();
     fltSliderValue = GUILayout.HorizontalSlider(fltSliderValue, 0.0f, 1.1f, GUILayout.Width(128));
     fltSliderValue = GUILayout.VerticalSlider(fltSliderValue, 0.0f, 1.1f, GUILayout.Height(50));
     GUILayout.EndHorizontal();
     //Scrollbars
     GUILayout.BeginHorizontal();
     fltScrollerValue = GUILayout.HorizontalScrollbar(fltScrollerValue, 0.1f, 0.0f, 1.1f, GUILayout.Width(128));
     fltScrollerValue = GUILayout.VerticalScrollbar(fltScrollerValue, 0.1f, 0.0f, 1.1f, GUILayout.Height(90));
     GUILayout.Box("Im\na\ntest\nBox");
     GUILayout.EndHorizontal();
     GUILayout.EndVertical();
     GUI.DragWindow();
 }
Ejemplo n.º 10
0
    void OnGUI()
    {
        EditorGUILayout.LabelField("ようこそ! Unityエディタ拡張の沼へ!");         // せっかくなので残しておこう。

        GUILayout.Label("Label : GUILayoutはUnityEngine側なので、ランタイムでもそのまま使える系");

        if (GUILayout.Button("Button"))
        {
            Debug.Log("Button!");
        }

        if (GUILayout.RepeatButton("RepeatButton"))        //これわけわからん。使わなそう。
        {
            Debug.Log("RepeatButton!");
        }

        toggle = GUILayout.Toggle(toggle, "Toggle");

        GUILayout.Label("TextField");        //改行可能
        textField = GUILayout.TextField(textField);

        GUILayout.Label("TextArea");        //改行不可能
        textArea = GUILayout.TextArea(textArea);

        GUILayout.Label("PasswordField");
        password = GUILayout.PasswordField(password, '*');

        GUILayout.Label("HorizontalScrollbar"); //これは使いそう、
        float horizontalSize = 10.0f;           // sizeはバーのサイズ(0~100のスクロールバーで10なので、全体に対して10分の1サイズ)

        horizontalScrollbar = GUILayout.HorizontalScrollbar(horizontalScrollbar, horizontalSize, 0.0f, 100.0f);

        GUILayout.Label("VerticalScrollbar");
        float verticalSize = 10.0f;        // sizeはバーのサイズ(0~100のスクロールバーで10なので、全体に対して10分の1サイズ)

        verticalScrollbar = GUILayout.VerticalScrollbar(verticalScrollbar, verticalSize, 0.0f, 100.0f);

        GUILayout.Label("HorizontalSlider");
        horizontalSlider = GUILayout.HorizontalSlider(horizontalSlider, 0.0f, 100.0f);

        GUILayout.Label("VerticalSlider");
        verticalSlider = GUILayout.VerticalSlider(verticalSlider, 0.0f, 100.0f);

        GUILayout.Label("Toolbar");
        toolbar = GUILayout.Toolbar(toolbar, new string[] { "Tool1", "Tool2", "Tool3" });

        GUILayout.Label("SelectionGrid");
        selectionGrid = GUILayout.SelectionGrid(selectionGrid, new string[] { "Grid 1", "Grid 2", "Grid 3", "Grid 4" }, 2);

        GUILayout.Box("Box");

        GUILayout.Label("ここからSpace");
        GUILayout.Space(100);
        GUILayout.Label("ここまでSpace");

        GUILayout.Label("ここからFlexibleSpace");
        GUILayout.FlexibleSpace();
        GUILayout.Label("ここまでFlexibleSpace");
    }
Ejemplo n.º 11
0
 private void OnGUI()
 {
     GUILayout.BeginHorizontal();
     GUILayout.Label("Size: " + Styles.FontSize);
     Styles.FontSize = GUILayout.HorizontalScrollbar(Styles.FontSize, 1, 11.0f, 60.0f, Styles.HorizontalScrollbar);
     GUILayout.EndHorizontal();
     m_Devices.DoGUI();
 }
Ejemplo n.º 12
0
        private void TestControls()
        {
            GUILayout.BeginArea(new Rect(10, 10, 200, 300));
            if (GUILayout.Button(_isRope ? "Destroy rope" : "Instantiate rope"))
            {
                if (_isRope)
                {
                    Destroy(_rope);
                    _ropeEntity = null;
                }
                else
                {
                    _rope       = Instantiate(Rope) as GameObject;
                    _ropeEntity = _rope.GetComponent <Rope>();
                }
                _isRope = !_isRope;
            }
            if (_isRope && _ropeEntity != null)
            {
                GUILayout.BeginHorizontal("box");
                _ropeEntity.Width = GUILayout.HorizontalScrollbar(_ropeEntity.Width, 0.03F, 0.01F, 0.3F, GUILayout.Width(100));
                GUILayout.Label(string.Format("Rope width: {0}", Mathf.Round(_ropeEntity.Width * 100f) / 100f));
                GUILayout.EndHorizontal();

                GUILayout.BeginHorizontal("box");
                if (GUILayout.RepeatButton("Cut front end"))
                {
                    _ropeEntity.CutRope(0.2f, Direction.FrontToBack);
                }
                if (GUILayout.RepeatButton("Cut back end"))
                {
                    _ropeEntity.CutRope(0.2f, Direction.BackToFront);
                }

                GUILayout.EndHorizontal();

                GUILayout.BeginVertical("box");
                GUILayout.Label("Select texturing mode:");
                if (GUILayout.Button("None"))
                {
                    _ropeEntity.TexturingMode = TexturingMode.None;
                }
                if (GUILayout.Button("Stretched"))
                {
                    _ropeEntity.TexturingMode = TexturingMode.Stretched;
                }
                if (GUILayout.Button("TiledFromFrontEnd"))
                {
                    _ropeEntity.TexturingMode = TexturingMode.TiledFromFrontEnd;
                }
                if (GUILayout.Button("TiledFromBackEnd"))
                {
                    _ropeEntity.TexturingMode = TexturingMode.TiledFromBackEnd;
                }
                GUILayout.EndVertical();
            }
            GUILayout.EndArea();
        }
        private void OnSceneGUI()
        {
            Handles.BeginGUI();

            _hValue = GUILayout.HorizontalScrollbar(_hValue, 1, 0, 10);
            _vValue = GUILayout.VerticalScrollbar(_vValue, 1, 0, 10);

            Handles.EndGUI();
        }
Ejemplo n.º 14
0
 public void OnGUI()
 {
     if (currentMesh != null)
     {
         GUILayout.BeginArea(new Rect(new Vector2(Screen.width / 2, 50), new Vector2(200, 200)));
         fat = GUILayout.HorizontalScrollbar(fat, 0.2f, 0, 1);
         GUILayout.EndArea();
     }
 }
Ejemplo n.º 15
0
    void ShowDownLoadInfo()
    {
        GUILayout.BeginHorizontal();
        if (GUILayout.Button("停止下载"))
        {
            AssetDownLoads.StopALLDownLoad();
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.TextField("正在下载!!!!!!!!");
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.TextField(string.Format("每秒[{0}]Bit", DownloaderConstant.DownLoadSpeed));
        GUILayout.EndHorizontal();

        GUILayout.Space(10);

        ShowDownLoadErrorFile();

        GUILayout.BeginHorizontal();
        GUILayout.Label(string.Format("文件数量{0}进度", "下载"));
        GUILayout.HorizontalScrollbar(
            0, DownLoadStageResult.CurrentCount,
            0, DownLoadStageResult.FileCount,
            GUILayout.Width(500));
        GUILayout.TextField(string.Format("{0}/{1}", DownLoadStageResult.CurrentCount, DownLoadStageResult.FileCount));
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.Label(string.Format("Bytes{0}进度", "下载"));
        GUILayout.HorizontalScrollbar(
            0, DownLoadStageResult.CurrentSize,
            0, DownLoadStageResult.TotalSize,
            GUILayout.Width(500));
        GUILayout.TextField(string.Format("{0}/{1}", DownLoadStageResult.CurrentSize, DownLoadStageResult.TotalSize));
        GUILayout.EndHorizontal();

        if (DownLoadStageResult.DownLoadFileInfos == null)
        {
            return;
        }

        var itr = DownLoadStageResult.DownLoadFileInfos.Keys.GetEnumerator();

        while (itr.MoveNext())
        {
            if (DownLoadStageResult.DownLoadFileInfos[itr.Current].AssetName == string.Empty)
            {
                continue;
            }
            ShowDownLoadFileInfo(itr.Current);
        }
        itr.Dispose();
    }
Ejemplo n.º 16
0
 private void HorizontalScrollbar2()
 {
     GUILayout.BeginHorizontal();
     {
         GUILayout.Label(new GUIContent("", "StyleGeneral.PartitionVertical"), GuiStyleSet.StyleGeneral.partitionVertical);
         GUILayout.HorizontalScrollbar(0.25f, 0.5f, 0.0f, 1.0f, GuiStyleSet.StyleLoopTool.waveformbar);
         GUILayout.Label(new GUIContent("", "StyleGeneral.PartitionVertical"), GuiStyleSet.StyleGeneral.partitionVertical);
     }
     GUILayout.EndHorizontal();
 }
Ejemplo n.º 17
0
 internal override void DrawWindow(int id)
 {
     GUILayout.Button("This is a button");
     togglevalue = GUILayout.Toggle(togglevalue, "This is a Toggle");
     GUILayout.Label("This is a Label");
     horizvalue = GUILayout.HorizontalScrollbar(horizvalue, 20, 0, 100);
     GUILayout.Label("Scrollbar Value=" + horizvalue.ToString("0"));
     GUILayout.Button("red text button", "RedButton");
     GUILayout.Button("Unity button", SkinsLibrary.DefUnitySkin.button);
     GUILayout.Label("DragEnabled:" + DragEnabled.ToString());
 }
Ejemplo n.º 18
0
        private static void DrawDepthContorllerWindow(int windowId)
        {
            var depthChargeMaxValue = FindMinDepth("DepthCharge");
            var torpedoMaxValue     = FindMinDepth("Torpedo");

            GUILayout.BeginVertical();

            GUILayout.BeginHorizontal();
            GUILayout.Label(Localizer.Format("#autoLOC_NAS_DepthSettings_depthCharge"));
            GUILayout.FlexibleSpace();

            if (depthChargeMaxValue > 0)
            {
                GUILayout.Label(setAllDepthCharges.ToString() + " m");
                setAllDepthCharges = (int)GUILayout.HorizontalScrollbar(
                    setAllDepthCharges, 2, 25,
                    depthChargeMaxValue + 2, GUILayout.MinWidth(100));

                if (setAllDepthCharges != _setAllDepthChargesTemp)
                {
                    SetAllDepthChargeDepth(setAllDepthCharges);
                    _setAllDepthChargesTemp = setAllDepthCharges;
                }
            }
            else
            {
                GUILayout.Label(Localizer.Format("#autoLOC_NAS_DepthSettings_unavailable"));
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label(Localizer.Format("#autoLOC_NAS_DepthSettings_torpedo"));
            GUILayout.FlexibleSpace();
            if (torpedoMaxValue > 0)
            {
                GUILayout.Label(setAllTorpedos.ToString() + " m");
                setAllTorpedos = (int)GUILayout.HorizontalScrollbar(setAllTorpedos, 2, 1, torpedoMaxValue, GUILayout.MinWidth(100));
                if (setAllTorpedos != _setAllTorpedosTemp)
                {
                    SetAllTorpedoDepth(setAllTorpedos);
                    _setAllTorpedosTemp = setAllTorpedos;
                }
            }
            else
            {
                GUILayout.Label(Localizer.Format("#autoLOC_NAS_DepthSettings_unavailable"));
            }
            GUILayout.EndHorizontal();

            GUILayout.EndVertical();

            GUI.DragWindow();
        }
Ejemplo n.º 19
0
    // Token: 0x060007B7 RID: 1975 RVA: 0x000353C8 File Offset: 0x000335C8
    public static float HorizontalScrollbar(string title, float value, int min, int max)
    {
        GUILayout.BeginHorizontal(new GUILayoutOption[0]);
        GUILayout.Label(title, new GUILayoutOption[0]);
        GUILayout.Space(10f);
        float result = GUILayout.HorizontalScrollbar(value, 1f, (float)min, (float)(max + 1), new GUILayoutOption[0]);

        GUILayout.Space(10f);
        GUILayout.Label(string.Format("{0} [{1},{2}]", value, min, max), new GUILayoutOption[0]);
        GUILayout.EndHorizontal();
        return(result);
    }
Ejemplo n.º 20
0
    // Token: 0x060007B6 RID: 1974 RVA: 0x00035344 File Offset: 0x00033544
    public static int HorizontalScrollbar(string title, int value, int min, int max)
    {
        float num = (float)value;

        GUILayout.BeginHorizontal(new GUILayoutOption[0]);
        GUILayout.Label(title, new GUILayoutOption[0]);
        GUILayout.Space(10f);
        num = GUILayout.HorizontalScrollbar((float)value, 1f, (float)min, (float)(max + 1), new GUILayoutOption[0]);
        GUILayout.Space(10f);
        GUILayout.Label(string.Format("{0} [{1},{2}]", value, min, max), new GUILayoutOption[0]);
        GUILayout.EndHorizontal();
        return((int)num);
    }
Ejemplo n.º 21
0
    void ShowDownLoadFileInfo(string assetName)
    {
        GUILayout.BeginHorizontal();
        DownLoadFileResultInfo info = DownLoadStageResult.DownLoadFileInfos[assetName];

        GUILayout.Label(info.AssetName);
        GUILayout.HorizontalScrollbar(
            0, info.CurrentFileSize,
            0, info.TotalFileSize,
            GUILayout.Width(300));
        GUILayout.TextField(string.Format("{0}/{1}", info.CurrentFileSize, info.TotalFileSize));
        GUILayout.EndHorizontal();
    }
    void OnGUI()
    {
        GUIStyle style = new GUIStyle();

        style.fontSize         = 15;
        style.normal.textColor = Color.white;
        GUILayout.Space(30 * id);
        GUILayout.BeginHorizontal();
        GUILayout.Space(10);
        GUILayout.Label("Enemy" + id, style, GUILayout.Width(70));
        GUILayout.HorizontalScrollbar(0, health, 0, maxHealth, GUILayout.Width(200));
        GUILayout.Label((canShoot) ? "Shooting" : "Patroling", style, GUILayout.Width(70));
        GUILayout.EndHorizontal();
    }
Ejemplo n.º 23
0
    void OnGUI()
    {
        MinVal = EditorGUILayout.Vector2Field("Min Values", MinVal);
        MaxVal = EditorGUILayout.Vector2Field("Max Values", MaxVal);

        GUILayout.Label("Number of Models", EditorStyles.boldLabel);
        numberOfModels = (int)GUILayout.HorizontalScrollbar(numberOfModels, 1.0f, 1.0f, 5.0f);

        GUILayout.Label("Model Texture", EditorStyles.boldLabel);
        modelTexture = EditorGUILayout.ObjectField(modelTexture, typeof(Texture), false) as Texture;

        GUILayout.Label("Model Prefabs", EditorStyles.boldLabel);
        if (modelsArray.Length != numberOfModels)
        {
            modelsArray = new GameObject[numberOfModels];
        }
        for (int i = 0; i < modelsArray.Length; i++)
        {
            modelsArray[i] = EditorGUILayout.ObjectField(modelsArray[i], typeof(GameObject), false) as GameObject;
        }
        if (GUILayout.Button("Generate"))
        {
            if (MinVal.x == 0 || MinVal.y == 0)
            {
                ShowNotification(new GUIContent("Max numbers must be nonzero"));
                return;
            }
            if (MaxVal.x > MinVal.x || MaxVal.y > MinVal.y)
            {
                ShowNotification(new GUIContent("Min numbers must be smaller than Max numbers"));
                return;
            }
            if (modelTexture == null)
            {
                ShowNotification(new GUIContent("Texture must be filled"));
                return;
            }
            foreach (GameObject i in modelsArray)
            {
                if (i == null)
                {
                    ShowNotification(new GUIContent("Each array must be filled"));
                    return;
                }
            }

            GenerateLevel(MinVal.x, MaxVal.x, MinVal.y, MaxVal.y, modelsArray, modelTexture);
        }
    }
Ejemplo n.º 24
0
    public override void OnInspectorGUI()                                                     // unity arayüzdeki inspector paneline erişim
    {
        TestereHareket script = (TestereHareket)target;                                       //yukarıdaki class ile bağlantı için - 3

        if (GUILayout.Button("Gizmo Olustur", GUILayout.MinWidth(100), GUILayout.Width(100))) // arayüzde testerehareket scriptinin altında buton oluşturma
        {
            GameObject yeniObje = new GameObject();                                           //Üret butonuna basıldığında obje oluşması
            yeniObje.transform.parent   = script.transform;                                   // alt obje olarak oluşturma
            yeniObje.transform.position = script.transform.position;                          // yeni objelerim script'in (testere'nin) bulunduğu pozisyonda oluşacak.
            yeniObje.name = script.transform.childCount.ToString();                           // yeni oluşacak objelerin adları (testere objesinin altında 1, 2, 3... şeklinde)
        }

        GUILayout.Label("Testere dönme hizi:");
        script.testereDonmeHizi = GUILayout.HorizontalScrollbar(script.testereDonmeHizi, 1, 0, 20);        //testere dönme hizi ayari için scripte scrollbar ekleme.
        GUILayout.Label("Testere hareket hizi:");
        script.testereHareketHizi = GUILayout.HorizontalScrollbar(script.testereHareketHizi, 0.5f, 0, 5f); //testere hareket hizi ayari için scripte scrollbar ekleme.
    }
Ejemplo n.º 25
0
        void OnGUI()
        {
            GUILayout.Space(20);
            GUILayout.Label("Lose percent: " + losePercent.ToString("0.00"));
            losePercent = GUILayout.HorizontalScrollbar(losePercent, 1.0f, 0.0f, 100.0f);

            GUILayout.Label("False percent: " + falsePercent.ToString("0.00"));
            falsePercent = GUILayout.HorizontalScrollbar(falsePercent, 1.0f, 0.0f, 100.0f);

            GUILayout.Label("Lucky percent: " + luckyPercent.ToString("0.00"));
            luckyPercent = GUILayout.HorizontalScrollbar(luckyPercent, 1.0f, 0.0f, 100.0f);

            GUILayout.Label("bigWin percent: " + bigWinPercent.ToString("0.00"));
            bigWinPercent = GUILayout.HorizontalScrollbar(bigWinPercent, 1.0f, 0.0f, 100.0f);

            GUILayout.Space(20);

            GUILayout.Label("MinFalseReward percent: " + minFalseReward.ToString("0.00"));
            minFalseReward = GUILayout.HorizontalScrollbar(minFalseReward, 1.0f, 0.0f, 100.0f);

            GUILayout.Label("MaxLuckyReward percent: " + maxLuckyReward.ToString("0.00"));
            maxLuckyReward = GUILayout.HorizontalScrollbar(maxLuckyReward, 1.0f, 100.0f, 200.0f);

            GUILayout.Label("MinBigReward percent: " + minBigReward.ToString("0.00"));
            minBigReward = GUILayout.HorizontalScrollbar(minBigReward, 1.0f, 100.0f, 1000.0f);

            GUILayout.Label("MinBigReward percent: " + maxBigReward.ToString("0.00"));
            maxBigReward = GUILayout.HorizontalScrollbar(maxBigReward, 1.0f, 100.0f, 1000.0f);

            CalcPeriod();

            GUILayout.Space(10);

            GUILayout.TextField("Balance=" + periodBalance.ToString("0.00"), 25);

            if (GUILayout.Button("Move to config"))
            {
                if (onFinishClick != null)
                {
                    onFinishClick();
                }

                this.Close();
            }
        }
    void OnGUI()
    {
        if (isDead)
        {
            return;
        }

        GUIStyle style = new GUIStyle();

        style.fontSize         = 15;
        style.normal.textColor = Color.white;
        GUILayout.Space(10);
        GUILayout.BeginHorizontal();
        GUILayout.Space(10);
        GUILayout.Label("Player", style, GUILayout.Width(70));
        GUILayout.HorizontalScrollbar(0, health, 0, maxHealth, GUILayout.Width(200));
        GUILayout.EndHorizontal();
    }
Ejemplo n.º 27
0
 void ShinyWindowMethod(Int32 id)
 {
     GUILayout.Label("battle # " + BattleCount);
     GUILayout.Label("time avg : " + ((Single)(Environment.TickCount - tick) / 1000 / (Single)BattleCount));
     GUILayout.Label("needToEnterBattle " + needToEnterBattle);
     GUILayout.Label("needToCloseLevelUpDelay " + needToCloseLevelUpDelay);
     GUILayout.Label("needToSelectBench " + needToCloseLevelUpDelay);
     fight      = GUILayout.Toggle(fight, fight ? "Fight" : "Flee");
     luma       = GUILayout.Toggle(luma, "Luma required");
     disableGfx = GUILayout.Toggle(disableGfx, "Disable gfx");
     GUILayout.Label("sv minimums to stop");
     GUILayout.BeginHorizontal();
     GUILayout.Label("hp");
     sv_hp = GUILayout.HorizontalScrollbar(sv_hp, 1, 0, 50);
     GUILayout.EndHorizontal();
     GUILayout.BeginHorizontal();
     GUILayout.Label("stam");
     sv_stam = GUILayout.HorizontalScrollbar(sv_stam, 1, 0, 50);
     GUILayout.EndHorizontal();
     GUILayout.BeginHorizontal();
     GUILayout.Label("atk");
     sv_atk = GUILayout.HorizontalScrollbar(sv_atk, 1, 0, 50);
     GUILayout.EndHorizontal();
     GUILayout.BeginHorizontal();
     GUILayout.Label("def");
     sv_def = GUILayout.HorizontalScrollbar(sv_def, 1, 0, 50);
     GUILayout.EndHorizontal();
     GUILayout.BeginHorizontal();
     GUILayout.Label("spatk");
     sv_spatk = GUILayout.HorizontalScrollbar(sv_spatk, 1, 0, 50);
     GUILayout.EndHorizontal();
     GUILayout.BeginHorizontal();
     GUILayout.Label("spdef");
     sv_spdef = GUILayout.HorizontalScrollbar(sv_spdef, 1, 0, 50);
     GUILayout.EndHorizontal();
     GUILayout.BeginHorizontal();
     GUILayout.Label("speed");
     sv_speed = GUILayout.HorizontalScrollbar(sv_speed, 1, 0, 50);
     GUILayout.EndHorizontal();
     GUI.DragWindow();
 }
Ejemplo n.º 28
0
 private void _OnGUI_Window(int nWindowID)
 {
     GUILayout.BeginVertical(new GUILayoutOption[0]);
     GUILayout.Label("Walk Speed : " + this.fWalkSpeed, new GUILayoutOption[0]);
     this.fWalkSpeed  = GUILayout.HorizontalScrollbar(this.fWalkSpeed, 1f, 1f, 250f, new GUILayoutOption[0]);
     this.fWalkSpeed -= this.fWalkSpeed % 1f;
     GUILayout.Label("Run Speed : " + this.fRunSpeed, new GUILayoutOption[0]);
     this.fRunSpeed  = GUILayout.HorizontalScrollbar(this.fRunSpeed, 1f, 1f, 250f, new GUILayoutOption[0]);
     this.fRunSpeed -= this.fRunSpeed % 1f;
     this.bForceRun  = GUILayout.Toggle(this.bForceRun, "무조건 뛰는 모드", new GUILayoutOption[0]);
     GUILayout.Space(10f);
     GUILayout.Label("-알림-", new GUILayoutOption[0]);
     GUILayout.Label("LeftShift/RightShift : 뛰기", new GUILayoutOption[0]);
     GUILayout.Label("NumPad7 : Camera X +1", new GUILayoutOption[0]);
     GUILayout.Label("NumPad4 : Camera X -1", new GUILayoutOption[0]);
     GUILayout.Label("NumPad8 : Camera Y +1", new GUILayoutOption[0]);
     GUILayout.Label("NumPad5 : Camera Y -1", new GUILayoutOption[0]);
     GUILayout.Label("NumPad9 : Camera Z +1", new GUILayoutOption[0]);
     GUILayout.Label("NumPad6 : Camera Z -1", new GUILayoutOption[0]);
     GUILayout.EndVertical();
 }
Ejemplo n.º 29
0
 void OnGuiSlider(string name, ref float val, float min, float max, ref string inputVal)
 {
     GUILayout.Space(20);
     GUILayout.BeginHorizontal();
     {
         GUILayout.Label(name, textStyle, GUILayout.Width(paramLabelWidth));
         float size   = (max - min) / 10;
         float newVal = GUILayout.HorizontalScrollbar(val, size, min, max + size);
         if (val != newVal && GUI.changed)
         {
             GUI.changed = false;
             val         = newVal;
             inputVal    = val.ToString();
         }
         inputVal = GUILayout.TextField(inputVal, textFieldStyle, GUILayout.Width(80));
         if (float.TryParse(inputVal, out newVal))
         {
             val = newVal;
         }
     }
     GUILayout.EndHorizontal();
 }
Ejemplo n.º 30
0
        void MenuMethod(Int32 id)
        {
            foreach (var mono in Init.BaseObject.GetComponents <MonoBehaviour>())
            {
                if (mono.GetType() == GetType())
                {
                    continue;
                }
                mono.enabled = GUILayout.Toggle(mono.enabled, mono.GetType().Name);
                if (ScalingOptions.Contains(mono.GetType()))
                {
                    mono.SetField("ScalingValue", GUILayout.HorizontalScrollbar(mono.GetField <Single>("ScalingValue"), 1.0f, mono.GetField <Single>("MinValue"), mono.GetField <Single>("MaxValue")));
                }
            }
            var unload = GUILayout.Toggle(false, "Unload");

            if (unload)
            {
                Destroy(Init.BaseObject);
            }
            GUI.DragWindow();
        }