C#1.0&2.0语法实验

  1. 如下
public class demo : MonoBehaviour
{
    private void Start()
    {
        //foreach (var item in SomeNumbes())
        //{
        //    print(item);
        //}
        //协变待补充

        //ProcessMessages();
        //1.0相关的介绍
        // checked 是否容忍移除
        // goto语句用法
        //空语句
        //特效省略
        Skkk();
    }
    void ProcessMessages()
    {
        while (false) ;
    }

    void Skkk()
    {
        //    for(int i = 0; i < 4; i++)
        //    {
        //        for(int j = 0; j < 5; j++)
        //        {
        //            if(i==j)
        //            goto Foud;
        //        }
        //    }

        //Foud: print("ggg");


    }
    public static System.Collections.IEnumerable SomeNumbes()
    {
        yield return 3;
        yield return 5;
        yield break;
        yield return 8;
    }
}

猜你喜欢

转载自blog.csdn.net/qq_37811712/article/details/86610117
今日推荐