• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# GUIStyle类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中GUIStyle的典型用法代码示例。如果您正苦于以下问题:C# GUIStyle类的具体用法?C# GUIStyle怎么用?C# GUIStyle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



GUIStyle类属于命名空间,在下文中一共展示了GUIStyle类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: BeginScrollView

 internal static void BeginScrollView(Rect position, Vector2 scrollPosition, Rect viewRect, GUIStyle horizontalScrollbar, GUIStyle verticalScrollbar)
 {
     s_ScrollPos = scrollPosition;
     s_ViewRect = viewRect;
     s_Position = position;
     GUIClip.Push(position, new Vector2(Mathf.Round((-scrollPosition.x - viewRect.x) - ((viewRect.width - position.width) * 0.5f)), Mathf.Round((-scrollPosition.y - viewRect.y) - ((viewRect.height - position.height) * 0.5f))), Vector2.zero, false);
 }
开发者ID:demelev,项目名称:projectHL,代码行数:7,代码来源:PreviewGUI.cs


示例2: OnGUI

    void OnGUI()
    {
        current = EditorGUILayout.BeginScrollView (current);

        GUIStyle buttonStyle = new GUIStyle ();
        buttonStyle.margin.left = 10;
        buttonStyle.margin.top = 5;

        GUIStyle labelStyle = new GUIStyle (buttonStyle);
        labelStyle.fontSize = 24;

        foreach (var layerWithObject in layerWithObjectList) {
            string layerName = LayerMask.LayerToName (layerWithObject.layer);

            layerWithObject.isOpen = GUILayout.Toggle (layerWithObject.isOpen, layerName, labelStyle);

            if (layerWithObject.isOpen) {
                foreach (var obj in layerWithObject.objectList) {
                    if (GUILayout.Button (obj.name, buttonStyle)) {
                        UnityEditor.EditorGUIUtility.PingObject (obj);
                    }
                }
            }

            GUILayout.Space (16);
        }

        EditorGUILayout.EndScrollView ();
    }
开发者ID:Kayrohinc,项目名称:ReferenceExplorer,代码行数:29,代码来源:LayerList.cs


示例3: OnGUI

    void OnGUI()
    {
        GUIStyle buttonStyle = new GUIStyle();
        buttonStyle.normal.background = null;

        GUIStyle designStyle = new GUIStyle();

        //Top and Bottom middle frame
        GUI.DrawTexture(new Rect(0, 0, Screen.width, 128), FrameTopMiddle_KD);
        GUI.DrawTexture(new Rect(0, Screen.height - 128, Screen.width, 128), FrameBottomMiddle_KD);

        //Left and Right middle frame
        GUI.DrawTexture(new Rect(0, 0, 128, Screen.height), FrameLeft_KD);
        GUI.DrawTexture(new Rect(Screen.width - 128, 0, 128, Screen.height), FrameRight_KD);

        //Frame corners
        GUI.Box(new Rect(Screen.width - 128, 0, 128, 128), FrameTopRight_KD, designStyle);
        GUI.Box(new Rect(0, 0, 128, 128), FrameTopLeft_KD, designStyle);
        GUI.Box(new Rect(Screen.width - 128, Screen.height - 128, 128, 128), FrameBottomRight_KD, designStyle);
        GUI.Box(new Rect(0, Screen.height - 128, 128, 128), FrameBottomLeft_KD, designStyle);

        GUI.Box(new Rect(0, 0, 1024, 1024), FrameMoon_KD, designStyle);
        GUI.Box(new Rect(100, 0, 512, 128), ButtonsBG_KD, designStyle);

        GUI.Box(new Rect(Screen.width - 256, 0, 256, 64), Logo_KD, designStyle);

        //Energy Bar
        //GUI.DrawTexture(new Rect(Screen.width - 33, Screen.height - 232, 30, 200 * .5f), EnergyBarBW_KD, ScaleMode.ScaleAndCrop);
        //GUI.Box(new Rect(Screen.width - 33, Screen.height - 232, 30, 200), EnergyBar_KD, designStyle);
        //GUI.DrawTexture(new Rect(Screen.width - 33, Screen.height - 232, 25, 200 - PowerLevel * 200 / 100), EnergyBarBW_KD, ScaleMode.ScaleAndCrop);
        //GUI.Box(new Rect(Screen.width - 33, Screen.height - 232, 30, 200 * .5f), EnergyBarBW_KD, designStyle);
    }
