Added Tree Sprite

This commit is contained in:
janis
2022-02-16 20:36:55 +01:00
parent 4572559fc7
commit e719f34253
12 changed files with 635 additions and 27 deletions

Binary file not shown.

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 69863e12964da9a4aa8514db0cdd0349
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Assets/Prefabs.meta Normal file
View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 831cf7fc9533c2b429e0c8e69e10e25b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,121 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1909482199139559741
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1909482199139559713}
- component: {fileID: 1909482199139559714}
- component: {fileID: 1909482199139559715}
- component: {fileID: 1909482199139559712}
m_Layer: 0
m_Name: tree_oak
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1909482199139559713
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1909482199139559741}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -5.92, y: 0.79, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &1909482199139559714
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1909482199139559741}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2}
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: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 518a023177499734197c97667a117512, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 5.4375, y: 6.6875}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 1
--- !u!114 &1909482199139559715
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1909482199139559741}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c68a9987090906346b5bc7622cb96556, type: 3}
m_Name:
m_EditorClassIdentifier:
interactionType: 2
holdDuration: 1
radius: 3
centerPoint: {fileID: 1909482199139559713}
harvestDuration: 3
--- !u!70 &1909482199139559712
CapsuleCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1909482199139559741}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0.20796245, y: 0.23104483}
m_Size: {x: 1.9242423, y: 0.67659634}
m_Direction: 1

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: a51034cd9a84299479d24128aec330e6
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -168,7 +168,7 @@ Transform:
- {fileID: 1759039339}
- {fileID: 1938035018}
m_Father: {fileID: 0}
m_RootOrder: 2
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &87507992
GameObject:
@@ -341,7 +341,7 @@ Transform:
- {fileID: 1523942492}
- {fileID: 466200731}
m_Father: {fileID: 0}
m_RootOrder: 7
m_RootOrder: 12
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &138750305
GameObject:
@@ -542,7 +542,7 @@ Transform:
m_Children:
- {fileID: 519420032}
m_Father: {fileID: 0}
m_RootOrder: 1
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!95 &310196955
Animator:
@@ -765,6 +765,7 @@ MonoBehaviour:
interactionType: 1
holdDuration: 1
radius: 3
centerPoint: {fileID: 466200731}
color: {r: 1, g: 1, b: 1, a: 0}
globalLight: {fileID: 360525551}
--- !u!212 &466200733
@@ -963,6 +964,63 @@ MonoBehaviour:
m_RequiresDepthTexture: 0
m_RequiresColorTexture: 0
m_Version: 2
--- !u!1001 &653148688
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_RootOrder
value: 4
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalPosition.x
value: -13.410806
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalPosition.y
value: 4.33799
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559741, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_Name
value: tree_oak (1)
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: a51034cd9a84299479d24128aec330e6, type: 3}
--- !u!1 &725785167
GameObject:
m_ObjectHideFlags: 0
@@ -1057,7 +1115,7 @@ RectTransform:
m_Children:
- {fileID: 87507993}
m_Father: {fileID: 0}
m_RootOrder: 5
m_RootOrder: 10
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
@@ -1113,6 +1171,7 @@ MonoBehaviour:
interactionType: 1
holdDuration: 1
radius: 3
centerPoint: {fileID: 760798427}
color: {r: 0.9811321, g: 0.4931305, b: 0, a: 0}
globalLight: {fileID: 360525551}
--- !u!212 &760798429
@@ -1242,6 +1301,7 @@ MonoBehaviour:
interactionType: 1
holdDuration: 1
radius: 3
centerPoint: {fileID: 811951905}
color: {r: 0.09919691, g: 1, b: 0, a: 0}
globalLight: {fileID: 360525551}
--- !u!212 &811951907
@@ -4244,7 +4304,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1335747190
MonoBehaviour:
@@ -4261,6 +4321,7 @@ MonoBehaviour:
interactionType: 2
holdDuration: 1
radius: 3
centerPoint: {fileID: 0}
harvestDuration: 3
--- !u!1 &1523942491
GameObject:
@@ -4311,6 +4372,7 @@ MonoBehaviour:
interactionType: 1
holdDuration: 1
radius: 3
centerPoint: {fileID: 1523942492}
color: {r: 0, g: 0.20715475, b: 1, a: 0}
globalLight: {fileID: 360525551}
--- !u!212 &1523942494
@@ -4440,6 +4502,7 @@ MonoBehaviour:
interactionType: 1
holdDuration: 1
radius: 3
centerPoint: {fileID: 1540973175}
color: {r: 1, g: 0, b: 0, a: 0}
globalLight: {fileID: 360525551}
--- !u!212 &1540973177
@@ -4520,6 +4583,63 @@ BoxCollider2D:
serializedVersion: 2
m_Size: {x: 1, y: 1}
m_EdgeRadius: 0
--- !u!1001 &1561532225
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalPosition.x
value: 1.4564366
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalPosition.y
value: 9.728643
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559741, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_Name
value: tree_oak (3)
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: a51034cd9a84299479d24128aec330e6, type: 3}
--- !u!1 &1759039338
GameObject:
m_ObjectHideFlags: 0
@@ -14697,7 +14817,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 6
m_RootOrder: 11
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1938035017
GameObject:
@@ -27577,6 +27697,63 @@ Tilemap:
e31: 0
e32: 0
e33: 1
--- !u!1001 &1973802414
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_RootOrder
value: 3
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalPosition.x
value: -6.0973587
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalPosition.y
value: 10.484023
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559741, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_Name
value: tree_oak (2)
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: a51034cd9a84299479d24128aec330e6, type: 3}
--- !u!1 &2014753552
GameObject:
m_ObjectHideFlags: 1
@@ -27659,8 +27836,65 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &2032016596
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalPosition.x
value: -15.89
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalPosition.y
value: 4.81
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559741, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_Name
value: tree_oak (4)
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: a51034cd9a84299479d24128aec330e6, type: 3}
--- !u!1 &2063803992
GameObject:
m_ObjectHideFlags: 0
@@ -27710,6 +27944,7 @@ MonoBehaviour:
interactionType: 1
holdDuration: 1
radius: 3
centerPoint: {fileID: 2063803993}
color: {r: 1, g: 0, b: 0.6604276, a: 0}
globalLight: {fileID: 360525551}
--- !u!212 &2063803995
@@ -27790,3 +28025,60 @@ BoxCollider2D:
serializedVersion: 2
m_Size: {x: 1, y: 1}
m_EdgeRadius: 0
--- !u!1001 &1909482199119969203
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_RootOrder
value: 8
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalPosition.x
value: -10.26
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalPosition.y
value: 4.41
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559713, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1909482199139559741, guid: a51034cd9a84299479d24128aec330e6, type: 3}
propertyPath: m_Name
value: tree_oak
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: a51034cd9a84299479d24128aec330e6, type: 3}

