starting simulation, adding particle effects, item controllers, script restructure

This commit is contained in:
aj 2020-09-30 13:23:01 +01:00
parent bc6515f7f1
commit 4c062b8a05
62 changed files with 6835 additions and 315 deletions

File diff suppressed because it is too large Load Diff

View File

@ -97,7 +97,7 @@ TextureImporter:
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spritePixelsToUnits: 32
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
@ -136,6 +136,30 @@ TextureImporter:
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
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: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:

View File

@ -97,7 +97,7 @@ TextureImporter:
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spritePixelsToUnits: 32
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
@ -136,6 +136,30 @@ TextureImporter:
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
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: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:

View File

@ -97,7 +97,7 @@ TextureImporter:
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spritePixelsToUnits: 32
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
@ -136,6 +136,30 @@ TextureImporter:
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
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: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:

View File

@ -64,7 +64,7 @@ TextureImporter:
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spritePixelsToUnits: 32
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
@ -103,6 +103,30 @@ TextureImporter:
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
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: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:

View File

@ -97,7 +97,7 @@ TextureImporter:
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spritePixelsToUnits: 32
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
@ -136,6 +136,30 @@ TextureImporter:
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
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: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:

View File

@ -97,7 +97,7 @@ TextureImporter:
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spritePixelsToUnits: 32
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
@ -136,6 +136,30 @@ TextureImporter:
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
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: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:

View File

@ -97,7 +97,7 @@ TextureImporter:
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spritePixelsToUnits: 32
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
@ -136,6 +136,30 @@ TextureImporter:
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
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: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:

View File

@ -97,7 +97,7 @@ TextureImporter:
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spritePixelsToUnits: 32
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
@ -136,6 +136,30 @@ TextureImporter:
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
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: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:

View File

@ -97,7 +97,7 @@ TextureImporter:
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spritePixelsToUnits: 32
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
@ -136,6 +136,30 @@ TextureImporter:
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
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: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:

View File

