摘要: //二级旋钮public void TwoStateClick(GameObject game) { CheckState = !CheckState; if (CheckState == false) { //左转,默认状态 game.GetComponent().transform.lo... 阅读全文
posted @ 2017-03-02 14:07 CocomoNo1 阅读(99) 评论(0) 推荐(0) 编辑
摘要: //方法一: Image/pic 在 Assets/Resources/目录下 Image _myImage; void Start() { _myImage.sprite = Resources.Load("Image/pic", typeof(Sprite)) as Sprite; } //方法二:mySprite 为外部指定的图片资源 Image _myImage; Spr... 阅读全文
posted @ 2017-02-28 10:14 CocomoNo1 阅读(1968) 评论(0) 推荐(0) 编辑
摘要: public IEnumerator IData() { yield return null; while (true) { TemperatureData(45f, 50f); yield return new WaitForSeconds(2f)... 阅读全文
posted @ 2016-12-08 13:29 CocomoNo1 阅读(177) 评论(0) 推荐(0) 编辑
摘要: using UnityEngine; using System.Collections; using UnityEngine.UI; using System.Collections.Generic; public class CircuitControl : MonoBehaviour { public List RBsprites = new List();//存放红黑触笔的图片 ... 阅读全文
posted @ 2016-12-07 13:18 CocomoNo1 阅读(156) 评论(0) 推荐(0) 编辑
摘要: Mould.transform.localPosition = new Vector3(Mathf.MoveTowards(Mould.transform.localPosition.x, -30f, Time.deltaTime * 2f), Mould.transform.localPosition.y, Mould.transform.localPosition.z); 阅读全文
posted @ 2016-11-25 19:07 CocomoNo1 阅读(134) 评论(0) 推荐(0) 编辑
摘要: using UnityEngine; using System.Collections; using UnityEngine.UI; public class DirectionMove : MonoBehaviour { public GameObject WestMoveTog;//西移 public GameObject EastMoveTog;//东移 pub... 阅读全文
posted @ 2016-11-23 18:51 CocomoNo1 阅读(347) 评论(0) 推荐(0) 编辑
摘要: 单例模式(也叫单件模式)的作用就是保证在整个应用程序的生命周期中, 任何一个时刻,单例类的实例都只存在一个(当然也可以不存在)。 单例模式脚本,非静态方法需要挂载,否则会报空; 脚本需挂载 阅读全文
posted @ 2016-10-11 11:05 CocomoNo1 阅读(126) 评论(0) 推荐(0) 编辑
摘要: using UnityEngine; using System.Collections; using UnityEngine.UI; public class WinControl : MonoBehaviour { public GameObject WinBtn1; public GameObject WinBtn2; public GameObject WinBtn... 阅读全文
posted @ 2016-09-22 09:44 CocomoNo1 阅读(158) 评论(0) 推荐(0) 编辑
摘要: using UnityEngine; using System.Collections; public class ChangeMatericals : MonoBehaviour { public Material IniMaterical;// 替换前材质(原材质) public Material ChangeMaterical;//替换后的材质(半透明材质) p... 阅读全文
posted @ 2016-09-14 08:48 CocomoNo1 阅读(293) 评论(0) 推荐(0) 编辑
摘要: 公共变量的脚本 Toogle和Button控制同一窗口的显隐 阅读全文
posted @ 2016-08-27 14:44 CocomoNo1 阅读(310) 评论(0) 推荐(0) 编辑