diff --git a/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer.meta b/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer.meta new file mode 100644 index 00000000..c712628c --- /dev/null +++ b/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 409c5086af6f17045acadcd6198cfc2a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scenes.meta b/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scenes.meta new file mode 100644 index 00000000..7daf0245 --- /dev/null +++ b/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scenes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3b81d953fa7983342b8732ac23b13916 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scenes/SubScenes.meta b/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scenes/SubScenes.meta new file mode 100644 index 00000000..65ccd63f --- /dev/null +++ b/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scenes/SubScenes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f0adb98a47903e640a2c20a69e3753d2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scenes/SubScenes/Timer_SubScene.unity b/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scenes/SubScenes/Timer_SubScene.unity new file mode 100644 index 00000000..67915240 --- /dev/null +++ b/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scenes/SubScenes/Timer_SubScene.unity @@ -0,0 +1,313 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.12731749, g: 0.13414757, b: 0.1210787, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &394006700 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 394006701} + - component: {fileID: 394006702} + m_Layer: 0 + m_Name: TimerDemoSystemAuthoring + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &394006701 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 394006700} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &394006702 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 394006700} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f7ffc06af2e010c499d896863ba503b2, type: 3} + m_Name: + m_EditorClassIdentifier: + IsSystemEnabled: 1 +--- !u!1 &1465897714 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1465897715} + - component: {fileID: 1465897716} + m_Layer: 0 + m_Name: --------- Instances ---------- + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1465897715 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1465897714} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1465897716 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1465897714} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e4bd367752a957644a1419fad5d66606, type: 3} + m_Name: + m_EditorClassIdentifier: + DividerType: 3 +--- !u!1 &1592965419 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1592965420} + - component: {fileID: 1592965421} + m_Layer: 0 + m_Name: ------- SharedSystems -------- + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1592965420 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1592965419} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1592965421 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1592965419} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e4bd367752a957644a1419fad5d66606, type: 3} + m_Name: + m_EditorClassIdentifier: + DividerType: 1 +--- !u!1 &1985194063 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1985194065} + - component: {fileID: 1985194066} + m_Layer: 0 + m_Name: TimerSystemAuthoring + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1985194065 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1985194063} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1985194066 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1985194063} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 37a02ab87e263554286bccc50ec14bde, type: 3} + m_Name: + m_EditorClassIdentifier: + IsSystemEnabled: 1 +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 1592965420} + - {fileID: 1985194065} + - {fileID: 1465897715} + - {fileID: 394006701} diff --git a/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scenes/SubScenes/Timer_SubScene.unity.meta b/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scenes/SubScenes/Timer_SubScene.unity.meta new file mode 100644 index 00000000..2bc8f700 --- /dev/null +++ b/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scenes/SubScenes/Timer_SubScene.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a55e107bfe8992742af35c492e5baca2 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scenes/Timer.unity b/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scenes/Timer.unity new file mode 100644 index 00000000..8d46ea1e --- /dev/null +++ b/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scenes/Timer.unity @@ -0,0 +1,526 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.18028462, g: 0.225715, b: 0.3069236, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &398666136 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 398666138} + - component: {fileID: 398666139} + m_Layer: 0 + m_Name: Timer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &398666138 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 398666136} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 2.58, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &398666139 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 398666136} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3ce9d68e84c620848baf815ebf5937e0, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &1345535641 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1345535643} + - component: {fileID: 1345535642} + m_Layer: 0 + m_Name: Version02_DOTSSubScene + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1345535642 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1345535641} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 45a335734b1572644a6a5d09d87adc65, type: 3} + m_Name: + m_EditorClassIdentifier: + _SceneAsset: {fileID: 102900000, guid: a55e107bfe8992742af35c492e5baca2, type: 3} + _HierarchyColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + AutoLoadScene: 1 + _SceneGUID: + Value: + x: 3070354778 + y: 1193908463 + z: 2495954850 + w: 717927906 +--- !u!4 &1345535643 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1345535641} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1940437712117862330 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2797343973506617792} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RenderShadows: 1 + m_RequiresDepthTextureOption: 2 + m_RequiresOpaqueTextureOption: 2 + m_CameraType: 0 + m_Cameras: [] + m_RendererIndex: -1 + m_VolumeLayerMask: + serializedVersion: 2 + m_Bits: 1 + m_VolumeTrigger: {fileID: 0} + m_VolumeFrameworkUpdateModeOption: 2 + m_RenderPostProcessing: 0 + m_Antialiasing: 0 + m_AntialiasingQuality: 2 + m_StopNaN: 0 + m_Dithering: 0 + m_ClearDepth: 1 + m_AllowXRRendering: 1 + m_AllowHDROutput: 1 + m_UseScreenCoordOverride: 0 + m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0} + m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0} + m_RequiresDepthTexture: 0 + m_RequiresColorTexture: 0 + m_Version: 2 + m_TaaSettings: + m_Quality: 3 + m_FrameInfluence: 0.1 + m_JitterScale: 1 + m_MipBias: 0 + m_VarianceClampScale: 0.9 + m_ContrastAdaptiveSharpening: 0 +--- !u!20 &2515185508210893250 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2797343973506617792} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.14466001, g: 0.16470496, b: 0.1981132, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 1 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 42.972195 + orthographic: 0 + orthographic size: 4.84 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 0 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!1 &2797343973506617792 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6892052977748124990} + - component: {fileID: 2515185508210893250} + - component: {fileID: 5743497740944284917} + - component: {fileID: 3750998247082130961} + - component: {fileID: 1940437712117862330} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &2804207075406205457 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4825924165603996095} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Version: 3 + m_UsePipelineSettings: 1 + m_AdditionalLightsShadowResolutionTier: 2 + m_LightLayerMask: 1 + m_RenderingLayers: 1 + m_CustomShadowLayers: 0 + m_ShadowLayerMask: 1 + m_ShadowRenderingLayers: 1 + m_LightCookieSize: {x: 1, y: 1} + m_LightCookieOffset: {x: 0, y: 0} + m_SoftShadowQuality: 0 +--- !u!4 &3730110961393659966 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5734806533014474125} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.5, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 8350548158783097638} + - {fileID: 6892052977748124990} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!81 &3750998247082130961 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2797343973506617792} + m_Enabled: 1 +--- !u!1 &4825924165603996095 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8350548158783097638} + - component: {fileID: 6154716444365898511} + - component: {fileID: 2804207075406205457} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &5734806533014474125 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3730110961393659966} + m_Layer: 0 + m_Name: Common + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!124 &5743497740944284917 +Behaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2797343973506617792} + m_Enabled: 1 +--- !u!108 &6154716444365898511 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4825924165603996095} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &6892052977748124990 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2797343973506617792} + serializedVersion: 2 + m_LocalRotation: {x: 0.4110371, y: 0, z: 0, w: 0.91161865} + m_LocalPosition: {x: 0, y: 9, z: -9} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 1 + m_Children: [] + m_Father: {fileID: 3730110961393659966} + m_LocalEulerAnglesHint: {x: 48.54, y: 0, z: 0} +--- !u!4 &8350548158783097638 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4825924165603996095} + serializedVersion: 2 + m_LocalRotation: {x: 0.36599815, y: 0.4531539, z: -0.21130912, w: 0.7848856} + m_LocalPosition: {x: 0, y: 2.5, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3730110961393659966} + m_LocalEulerAnglesHint: {x: 50, y: 60, z: 0} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 3730110961393659966} + - {fileID: 398666138} + - {fileID: 1345535643} diff --git a/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scenes/Timer.unity.meta b/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scenes/Timer.unity.meta new file mode 100644 index 00000000..da13c9c7 --- /dev/null +++ b/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scenes/Timer.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a7512fc75e6bd5542bcf93d53f94581b +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scripts.meta b/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scripts.meta new file mode 100644 index 00000000..f1b8be88 --- /dev/null +++ b/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e1b6e190a3484bd4090a17af8e6984f0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scripts/Runtime.meta b/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scripts/Runtime.meta new file mode 100644 index 00000000..ba2adf05 --- /dev/null +++ b/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scripts/Runtime.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 17826a817a9815742bb6497190e99c98 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scripts/Runtime/RMC.DOTS.Demos.Timer.Runtime.asmdef b/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scripts/Runtime/RMC.DOTS.Demos.Timer.Runtime.asmdef new file mode 100644 index 00000000..e8d4de88 --- /dev/null +++ b/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scripts/Runtime/RMC.DOTS.Demos.Timer.Runtime.asmdef @@ -0,0 +1,27 @@ +{ + "name": "RMC.DOTS.Demos.Timer.Runtime", + "rootNamespace": "", + "references": [ + "GUID:d28bf24cef16ed84cb4cb180b9c77ac3", + "GUID:330ce21097b4d554fa95a74295bc3b8f", + "GUID:2665a8d13d1b3f18800f46e256720795", + "GUID:734d92eba21c94caba915361bd5ac177", + "GUID:63afb046c8423dd448ae7aba042ea63d", + "GUID:a5baed0c9693541a5bd947d336ec7659", + "GUID:e0cd26848372d4e5c891c569017e11f1", + "GUID:d8b63aba1907145bea998dd612889d6b", + "GUID:5f3cf485eb0554709a8abbeace890c86", + "GUID:8819f35a0fc84499b990e90a4ca1911f", + "GUID:75469ad4d38634e559750d17036d5f7c", + "GUID:f2381d29563bc3c49ab35691478f3482" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scripts/Runtime/RMC.DOTS.Demos.Timer.Runtime.asmdef.meta b/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scripts/Runtime/RMC.DOTS.Demos.Timer.Runtime.asmdef.meta new file mode 100644 index 00000000..f30f90cb --- /dev/null +++ b/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scripts/Runtime/RMC.DOTS.Demos.Timer.Runtime.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: bc79c86adcb5ebb4c9181f78ddec8fed +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scripts/Runtime/Timer.cs b/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scripts/Runtime/Timer.cs new file mode 100644 index 00000000..18f2f85c --- /dev/null +++ b/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scripts/Runtime/Timer.cs @@ -0,0 +1,13 @@ +using UnityEngine; + +namespace RMC.DOTS.Demos.Timer +{ + public class Timer : MonoBehaviour + { + // Initialization -------------------------------- + protected void Start() + { + Debug.Log("Timer Demo. Watch the console."); + } + } +} \ No newline at end of file diff --git a/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scripts/Runtime/Timer.cs.meta b/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scripts/Runtime/Timer.cs.meta new file mode 100644 index 00000000..d09bac19 --- /dev/null +++ b/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scripts/Runtime/Timer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3ce9d68e84c620848baf815ebf5937e0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scripts/Runtime/TimerDemoSystem.cs b/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scripts/Runtime/TimerDemoSystem.cs new file mode 100644 index 00000000..e7dfdd8d --- /dev/null +++ b/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scripts/Runtime/TimerDemoSystem.cs @@ -0,0 +1,39 @@ +using Unity.Entities; +using UnityEngine; + +namespace RMC.DOTS.Systems.Timer +{ + public partial struct TimerDemoSystem : ISystem + { + public void OnCreate(ref SystemState state) + { + state.RequireForUpdate(); + state.RequireForUpdate(); + + // 1) START TIMER + //Typically this is done within the OnUpdate of a production system + + // Half-second + var entity1 = state.EntityManager.CreateEntity(); + state.EntityManager.AddComponentData(entity1, new TimerComponent(0.5f)); + + // A bit longer... + var entity2 = state.EntityManager.CreateEntity(); + state.EntityManager.AddComponentData(entity2, new TimerComponent(1.5f)); + } + + public void OnUpdate(ref SystemState state) + { + foreach (var timerComponent in + SystemAPI.Query< + RefRO>()) + { + // 2) CHECK TIMER + if (timerComponent.ValueRO.IsTimerDone) + { + Debug.Log($"TimerDemoSystem: Done after {timerComponent.ValueRO.TargetDurationInSeconds} seconds."); + } + } + } + } +} \ No newline at end of file diff --git a/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scripts/Runtime/TimerDemoSystem.cs.meta b/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scripts/Runtime/TimerDemoSystem.cs.meta new file mode 100644 index 00000000..50273ab1 --- /dev/null +++ b/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scripts/Runtime/TimerDemoSystem.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 763970e24fba4db7a9c2c9546ac3a460 +timeCreated: 1714530828 \ No newline at end of file diff --git a/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scripts/Runtime/TimerDemoSystemAuthoring.cs b/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scripts/Runtime/TimerDemoSystemAuthoring.cs new file mode 100644 index 00000000..0154b16b --- /dev/null +++ b/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scripts/Runtime/TimerDemoSystemAuthoring.cs @@ -0,0 +1,31 @@ +using Unity.Entities; +using UnityEngine; + +namespace RMC.DOTS.Systems.Timer +{ + /// + /// Place this MonoBehaviour on a GameObject in the Scene + /// To enable the + /// + public class TimerDemoSystemAuthoring : MonoBehaviour + { + [SerializeField] + public bool IsSystemEnabled = true; + + public struct TimerDemoSystemIsEnabledTag : IComponentData {} + + public class TimerDemoSystemBaker : Baker + { + public override void Bake(TimerDemoSystemAuthoring authoring) + { + if (authoring.IsSystemEnabled) + { + Entity entity = GetEntity(TransformUsageFlags.Dynamic); + + //Turn system on + AddComponent(entity); + } + } + } + } +} diff --git a/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scripts/Runtime/TimerDemoSystemAuthoring.cs.meta b/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scripts/Runtime/TimerDemoSystemAuthoring.cs.meta new file mode 100644 index 00000000..56a9160f --- /dev/null +++ b/RMC DOTS/Samples~/2. RMC DOTS Library Demos/Demos/Timer/Scripts/Runtime/TimerDemoSystemAuthoring.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: f7ffc06af2e010c499d896863ba503b2 +timeCreated: 1712874887 \ No newline at end of file diff --git a/RMC DOTS/Scripts/Runtime/Systems/Timer.meta b/RMC DOTS/Scripts/Runtime/Systems/Timer.meta new file mode 100644 index 00000000..3d696d24 --- /dev/null +++ b/RMC DOTS/Scripts/Runtime/Systems/Timer.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 95a8d71b8d2aa554aadc9247765b38b8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/RMC DOTS/Scripts/Runtime/Systems/Timer/TimerComponent.cs b/RMC DOTS/Scripts/Runtime/Systems/Timer/TimerComponent.cs new file mode 100644 index 00000000..abc585b6 --- /dev/null +++ b/RMC DOTS/Scripts/Runtime/Systems/Timer/TimerComponent.cs @@ -0,0 +1,29 @@ +using Unity.Entities; + +namespace RMC.DOTS.Systems.Timer +{ + public struct TimerComponent : IComponentData + { + public bool IsTimerDone + { + get + { + return ElapsedTimeInSeconds >= TargetDurationInSeconds; + } + } + + public void UpdateTimer (float deltaTime) + { + ElapsedTimeInSeconds += deltaTime; + } + + private float ElapsedTimeInSeconds; + public readonly float TargetDurationInSeconds; + + public TimerComponent(float targetDurationInSeconds) : this() + { + ElapsedTimeInSeconds = 0; + TargetDurationInSeconds = targetDurationInSeconds; + } + } +} \ No newline at end of file diff --git a/RMC DOTS/Scripts/Runtime/Systems/Timer/TimerComponent.cs.meta b/RMC DOTS/Scripts/Runtime/Systems/Timer/TimerComponent.cs.meta new file mode 100644 index 00000000..c3995ea9 --- /dev/null +++ b/RMC DOTS/Scripts/Runtime/Systems/Timer/TimerComponent.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 9afea653fba21d8479b508b2bdd86aa2 +timeCreated: 1714533081 \ No newline at end of file diff --git a/RMC DOTS/Scripts/Runtime/Systems/Timer/TimerSystem.cs b/RMC DOTS/Scripts/Runtime/Systems/Timer/TimerSystem.cs new file mode 100644 index 00000000..fc847a5d --- /dev/null +++ b/RMC DOTS/Scripts/Runtime/Systems/Timer/TimerSystem.cs @@ -0,0 +1,70 @@ +using RMC.DOTS.SystemGroups; +using Unity.Burst; +using Unity.Entities; + +namespace RMC.DOTS.Systems.Timer +{ + [UpdateInGroup(typeof(UnpauseableSystemGroup))] + [RequireMatchingQueriesForUpdate] + [BurstCompile] + public partial struct TimerSystem : ISystem + { + + + /// + /// We set the TimeScale as virtual so that subclasses can have their own timescales if needed. + /// A use case for this is for faster speeds or faster enemies in strategy games. + /// + // protected virtual float TimeScale + // { + // get + // { + // return 1; + // } + // } + // + // /// + // /// This is the scaled time - applying the Timescale to the delta time. + // /// + // private float ScaledDeltaTime + // { + // get { return SystemAPI.Time.DeltaTime * TimeScale; } + // } + + // private EndSimulationEntityCommandBufferSystem _ecbSystem; + // + [BurstCompile] + public void OnCreate(ref SystemState state) + { + state.RequireForUpdate(); + state.RequireForUpdate(); + state.RequireForUpdate(); + } + + [BurstCompile] + public void OnUpdate(ref SystemState state) + { + var ecb = SystemAPI. + GetSingleton(). + CreateCommandBuffer(state.WorldUnmanaged); + + var deltaTime = SystemAPI.Time.DeltaTime; + + foreach (var (timerComponent, entity) in + SystemAPI.Query< + RefRW>().WithEntityAccess()) + { + + bool wasDone = timerComponent.ValueRW.IsTimerDone; + timerComponent.ValueRW.UpdateTimer(deltaTime); + bool isDone = timerComponent.ValueRW.IsTimerDone; + + //Capture the FIRST frame when the timer is met and DestroyEntity + if (wasDone && isDone) + { + ecb.DestroyEntity(entity); + } + } + } + } +} diff --git a/RMC DOTS/Scripts/Runtime/Systems/Timer/TimerSystem.cs.meta b/RMC DOTS/Scripts/Runtime/Systems/Timer/TimerSystem.cs.meta new file mode 100644 index 00000000..30abddf0 --- /dev/null +++ b/RMC DOTS/Scripts/Runtime/Systems/Timer/TimerSystem.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c40648546e2d8b745aadb7cc43715ba5 +timeCreated: 1688449274 \ No newline at end of file diff --git a/RMC DOTS/Scripts/Runtime/Systems/Timer/TimerSystemAuthoring.cs b/RMC DOTS/Scripts/Runtime/Systems/Timer/TimerSystemAuthoring.cs new file mode 100644 index 00000000..f6874aec --- /dev/null +++ b/RMC DOTS/Scripts/Runtime/Systems/Timer/TimerSystemAuthoring.cs @@ -0,0 +1,31 @@ +using Unity.Entities; +using UnityEngine; + +namespace RMC.DOTS.Systems.Timer +{ + /// + /// Place this MonoBehaviour on a GameObject in the Scene + /// To enable the + /// + public class TimerSystemAuthoring : MonoBehaviour + { + [SerializeField] + public bool IsSystemEnabled = true; + + public struct TimerSystemIsEnabledTag : IComponentData {} + + public class TimerSystemAuthoringBaker : Baker + { + public override void Bake(TimerSystemAuthoring authoring) + { + if (authoring.IsSystemEnabled) + { + Entity entity = GetEntity(TransformUsageFlags.Dynamic); + + //Turn system on + AddComponent(entity); + } + } + } + } +} diff --git a/RMC DOTS/Scripts/Runtime/Systems/Timer/TimerSystemAuthoring.cs.meta b/RMC DOTS/Scripts/Runtime/Systems/Timer/TimerSystemAuthoring.cs.meta new file mode 100644 index 00000000..b108a503 --- /dev/null +++ b/RMC DOTS/Scripts/Runtime/Systems/Timer/TimerSystemAuthoring.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 37a02ab87e263554286bccc50ec14bde +timeCreated: 1712874887 \ No newline at end of file diff --git a/package.json b/package.json index 9a25565f..7249138f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "com.rmc.rmc-dots", "displayName": "RMC DOTS", - "version": "1.2.2", + "version": "1.2.3", "unity": "2022.3", "description": "DOTS library for Unity Development by Rivello Multimedia Consulting", "keywords": [