Skip to content

Instantly share code, notes, and snippets.

@tsubaki
tsubaki / Sample.cs
Last active Mar 1, 2019
ResourceManagerの超小さい例
View Sample.cs
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.ResourceManagement;
class Sample : MonoBehaviour
{
void Start()
{
// 初期化
View TagProvider.cs
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Unity.QuickSearch;
using UnityEngine;
using System;
using UnityEditor;
using UnityEditorInternal;
public class TagProvider : MonoBehaviour
View NativeListExample.cs
using UnityEngine;
using Unity.Collections;
using Unity.Jobs;
public class NativeListExample : MonoBehaviour
{
JobHandle handle;
NativeQueue<int> queue;
NativeList<int> list;
View NewComponentDataArrayWithJobSampleSystem.cs
using Unity.Entities;
using Unity.Transforms;
using Unity.Collections;
using Unity.Mathematics;
using Unity.Jobs;
public class NewComponentDataArrayWithJobSampleSystem : JobComponentSystem
{
ComponentGroup playerGroup, enemyGroup;
View NewComponentDataArraySampleSystem.cs
using Unity.Entities;
using Unity.Transforms;
using Unity.Collections;
using Unity.Mathematics;
public class NewComponentDataArraySampleSystem : ComponentSystem
{
ComponentGroup playerGroup, enemyGroup;
protected override void OnCreateManager()
We couldn’t find that file to show.
@tsubaki
tsubaki / SampleSystems.cs
Last active Feb 19, 2019
GetSingletonのサンプル
View SampleSystems.cs
using UnityEngine;
using Unity.Entities;
public class DamageSystem : ComponentSystem
{
protected override void OnCreateManager()
{
RequireSingletonForUpdate<Score>(); // Scoreがある場合のみSystemが動作するようにする
}
@tsubaki
tsubaki / SpawnEntitySystem.cs
Created Feb 18, 2019
Entityを一気に初期化するテスト
View SpawnEntitySystem.cs
using System.Collections;
using System.Collections.Generic;
using Unity.Burst;
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
using Unity.Entities;
using Unity.Jobs;
using Unity.Jobs.LowLevel.Unsafe;
using Unity.Transforms;
using UnityEngine;
View IJobParallelForFilterTest.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Unity.Jobs;
using UnityEngine.Jobs;
using Unity.Collections;
using Unity.Mathematics;
public class IJobParallelForFilterTest : MonoBehaviour
{
View SampleSystem3.cs
using Unity.Entities;
public class SampleSystem3 : ComponentSystem
{
protected override void OnUpdate()
{
Entities.ForEach((Entity entity, ref Score score) => {
// EntityManager.DestroyEntity(entity) // エラーが出る
PostUpdateCommands.DestroyEntity(entity); // こちらならOK
You can’t perform that action at this time.