UNITY3D 如何添加两个按钮?下面是一个按钮的代码,如何在其下方再添加一个按钮?求高手解救。初学UNITY!

UNITY3D 如何添加两个按钮?下面是一个按钮的代码,如何在其下方再添加一个按钮?求高手解救。初学UNITY!,第1张

var customSkin:GUISkin

function OnGUI () {

if(GUI.Button(Rect(Screen.width/2-50, Screen.height/2+200, 100,50), "Play game"))

{

print("You clicked me")

Application.LoadLevel(1)

}

//GUI.Button(Rect(Screen.width/2-50, Screen.height/2+260, 100,50), "exit game")

if(GUI.Button(Rect(Screen.width/2-50, Screen.height/2+260, 100,50), "exit game"))

{

print("You clicked me")

Application.LoadLevel(2)

}

}

}

using com.game.vo

using Com.Game.Module.Chat

using System.Collections

using System.Collections.Generic

using UnityEditor

using UnityEngine

public class GM : MonoBehaviour {

    //[MenuItem("GM/super_long")]

    //static void ShowWindow()

    //{

    //    ChatMode.Instance.SendPublicMsg((byte)ChatType.World, "#super_long")

    //}

    [MenuItem("GM/1")]

    static void ShowWindow1()

    {

        ChatMode.Instance.SendPublicMsg((byte)ChatType.World, "#gold 10000000")

        ChatMode.Instance.SendPublicMsg((byte)ChatType.World, "#diam 10000000")

        ChatMode.Instance.SendPublicMsg((byte)ChatType.World, "#lvl 500")

        for (int i = 1i <= 10i++)

        {

            int id = 100009090 + i * 1000000 + MeVo.instance.job * 100000

            ChatMode.Instance.SendPublicMsg((byte)ChatType.World, "#goods " + id)

        }

        ChatMode.Instance.SendPublicMsg((byte)ChatType.World, "#tk 100007")

        ChatMode.Instance.SendPublicMsg((byte)ChatType.World, "#mv 10000")

        //ChatMode.Instance.SendPublicMsg((byte)ChatType.World, "#chapter 6")

        //ChatMode.Instance.SendPublicMsg((byte)ChatType.World, "#kick")

}

[MenuItem("GM/2")]

static void ShowWindow2()

{

    ChatMode.Instance.SendPublicMsg((byte)ChatType.World, "#sc_start")

    }

[MenuItem("GM/3")]

static void ShowWindow3()

{

ChatMode.Instance.SendPublicMsg((byte)ChatType.World, "#bubble_boss")

}

}


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/bake/11680317.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-17
下一篇 2023-05-17

发表评论

登录后才能评论

评论列表(0条)

保存