开发者ID:kdikov,项目名称:moonville,代码行数:32,代码来源:FrameMainMenuNZh.cs


示例4: Start

 void Start()
 {
     this.labelStyle = new GUIStyle();
     this.labelStyle.fontSize = Screen.height / 22;
     this.labelStyle.normal.textColor = Color.white;
     //start_gyro = StartCameraController.ini_gyro;
 }
开发者ID:hounenhounen,项目名称:NCMB_BitSummit_hacoscon,代码行数:7,代码来源:MyCameraController.cs


示例5: Start

    void Start()
    {
        _img = (Texture2D)Resources.Load("bg1");
        _img2 = (Texture2D)Resources.Load("bg2");

        style = new GUIStyle();

        style.font = (Font)Resources.Load("Fonts/Arial");

        style.active.background = _img2; // not working
        style.hover.background = _img2; // not working
        style.normal.background = _img; // not working

        style.active.textColor = Color.red; // not working
        style.hover.textColor = Color.blue; // not working
        style.normal.textColor = Color.white;

        int border = 30;

        style.border.left = border; // not working, since backgrounds aren't showing
        style.border.right = border; // ---
        style.border.top = border; // ---
        style.border.bottom = border; // ---

        style.stretchWidth = true; // ---
        style.stretchHeight = true; // not working, since backgrounds aren't showing

        style.alignment = TextAnchor.MiddleCenter;
    }
开发者ID:russboss,项目名称:VisTest2,代码行数:29,代码来源:DynamicGUIStyle.cs


示例6: OnEnable

    void OnEnable()
    {
		displayManager = target as RUISDisplayManager;
		
        displays = serializedObject.FindProperty("displays");
		ruisMenuPrefab = serializedObject.FindProperty("ruisMenuPrefab");
		
		guiX = serializedObject.FindProperty("guiX");
		guiY = serializedObject.FindProperty("guiY");
		guiZ = serializedObject.FindProperty("guiZ");
		guiScaleX = serializedObject.FindProperty("guiScaleX");
		guiScaleY = serializedObject.FindProperty("guiScaleY");
		hideMouseOnPlay = serializedObject.FindProperty("hideMouseOnPlay");
		
		displayManagerLink = new SerializedObject(displayManager);
		guiDisplayChoiceLink = displayManagerLink.FindProperty("guiDisplayChoice");
		
//        allowResolutionDialog = serializedObject.FindProperty("allowResolutionDialog");
        displayPrefab = Resources.Load("RUIS/Prefabs/Main RUIS/RUISDisplay") as GameObject;

        displayBoxStyle = new GUIStyle();
        displayBoxStyle.normal.textColor = Color.white;
        displayBoxStyle.alignment = TextAnchor.MiddleCenter;
        displayBoxStyle.border = new RectOffset(2, 2, 2, 2);
        displayBoxStyle.margin = new RectOffset(1, 0, 0, 0);
        displayBoxStyle.wordWrap = true;

        monoDisplayTexture = Resources.Load("RUIS/Editor/Textures/monodisplay") as Texture2D;
        stereoDisplayTexture = Resources.Load("RUIS/Editor/Textures/stereodisplay") as Texture2D;
		
		menuCursorPrefab = serializedObject.FindProperty("menuCursorPrefab");
		menuLayer = serializedObject.FindProperty("menuLayer");
    }
开发者ID:znjRoLS,项目名称:RUISAircraftGunner,代码行数:33,代码来源:RUISDisplayManagerEditor.cs


