Skip to content

Instantly share code, notes, and snippets.

@tsubaki
Created April 25, 2018 14:47
Show Gist options
  • Save tsubaki/a3c997c82e537eb088f0affd0fbe15d4 to your computer and use it in GitHub Desktop.
Save tsubaki/a3c997c82e537eb088f0affd0fbe15d4 to your computer and use it in GitHub Desktop.
using System.Collections;
using System.Collections.Generic;
using Unity.Collections;
using Unity.Jobs;
using UnityEngine;
public class AnyComponent : MonoBehaviour
{
NativeArray<int> array;
void OnEnable()
{
NativeArray<int> array = new NativeArray<int>(1, Allocator.Persistent);
}
void OnDisable()
{
array.Dispose(); // 忘れるとエラー
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment