Unity multiplayer
Posted llguanli
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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的主要内容,如果未能解决你的问题,请参考以下文章
Unity3D资源文件 ③ ( Unity 资源包简介 | 导出 Unity 资源包 | 导出资源包的包含依赖选项 | 导入 Unity 资源包 | Unity 资源商店 )