示例7: OnSceneGUI

	private         void OnSceneGUI    () {
		Ferr2D_Path  path      = (Ferr2D_Path)target;
		GUIStyle     iconStyle = new GUIStyle();
		iconStyle.alignment    = TextAnchor.MiddleCenter;
		
		// setup undoing things
		Undo.RecordObject(target, "Modified Path");
		
        // draw the path line
		if (Event.current.type == EventType.repaint)
			DoPath(path);
		
		// Check for drag-selecting multiple points
		DragSelect(path);
		
        // do adding verts in when the shift key is down!
		if (Event.current.shift && !Event.current.control) {
			DoShiftAdd(path, iconStyle);
		}
		
        // draw and interact with all the path handles
		DoHandles(path, iconStyle);
		
		// update everything that relies on this path, if the GUI changed
		if (GUI.changed) {
			UpdateDependentsSmart(path, false, false);
			EditorUtility.SetDirty (target);
			prevChanged = true;
		} else if (Event.current.type == EventType.used) {
			if (prevChanged == true) {
				UpdateDependentsSmart(path, false, true);
			}
			prevChanged = false;
		}
	}
开发者ID:lancetipton04,项目名称:VG,代码行数:35,代码来源:Ferr2D_PathEditor.cs


示例8: OnGUI

    void OnGUI()
    {
        float screenWidth = Screen.width;
        float screenHeight = Screen.height;
        float weapTextHeight = screenHeight * .02f; //4% of total screen height
        float weapImageHeight = screenHeight * .07f;
        float scoreTextHeight = screenHeight * .08f;

        GUIStyle centerStyle = new GUIStyle(GUI.skin.label);
        centerStyle.alignment = TextAnchor.MiddleCenter;
        GUIStyle rightStyle = new GUIStyle(GUI.skin.label);
        rightStyle.alignment = TextAnchor.MiddleRight;
        rightStyle.fontSize = 20;

        GUI.Label(new Rect(105, 5, 50, weapTextHeight), "MAIN", centerStyle);
        GUI.Label(new Rect(225, 5, 50, weapTextHeight), "SUB", centerStyle);

        Texture2D weaponTexture = Resources.Load<Texture2D>("bullet_bill");
        GUI.DrawTexture(new Rect(105, 5 + weapTextHeight, 50, weapImageHeight), weaponTexture, ScaleMode.ScaleToFit, true, 1.0f);

        Texture2D subWeaponTexture = Resources.Load<Texture2D>("thunderbolt");
        GUI.DrawTexture(new Rect(225, 5 + weapTextHeight, 50, weapImageHeight), subWeaponTexture, ScaleMode.ScaleToFit, true, 1.0f);

        Texture2D meterTexture = Resources.Load<Texture2D>("meter");
        GUI.DrawTexture(new Rect(400, 5, 600, scoreTextHeight), meterTexture, ScaleMode.StretchToFill, true, 1.0f);

        GUI.Label(new Rect(screenWidth - 450, 5, 280, scoreTextHeight), "Score: 314159265351337", rightStyle);
    }
开发者ID:jcsinck,项目名称:colt,代码行数:28,代码来源:gui_renderer.cs


示例9: OnGUI

 void OnGUI()
 {
     GUIStyle style = new GUIStyle();
     style.normal.textColor = Color.black;
     for (int i = 0; i < helptext.Length; i++)
         GUILayout.Label(helptext[i], style);
 }
开发者ID:alerdenisov,项目名称:ADAPT,代码行数:7,代码来源:HelpText.cs


示例10: OnGUI

    void OnGUI()
    {
        if (photonView.isMine) {

            listenForLevelUp();

            GUIStyle style = new GUIStyle();
            style.normal.textColor = Color.blue;
            style.fontSize = 20;
            GUILayout.Label("Health: " + sCharacterClass.currentHealth.ToString() + " / "
                + sCharacterClass.maxHealth.ToString(), style);
            GUILayout.Label("Level: " + sCharacterClass.level.ToString(), style);
            GUILayout.Label("xp" + sCharacterClass.experience.ToString() + " / " + sCharacterClass.reqExperience.ToString(), style);

            if(collideWeapon != null)
            {
                GUI.Label(new Rect(10, 200, 300, 20), "Press F to pick up " + collideWeapon.GunID, style);
            }

            if(increaseStat > 0)
            {
                levelUpStats();
            }

        }
    }
开发者ID:EricJSoler,项目名称:astron,代码行数:26,代码来源:PlayerHUD.cs


示例11: AgentPanel

 void AgentPanel(Agent agent)
 {
     GUILayout.BeginVertical();
         //GUILayout.Box(agent._name, GUILayout.Height(100f));
         GUILayout.Box(agent._name);
         GUILayout.Label("HP: "+agent.life+"/"+agent.lifeTotal+"  "+"XP: "+agent.skill);
         GUILayout.BeginHorizontal();
          GUILayout.Label("BP:");
          Dictionary<Type, int> typeToCount = new Dictionary<Type, int>();
          Dictionary<Type, Texture> typeToIcon = new Dictionary<Type, Texture>();
          foreach (EObject obj in agent.backpack) {
             if (typeToCount.ContainsKey(obj.GetType()))
                 typeToCount[obj.GetType()] = typeToCount[obj.GetType()] + 1;
             else {
                 typeToCount.Add(obj.GetType(), 1);
                 typeToIcon.Add(obj.GetType(), obj.getIcon());
             }
          }
         foreach (Type type in typeToCount.Keys) {
         GUILayout.BeginHorizontal();
             GUIStyle iconStyle = new GUIStyle();
             iconStyle.margin = new RectOffset(0, 0, 5, 0);
             GUILayout.Label(typeToIcon[type], iconStyle, GUILayout.Width (20), GUILayout.Height (15));
             GUIStyle textStyle = new GUIStyle();
             textStyle.margin = new RectOffset(0, 10, 5, 0);
             textStyle.normal.textColor = Color.white;
             GUILayout.Label(": " + typeToCount[type], textStyle);
         GUILayout.EndHorizontal();
         }
         GUILayout.EndHorizontal();
     GUILayout.EndVertical();
 }
开发者ID:igaray,项目名称:iaj,代码行数:32,代码来源:InfoControlBar.cs


示例12: OnGUI

	// Test Menu
	// Includes SendTag/SendTags and getting the userID and pushToken
	void OnGUI () {
		GUIStyle customTextSize = new GUIStyle("button");
		customTextSize.fontSize = 30;

		GUIStyle guiBoxStyle = new GUIStyle("box");
		guiBoxStyle.fontSize = 30;

		GUI.Box(new Rect(10, 10, 390, 250), "Test Menu", guiBoxStyle);

		if (GUI.Button (new Rect (60, 80, 300, 60), "SendTags", customTextSize)) {
			// You can tags users with key value pairs like this:
            OneSignal.SendTag("UnityTestKey", "TestValue");
			// Or use an IDictionary if you need to set more than one tag.
            OneSignal.SendTags(new Dictionary<string, string>() { { "UnityTestKey2", "value2" }, { "UnityTestKey3", "value3" } });

			// You can delete a single tag with it's key.
            // OneSignal.DeleteTag("UnityTestKey");
			// Or delete many with an IList.
            // OneSignal.DeleteTags(new List<string>() {"UnityTestKey2", "UnityTestKey3" });
		}

		if (GUI.Button (new Rect (60, 170, 300, 60), "GetIds", customTextSize)) {
            OneSignal.GetIdsAvailable((userId, pushToken) => {
				extraMessage = "UserID:\n" + userId + "\n\nPushToken:\n" + pushToken;
			});
		}

		if (extraMessage != null) {
			guiBoxStyle.alignment = TextAnchor.UpperLeft;
			guiBoxStyle.wordWrap = true;
			GUI.Box (new Rect (10, 300, Screen.width - 20, Screen.height - 310), extraMessage, guiBoxStyle);
		}
	}
开发者ID:sonxoans2,项目名称:Tap-Rotate,代码行数:35,代码来源:GameControllerExample.cs


