- 1
- 0
- 约2.66千字
- 约 6页
- 2018-05-25 发布于贵州
- 举报
unity3d游戏开发之回馈IOS高等界面消息
上一章介绍了IOS高级界面向?? ?? ? Project栏目中创建一个c#脚本,命名为Main.cs ,之前没有使用过 C#写脚本,今天我用C#来写这个脚本,哇咔咔~~~ 如下图所示将脚本拖动在摄像机上,脚本中声明两个Texture 类型变量用来保存按钮绘制的图片资源。? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ???? ?? ? Main.cs 代码?
using UnityEngine;
using System.Collections;
??
public class Main : MonoBehaviour {
??
//声明两个Texture变量,图片资源在外面连线赋值
public Texture Button0;
public Texture Button1;
??
? ? // Use this for initialization
? ? void Start () {
??
? ? }
??
? ? // Update is called once per frame
? ? void Update () {
??
? ? }
??
? ? //这个方法用于绘制
? ? void OnGUI() {
? ?? ???//绘制两个按钮
? ?? ???if(GUI.Button(new Rect(0,44,120,120),But
原创力文档

文档评论(0)