Upload project
This commit is contained in:
1 parent
6bbeab16d1
commit
bf545f3baf
371 files changed
+91095
No files matched your search
+8
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 99214d3f1d71df340b942a6ad26882ae
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
using Unity.Burst;
|
||||
using Unity.Collections;
|
||||
using Unity.Entities;
|
||||
using Unity.Jobs;
|
||||
using Unity.Mathematics;
|
||||
using Unity.Transforms;
|
||||
|
||||
[UpdateInGroup(typeof(PresentationSystemGroup))]
|
||||
public partial class MainCameraSystem : SystemBase
|
||||
{
|
||||
protected override void OnUpdate()
|
||||
{
|
||||
if (MainGameObjectCamera.Instance != null && SystemAPI.HasSingleton<MainEntityCamera>())
|
||||
{
|
||||
Entity mainEntityCameraEntity = SystemAPI.GetSingletonEntity<MainEntityCamera>();
|
||||
LocalToWorld targetLocalToWorld = SystemAPI.GetComponent<LocalToWorld>(mainEntityCameraEntity);
|
||||
MainGameObjectCamera.Instance.transform.SetPositionAndRotation(targetLocalToWorld.Position, targetLocalToWorld.Rotation);
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7d4fbc2db2fb32d48b168c795a5c3afd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
using Unity.Collections;
|
||||
using Unity.Entities;
|
||||
using Unity.Mathematics;
|
||||
|
||||
[Serializable]
|
||||
public struct MainEntityCamera : IComponentData
|
||||
{
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9680d5663c7e4b24a9308dce893ab885
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Unity.Entities;
|
||||
|
||||
[DisallowMultipleComponent]
|
||||
public class MainEntityCameraAuthoring : MonoBehaviour
|
||||
{
|
||||
public class Baker : Baker<MainEntityCameraAuthoring>
|
||||
{
|
||||
public override void Bake(MainEntityCameraAuthoring authoring)
|
||||
{
|
||||
Entity entity = GetEntity(TransformUsageFlags.Dynamic);
|
||||
AddComponent<MainEntityCamera>(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 91cffade3faa23640921cbb79b1e6bb0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
|
||||
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class MainGameObjectCamera : MonoBehaviour
|
||||
{
|
||||
public static Camera Instance;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
Instance = GetComponent<UnityEngine.Camera>();
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ef98a7c3224c6704d976c8bd33dfc59e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using Unity.Burst;
|
||||
using Unity.Entities;
|
||||
using UnityEngine;
|
||||
|
||||
[UpdateInGroup(typeof(FixedStepSimulationSystemGroup), OrderLast = true)]
|
||||
[BurstCompile]
|
||||
public partial struct FixedTickSystem : ISystem
|
||||
{
|
||||
public struct Singleton : IComponentData
|
||||
{
|
||||
public uint Tick;
|
||||
}
|
||||
|
||||
public void OnCreate(ref SystemState state)
|
||||
{
|
||||
if (!SystemAPI.HasSingleton<Singleton>())
|
||||
{
|
||||
Entity singletonEntity = state.EntityManager.CreateEntity();
|
||||
state.EntityManager.AddComponentData(singletonEntity, new Singleton());
|
||||
}
|
||||
}
|
||||
|
||||
[BurstCompile]
|
||||
public void OnUpdate(ref SystemState state)
|
||||
{
|
||||
ref Singleton singleton = ref SystemAPI.GetSingletonRW<Singleton>().ValueRW;
|
||||
singleton.Tick++;
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d6fbafd4891f00443b6216ceb5e730e2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Unity.Entities;
|
||||
using Unity.Mathematics;
|
||||
using UnityEngine;
|
||||
|
||||
public struct FixedInputEvent
|
||||
{
|
||||
private byte _wasEverSet;
|
||||
private uint _lastSetTick;
|
||||
|
||||
public void Set(uint tick)
|
||||
{
|
||||
_lastSetTick = tick;
|
||||
_wasEverSet = 1;
|
||||
}
|
||||
|
||||
public bool IsSet(uint tick)
|
||||
{
|
||||
if (_wasEverSet == 1)
|
||||
{
|
||||
return tick == _lastSetTick;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b8544c6607fc2464898a9419ad9e6edf
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in new issue
Block a user