示例13: prepGUIStyles

    protected new void prepGUIStyles()
    {
        availableGUIStyles = new Dictionary<string, GUIStyle>();

        float targetWidth = 1280f;
        float targetHeight = 800f;
        Vector3 scaleForCurrRes = new Vector3((Screen.width * 1.0f)/targetWidth,(Screen.height * 1.0f)/targetHeight,1f);

        GUIStyle fieldTitleStyle = new GUIStyle(GUI.skin.label);
        fieldTitleStyle.alignment = TextAnchor.MiddleCenter;
        fieldTitleStyle.fontSize = (int) (50 * scaleForCurrRes.x);

        GUIStyle fieldContentStyle = new GUIStyle(GUI.skin.label);
        fieldContentStyle.alignment = TextAnchor.MiddleCenter;
        fieldContentStyle.fontSize = (int) (30 * scaleForCurrRes.x);

        GUIStyle goalTextStyle = new GUIStyle(GUI.skin.label);
        goalTextStyle.alignment = TextAnchor.MiddleLeft;
        goalTextStyle.fontSize = (int) (30 * scaleForCurrRes.x);

        GUIStyle btnStyle = new GUIStyle(GUI.skin.button);
        btnStyle.wordWrap = true;
        btnStyle.normal.textColor = Color.black;

        availableGUIStyles.Add("FieldTitle",fieldTitleStyle);
        availableGUIStyles.Add("FieldContent",fieldContentStyle);
        availableGUIStyles.Add("GoalText",goalTextStyle);
        availableGUIStyles.Add("Button",btnStyle);
        hasInitGUIStyles = true;
    }
开发者ID:TAPeri,项目名称:WordsMatter,代码行数:30,代码来源:GoalWindow.cs


示例14: JBCStyle

    public JBCStyle()
    {
        bgTexture = new Texture2D(1, 1);
        bgTexture.SetPixel(0, 0, new Color(0f, 0f, 0f, 0.8f));
        bgTexture.Apply();

        HiddenScrollBar = new GUIStyle(GUI.skin.verticalScrollbar);
        HiddenScrollBar.fixedHeight = HiddenScrollBar.fixedWidth = 0;

        boxStyle = new GUIStyle();
        boxStyle.normal.background = bgTexture;
        boxStyle.normal.textColor = Color.white;

        menuStyle = new GUIStyle(GUI.skin.button);
        menuStyle.normal.textColor = Color.white;
        menuStyle.fontSize = MENU_FONT_SIZE;
        menuStyle.fontStyle = FontStyle.Bold;
        menuStyle.normal.textColor = new Color(0.8f, 0.6f, 0f);

        levelToStyle = new Dictionary<ConsoleLevel, GUIStyle>();

        GUIStyle style = MakeLogStyle();
        style.normal.textColor = new Color(0.62f, 0.82f, 0.62f);
        levelToStyle[ConsoleLevel.Debug] = style;
        style = MakeLogStyle();
        style.normal.textColor = new Color(1f, 0.87f, 0.87f);
        levelToStyle[ConsoleLevel.Info] = style;
        style = MakeLogStyle();
        style.normal.textColor = new Color(1f, 0.47f, 0.47f);
        levelToStyle[ConsoleLevel.Warn] = style;
        style = MakeLogStyle();
        style.normal.textColor = new Color(1f, 0.133f, 0.133f);
        levelToStyle[ConsoleLevel.Error] = style;
        levelToStyle[ConsoleLevel.Fatal] = style;
    }
开发者ID:junkbyte,项目名称:UnityConsole,代码行数:35,代码来源:JBCStyle.cs


示例15: OnGUI

	void OnGUI(){
		GUIStyle style = new GUIStyle ();
		style.fontSize = Mathf.RoundToInt(40*scale);
		style.normal.textColor = Color.white;
		style.alignment = TextAnchor.UpperCenter;
		GUI.Label (new Rect(Screen.width/2 - titleWidth/2, Screen.height * 0.05f*scale, titleWidth, titleHeight), "Word Snack",style);
		
		
		GUIStyle ButtonStyle = new GUIStyle ();
		ButtonStyle.fontSize = Mathf.RoundToInt(32*scale);
		ButtonStyle.normal.textColor = Color.white;
		ButtonStyle.normal.background = buttonBackground;
		ButtonStyle.alignment = TextAnchor.LowerCenter;
		GUI.BeginGroup (new Rect (Screen.width / 2 - buttonWidth/2, Screen.height * 0.5f, buttonWidth, buttonHeight));
		if (GUILayout.Button ("Play", ButtonStyle)) {
			Debug.Log ("Play is pressed");
			Application.LoadLevel(1);
		}
		GUILayout.Button ( "Instructions", ButtonStyle);
		GUILayout.Button ( "About", ButtonStyle);
		GUI.EndGroup ();
		
		Debug.Log (Screen.height);
		Debug.Log (Screen.width);
	}
