コード例 #1
0
        public void NativeSortedSetAdd()
        {
            for (int i = 0; i < COUNT; i++)
            {
                ndict.Add(i, i * i);
            }

            for (int i = 0; i < COUNT; i++)
            {
                ndict.Remove(i);
            }
        }
コード例 #2
0
    void RunTest()
    {
        NativeDictionary <int, int, IntEqual> dict = new NativeDictionary <int, int, IntEqual>(5, Allocator.Temp, new IntEqual());

        for (int i = 0; i < 50; ++i)
        {
            dict.Add(i, i + 5);
        }
        for (int i = 0; i < 10; ++i)
        {
            dict.Remove(i);
        }
        Debug.Log(dict.Length);
        for (int i = 0; i < 50; ++i)
        {
            int value;
            if (dict.Get(i, out value))
            {
                Debug.Log(value);
            }
        }
    }