11 2013 档案

摘要:using UnityEngine;using System.Collections;public class Distance : MonoBehaviour { public GameObject _A; float _distance; // Use this for initialization void Start () { } // Update is called once per frame void Update () { _distance = Mathf.Sqrt(Mathf.Pow((_A.... 阅读全文
posted @ 2013-11-29 19:47 古刹红罗 阅读(251) 评论(0) 推荐(0)
摘要:C#静态函数属于类而不属于具体对象,调用的时候不能用:对象.func()而是用:类名.func()静态函数里边只能有类的静态变量,不能有类的普通成员 阅读全文
posted @ 2013-11-28 11:52 古刹红罗 阅读(287) 评论(0) 推荐(0)
摘要:http://blog.csdn.net/feixiaoxing/article/details/7001999 阅读全文
posted @ 2013-11-28 11:44 古刹红罗 阅读(151) 评论(0) 推荐(0)
摘要:问题源自一个帖子,因为上传的图比较多,就另开了这个贴写下自己的试验结果,原帖在下面链接中http://game.ceeger.com/forum/read.php?tid=8911#infoNGUI中是用depth来控制sprite显示顺序的,本来这很好用,但碰到上面帖子中的问题时却不好解决了,于是我试验了下。以下是一些总结,不对的地方请指正。下面的内容可能看起来比较绕,这样的话只需实际试验下就能很容易的知道结果,呵呵如果还是看不明白,可以先看1楼,那里有个总结1,同一个panel下,同一个atlas的不同sprite的显示只受depth的控制,这是最经常用的方式。此时不论精灵的z轴如何变化, 阅读全文
posted @ 2013-11-27 13:52 古刹红罗 阅读(358) 评论(0) 推荐(0)
摘要:新增:http://www.360doc.com/content/13/1209/22/15011722_335835538.shtml[unity3d] iTween文档解析(1) (iTween方法和属性)分类:unity3diTween2012-03-15 20:452186人阅读评论(0)收藏举报文档integer脚本AudioFrom:pitch和volum属性提供的是初始值audioTo: pitch和volum属性提供的是终结值audioUpdate:pitch和volum属性提供的是终结值 此方法用于Update()方法中CameraFadeAdd:创建一个对象可以模拟摄相机的 阅读全文
posted @ 2013-11-25 13:09 古刹红罗 阅读(778) 评论(0) 推荐(0)
摘要:摄像机的渐隐渐现用CameraFadeTo等函数物体的透明度调整用FadeTo等函数物体的移动可以用moveto等函数如果用来做菜单按钮,用punch系列函数很快,PunchPosition,应该就是实现的位置上的小偏移物体的旋转RotateTo物体的缩放scaleto物体的抖动shake系列实现数值的持续变化,用valueto,比如金币滚动的效果示例:iTween.rotateFrom(go,{"y":90, "time":1.5, "transition":"easeInExpo"});//旋转从90度到当前i 阅读全文
posted @ 2013-11-25 11:01 古刹红罗 阅读(851) 评论(0) 推荐(0)
摘要:using UnityEngine;using System.Collections;public class Orientation : MonoBehaviour { // Use this for initialization public enum _trans{position,rotation}; public _trans _t; public float _limitMin=-180; public float _limitMax=180; float _positionX; float _rotationY; float _de... 阅读全文
posted @ 2013-11-25 09:20 古刹红罗 阅读(226) 评论(0) 推荐(0)
摘要:http://msdn.microsoft.com/zh-cn/library/ebca9ah3.aspx 阅读全文
posted @ 2013-11-22 11:19 古刹红罗 阅读(911) 评论(0) 推荐(0)
摘要:Happydayo:只要实现这个接口都可以作为返回值 如果用具体类做返回值只能返回一种类型无法实现多态如果用接口作为返回值类型只要实现了这个接口的类都可以作为返回值So为了实现多态返回值类型一般定为接口或基类 一个接口:性别;二个类:,男,女;男和女实现性别接口;如果函数的返回值是男;那只能返回男这个类型如果是女只能返回女这个类型,这样限制了这个函数的返回 类型那如果用接口性别作为返回值类型男和女都是可以作为返回值的 这就是所谓的不用具体用抽象 抽象编程就是这样 阅读全文
posted @ 2013-11-22 11:18 古刹红罗 阅读(239) 评论(0) 推荐(0)
摘要:using UnityEngine;using System.Collections;public class UV_Animation : MonoBehaviour { public float _columnCount=1;//行数 public float _rowCount=1;//列数 public int _framePerSecond;//帧速率 float _colIndex=0; float _rowIndex=0; bool _isPlay=false; float myTime=0; // Use this for ini... 阅读全文
posted @ 2013-11-22 00:14 古刹红罗 阅读(966) 评论(0) 推荐(0)
摘要:Rigidbody.AddForceAtPosition 在位置上添加力function AddForceAtPosition (force : Vector3, position : Vector3, mode : ForceMode = ForceMode.Force) : voidpublic class example : MonoBehaviour { void ApplyForce(Rigidbody body) { Vector3 direction = body.transform.position - transform.position; body.AddForceAt.. 阅读全文
posted @ 2013-11-18 21:50 古刹红罗 阅读(106) 评论(0) 推荐(0)
摘要:using UnityEngine;using System.Collections;public class Test_1 : MonoBehaviour { // Use this for initialization IEnumerator onStart() { Debug.Log("--------------------------"); AsyncOperation async = Application.LoadLevelAdditiveAsync("B"); yield return async; Debug... 阅读全文
posted @ 2013-11-14 17:39 古刹红罗 阅读(147) 评论(0) 推荐(0)
摘要:http://game.ceeger.com/forum/read.php?tid=10244&fid=16 阅读全文
posted @ 2013-11-12 11:31 古刹红罗 阅读(103) 评论(0) 推荐(0)
摘要:http://vfxinfo.net/2013/11/10/create-a-light-from-view-script-with-python-in-maya/ 阅读全文
posted @ 2013-11-12 11:19 古刹红罗 阅读(198) 评论(0) 推荐(0)
摘要:通常用于指示这个类或属性有什么样的特征,在后续的调用中可以通过反射获取到,并根据值做一些处理http://technet.microsoft.com/zh-cn/library/system.attribute.aspx[SerializeField] 阅读全文
posted @ 2013-11-12 09:29 古刹红罗 阅读(126) 评论(0) 推荐(0)
摘要:using UnityEngine;using System.Collections;public class Test_001 : MonoBehaviour { // Use this for initialization public class SomeClass{ public int data1=0; int data2=5; public int add(){ Debug.Log("SomeClass"); return data1+data2; } } v... 阅读全文
posted @ 2013-11-10 12:02 古刹红罗 阅读(153) 评论(0) 推荐(0)
摘要:C#基类和派生类(转)1.基类和派生类的一些基本概念classB : A{}A是基类,B是派生类.一个类最多只允许从一个类中派生.class C : B{}B还可以充当C的派生类继承总是隐式为public的,System.Object是所有类的根编译器会把你的类悄悄的编译成 class A : System.Object{}2.调用基类的构造函数class B : A{public B(string sqlstr) : base(sqlstr){}}3基类派生类对象之间的关系class A{}class B : A {}class C: A {}B b = new B();C c = b; . 阅读全文
posted @ 2013-11-10 11:16 古刹红罗 阅读(606) 评论(0) 推荐(0)
摘要:http://msdn.microsoft.com/zh-cn/library/ebca9ah3.aspx 阅读全文
posted @ 2013-11-10 10:57 古刹红罗 阅读(686) 评论(0) 推荐(0)
摘要:http://www.narkii.com/club/thread-297439-1.html 阅读全文
posted @ 2013-11-07 09:36 古刹红罗 阅读(196) 评论(0) 推荐(0)
摘要:int get() {}void set(int value) {}private int a;public int A{ get {return a;} set {a = value}}一个叫get的,不接受参数,返回一个定义好的类型。一个叫set的,接受一个定义好类型的参数,返回void。http://blog.csdn.net/bmzydream_007/article/details/4261402Public float A{ set { Debug.Log("Just boring!"); }}Public float A{ get... 阅读全文
posted @ 2013-11-05 22:07 古刹红罗 阅读(620) 评论(0) 推荐(0)
摘要:摄像机做成SolidColorDepthOnly在RenderTexture上有问题 阅读全文
posted @ 2013-11-05 20:59 古刹红罗 阅读(217) 评论(0) 推荐(0)
摘要:Unity本身有PlayerPrefs来做一些数据的保存和读取,也可以通过循环来做批量的读取或者保存,下面这个脚本可以方便的调用用来做上面批量的工作,比如读取一组文本数组数据和保存一组文本数组数据.建议把这个脚本放在Standard Assets目录下,这样可以按照下面的方法方便的调用它.现在包含了下面这些命令: PlayerPrefsX.SetVector3 PlayerPrefsX.GetVector3 PlayerPrefsX.SetIntArray PlayerPrefsX.GetIntArray PlayerPrefsX.SetFloatArray PlayerPrefsX.GetF 阅读全文
posted @ 2013-11-04 13:38 古刹红罗 阅读(1952) 评论(0) 推荐(0)
摘要:protected这个是成员才能使用的方法override父类虚函数的实现out是在函数内部实例化变量 阅读全文
posted @ 2013-11-01 01:01 古刹红罗 阅读(108) 评论(0) 推荐(0)