开发者ID:imann24,项目名称:WordSnack,代码行数:25,代码来源:StartScreenGUI.cs


示例16: OnGUI

    void OnGUI()
    {
        //draw health bar
        m_Rectangle.x = Screen.width/2 - m_RectOffset.x;
        m_Rectangle.y = Screen.height - m_RectOffset.y;
        GUI.DrawTexture(m_Rectangle, m_Background);
        Rect partialRect = m_Rectangle;
        partialRect.width = m_Rectangle.width * (m_CurrentTime/m_WeaponRechargeTime);
        partialRect.x = m_Rectangle.x;
        GUI.DrawTexture(partialRect, m_Foreground);

        //draw label
        m_LabelRect.x = m_Rectangle.x-m_LabelOffset.x;
        m_LabelRect.y = m_Rectangle.y-m_LabelOffset.y;
        GUIStyle labelStyle = new GUIStyle();
        labelStyle.fontStyle = FontStyle.Bold;
        labelStyle.fontSize = 16;
        labelStyle.normal.textColor = Color.white;
        //labelStyle.font.material =
        GUI.Label(m_LabelRect,"Weapon",labelStyle);

        //draw glow
        m_GlowRect.x = Screen.width/2 - m_GlowOffset.x;
        m_GlowRect.y = Screen.height - m_GlowOffset.y;
        GUI.DrawTexture(m_GlowRect, m_Glow);
    }
开发者ID:HaoYuan90,项目名称:RealManAdventure,代码行数:26,代码来源:UIWeaponRechargeBar.cs


示例17: OnGUI

    // Update GUI
    void OnGUI()
    {
        // Game name
        GUIStyle startStyle = new GUIStyle();
        startStyle.font = scoreFont;
        startStyle.fontSize = 68;
        startStyle.normal.textColor = Color.black;
        startStyle.alignment = TextAnchor.UpperCenter;

        GUI.Label(new Rect((float)Screen.width/2.0f - 50,10,100,20), "ATAULFO HEARTQUEST", startStyle);

        // Press any key
        startStyle.fontSize = 48;

        GUI.Label(new Rect((float)Screen.width/2.0f - 50,Screen.height-Random.Range(100, 102),100,20), "* PRESS ANY KEY *", startStyle);

        // Graphics
        startStyle.fontSize = 20;
        startStyle.alignment = TextAnchor.UpperRight;
        GUI.Label(new Rect(Screen.width-120,Screen.height-200,100,20), "* Baboon Painters *", startStyle);
        GUI.Label(new Rect(Screen.width-120,Screen.height-180,100,20), "lesswanted", startStyle);
        GUI.Label(new Rect(Screen.width-120,Screen.height-160,100,20), "pikolop", startStyle);

        GUI.Label(new Rect(Screen.width-120,Screen.height-120,100,20), "* Music Gorilla *", startStyle);
        GUI.Label(new Rect(Screen.width-120,Screen.height-100,100,20), "maulo", startStyle);
        //GUI.Label(new Rect(Screen.width-120,Screen.height-140,100,20), "Ataulfo", startStyle);

        // Graphics
        startStyle.fontSize = 20;
        startStyle.alignment = TextAnchor.UpperLeft;
        GUI.Label(new Rect(20,Screen.height-200,100,20), "* Code Monkeys *", startStyle);
        GUI.Label(new Rect(20,Screen.height-180,100,20), "octal0", startStyle);
        GUI.Label(new Rect(20,Screen.height-160,100,20), "leosamu", startStyle);
        GUI.Label(new Rect(20,Screen.height-140,100,20), "materod", startStyle);
    }
