Пример #1
0
        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            NativeArray <CharaPos>     charaPoses     = m_query.ToComponentDataArray <CharaPos>(Allocator.TempJob);
            NativeArray <CharaLastPos> charaLastPoses = m_query.ToComponentDataArray <CharaLastPos>(Allocator.TempJob);
            NativeArray <CharaQueue>   charaQueues    = m_query.ToComponentDataArray <CharaQueue>(Allocator.TempJob);
            NativeArray <CharaFlag>    charaFlags     = m_query.ToComponentDataArray <CharaFlag>(Allocator.TempJob);

            NativeMapTips mapTips = Shared.m_mapTipList.m_MapTipList[0];
            var           job     = new MapJob()
            {
                m_charaPoses     = charaPoses,
                m_charaLastPoses = charaLastPoses,
                m_charaQueues    = charaQueues,
                m_charaFlags     = charaFlags,
                MapSizeX         = mapTips.m_mapSizeX,
                MapSizeY         = mapTips.m_mapSizeY,
                MapSizeZ         = mapTips.m_mapSizeZ,
                Shapes           = mapTips.shapes,
                Events           = mapTips.events,
            };

            inputDeps = job.Schedule(inputDeps);
            inputDeps.Complete();

            m_query.CopyFromComponentDataArray(job.m_charaQueues);
            m_query.CopyFromComponentDataArray(job.m_charaPoses);

            charaFlags.Dispose();
            charaQueues.Dispose();
            charaPoses.Dispose();
            charaLastPoses.Dispose();

            return(inputDeps);
        }
Пример #2
0
        public void Init()
        {
            m_MapTipList = new List <NativeMapTips>();

            var loadObjects = Resources.LoadAll <MapTips>(PathSettings.MapData);

            if (loadObjects.Length == 0)
            {
                Debug.LogError("MapTip None");
                return;
            }

            foreach (var item in loadObjects)
            {
                var newMapTips = new NativeMapTips(item);
                m_MapTipList.Add(newMapTips);
            }
        }