コード例 #1
0
    void CheckEnemy()
    {
        NativeArray <bool> result = new NativeArray <bool>(1, Allocator.TempJob);

        result[0] = false;
        CatchJob catchJob = new CatchJob {
            x      = (int)player.x,
            z      = (int)player.z,
            result = result
        };
        JobHandle jobHandle = catchJob.Schedule(this);

        jobHandle.Complete();
        if (result[0])
        {
            DestroyThemAll destroyJob = new DestroyThemAll {
                CommandBuffer = endSimCommandBufferSystem.CreateCommandBuffer().ToConcurrent()
            };
            JobHandle destroyJobHandle = destroyJob.Schedule(this);
            destroyJobHandle.Complete();
            RecursiveBacktracking.StaticReset();
            MenuController.LoadMazeStatic();
        }
        result.Dispose();
    }
コード例 #2
0
    void BackToMenu()
    {
        DestroyThemAll destroyJob = new DestroyThemAll {
            CommandBuffer = endSimCommandBufferSystem.CreateCommandBuffer().ToConcurrent()
        };
        JobHandle destroyJobHandle = destroyJob.Schedule(this);

        destroyJobHandle.Complete();
        RecursiveBacktracking.StaticReset();
        MenuController.LoadMenuStatic();
    }