Skip to content

Commit

Permalink
More tweaks and adjustments
Browse files Browse the repository at this point in the history
notably making Globals non static but instead a singleton and adding a way to get the singleton instance of blocks using `Block.Instance<BlockType>();`. also makes player sprite rotation for walking scale-based instead of flipping the sprite renderer so that child objects are also affected. This means that the camera had to be moved outside of the player instances.
  • Loading branch information
Mark Suckerberg committed Jun 5, 2021
1 parent be69eec commit a9f55a9
Show file tree
Hide file tree
Showing 35 changed files with 568 additions and 337 deletions.
142 changes: 15 additions & 127 deletions Blocktest/Assets/Prefabs/Player.prefab
Original file line number Diff line number Diff line change
@@ -1,109 +1,5 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3613805916373815112
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3613805916373815119}
- component: {fileID: 3613805916373815118}
- component: {fileID: 3613805916373815113}
- component: {fileID: 3613805916373815116}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3613805916373815119
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3613805916373815112}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 3613805916922500982}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!20 &3613805916373815118
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3613805916373815112}
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_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_FocalLength: 50
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: 1
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!81 &3613805916373815113
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3613805916373815112}
m_Enabled: 1
--- !u!114 &3613805916373815116
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3613805916373815112}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6a160d838ff8b4b4693ac20007e008c7, type: 3}
m_Name:
m_EditorClassIdentifier:
m_AssetsPPU: 16
m_RefResolutionX: 320
m_RefResolutionY: 180
m_UpscaleRT: 0
m_PixelSnapping: 1
m_CropFrameX: 0
m_CropFrameY: 0
m_StretchFill: 0
--- !u!1 &3613805916922500989
GameObject:
m_ObjectHideFlags: 0
Expand All @@ -116,9 +12,9 @@ GameObject:
- component: {fileID: 3613805916922500977}
- component: {fileID: 3613805916922500979}
- component: {fileID: 3613805916922500983}
- component: {fileID: 3613805916922500980}
- component: {fileID: 3613805916922500976}
- component: {fileID: 265962019098306197}
- component: {fileID: 6702252210274647291}
m_Layer: 8
m_Name: Player
m_TagString: Untagged
Expand All @@ -136,8 +32,7 @@ Transform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 3613805916373815119}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
Expand Down Expand Up @@ -230,25 +125,7 @@ MonoBehaviour:
groundLayer:
serializedVersion: 2
m_Bits: 1536
--- !u!95 &3613805916922500980
Animator:
serializedVersion: 3
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3613805916922500989}
m_Enabled: 1
m_Avatar: {fileID: 0}
m_Controller: {fileID: 9100000, guid: fca24237ae0587540b9b4dfe58c15694, type: 2}
m_CullingMode: 0
m_UpdateMode: 0
m_ApplyRootMotion: 0
m_LinearVelocityBlending: 0
m_WarningMessage:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorControllerStateOnDisable: 0
species: human
--- !u!114 &3613805916922500976
MonoBehaviour:
m_ObjectHideFlags: 0
Expand All @@ -264,7 +141,6 @@ MonoBehaviour:
destroySprite: {fileID: 21300000, guid: b9976b73dc5aa3049a6d2f50ba07925d, type: 3}
buildMode: 1
maxBuildDistance: 5
selectionDropdown: {fileID: 0}
--- !u!61 &265962019098306197
BoxCollider2D:
m_ObjectHideFlags: 0
Expand All @@ -291,3 +167,15 @@ BoxCollider2D:
serializedVersion: 2
m_Size: {x: 0.7, y: 1.8}
m_EdgeRadius: 0
--- !u!114 &6702252210274647291
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3613805916922500989}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6dcb98f32d6746e6bff49b05e616b679, type: 3}
m_Name:
m_EditorClassIdentifier:
6 changes: 5 additions & 1 deletion Blocktest/Assets/Prefabs/Player_Lizard.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,13 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3613805916922500983, guid: 4618fdaf1ab8b67418a5f9dc19c540ef, type: 3}
propertyPath: species
value: lizard
objectReference: {fileID: 0}
- target: {fileID: 3613805916922500989, guid: 4618fdaf1ab8b67418a5f9dc19c540ef, type: 3}
propertyPath: m_Name
value: Player (1)
value: Player_Lizard
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 4618fdaf1ab8b67418a5f9dc19c540ef, type: 3}
6 changes: 5 additions & 1 deletion Blocktest/Assets/Prefabs/Player_Radlad.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ PrefabInstance:
propertyPath: m_Controller
value:
objectReference: {fileID: 9100000, guid: 5dbc5e892f240a74da21a18ee01b9a86, type: 2}
- target: {fileID: 599135766860656146, guid: a78d10faadf79b04aba9097c259c19e6, type: 3}
propertyPath: species
value: radlad
objectReference: {fileID: 0}
- target: {fileID: 599135766860656147, guid: a78d10faadf79b04aba9097c259c19e6, type: 3}
propertyPath: m_RootOrder
value: 0
Expand Down Expand Up @@ -65,7 +69,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 599135766860656152, guid: a78d10faadf79b04aba9097c259c19e6, type: 3}
propertyPath: m_Name
value: Player (1)
value: Player_Radlad
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: a78d10faadf79b04aba9097c259c19e6, type: 3}
32 changes: 16 additions & 16 deletions Blocktest/Assets/Resources/Sprites/Blocks/dirt.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a9f55a9

Please sign in to comment.