View File

@@ -31,13 +31,22 @@ public abstract class Interactable : MonoBehaviour
// Used to measure the distance between the player and the object
Transform playerTransform;
Transform interactableTransform;
[Tooltip("The range in which the player can interact with an object")]
[Range(1f, 50f)]
[SerializeField]
float radius = 3f;
[SerializeField]
Transform centerPoint;
void Awake()
{
if(centerPoint == null)
{
centerPoint = gameObject.transform;
}
}
#region GETTER
/// <summary>
/// <c>GetDescription</c> gets the description of an interactable object.
@@ -110,8 +119,8 @@ public abstract class Interactable : MonoBehaviour
public bool isInRange()
{
playerTransform = GameObject.FindGameObjectWithTag("Player").gameObject.transform; // Maybe singleton later?
interactableTransform = gameObject.transform;
float distance = Vector2.Distance(interactableTransform.position, playerTransform.position);
float distance = Vector2.Distance(centerPoint.position, playerTransform.position);
if(distance <= radius)
{
@@ -125,11 +134,18 @@ public abstract class Interactable : MonoBehaviour
}
// Show interactable range in editor but NOT IN-GAME
private void OnDrawGizmosSelected()
{
// Same as in "Awake()", cause the object does not get "awakend" in inspector
if (centerPoint == null)
{
centerPoint = gameObject.transform;
}
// Gizmos are only visible in the scene view -> NOT visible IN-GAME (DEBUG Reasons)
Gizmos.color = Color.magenta;
Gizmos.DrawWireSphere(transform.position, radius);
Gizmos.DrawWireSphere(centerPoint.position, radius);
}
}

BIN
Assets/Sprites/tree_oak.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -0,0 +1,134 @@
fileFormatVersion: 2
guid: 518a023177499734197c97667a117512
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 0
spriteMeshType: 1
alignment: 7
spritePivot: {x: 0.2, y: -0.2}
spritePixelsToUnits: 16
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 512
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Windows Store Apps
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,17 @@
{
"MonoBehaviour": {
"Version": 4,
"EnableBurstCompilation": true,
"EnableOptimisations": true,
"EnableSafetyChecks": false,
"EnableDebugInAllBuilds": false,
"UsePlatformSDKLinker": false,
"CpuMinTargetX32": 0,
"CpuMaxTargetX32": 0,
"CpuMinTargetX64": 0,
"CpuMaxTargetX64": 0,
"CpuTargetsX32": 6,
"CpuTargetsX64": 72,
"OptimizeFor": 0
}
}

View File

@@ -0,0 +1,6 @@
{
"MonoBehaviour": {
"Version": 4,
"DisabledWarnings": ""
}
}

View File

@@ -19,7 +19,7 @@ MonoBehaviour:
width: 1920
height: 989
m_ShowMode: 4
m_Title: Hierarchy
m_Title: Game
m_RootView: {fileID: 4}
m_MinSize: {x: 875, y: 350}
m_MaxSize: {x: 10000, y: 10000}
@@ -43,8 +43,8 @@ MonoBehaviour:
y: 0
width: 446
height: 939
m_MinSize: {x: 276, y: 71}
m_MaxSize: {x: 4001, y: 4021}
m_MinSize: {x: 275, y: 50}
m_MaxSize: {x: 4000, y: 4000}
m_ActualView: {fileID: 17}
m_Panes:
- {fileID: 17}
@@ -74,7 +74,7 @@ MonoBehaviour:
m_MinSize: {x: 300, y: 200}
m_MaxSize: {x: 24288, y: 16192}
vertical: 0
controlID: 101
controlID: 17
--- !u!114 &4
MonoBehaviour:
m_ObjectHideFlags: 52
@@ -170,7 +170,7 @@ MonoBehaviour:
m_MinSize: {x: 200, y: 200}
m_MaxSize: {x: 16192, y: 16192}
vertical: 1
controlID: 65
controlID: 68
--- !u!114 &8
MonoBehaviour:
m_ObjectHideFlags: 52
@@ -195,7 +195,7 @@ MonoBehaviour:
m_MinSize: {x: 200, y: 100}
m_MaxSize: {x: 16192, y: 8096}
vertical: 0
controlID: 66
controlID: 69
--- !u!114 &9
MonoBehaviour:
m_ObjectHideFlags: 52
@@ -215,8 +215,8 @@ MonoBehaviour:
y: 0
width: 304
height: 615
m_MinSize: {x: 201, y: 221}
m_MaxSize: {x: 4001, y: 4021}
m_MinSize: {x: 200, y: 200}
m_MaxSize: {x: 4000, y: 4000}
m_ActualView: {fileID: 13}
m_Panes:
- {fileID: 13}
@@ -241,8 +241,8 @@ MonoBehaviour:
y: 0
width: 1170
height: 615
m_MinSize: {x: 102, y: 121}
m_MaxSize: {x: 4002, y: 4021}
m_MinSize: {x: 100, y: 100}
m_MaxSize: {x: 4000, y: 4000}
m_ActualView: {fileID: 12}
m_Panes:
- {fileID: 14}
@@ -401,7 +401,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: 76b0feff8487ffff62f9ffff28fbffff026d0000086d0000
m_ExpandedIDs: 26fbffff
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@@ -806,9 +806,9 @@ MonoBehaviour:
m_IsLocked: 0
m_FolderTreeState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: c46a0000
m_LastClickedID: 27332
m_ExpandedIDs: 00000000c46a0000ce6a0000d46a00001290000000ca9a3bffffff7f
m_SelectedIDs: 426f0000
m_LastClickedID: 28482
m_ExpandedIDs: 00000000426f000000ca9a3bffffff7f
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@@ -836,7 +836,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: 00000000c46a0000
m_ExpandedIDs: 00000000426f0000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@@ -863,7 +863,7 @@ MonoBehaviour:
m_ListAreaState:
m_SelectedInstanceIDs:
m_LastClickedInstanceID: 0
m_HadKeyboardFocusLastEvent: 1
m_HadKeyboardFocusLastEvent: 0
m_ExpandedInstanceIDs: c62300006a8e0000f25e000088610000
m_RenameOverlay:
m_UserAcceptedRename: 0