Example #1
0
    void Awake()
    {
        PuzzlesJudge = new GameObject[8];
        Instance     = this;

        indx = Random.Range(0, PuzzleGrids.Length - 1);   //保持最后一块总有拼图,防止随机出来拼好的拼图
        for (int i = 0; i < PuzzleGrids.Length; i++)
        {
            if (i == indx)
            {
                continue;                          //随机选择空出的格子(除了最后一块)
            }
            GameObject FixPuzzle = Instantiate(GetRandomPuzzle(Puzzles));
            FixPuzzle.transform.SetParent(PuzzleGrids[i].transform);
            FixPuzzle.transform.localPosition = Vector3.zero;
            FixPuzzle.transform.localScale    = Vector3.zero;
            FixPuzzle.transform.localScale    = new Vector3(1, 1, 0);
        }
        PuzzlesJudge[0] = GameObject.Find("Puzzle(Clone)");
        PuzzlesJudge[1] = GameObject.Find("Puzzle1(Clone)");
        PuzzlesJudge[2] = GameObject.Find("Puzzle2(Clone)");
        PuzzlesJudge[3] = GameObject.Find("Puzzle3(Clone)");
        PuzzlesJudge[4] = GameObject.Find("Puzzle4(Clone)");
        PuzzlesJudge[5] = GameObject.Find("Puzzle5(Clone)");
        PuzzlesJudge[6] = GameObject.Find("Puzzle6(Clone)");
        PuzzlesJudge[7] = GameObject.Find("Puzzle7(Clone)");
    }
Example #2
0
        /// <summary>
        /// 测试 泛型的方法. (类是普通,仅方法是泛型)
        /// </summary>
        static void TestGenericMethod()
        {
            Console.WriteLine("测试 泛型的方法. (类是普通,仅方法是泛型)");

            List <Int32> list = RandomAdd.GetRandomData <List <Int32> >();

            RandomAdd.ShowRandomData <List <Int32> >(list);


            LinkedList <Int32> linkList = RandomAdd.GetRandomData <LinkedList <Int32> >();

            RandomAdd.ShowRandomData <LinkedList <Int32> >(linkList);
        }