diff --git a/Assets/Resources/Prefabs/Weapons/TestWeapon/TestWeapon.prefab b/Assets/Resources/Prefabs/Weapons/TestWeapon/TestWeapon.prefab index 6f3b33205c48aca88c19d4fc77a3c6921e91e66e..9de67d75d8113bd2ed1c02a96d95512cedfcf185 100644 --- a/Assets/Resources/Prefabs/Weapons/TestWeapon/TestWeapon.prefab +++ b/Assets/Resources/Prefabs/Weapons/TestWeapon/TestWeapon.prefab @@ -16,7 +16,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!4 &1050311400148833009 Transform: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/Level0.unity b/Assets/Scenes/Level0.unity new file mode 100644 index 0000000000000000000000000000000000000000..a5aa89ef194143934200c78341df79581c8680ee --- /dev/null +++ b/Assets/Scenes/Level0.unity @@ -0,0 +1,1068 @@ +%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_IndirectSpecularColor: {r: 0.46169513, g: 0.5124164, b: 0.58993304, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + 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: 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: 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!1001 &84371474 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1652156425} + m_Modifications: + - target: {fileID: 1050311400148833009, guid: 1a7698227caac3d429dceb8aa5056502, type: 3} + propertyPath: m_LocalPosition.x + value: 0.258 + objectReference: {fileID: 0} + - target: {fileID: 1050311400148833009, guid: 1a7698227caac3d429dceb8aa5056502, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1050311400148833009, guid: 1a7698227caac3d429dceb8aa5056502, type: 3} + propertyPath: m_LocalPosition.z + value: 0.375 + objectReference: {fileID: 0} + - target: {fileID: 1050311400148833009, guid: 1a7698227caac3d429dceb8aa5056502, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1050311400148833009, guid: 1a7698227caac3d429dceb8aa5056502, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1050311400148833009, guid: 1a7698227caac3d429dceb8aa5056502, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1050311400148833009, guid: 1a7698227caac3d429dceb8aa5056502, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1050311400148833009, guid: 1a7698227caac3d429dceb8aa5056502, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1050311400148833009, guid: 1a7698227caac3d429dceb8aa5056502, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1050311400148833009, guid: 1a7698227caac3d429dceb8aa5056502, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5240801910879785525, guid: 1a7698227caac3d429dceb8aa5056502, type: 3} + propertyPath: m_Name + value: TestWeapon + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 1a7698227caac3d429dceb8aa5056502, type: 3} +--- !u!1 &272310724 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 272310726} + - component: {fileID: 272310725} + m_Layer: 0 + m_Name: GameController + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &272310725 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 272310724} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 354f6ba1c1428a04da1f256d1da9f51e, type: 3} + m_Name: + m_EditorClassIdentifier: + player: {fileID: 1652156426} +--- !u!4 &272310726 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 272310724} + 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: + - {fileID: 1487068468} + - {fileID: 1847257073} + - {fileID: 531325656} + - {fileID: 387761188} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &374115585 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7065619579114910469, guid: c98b222ded23bb24690e674886e5741a, type: 3} + m_PrefabInstance: {fileID: 1139456223} + m_PrefabAsset: {fileID: 0} +--- !u!1 &387761187 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 387761188} + - component: {fileID: 387761189} + m_Layer: 0 + m_Name: ObjectManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &387761188 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 387761187} + 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: 272310726} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &387761189 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 387761187} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c051aae39aef0264ba144bc30cbe301e, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!4 &493225843 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 1838854055268103909, guid: 71b1260932d07054caf2d52890e46704, type: 3} + m_PrefabInstance: {fileID: 791030441} + m_PrefabAsset: {fileID: 0} +--- !u!1 &531325655 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 531325656} + - component: {fileID: 531325657} + m_Layer: 0 + m_Name: EnvironmentManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &531325656 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 531325655} + 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: + - {fileID: 374115585} + - {fileID: 666869943} + - {fileID: 1902219903} + m_Father: {fileID: 272310726} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &531325657 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 531325655} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c54dc993f0d1e36499ea37e182a87cbc, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!4 &554185221 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 6141342063799955615, guid: 7e312250336c0244193b4b75151d4fe3, type: 3} + m_PrefabInstance: {fileID: 1104825471} + m_PrefabAsset: {fileID: 0} +--- !u!1 &666869941 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 666869943} + - component: {fileID: 666869942} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &666869942 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 666869941} + m_Enabled: 1 + serializedVersion: 11 + m_Type: 1 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 0.5 + 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 &666869943 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 666869941} + serializedVersion: 2 + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: 0.31, y: 3.87, z: -0.52} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 531325656} + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1001 &791030441 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1652156425} + m_Modifications: + - target: {fileID: 125248941348886635, guid: 71b1260932d07054caf2d52890e46704, type: 3} + propertyPath: m_Name + value: Model + objectReference: {fileID: 0} + - target: {fileID: 1838854055268103909, guid: 71b1260932d07054caf2d52890e46704, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1838854055268103909, guid: 71b1260932d07054caf2d52890e46704, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1838854055268103909, guid: 71b1260932d07054caf2d52890e46704, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1838854055268103909, guid: 71b1260932d07054caf2d52890e46704, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1838854055268103909, guid: 71b1260932d07054caf2d52890e46704, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1838854055268103909, guid: 71b1260932d07054caf2d52890e46704, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1838854055268103909, guid: 71b1260932d07054caf2d52890e46704, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1838854055268103909, guid: 71b1260932d07054caf2d52890e46704, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1838854055268103909, guid: 71b1260932d07054caf2d52890e46704, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1838854055268103909, guid: 71b1260932d07054caf2d52890e46704, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7854868560450781420, guid: 71b1260932d07054caf2d52890e46704, type: 3} + propertyPath: m_Enabled + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 71b1260932d07054caf2d52890e46704, type: 3} +--- !u!1 &862419724 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 862419725} + - component: {fileID: 862419726} + m_Layer: 0 + m_Name: GameControls + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &862419725 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 862419724} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.75, 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 &862419726 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 862419724} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 277e6d37ad3220543a05009070b3a2b8, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1001 &1104825471 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1847257073} + m_Modifications: + - target: {fileID: 6141342063799955615, guid: 7e312250336c0244193b4b75151d4fe3, type: 3} + propertyPath: m_LocalPosition.x + value: -0.8136101 + objectReference: {fileID: 0} + - target: {fileID: 6141342063799955615, guid: 7e312250336c0244193b4b75151d4fe3, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6141342063799955615, guid: 7e312250336c0244193b4b75151d4fe3, type: 3} + propertyPath: m_LocalPosition.z + value: 2.4709601 + objectReference: {fileID: 0} + - target: {fileID: 6141342063799955615, guid: 7e312250336c0244193b4b75151d4fe3, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6141342063799955615, guid: 7e312250336c0244193b4b75151d4fe3, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 6141342063799955615, guid: 7e312250336c0244193b4b75151d4fe3, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 6141342063799955615, guid: 7e312250336c0244193b4b75151d4fe3, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 6141342063799955615, guid: 7e312250336c0244193b4b75151d4fe3, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6141342063799955615, guid: 7e312250336c0244193b4b75151d4fe3, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6141342063799955615, guid: 7e312250336c0244193b4b75151d4fe3, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8491347043216026353, guid: 7e312250336c0244193b4b75151d4fe3, type: 3} + propertyPath: m_Name + value: Dummy + objectReference: {fileID: 0} + - target: {fileID: 8734659159874979979, guid: 7e312250336c0244193b4b75151d4fe3, type: 3} + propertyPath: id + value: + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 7e312250336c0244193b4b75151d4fe3, type: 3} +--- !u!1001 &1139456223 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 531325656} + m_Modifications: + - target: {fileID: 6541102688641435260, guid: c98b222ded23bb24690e674886e5741a, type: 3} + propertyPath: m_Name + value: TestInteractable + objectReference: {fileID: 0} + - target: {fileID: 7065619579114910469, guid: c98b222ded23bb24690e674886e5741a, type: 3} + propertyPath: m_LocalPosition.x + value: 2.7590532 + objectReference: {fileID: 0} + - target: {fileID: 7065619579114910469, guid: c98b222ded23bb24690e674886e5741a, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7065619579114910469, guid: c98b222ded23bb24690e674886e5741a, type: 3} + propertyPath: m_LocalPosition.z + value: -1.027792 + objectReference: {fileID: 0} + - target: {fileID: 7065619579114910469, guid: c98b222ded23bb24690e674886e5741a, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7065619579114910469, guid: c98b222ded23bb24690e674886e5741a, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 7065619579114910469, guid: c98b222ded23bb24690e674886e5741a, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 7065619579114910469, guid: c98b222ded23bb24690e674886e5741a, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 7065619579114910469, guid: c98b222ded23bb24690e674886e5741a, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7065619579114910469, guid: c98b222ded23bb24690e674886e5741a, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7065619579114910469, guid: c98b222ded23bb24690e674886e5741a, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: c98b222ded23bb24690e674886e5741a, type: 3} +--- !u!1 &1487068465 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1487068468} + - component: {fileID: 1487068467} + - component: {fileID: 1487068466} + - component: {fileID: 1487068469} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &1487068466 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1487068465} + m_Enabled: 1 +--- !u!20 &1487068467 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1487068465} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + 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: 60 + orthographic: 0 + orthographic size: 5 + 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: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1487068468 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1487068465} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 2.55, z: -3.32} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 272310726} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1487068469 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1487068465} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7558c354360ba85428bc25c0e0a3d83b, type: 3} + m_Name: + m_EditorClassIdentifier: + target: {fileID: 1652156425} + followingTime: 0.1 + mouseSensitivity: 1 +--- !u!1 &1652156424 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1652156425} + - component: {fileID: 1652156427} + - component: {fileID: 1652156426} + m_Layer: 0 + m_Name: Player + m_TagString: Player + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1652156425 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1652156424} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 2.5, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 493225843} + - {fileID: 1829954853} + m_Father: {fileID: 1847257073} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1652156426 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1652156424} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bbd12f0cc12b22743998413b3f14b197, type: 3} + m_Name: + m_EditorClassIdentifier: + id: + knockbackResistance: 2 + baseSpeed: 10 + jumpForce: 5 + groundLayers: + serializedVersion: 2 + m_Bits: 0 + maxHealth: 10 + health: 10 + damagedDelay: 1 + weaponList: + - {fileID: 1829954854} + baseDamage: 0 + weaponLocation: {x: 0, y: 0, z: 0} + companionList: [] + activeCompanions: +--- !u!54 &1652156427 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1652156424} + serializedVersion: 4 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 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: 80 + m_CollisionDetection: 0 +--- !u!4 &1829954853 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 1050311400148833009, guid: 1a7698227caac3d429dceb8aa5056502, type: 3} + m_PrefabInstance: {fileID: 84371474} + m_PrefabAsset: {fileID: 0} +--- !u!114 &1829954854 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 5029868015402955001, guid: 1a7698227caac3d429dceb8aa5056502, type: 3} + m_PrefabInstance: {fileID: 84371474} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 68705b8ed948aae4d98ef6e87b6f6961, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &1847257072 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1847257073} + - component: {fileID: 1847257074} + m_Layer: 0 + m_Name: EntityManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1847257073 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1847257072} + 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: + - {fileID: 554185221} + - {fileID: 1652156425} + m_Father: {fileID: 272310726} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1847257074 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1847257072} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 04dfd389d2725984eac71a7ab91689a3, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &1902219902 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1902219903} + - component: {fileID: 1902219906} + - component: {fileID: 1902219905} + - component: {fileID: 1902219904} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1902219903 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1902219902} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -0.125, z: 0} + m_LocalScale: {x: 59, y: 0.25, z: 59} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 531325656} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &1902219904 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1902219902} + 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: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1902219905 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1902219902} + 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_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_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1902219906 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1902219902} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1919968788 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1919968790} + - component: {fileID: 1919968789} + m_Layer: 0 + m_Name: GameSaveData + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1919968789 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1919968788} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1e57b66e76eeafd4bb8ea101ee7598ae, type: 3} + m_Name: + m_EditorClassIdentifier: + difficulty: 1 +--- !u!4 &1919968790 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1919968788} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.75, 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!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 272310726} + - {fileID: 1919968790} + - {fileID: 862419725} diff --git a/Assets/Scenes/Level0.unity.meta b/Assets/Scenes/Level0.unity.meta new file mode 100644 index 0000000000000000000000000000000000000000..0b83c0f3247d634b7404f77abcc69eaddfbf467b --- /dev/null +++ b/Assets/Scenes/Level0.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: dfc6416ab7fca384089b4e171535c1ab +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Scripts/Core/Player/Player.cs b/Assets/_Scripts/Core/Player/Player.cs index 00b498d721794f486f41e76f3647ea5dbe55db87..290dcf8fdc572f8fea734b6bc8a3a4ad68800ed4 100644 --- a/Assets/_Scripts/Core/Player/Player.cs +++ b/Assets/_Scripts/Core/Player/Player.cs @@ -25,11 +25,11 @@ public class Player : PlayerEntity base.Start(); SetIdPrefix(ObjectIdPrefix); Health *= GameConfig.DIFFICULTY_MODIFIERS[GameSaveData.instance.difficulty].playerHealthMultiplier; + stats = new PlayerStats(this); stateController = new PlayerStateController(this); inputController = new PlayerInputController(this); movementController = new PlayerMovementController(this); animationController = new PlayerAnimationController(this); - stats = new PlayerStats(this); WeaponList.AddRange(GetComponentsInChildren<WeaponObject>()); diff --git a/Assets/_Scripts/Core/Player/PlayerAnimationController.cs b/Assets/_Scripts/Core/Player/PlayerAnimationController.cs index 7d32ee5b01b2e912afa1d675a7f7ef560d01a4b4..2014cc5fde03b4ffbd45862b44759ee959f02960 100644 --- a/Assets/_Scripts/Core/Player/PlayerAnimationController.cs +++ b/Assets/_Scripts/Core/Player/PlayerAnimationController.cs @@ -21,6 +21,10 @@ public class PlayerAnimationController : AnimationController // Functions public void AnimateStates() { + if(animator == null) + { + Debug.LogWarning($"Animated object of {player.name} does not have an animator in its model"); + } switch (player.stateController.state) { case PlayerState.IDLE: diff --git a/Assets/_Scripts/Core/Player/PlayerInputController.cs b/Assets/_Scripts/Core/Player/PlayerInputController.cs index 20f7d2a59ec65c72970ec504c25d039746c58fc0..484eae27aee3e960e8451b3cbee3e0fba9a36141 100644 --- a/Assets/_Scripts/Core/Player/PlayerInputController.cs +++ b/Assets/_Scripts/Core/Player/PlayerInputController.cs @@ -11,6 +11,7 @@ public class PlayerInputController public bool movementInputJump; // Events + public event Action<float, float> OnMovementEvent; public event Action OnJumpEvent; // Constructor @@ -26,6 +27,11 @@ public class PlayerInputController movementInputZ = Input.GetAxisRaw("Vertical"); movementInputScroll = Input.GetAxisRaw("Mouse ScrollWheel"); + if(movementInputX != 0 || movementInputZ != 0) + { + OnMovementEvent?.Invoke(movementInputX, movementInputZ); + } + if(Input.GetButtonDown("Jump") && player.Grounded) { OnJumpEvent?.Invoke(); diff --git a/Assets/_Scripts/Core/Player/PlayerMovementController.cs b/Assets/_Scripts/Core/Player/PlayerMovementController.cs index 26543bf28b5b678436d5364469b1bb55fbd6a639..e1bc5b58c51a876766a3ecdd813283e127a9fca2 100644 --- a/Assets/_Scripts/Core/Player/PlayerMovementController.cs +++ b/Assets/_Scripts/Core/Player/PlayerMovementController.cs @@ -34,6 +34,7 @@ public class PlayerMovementController { float inputX = player.inputController.movementInputX; float inputZ = player.inputController.movementInputZ; + Debug.Log(inputX); SnapshotCameraOrientation(); diff --git a/Assets/_Scripts/Library/BaseClasses/Controller/AnimationController.cs b/Assets/_Scripts/Library/BaseClasses/Controller/AnimationController.cs index 428dc3f94e041350753f66eac3d61e769b7e71b9..3d45b8217fae01e4714b9b19fbfd0a1f0b26cf3e 100644 --- a/Assets/_Scripts/Library/BaseClasses/Controller/AnimationController.cs +++ b/Assets/_Scripts/Library/BaseClasses/Controller/AnimationController.cs @@ -11,21 +11,23 @@ public abstract class AnimationController public AnimationController(MonoBehaviour animable) { model = animable.transform.Find(EnvironmentConfig.OBJECT_MODEL); - animator = model.GetComponent<Animator>(); - meshRenderer = model.GetComponent<MeshRenderer>(); - + if(model == null) { - Debug.LogWarning($"Animated object of {animable.name} does not have a model"); - } - if(animator == null) - { - Debug.LogWarning($"Animated object of {animable.name} does not have an animator in its model"); + Debug.LogWarning($"Animated object of {animable.name} does not have a model, Please create a gameObject named 'Model' as its child"); } - if(meshRenderer == null) + else { - Debug.LogWarning($"Animated object of {animable.name} does not have an meshRenderer in its model"); + animator = model.GetComponent<Animator>(); + meshRenderer = model.GetComponent<MeshRenderer>(); + if(animator == null) + { + Debug.LogWarning($"Animated object of {animable.name} does not have an animator in its model"); + } + if(meshRenderer == null) + { + Debug.LogWarning($"Animated object of {animable.name} does not have an meshRenderer in its model"); + } } - } } \ No newline at end of file diff --git a/Assets/_Scripts/Library/BaseClasses/EntityObject/CombatantEntity.cs b/Assets/_Scripts/Library/BaseClasses/EntityObject/CombatantEntity.cs index 4c74297a8ca75a6f2e99f0e86dd2c395590a67e7..022e6a7e2ff5e5ac7b2685398e39aaea9f051f82 100644 --- a/Assets/_Scripts/Library/BaseClasses/EntityObject/CombatantEntity.cs +++ b/Assets/_Scripts/Library/BaseClasses/EntityObject/CombatantEntity.cs @@ -40,8 +40,6 @@ public class CombatantEntity : DamageableEntity, IArmed // Functions - // TODO: Review, consider using prefabs instead? - // Prefabs are easier to implement but much less extendable public void EquipWeapon(int index) { if(weaponList.Count == 0) @@ -52,32 +50,37 @@ public class CombatantEntity : DamageableEntity, IArmed UnequipWeapon(); - Debug.Log($"Equipping weapon {index}"); WeaponIndex = index; WeaponObject selectedWeapon = WeaponList[WeaponIndex]; - // To handle editor prefab dragndrops - Debug.Log($"Length: {WeaponList.Count}"); + // To handle editor prefab drag n drops if(!selectedWeapon.gameObject.scene.IsValid()) { selectedWeapon = ObjectFactory.CreateObject<WeaponObject>( - prefabPath: selectedWeapon == null? NoWeapon.weaponPrefab : selectedWeapon.data.prefabPath, + prefabPath: selectedWeapon.data.prefabPath, parent: transform, objectName: EnvironmentConfig.OBJECT_WEAPON ); WeaponList[WeaponIndex] = selectedWeapon; } selectedWeapon.gameObject.SetActive(true); + selectedWeapon.transform.localPosition = WeaponLocation; + selectedWeapon.gameObject.layer = LayerMask.NameToLayer(AttackLayerCode); weapon = selectedWeapon; - // weaponObject.transform.localPosition = WeaponLocation; - // weaponObject.gameObject.layer = LayerMask.NameToLayer(AttackLayerCode); - // weapon = weaponObject; } public void UnequipWeapon(){ foreach (WeaponObject weapon in WeaponList) { - weapon.gameObject.SetActive(false); + // We'll also clean null weapons here, add no weapons explicitly + if(weapon == null) + { + WeaponList.Remove(weapon); + } + else + { + weapon.gameObject.SetActive(false); + } } } }