C

From 呼吸的草稿本

Jump to: navigation, search

http://msdn.microsoft.com/en-us/library/x53a06bb(VS.71).aspx

上面为微软的官方文档,链接是c# 关键词

http://www.unifycommunity.com/wiki/index.php?title=Programming

unity 官方教程 for c# 。正在研究中



额外的语法:

  • foreach (ElementType element in collection) statement
  • yield

void Start () { StartCoroutine(YieldTest(1,2)); }

   public IEnumerator YieldTest ( float idleTime, float durationTime)
   {

Debug.Log("Begin idle:"+Time.time);

       yield return new WaitForSeconds (idleTime);

Debug.Log("Enter Duration:"+Time.time); float i = 0;

       while (i <= durationTime) 
       {

i += Time.deltaTime;


           //yield return true; 

yield return new WaitForSeconds (0.1f);

       }

Debug.Log("end "+Time.time);

   }
Personal tools