@ -0,0 +1,178 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1102 &-9001414608798601624
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: moving apple
m_Speed: 0.4
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: e45793a1d087d924ca09910fdd8d4844, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1101 &-2439569107660718337
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: reset
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -9001414608798601624}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.75
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &-1580317281934853910
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: collected
m_Speed: 0.8
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours:
- {fileID: 8794174165688282633}
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: ccf1e161c079d484e9aacc31c44f53ef, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1107 &-1577439904952249061
AnimatorStateMachine:
serializedVersion: 5
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Base Layer
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: -9001414608798601624}
m_Position: {x: 520, y: 80, z: 0}
- serializedVersion: 1
m_State: {fileID: -1580317281934853910}
m_Position: {x: 480, y: -60, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions:
- {fileID: 7105427449941067485}
- {fileID: -2439569107660718337}
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 80, y: -30, z: 0}
m_EntryPosition: {x: 130, y: 160, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: -9001414608798601624}
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: apple
serializedVersion: 5
m_AnimatorParameters:
- m_Name: collected
m_Type: 9
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
- m_Name: reset
m_Type: 9
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
m_StateMachine: {fileID: -1577439904952249061}
m_Mask: {fileID: 0}
m_Motions: []
m_Behaviours: []
m_BlendingMode: 0
m_SyncedLayerIndex: -1
m_DefaultWeight: 0
m_IKPass: 0
m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000}
--- !u!1101 &7105427449941067485
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: collected
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -1580317281934853910}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.01741691
m_TransitionOffset: 0
m_ExitTime: 5.277961e-10
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!114 &8794174165688282633
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 93bdbc5aa92e0cd44bb52eae417af7a4, type: 3}
m_Name:
m_EditorClassIdentifier:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 32d2d166b13f7b5419e11d7c6e4851b3
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,89 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: collected
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves:
- curve:
- time: 0
value: {fileID: -4801923697170587870, guid: be1a5bd13766ec048bab6f4c578baa0f,
type: 3}
- time: 0.016666668
value: {fileID: -8008818501793099674, guid: be1a5bd13766ec048bab6f4c578baa0f,
type: 3}
- time: 0.033333335
value: {fileID: -5647853031727683852, guid: be1a5bd13766ec048bab6f4c578baa0f,
type: 3}
- time: 0.05
value: {fileID: 6868876828740441722, guid: be1a5bd13766ec048bab6f4c578baa0f,
type: 3}
- time: 0.06666667
value: {fileID: -3443555461527096104, guid: be1a5bd13766ec048bab6f4c578baa0f,
type: 3}
- time: 0.083333336
value: {fileID: 2831489644526101201, guid: be1a5bd13766ec048bab6f4c578baa0f,
type: 3}
attribute: m_Sprite
path:
classID: 212
script: {fileID: 0}
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 0
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
pptrCurveMapping:
- {fileID: -4801923697170587870, guid: be1a5bd13766ec048bab6f4c578baa0f, type: 3}
- {fileID: -8008818501793099674, guid: be1a5bd13766ec048bab6f4c578baa0f, type: 3}
- {fileID: -5647853031727683852, guid: be1a5bd13766ec048bab6f4c578baa0f, type: 3}
- {fileID: 6868876828740441722, guid: be1a5bd13766ec048bab6f4c578baa0f, type: 3}
- {fileID: -3443555461527096104, guid: be1a5bd13766ec048bab6f4c578baa0f, type: 3}
- {fileID: 2831489644526101201, guid: be1a5bd13766ec048bab6f4c578baa0f, type: 3}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.1
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ccf1e161c079d484e9aacc31c44f53ef
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,133 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: moving apple
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves:
- curve:
- time: 0
value: {fileID: 7293598183456022363, guid: 1ddc9afd21fec77489b1248d18f31b68,
type: 3}
- time: 0.016666668
value: {fileID: 3211865404380153573, guid: 1ddc9afd21fec77489b1248d18f31b68,
type: 3}
- time: 0.033333335
value: {fileID: 4808522734667448011, guid: 1ddc9afd21fec77489b1248d18f31b68,
type: 3}
- time: 0.05
value: {fileID: -8577097333041121892, guid: 1ddc9afd21fec77489b1248d18f31b68,
type: 3}
- time: 0.06666667
value: {fileID: 1419576285154770477, guid: 1ddc9afd21fec77489b1248d18f31b68,
type: 3}
- time: 0.083333336
value: {fileID: -7706788487438311687, guid: 1ddc9afd21fec77489b1248d18f31b68,
type: 3}
- time: 0.1
value: {fileID: 8638710384840876012, guid: 1ddc9afd21fec77489b1248d18f31b68,
type: 3}
- time: 0.11666667
value: {fileID: -4689406079702324653, guid: 1ddc9afd21fec77489b1248d18f31b68,
type: 3}
- time: 0.13333334
value: {fileID: -4804661220611782958, guid: 1ddc9afd21fec77489b1248d18f31b68,
type: 3}
- time: 0.15
value: {fileID: 542562350195365616, guid: 1ddc9afd21fec77489b1248d18f31b68,
type: 3}
- time: 0.16666667
value: {fileID: 1535906679059638393, guid: 1ddc9afd21fec77489b1248d18f31b68,
type: 3}
- time: 0.18333334
value: {fileID: -6207369124864647917, guid: 1ddc9afd21fec77489b1248d18f31b68,
type: 3}
- time: 0.2
value: {fileID: 7209791866757004406, guid: 1ddc9afd21fec77489b1248d18f31b68,
type: 3}
- time: 0.21666667
value: {fileID: -1462588236305530756, guid: 1ddc9afd21fec77489b1248d18f31b68,
type: 3}
- time: 0.23333333
value: {fileID: 4023135878370671054, guid: 1ddc9afd21fec77489b1248d18f31b68,
type: 3}
- time: 0.25
value: {fileID: -337911150936919937, guid: 1ddc9afd21fec77489b1248d18f31b68,
type: 3}
- time: 0.26666668
value: {fileID: 9139289913481491577, guid: 1ddc9afd21fec77489b1248d18f31b68,
type: 3}
attribute: m_Sprite
path:
classID: 212
script: {fileID: 0}
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 0
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
pptrCurveMapping:
- {fileID: 7293598183456022363, guid: 1ddc9afd21fec77489b1248d18f31b68, type: 3}
- {fileID: 3211865404380153573, guid: 1ddc9afd21fec77489b1248d18f31b68, type: 3}
- {fileID: 4808522734667448011, guid: 1ddc9afd21fec77489b1248d18f31b68, type: 3}
- {fileID: -8577097333041121892, guid: 1ddc9afd21fec77489b1248d18f31b68, type: 3}
- {fileID: 1419576285154770477, guid: 1ddc9afd21fec77489b1248d18f31b68, type: 3}
- {fileID: -7706788487438311687, guid: 1ddc9afd21fec77489b1248d18f31b68, type: 3}
- {fileID: 8638710384840876012, guid: 1ddc9afd21fec77489b1248d18f31b68, type: 3}
- {fileID: -4689406079702324653, guid: 1ddc9afd21fec77489b1248d18f31b68, type: 3}
- {fileID: -4804661220611782958, guid: 1ddc9afd21fec77489b1248d18f31b68, type: 3}
- {fileID: 542562350195365616, guid: 1ddc9afd21fec77489b1248d18f31b68, type: 3}
- {fileID: 1535906679059638393, guid: 1ddc9afd21fec77489b1248d18f31b68, type: 3}
- {fileID: -6207369124864647917, guid: 1ddc9afd21fec77489b1248d18f31b68, type: 3}
- {fileID: 7209791866757004406, guid: 1ddc9afd21fec77489b1248d18f31b68, type: 3}
- {fileID: -1462588236305530756, guid: 1ddc9afd21fec77489b1248d18f31b68, type: 3}
- {fileID: 4023135878370671054, guid: 1ddc9afd21fec77489b1248d18f31b68, type: 3}
- {fileID: -337911150936919937, guid: 1ddc9afd21fec77489b1248d18f31b68, type: 3}
- {fileID: 9139289913481491577, guid: 1ddc9afd21fec77489b1248d18f31b68, type: 3}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.28333336
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e45793a1d087d924ca09910fdd8d4844
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -47,6 +47,8 @@ GameObject:
- component: {fileID: 557720380000076311}
- component: {fileID: 7691372070587086485}
- component: {fileID: 5976345916529560159}
- component: {fileID: 145711148100088082}
- component: {fileID: 6140870815240737537}
m_Layer: 0
m_Name: Pink
m_TagString: Untagged
@ -109,7 +111,7 @@ SpriteRenderer:
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_SortingOrder: 2
m_Sprite: {fileID: -6367560908665664636, guid: d348dff3819df794186a80cb95777629,
type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
@ -184,8 +186,8 @@ MonoBehaviour:
- {x: -0.18509436, y: -0.4973666, z: 0}
- {x: -0.1313343, y: -0.4952123, z: 0}
- {x: -0.06197548, y: -0.43095917, z: 0}
- {x: -0.05126047, y: -0.39557147, z: 0}
- {x: 0.08255291, y: -0.40841404, z: 0}
- {x: -0.049506187, y: -0.40609825, z: 0}
- {x: 0.08781624, y: -0.40665957, z: 0}
- {x: 0.08905506, y: -0.45822453, z: 0}
- {x: 0.124240875, y: -0.4943212, z: 0}
- {x: 0.18844604, y: -0.4989672, z: 0}
@ -204,9 +206,9 @@ MonoBehaviour:
- {x: 0.25698066, y: 0.28528532, z: 0}
- {x: 0.1700201, y: 0.2865208, z: 0}
- {x: 0.105240345, y: 0.21398321, z: 0}
- {x: 0.0964489, y: 0.19269344, z: 0}
- {x: 0.014774799, y: 0.18248424, z: 0}
- {x: -0.066898346, y: 0.17227504, z: 0}
- {x: 0.09820318, y: 0.18567559, z: 0}
- {x: 0.020038605, y: 0.18599316, z: 0}
- {x: -0.052862644, y: 0.18631074, z: 0}
- {x: -0.06562853, y: 0.21976611, z: 0}
- {x: -0.09029484, y: 0.2536042, z: 0}
- {x: -0.13060474, y: 0.27912745, z: 0}
@ -224,9 +226,9 @@ MonoBehaviour:
- {x: -0.3119192, y: -0.35349905, z: 0}
- {x: -0.26087332, y: -0.36370823, z: 0}
- {x: -0.24555969, y: -0.4249635, z: 0}
m_ShapePathHash: -1297610441
m_ShapePathHash: 1518933887
m_Mesh: {fileID: 0}
m_InstanceId: 72474
m_InstanceId: -161710
--- !u!70 &607263385546436226
CapsuleCollider2D:
m_ObjectHideFlags: 0
@ -258,6 +260,8 @@ MonoBehaviour:
controller: {fileID: 7691372070587086485}
animator: {fileID: 6698281393096328332}
health: {fileID: 5976345916529560159}
flash: {fileID: 145711148100088082}
controlAllowed: 1
runSpeed: 30
--- !u!114 &7691372070587086485
MonoBehaviour:
@ -328,6 +332,75 @@ MonoBehaviour:
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
WasKilled:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 557720380000076311}
m_TargetAssemblyTypeName: Pink.Mechanics.PinkController, Assembly-CSharp
m_MethodName: WasKilled
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &145711148100088082
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6698281393096328333}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 48a7c389a7398304eb48829dd011aaa1, type: 3}
m_Name:
m_EditorClassIdentifier:
flasher: {fileID: 6140870815240737537}
--- !u!114 &6140870815240737537
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6698281393096328333}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 073797afb82c5a1438f328866b10b3f0, type: 3}
m_Name:
m_EditorClassIdentifier:
m_LightType: 0
m_BlendStyleIndex: 0
m_FalloffIntensity: 0.5
m_Color: {r: 1, g: 0.76066566, b: 0.4575472, a: 1}
m_Intensity: 0
m_LightVolumeOpacity: 0
m_ApplyToSortingLayers: 00000000
m_LightCookieSprite: {fileID: 0}
m_UseNormalMap: 1
m_LightOrder: 0
m_AlphaBlendOnOverlap: 0
m_ShadowIntensity: 0
m_ShadowVolumeIntensity: 0
m_PointLightInnerAngle: 360
m_PointLightOuterAngle: 360
m_PointLightInnerRadius: 0
m_PointLightOuterRadius: 1
m_PointLightDistance: 3
m_PointLightQuality: 1
m_ShapeLightParametricSides: 7
m_ShapeLightParametricAngleOffset: 0
m_ShapeLightParametricRadius: 0.5
m_ShapeLightFalloffSize: 0.5
m_ShapeLightFalloffOffset: {x: 0, y: 0}
m_ShapePath:
- {x: -0.5, y: -0.5, z: 0}
- {x: 0.5, y: -0.5, z: 0}
- {x: 0.5, y: 0.5, z: 0}
- {x: -0.5, y: 0.5, z: 0}
--- !u!1 &8923910403059220416
GameObject:
m_ObjectHideFlags: 0

