Skip to content

Instantly share code, notes, and snippets.

@tsubaki
tsubaki / BallTag.cs
Created Mar 29, 2020
UnityPhysics 0.3.1と Entities 0.8.0 の組み合わせ
View BallTag.cs
using Unity.Collections;
using Unity.Entities;
using Unity.Jobs;
using Unity.Physics;
using Unity.Physics.Systems;
[GenerateAuthoringComponent]
public struct BallTag : IComponentData{}
[AlwaysUpdateSystem]
@tsubaki
tsubaki / BallTag.cs
Last active Mar 29, 2020
UnityPhysics 0.3.1と Entities 0.8.0 の組み合わせ
View BallTag.cs
using Unity.Collections;
using Unity.Entities;
using Unity.Jobs;
using Unity.Physics;
using Unity.Physics.Systems;
using static Unity.Entities.ComponentType;
namespace BallSystems
{
// ボール
@tsubaki
tsubaki / BallTag.cs
Created Mar 29, 2020
UnityPhysics 0.3.1と Entities 0.8.0 の組み合わせ
View BallTag.cs
using Unity.Collections;
using Unity.Entities;
using Unity.Jobs;
using Unity.Physics;
using Unity.Physics.Systems;
[GenerateAuthoringComponent]
public struct BallTag : IComponentData{}
[AlwaysUpdateSystem]
@tsubaki
tsubaki / MySystem.cs
Last active Mar 21, 2020
新しいEntitiesを使用するためのコード
View MySystem.cs
using Unity.Entities;
using Unity.Jobs;
using Unity.Mathematics;
using Unity.Transforms;
public class MySystem : SystemBase
{
protected override void OnUpdate()
{
var time = UnityEngine.Time.timeSinceLevelLoad;
View GameEvent.cs
using System.Collections;
using UnityEngine;
using UnityEngine.Events;
#if UNITY_EDITOR
using UnityEditorInternal;
using UnityEditor;
#endif
public class GameEvent : MonoBehaviour
{
@tsubaki
tsubaki / MySchedule.cs
Created Dec 22, 2019
Micro Game のScheduleの挙動
View MySchedule.cs
using System.Collections;
using System.Collections.Generic;
using Platformer.Core;
using UnityEngine;
using static Platformer.Core.Simulation;
public class MySchedule : MonoBehaviour
{
void Start()
{
@tsubaki
tsubaki / DisplayPlayerDistance.cs
Created Dec 8, 2019
MonoBehaviourとComponentDataの同期
View DisplayPlayerDistance.cs
using Unity.Entities;
using UnityEngine;
public class DisplayPlayerDistance : MonoBehaviour
{
DistanceFromPlayerAuthoring fromPlayer;
void Start()
{
View PositionUpdateSystem.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Unity.Jobs.LowLevel;
using Unity.Jobs;
using Unity.Jobs.LowLevel.Unsafe;
using Unity.Collections;
using Unity.Collections.LowLevel;
using Unity.Collections.LowLevel.Unsafe;
View DrawLine.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DrawLine : MonoBehaviour
{
private Queue<Vector3> queue;
private Vector3[] positions;
private Camera cachedCamera;
@tsubaki
tsubaki / ClickToEndBehaviour.cs
Last active Aug 14, 2020
UnityのTimel inで、クリックしたらクリップの末まで移動する
View ClickToEndBehaviour.cs
using UnityEngine;
using UnityEngine.Playables;
public class ClickToEndBehaviour : PlayableBehaviour
{
private PlayableDirector director { get; set; }
public override void OnPlayableCreate(Playable playable)
{
director = (playable.GetGraph().GetResolver() as PlayableDirector);
You can’t perform that action at this time.