首页 > 代码库 > Unity multiplayer
Unity multiplayer
using UnityEngine;
using System.Collections;
public class multiplayer_Button : MonoBehaviour {
void OnGUI()
{
const int buttonWidth = 150;
const int buttonHeight = 60;
// Determine the button‘s place on screen
// Center in X, 2/3 of the height in Y
Rect buttonRect = new Rect(
Screen.width / 2 - (buttonWidth / 2) +200,
(Screen.height / 2) - (buttonHeight / 2),
buttonWidth,
buttonHeight
);
GUIStyle invisibox;
invisibox = new GUIStyle ();
//invisibox.alignment = TextAnchor.MiddleCenter;
//invisibox.normal.textColor = new Color(0,100,0);
//invisibox.fontSize = 30;
if(GUI.Button(buttonRect,"",invisibox))
{
Application.LoadLevel("multSurvival");
}
}
}
using System.Collections;
public class multiplayer_Button : MonoBehaviour {
void OnGUI()
{
const int buttonWidth = 150;
const int buttonHeight = 60;
// Determine the button‘s place on screen
// Center in X, 2/3 of the height in Y
Rect buttonRect = new Rect(
Screen.width / 2 - (buttonWidth / 2) +200,
(Screen.height / 2) - (buttonHeight / 2),
buttonWidth,
buttonHeight
);
GUIStyle invisibox;
invisibox = new GUIStyle ();
//invisibox.alignment = TextAnchor.MiddleCenter;
//invisibox.normal.textColor = new Color(0,100,0);
//invisibox.fontSize = 30;
if(GUI.Button(buttonRect,"",invisibox))
{
Application.LoadLevel("multSurvival");
}
}
}
Unity multiplayer
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。