开发者ID:materod,项目名称:AtaulfoHeartQuest,代码行数:36,代码来源:StartGameClass.cs


示例18: OnGUI

    void OnGUI()
    {
        //以下デバッグUIの表示

        GUIStyle labelStyle = new GUIStyle();
        labelStyle.alignment = TextAnchor.MiddleCenter;
        labelStyle.normal.textColor = Color.white;
        labelStyle.wordWrap = true;
        labelStyle.fontSize = 24;

        var centerX = Screen.width / 2;
        var tabHeight = Screen.height / 20;

        var buttonWidth = Screen.width - (Screen.width / 6);
        var buttonHeight = Screen.height / 15;

        Rect position;
        float yPosition = Screen.height / 3;

        //オファー
        position = new Rect(centerX - (buttonWidth / 2), yPosition, buttonWidth, buttonHeight);
        if (GUI.Button(position, "広告あり シーン1へ")) {
            Application.LoadLevel("SampleScene1");
        }
    }
开发者ID:MasatoKokuryo,项目名称:Test,代码行数:25,代码来源:SampleScene2.cs


示例19: List

    public static bool List(Rect position, ref bool showList, ref int listEntry, GUIContent buttonContent, GUIContent[] listContent,
	                         GUIStyle buttonStyle, GUIStyle boxStyle, GUIStyle listStyle)
    {
        int controlID = GUIUtility.GetControlID (popupListHash, FocusType.Passive);
                bool done = false;
                switch (Event.current.GetTypeForControl (controlID)) {
                case EventType.mouseDown:
                        if (position.Contains (Event.current.mousePosition)) {
                                GUIUtility.hotControl = controlID;
                                showList = true;
                        }
                        break;
                case EventType.mouseUp:
                        if (showList) {
                                done = true;
                        }
                        break;
                }

                GUI.Label (position, buttonContent, buttonStyle);
                if (showList) {
                        Rect listRect = new Rect (position.x, position.y, position.width, listStyle.CalcHeight (listContent [0], 1.0f) * listContent.Length);
                        GUI.Box (listRect, "", boxStyle);
                        listEntry = GUI.SelectionGrid (listRect, listEntry, listContent, 1, listStyle);
                }
                if (done) {
                        showList = false;
                }
                return done;
    }
开发者ID:nileshlg2003,项目名称:AR_App,代码行数:30,代码来源:Popup.cs


示例20: OnGUI

// ReSharper disable once UnusedMember.Local
    private void OnGUI()
    {
        if (rowStyle == null)
        {
            rowStyle = new GUIStyle(GUI.skin.button);
            RectOffset margin = rowStyle.margin;
            rowStyle.margin = new RectOffset(margin.left, margin.right, 1, 1);
        }

        GUILayout.BeginArea(new Rect(5, 40, 30, 255), GUI.skin.box);

        if (GUILayout.Button("-")) api.zoom--;

        for (int i = 3; i < 21; i++)
            if (GUILayout.Button("", rowStyle, GUILayout.Height(10))) api.zoom = i;

        if (GUILayout.Button("+")) api.zoom++;

        GUILayout.EndArea();

        GUI.Box(new Rect(5, 5, Screen.width - 10, 30), "");
        GUI.Label(new Rect(10, 10, 100, 20), "Find place:");
        search = GUI.TextField(new Rect(80, 10, Screen.width - 200, 20), search);
        if (Event.current.type == EventType.KeyUp &&
            (Event.current.keyCode == KeyCode.KeypadEnter || Event.current.keyCode == KeyCode.Return))
            api.FindLocation(search);
        if (GUI.Button(new Rect(Screen.width - 110, 10, 100, 20), "Search")) api.FindLocation(search);
    }
开发者ID:juliancruz87,项目名称:transpp,代码行数:29,代码来源:ExampleGUI.cs



注:本文中的GUIStyle类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# GUIText类代码示例发布时间:2022-05-24
下一篇:
C# GUIState类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap