MonoBehaviour vs DOTS testing
This commit is contained in:
parent
1d2b4f3a0c
commit
23962bb961
34 changed files with 1623 additions and 164 deletions
6
.vsconfig
Normal file
6
.vsconfig
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"version": "1.0",
|
||||||
|
"components": [
|
||||||
|
"Microsoft.VisualStudio.Workload.ManagedGame"
|
||||||
|
]
|
||||||
|
}
|
||||||
160
Assets/Prefabs/Units/Capsule.prefab
Normal file
160
Assets/Prefabs/Units/Capsule.prefab
Normal file
|
|
@ -0,0 +1,160 @@
|
||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!1 &8442802479821363351
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 39074758509039986}
|
||||||
|
- component: {fileID: 1113650087842845955}
|
||||||
|
- component: {fileID: 1709696524883855978}
|
||||||
|
- component: {fileID: 8890678473989539349}
|
||||||
|
- component: {fileID: 6474328328421577028}
|
||||||
|
- component: {fileID: 369182852915698689}
|
||||||
|
m_Layer: 10
|
||||||
|
m_Name: Capsule
|
||||||
|
m_TagString: Pille
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &39074758509039986
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 8442802479821363351}
|
||||||
|
serializedVersion: 2
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: -40.97, y: 1.84, z: 0}
|
||||||
|
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!33 &1113650087842845955
|
||||||
|
MeshFilter:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 8442802479821363351}
|
||||||
|
m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0}
|
||||||
|
--- !u!23 &1709696524883855978
|
||||||
|
MeshRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 8442802479821363351}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_CastShadows: 1
|
||||||
|
m_ReceiveShadows: 1
|
||||||
|
m_DynamicOccludee: 1
|
||||||
|
m_StaticShadowCaster: 0
|
||||||
|
m_MotionVectors: 1
|
||||||
|
m_LightProbeUsage: 1
|
||||||
|
m_ReflectionProbeUsage: 1
|
||||||
|
m_RayTracingMode: 2
|
||||||
|
m_RayTraceProcedural: 0
|
||||||
|
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||||
|
m_RayTracingAccelStructBuildFlags: 1
|
||||||
|
m_SmallMeshCulling: 1
|
||||||
|
m_ForceMeshLod: -1
|
||||||
|
m_MeshLodSelectionBias: 0
|
||||||
|
m_RenderingLayerMask: 1
|
||||||
|
m_RendererPriority: 0
|
||||||
|
m_Materials:
|
||||||
|
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_StaticBatchInfo:
|
||||||
|
firstSubMesh: 0
|
||||||
|
subMeshCount: 0
|
||||||
|
m_StaticBatchRoot: {fileID: 0}
|
||||||
|
m_ProbeAnchor: {fileID: 0}
|
||||||
|
m_LightProbeVolumeOverride: {fileID: 0}
|
||||||
|
m_ScaleInLightmap: 1
|
||||||
|
m_ReceiveGI: 1
|
||||||
|
m_PreserveUVs: 0
|
||||||
|
m_IgnoreNormalsForChartDetection: 0
|
||||||
|
m_ImportantGI: 0
|
||||||
|
m_StitchLightmapSeams: 1
|
||||||
|
m_SelectedEditorRenderState: 3
|
||||||
|
m_MinimumChartSize: 4
|
||||||
|
m_AutoUVMaxDistance: 0.5
|
||||||
|
m_AutoUVMaxAngle: 89
|
||||||
|
m_LightmapParameters: {fileID: 0}
|
||||||
|
m_GlobalIlluminationMeshLod: 0
|
||||||
|
m_SortingLayerID: 0
|
||||||
|
m_SortingLayer: 0
|
||||||
|
m_SortingOrder: 0
|
||||||
|
m_MaskInteraction: 0
|
||||||
|
m_AdditionalVertexStreams: {fileID: 0}
|
||||||
|
--- !u!136 &8890678473989539349
|
||||||
|
CapsuleCollider:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 8442802479821363351}
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_IncludeLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 0
|
||||||
|
m_ExcludeLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 0
|
||||||
|
m_LayerOverridePriority: 0
|
||||||
|
m_IsTrigger: 0
|
||||||
|
m_ProvidesContacts: 0
|
||||||
|
m_Enabled: 1
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Radius: 0.5
|
||||||
|
m_Height: 2
|
||||||
|
m_Direction: 1
|
||||||
|
m_Center: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!114 &6474328328421577028
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 8442802479821363351}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 25d7cd903fe278743bee455fa70ffd68, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier: '::'
|
||||||
|
geschwindigkeit: 5
|
||||||
|
wandTag: Wall
|
||||||
|
pilleTag: Pille
|
||||||
|
--- !u!54 &369182852915698689
|
||||||
|
Rigidbody:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 8442802479821363351}
|
||||||
|
serializedVersion: 5
|
||||||
|
m_Mass: 1
|
||||||
|
m_LinearDamping: 0
|
||||||
|
m_AngularDamping: 0.05
|
||||||
|
m_CenterOfMass: {x: 0, y: 0, z: 0}
|
||||||
|
m_InertiaTensor: {x: 1, y: 1, z: 1}
|
||||||
|
m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_IncludeLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 0
|
||||||
|
m_ExcludeLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 0
|
||||||
|
m_ImplicitCom: 1
|
||||||
|
m_ImplicitTensor: 1
|
||||||
|
m_UseGravity: 1
|
||||||
|
m_IsKinematic: 0
|
||||||
|
m_Interpolate: 0
|
||||||
|
m_Constraints: 0
|
||||||
|
m_CollisionDetection: 0
|
||||||
7
Assets/Prefabs/Units/Capsule.prefab.meta
Normal file
7
Assets/Prefabs/Units/Capsule.prefab.meta
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 04bec44a85548c542ad05ccf95af92bb
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
130
Assets/Prefabs/Units/Pille_DOTS.prefab
Normal file
130
Assets/Prefabs/Units/Pille_DOTS.prefab
Normal file
|
|
@ -0,0 +1,130 @@
|
||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!1 &8442802479821363351
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 39074758509039986}
|
||||||
|
- component: {fileID: 1113650087842845955}
|
||||||
|
- component: {fileID: 1709696524883855978}
|
||||||
|
- component: {fileID: 8890678473989539349}
|
||||||
|
- component: {fileID: 1621524998703728851}
|
||||||
|
m_Layer: 10
|
||||||
|
m_Name: Pille_DOTS
|
||||||
|
m_TagString: Pille
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &39074758509039986
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 8442802479821363351}
|
||||||
|
serializedVersion: 2
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: -40.97, y: 1.84, z: 0}
|
||||||
|
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!33 &1113650087842845955
|
||||||
|
MeshFilter:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 8442802479821363351}
|
||||||
|
m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0}
|
||||||
|
--- !u!23 &1709696524883855978
|
||||||
|
MeshRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 8442802479821363351}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_CastShadows: 1
|
||||||
|
m_ReceiveShadows: 1
|
||||||
|
m_DynamicOccludee: 1
|
||||||
|
m_StaticShadowCaster: 0
|
||||||
|
m_MotionVectors: 1
|
||||||
|
m_LightProbeUsage: 1
|
||||||
|
m_ReflectionProbeUsage: 1
|
||||||
|
m_RayTracingMode: 2
|
||||||
|
m_RayTraceProcedural: 0
|
||||||
|
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||||
|
m_RayTracingAccelStructBuildFlags: 1
|
||||||
|
m_SmallMeshCulling: 1
|
||||||
|
m_ForceMeshLod: -1
|
||||||
|
m_MeshLodSelectionBias: 0
|
||||||
|
m_RenderingLayerMask: 1
|
||||||
|
m_RendererPriority: 0
|
||||||
|
m_Materials:
|
||||||
|
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_StaticBatchInfo:
|
||||||
|
firstSubMesh: 0
|
||||||
|
subMeshCount: 0
|
||||||
|
m_StaticBatchRoot: {fileID: 0}
|
||||||
|
m_ProbeAnchor: {fileID: 0}
|
||||||
|
m_LightProbeVolumeOverride: {fileID: 0}
|
||||||
|
m_ScaleInLightmap: 1
|
||||||
|
m_ReceiveGI: 1
|
||||||
|
m_PreserveUVs: 0
|
||||||
|
m_IgnoreNormalsForChartDetection: 0
|
||||||
|
m_ImportantGI: 0
|
||||||
|
m_StitchLightmapSeams: 1
|
||||||
|
m_SelectedEditorRenderState: 3
|
||||||
|
m_MinimumChartSize: 4
|
||||||
|
m_AutoUVMaxDistance: 0.5
|
||||||
|
m_AutoUVMaxAngle: 89
|
||||||
|
m_LightmapParameters: {fileID: 0}
|
||||||
|
m_GlobalIlluminationMeshLod: 0
|
||||||
|
m_SortingLayerID: 0
|
||||||
|
m_SortingLayer: 0
|
||||||
|
m_SortingOrder: 0
|
||||||
|
m_MaskInteraction: 0
|
||||||
|
m_AdditionalVertexStreams: {fileID: 0}
|
||||||
|
--- !u!136 &8890678473989539349
|
||||||
|
CapsuleCollider:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 8442802479821363351}
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_IncludeLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 0
|
||||||
|
m_ExcludeLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 0
|
||||||
|
m_LayerOverridePriority: 0
|
||||||
|
m_IsTrigger: 0
|
||||||
|
m_ProvidesContacts: 0
|
||||||
|
m_Enabled: 1
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Radius: 0.5
|
||||||
|
m_Height: 2
|
||||||
|
m_Direction: 1
|
||||||
|
m_Center: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!114 &1621524998703728851
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 8442802479821363351}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 32b1263ba300f144a92fca434251d14f, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier: Assembly-CSharp::HappyForest.Prototypen.PilleAuthoring
|
||||||
|
speed: 5
|
||||||
7
Assets/Prefabs/Units/Pille_DOTS.prefab.meta
Normal file
7
Assets/Prefabs/Units/Pille_DOTS.prefab.meta
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 6756005a10a6f944795b2a02da5d591a
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/SceneDependencyCache.meta
Normal file
8
Assets/SceneDependencyCache.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b3b0818e68a228746b4d773f87cdbfd3
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Binary file not shown.
|
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: aa2d907f823ed66d218a463f1b684821
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Scenes/Sandbox_Rainer.meta
Normal file
8
Assets/Scenes/Sandbox_Rainer.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 406888758b0253d49bf20d34d83dc4d5
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
@ -148,8 +148,12 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: 570fdde114741274eabb7c5630a5775d, type: 3}
|
m_Script: {fileID: 11500000, guid: 570fdde114741274eabb7c5630a5775d, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier: '::'
|
m_EditorClassIdentifier: '::'
|
||||||
prefabToSpawn: {fileID: 0}
|
nutzeDOTS: 1
|
||||||
spawnPosition: {x: 0, y: 0, z: 0}
|
dotsPrefab: {fileID: 8442802479821363351, guid: 6756005a10a6f944795b2a02da5d591a, type: 3}
|
||||||
|
oopPrefab: {fileID: 8442802479821363351, guid: 04bec44a85548c542ad05ccf95af92bb, type: 3}
|
||||||
|
pillenKollidieren: 0
|
||||||
|
aktionsVerzoegerung: 0.1
|
||||||
|
aktivePillen: []
|
||||||
--- !u!4 &294313398
|
--- !u!4 &294313398
|
||||||
Transform:
|
Transform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -165,120 +169,6 @@ Transform:
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!1 &317409014
|
|
||||||
GameObject:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
serializedVersion: 6
|
|
||||||
m_Component:
|
|
||||||
- component: {fileID: 317409018}
|
|
||||||
- component: {fileID: 317409017}
|
|
||||||
- component: {fileID: 317409016}
|
|
||||||
- component: {fileID: 317409015}
|
|
||||||
m_Layer: 0
|
|
||||||
m_Name: Capsule
|
|
||||||
m_TagString: Untagged
|
|
||||||
m_Icon: {fileID: 0}
|
|
||||||
m_NavMeshLayer: 0
|
|
||||||
m_StaticEditorFlags: 0
|
|
||||||
m_IsActive: 1
|
|
||||||
--- !u!136 &317409015
|
|
||||||
CapsuleCollider:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 317409014}
|
|
||||||
m_Material: {fileID: 0}
|
|
||||||
m_IncludeLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 0
|
|
||||||
m_ExcludeLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 0
|
|
||||||
m_LayerOverridePriority: 0
|
|
||||||
m_IsTrigger: 0
|
|
||||||
m_ProvidesContacts: 0
|
|
||||||
m_Enabled: 1
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Radius: 0.5
|
|
||||||
m_Height: 2
|
|
||||||
m_Direction: 1
|
|
||||||
m_Center: {x: 0, y: 0, z: 0}
|
|
||||||
--- !u!23 &317409016
|
|
||||||
MeshRenderer:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 317409014}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_CastShadows: 1
|
|
||||||
m_ReceiveShadows: 1
|
|
||||||
m_DynamicOccludee: 1
|
|
||||||
m_StaticShadowCaster: 0
|
|
||||||
m_MotionVectors: 1
|
|
||||||
m_LightProbeUsage: 1
|
|
||||||
m_ReflectionProbeUsage: 1
|
|
||||||
m_RayTracingMode: 2
|
|
||||||
m_RayTraceProcedural: 0
|
|
||||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
|
||||||
m_RayTracingAccelStructBuildFlags: 1
|
|
||||||
m_SmallMeshCulling: 1
|
|
||||||
m_ForceMeshLod: -1
|
|
||||||
m_MeshLodSelectionBias: 0
|
|
||||||
m_RenderingLayerMask: 1
|
|
||||||
m_RendererPriority: 0
|
|
||||||
m_Materials:
|
|
||||||
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
|
|
||||||
m_StaticBatchInfo:
|
|
||||||
firstSubMesh: 0
|
|
||||||
subMeshCount: 0
|
|
||||||
m_StaticBatchRoot: {fileID: 0}
|
|
||||||
m_ProbeAnchor: {fileID: 0}
|
|
||||||
m_LightProbeVolumeOverride: {fileID: 0}
|
|
||||||
m_ScaleInLightmap: 1
|
|
||||||
m_ReceiveGI: 1
|
|
||||||
m_PreserveUVs: 0
|
|
||||||
m_IgnoreNormalsForChartDetection: 0
|
|
||||||
m_ImportantGI: 0
|
|
||||||
m_StitchLightmapSeams: 1
|
|
||||||
m_SelectedEditorRenderState: 3
|
|
||||||
m_MinimumChartSize: 4
|
|
||||||
m_AutoUVMaxDistance: 0.5
|
|
||||||
m_AutoUVMaxAngle: 89
|
|
||||||
m_LightmapParameters: {fileID: 0}
|
|
||||||
m_GlobalIlluminationMeshLod: 0
|
|
||||||
m_SortingLayerID: 0
|
|
||||||
m_SortingLayer: 0
|
|
||||||
m_SortingOrder: 0
|
|
||||||
m_MaskInteraction: 0
|
|
||||||
m_AdditionalVertexStreams: {fileID: 0}
|
|
||||||
--- !u!33 &317409017
|
|
||||||
MeshFilter:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 317409014}
|
|
||||||
m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0}
|
|
||||||
--- !u!4 &317409018
|
|
||||||
Transform:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 317409014}
|
|
||||||
serializedVersion: 2
|
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
|
||||||
m_LocalPosition: {x: -40.97, y: 1.84, 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!1 &484453422
|
--- !u!1 &484453422
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -293,7 +183,7 @@ GameObject:
|
||||||
- component: {fileID: 484453423}
|
- component: {fileID: 484453423}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: WallNorth
|
m_Name: WallNorth
|
||||||
m_TagString: Untagged
|
m_TagString: Wall
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
|
|
@ -385,12 +275,65 @@ Transform:
|
||||||
m_GameObject: {fileID: 484453422}
|
m_GameObject: {fileID: 484453422}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||||
m_LocalPosition: {x: 0.52011, y: 2.5, z: 21.64156}
|
m_LocalPosition: {x: 0.52011, y: 2.5, z: 53.339}
|
||||||
m_LocalScale: {x: 100, y: 5, z: 1}
|
m_LocalScale: {x: 229.81999, y: 5, z: 2.2937}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 1401811864}
|
m_Father: {fileID: 1401811864}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!1 &553331995
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 553331997}
|
||||||
|
- component: {fileID: 553331996}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: DotsSetup
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!114 &553331996
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 553331995}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 45a335734b1572644a6a5d09d87adc65, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier: Unity.Scenes::Unity.Scenes.SubScene
|
||||||
|
_SceneAsset: {fileID: 102900000, guid: 7157e4f0b4de28b48899d69ed53b5dcc, type: 3}
|
||||||
|
_HierarchyColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||||
|
AutoLoadScene: 1
|
||||||
|
_SceneGUID:
|
||||||
|
Value:
|
||||||
|
x: 256800023
|
||||||
|
y: 1266871627
|
||||||
|
z: 3916274056
|
||||||
|
w: 3436557149
|
||||||
|
--- !u!4 &553331997
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 553331995}
|
||||||
|
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!1 &925142572
|
--- !u!1 &925142572
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -573,13 +516,13 @@ Transform:
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1109898414}
|
m_GameObject: {fileID: 1109898414}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: 0.13389976, y: -0.3925302, z: 0.057889134, w: 0.9080968}
|
||||||
m_LocalPosition: {x: 0, y: 1, z: -10}
|
m_LocalPosition: {x: 112.402405, y: 5.4447975, z: -54.697075}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 50, y: 0, z: 0}
|
||||||
--- !u!1 &1401811863
|
--- !u!1 &1401811863
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -630,7 +573,7 @@ GameObject:
|
||||||
- component: {fileID: 1432930634}
|
- component: {fileID: 1432930634}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: WallSouth
|
m_Name: WallSouth
|
||||||
m_TagString: Untagged
|
m_TagString: Wall
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
|
|
@ -722,8 +665,8 @@ Transform:
|
||||||
m_GameObject: {fileID: 1432930633}
|
m_GameObject: {fileID: 1432930633}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||||
m_LocalPosition: {x: 0.52011, y: 2.5, z: -27.35844}
|
m_LocalPosition: {x: 0.52011, y: 2.5, z: -59.054}
|
||||||
m_LocalScale: {x: 100, y: 5, z: 1}
|
m_LocalScale: {x: 229.81999, y: 5, z: 2.2937}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 1401811864}
|
m_Father: {fileID: 1401811864}
|
||||||
|
|
@ -742,7 +685,7 @@ GameObject:
|
||||||
- component: {fileID: 1465384990}
|
- component: {fileID: 1465384990}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: WallWest
|
m_Name: WallWest
|
||||||
m_TagString: Untagged
|
m_TagString: Wall
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
|
|
@ -834,8 +777,8 @@ Transform:
|
||||||
m_GameObject: {fileID: 1465384989}
|
m_GameObject: {fileID: 1465384989}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_LocalRotation: {x: -0, y: 0.7071068, z: -0, w: 0.7071068}
|
m_LocalRotation: {x: -0, y: 0.7071068, z: -0, w: 0.7071068}
|
||||||
m_LocalPosition: {x: -48.97989, y: 2.5, z: -2.85844}
|
m_LocalPosition: {x: -113.24, y: 2.5, z: -2.8587}
|
||||||
m_LocalScale: {x: 48, y: 5, z: 1}
|
m_LocalScale: {x: 110.097595, y: 5, z: 2.2982}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 1401811864}
|
m_Father: {fileID: 1401811864}
|
||||||
|
|
@ -946,8 +889,8 @@ Transform:
|
||||||
m_GameObject: {fileID: 2016336478}
|
m_GameObject: {fileID: 2016336478}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||||
m_LocalPosition: {x: 0.52011, y: -0.5, z: -2.85844}
|
m_LocalPosition: {x: 0.52011, y: -0.5, z: -2.8587}
|
||||||
m_LocalScale: {x: 100, y: 1, z: 50}
|
m_LocalScale: {x: 229.81999, y: 1, z: 114.685}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 1401811864}
|
m_Father: {fileID: 1401811864}
|
||||||
|
|
@ -966,7 +909,7 @@ GameObject:
|
||||||
- component: {fileID: 2056509220}
|
- component: {fileID: 2056509220}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: WallEast
|
m_Name: WallEast
|
||||||
m_TagString: Untagged
|
m_TagString: Wall
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
|
|
@ -1058,8 +1001,8 @@ Transform:
|
||||||
m_GameObject: {fileID: 2056509219}
|
m_GameObject: {fileID: 2056509219}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_LocalRotation: {x: -0, y: 0.7071068, z: -0, w: 0.7071068}
|
m_LocalRotation: {x: -0, y: 0.7071068, z: -0, w: 0.7071068}
|
||||||
m_LocalPosition: {x: 50.02011, y: 2.5, z: -2.85844}
|
m_LocalPosition: {x: 114.28, y: 2.5, z: -2.8586}
|
||||||
m_LocalScale: {x: 48, y: 5, z: 1}
|
m_LocalScale: {x: 110.097595, y: 5, z: 2.2982}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 1401811864}
|
m_Father: {fileID: 1401811864}
|
||||||
|
|
@ -1070,6 +1013,6 @@ SceneRoots:
|
||||||
m_Roots:
|
m_Roots:
|
||||||
- {fileID: 1109898417}
|
- {fileID: 1109898417}
|
||||||
- {fileID: 925142574}
|
- {fileID: 925142574}
|
||||||
- {fileID: 317409018}
|
|
||||||
- {fileID: 1401811864}
|
- {fileID: 1401811864}
|
||||||
- {fileID: 294313398}
|
- {fileID: 294313398}
|
||||||
|
- {fileID: 553331997}
|
||||||
|
|
|
||||||
171
Assets/Scenes/Sandbox_Rainer/DotsSetup.unity
Normal file
171
Assets/Scenes/Sandbox_Rainer/DotsSetup.unity
Normal file
|
|
@ -0,0 +1,171 @@
|
||||||
|
%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: 10
|
||||||
|
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_UseRadianceAmbientProbe: 0
|
||||||
|
--- !u!157 &3
|
||||||
|
LightmapSettings:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 13
|
||||||
|
m_BakeOnSceneLoad: 0
|
||||||
|
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_ReflectionCompression: 2
|
||||||
|
m_MixedBakeMode: 2
|
||||||
|
m_BakeBackend: 2
|
||||||
|
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: 1
|
||||||
|
m_PVRFilteringGaussRadiusAO: 1
|
||||||
|
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||||
|
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||||
|
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||||
|
m_ExportTrainingData: 0
|
||||||
|
m_TrainingDataDestination: TrainingData
|
||||||
|
m_LightProbeSampleCountMultiplier: 4
|
||||||
|
m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 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 &148495147
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 148495149}
|
||||||
|
- component: {fileID: 148495148}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: DOTS_Spawner_Setup
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!114 &148495148
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 148495147}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 79a07f7d3dc16674ea11eff80a43f514, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier: Assembly-CSharp::HappyForest.Prototypen.DotsSpawnerAuthoring
|
||||||
|
dotsPrefab: {fileID: 8442802479821363351, guid: 6756005a10a6f944795b2a02da5d591a, type: 3}
|
||||||
|
--- !u!4 &148495149
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 148495147}
|
||||||
|
serializedVersion: 2
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 99.2465, y: -0, z: -42.32264}
|
||||||
|
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!1660057539 &9223372036854775807
|
||||||
|
SceneRoots:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_Roots:
|
||||||
|
- {fileID: 148495149}
|
||||||
7
Assets/Scenes/Sandbox_Rainer/DotsSetup.unity.meta
Normal file
7
Assets/Scenes/Sandbox_Rainer/DotsSetup.unity.meta
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7157e4f0b4de28b48899d69ed53b5dcc
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
205
Assets/Scripts/DOTS Cheat Sheet.cs
Normal file
205
Assets/Scripts/DOTS Cheat Sheet.cs
Normal file
|
|
@ -0,0 +1,205 @@
|
||||||
|
namespace DOTSCheatSheet
|
||||||
|
{
|
||||||
|
|
||||||
|
using System; // Wird für Events / Actions benötigt
|
||||||
|
using System.Collections; // Wird für Coroutinen benötigt
|
||||||
|
using UnityEngine; // Der Haupt-Namespace für fast alles in Unity
|
||||||
|
|
||||||
|
// Das Attribut RequireComponent zwingt Unity dazu, automatisch einen Rigidbody
|
||||||
|
// an das GameObject zu hängen, sobald dieses Skript hinzugefügt wird.
|
||||||
|
[RequireComponent(typeof(Rigidbody))]
|
||||||
|
public class UnityReferenz : MonoBehaviour
|
||||||
|
{
|
||||||
|
// ========================================================================
|
||||||
|
// 1. VARIABLEN & SICHTBARKEIT (Attribute für den Inspektor)
|
||||||
|
// ========================================================================
|
||||||
|
|
||||||
|
[Header("Basis-Variablen")]
|
||||||
|
[Tooltip("Das ist ein Tooltip. Er erscheint, wenn man mit der Maus im Editor darüber fährt.")]
|
||||||
|
public int lebenspunkte = 100; // Public: Von überall sichtbar UND im Editor sichtbar
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private float geschwindigkeit = 5.5f; // Private + SerializeField: Nur in diesem Skript nutzbar, ABER im Editor einstellbar! (Best Practice)
|
||||||
|
|
||||||
|
[Range(0f, 1f)]
|
||||||
|
public float lautstaerke = 0.5f; // Erzeugt einen schönen Schieberegler im Unity Editor
|
||||||
|
|
||||||
|
[HideInInspector]
|
||||||
|
public bool istVersteckt = true; // Public, aber im Editor unsichtbar (für interne Logik)
|
||||||
|
|
||||||
|
[Header("Referenzen zu anderen Dingen")]
|
||||||
|
[SerializeField] private GameObject meinPrefab; // Referenz auf ein Prefab (z.B. ein Schuss oder Gegner)
|
||||||
|
[SerializeField] private Transform zielPosition; // Referenz auf eine Position in der Welt (Transform)
|
||||||
|
[SerializeField] private Renderer meinRenderer; // Referenz auf eine visuelle Komponente
|
||||||
|
|
||||||
|
// Private Variablen (weder von außen noch vom Editor erreichbar)
|
||||||
|
private Rigidbody meinRigidbody;
|
||||||
|
private float zeitSeitStart = 0f;
|
||||||
|
|
||||||
|
// ========================================================================
|
||||||
|
// 2. UNITY LEBENSZYKLUS (Event-Methoden, die Unity automatisch aufruft)
|
||||||
|
// ========================================================================
|
||||||
|
|
||||||
|
// Awake wird als ALLERERSTES aufgerufen, noch bevor das Spiel richtig losgeht.
|
||||||
|
// Hier holt man sich Referenzen auf die eigenen Komponenten.
|
||||||
|
void Awake()
|
||||||
|
{
|
||||||
|
// Holt den Rigidbody, der auf DIESEM GameObject liegt.
|
||||||
|
meinRigidbody = GetComponent<Rigidbody>();
|
||||||
|
|
||||||
|
if (meinRigidbody == null)
|
||||||
|
{
|
||||||
|
Debug.LogError("Hilfe! Hier fehlt ein Rigidbody!"); // Schreibt einen Fehler in die Konsole
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Start wird aufgerufen, bevor das erste Update läuft (für Initialisierungen).
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
Debug.Log("Das Spiel ist gestartet! Hallo von: " + gameObject.name);
|
||||||
|
|
||||||
|
// Farbe ändern als Test
|
||||||
|
if (meinRenderer != null)
|
||||||
|
{
|
||||||
|
meinRenderer.material.color = Color.blue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Startet eine asynchrone Hintergrund-Schleife (Coroutinen, siehe unten)
|
||||||
|
StartCoroutine(MeinTimer());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update wird JEDEN FRAME aufgerufen.
|
||||||
|
// Achtung: Wenn das Spiel mit 60 FPS läuft, läuft das hier 60x pro Sekunde!
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
// 1. Timer hochzählen mit Time.deltaTime (Zeit, die seit dem letzten Frame vergangen ist)
|
||||||
|
zeitSeitStart += Time.deltaTime;
|
||||||
|
|
||||||
|
// 2. Input abfragen
|
||||||
|
AbfrageInput();
|
||||||
|
}
|
||||||
|
|
||||||
|
// FixedUpdate wird in festen Zeitintervallen aufgerufen (Standard: 50x pro Sekunde).
|
||||||
|
// ALLES was mit Physik zu tun hat, MUSS hier rein, NICHT in Update!
|
||||||
|
void FixedUpdate()
|
||||||
|
{
|
||||||
|
// Beispiel: Wir schieben das Objekt stetig nach vorne
|
||||||
|
// meinRigidbody.AddForce(Vector3.forward * geschwindigkeit);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========================================================================
|
||||||
|
// 3. EIGENE METHODEN: INPUT & BEWEGUNG
|
||||||
|
// ========================================================================
|
||||||
|
|
||||||
|
private void AbfrageInput()
|
||||||
|
{
|
||||||
|
// TASTENABFRAGE (Einmaliges Drücken)
|
||||||
|
if (Input.GetKeyDown(KeyCode.Space))
|
||||||
|
{
|
||||||
|
Springen();
|
||||||
|
}
|
||||||
|
|
||||||
|
// TASTENABFRAGE (Gedrückt halten)
|
||||||
|
if (Input.GetKey(KeyCode.W))
|
||||||
|
{
|
||||||
|
// Bewege das Objekt direkt (ohne Physik) nach vorne
|
||||||
|
// transform.Translate(Vector3.forward * geschwindigkeit * Time.deltaTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
// MAUSABFRAGE (0 = Links, 1 = Rechts, 2 = Mitte)
|
||||||
|
if (Input.GetMouseButtonDown(0))
|
||||||
|
{
|
||||||
|
SpawnObjekt();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Springen()
|
||||||
|
{
|
||||||
|
// Wirft das Objekt physikalisch in die Luft
|
||||||
|
meinRigidbody.AddForce(Vector3.up * 300f);
|
||||||
|
Debug.Log("Hüpf!");
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========================================================================
|
||||||
|
// 4. INSTANZIIEREN (Spawnen) & ZERSTÖREN
|
||||||
|
// ========================================================================
|
||||||
|
|
||||||
|
public void SpawnObjekt()
|
||||||
|
{
|
||||||
|
if (meinPrefab == null) return; // Abbruch, wenn kein Prefab hinterlegt ist
|
||||||
|
|
||||||
|
// Instantiate erstellt eine Kopie des Prefabs an unserer aktuellen Position
|
||||||
|
GameObject neuesObjekt = Instantiate(meinPrefab, transform.position, Quaternion.identity);
|
||||||
|
|
||||||
|
// Wir können das neue Objekt direkt benennen
|
||||||
|
neuesObjekt.name = "Klon_von_" + gameObject.name;
|
||||||
|
|
||||||
|
// Wir können das Objekt nach 5 Sekunden automatisch zerstören lassen
|
||||||
|
Destroy(neuesObjekt, 5f);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========================================================================
|
||||||
|
// 5. PHYSIK & KOLLISIONEN
|
||||||
|
// ========================================================================
|
||||||
|
|
||||||
|
// Wird ausgelöst, wenn ein anderes Objekt (mit Collider und Rigidbody) uns RAMMT
|
||||||
|
void OnCollisionEnter(Collision collision)
|
||||||
|
{
|
||||||
|
// Checken, wen wir da gerammt haben (anhand von Tags)
|
||||||
|
if (collision.gameObject.CompareTag("Player"))
|
||||||
|
{
|
||||||
|
Debug.Log("Autsch! Der Spieler hat mich gerammt!");
|
||||||
|
|
||||||
|
// So können wir z.B. Leben abziehen:
|
||||||
|
lebenspunkte -= 10;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Wird ausgelöst, wenn ein Objekt eine unsichtbare Lichtschranke durchquert
|
||||||
|
// (Collider muss auf "Is Trigger" gestellt sein)
|
||||||
|
void OnTriggerEnter(Collider other)
|
||||||
|
{
|
||||||
|
Debug.Log("Etwas ist in meinen Trigger gelaufen: " + other.name);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========================================================================
|
||||||
|
// 6. RAYCASTING (Laser-Strahlen schießen)
|
||||||
|
// ========================================================================
|
||||||
|
|
||||||
|
private void SchiesseLaser()
|
||||||
|
{
|
||||||
|
RaycastHit hit;
|
||||||
|
// Schießt einen Strahl von unserer Position nach vorne, 100 Meter weit
|
||||||
|
if (Physics.Raycast(transform.position, transform.forward, out hit, 100f))
|
||||||
|
{
|
||||||
|
Debug.Log("Ich schaue genau auf: " + hit.collider.name);
|
||||||
|
|
||||||
|
// Wenn man auf das getroffene Objekt zugreifen will:
|
||||||
|
// hit.collider.gameObject.GetComponent<AnderesSkript>().MachWas();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========================================================================
|
||||||
|
// 7. COROUTINEN (Dinge, die Zeit brauchen / Warten)
|
||||||
|
// ========================================================================
|
||||||
|
|
||||||
|
// Eine Methode vom Typ IEnumerator läuft parallel und kann pausiert werden
|
||||||
|
private IEnumerator MeinTimer()
|
||||||
|
{
|
||||||
|
Debug.Log("Timer gestartet...");
|
||||||
|
|
||||||
|
// Pausiert die Ausführung dieser Methode für exakt 2 Sekunden
|
||||||
|
yield return new WaitForSeconds(2f);
|
||||||
|
|
||||||
|
Debug.Log("2 Sekunden sind vorbei!");
|
||||||
|
|
||||||
|
// Endlos-Schleifen sind hier okay, WEIL sie mit yield return pausiert werden!
|
||||||
|
while (lebenspunkte > 0)
|
||||||
|
{
|
||||||
|
// Mache jede Sekunde einen Tick Schaden
|
||||||
|
// lebenspunkte -= 1;
|
||||||
|
yield return new WaitForSeconds(1f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/DOTS Cheat Sheet.cs.meta
Normal file
2
Assets/Scripts/DOTS Cheat Sheet.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4896b8c3148946c47b13a06dc41770db
|
||||||
24
Assets/Scripts/DotsSpawnerAuthoring.cs
Normal file
24
Assets/Scripts/DotsSpawnerAuthoring.cs
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
using Unity.Entities;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace HappyForest.Prototypen
|
||||||
|
{
|
||||||
|
public class DotsSpawnerAuthoring : MonoBehaviour
|
||||||
|
{
|
||||||
|
public GameObject dotsPrefab;
|
||||||
|
|
||||||
|
class Baker : Baker<DotsSpawnerAuthoring>
|
||||||
|
{
|
||||||
|
public override void Bake(DotsSpawnerAuthoring authoring)
|
||||||
|
{
|
||||||
|
var entity = GetEntity(TransformUsageFlags.None);
|
||||||
|
|
||||||
|
AddComponent(entity, new SpawnerData
|
||||||
|
{
|
||||||
|
// TransformUsageFlags.Dynamic ist extrem wichtig, damit die Pille sich später bewegen darf!
|
||||||
|
DotsPrefabEntity = GetEntity(authoring.dotsPrefab, TransformUsageFlags.Dynamic)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/DotsSpawnerAuthoring.cs.meta
Normal file
2
Assets/Scripts/DotsSpawnerAuthoring.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 79a07f7d3dc16674ea11eff80a43f514
|
||||||
|
|
@ -1,35 +1,160 @@
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Unity.Entities;
|
||||||
|
using Unity.Transforms;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
public class ManagerScript : MonoBehaviour
|
namespace HappyForest.Prototypen
|
||||||
{
|
{
|
||||||
[Header("Spawner Einstellungen")]
|
// --- DOTS DATEN FÜR DEN MANAGER ---
|
||||||
[SerializeField] private GameObject prefabToSpawn; // Ziehe hier dein Prefab im Inspector rein
|
public struct SpawnerData : IComponentData
|
||||||
[SerializeField] private Vector3 spawnPosition = Vector3.zero;
|
{
|
||||||
|
public Entity DotsPrefabEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- DER OOP MANAGER ---
|
||||||
|
public class ManagerScript : MonoBehaviour
|
||||||
|
{
|
||||||
|
[Header("Architektur Switch")]
|
||||||
|
[Tooltip("Schaltet um auf das rasend schnelle Entity Component System")]
|
||||||
|
public bool nutzeDOTS = false;
|
||||||
|
public GameObject dotsPrefab; // Zieh hier dein NEUES DOTS-Prefab rein
|
||||||
|
|
||||||
|
[Header("OOP Spawner Einstellungen")]
|
||||||
|
public GameObject oopPrefab; // Dein altes Prefab
|
||||||
|
public bool pillenKollidieren = true;
|
||||||
|
|
||||||
|
[Header("Tasten-Einstellungen")]
|
||||||
|
public float aktionsVerzoegerung = 0.1f;
|
||||||
|
private float letzterAktionsZeitpunkt = 0f;
|
||||||
|
|
||||||
|
[HideInInspector]
|
||||||
|
public List<GameObject> aktivePillen = new List<GameObject>();
|
||||||
|
|
||||||
|
// DOTS Referenzen
|
||||||
|
private EntityManager entityManager;
|
||||||
|
private EntityQuery spawnerQuery;
|
||||||
|
private int dotsPillenCount = 0;
|
||||||
|
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
SpawnObject();
|
// Initialisiere DOTS Welt
|
||||||
|
if (World.DefaultGameObjectInjectionWorld != null)
|
||||||
|
{
|
||||||
|
entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
|
||||||
|
spawnerQuery = entityManager.CreateEntityQuery(typeof(SpawnerData));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Update()
|
void Update()
|
||||||
{
|
{
|
||||||
// Beispiel: Spawnen per Leertaste
|
// Tote OOP-Pillen aussortieren (falls sie über -10 gefallen sind)
|
||||||
if (Input.GetKeyDown(KeyCode.Space))
|
aktivePillen.RemoveAll(pille => pille == null);
|
||||||
|
|
||||||
|
// Tasten gedrückt halten (mit Cooldown)
|
||||||
|
if (Time.time - letzterAktionsZeitpunkt > aktionsVerzoegerung)
|
||||||
{
|
{
|
||||||
SpawnObject();
|
// HIER SIND DIE NEUEN TASTEN FÜR DEINE TASTATUR
|
||||||
|
if (Input.GetKey(KeyCode.Space))
|
||||||
|
{
|
||||||
|
Debug.Log("Leertaste gedrückt!"); // <--- NEU
|
||||||
|
SpawnPille(1);
|
||||||
|
letzterAktionsZeitpunkt = Time.time;
|
||||||
|
}
|
||||||
|
else if (Input.GetKey(KeyCode.M))
|
||||||
|
{
|
||||||
|
PilleEntfernen();
|
||||||
|
letzterAktionsZeitpunkt = Time.time;
|
||||||
|
}
|
||||||
|
else if (Input.GetKey(KeyCode.C))
|
||||||
|
{
|
||||||
|
SpawnPille(100);
|
||||||
|
letzterAktionsZeitpunkt = Time.time;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SpawnObject()
|
private void SpawnPille(int anzahl)
|
||||||
{
|
{
|
||||||
if (prefabToSpawn != null)
|
if (nutzeDOTS)
|
||||||
{
|
{
|
||||||
// Spawnt das Prefab an der Position spawnPosition mit Standard-Rotation
|
// --- DOTS SPAWN ---
|
||||||
Instantiate(prefabToSpawn, spawnPosition, Quaternion.identity);
|
if (!spawnerQuery.HasSingleton<SpawnerData>())
|
||||||
|
{
|
||||||
|
Debug.LogError("Abbruch: Manager findet SpawnerData nicht!"); // <--- NEU
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Entity prefab = spawnerQuery.GetSingleton<SpawnerData>().DotsPrefabEntity;
|
||||||
|
|
||||||
|
for (int i = 0; i < anzahl; i++)
|
||||||
|
{
|
||||||
|
Entity newEntity = entityManager.Instantiate(prefab);
|
||||||
|
|
||||||
|
// Optionale Startposition (z.B. aus einer bestehenden Pille) könnte man hier über LocalTransform setzen
|
||||||
|
entityManager.SetComponentData(newEntity, LocalTransform.FromPosition(Vector3.zero));
|
||||||
|
dotsPillenCount++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.LogWarning("ManagerScript: Keinem Prefab zugewiesen!");
|
// --- OOP SPAWN (Dein alter Code) ---
|
||||||
|
for (int i = 0; i < anzahl; i++)
|
||||||
|
{
|
||||||
|
Vector3 spawnPos = Vector3.zero;
|
||||||
|
if (aktivePillen.Count > 0)
|
||||||
|
{
|
||||||
|
GameObject randomPille = aktivePillen[Random.Range(0, aktivePillen.Count)];
|
||||||
|
spawnPos = randomPille.transform.position;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (oopPrefab != null)
|
||||||
|
{
|
||||||
|
GameObject neu = Instantiate(oopPrefab, spawnPos, Quaternion.identity);
|
||||||
|
aktivePillen.Add(neu);
|
||||||
|
|
||||||
|
// Kollision umschalten
|
||||||
|
if (!pillenKollidieren) neu.layer = LayerMask.NameToLayer("Pille");
|
||||||
|
else neu.layer = LayerMask.NameToLayer("Default");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void PilleEntfernen()
|
||||||
|
{
|
||||||
|
if (nutzeDOTS)
|
||||||
|
{
|
||||||
|
// In DOTS müsste man hier eine Query machen und eine Entity löschen.
|
||||||
|
// Für diesen Test reduzieren wir nur den Zähler zur Veranschaulichung.
|
||||||
|
Debug.Log("Löschen in DOTS benötigt einen kleinen Extra-Job!");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (aktivePillen.Count > 0)
|
||||||
|
{
|
||||||
|
GameObject pilleToDelete = aktivePillen[0];
|
||||||
|
aktivePillen.RemoveAt(0);
|
||||||
|
Destroy(pilleToDelete);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnGUI()
|
||||||
|
{
|
||||||
|
GUI.color = Color.yellow;
|
||||||
|
GUI.skin.label.fontSize = 20;
|
||||||
|
|
||||||
|
int fps = (int)(1f / Time.unscaledDeltaTime);
|
||||||
|
GUI.Label(new Rect(10, 10, 400, 30), $"FPS: {fps}");
|
||||||
|
|
||||||
|
if (nutzeDOTS)
|
||||||
|
{
|
||||||
|
GUI.Label(new Rect(10, 40, 400, 30), $"Aktive DOTS Pillen (Gespawnt): {dotsPillenCount}");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GUI.Label(new Rect(10, 40, 400, 30), $"Aktive OOP Pillen: {aktivePillen.Count}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
89
Assets/Scripts/MovingScript.cs
Normal file
89
Assets/Scripts/MovingScript.cs
Normal file
|
|
@ -0,0 +1,89 @@
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace HappyForest.Prototypen
|
||||||
|
{
|
||||||
|
//// Zwingt Unity, der Pille automatisch einen Rigidbody zu geben, falls noch keiner da ist
|
||||||
|
[RequireComponent(typeof(Rigidbody))]
|
||||||
|
public class WanderndePille : MonoBehaviour
|
||||||
|
{
|
||||||
|
[SerializeField] private float geschwindigkeit = 5f;
|
||||||
|
[SerializeField] private string wandTag = "Wand"; // Nach diesem Etikett suchen wir
|
||||||
|
[SerializeField] private string pilleTag = "Pille"; // NEU: Damit sie sich auch gegenseitig erkennen
|
||||||
|
|
||||||
|
private Rigidbody meinRigidbody;
|
||||||
|
private float zeitLetzterDrehung = 0f; // NEU: Ein Timer, damit sie sich nicht zu oft dreht
|
||||||
|
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
// Rigidbody-Referenz holen
|
||||||
|
meinRigidbody = GetComponent<Rigidbody>();
|
||||||
|
|
||||||
|
// WICHTIG: Damit die Pille nicht umfällt UND nicht durch Kollisionen anfängt zu trudeln!
|
||||||
|
// FreezeRotation sperrt direkt alle drei Achsen (X, Y und Z) für die Physik-Engine.
|
||||||
|
meinRigidbody.constraints = RigidbodyConstraints.FreezeRotation;
|
||||||
|
|
||||||
|
// Zum Start direkt eine zufällige Richtung aussuchen
|
||||||
|
NeueRichtungWaehlen(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void FixedUpdate()
|
||||||
|
{
|
||||||
|
// NEU: Fällt die Pille in den Abgrund?
|
||||||
|
// Wenn Y kleiner als -10 ist, löscht sie sich selbst und beendet die Methode sofort mit "return".
|
||||||
|
if (transform.position.y < -10f)
|
||||||
|
{
|
||||||
|
Destroy(gameObject);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Wir setzen die Geschwindigkeit des Rigidbodys konstant auf unsere Blickrichtung (forward)
|
||||||
|
// Die Y-Geschwindigkeit (Fallen) behalten wir bei, damit Schwerkraft noch funktioniert
|
||||||
|
Vector3 neueGeschwindigkeit = transform.forward * geschwindigkeit;
|
||||||
|
neueGeschwindigkeit.y = meinRigidbody.linearVelocity.y;
|
||||||
|
|
||||||
|
meinRigidbody.linearVelocity = neueGeschwindigkeit;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Wird automatisch von Unity aufgerufen, wenn unser Collider einen anderen Collider rammt
|
||||||
|
void OnCollisionEnter(Collision collision)
|
||||||
|
{
|
||||||
|
// Haben wir eine Wand ODER eine andere Pille getroffen UND ist die letzte Drehung lang genug her? (Cooldown)
|
||||||
|
if ((collision.gameObject.CompareTag(wandTag) || collision.gameObject.CompareTag(pilleTag)) && Time.time > zeitLetzterDrehung + 0.2f)
|
||||||
|
{
|
||||||
|
zeitLetzterDrehung = Time.time; // Zeitstempel merken
|
||||||
|
NeueRichtungWaehlen(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sicherheitsnetz: Falls sie doch mal hängen bleibt und an der Wand reibt
|
||||||
|
void OnCollisionStay(Collision collision)
|
||||||
|
{
|
||||||
|
if ((collision.gameObject.CompareTag(wandTag) || collision.gameObject.CompareTag(pilleTag)) && Time.time > zeitLetzterDrehung + 0.2f)
|
||||||
|
{
|
||||||
|
zeitLetzterDrehung = Time.time;
|
||||||
|
NeueRichtungWaehlen(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void NeueRichtungWaehlen(bool wandGetroffen)
|
||||||
|
{
|
||||||
|
float neuerWinkel;
|
||||||
|
|
||||||
|
if (wandGetroffen)
|
||||||
|
{
|
||||||
|
// Wenn wir eine Wand treffen, drehen wir uns um ca. 180 Grad um!
|
||||||
|
// (Mit ein bisschen Zufall zwischen 130 und 230 Grad)
|
||||||
|
float aktuellerWinkel = transform.eulerAngles.y;
|
||||||
|
neuerWinkel = aktuellerWinkel + Random.Range(130f, 230f);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Wählt zum Start eine völlig zufällige Zahl zwischen 0 und 360 Grad
|
||||||
|
neuerWinkel = Random.Range(0f, 360f);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Dreht die Pille auf der Y-Achse (die Achse, die nach oben zeigt)
|
||||||
|
transform.rotation = Quaternion.Euler(0f, neuerWinkel, 0f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/MovingScript.cs.meta
Normal file
2
Assets/Scripts/MovingScript.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 25d7cd903fe278743bee455fa70ffd68
|
||||||
27
Assets/Scripts/PilleAuthoring.cs
Normal file
27
Assets/Scripts/PilleAuthoring.cs
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
using Unity.Entities;
|
||||||
|
using UnityEngine;
|
||||||
|
using Unity.Mathematics;
|
||||||
|
|
||||||
|
namespace HappyForest.Prototypen
|
||||||
|
{
|
||||||
|
public class PilleAuthoring : MonoBehaviour
|
||||||
|
{
|
||||||
|
public float speed = 5f;
|
||||||
|
|
||||||
|
// Der Baker wird von Unity automatisch beim Start ausgeführt
|
||||||
|
class PilleBaker : Baker<PilleAuthoring>
|
||||||
|
{
|
||||||
|
public override void Bake(PilleAuthoring authoring)
|
||||||
|
{
|
||||||
|
var entity = GetEntity(TransformUsageFlags.Dynamic);
|
||||||
|
|
||||||
|
// Wir fügen der Entity unsere reinen Daten hinzu
|
||||||
|
AddComponent(entity, new PilleWanderData
|
||||||
|
{
|
||||||
|
Speed = authoring.speed,
|
||||||
|
Direction = new float3(1, 0, 0) // Startrichtung
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/PilleAuthoring.cs.meta
Normal file
2
Assets/Scripts/PilleAuthoring.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 32b1263ba300f144a92fca434251d14f
|
||||||
12
Assets/Scripts/PilleWanderData.cs
Normal file
12
Assets/Scripts/PilleWanderData.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
using Unity.Entities;
|
||||||
|
using Unity.Mathematics;
|
||||||
|
|
||||||
|
namespace HappyForest.Prototypen
|
||||||
|
{
|
||||||
|
// IComponentData markiert dieses Struct als DOTS-Komponente
|
||||||
|
public struct PilleWanderData : IComponentData
|
||||||
|
{
|
||||||
|
public float Speed;
|
||||||
|
public float3 Direction;
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/PilleWanderData.cs.meta
Normal file
2
Assets/Scripts/PilleWanderData.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f8ca2cbf1bd951143b9467b154c4281e
|
||||||
40
Assets/Scripts/PilleWanderSystem.cs
Normal file
40
Assets/Scripts/PilleWanderSystem.cs
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
using Unity.Burst;
|
||||||
|
using Unity.Entities;
|
||||||
|
using Unity.Transforms;
|
||||||
|
using Unity.Mathematics;
|
||||||
|
|
||||||
|
namespace HappyForest.Prototypen
|
||||||
|
{
|
||||||
|
[BurstCompile]
|
||||||
|
public partial struct PilleWanderSystem : ISystem
|
||||||
|
{
|
||||||
|
[BurstCompile]
|
||||||
|
public void OnCreate(ref SystemState state)
|
||||||
|
{
|
||||||
|
state.RequireForUpdate<PilleWanderData>();
|
||||||
|
}
|
||||||
|
|
||||||
|
[BurstCompile]
|
||||||
|
public void OnUpdate(ref SystemState state)
|
||||||
|
{
|
||||||
|
float deltaTime = SystemAPI.Time.DeltaTime;
|
||||||
|
|
||||||
|
// Ein EntityCommandBuffer wird benötigt, um Entities sicher zu zerstören,
|
||||||
|
// während wir gerade über sie iterieren.
|
||||||
|
var ecb = SystemAPI.GetSingleton<EndSimulationEntityCommandBufferSystem.Singleton>().CreateCommandBuffer(state.WorldUnmanaged);
|
||||||
|
|
||||||
|
// Iteriere über alle Entities, die eine Position (LocalTransform) und unsere WanderData haben
|
||||||
|
foreach (var (transform, wanderData, entity) in SystemAPI.Query<RefRW<LocalTransform>, RefRO<PilleWanderData>>().WithEntityAccess())
|
||||||
|
{
|
||||||
|
// 1. Bewegen (Aktuelle Position + Richtung * Geschwindigkeit * Zeit)
|
||||||
|
transform.ValueRW.Position += wanderData.ValueRO.Direction * wanderData.ValueRO.Speed * deltaTime;
|
||||||
|
|
||||||
|
// 2. Abgrund-Check (Runtergefallen?)
|
||||||
|
if (transform.ValueRO.Position.y < -10f)
|
||||||
|
{
|
||||||
|
ecb.DestroyEntity(entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/PilleWanderSystem.cs.meta
Normal file
2
Assets/Scripts/PilleWanderSystem.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: bbc9d633e4db8d248a1394d5c6ca02d2
|
||||||
180
Assets/Scripts/Unity API Referenz.cs
Normal file
180
Assets/Scripts/Unity API Referenz.cs
Normal file
|
|
@ -0,0 +1,180 @@
|
||||||
|
namespace UnityAPIReference
|
||||||
|
{
|
||||||
|
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.SceneManagement; // WICHTIG: Für den Szenen-Wechsel
|
||||||
|
using UnityEngine.UI; // WICHTIG: Für klassische UI (Text, Buttons)
|
||||||
|
|
||||||
|
public class UnityAPIReferenz : MonoBehaviour
|
||||||
|
{
|
||||||
|
[Header("Referenzen auf andere Komponenten")]
|
||||||
|
public Rigidbody meinRigidbody;
|
||||||
|
public Renderer meinRenderer;
|
||||||
|
public AudioSource meineAudioquelle;
|
||||||
|
public Animator meinAnimator;
|
||||||
|
public Light meinLicht;
|
||||||
|
public Text meinUI_Text;
|
||||||
|
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
// ========================================================================
|
||||||
|
// 1. DAS EIGENE GAMEOBJECT KONTROLLIEREN
|
||||||
|
// ========================================================================
|
||||||
|
|
||||||
|
// Das Objekt komplett de-aktivieren (verschwindet aus der Welt, Updates stoppen)
|
||||||
|
gameObject.SetActive(false);
|
||||||
|
gameObject.SetActive(true);
|
||||||
|
|
||||||
|
// Namen und Tag auslesen oder ändern
|
||||||
|
gameObject.name = "Neuer_Name_im_Inspector";
|
||||||
|
gameObject.tag = "Player"; // (Achtung: Der Tag muss im Editor existieren!)
|
||||||
|
|
||||||
|
// Das Objekt nach 3 Sekunden komplett aus dem Speicher löschen
|
||||||
|
Destroy(gameObject, 3f);
|
||||||
|
|
||||||
|
|
||||||
|
// ========================================================================
|
||||||
|
// 2. TRANSFORM (Position, Rotation, Skalierung & Hierarchie)
|
||||||
|
// Transform hat JEDES GameObject standardmäßig.
|
||||||
|
// ========================================================================
|
||||||
|
|
||||||
|
// Position setzen (Vector3 = X, Y, Z Koordinaten)
|
||||||
|
transform.position = new Vector3(0, 5, 0); // Absolute Welt-Position
|
||||||
|
transform.localPosition = new Vector3(0, 0, 0); // Position relativ zum "Eltern-Objekt"
|
||||||
|
|
||||||
|
// Rotation setzen (Quaternion ist komplex, daher nutzen wir Euler-Winkel in Grad)
|
||||||
|
transform.rotation = Quaternion.Euler(0, 90, 0); // Dreht das Objekt um 90 Grad auf der Y-Achse
|
||||||
|
|
||||||
|
// Skalierung (Größe) ändern
|
||||||
|
transform.localScale = new Vector3(2, 2, 2); // Macht das Objekt doppelt so groß
|
||||||
|
|
||||||
|
// Direkte Bewegungen (ohne Physik!)
|
||||||
|
transform.Translate(Vector3.forward * 5f); // 5 Meter nach vorne schieben
|
||||||
|
transform.Rotate(Vector3.up, 45f); // Um 45 Grad drehen
|
||||||
|
|
||||||
|
// Hierarchie (Parenting) ändern
|
||||||
|
// transform.SetParent(anderesGameObject.transform); // Hängt dieses Objekt an ein anderes an
|
||||||
|
transform.SetParent(null); // Macht das Objekt wieder komplett unabhängig (Root-Ebene)
|
||||||
|
|
||||||
|
|
||||||
|
// ========================================================================
|
||||||
|
// 3. KOMPONENTEN FINDEN UND AUSLESEN (Sehr wichtig!)
|
||||||
|
// ========================================================================
|
||||||
|
|
||||||
|
// Holt die Komponente "BoxCollider", die auf demselben GameObject liegt
|
||||||
|
BoxCollider meinCollider = GetComponent<BoxCollider>();
|
||||||
|
if (meinCollider != null)
|
||||||
|
{
|
||||||
|
meinCollider.enabled = false; // Schaltet die Kollision ab
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========================================================================
|
||||||
|
// 4. PHYSIK (Rigidbody)
|
||||||
|
// ========================================================================
|
||||||
|
|
||||||
|
if (meinRigidbody != null)
|
||||||
|
{
|
||||||
|
// Einen Impuls-Schub geben (z.B. für einen Sprung oder eine Explosion)
|
||||||
|
meinRigidbody.AddForce(Vector3.up * 500f, ForceMode.Impulse);
|
||||||
|
|
||||||
|
// Die aktuelle Geschwindigkeit direkt überschreiben oder auslesen
|
||||||
|
meinRigidbody.linearVelocity = new Vector3(0, 10, 0);
|
||||||
|
|
||||||
|
// Schwerkraft für dieses Objekt deaktivieren
|
||||||
|
meinRigidbody.useGravity = false;
|
||||||
|
|
||||||
|
// Masse ändern
|
||||||
|
meinRigidbody.mass = 50f;
|
||||||
|
|
||||||
|
// IsKinematic: Wenn true, wird das Objekt NICHT mehr von Physik (Schwerkraft/Stöße)
|
||||||
|
// beeinflusst, kann aber per Skript bewegt werden und rammt andere Objekte weg.
|
||||||
|
meinRigidbody.isKinematic = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========================================================================
|
||||||
|
// 5. GRAFIK & MATERIALIEN (Renderer)
|
||||||
|
// ========================================================================
|
||||||
|
|
||||||
|
if (meinRenderer != null)
|
||||||
|
{
|
||||||
|
// Das Objekt unsichtbar machen (es bleibt aber da und hat noch Kollision!)
|
||||||
|
meinRenderer.enabled = false;
|
||||||
|
|
||||||
|
// Die Farbe des Materials ändern
|
||||||
|
meinRenderer.material.color = Color.red; // Standard-Farben
|
||||||
|
meinRenderer.material.color = new Color(0.5f, 0.2f, 0.8f, 1f); // RGBA (Rot, Grün, Blau, Alpha/Transparenz)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========================================================================
|
||||||
|
// 6. AUDIO & SOUNDS
|
||||||
|
// ========================================================================
|
||||||
|
|
||||||
|
if (meineAudioquelle != null)
|
||||||
|
{
|
||||||
|
meineAudioquelle.volume = 0.5f; // Lautstärke (0.0 bis 1.0)
|
||||||
|
meineAudioquelle.pitch = 1.2f; // Tonhöhe (1.0 = normal, < 1 = tiefer/langsamer)
|
||||||
|
meineAudioquelle.Play(); // Sound abspielen
|
||||||
|
meineAudioquelle.Stop(); // Sound stoppen
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========================================================================
|
||||||
|
// 7. ANIMATIONEN (Animator)
|
||||||
|
// Setzt Parameter, die du im Animator-Fenster definiert hast
|
||||||
|
// ========================================================================
|
||||||
|
|
||||||
|
if (meinAnimator != null)
|
||||||
|
{
|
||||||
|
meinAnimator.SetBool("IsRunning", true); // Eine Checkbox umschalten
|
||||||
|
meinAnimator.SetFloat("Speed", 5.5f); // Einen Komma-Wert übergeben
|
||||||
|
meinAnimator.SetTrigger("Jump"); // Einen einmaligen Impuls feuern
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========================================================================
|
||||||
|
// 8. LICHT
|
||||||
|
// ========================================================================
|
||||||
|
|
||||||
|
if (meinLicht != null)
|
||||||
|
{
|
||||||
|
meinLicht.intensity = 10f; // Helligkeit
|
||||||
|
meinLicht.color = Color.yellow; // Lichtfarbe
|
||||||
|
meinLicht.range = 50f; // Reichweite des Lichts
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========================================================================
|
||||||
|
// 9. ZEIT KONTROLLIEREN (Time-Klasse)
|
||||||
|
// ========================================================================
|
||||||
|
|
||||||
|
// Zeitlupen-Effekt (0.5 = halbe Geschwindigkeit, 0 = Spiel pausiert!)
|
||||||
|
// Time.timeScale = 0.5f;
|
||||||
|
|
||||||
|
// Wieviel Zeit seit Spielstart vergangen ist (in Sekunden)
|
||||||
|
float zeit = Time.time;
|
||||||
|
|
||||||
|
// ========================================================================
|
||||||
|
// 10. SZENEN & LEVEL WECHSELN
|
||||||
|
// ========================================================================
|
||||||
|
|
||||||
|
// Lädt die Szene mit dem Namen "Level_02" (Muss in den Build-Settings hinzugefügt sein!)
|
||||||
|
// SceneManager.LoadScene("Level_02");
|
||||||
|
|
||||||
|
// Lädt die aktuelle Szene neu (z.B. nach einem Game Over)
|
||||||
|
// SceneManager.LoadScene(SceneManager.GetActiveScene().name);
|
||||||
|
|
||||||
|
// ========================================================================
|
||||||
|
// 11. HILFS-MATHEMATIK (Die Unity Mathf Klasse)
|
||||||
|
// ========================================================================
|
||||||
|
|
||||||
|
// Clamp: Begrenzt einen Wert auf ein Minimum und Maximum
|
||||||
|
float lebenspunkte = 150f;
|
||||||
|
lebenspunkte = Mathf.Clamp(lebenspunkte, 0f, 100f); // Setzt den Wert zwingend auf max 100 zurück
|
||||||
|
|
||||||
|
// Random: Eine Zufallszahl generieren
|
||||||
|
int zufallsZahl = Random.Range(1, 10); // Zahl zwischen 1 und 9 (Int-Maximum ist exklusiv!)
|
||||||
|
float zufallsKomma = Random.Range(0f, 5.5f); // Float-Maximum ist inklusiv.
|
||||||
|
|
||||||
|
// Lerp (Linear Interpolation): Einen sanften Übergang zwischen zwei Werten berechnen
|
||||||
|
// Hier: Berechne den Wert genau in der Mitte (0.5f) zwischen 10 und 20 -> Ergebnis: 15
|
||||||
|
float sanfterWert = Mathf.Lerp(10f, 20f, 0.5f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/Unity API Referenz.cs.meta
Normal file
2
Assets/Scripts/Unity API Referenz.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 33a1f9a622bebf94faead6cf97e62e2c
|
||||||
205
Assets/Scripts/Unity Cheat Sheet.cs
Normal file
205
Assets/Scripts/Unity Cheat Sheet.cs
Normal file
|
|
@ -0,0 +1,205 @@
|
||||||
|
namespace UnityCheatSheet
|
||||||
|
{
|
||||||
|
|
||||||
|
using System; // Wird für Events / Actions benötigt
|
||||||
|
using System.Collections; // Wird für Coroutinen benötigt
|
||||||
|
using UnityEngine; // Der Haupt-Namespace für fast alles in Unity
|
||||||
|
|
||||||
|
// Das Attribut RequireComponent zwingt Unity dazu, automatisch einen Rigidbody
|
||||||
|
// an das GameObject zu hängen, sobald dieses Skript hinzugefügt wird.
|
||||||
|
[RequireComponent(typeof(Rigidbody))]
|
||||||
|
public class UnityReferenz : MonoBehaviour
|
||||||
|
{
|
||||||
|
// ========================================================================
|
||||||
|
// 1. VARIABLEN & SICHTBARKEIT (Attribute für den Inspektor)
|
||||||
|
// ========================================================================
|
||||||
|
|
||||||
|
[Header("Basis-Variablen")]
|
||||||
|
[Tooltip("Das ist ein Tooltip. Er erscheint, wenn man mit der Maus im Editor darüber fährt.")]
|
||||||
|
public int lebenspunkte = 100; // Public: Von überall sichtbar UND im Editor sichtbar
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private float geschwindigkeit = 5.5f; // Private + SerializeField: Nur in diesem Skript nutzbar, ABER im Editor einstellbar! (Best Practice)
|
||||||
|
|
||||||
|
[Range(0f, 1f)]
|
||||||
|
public float lautstaerke = 0.5f; // Erzeugt einen schönen Schieberegler im Unity Editor
|
||||||
|
|
||||||
|
[HideInInspector]
|
||||||
|
public bool istVersteckt = true; // Public, aber im Editor unsichtbar (für interne Logik)
|
||||||
|
|
||||||
|
[Header("Referenzen zu anderen Dingen")]
|
||||||
|
[SerializeField] private GameObject meinPrefab; // Referenz auf ein Prefab (z.B. ein Schuss oder Gegner)
|
||||||
|
[SerializeField] private Transform zielPosition; // Referenz auf eine Position in der Welt (Transform)
|
||||||
|
[SerializeField] private Renderer meinRenderer; // Referenz auf eine visuelle Komponente
|
||||||
|
|
||||||
|
// Private Variablen (weder von außen noch vom Editor erreichbar)
|
||||||
|
private Rigidbody meinRigidbody;
|
||||||
|
private float zeitSeitStart = 0f;
|
||||||
|
|
||||||
|
// ========================================================================
|
||||||
|
// 2. UNITY LEBENSZYKLUS (Event-Methoden, die Unity automatisch aufruft)
|
||||||
|
// ========================================================================
|
||||||
|
|
||||||
|
// Awake wird als ALLERERSTES aufgerufen, noch bevor das Spiel richtig losgeht.
|
||||||
|
// Hier holt man sich Referenzen auf die eigenen Komponenten.
|
||||||
|
void Awake()
|
||||||
|
{
|
||||||
|
// Holt den Rigidbody, der auf DIESEM GameObject liegt.
|
||||||
|
meinRigidbody = GetComponent<Rigidbody>();
|
||||||
|
|
||||||
|
if (meinRigidbody == null)
|
||||||
|
{
|
||||||
|
Debug.LogError("Hilfe! Hier fehlt ein Rigidbody!"); // Schreibt einen Fehler in die Konsole
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Start wird aufgerufen, bevor das erste Update läuft (für Initialisierungen).
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
Debug.Log("Das Spiel ist gestartet! Hallo von: " + gameObject.name);
|
||||||
|
|
||||||
|
// Farbe ändern als Test
|
||||||
|
if (meinRenderer != null)
|
||||||
|
{
|
||||||
|
meinRenderer.material.color = Color.blue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Startet eine asynchrone Hintergrund-Schleife (Coroutinen, siehe unten)
|
||||||
|
StartCoroutine(MeinTimer());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update wird JEDEN FRAME aufgerufen.
|
||||||
|
// Achtung: Wenn das Spiel mit 60 FPS läuft, läuft das hier 60x pro Sekunde!
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
// 1. Timer hochzählen mit Time.deltaTime (Zeit, die seit dem letzten Frame vergangen ist)
|
||||||
|
zeitSeitStart += Time.deltaTime;
|
||||||
|
|
||||||
|
// 2. Input abfragen
|
||||||
|
AbfrageInput();
|
||||||
|
}
|
||||||
|
|
||||||
|
// FixedUpdate wird in festen Zeitintervallen aufgerufen (Standard: 50x pro Sekunde).
|
||||||
|
// ALLES was mit Physik zu tun hat, MUSS hier rein, NICHT in Update!
|
||||||
|
void FixedUpdate()
|
||||||
|
{
|
||||||
|
// Beispiel: Wir schieben das Objekt stetig nach vorne
|
||||||
|
// meinRigidbody.AddForce(Vector3.forward * geschwindigkeit);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========================================================================
|
||||||
|
// 3. EIGENE METHODEN: INPUT & BEWEGUNG
|
||||||
|
// ========================================================================
|
||||||
|
|
||||||
|
private void AbfrageInput()
|
||||||
|
{
|
||||||
|
// TASTENABFRAGE (Einmaliges Drücken)
|
||||||
|
if (Input.GetKeyDown(KeyCode.Space))
|
||||||
|
{
|
||||||
|
Springen();
|
||||||
|
}
|
||||||
|
|
||||||
|
// TASTENABFRAGE (Gedrückt halten)
|
||||||
|
if (Input.GetKey(KeyCode.W))
|
||||||
|
{
|
||||||
|
// Bewege das Objekt direkt (ohne Physik) nach vorne
|
||||||
|
// transform.Translate(Vector3.forward * geschwindigkeit * Time.deltaTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
// MAUSABFRAGE (0 = Links, 1 = Rechts, 2 = Mitte)
|
||||||
|
if (Input.GetMouseButtonDown(0))
|
||||||
|
{
|
||||||
|
SpawnObjekt();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Springen()
|
||||||
|
{
|
||||||
|
// Wirft das Objekt physikalisch in die Luft
|
||||||
|
meinRigidbody.AddForce(Vector3.up * 300f);
|
||||||
|
Debug.Log("Hüpf!");
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========================================================================
|
||||||
|
// 4. INSTANZIIEREN (Spawnen) & ZERSTÖREN
|
||||||
|
// ========================================================================
|
||||||
|
|
||||||
|
public void SpawnObjekt()
|
||||||
|
{
|
||||||
|
if (meinPrefab == null) return; // Abbruch, wenn kein Prefab hinterlegt ist
|
||||||
|
|
||||||
|
// Instantiate erstellt eine Kopie des Prefabs an unserer aktuellen Position
|
||||||
|
GameObject neuesObjekt = Instantiate(meinPrefab, transform.position, Quaternion.identity);
|
||||||
|
|
||||||
|
// Wir können das neue Objekt direkt benennen
|
||||||
|
neuesObjekt.name = "Klon_von_" + gameObject.name;
|
||||||
|
|
||||||
|
// Wir können das Objekt nach 5 Sekunden automatisch zerstören lassen
|
||||||
|
Destroy(neuesObjekt, 5f);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========================================================================
|
||||||
|
// 5. PHYSIK & KOLLISIONEN
|
||||||
|
// ========================================================================
|
||||||
|
|
||||||
|
// Wird ausgelöst, wenn ein anderes Objekt (mit Collider und Rigidbody) uns RAMMT
|
||||||
|
void OnCollisionEnter(Collision collision)
|
||||||
|
{
|
||||||
|
// Checken, wen wir da gerammt haben (anhand von Tags)
|
||||||
|
if (collision.gameObject.CompareTag("Player"))
|
||||||
|
{
|
||||||
|
Debug.Log("Autsch! Der Spieler hat mich gerammt!");
|
||||||
|
|
||||||
|
// So können wir z.B. Leben abziehen:
|
||||||
|
lebenspunkte -= 10;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Wird ausgelöst, wenn ein Objekt eine unsichtbare Lichtschranke durchquert
|
||||||
|
// (Collider muss auf "Is Trigger" gestellt sein)
|
||||||
|
void OnTriggerEnter(Collider other)
|
||||||
|
{
|
||||||
|
Debug.Log("Etwas ist in meinen Trigger gelaufen: " + other.name);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========================================================================
|
||||||
|
// 6. RAYCASTING (Laser-Strahlen schießen)
|
||||||
|
// ========================================================================
|
||||||
|
|
||||||
|
private void SchiesseLaser()
|
||||||
|
{
|
||||||
|
RaycastHit hit;
|
||||||
|
// Schießt einen Strahl von unserer Position nach vorne, 100 Meter weit
|
||||||
|
if (Physics.Raycast(transform.position, transform.forward, out hit, 100f))
|
||||||
|
{
|
||||||
|
Debug.Log("Ich schaue genau auf: " + hit.collider.name);
|
||||||
|
|
||||||
|
// Wenn man auf das getroffene Objekt zugreifen will:
|
||||||
|
// hit.collider.gameObject.GetComponent<AnderesSkript>().MachWas();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========================================================================
|
||||||
|
// 7. COROUTINEN (Dinge, die Zeit brauchen / Warten)
|
||||||
|
// ========================================================================
|
||||||
|
|
||||||
|
// Eine Methode vom Typ IEnumerator läuft parallel und kann pausiert werden
|
||||||
|
private IEnumerator MeinTimer()
|
||||||
|
{
|
||||||
|
Debug.Log("Timer gestartet...");
|
||||||
|
|
||||||
|
// Pausiert die Ausführung dieser Methode für exakt 2 Sekunden
|
||||||
|
yield return new WaitForSeconds(2f);
|
||||||
|
|
||||||
|
Debug.Log("2 Sekunden sind vorbei!");
|
||||||
|
|
||||||
|
// Endlos-Schleifen sind hier okay, WEIL sie mit yield return pausiert werden!
|
||||||
|
while (lebenspunkte > 0)
|
||||||
|
{
|
||||||
|
// Mache jede Sekunde einen Tick Schaden
|
||||||
|
// lebenspunkte -= 1;
|
||||||
|
yield return new WaitForSeconds(1f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/Unity Cheat Sheet.cs.meta
Normal file
2
Assets/Scripts/Unity Cheat Sheet.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1f887ce3b1cfb6c429cccd8f79997796
|
||||||
4
Happy_Forest.slnx
Normal file
4
Happy_Forest.slnx
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
<Solution>
|
||||||
|
<Project Path="Assembly-CSharp.csproj" />
|
||||||
|
<Project Path="Assembly-CSharp-Editor.csproj" />
|
||||||
|
</Solution>
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"com.unity.entities": "1.4.8",
|
||||||
|
"com.unity.ide.visualstudio": "2.0.27",
|
||||||
"com.unity.multiplayer.center": "1.0.1",
|
"com.unity.multiplayer.center": "1.0.1",
|
||||||
"com.unity.shadergraph": "17.3.0",
|
"com.unity.shadergraph": "17.3.0",
|
||||||
"com.unity.modules.accessibility": "1.0.0",
|
"com.unity.modules.accessibility": "1.0.0",
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.unity.burst": {
|
"com.unity.burst": {
|
||||||
"version": "1.8.30",
|
"version": "1.8.30",
|
||||||
"depth": 2,
|
"depth": 1,
|
||||||
"source": "registry",
|
"source": "registry",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.unity.mathematics": "1.2.1",
|
"com.unity.mathematics": "1.2.1",
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
},
|
},
|
||||||
"com.unity.collections": {
|
"com.unity.collections": {
|
||||||
"version": "2.6.8",
|
"version": "2.6.8",
|
||||||
"depth": 2,
|
"depth": 1,
|
||||||
"source": "registry",
|
"source": "registry",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.unity.burst": "1.8.29",
|
"com.unity.burst": "1.8.29",
|
||||||
|
|
@ -23,15 +23,46 @@
|
||||||
},
|
},
|
||||||
"url": "https://packages.unity.com"
|
"url": "https://packages.unity.com"
|
||||||
},
|
},
|
||||||
|
"com.unity.entities": {
|
||||||
|
"version": "1.4.8",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "registry",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.burst": "1.8.29",
|
||||||
|
"com.unity.collections": "2.6.8",
|
||||||
|
"com.unity.mathematics": "1.3.2",
|
||||||
|
"com.unity.modules.audio": "1.0.0",
|
||||||
|
"com.unity.serialization": "3.1.3",
|
||||||
|
"com.unity.profiling.core": "1.0.3",
|
||||||
|
"com.unity.modules.physics": "1.0.0",
|
||||||
|
"com.unity.nuget.mono-cecil": "1.11.6",
|
||||||
|
"com.unity.modules.uielements": "1.0.0",
|
||||||
|
"com.unity.modules.assetbundle": "1.0.0",
|
||||||
|
"com.unity.modules.unityanalytics": "1.0.0",
|
||||||
|
"com.unity.modules.unitywebrequest": "1.0.0",
|
||||||
|
"com.unity.scriptablebuildpipeline": "1.23.1",
|
||||||
|
"com.unity.test-framework.performance": "3.0.3"
|
||||||
|
},
|
||||||
|
"url": "https://packages.unity.com"
|
||||||
|
},
|
||||||
"com.unity.ext.nunit": {
|
"com.unity.ext.nunit": {
|
||||||
"version": "2.0.5",
|
"version": "2.0.5",
|
||||||
"depth": 4,
|
"depth": 2,
|
||||||
"source": "builtin",
|
"source": "builtin",
|
||||||
"dependencies": {}
|
"dependencies": {}
|
||||||
},
|
},
|
||||||
|
"com.unity.ide.visualstudio": {
|
||||||
|
"version": "2.0.27",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "registry",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.test-framework": "1.1.33"
|
||||||
|
},
|
||||||
|
"url": "https://packages.unity.com"
|
||||||
|
},
|
||||||
"com.unity.mathematics": {
|
"com.unity.mathematics": {
|
||||||
"version": "1.3.3",
|
"version": "1.3.3",
|
||||||
"depth": 2,
|
"depth": 1,
|
||||||
"source": "registry",
|
"source": "registry",
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"url": "https://packages.unity.com"
|
"url": "https://packages.unity.com"
|
||||||
|
|
@ -46,7 +77,14 @@
|
||||||
},
|
},
|
||||||
"com.unity.nuget.mono-cecil": {
|
"com.unity.nuget.mono-cecil": {
|
||||||
"version": "1.11.6",
|
"version": "1.11.6",
|
||||||
"depth": 3,
|
"depth": 1,
|
||||||
|
"source": "registry",
|
||||||
|
"dependencies": {},
|
||||||
|
"url": "https://packages.unity.com"
|
||||||
|
},
|
||||||
|
"com.unity.profiling.core": {
|
||||||
|
"version": "1.0.3",
|
||||||
|
"depth": 1,
|
||||||
"source": "registry",
|
"source": "registry",
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"url": "https://packages.unity.com"
|
"url": "https://packages.unity.com"
|
||||||
|
|
@ -65,6 +103,16 @@
|
||||||
"com.unity.modules.jsonserialize": "1.0.0"
|
"com.unity.modules.jsonserialize": "1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"com.unity.scriptablebuildpipeline": {
|
||||||
|
"version": "2.6.1",
|
||||||
|
"depth": 1,
|
||||||
|
"source": "registry",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.test-framework": "1.4.5",
|
||||||
|
"com.unity.modules.assetbundle": "1.0.0"
|
||||||
|
},
|
||||||
|
"url": "https://packages.unity.com"
|
||||||
|
},
|
||||||
"com.unity.searcher": {
|
"com.unity.searcher": {
|
||||||
"version": "4.9.4",
|
"version": "4.9.4",
|
||||||
"depth": 1,
|
"depth": 1,
|
||||||
|
|
@ -72,6 +120,16 @@
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"url": "https://packages.unity.com"
|
"url": "https://packages.unity.com"
|
||||||
},
|
},
|
||||||
|
"com.unity.serialization": {
|
||||||
|
"version": "3.1.3",
|
||||||
|
"depth": 1,
|
||||||
|
"source": "registry",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.burst": "1.7.2",
|
||||||
|
"com.unity.collections": "2.4.2"
|
||||||
|
},
|
||||||
|
"url": "https://packages.unity.com"
|
||||||
|
},
|
||||||
"com.unity.shadergraph": {
|
"com.unity.shadergraph": {
|
||||||
"version": "17.3.0",
|
"version": "17.3.0",
|
||||||
"depth": 0,
|
"depth": 0,
|
||||||
|
|
@ -83,7 +141,7 @@
|
||||||
},
|
},
|
||||||
"com.unity.test-framework": {
|
"com.unity.test-framework": {
|
||||||
"version": "1.6.0",
|
"version": "1.6.0",
|
||||||
"depth": 3,
|
"depth": 1,
|
||||||
"source": "builtin",
|
"source": "builtin",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.unity.ext.nunit": "2.0.3",
|
"com.unity.ext.nunit": "2.0.3",
|
||||||
|
|
@ -93,7 +151,7 @@
|
||||||
},
|
},
|
||||||
"com.unity.test-framework.performance": {
|
"com.unity.test-framework.performance": {
|
||||||
"version": "3.5.0",
|
"version": "3.5.0",
|
||||||
"depth": 3,
|
"depth": 1,
|
||||||
"source": "registry",
|
"source": "registry",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.unity.test-framework": "1.1.33",
|
"com.unity.test-framework": "1.1.33",
|
||||||
|
|
|
||||||
16
ProjectSettings/EntitiesClientSettings.asset
Normal file
16
ProjectSettings/EntitiesClientSettings.asset
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!114 &1
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 53
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 0}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: e2ea235c1fcfe29488ed97c467a0da53, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier: Unity.Entities.Build::Unity.Entities.Build.EntitiesClientSettings
|
||||||
|
FilterSettings:
|
||||||
|
ExcludedBakingSystemAssemblies: []
|
||||||
|
|
@ -3,7 +3,9 @@
|
||||||
--- !u!78 &1
|
--- !u!78 &1
|
||||||
TagManager:
|
TagManager:
|
||||||
serializedVersion: 3
|
serializedVersion: 3
|
||||||
tags: []
|
tags:
|
||||||
|
- Wall
|
||||||
|
- Pille
|
||||||
layers:
|
layers:
|
||||||
- Default
|
- Default
|
||||||
- TransparentFX
|
- TransparentFX
|
||||||
|
|
@ -15,7 +17,7 @@ TagManager:
|
||||||
-
|
-
|
||||||
-
|
-
|
||||||
-
|
-
|
||||||
-
|
- Pille
|
||||||
-
|
-
|
||||||
-
|
-
|
||||||
-
|
-
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue