上一页 1 ··· 4 5 6 7 8 9 下一页
摘要: 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 古刹红罗 阅读(964) 评论(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 古刹红罗 阅读(104) 评论(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 古刹红罗 阅读(145) 评论(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 古刹红罗 阅读(196) 评论(0) 推荐(0)
摘要: 通常用于指示这个类或属性有什么样的特征,在后续的调用中可以通过反射获取到,并根据值做一些处理http://technet.microsoft.com/zh-cn/library/system.attribute.aspx[SerializeField] 阅读全文
posted @ 2013-11-12 09:29 古刹红罗 阅读(125) 评论(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 古刹红罗 阅读(149) 评论(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 古刹红罗 阅读(603) 评论(0) 推荐(0)
摘要: http://msdn.microsoft.com/zh-cn/library/ebca9ah3.aspx 阅读全文
posted @ 2013-11-10 10:57 古刹红罗 阅读(685) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 下一页