Added player task system. simple interaction with objects. Known issue - no player stats canvas

This commit is contained in:
Vladimir Koshevarov
2023-02-21 18:58:06 +02:00
parent 7c26b80584
commit 59d2f7cc30
46 changed files with 2289 additions and 3121 deletions
@@ -50,8 +50,8 @@ Material:
m_Scale: {x: 2, y: 2}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Texture: {fileID: 2800000, guid: 3896f4ca02b49124dbe88348af6cd90b, type: 3}
m_Scale: {x: 2, y: 2}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 2800000, guid: 0766eab8c00d3f84e9f0506fc5992244, type: 3}
@@ -117,7 +117,7 @@ Material:
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0.2924528, g: 0.12524095, b: 0.0731132, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 0.29245278, g: 0.12524092, b: 0.073113196, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
m_BuildTextureStacks: []
@@ -50,8 +50,8 @@ Material:
m_Scale: {x: 4, y: 4}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Texture: {fileID: 2800000, guid: f777047004de95f4ba34895907052505, type: 3}
m_Scale: {x: 4, y: 4}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
@@ -117,7 +117,7 @@ Material:
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 0.8980392, b: 0.38039216, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 0.8980392, b: 0.3803921, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
m_BuildTextureStacks: []
@@ -52,8 +52,8 @@ Material:
m_Scale: {x: 4, y: 4}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Texture: {fileID: 2800000, guid: e9783abdcac23084985c08e4d4dade3b, type: 3}
m_Scale: {x: 4, y: 4}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
@@ -119,7 +119,7 @@ Material:
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0.14412825, g: 0.06915272, b: 0.6981132, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 0.1441282, g: 0.0691527, b: 0.6981132, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
m_BuildTextureStacks: []
@@ -52,8 +52,8 @@ Material:
m_Scale: {x: 4, y: 4}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Texture: {fileID: 2800000, guid: e9783abdcac23084985c08e4d4dade3b, type: 3}
m_Scale: {x: 4, y: 4}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
@@ -51,8 +51,8 @@ Material:
m_Scale: {x: 2, y: 2}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Texture: {fileID: 2800000, guid: e2c05aebeef07c543930c67d2767bfdc, type: 3}
m_Scale: {x: 2, y: 2}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
@@ -118,7 +118,7 @@ Material:
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0.2830189, g: 0.16176584, b: 0.14551443, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 0.28301886, g: 0.16176581, b: 0.1455144, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
m_BuildTextureStacks: []
@@ -52,7 +52,7 @@ Material:
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Scale: {x: 6, y: 6}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
@@ -118,7 +118,7 @@ Material:
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0.990566, g: 0.990566, b: 0.990566, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 0.99056596, g: 0.99056596, b: 0.99056596, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
m_BuildTextureStacks: []
@@ -50,7 +50,7 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 04bdf3eac1ea0c04ebb541a4883a827f, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
@@ -117,7 +117,7 @@ Material:
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0.7735849, g: 0.7735849, b: 0.7735849, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 0.7735849, g: 0.7735849, b: 0.7735849, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []
+391
View File
@@ -0,0 +1,391 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &168138392062545361
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 168138392062545360}
- component: {fileID: 168138392062545363}
m_Layer: 0
m_Name: Selected
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &168138392062545360
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 168138392062545361}
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: 199909838302166302}
m_Father: {fileID: 168138393772344589}
m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &168138392062545363
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 168138392062545361}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c67621cbedb3453428fcc7207806f507, type: 3}
m_Name:
m_EditorClassIdentifier:
_selectedObject: {fileID: 5351194727339921736}
visualGameObjectArray:
- {fileID: 199909838302166291}
- {fileID: 199909837917391647}
- {fileID: 199909837306106162}
- {fileID: 199909837468661505}
--- !u!1 &168138393772344594
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 168138393772344589}
- component: {fileID: 168138393772344588}
- component: {fileID: 5351194727339921736}
m_Layer: 6
m_Name: Bed
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &168138393772344589
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 168138393772344594}
m_LocalRotation: {x: 0, y: 0.7071068, z: 0, w: 0.7071068}
m_LocalPosition: {x: -0, y: 0, z: 8.643}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 5360312089705388636}
- {fileID: 6083021128705139609}
- {fileID: 168138392062545360}
m_Father: {fileID: 0}
m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0}
--- !u!65 &168138393772344588
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 168138393772344594}
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: 0.94, y: 1.96, z: 1.09}
m_Center: {x: 0.09, y: 1.02, z: 0}
--- !u!114 &5351194727339921736
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 168138393772344594}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ec924e9d7d23a4e46b256dedc9caa75c, type: 3}
m_Name:
m_EditorClassIdentifier:
_playerArrivePoint: {fileID: 5360312089705388636}
--- !u!1 &4960435320984939974
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5360312089705388636}
m_Layer: 0
m_Name: PlayerStartInteractPoint
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5360312089705388636
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4960435320984939974}
m_LocalRotation: {x: -0, y: -0.7071068, z: -0, w: 0.7071068}
m_LocalPosition: {x: 0.2, y: 0, z: 0.85}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 168138393772344589}
m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &3165226905153932186
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 168138393772344589}
m_Modifications:
- target: {fileID: 9189065510491252739, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
propertyPath: m_RootOrder
value: -1
objectReference: {fileID: 0}
- target: {fileID: 9189065510491252739, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
propertyPath: m_LocalScale.x
value: 0.7
objectReference: {fileID: 0}
- target: {fileID: 9189065510491252739, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
propertyPath: m_LocalScale.y
value: 0.7
objectReference: {fileID: 0}
- target: {fileID: 9189065510491252739, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
propertyPath: m_LocalScale.z
value: 0.7
objectReference: {fileID: 0}
- target: {fileID: 9189065510491252739, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9189065510491252739, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9189065510491252739, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9189065510491252739, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 9189065510491252739, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 9189065510491252739, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 9189065510491252739, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 9189065510491252739, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9189065510491252739, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9189065510491252739, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9189065510491252739, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
propertyPath: m_ConstrainProportionsScale
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9189065510491252750, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
propertyPath: m_Name
value: Bed_Visual
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 8af73887c9cd7fa47a2f642969b20378, type: 3}
--- !u!4 &6083021128705139609 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 9189065510491252739, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
m_PrefabInstance: {fileID: 3165226905153932186}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &9025256075473245469
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 168138392062545360}
m_Modifications:
- target: {fileID: 9189065509065776645, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 710613883f6dfb64889bf6134b4b15e3, type: 2}
- target: {fileID: 9189065509477827618, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 710613883f6dfb64889bf6134b4b15e3, type: 2}
- target: {fileID: 9189065510491252737, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 710613883f6dfb64889bf6134b4b15e3, type: 2}
- target: {fileID: 9189065510491252739, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
propertyPath: m_RootOrder
value: -1
objectReference: {fileID: 0}
- target: {fileID: 9189065510491252739, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
propertyPath: m_LocalScale.x
value: 0.75
objectReference: {fileID: 0}
- target: {fileID: 9189065510491252739, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
propertyPath: m_LocalScale.y
value: 0.71
objectReference: {fileID: 0}
- target: {fileID: 9189065510491252739, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
propertyPath: m_LocalScale.z
value: 0.71
objectReference: {fileID: 0}
- target: {fileID: 9189065510491252739, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
propertyPath: m_LocalPosition.x
value: 0.079
objectReference: {fileID: 0}
- target: {fileID: 9189065510491252739, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9189065510491252739, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9189065510491252739, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 9189065510491252739, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 9189065510491252739, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 9189065510491252739, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 9189065510491252739, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9189065510491252739, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9189065510491252739, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9189065510491252750, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
propertyPath: m_Name
value: Bed_Visual
objectReference: {fileID: 0}
- target: {fileID: 9189065510491252750, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 8af73887c9cd7fa47a2f642969b20378, type: 3}
--- !u!1 &199909837306106162 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 9189065509477827631, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
m_PrefabInstance: {fileID: 9025256075473245469}
m_PrefabAsset: {fileID: 0}
--- !u!1 &199909837468661505 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 9189065509120254492, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
m_PrefabInstance: {fileID: 9025256075473245469}
m_PrefabAsset: {fileID: 0}
--- !u!1 &199909837917391647 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 9189065509065776642, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
m_PrefabInstance: {fileID: 9025256075473245469}
m_PrefabAsset: {fileID: 0}
--- !u!1 &199909838302166291 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 9189065510491252750, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
m_PrefabInstance: {fileID: 9025256075473245469}
m_PrefabAsset: {fileID: 0}
--- !u!4 &199909838302166302 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 9189065510491252739, guid: 8af73887c9cd7fa47a2f642969b20378,
type: 3}
m_PrefabInstance: {fileID: 9025256075473245469}
m_PrefabAsset: {fileID: 0}
+7
View File
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 910e671451e1bf94e9bba00c3809c94a
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
File diff suppressed because it is too large Load Diff
+7
View File
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 7da3da938889a5a44808355c805dcccb
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+223 -1848
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -10,7 +10,7 @@ namespace Assets.Scripts.Actions
DurationInTicks = durationTicks;
}
public abstract void ApplyAction(PlayerManager playerController);
public abstract void ApplyAction(Player playerController);
}
}
+2 -2
View File
@@ -19,9 +19,9 @@ namespace Assets.Scripts.Actions
}
public void ApplyAction(PlayerManager playerController)
public void ApplyAction(Player playerController)
{
playerController.PlayerStats[GameManager.StatsId.Food].increase(_energy);
playerController.PlayerStats[StatsId.Food].increase(_energy);
}
}
}
@@ -4,7 +4,7 @@
public interface IPlayerAction
{
public string Description { get; }
public void ApplyAction(PlayerManager player);
public void ApplyAction(Player player);
}
public interface ISellable
+1 -1
View File
@@ -16,7 +16,7 @@ namespace Assets.Scripts.Actions
_position = position;
Sallary = sallary;
}
public void ApplyAction(PlayerManager playerController)
public void ApplyAction(Player playerController)
{
playerController.WorkPlace = this;
}
+2 -2
View File
@@ -12,9 +12,9 @@ namespace Assets.Scripts.Actions
public string Description => throw new System.NotImplementedException();
public void ApplyAction(PlayerManager playerController)
public void ApplyAction(Player playerController)
{
playerController.PlayerStats[GameManager.StatsId.Energy].increase(_energyPerTick);
playerController.PlayerStats[StatsId.Energy].increase(_energyPerTick);
}
}
}
+3 -6
View File
@@ -2,9 +2,6 @@ using UnityEngine;
public class CameraPlayerFollow : MonoBehaviour
{
[SerializeField]
private Transform _player;
private Vector3 _cameraOffset;
private Transform _obstruction;
@@ -16,13 +13,13 @@ public class CameraPlayerFollow : MonoBehaviour
void Start()
{
_obstruction = null;
_cameraOffset = transform.position - _player.position;
_cameraOffset = transform.position - Player.Instance.transform.position;
// .LookAt(_player);
}
void LateUpdate()
{
Vector3 newPosition = _player.position + _cameraOffset;
Vector3 newPosition = Player.Instance.transform.position + _cameraOffset;
transform.position = Vector3.Slerp(transform.position, newPosition, _smoothFactor);
ViewObstructed();
@@ -31,7 +28,7 @@ public class CameraPlayerFollow : MonoBehaviour
private void ViewObstructed()
{
RaycastHit hit;
if (Physics.Raycast(transform.position, _player.position - transform.position, out hit, 3.5f))
if (Physics.Raycast(transform.position, Player.Instance.transform.position - transform.position, out hit, 3.5f))
{
if (hit.collider.gameObject.tag != "Player")
{
@@ -11,7 +11,6 @@ public class ConversationController : MonoBehaviour
[SerializeField] public Button _choiceButton;
[SerializeField] private Button _btnApply;
[SerializeField] private Button _btnClose;
[SerializeField] PlayerManager _playerManager;
public ConversationChangeEvent conversationChangeEvent;
private List<ChoiceController> choiceControllers = new();
@@ -37,7 +36,7 @@ public class ConversationController : MonoBehaviour
ApplyActionOnPlayer(_selectedAction);
});
_playerManager.allowMovement = false;
Player.Instance.allowMovement = false;
RemoveChoices();
_title.text = title;
gameObject.SetActive(true);
@@ -60,14 +59,14 @@ public class ConversationController : MonoBehaviour
_selectedAction = action;
if (action is ISellable)
{
_btnApply.interactable = _playerManager.PlayerStats[GameManager.StatsId.Money].Value >= (action as ISellable).Price;
_btnApply.interactable = Player.Instance.PlayerStats[StatsId.Money].Value >= (action as ISellable).Price;
}
}
private void ApplyActionOnPlayer(IPlayerAction action)
{
if (action is ISellable)
_playerManager.BuyAction(action);
Player.Instance.BuyAction(action);
}
private void RemoveChoices()
{
@@ -84,6 +83,6 @@ public class ConversationController : MonoBehaviour
RemoveChoices();
gameObject.SetActive(false);
Time.timeScale = 1;
_playerManager.allowMovement = true;
Player.Instance.allowMovement = true;
}
}
+2 -2
View File
@@ -3,10 +3,10 @@ using UnityEngine;
public class OnSelectedObjectChangedEventArgs : EventArgs
{
public Transform SelectedObject;
public BaseInteractableObject SelectedObject;
}
public class OnMovementTargetSelectedEventArgs:EventArgs
public class OnPlayerMovesEventArgs : EventArgs
{
public Vector3 PointToMove;
}
+1 -3
View File
@@ -1,13 +1,11 @@
using System.Collections.Generic;
using UnityEngine;
public enum StatsId { Money, RentAccount, Food, Energy, BankAccount, Job, }
public class GameManager : MonoBehaviour
{
public enum StatsId { Money, RentAccount, Food, Energy, BankAccount, Job, }
public static GameManager Instance { get; private set; }
public PlayerManager Player;
public Dictionary<StatsId, Stat> PlayerStats;
// Start is called before the first frame update
void Awake()
+3 -7
View File
@@ -1,13 +1,9 @@
using TMPro;
using UnityEngine;
using UnityEngine.UI;
using static GameManager;
public class GameUIManager : MonoBehaviour
{
[SerializeField]
private PlayerManager _playerController;
[SerializeField]
private TextMeshProUGUI _timeText;
@@ -34,7 +30,7 @@ public class GameUIManager : MonoBehaviour
// Update is called once per frame
void Update()
{
_moneyText.text = $"${_playerController.PlayerStats[StatsId.Money].Value}";
_moneyText.text = $"${Player.Instance.PlayerStats[StatsId.Money].Value}";
}
@@ -46,7 +42,7 @@ public class GameUIManager : MonoBehaviour
_timeText.text = TimeManager.CurrentTime.ToString(@"hh\:mm");
}
_energy.value = (float)_playerController.PlayerStats[StatsId.Energy].Value;
_food.value = (float)_playerController.PlayerStats[StatsId.Food].Value;
_energy.value = (float)Player.Instance.PlayerStats[StatsId.Energy].Value;
_food.value = (float)Player.Instance.PlayerStats[StatsId.Food].Value;
}
}
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: ba062aa6c92b140379dbc06b43dd3b9b
guid: 31c259be454ab6b4cb65a567ef4c2d0f
folderAsset: yes
DefaultImporter:
externalObjects: {}
@@ -0,0 +1,11 @@
using UnityEngine;
public class BaseInteractableObject : MonoBehaviour
{
[SerializeField]
public Transform _playerArrivePoint;
public virtual void Interact()
{
Debug.Log("Interact with some object");
}
}
@@ -1,8 +1,7 @@
fileFormatVersion: 2
guid: 476cc7d7cd9874016adc216baab94a0a
timeCreated: 1484146680
licenseType: Store
guid: 2af31bf77e63ee64da69d7c708550949
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
+10
View File
@@ -0,0 +1,10 @@
using UnityEngine;
public class Bed : BaseInteractableObject
{
public override void Interact()
{
Debug.Log("Interact with bed");
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ec924e9d7d23a4e46b256dedc9caa75c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,10 @@
using UnityEngine;
public class Fridge : BaseInteractableObject
{
public override void Interact()
{
Debug.Log("Interact with Fridge");
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6768a45c9ae20c246bf1052cfa08ddec
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+22 -12
View File
@@ -11,10 +11,8 @@ public class MouseInputManager : MonoBehaviour
[SerializeField]
private Camera _camera;
private RaycastHit _raycastHit;
public event EventHandler<OnSelectedObjectChangedEventArgs> OnSelectedObjectChanged;
public event EventHandler<OnMovementTargetSelectedEventArgs> OnMovementTargetSelected;
public static MouseInputManager Instance { get; private set; }
@@ -22,7 +20,7 @@ public class MouseInputManager : MonoBehaviour
{
if (Instance != null)
{
Debug.Log("There's more than one player instance");
Debug.Log("There's more than one mouse Input instance");
}
Instance = this;
}
@@ -30,20 +28,32 @@ public class MouseInputManager : MonoBehaviour
void Update()
{
var ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if (!EventSystem.current.IsPointerOverGameObject() && Physics.Raycast(ray, out _raycastHit, 100f, _selectableLayerMask))
if (!EventSystem.current.IsPointerOverGameObject() && Physics.Raycast(ray, out var mouseRaycastHit, 100f, _selectableLayerMask))
{
OnSelectedObjectChanged?.Invoke(this, new OnSelectedObjectChangedEventArgs() { SelectedObject = _raycastHit.transform });
mouseRaycastHit.transform.TryGetComponent(out BaseInteractableObject baseObject);
if (baseObject != null)
{
OnSelectedObjectChanged?.Invoke(this, new OnSelectedObjectChangedEventArgs() { SelectedObject = baseObject });
if (Input.GetMouseButtonDown(0))
{
Player.Instance.AddTask(new PlayerTasks(Tasks.Move, baseObject._playerArrivePoint.position));
Player.Instance.AddTask(new PlayerTasks(Tasks.Interact, baseObject));
}
}
else
{
OnSelectedObjectChanged?.Invoke(this, new OnSelectedObjectChangedEventArgs() { SelectedObject = null });
}
}
else
{
OnSelectedObjectChanged?.Invoke(this, new OnSelectedObjectChangedEventArgs() { SelectedObject = null });
}
if (Input.GetMouseButton(0))
{
if (Physics.Raycast(_camera.ScreenPointToRay(Input.mousePosition), out RaycastHit hit, 100f, _walkableLayerMask))
if (Input.GetMouseButtonDown(0))
{
var pointToMove = hit.point;
OnMovementTargetSelected?.Invoke(this, new OnMovementTargetSelectedEventArgs() { PointToMove = pointToMove });
if (Physics.Raycast(_camera.ScreenPointToRay(Input.mousePosition), out RaycastHit hit, 100f, _walkableLayerMask))
{
Player.Instance.AddTask(new PlayerTasks(Tasks.Move, hit.point));
}
}
}
}
@@ -1,111 +1,158 @@
using Assets.Scripts.Actions.Interfaces;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;
using static GameManager;
using static UnityEditor.PlayerSettings;
public class PlayerManager : MonoBehaviour
{
private enum States { Idle, Walking, Sleeping };
[SerializeField]
public LayerMask _walkableLayer;
[SerializeField]
public NavMeshAgent _navAgent;
[SerializeField]
public Animator _animator;
[SerializeField]
private Camera _camera;
public bool allowMovement = true;
private States _state;
private Vector3 _groundDeltaPosition;
public Dictionary<StatsId, Stat> PlayerStats;
public IWorkPlace WorkPlace { get; set; }
private Vector3 _pointToMove;
private bool _movePointReceived=false;
private void Start()
{
TimeManager.OnMinuteChanged += UpdatePlayerState;
allowMovement = true;
_navAgent.updatePosition = false;
PlayerStats = GameManager.Instance.PlayerStats;
MouseInputManager.Instance.OnMovementTargetSelected += Mouse_OnMovementTargetSelected;
}
private void Mouse_OnMovementTargetSelected(object sender, OnMovementTargetSelectedEventArgs e)
{
_pointToMove= e.PointToMove;
_movePointReceived = true;
}
private void OnDestroy()
{
TimeManager.OnMinuteChanged -= UpdatePlayerState;
MouseInputManager.Instance.OnMovementTargetSelected -= Mouse_OnMovementTargetSelected;
}
private void Update()
{
if (allowMovement && _movePointReceived)
{
_movePointReceived = false;
_navAgent.SetDestination(_pointToMove);
}
var worldDeltaPosition = _navAgent.nextPosition - transform.position;
_groundDeltaPosition.x = Vector3.Dot(transform.right, worldDeltaPosition);
_groundDeltaPosition.y = Vector3.Dot(transform.forward, worldDeltaPosition);
Vector2 velocity = (Time.deltaTime > 1e-5f) ? _groundDeltaPosition / Time.deltaTime : Vector2.zero;
var shouldMove = velocity.magnitude > 0.025f && _navAgent.remainingDistance > _navAgent.radius;
if (_state != States.Sleeping)
{
_state = shouldMove ? States.Walking : States.Idle;
_animator.SetBool("Move", shouldMove);
_animator.SetFloat("velY", velocity.y);
}
}
private void OnAnimatorMove()
{
transform.position = _navAgent.nextPosition;
}
public void UpdatePlayerState()
{
PlayerStats[StatsId.Food].deduct(0.034m); // 48 hours it's 100, 100/2880=~0.034 per minute
switch (_state)
{
case States.Idle:
case States.Walking:
PlayerStats[StatsId.Energy].deduct(0.1m); // 24 hours it's 100, 100/1440=~0.096 per minute
break;
case States.Sleeping:
PlayerStats[StatsId.Energy].increase(1m);
break;
}
if (PlayerStats[StatsId.Energy].Value <= 10 && _state != States.Sleeping)
{
_state = States.Sleeping;
allowMovement = false;
_animator.SetBool("Fall", true);
}
if (PlayerStats[StatsId.Energy].Value >= 100 && _state == States.Sleeping)
{
_state = States.Idle;
allowMovement = true;
_animator.SetBool("Fall", false);
}
}
public void BuyAction(IPlayerAction action)
{
PlayerStats[StatsId.Money].deduct(((ISellable)action).Price);
action.ApplyAction(this);
}
}
using Assets.Scripts.Actions.Interfaces;
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;
public enum Tasks { Move, Interact };
public enum TaskStatus { Waiting, InProgress, Complete };
public class Player : MonoBehaviour
{
public event EventHandler<OnPlayerMovesEventArgs> OnPlayerMoves;
private enum States { Idle, Walking, Sleeping };
public static Player Instance { get; private set; }
[SerializeField]
public NavMeshAgent _navAgent;
[SerializeField]
public Animator _animator;
public bool allowMovement = true;
private States _state;
private Vector3 _groundDeltaPosition;
public Dictionary<StatsId, Stat> PlayerStats;
public IWorkPlace WorkPlace { get; set; }
private readonly Queue<PlayerTasks> _tasks = new Queue<PlayerTasks>();
private PlayerTasks _currentTask;
private void Awake()
{
if (Instance != null)
{
Debug.Log("There's more than one player instance");
return;
}
Instance = this;
}
private void Start()
{
TimeManager.OnMinuteChanged += UpdatePlayerState;
allowMovement = true;
_navAgent.updatePosition = false;
PlayerStats = GameManager.Instance.PlayerStats;
}
private void OnDestroy()
{
TimeManager.OnMinuteChanged -= UpdatePlayerState;
}
private void Update()
{
if (_currentTask == null || _currentTask.Status == TaskStatus.Complete)
{
_tasks.TryDequeue(out _currentTask);
}
if (_currentTask != null)
{
switch (_currentTask.Task)
{
case Tasks.Move:
OnPlayerMoves?.Invoke(this, new OnPlayerMovesEventArgs() { PointToMove = _currentTask.Position });
_navAgent.SetDestination(_currentTask.Position);
_currentTask.UpdateStatus(MoveToPoint());
break;
case Tasks.Interact:
_currentTask.UpdateStatus(InteractWithObject(_currentTask.Interactable));
break;
}
}
}
private TaskStatus MoveToPoint()
{
var worldDeltaPosition = _navAgent.nextPosition - transform.position;
_groundDeltaPosition.x = Vector3.Dot(transform.right, worldDeltaPosition);
_groundDeltaPosition.y = Vector3.Dot(transform.forward, worldDeltaPosition);
Vector2 velocity = (Time.deltaTime > 1e-5f) ? _groundDeltaPosition / Time.deltaTime : Vector2.zero;
var shouldMove = velocity.magnitude > 0.025f && _navAgent.remainingDistance > _navAgent.radius;
if (_state != States.Sleeping)
{
_state = shouldMove ? States.Walking : States.Idle;
_animator.SetBool("Move", shouldMove);
_animator.SetFloat("velY", velocity.y);
}
return pathComplete() ? TaskStatus.Complete : TaskStatus.InProgress;
}
private bool pathComplete()
{
if (Vector3.Distance(_navAgent.destination, _navAgent.transform.position) <= _navAgent.radius)
{
if (!_navAgent.hasPath || _navAgent.velocity.sqrMagnitude == 0f)
{
return true;
}
}
return false;
}
private TaskStatus InteractWithObject(BaseInteractableObject interactableObject)
{
interactableObject.Interact();
return TaskStatus.Complete;
}
private void OnAnimatorMove()
{
transform.position = _navAgent.nextPosition;
}
public void AddTask(PlayerTasks task)
{
_tasks.Enqueue(task);
}
public void UpdatePlayerState()
{
PlayerStats[StatsId.Food].deduct(0.034m); // 48 hours it's 100, 100/2880=~0.034 per minute
switch (_state)
{
case States.Idle:
case States.Walking:
PlayerStats[StatsId.Energy].deduct(0.1m); // 24 hours it's 100, 100/1440=~0.096 per minute
break;
case States.Sleeping:
PlayerStats[StatsId.Energy].increase(1m);
break;
}
if (PlayerStats[StatsId.Energy].Value <= 10 && _state != States.Sleeping)
{
_state = States.Sleeping;
allowMovement = false;
_animator.SetBool("Fall", true);
}
if (PlayerStats[StatsId.Energy].Value >= 100 && _state == States.Sleeping)
{
_state = States.Idle;
allowMovement = true;
_animator.SetBool("Fall", false);
}
}
public void BuyAction(IPlayerAction action)
{
PlayerStats[StatsId.Money].deduct(((ISellable)action).Price);
action.ApplyAction(this);
}
}
+27
View File
@@ -0,0 +1,27 @@
using UnityEngine;
public class PlayerTasks
{
public Tasks Task { get; private set; }
public Vector3 Position { get; private set; }
public BaseInteractableObject Interactable { get; private set; }
public TaskStatus Status { get; private set; }
public PlayerTasks(Tasks task, Vector3 position)
{
Task = task;
Position = position;
Status = TaskStatus.Waiting;
}
public PlayerTasks(Tasks task, BaseInteractableObject interactable)
{
Task = task;
Interactable = interactable;
Status = TaskStatus.Waiting;
}
public void UpdateStatus(TaskStatus status)
{
Status = status;
}
}
+11
View File
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a64ec35bd6b0f784cba543d437d7cdd4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+4 -2
View File
@@ -2,8 +2,10 @@ using UnityEngine;
public class SelectedVisual : MonoBehaviour
{
[SerializeField] private Transform _selectedObject;
[SerializeField] private GameObject[] visualGameObjectArray;
[SerializeField]
private BaseInteractableObject _selectedObject;
[SerializeField]
private GameObject[] visualGameObjectArray;
private void Start()
+3 -3
View File
@@ -9,10 +9,10 @@ public class WaypointVisual : MonoBehaviour
private void Start()
{
MouseInputManager.Instance.OnMovementTargetSelected += Mouse_OnMovementTargetSelected;
Player.Instance.OnPlayerMoves += Instance_OnPlayerMoves;
}
private void Mouse_OnMovementTargetSelected(object sender, OnMovementTargetSelectedEventArgs e)
private void Instance_OnPlayerMoves(object sender, OnPlayerMovesEventArgs e)
{
_wayPoint.position = e.PointToMove;
_particleSystem.Play();
@@ -20,6 +20,6 @@ public class WaypointVisual : MonoBehaviour
private void OnDestroy()
{
MouseInputManager.Instance.OnMovementTargetSelected -= Mouse_OnMovementTargetSelected;
Player.Instance.OnPlayerMoves -= Instance_OnPlayerMoves;
}
}
-9
View File
@@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 8a0c9218a650547d98138cd835033977
folderAsset: yes
timeCreated: 1484670163
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

-134
View File
@@ -1,134 +0,0 @@
fileFormatVersion: 2
guid: 727a75301c3d24613a3ebcec4a24c2c8
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: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 2
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
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: Android
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: iPhone
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:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
-654
View File
@@ -1,654 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &1
MonoBehaviour:
m_ObjectHideFlags: 52
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 12004, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier:
m_PixelRect:
serializedVersion: 2
x: 0
y: 45
width: 1666
height: 958
m_ShowMode: 4
m_Title:
m_RootView: {fileID: 6}
m_MinSize: {x: 950, y: 542}
m_MaxSize: {x: 10000, y: 10000}
--- !u!114 &2
MonoBehaviour:
m_ObjectHideFlags: 52
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier:
m_Children: []
m_Position:
serializedVersion: 2
x: 0
y: 466
width: 290
height: 442
m_MinSize: {x: 234, y: 271}
m_MaxSize: {x: 10004, y: 10021}
m_ActualView: {fileID: 14}
m_Panes:
- {fileID: 14}
m_Selected: 0
m_LastSelected: 0
--- !u!114 &3
MonoBehaviour:
m_ObjectHideFlags: 52
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 12010, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier:
m_Children:
- {fileID: 4}
- {fileID: 2}
m_Position:
serializedVersion: 2
x: 973
y: 0
width: 290
height: 908
m_MinSize: {x: 234, y: 492}
m_MaxSize: {x: 10004, y: 14042}
vertical: 1
controlID: 226
--- !u!114 &4
MonoBehaviour:
m_ObjectHideFlags: 52
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier:
m_Children: []
m_Position:
serializedVersion: 2
x: 0
y: 0
width: 290
height: 466
m_MinSize: {x: 204, y: 221}
m_MaxSize: {x: 4004, y: 4021}
m_ActualView: {fileID: 17}
m_Panes:
- {fileID: 17}
m_Selected: 0
m_LastSelected: 0
--- !u!114 &5
MonoBehaviour:
m_ObjectHideFlags: 52
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier:
m_Children: []
m_Position:
serializedVersion: 2
x: 0
y: 466
width: 973
height: 442
m_MinSize: {x: 202, y: 221}
m_MaxSize: {x: 4002, y: 4021}
m_ActualView: {fileID: 15}
m_Panes:
- {fileID: 15}
m_Selected: 0
m_LastSelected: 0
--- !u!114 &6
MonoBehaviour:
m_ObjectHideFlags: 52
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 12008, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier:
m_Children:
- {fileID: 7}
- {fileID: 8}
- {fileID: 9}
m_Position:
serializedVersion: 2
x: 0
y: 0
width: 1666
height: 958
m_MinSize: {x: 950, y: 542}
m_MaxSize: {x: 10000, y: 10000}
--- !u!114 &7
MonoBehaviour:
m_ObjectHideFlags: 52
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 12011, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier:
m_Children: []
m_Position:
serializedVersion: 2
x: 0
y: 0
width: 1666
height: 30
m_MinSize: {x: 0, y: 0}
m_MaxSize: {x: 0, y: 0}
m_LastLoadedLayoutName: Tutorial
--- !u!114 &8
MonoBehaviour:
m_ObjectHideFlags: 52
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 12010, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier:
m_Children:
- {fileID: 10}
- {fileID: 3}
- {fileID: 11}
m_Position:
serializedVersion: 2
x: 0
y: 30
width: 1666
height: 908
m_MinSize: {x: 713, y: 492}
m_MaxSize: {x: 18008, y: 14042}
vertical: 0
controlID: 74
--- !u!114 &9
MonoBehaviour:
m_ObjectHideFlags: 52
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 12042, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier:
m_Children: []
m_Position:
serializedVersion: 2
x: 0
y: 938
width: 1666
height: 20
m_MinSize: {x: 0, y: 0}
m_MaxSize: {x: 0, y: 0}
--- !u!114 &10
MonoBehaviour:
m_ObjectHideFlags: 52
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 12010, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier:
m_Children:
- {fileID: 12}
- {fileID: 5}
m_Position:
serializedVersion: 2
x: 0
y: 0
width: 973
height: 908
m_MinSize: {x: 202, y: 442}
m_MaxSize: {x: 4002, y: 8042}
vertical: 1
controlID: 75
--- !u!114 &11
MonoBehaviour:
m_ObjectHideFlags: 52
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier:
m_Children: []
m_Position:
serializedVersion: 2
x: 1263
y: 0
width: 403
height: 908
m_MinSize: {x: 277, y: 71}
m_MaxSize: {x: 4002, y: 4021}
m_ActualView: {fileID: 13}
m_Panes:
- {fileID: 13}
m_Selected: 0
m_LastSelected: 0
--- !u!114 &12
MonoBehaviour:
m_ObjectHideFlags: 52
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier:
m_Children: []
m_Position:
serializedVersion: 2
x: 0
y: 0
width: 973
height: 466
m_MinSize: {x: 202, y: 221}
m_MaxSize: {x: 4002, y: 4021}
m_ActualView: {fileID: 16}
m_Panes:
- {fileID: 16}
m_Selected: 0
m_LastSelected: 0
--- !u!114 &13
MonoBehaviour:
m_ObjectHideFlags: 52
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 12019, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier:
m_AutoRepaintOnSceneChange: 0
m_MinSize: {x: 275, y: 50}
m_MaxSize: {x: 4000, y: 4000}
m_TitleContent:
m_Text: Inspector
m_Image: {fileID: -6905738622615590433, guid: 0000000000000000d000000000000000,
type: 0}
m_Tooltip:
m_DepthBufferBits: 0
m_Pos:
serializedVersion: 2
x: 2
y: 19
width: 401
height: 887
m_ScrollPosition: {x: 0, y: 0}
m_InspectorMode: 0
m_PreviewResizer:
m_CachedPref: -160
m_ControlHash: -371814159
m_PrefName: Preview_InspectorPreview
m_PreviewWindow: {fileID: 0}
--- !u!114 &14
MonoBehaviour:
m_ObjectHideFlags: 52
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 12014, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier:
m_AutoRepaintOnSceneChange: 0
m_MinSize: {x: 230, y: 250}
m_MaxSize: {x: 10000, y: 10000}
m_TitleContent:
m_Text: Project
m_Image: {fileID: -7501376956915960154, guid: 0000000000000000d000000000000000,
type: 0}
m_Tooltip:
m_DepthBufferBits: 0
m_Pos:
serializedVersion: 2
x: 2
y: 19
width: 286
height: 421
m_SearchFilter:
m_NameFilter:
m_ClassNames: []
m_AssetLabels: []
m_AssetBundleNames: []
m_VersionControlStates: []
m_ReferencingInstanceIDs:
m_ScenePaths: []
m_ShowAllHits: 0
m_SearchArea: 0
m_Folders:
- Assets
m_ViewMode: 0
m_StartGridSize: 64
m_LastFolders:
- Assets
m_LastFoldersGridSize: -1
m_LastProjectPath: /Users/danielbrauer/Unity Projects/New Unity Project 47
m_IsLocked: 0
m_FolderTreeState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: ee240000
m_LastClickedID: 9454
m_ExpandedIDs: ee24000000ca9a3bffffff7f
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
m_OriginalName:
m_EditFieldRect:
serializedVersion: 2
x: 0
y: 0
width: 0
height: 0
m_UserData: 0
m_IsWaitingForDelay: 0
m_IsRenaming: 0
m_OriginalEventType: 11
m_IsRenamingFilename: 1
m_ClientGUIView: {fileID: 0}
m_SearchString:
m_CreateAssetUtility:
m_EndAction: {fileID: 0}
m_InstanceID: 0
m_Path:
m_Icon: {fileID: 0}
m_ResourceFile:
m_AssetTreeState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: 68fbffff
m_LastClickedID: 0
m_ExpandedIDs: ee240000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
m_OriginalName:
m_EditFieldRect:
serializedVersion: 2
x: 0
y: 0
width: 0
height: 0
m_UserData: 0
m_IsWaitingForDelay: 0
m_IsRenaming: 0
m_OriginalEventType: 11
m_IsRenamingFilename: 1
m_ClientGUIView: {fileID: 0}
m_SearchString:
m_CreateAssetUtility:
m_EndAction: {fileID: 0}
m_InstanceID: 0
m_Path:
m_Icon: {fileID: 0}
m_ResourceFile:
m_ListAreaState:
m_SelectedInstanceIDs: 68fbffff
m_LastClickedInstanceID: -1176
m_HadKeyboardFocusLastEvent: 0
m_ExpandedInstanceIDs: c6230000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
m_OriginalName:
m_EditFieldRect:
serializedVersion: 2
x: 0
y: 0
width: 0
height: 0
m_UserData: 0
m_IsWaitingForDelay: 0
m_IsRenaming: 0
m_OriginalEventType: 11
m_IsRenamingFilename: 1
m_ClientGUIView: {fileID: 0}
m_CreateAssetUtility:
m_EndAction: {fileID: 0}
m_InstanceID: 0
m_Path:
m_Icon: {fileID: 0}
m_ResourceFile:
m_NewAssetIndexInList: -1
m_ScrollPosition: {x: 0, y: 0}
m_GridSize: 64
m_DirectoriesAreaWidth: 110
--- !u!114 &15
MonoBehaviour:
m_ObjectHideFlags: 52
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 12015, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier:
m_AutoRepaintOnSceneChange: 1
m_MinSize: {x: 200, y: 200}
m_MaxSize: {x: 4000, y: 4000}
m_TitleContent:
m_Text: Game
m_Image: {fileID: -2087823869225018852, guid: 0000000000000000d000000000000000,
type: 0}
m_Tooltip:
m_DepthBufferBits: 32
m_Pos:
serializedVersion: 2
x: 0
y: 19
width: 971
height: 421
m_MaximizeOnPlay: 0
m_Gizmos: 0
m_Stats: 0
m_SelectedSizes: 00000000000000000000000000000000000000000000000000000000000000000000000000000000
m_TargetDisplay: 0
m_ZoomArea:
m_HRangeLocked: 0
m_VRangeLocked: 0
m_HBaseRangeMin: -242.75
m_HBaseRangeMax: 242.75
m_VBaseRangeMin: -101
m_VBaseRangeMax: 101
m_HAllowExceedBaseRangeMin: 1
m_HAllowExceedBaseRangeMax: 1
m_VAllowExceedBaseRangeMin: 1
m_VAllowExceedBaseRangeMax: 1
m_ScaleWithWindow: 0
m_HSlider: 0
m_VSlider: 0
m_IgnoreScrollWheelUntilClicked: 0
m_EnableMouseInput: 1
m_EnableSliderZoom: 0
m_UniformScale: 1
m_UpDirection: 1
m_DrawArea:
serializedVersion: 2
x: 0
y: 17
width: 971
height: 404
m_Scale: {x: 2, y: 2}
m_Translation: {x: 485.5, y: 202}
m_MarginLeft: 0
m_MarginRight: 0
m_MarginTop: 0
m_MarginBottom: 0
m_LastShownAreaInsideMargins:
serializedVersion: 2
x: -242.75
y: -101
width: 485.5
height: 202
m_MinimalGUI: 1
m_defaultScale: 2
m_TargetTexture: {fileID: 0}
m_CurrentColorSpace: 0
m_LastWindowPixelSize: {x: 1942, y: 842}
m_ClearInEditMode: 1
m_NoCameraWarning: 1
m_LowResolutionForAspectRatios: 01000000000100000100
--- !u!114 &16
MonoBehaviour:
m_ObjectHideFlags: 52
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 12013, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier:
m_AutoRepaintOnSceneChange: 1
m_MinSize: {x: 200, y: 200}
m_MaxSize: {x: 4000, y: 4000}
m_TitleContent:
m_Text: Scene
m_Image: {fileID: 2318424515335265636, guid: 0000000000000000d000000000000000,
type: 0}
m_Tooltip:
m_DepthBufferBits: 32
m_Pos:
serializedVersion: 2
x: 0
y: 19
width: 971
height: 445
m_SceneLighting: 1
lastFramingTime: 0
m_2DMode: 0
m_isRotationLocked: 0
m_AudioPlay: 0
m_Position:
m_Target: {x: 0, y: 0, z: 0}
speed: 2
m_Value: {x: 0, y: 0, z: 0}
m_RenderMode: 0
m_ValidateTrueMetals: 0
m_SceneViewState:
showFog: 1
showMaterialUpdate: 0
showSkybox: 1
showFlares: 1
showImageEffects: 1
grid:
xGrid:
m_Target: 0
speed: 2
m_Value: 0
yGrid:
m_Target: 1
speed: 2
m_Value: 1
zGrid:
m_Target: 0
speed: 2
m_Value: 0
m_Rotation:
m_Target: {x: -0.08717229, y: 0.89959055, z: -0.21045254, w: -0.3726226}
speed: 2
m_Value: {x: -0.08717229, y: 0.89959055, z: -0.21045254, w: -0.3726226}
m_Size:
m_Target: 10
speed: 2
m_Value: 10
m_Ortho:
m_Target: 0
speed: 2
m_Value: 0
m_LastSceneViewRotation: {x: 0, y: 0, z: 0, w: 0}
m_LastSceneViewOrtho: 0
m_ReplacementShader: {fileID: 0}
m_ReplacementString:
m_LastLockedObject: {fileID: 0}
m_ViewIsLockedToObject: 0
--- !u!114 &17
MonoBehaviour:
m_ObjectHideFlags: 52
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 12061, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier:
m_AutoRepaintOnSceneChange: 0
m_MinSize: {x: 200, y: 200}
m_MaxSize: {x: 4000, y: 4000}
m_TitleContent:
m_Text: Hierarchy
m_Image: {fileID: -590624980919486359, guid: 0000000000000000d000000000000000,
type: 0}
m_Tooltip:
m_DepthBufferBits: 0
m_Pos:
serializedVersion: 2
x: 2
y: 19
width: 286
height: 445
m_TreeViewState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: 68fbffff
m_LastClickedID: -1176
m_ExpandedIDs: 7efbffff00000000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
m_OriginalName:
m_EditFieldRect:
serializedVersion: 2
x: 0
y: 0
width: 0
height: 0
m_UserData: 0
m_IsWaitingForDelay: 0
m_IsRenaming: 0
m_OriginalEventType: 11
m_IsRenamingFilename: 0
m_ClientGUIView: {fileID: 0}
m_SearchString:
m_ExpandedScenes:
-
m_CurrenRootInstanceID: 0
m_Locked: 0
m_CurrentSortingName: TransformSorting
-8
View File
@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: eabc9546105bf4accac1fd62a63e88e6
timeCreated: 1487337779
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
-9
View File
@@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 5a9bcd70e6a4b4b05badaa72e827d8e0
folderAsset: yes
timeCreated: 1475835190
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
-9
View File
@@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 3ad9b87dffba344c89909c6d1b1c17e1
folderAsset: yes
timeCreated: 1475593892
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
@@ -1,242 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System;
using System.IO;
using System.Reflection;
[CustomEditor(typeof(Readme))]
[InitializeOnLoad]
public class ReadmeEditor : Editor
{
static string s_ShowedReadmeSessionStateName = "ReadmeEditor.showedReadme";
static string s_ReadmeSourceDirectory = "Assets/TutorialInfo";
const float k_Space = 16f;
static ReadmeEditor()
{
EditorApplication.delayCall += SelectReadmeAutomatically;
}
static void RemoveTutorial()
{
if (EditorUtility.DisplayDialog("Remove Readme Assets",
$"All contents under {s_ReadmeSourceDirectory} will be removed, are you sure you want to proceed?",
"Proceed",
"Cancel"))
{
if (Directory.Exists(s_ReadmeSourceDirectory))
{
FileUtil.DeleteFileOrDirectory(s_ReadmeSourceDirectory);
FileUtil.DeleteFileOrDirectory(s_ReadmeSourceDirectory + ".meta");
}
else
{
Debug.Log($"Could not find the Readme folder at {s_ReadmeSourceDirectory}");
}
var readmeAsset = SelectReadme();
if (readmeAsset != null)
{
var path = AssetDatabase.GetAssetPath(readmeAsset);
FileUtil.DeleteFileOrDirectory(path + ".meta");
FileUtil.DeleteFileOrDirectory(path);
}
AssetDatabase.Refresh();
}
}
static void SelectReadmeAutomatically()
{
if (!SessionState.GetBool(s_ShowedReadmeSessionStateName, false))
{
var readme = SelectReadme();
SessionState.SetBool(s_ShowedReadmeSessionStateName, true);
if (readme && !readme.loadedLayout)
{
LoadLayout();
readme.loadedLayout = true;
}
}
}
static void LoadLayout()
{
var assembly = typeof(EditorApplication).Assembly;
var windowLayoutType = assembly.GetType("UnityEditor.WindowLayout", true);
var method = windowLayoutType.GetMethod("LoadWindowLayout", BindingFlags.Public | BindingFlags.Static);
method.Invoke(null, new object[] { Path.Combine(Application.dataPath, "TutorialInfo/Layout.wlt"), false });
}
static Readme SelectReadme()
{
var ids = AssetDatabase.FindAssets("Readme t:Readme");
if (ids.Length == 1)
{
var readmeObject = AssetDatabase.LoadMainAssetAtPath(AssetDatabase.GUIDToAssetPath(ids[0]));
Selection.objects = new UnityEngine.Object[] { readmeObject };
return (Readme)readmeObject;
}
else
{
Debug.Log("Couldn't find a readme");
return null;
}
}
protected override void OnHeaderGUI()
{
var readme = (Readme)target;
Init();
var iconWidth = Mathf.Min(EditorGUIUtility.currentViewWidth / 3f - 20f, 128f);
GUILayout.BeginHorizontal("In BigTitle");
{
if (readme.icon != null)
{
GUILayout.Space(k_Space);
GUILayout.Label(readme.icon, GUILayout.Width(iconWidth), GUILayout.Height(iconWidth));
}
GUILayout.Space(k_Space);
GUILayout.BeginVertical();
{
GUILayout.FlexibleSpace();
GUILayout.Label(readme.title, TitleStyle);
GUILayout.FlexibleSpace();
}
GUILayout.EndVertical();
GUILayout.FlexibleSpace();
}
GUILayout.EndHorizontal();
}
public override void OnInspectorGUI()
{
var readme = (Readme)target;
Init();
foreach (var section in readme.sections)
{
if (!string.IsNullOrEmpty(section.heading))
{
GUILayout.Label(section.heading, HeadingStyle);
}
if (!string.IsNullOrEmpty(section.text))
{
GUILayout.Label(section.text, BodyStyle);
}
if (!string.IsNullOrEmpty(section.linkText))
{
if (LinkLabel(new GUIContent(section.linkText)))
{
Application.OpenURL(section.url);
}
}
GUILayout.Space(k_Space);
}
if (GUILayout.Button("Remove Readme Assets", ButtonStyle))
{
RemoveTutorial();
}
}
bool m_Initialized;
GUIStyle LinkStyle
{
get { return m_LinkStyle; }
}
[SerializeField]
GUIStyle m_LinkStyle;
GUIStyle TitleStyle
{
get { return m_TitleStyle; }
}
[SerializeField]
GUIStyle m_TitleStyle;
GUIStyle HeadingStyle
{
get { return m_HeadingStyle; }
}
[SerializeField]
GUIStyle m_HeadingStyle;
GUIStyle BodyStyle
{
get { return m_BodyStyle; }
}
[SerializeField]
GUIStyle m_BodyStyle;
GUIStyle ButtonStyle
{
get { return m_ButtonStyle; }
}
[SerializeField]
GUIStyle m_ButtonStyle;
void Init()
{
if (m_Initialized)
return;
m_BodyStyle = new GUIStyle(EditorStyles.label);
m_BodyStyle.wordWrap = true;
m_BodyStyle.fontSize = 14;
m_BodyStyle.richText = true;
m_TitleStyle = new GUIStyle(m_BodyStyle);
m_TitleStyle.fontSize = 26;
m_HeadingStyle = new GUIStyle(m_BodyStyle);
m_HeadingStyle.fontStyle = FontStyle.Bold;
m_HeadingStyle.fontSize = 18;
m_LinkStyle = new GUIStyle(m_BodyStyle);
m_LinkStyle.wordWrap = false;
// Match selection color which works nicely for both light and dark skins
m_LinkStyle.normal.textColor = new Color(0x00 / 255f, 0x78 / 255f, 0xDA / 255f, 1f);
m_LinkStyle.stretchWidth = false;
m_ButtonStyle = new GUIStyle(EditorStyles.miniButton);
m_ButtonStyle.fontStyle = FontStyle.Bold;
m_Initialized = true;
}
bool LinkLabel(GUIContent label, params GUILayoutOption[] options)
{
var position = GUILayoutUtility.GetRect(label, LinkStyle, options);
Handles.BeginGUI();
Handles.color = LinkStyle.normal.textColor;
Handles.DrawLine(new Vector3(position.xMin, position.yMax), new Vector3(position.xMax, position.yMax));
Handles.color = Color.white;
Handles.EndGUI();
EditorGUIUtility.AddCursorRect(position, MouseCursor.Link);
return GUI.Button(position, label, LinkStyle);
}
}
-16
View File
@@ -1,16 +0,0 @@
using System;
using UnityEngine;
public class Readme : ScriptableObject
{
public Texture2D icon;
public string title;
public Section[] sections;
public bool loadedLayout;
[Serializable]
public class Section
{
public string heading, text, linkText, url;
}
}
@@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: fcf7219bab7fe46a1ad266029b2fee19
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences:
- icon: {instanceID: 0}
executionOrder: 0
icon: {fileID: 2800000, guid: a186f8a87ca4f4d3aa864638ad5dfb65, type: 3}
userData:
assetBundleName:
assetBundleVariant: