Skip to content

Instantly share code, notes, and snippets.

View CopyTransformToGameObjectConvert.cs
using Unity.Entities;
using Unity.Transforms;
using UnityEngine;
public class CopyTransformToGameObjectConvert : MonoBehaviour, IConvertGameObjectToEntity
{
public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
{
dstManager.AddComponentData(entity, new CopyTransformToGameObject());
}
@tsubaki
tsubaki / ChangeTargetAnimator.cs
Created Jul 30, 2017
PlayableOutputのターゲットを切り替えるサンプル
View ChangeTargetAnimator.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.Animations;
public class ChangeTargetAnimator : MonoBehaviour
{
PlayableGraph graph;
AnimationPlayableOutput output;
View HitTestSystem.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Unity.Physics;
using Unity.Mathematics;
using Unity.Transforms;
using Unity.Entities;
using Unity.Physics.Systems;
[AlwaysUpdateSystem]
View ChunkIterationBootstrap.cs
using UnityEngine;
using Unity.Entities;
using Unity.Collections;
using Unity.Transforms;
using Unity.Rendering;
public class ChunkIterationBootstrap : MonoBehaviour
{
[SerializeField] RenderMesh meshInstanceRenderer;
View RemoveSystem.cs
using Unity.Entities;
using Unity.Jobs;
using Unity.Transforms;
using UnityEngine;
using Unity.Mathematics;
using Unity.Collections;
class RangeCheckSystem : JobComponentSystem
{
EntityCommandBufferSystem barrier; // EntityCommandBufferSystemを用意
View GameController.cs
using UnityEngine;
using Unity.Entities;
using Unity.Transforms;
using Unity.Collections;
using Unity.Mathematics;
using Random = Unity.Mathematics.Random;
public class GameController : MonoBehaviour
{
[SerializeField] GameObject prefab;
@tsubaki
tsubaki / Component.cs
Last active Apr 5, 2019
ISystemStateComponentData Sample
View Component.cs
using Unity.Entities;
using System;
public struct Life : IComponentData{}
[Serializable]
public struct LifeState : ISystemStateComponentData
{
public Place lastPlace;
}
@tsubaki
tsubaki / DestroyCheckSystem.cs
Created Apr 4, 2019
ISystemStateComponentDataのサンプル
View DestroyCheckSystem.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Unity.Entities;
using Unity.Jobs;
using Unity.Mathematics;
using Unity.Collections;
public class DestroyCheckSystem : JobComponentSystem
{
@tsubaki
tsubaki / ReplaceMissingAnimationCurve.cs
Last active Apr 2, 2019
AnimationCurveのmissingを修正するサポート
View ReplaceMissingAnimationCurve.cs
using UnityEngine;
using System.Collections;
using UnityEditor;
using UnityEditorInternal;
using System.Linq;
using System.Collections.Generic;
public class ReplaceMissingAnimationCurve : EditorWindow
{
Animator animator;
View VertexRotation.shader
Shader "VertexRotation"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType"="Opaque" "DisableBatching" = "True"}
You can’t perform that action at this time.