View File

@ -266,7 +266,7 @@ AnimatorState:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: hit
m_Speed: 1
m_Speed: 0.4
m_CycleOffset: 0
m_Transitions:
- {fileID: -6552758591883291483}

File diff suppressed because one or more lines are too long

View File

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

View File

@ -0,0 +1,30 @@
using UnityEngine;
namespace Pink.Environment
{
/// <summary>
/// The main model containing needed data to implement a platformer style
/// game. This class should only contain data, and methods that operate
/// on the data. It is initialised with data in the GameController class.
/// </summary>
[System.Serializable]
public class EnvironmentModel
{
/// <summary>
/// The virtual camera in the scene.
/// </summary>
public Cinemachine.CinemachineVirtualCamera virtualCamera;
/// <summary>
/// The main component which controls the player sprite, controlled
/// by the user.
/// </summary>
public Pink.Mechanics.PinkController player;
/// <summary>
/// The spawn point in the scene.
/// </summary>
public Transform spawnPoint;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 386330a60fbb827448288b6fa26f982e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,36 @@
using UnityEngine;
namespace Pink.Environment
{
/// <summary>
/// This class exposes the the game model in the inspector, and ticks the
/// simulation.
/// </summary>
public class GameController : MonoBehaviour
{
public static GameController Instance { get; private set; }
//This model field is public and can be therefore be modified in the
//inspector.
//The reference actually comes from the InstanceRegister, and is shared
//through the simulation and events. Unity will deserialize over this
//shared reference when the scene loads, allowing the model to be
//conveniently configured inside the inspector.
public EnvironmentModel model = Simulation.GetModel<EnvironmentModel>();
void OnEnable()
{
Instance = this;
}
void OnDisable()
{
if (Instance == this) Instance = null;
}
void Update()
{
//if (Instance == this) Environment.Tick();
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b1085591623a4e34c9596ce48344eafe
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,63 @@

namespace Pink.Environment
{
public static partial class Simulation
{
/// <summary>
/// An event is something that happens at a point in time in a simulation.
/// The Precondition method is used to check if the event should be executed,
/// as conditions may have changed in the simulation since the event was
/// originally scheduled.
/// </summary>
/// <typeparam name="Event"></typeparam>
public abstract class Event : System.IComparable<Event>
{
internal float tick;
public int CompareTo(Event other)
{
return tick.CompareTo(other.tick);
}
public abstract void Execute();
public virtual bool Precondition() => true;
internal virtual void ExecuteEvent()
{
if (Precondition())
Execute();
}
/// <summary>
/// This method is generally used to set references to null when required.
/// It is automatically called by the Simulation when an event has completed.
/// </summary>
internal virtual void Cleanup()
{
}
}
/// <summary>
/// Event<T> adds the ability to hook into the OnExecute callback
/// whenever the event is executed. Use this class to allow functionality
/// to be plugged into your application with minimal or zero configuration.
/// </summary>
/// <typeparam name="T"></typeparam>
public abstract class Event<T> : Event where T : Event<T>
{
public static System.Action<T> OnExecute;
internal override void ExecuteEvent()
{
if (Precondition())
{
Execute();
OnExecute?.Invoke((T)this);
}
}
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 450ce21ac1ecf8a4e91237aa54759160
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,16 @@
namespace Pink.Environment
{
public static partial class Simulation
{
/// <summary>
/// This class provides a container for creating singletons for any other class,
/// within the scope of the Simulation. It is typically used to hold the simulation
/// models and configuration classes.
/// </summary>
/// <typeparam name="T"></typeparam>
static class InstanceRegister<T> where T : class, new()
{
public static T instance = new T();
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: cfdfb8a415e1f5446b75016782a337f8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,14 @@
namespace Pink.Environment
{
public static partial class Simulation
{
/// <summary>
/// Return the simulation model instance for a class.
/// </summary>
/// <typeparam name="T"></typeparam>
static public T GetModel<T>() where T : class, new()
{
return InstanceRegister<T>.instance;
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b64e9e83babc2524387c58e0ffc721ac
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,29 +0,0 @@
using Pink.Mechanics;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Hot : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
void OnCollisionEnter2D(Collision2D col)
{
var player = col.gameObject.GetComponent<PinkController>();
if (player != null)
{
Debug.Log("Player Burnt");
player.health.Hurt(4f);
}
}
}

View File

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

View File

@ -0,0 +1,14 @@
using UnityEngine;
namespace Pink.Items
{
class Firepit: MonoBehaviour
{
public ParticleSystem explosionParticles;
void OnTriggerEnter2D(Collider2D collider)
{
explosionParticles.Play();
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 30c0625f95eed7644bb526b786e31529
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,27 @@
using UnityEngine;
using Pink.Mechanics;
namespace Pink.Items
{
class FruitController : MonoBehaviour
{
public Animator animator;
void OnTriggerEnter2D(Collider2D collider)
{
var userController = collider.gameObject.GetComponent<PinkController>();
if (userController != null)
{
animator.SetTrigger("collected");
}
}
public void Collect()
{
animator.enabled = false;
GetComponent<CapsuleCollider2D>().enabled = false;
gameObject.SetActive(false);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: dce774be0c444454ea5a217f17532b82
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,37 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Pink.Items;
public class HideFruit : StateMachineBehaviour
{
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
//override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
//{
// animator.gameObject.SetActive(false);
//}
// OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks
//override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
//{
//
//}
// OnStateExit is called when a transition ends and the state machine finishes evaluating this state
override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
animator.gameObject.GetComponent<FruitController>().Collect();
}
// OnStateMove is called right after Animator.OnAnimatorMove()
//override public void OnStateMove(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
//{
// // Implement code that processes and affects root motion
//}
// OnStateIK is called right after Animator.OnAnimatorIK()
//override public void OnStateIK(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
//{
// // Implement code that sets up animation IK (inverse kinematics)
//}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 93bdbc5aa92e0cd44bb52eae417af7a4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

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

View File

@ -63,10 +63,8 @@ namespace Pink.Mechanics
}
}
public void Move(float move, bool crouch, bool jump)
{
//only control the player if grounded or airControl is turned on
if (m_Grounded || m_AirControl)
{

View File

@ -0,0 +1,17 @@
using System.Collections;
using UnityEngine;
namespace Pink.Mechanics
{
class FreezeControl: MonoBehaviour
{
public PinkController player;
public IEnumerator Run(float duration)
{
player.controlAllowed = false;
yield return new WaitForSeconds(duration / 1000f);
player.controlAllowed = true;
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0a68e1163b52a23449e1da295f47d925
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -8,8 +8,12 @@ namespace Pink.Mechanics
{
public float MaxHealth = 10f;
[Header("Events")]
[Space]
public UnityEvent WasHurt;
public UnityEvent WasHealed;
public UnityEvent WasKilled;
private float currentHealth;
float CurrentHealth {
@ -18,7 +22,8 @@ namespace Pink.Mechanics
Math.Max(0f, value),
MaxHealth);
}
public bool IsDead => CurrentHealth > 0;
public bool IsDead => CurrentHealth == 0;
public bool IsAlive => CurrentHealth > 0;
// Start is called before the first frame update
void Start()
@ -28,9 +33,19 @@ namespace Pink.Mechanics
public bool Hurt(float decrement)
{
CurrentHealth -= decrement;
WasHurt.Invoke();
return !IsDead;
if (IsAlive)
{
CurrentHealth -= decrement;
WasHurt.Invoke();
if (IsDead)
WasKilled.Invoke();
}
return IsAlive;
}
public bool Hurt()
{
return Hurt(MaxHealth / 5);
}
public bool Heal(float increment)
@ -39,5 +54,25 @@ namespace Pink.Mechanics
WasHealed.Invoke();
return CurrentHealth == MaxHealth;
}
public bool Heal()
{
CurrentHealth = MaxHealth;
WasHealed.Invoke();
return CurrentHealth == MaxHealth;
}
public void Die()
{
if (IsAlive)
{
Hurt(MaxHealth);
}
}
public void Reset()
{
currentHealth = MaxHealth;
}
}
}

View File

@ -0,0 +1,18 @@
using UnityEngine;
namespace Pink.Mechanics
{
public class Hot : MonoBehaviour
{
void OnTriggerEnter2D(Collider2D collider)
{
var player = collider.gameObject.GetComponent<PinkController>();
if (player != null)
{
Debug.Log("Player Burnt");
player.health.Hurt(2f);
collider.gameObject.GetComponent<Rigidbody2D>().velocity *= -0.8f;
}
}
}
}

View File

@ -1,6 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Pink.Environment;
using Pink.Graphics;
using UnityEngine.Experimental.Rendering.Universal;
using UnityEngine;
namespace Pink.Mechanics
@ -10,6 +10,9 @@ namespace Pink.Mechanics
public CharacterKinematics controller;
public Animator animator;
public Health health;
public Flash flash;
public bool controlAllowed = true;
public float runSpeed = 40f;
float horizontalMovement = 0f;
@ -48,11 +51,18 @@ namespace Pink.Mechanics
{
animator.SetTrigger("hurt");
}
StartCoroutine(Simulation.GetModel<EnvironmentModel>().virtualCamera.GetComponent<Shake>().Run(400f, 6f, 9f));
StartCoroutine(flash.Run(3, 60, 60, 1f));
}
public void WasHealed()
{
animator.SetTrigger("");
}
public void WasKilled()
{
animator.SetBool("dead", true);
}
}
}

View File

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

View File

@ -0,0 +1,24 @@
using System.Collections;
using UnityEngine;
using UnityEngine.Experimental.Rendering.Universal;
using Cinemachine;
namespace Pink.Graphics
{
public class Flash : MonoBehaviour
{
public Light2D flasher;
public IEnumerator Run(int count = 5, float upTime = 100f, float downTime = 100f, float intensity = 1)
{
for(int i = 0; i < count; i++)
{
flasher.intensity = intensity;
yield return new WaitForSeconds(upTime / 1000f);
flasher.intensity = 0;
yield return new WaitForSeconds(downTime / 1000f);
}
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 48a7c389a7398304eb48829dd011aaa1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,24 @@
using System.Collections;
using UnityEngine;
using Cinemachine;
namespace Pink.Graphics
{
public class Shake : MonoBehaviour
{
public IEnumerator Run(float duration, float amplitude = .5f, float frequency = 10f)
{
var cam = GetComponent<Cinemachine.CinemachineVirtualCamera>();
var profile = cam.GetCinemachineComponent<CinemachineBasicMultiChannelPerlin>();
profile.m_AmplitudeGain = amplitude;
profile.m_FrequencyGain = frequency;
yield return new WaitForSeconds(duration / 1000f);
profile.m_AmplitudeGain = 0f;
profile.m_FrequencyGain = 0f;
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: dc8a31b24b6fb9f468cb54fe154db56d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

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

View File

@ -0,0 +1,25 @@
using Pink.Environment;
namespace Pink.Timeline
{
class PlayerDeath : Simulation.Event
{
EnvironmentModel state = Simulation.GetModel<EnvironmentModel>();
public override void Execute()
{
if (state.player.health.IsAlive)
{
state.player.health.Die();
state.player.controlAllowed = false;
state.virtualCamera.m_Follow = null;
state.virtualCamera.m_LookAt = null;
state.player.animator.SetTrigger("hurt");
state.player.animator.SetBool("dead", true);
//Simulation.Schedule<PlayerSpawn>(2);
}
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 092f46e2da098d7498af9818baa8cb72
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,23 @@
using Pink.Environment;
namespace Pink.Timeline
{
public class PlayerSpawn : Simulation.Event<PlayerSpawn>
{
EnvironmentModel state = Simulation.GetModel<EnvironmentModel>();
public override void Execute()
{
//player.collider2d.enabled = true;
state.player.controlAllowed = true;
state.player.health.Reset();
//state.player.Teleport(state.spawnPoint.transform.position);
state.player.animator.SetBool("dead", false);
state.virtualCamera.m_Follow = state.player.transform;
state.virtualCamera.m_LookAt = state.player.transform;
//Simulation.Schedule<EnablePlayerInput>(2f);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 33113f971474933478ba077e36ca02c1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

6
README.md Normal file
View File

@ -0,0 +1,6 @@
Pink
============
Practicing 2D Unity development with a platformer testbed.
Using ******, ***Hero Knight*** and ***Sunnyland***.