diff --git a/.gitignore b/.gitignore index 0210746..675adfb 100644 --- a/.gitignore +++ b/.gitignore @@ -5,9 +5,16 @@ [Bb]uilds/ Assets/AssetStoreTools* +*.swp + # Visual Studio cache directory .vs/ +Pop Pixie/Assets/TextMesh Pro +Pop Pixie/Assets/TextMesh Pro.meta +Pop Pixie/Assets/Rewired +Pop Pixie/Assets/Rewired.meta + # Autogenerated VS/MD/Consulo solution and project files ExportedObj/ .consulo/ diff --git a/Pop Pixie/Assets/Core Scripts/Game Over.meta b/Pop Pixie/Assets/Animations.meta similarity index 77% rename from Pop Pixie/Assets/Core Scripts/Game Over.meta rename to Pop Pixie/Assets/Animations.meta index c384900..69922c9 100644 --- a/Pop Pixie/Assets/Core Scripts/Game Over.meta +++ b/Pop Pixie/Assets/Animations.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 001a614cd7b3d4b9da403f8266eb6d04 +guid: 72c297d1b66e9416ca608e7146e451a9 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Pop Pixie/Assets/Core Scripts/Main Menu.meta b/Pop Pixie/Assets/Animations/Gremlin.meta similarity index 77% rename from Pop Pixie/Assets/Core Scripts/Main Menu.meta rename to Pop Pixie/Assets/Animations/Gremlin.meta index ce88569..f43db07 100644 --- a/Pop Pixie/Assets/Core Scripts/Main Menu.meta +++ b/Pop Pixie/Assets/Animations/Gremlin.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d9e876dfdfed44b9b902c6ba7d52fc75 +guid: 04863af3e5e1741dd81a16834a3910de folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Pop Pixie/Assets/Animations/Gremlin/Enemy.controller b/Pop Pixie/Assets/Animations/Gremlin/Enemy.controller new file mode 100644 index 0000000..8daa17e --- /dev/null +++ b/Pop Pixie/Assets/Animations/Gremlin/Enemy.controller @@ -0,0 +1,370 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Enemy + serializedVersion: 5 + m_AnimatorParameters: + - m_Name: Facing + m_Type: 3 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 9100000} + - m_Name: Walking + m_Type: 4 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 9100000} + - m_Name: Movement Direction + m_Type: 3 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 9100000} + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Movement + m_StateMachine: {fileID: 1107435943891301792} + 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} + - serializedVersion: 5 + m_Name: Facing + m_StateMachine: {fileID: 1107013262491717202} + 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 &1101298514240068674 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 6 + m_ConditionEvent: Facing + m_EventTreshold: -1 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 1102655350034757798} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.05 + m_TransitionOffset: 0 + m_ExitTime: 0.75 + m_HasExitTime: 0 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1101 &1101655982543847220 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 6 + m_ConditionEvent: Facing + m_EventTreshold: 1 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 1102146019942597110} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.05 + m_TransitionOffset: 0 + m_ExitTime: 0.75 + m_HasExitTime: 0 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1101 &1101767611515328118 +AnimatorStateTransition: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 2 + m_ConditionEvent: Walking + m_EventTreshold: 0 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 1102668432670060150} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.05 + m_TransitionOffset: 0 + m_ExitTime: 0.48275864 + m_HasExitTime: 0 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1101 &1101918826138489634 +AnimatorStateTransition: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 1 + m_ConditionEvent: Walking + m_EventTreshold: 0 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 1102029378562444834} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.05 + m_TransitionOffset: 0 + m_ExitTime: 0.75 + m_HasExitTime: 0 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1102 &1102029378562444834 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Walk + m_Speed: 0.85 + m_CycleOffset: 0 + m_Transitions: + - {fileID: 1101767611515328118} + 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: 24ef56ad45e734f29a3a45743ac549ee, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1102 &1102146019942597110 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Face Right + m_Speed: 1 + 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: 08aded571cebf46e9adf6f55a373d9ba, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1102 &1102254056835219854 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Idle 0 + m_Speed: 1 + 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: 415dd08081fd94e0fbc6df86b1fce05e, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1102 &1102363763444160442 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: idle + m_Speed: 1 + 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: 0} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1102 &1102655350034757798 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Face Left + m_Speed: 1 + 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: 93c6cb7f91a4f4cec8c77cb589f658e0, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1102 &1102668432670060150 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Idle + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: + - {fileID: 1101918826138489634} + 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: 415dd08081fd94e0fbc6df86b1fce05e, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1107 &1107013262491717202 +AnimatorStateMachine: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Facing + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: 1102655350034757798} + m_Position: {x: 360, y: 192, z: 0} + - serializedVersion: 1 + m_State: {fileID: 1102146019942597110} + m_Position: {x: 360, y: 0, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: + - {fileID: 1101298514240068674} + - {fileID: 1101655982543847220} + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 120, y: 108, z: 0} + m_EntryPosition: {x: 312, y: -216, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 1102146019942597110} +--- !u!1107 &1107435943891301792 +AnimatorStateMachine: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Movement + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: 1102668432670060150} + m_Position: {x: 468, y: -168, z: 0} + - serializedVersion: 1 + m_State: {fileID: 1102029378562444834} + m_Position: {x: 492, y: 192, z: 0} + - serializedVersion: 1 + m_State: {fileID: 1102363763444160442} + m_Position: {x: 527, y: 257, z: 0} + - serializedVersion: 1 + m_State: {fileID: 1102254056835219854} + m_Position: {x: 562, y: 322, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 84, y: -192, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 1102668432670060150} diff --git a/Pop Pixie/Assets/Prefabs/GameDataController.prefab.meta b/Pop Pixie/Assets/Animations/Gremlin/Enemy.controller.meta similarity index 63% rename from Pop Pixie/Assets/Prefabs/GameDataController.prefab.meta rename to Pop Pixie/Assets/Animations/Gremlin/Enemy.controller.meta index 83d2393..e30ca9d 100644 --- a/Pop Pixie/Assets/Prefabs/GameDataController.prefab.meta +++ b/Pop Pixie/Assets/Animations/Gremlin/Enemy.controller.meta @@ -1,8 +1,8 @@ fileFormatVersion: 2 -guid: c81bc849cad7b40a5a8b41703d026e9d +guid: 14e960006cb32448cbd1ddb91cb9d0d6 NativeFormatImporter: externalObjects: {} - mainObjectFileID: 100100000 + mainObjectFileID: 9100000 userData: assetBundleName: assetBundleVariant: diff --git a/Pop Pixie/Assets/Animations/Gremlin/Face Left.anim b/Pop Pixie/Assets/Animations/Gremlin/Face Left.anim new file mode 100644 index 0000000..a836c37 --- /dev/null +++ b/Pop Pixie/Assets/Animations/Gremlin/Face Left.anim @@ -0,0 +1,116 @@ +%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: Face Left + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_FlipX + path: Sprite + classID: 212 + script: {fileID: 0} + m_PPtrCurves: [] + 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: 850496168 + attribute: 555744692 + script: {fileID: 0} + typeID: 212 + customType: 0 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + 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: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_FlipX + path: Sprite + classID: 212 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Pop Pixie/Assets/Animations/Gremlin/Face Left.anim.meta b/Pop Pixie/Assets/Animations/Gremlin/Face Left.anim.meta new file mode 100644 index 0000000..365068f --- /dev/null +++ b/Pop Pixie/Assets/Animations/Gremlin/Face Left.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 93c6cb7f91a4f4cec8c77cb589f658e0 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Animations/Gremlin/Face Right.anim b/Pop Pixie/Assets/Animations/Gremlin/Face Right.anim new file mode 100644 index 0000000..e0ac9de --- /dev/null +++ b/Pop Pixie/Assets/Animations/Gremlin/Face Right.anim @@ -0,0 +1,116 @@ +%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: Face Right + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_FlipX + path: Sprite + classID: 212 + script: {fileID: 0} + m_PPtrCurves: [] + 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: 850496168 + attribute: 555744692 + script: {fileID: 0} + typeID: 212 + customType: 0 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + 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: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_FlipX + path: Sprite + classID: 212 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Pop Pixie/Assets/Animations/Gremlin/Face Right.anim.meta b/Pop Pixie/Assets/Animations/Gremlin/Face Right.anim.meta new file mode 100644 index 0000000..7bac565 --- /dev/null +++ b/Pop Pixie/Assets/Animations/Gremlin/Face Right.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 08aded571cebf46e9adf6f55a373d9ba +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Animations/Gremlin/Idle.anim b/Pop Pixie/Assets/Animations/Gremlin/Idle.anim new file mode 100644 index 0000000..9ef73ad --- /dev/null +++ b/Pop Pixie/Assets/Animations/Gremlin/Idle.anim @@ -0,0 +1,71 @@ +%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: Idle + 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: 21300000, guid: 49889b9b674184340bf9d19b77e15a98, type: 3} + - time: 1 + value: {fileID: 21300000, guid: 49889b9b674184340bf9d19b77e15a98, type: 3} + attribute: m_Sprite + path: Sprite + 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: 850496168 + attribute: 0 + script: {fileID: 0} + typeID: 212 + customType: 23 + isPPtrCurve: 1 + pptrCurveMapping: + - {fileID: 21300000, guid: 49889b9b674184340bf9d19b77e15a98, type: 3} + - {fileID: 21300000, guid: 49889b9b674184340bf9d19b77e15a98, type: 3} + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1.0166667 + 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: [] diff --git a/Pop Pixie/Assets/Animations/Gremlin/Idle.anim.meta b/Pop Pixie/Assets/Animations/Gremlin/Idle.anim.meta new file mode 100644 index 0000000..9ff6eaa --- /dev/null +++ b/Pop Pixie/Assets/Animations/Gremlin/Idle.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 415dd08081fd94e0fbc6df86b1fce05e +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Animations/Gremlin/Walk.anim b/Pop Pixie/Assets/Animations/Gremlin/Walk.anim new file mode 100644 index 0000000..1ebf412 --- /dev/null +++ b/Pop Pixie/Assets/Animations/Gremlin/Walk.anim @@ -0,0 +1,80 @@ +%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: Walk + 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: 21300000, guid: 49889b9b674184340bf9d19b77e15a98, type: 3} + - time: 0.11666667 + value: {fileID: 21300002, guid: 49889b9b674184340bf9d19b77e15a98, type: 3} + - time: 0.23333333 + value: {fileID: 21300000, guid: 49889b9b674184340bf9d19b77e15a98, type: 3} + - time: 0.35 + value: {fileID: 21300004, guid: 49889b9b674184340bf9d19b77e15a98, type: 3} + - time: 0.46666667 + value: {fileID: 21300000, guid: 49889b9b674184340bf9d19b77e15a98, type: 3} + attribute: m_Sprite + path: Sprite + 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: 850496168 + attribute: 0 + script: {fileID: 0} + typeID: 212 + customType: 23 + isPPtrCurve: 1 + pptrCurveMapping: + - {fileID: 21300000, guid: 49889b9b674184340bf9d19b77e15a98, type: 3} + - {fileID: 21300002, guid: 49889b9b674184340bf9d19b77e15a98, type: 3} + - {fileID: 21300000, guid: 49889b9b674184340bf9d19b77e15a98, type: 3} + - {fileID: 21300004, guid: 49889b9b674184340bf9d19b77e15a98, type: 3} + - {fileID: 21300000, guid: 49889b9b674184340bf9d19b77e15a98, type: 3} + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 0.48333335 + 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: [] diff --git a/Pop Pixie/Assets/Animations/Gremlin/Walk.anim.meta b/Pop Pixie/Assets/Animations/Gremlin/Walk.anim.meta new file mode 100644 index 0000000..e8aa515 --- /dev/null +++ b/Pop Pixie/Assets/Animations/Gremlin/Walk.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 24ef56ad45e734f29a3a45743ac549ee +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Animations/Pixie.meta b/Pop Pixie/Assets/Animations/Pixie.meta new file mode 100644 index 0000000..ef6c053 --- /dev/null +++ b/Pop Pixie/Assets/Animations/Pixie.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 19165b5a6fa8b401e91203cba45839ba +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Animations/Pixie/Face Left.anim b/Pop Pixie/Assets/Animations/Pixie/Face Left.anim new file mode 100644 index 0000000..4936ce1 --- /dev/null +++ b/Pop Pixie/Assets/Animations/Pixie/Face Left.anim @@ -0,0 +1,242 @@ +%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: Face Left + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_FlipX + path: Sprite Group/Equipped Weapon + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_FlipX + path: Sprite Group/Fist + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_FlipX + path: Sprite Group/Sprite + classID: 212 + script: {fileID: 0} + m_PPtrCurves: [] + 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: 3201617085 + attribute: 555744692 + script: {fileID: 0} + typeID: 212 + customType: 0 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 946674555 + attribute: 555744692 + script: {fileID: 0} + typeID: 212 + customType: 0 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 3814022139 + attribute: 555744692 + script: {fileID: 0} + typeID: 212 + customType: 0 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 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: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_FlipX + path: Sprite Group/Equipped Weapon + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_FlipX + path: Sprite Group/Fist + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_FlipX + path: Sprite Group/Sprite + classID: 212 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Pop Pixie/Assets/Animations/Pixie/Face Left.anim.meta b/Pop Pixie/Assets/Animations/Pixie/Face Left.anim.meta new file mode 100644 index 0000000..19fbb4b --- /dev/null +++ b/Pop Pixie/Assets/Animations/Pixie/Face Left.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bb14aa829285243789f9ced0d8a53fb1 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Animations/Pixie/Face Right.anim b/Pop Pixie/Assets/Animations/Pixie/Face Right.anim new file mode 100644 index 0000000..f616977 --- /dev/null +++ b/Pop Pixie/Assets/Animations/Pixie/Face Right.anim @@ -0,0 +1,242 @@ +%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: Face Right + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_FlipX + path: Sprite Group/Equipped Weapon + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_FlipX + path: Sprite Group/Fist + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_FlipX + path: Sprite Group/Sprite + classID: 212 + script: {fileID: 0} + m_PPtrCurves: [] + 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: 3201617085 + attribute: 555744692 + script: {fileID: 0} + typeID: 212 + customType: 0 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 946674555 + attribute: 555744692 + script: {fileID: 0} + typeID: 212 + customType: 0 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 3814022139 + attribute: 555744692 + script: {fileID: 0} + typeID: 212 + customType: 0 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 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: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_FlipX + path: Sprite Group/Equipped Weapon + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_FlipX + path: Sprite Group/Fist + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_FlipX + path: Sprite Group/Sprite + classID: 212 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Pop Pixie/Assets/Animations/Pixie/Face Right.anim.meta b/Pop Pixie/Assets/Animations/Pixie/Face Right.anim.meta new file mode 100644 index 0000000..5aee253 --- /dev/null +++ b/Pop Pixie/Assets/Animations/Pixie/Face Right.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f4d416b1a17634e00bccb10fe0aaee5f +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Animations/Pixie/Idle.anim b/Pop Pixie/Assets/Animations/Pixie/Idle.anim new file mode 100644 index 0000000..42ba5ed --- /dev/null +++ b/Pop Pixie/Assets/Animations/Pixie/Idle.anim @@ -0,0 +1,71 @@ +%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: Idle + 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: 21300000, guid: a1102afe6498b4cd49da0d9cff4a20b0, type: 3} + - time: 1 + value: {fileID: 21300000, guid: a1102afe6498b4cd49da0d9cff4a20b0, type: 3} + attribute: m_Sprite + path: Sprite Group/Sprite + 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: 3814022139 + attribute: 0 + script: {fileID: 0} + typeID: 212 + customType: 23 + isPPtrCurve: 1 + pptrCurveMapping: + - {fileID: 21300000, guid: a1102afe6498b4cd49da0d9cff4a20b0, type: 3} + - {fileID: 21300000, guid: a1102afe6498b4cd49da0d9cff4a20b0, type: 3} + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1.0166667 + 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: [] diff --git a/Pop Pixie/Assets/Animations/Pixie/Idle.anim.meta b/Pop Pixie/Assets/Animations/Pixie/Idle.anim.meta new file mode 100644 index 0000000..ba9d74d --- /dev/null +++ b/Pop Pixie/Assets/Animations/Pixie/Idle.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f637bff5e3fb64771a9265307b9bf239 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Animations/Pixie/Pixie.controller b/Pop Pixie/Assets/Animations/Pixie/Pixie.controller new file mode 100644 index 0000000..487fd31 --- /dev/null +++ b/Pop Pixie/Assets/Animations/Pixie/Pixie.controller @@ -0,0 +1,802 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Pixie + serializedVersion: 5 + m_AnimatorParameters: + - m_Name: Roll + m_Type: 9 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 0} + - m_Name: Facing + m_Type: 3 + m_DefaultFloat: 0 + m_DefaultInt: -1 + m_DefaultBool: 0 + m_Controller: {fileID: 0} + - m_Name: Walking + m_Type: 4 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 0} + - m_Name: Movement Direction + m_Type: 3 + m_DefaultFloat: 0 + m_DefaultInt: -1 + m_DefaultBool: 0 + m_Controller: {fileID: 0} + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Movement + m_StateMachine: {fileID: 1107405238008776448} + 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} + - serializedVersion: 5 + m_Name: Facing + m_StateMachine: {fileID: 1107314969806426136} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 1 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1101 &1101115021732267868 +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: Roll + m_EventTreshold: 0 + - m_ConditionMode: 6 + m_ConditionEvent: Movement Direction + m_EventTreshold: -1 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 1102610982503493926} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.05 + m_TransitionOffset: 0 + m_ExitTime: 0.75 + m_HasExitTime: 0 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1101 &1101179036786693610 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 6 + m_ConditionEvent: Facing + m_EventTreshold: -1 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 1102407420394815616} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.05 + m_TransitionOffset: 0 + m_ExitTime: 1 + m_HasExitTime: 0 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1101 &1101310038293617748 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 2 + m_ConditionEvent: Walking + m_EventTreshold: 0 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 1102786907866273502} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.05 + m_TransitionOffset: 0 + m_ExitTime: 1 + m_HasExitTime: 1 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1101 &1101334233611094192 +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: Walking + m_EventTreshold: 0 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 1102081118456732528} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.05 + m_TransitionOffset: 0 + m_ExitTime: 1 + m_HasExitTime: 1 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1101 &1101494826855798356 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: [] + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 1102081118456732528} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0 + m_HasExitTime: 1 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1101 &1101518797540286276 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: [] + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 1102689350678029842} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.75 + m_HasExitTime: 1 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1101 &1101540560943861130 +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: Walking + m_EventTreshold: 0 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 1102081118456732528} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.05 + m_TransitionOffset: 0 + m_ExitTime: 1 + m_HasExitTime: 1 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1101 &1101635729487214546 +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: Roll + m_EventTreshold: 0 + - m_ConditionMode: 3 + m_ConditionEvent: Movement Direction + m_EventTreshold: -1 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 1102689350678029842} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.05 + m_TransitionOffset: 0 + m_ExitTime: 0.75 + m_HasExitTime: 0 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1101 &1101695289293886554 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 2 + m_ConditionEvent: Walking + m_EventTreshold: 0 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 1102786907866273502} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.05 + m_TransitionOffset: 0 + m_ExitTime: 1 + m_HasExitTime: 1 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1101 &1101724194003980880 +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: Walking + m_EventTreshold: 0 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 1102081118456732528} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.05 + m_TransitionOffset: 0 + m_ExitTime: 0.75 + m_HasExitTime: 0 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1101 &1101730674856373792 +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: Roll + m_EventTreshold: 0 + - m_ConditionMode: 3 + m_ConditionEvent: Movement Direction + m_EventTreshold: -1 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 1102689350678029842} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.05 + m_TransitionOffset: 0 + m_ExitTime: 0.48275864 + m_HasExitTime: 0 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1101 &1101821374620164304 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 6 + m_ConditionEvent: Facing + m_EventTreshold: 1 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 1102579692040285120} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.05 + m_TransitionOffset: 0 + m_ExitTime: 1 + m_HasExitTime: 0 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1101 &1101907505297217262 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: [] + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 1102689350678029842} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0 + m_HasExitTime: 1 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1101 &1101918710963358816 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 2 + m_ConditionEvent: Walking + m_EventTreshold: 0 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 1102786907866273502} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.05 + m_TransitionOffset: 0 + m_ExitTime: 0.48275864 + m_HasExitTime: 0 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1101 &1101920252656100318 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: [] + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 1102786907866273502} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0 + m_HasExitTime: 1 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1101 &1101927146675117450 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: [] + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 1102786907866273502} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.75 + m_HasExitTime: 1 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1101 &1101969695937640678 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: [] + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 1102786907866273502} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0 + m_HasExitTime: 1 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1101 &1101971299757137064 +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: Roll + m_EventTreshold: 0 + - m_ConditionMode: 6 + m_ConditionEvent: Movement Direction + m_EventTreshold: -1 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 1102610982503493926} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.05 + m_TransitionOffset: 0 + m_ExitTime: 0.48275864 + m_HasExitTime: 0 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1101 &1101994676687660116 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: [] + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 1102689350678029842} + 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 &1102081118456732528 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Walk + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: + - {fileID: 1101918710963358816} + - {fileID: 1101971299757137064} + - {fileID: 1101730674856373792} + 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: 76bb15c7d4c504fe5b992714b7790475, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1102 &1102363540195610600 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Face Left + m_Speed: 1 + 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: bb14aa829285243789f9ced0d8a53fb1, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1102 &1102407420394815616 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Face Left + m_Speed: 1 + 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: bb14aa829285243789f9ced0d8a53fb1, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1102 &1102579692040285120 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Face Right + m_Speed: 1 + 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: f4d416b1a17634e00bccb10fe0aaee5f, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1102 &1102610982503493926 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Roll Left + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: + - {fileID: 1101695289293886554} + - {fileID: 1101334233611094192} + 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: 32b1da49801464a89a772e5126ce78b3, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1102 &1102632461281427520 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Face Right + m_Speed: 1 + 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: f4d416b1a17634e00bccb10fe0aaee5f, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1102 &1102689350678029842 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Roll Right + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: + - {fileID: 1101310038293617748} + - {fileID: 1101540560943861130} + 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: 0d553f096da784a1593422f654b9952a, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1102 &1102786907866273502 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Idle + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: + - {fileID: 1101724194003980880} + - {fileID: 1101115021732267868} + - {fileID: 1101635729487214546} + 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: f637bff5e3fb64771a9265307b9bf239, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1107 &1107314969806426136 +AnimatorStateMachine: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Facing + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: 1102407420394815616} + m_Position: {x: 552, y: 120, z: 0} + - serializedVersion: 1 + m_State: {fileID: 1102579692040285120} + m_Position: {x: 540, y: -60, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: + - {fileID: 1101821374620164304} + - {fileID: 1101179036786693610} + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 432, y: 48, z: 0} + m_EntryPosition: {x: 0, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 1102579692040285120} +--- !u!1107 &1107405238008776448 +AnimatorStateMachine: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Movement + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: 1102689350678029842} + m_Position: {x: 732, y: 240, z: 0} + - serializedVersion: 1 + m_State: {fileID: 1102786907866273502} + m_Position: {x: 288, y: 264, z: 0} + - serializedVersion: 1 + m_State: {fileID: 1102610982503493926} + m_Position: {x: 240, y: -36, z: 0} + - serializedVersion: 1 + m_State: {fileID: 1102081118456732528} + m_Position: {x: 576, y: -96, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 324, y: 480, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 984, y: 72, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 1102786907866273502} diff --git a/Pop Pixie/Assets/Animations/Pixie/Pixie.controller.meta b/Pop Pixie/Assets/Animations/Pixie/Pixie.controller.meta new file mode 100644 index 0000000..c29928f --- /dev/null +++ b/Pop Pixie/Assets/Animations/Pixie/Pixie.controller.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c3556559251fd465986c8253d8db2c75 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Animations/Pixie/Roll Left.anim b/Pop Pixie/Assets/Animations/Pixie/Roll Left.anim new file mode 100644 index 0000000..ce78698 --- /dev/null +++ b/Pop Pixie/Assets/Animations/Pixie/Roll Left.anim @@ -0,0 +1,199 @@ +%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: Roll Left + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: {x: 0, y: 0, z: -360} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 0.25 + value: {x: 0, y: 0, z: 0} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + path: Sprite Group + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + 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: 1349852152 + attribute: 4 + script: {fileID: 0} + typeID: 4 + customType: 4 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 0.25 + 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: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.25 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.x + path: Sprite Group + classID: 4 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.25 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.y + path: Sprite Group + classID: 4 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -360 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.25 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.z + path: Sprite Group + classID: 4 + script: {fileID: 0} + m_EulerEditorCurves: + - curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.z + path: Sprite Group + classID: 4 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.y + path: Sprite Group + classID: 4 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.x + path: Sprite Group + classID: 4 + script: {fileID: 0} + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Pop Pixie/Assets/Animations/Pixie/Roll Left.anim.meta b/Pop Pixie/Assets/Animations/Pixie/Roll Left.anim.meta new file mode 100644 index 0000000..b320cbd --- /dev/null +++ b/Pop Pixie/Assets/Animations/Pixie/Roll Left.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 32b1da49801464a89a772e5126ce78b3 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Animations/Pixie/Roll Right.anim b/Pop Pixie/Assets/Animations/Pixie/Roll Right.anim new file mode 100644 index 0000000..ca48bb6 --- /dev/null +++ b/Pop Pixie/Assets/Animations/Pixie/Roll Right.anim @@ -0,0 +1,199 @@ +%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: Roll Right + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: {x: 0, y: 0, z: 360} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 0.25 + value: {x: 0, y: 0, z: 0} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + path: Sprite Group + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + 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: 1349852152 + attribute: 4 + script: {fileID: 0} + typeID: 4 + customType: 4 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 0.25 + 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: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.25 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.x + path: Sprite Group + classID: 4 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.25 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.y + path: Sprite Group + classID: 4 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 360 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.25 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: localEulerAnglesRaw.z + path: Sprite Group + classID: 4 + script: {fileID: 0} + m_EulerEditorCurves: + - curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.z + path: Sprite Group + classID: 4 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.y + path: Sprite Group + classID: 4 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalEulerAngles.x + path: Sprite Group + classID: 4 + script: {fileID: 0} + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Pop Pixie/Assets/Animations/Pixie/Roll Right.anim.meta b/Pop Pixie/Assets/Animations/Pixie/Roll Right.anim.meta new file mode 100644 index 0000000..bd4ec74 --- /dev/null +++ b/Pop Pixie/Assets/Animations/Pixie/Roll Right.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0d553f096da784a1593422f654b9952a +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Animations/Pixie/Walk.anim b/Pop Pixie/Assets/Animations/Pixie/Walk.anim new file mode 100644 index 0000000..bc63016 --- /dev/null +++ b/Pop Pixie/Assets/Animations/Pixie/Walk.anim @@ -0,0 +1,170 @@ +%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: Walk + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1.0148515 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_Size.x + path: Sprite Group/Sprite + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1.4752475 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_Size.y + path: Sprite Group/Sprite + classID: 212 + script: {fileID: 0} + m_PPtrCurves: + - curve: + - time: 0 + value: {fileID: 21300000, guid: a1102afe6498b4cd49da0d9cff4a20b0, type: 3} + - time: 0.11666667 + value: {fileID: 21300002, guid: a1102afe6498b4cd49da0d9cff4a20b0, type: 3} + - time: 0.23333333 + value: {fileID: 21300000, guid: a1102afe6498b4cd49da0d9cff4a20b0, type: 3} + - time: 0.35 + value: {fileID: 21300004, guid: a1102afe6498b4cd49da0d9cff4a20b0, type: 3} + - time: 0.46666667 + value: {fileID: 21300000, guid: a1102afe6498b4cd49da0d9cff4a20b0, type: 3} + attribute: m_Sprite + path: Sprite Group/Sprite + 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: 3814022139 + attribute: 0 + script: {fileID: 0} + typeID: 212 + customType: 23 + isPPtrCurve: 1 + - serializedVersion: 2 + path: 3814022139 + attribute: 4197328169 + script: {fileID: 0} + typeID: 212 + customType: 0 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 3814022139 + attribute: 2368279999 + script: {fileID: 0} + typeID: 212 + customType: 0 + isPPtrCurve: 0 + pptrCurveMapping: + - {fileID: 21300000, guid: a1102afe6498b4cd49da0d9cff4a20b0, type: 3} + - {fileID: 21300002, guid: a1102afe6498b4cd49da0d9cff4a20b0, type: 3} + - {fileID: 21300000, guid: a1102afe6498b4cd49da0d9cff4a20b0, type: 3} + - {fileID: 21300004, guid: a1102afe6498b4cd49da0d9cff4a20b0, type: 3} + - {fileID: 21300000, guid: a1102afe6498b4cd49da0d9cff4a20b0, type: 3} + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 0.48333335 + 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: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1.0148515 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_Size.x + path: Sprite Group/Sprite + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1.4752475 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_Size.y + path: Sprite Group/Sprite + classID: 212 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Pop Pixie/Assets/Animations/Pixie/Walk.anim.meta b/Pop Pixie/Assets/Animations/Pixie/Walk.anim.meta new file mode 100644 index 0000000..538fd0d --- /dev/null +++ b/Pop Pixie/Assets/Animations/Pixie/Walk.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 76bb15c7d4c504fe5b992714b7790475 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Audio Mixers/Master.mixer b/Pop Pixie/Assets/Audio Mixers/Master.mixer index c58228a..f910a0e 100644 --- a/Pop Pixie/Assets/Audio Mixers/Master.mixer +++ b/Pop Pixie/Assets/Audio Mixers/Master.mixer @@ -36,7 +36,6 @@ AudioMixerGroupController: m_Pitch: d06872f66dc744db8ac54138af6f648b m_Effects: - {fileID: 24400004} - - {fileID: 244499359039970222} m_UserColorIndex: 0 m_Mute: 0 m_Solo: 0 @@ -88,28 +87,6 @@ AudioMixerSnapshotController: 558516ad4654d47a9bd5eb58fefb0010: 50 1646a1bf98d3a404684eecba7e656247: 10 m_TransitionOverrides: {} ---- !u!244 &244499359039970222 -AudioMixerEffectController: - m_ObjectHideFlags: 3 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: - m_EffectID: 2f020f2287a32498ca811fdc10e55f2a - m_EffectName: Compressor - m_MixLevel: a82c0b1446bba4468810292794256002 - m_Parameters: - - m_ParameterName: Threshold - m_GUID: 9bde60f79619c4e299ff498855dec30d - - m_ParameterName: Attack - m_GUID: 558516ad4654d47a9bd5eb58fefb0010 - - m_ParameterName: Release - m_GUID: 0275d3b8f795e46679be66ec7a3ac201 - - m_ParameterName: Make up gain - m_GUID: 8cd78ee1484fe42729519a27d0ca7dcb - m_SendTarget: {fileID: 0} - m_EnableWetMix: 0 - m_Bypass: 0 --- !u!244 &244849272157447204 AudioMixerEffectController: m_ObjectHideFlags: 3 diff --git a/Pop Pixie/Assets/Core Scripts/Controls.meta b/Pop Pixie/Assets/Core Scripts/Controls.meta new file mode 100644 index 0000000..66dec15 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Controls.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 46c027eb037a14d8f8717f59e304e285 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Controls/ControllerTypeData.cs b/Pop Pixie/Assets/Core Scripts/Controls/ControllerTypeData.cs new file mode 100644 index 0000000..62648da --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Controls/ControllerTypeData.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class ControllerTypeData { + + public static void SetControllerType( string type ) { + ConfigData.Current.Set( "controller-type", type ); + } + + public static String GetControllerType() { + return ConfigData.Current.Fetch( "controller-type", orSetEqualTo: "Xbox" ); + } + +} diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/EnemyAI.cs.meta b/Pop Pixie/Assets/Core Scripts/Controls/ControllerTypeData.cs.meta similarity index 83% rename from Pop Pixie/Assets/Core Scripts/Enemy/EnemyAI.cs.meta rename to Pop Pixie/Assets/Core Scripts/Controls/ControllerTypeData.cs.meta index 9bbb69c..30e8f66 100644 --- a/Pop Pixie/Assets/Core Scripts/Enemy/EnemyAI.cs.meta +++ b/Pop Pixie/Assets/Core Scripts/Controls/ControllerTypeData.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: cb6960d0f1aaa457cb3d3dc46374f48f +guid: cb97572b7e5ec4cb5837f75fbaf1b939 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Pop Pixie/Assets/Core Scripts/Controls/WrappedBaseInput.cs b/Pop Pixie/Assets/Core Scripts/Controls/WrappedBaseInput.cs new file mode 100644 index 0000000..0ba2a6c --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Controls/WrappedBaseInput.cs @@ -0,0 +1,26 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.EventSystems; + +public class WrappedBaseInput : BaseInput { + + public StandaloneInputModule StandaloneInputModule; + + protected override void Awake() { + StandaloneInputModule.inputOverride = this; + } + + public override bool GetButtonDown( string button ) { + if ( button == "Horizontal" || button == "Vertical" ) { + return base.GetButtonDown( button ); + } else { + return WrappedInput.GetButtonDown( button ); + } + } + + public override float GetAxisRaw( string axis ) { + return WrappedInput.GetAxis( axis ); + } + +} diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/AttackingAI.cs.meta b/Pop Pixie/Assets/Core Scripts/Controls/WrappedBaseInput.cs.meta similarity index 83% rename from Pop Pixie/Assets/Core Scripts/Enemy/AttackingAI.cs.meta rename to Pop Pixie/Assets/Core Scripts/Controls/WrappedBaseInput.cs.meta index a530a84..0e7144e 100644 --- a/Pop Pixie/Assets/Core Scripts/Enemy/AttackingAI.cs.meta +++ b/Pop Pixie/Assets/Core Scripts/Controls/WrappedBaseInput.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 949bc49a5b9204f35a846bf3b47f24bd +guid: 24483a1fd8a8b457ebbf9c26f3083268 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Pop Pixie/Assets/Core Scripts/Controls/WrappedInput.cs b/Pop Pixie/Assets/Core Scripts/Controls/WrappedInput.cs new file mode 100644 index 0000000..8dc107e --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Controls/WrappedInput.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text.RegularExpressions; +using UnityEngine; +using Rewired; + +public class WrappedInput : MonoBehaviour { + + private static Player Player { + get => ReInput.players.GetPlayer(0); + } + + public static bool GetButton( string buttonName ) { + return Player.GetButton( buttonName ); + } + + public static bool GetButtonDown( string buttonName ) { + return Player.GetButtonDown( buttonName ); + } + + public static float GetAxis( string axis ) { + return Player.GetAxis( axis ); + } + + public static string ControllerPrefix() { + if ( Input.GetJoystickNames().Length > 0 ) { + return ControllerTypeData.GetControllerType(); + } else { + return null; + } + } + +} diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/UnengagedAI.cs.meta b/Pop Pixie/Assets/Core Scripts/Controls/WrappedInput.cs.meta similarity index 83% rename from Pop Pixie/Assets/Core Scripts/Enemy/UnengagedAI.cs.meta rename to Pop Pixie/Assets/Core Scripts/Controls/WrappedInput.cs.meta index b96bba8..3633181 100644 --- a/Pop Pixie/Assets/Core Scripts/Enemy/UnengagedAI.cs.meta +++ b/Pop Pixie/Assets/Core Scripts/Controls/WrappedInput.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 02ef026457de340a3be1d2e47d71c490 +guid: af065ae09fc704df681e5fc9522270b1 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Pop Pixie/Assets/Core Scripts/Dialogue/DialogueBoxController.cs b/Pop Pixie/Assets/Core Scripts/Dialogue/DialogueBoxController.cs index 7ffe53e..ecfc94f 100644 --- a/Pop Pixie/Assets/Core Scripts/Dialogue/DialogueBoxController.cs +++ b/Pop Pixie/Assets/Core Scripts/Dialogue/DialogueBoxController.cs @@ -7,8 +7,10 @@ public class DialogueBoxController : MonoBehaviour { public Text TextBox; public Image FaceImage; - public float InitialDelay; - public float WriteDelay; + public float NormalInitialDelay; + public float FastInitialDelay; + public float NormalWriteDelay; + public float FastWriteDelay; public GameObject DialogueBox; public PromptButtonController PromptButtons; @@ -23,10 +25,9 @@ public void Write (string text, IDialoguePageEventHandler event_handler) { EventHandler = event_handler; CancelInvoke(); - InvokeRepeating( + Invoke( "WriteNextLetter", - InitialDelay, - WriteDelay + InitialDelay() ); } @@ -44,6 +45,27 @@ void WriteNextLetter () { WriteProgress ) ); + + Invoke( + "WriteNextLetter", + WriteDelay() + ); + } + + float InitialDelay() { + if ( WrappedInput.GetButton("Cancel") ) { + return FastInitialDelay; + } else { + return NormalInitialDelay; + } + } + + float WriteDelay() { + if ( WrappedInput.GetButton("Cancel") ) { + return FastWriteDelay; + } else { + return NormalWriteDelay; + } } void DirectWrite (string text) { @@ -71,12 +93,4 @@ public void Hide () { void SetEnabled (bool state) { DialogueBox.SetActive(state); } - - // Use this for initialization - void Start () { - } - - // Update is called once per frame - void Update () { - } } diff --git a/Pop Pixie/Assets/Core Scripts/Dialogue/DialogueManager.cs b/Pop Pixie/Assets/Core Scripts/Dialogue/DialogueManager.cs index 15fcdd8..d1057f2 100644 --- a/Pop Pixie/Assets/Core Scripts/Dialogue/DialogueManager.cs +++ b/Pop Pixie/Assets/Core Scripts/Dialogue/DialogueManager.cs @@ -6,24 +6,27 @@ public class DialogueManager : MonoBehaviour, IDialoguePageEventHandler { public DialogueBoxController DialogueBox; - public AudioSource Player; + public SoundController SoundController; public float InterruptCooldown; + public float SkipCooldown; private DialogueSequence Sequence; private int SequenceProgress; private bool DialogueBoxInProgress; private IDialogueSequenceEventHandler EventHandler; + IntervalTimer SkipCooldownTimer; + bool ButtonReleased; + void ReadPage (DialoguePage page) { DialogueBoxInProgress = true; DialogueBox.Write( page.Text, this ); DialogueBox.SetFace( page.Face() ); if ( page.HasVoiceLine() ) { - Player.clip = page.VoiceLine(); - Player.Play(); + SoundController.Play( page.VoiceLine() ); } else { - Player.Stop(); + SoundController.Stop(); } } @@ -45,16 +48,15 @@ void ReadNextPage () { void Exit () { DialogueBox.Hide(); StateManager.SetState( State.Playing ); - MusicController.Current.SetVolume(1.0f); EventHandler.SequenceFinished(); - Player.Stop(); + SoundController.Stop(); } public void Play (string sequence_name, IDialogueSequenceEventHandler event_handler) { + ButtonReleased = false; DialogueBoxInProgress = false; DialogueBox.Show(); StateManager.SetState( State.Dialogue ); - MusicController.Current.SetVolume(0.25f); string json = Resources.Load(sequence_name).text; Sequence = DialogueSequence.ParseJSON(json); @@ -65,33 +67,43 @@ public void Play (string sequence_name, IDialogueSequenceEventHandler event_hand ReadNextPage(); } - private bool ButtonDown; - void Awake () { DialogueBox.Hide(); } + + void Start () { + SkipCooldownTimer = new IntervalTimer() { + Interval = SkipCooldown + }; + + SkipCooldownTimer.Start(); + } // Update is called once per frame void Update () { if ( StateManager.Isnt( State.Dialogue ) ) return; - if ( Input.GetButton("Submit") ) { - if ( ButtonDown != true ) { - ButtonDown = true; + if ( ButtonReleased && WrappedInput.GetButton("Confirm") ) { + ButtonReleased = false; - if (DialogueBoxInProgress) { - DialogueBox.FinishPage(); - } else { - ReadNextPage(); - } + if (DialogueBoxInProgress) { + DialogueBox.FinishPage(); + } else { + ReadNextPage(); } - } else { - ButtonDown = false; } - if ( Input.GetButton("AbortDialogue") ) { - Exit(); + ButtonReleased = ! WrappedInput.GetButton("Confirm"); + + if ( WrappedInput.GetButton("Cancel") && !DialogueBoxInProgress ) { + ReadNextPage(); + } + + if ( WrappedInput.GetButton("Skip") && SkipCooldownTimer.Elapsed() ) { + SkipCooldownTimer.Reset(); + ReadNextPage(); + DialogueBox.FinishPage(); } } } diff --git a/Pop Pixie/Assets/Core Scripts/Dialogue/DialoguePromptManager.cs b/Pop Pixie/Assets/Core Scripts/Dialogue/DialoguePromptManager.cs index 7f98176..7362932 100644 --- a/Pop Pixie/Assets/Core Scripts/Dialogue/DialoguePromptManager.cs +++ b/Pop Pixie/Assets/Core Scripts/Dialogue/DialoguePromptManager.cs @@ -13,7 +13,6 @@ public class DialoguePromptManager : MonoBehaviour, IDialoguePageEventHandler, I public void Display (string question, string pveAns, string nveAns, IPromptButtonEventHandler event_handler) { StateManager.SetState( State.DialoguePrompt ); - MusicController.Current.SetVolume(0.25f); EventHandler = event_handler; DialogueBox.Show(); @@ -37,20 +36,10 @@ void Exit () { PromptButtons.Hide(); DialogueBox.Hide(); StateManager.SetState( State.Playing ); - MusicController.Current.SetVolume(1.0f); } void Awake () { PromptButtons.Hide(); } - - // Update is called once per frame - void Update () { - if ( StateManager.Isnt( State.DialoguePrompt ) ) - return; - - if ( Input.GetButton("AbortDialogue") ) { - Exit(); - } - } + } diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/AActivator.cs b/Pop Pixie/Assets/Core Scripts/Enemy/AActivator.cs new file mode 100644 index 0000000..01ec203 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/AActivator.cs @@ -0,0 +1,15 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public abstract class AActivator : MonoBehaviour { + + public virtual bool IsActivated( AEnemyAI ai ) { + return IsActivated(); + } + + public virtual bool IsActivated() { + throw new System.NotImplementedException("No implementation provided for IsActivated"); + } + +} diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/CoolingDownAI.cs.meta b/Pop Pixie/Assets/Core Scripts/Enemy/AActivator.cs.meta similarity index 83% rename from Pop Pixie/Assets/Core Scripts/Enemy/CoolingDownAI.cs.meta rename to Pop Pixie/Assets/Core Scripts/Enemy/AActivator.cs.meta index 72db8be..2c9ca31 100644 --- a/Pop Pixie/Assets/Core Scripts/Enemy/CoolingDownAI.cs.meta +++ b/Pop Pixie/Assets/Core Scripts/Enemy/AActivator.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ccbc0fe3e1248403ba75a1233e2585c9 +guid: 344d72af00e9d4e9ea57858977f8acfc MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/AEnemyAI.cs b/Pop Pixie/Assets/Core Scripts/Enemy/AEnemyAI.cs new file mode 100644 index 0000000..5d98e9a --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/AEnemyAI.cs @@ -0,0 +1,101 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public abstract class AEnemyAI : MonoBehaviour { + + public bool StartsInControl; + public bool InControl; + + void Start() { + LocalStart(); + + if ( StartsInControl ) + GainControl(); + } + + public virtual void LocalStart() {} + + public void GainControl() { + InControl = true; + ControlGained(); + } + + void FixedUpdate() { + if ( StateManager.Isnt( State.Playing ) ) + return; + + if ( InControl ) + WhileInControl(); + } + + public void RelinquishControl() { + InControl = false; + ControlRelinquished(); + } + + public virtual void ControlGained() { + } + + public virtual void WhileInControl() { + } + + public virtual void ControlRelinquished() { + } + + void OnCollisionEnter2D( Collision2D col ) { + if ( InControl ) + LocalOnCollisionEnter2D( col ); + } + + public virtual void LocalOnCollisionEnter2D( Collision2D col ) { + } + + // Utility methods + + public void RelinquishControlTo( AEnemyAI ai ) { + RelinquishControl(); + ai.GainControl(); + } + + public void ApplyMovement( Vector2 movement ) { + GetComponent().Movement += movement; + } + + public GameObject Target { + get { return GameObject.FindGameObjectWithTag("Player"); } + } + + public void DamageTarget( float damage ) { + Target.GetComponent().Damage( damage ); + } + + public Vector2 TargetHeading() { + return Target.transform.position - transform.position; + } + + public float TargetDistance() { + return TargetHeading().magnitude; + } + + public Vector2 TargetDirection() { + return TargetHeading().normalized; + } + + public bool LineOfMovement() { + var hit = Physics2D.CircleCast( + transform.position, + WidthRequiredForMovement() / 2, + TargetDirection(), + Mathf.Infinity, + ~( ( 1 << 8 ) | ( 1 << 9 ) ) // <-- neither 8 nor 9 + ); + + return hit.collider.gameObject == Target; + } + + public float WidthRequiredForMovement() { + return 1f; + } + +} diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/AEnemyAI.cs.meta b/Pop Pixie/Assets/Core Scripts/Enemy/AEnemyAI.cs.meta new file mode 100644 index 0000000..8e6d198 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/AEnemyAI.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 49b67d4b261194ae09f10193463d9757 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/AInterrupt.cs b/Pop Pixie/Assets/Core Scripts/Enemy/AInterrupt.cs new file mode 100644 index 0000000..20be400 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/AInterrupt.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +public abstract class AInterrupt : MonoBehaviour { + + void Start() { + LocalStart(); + } + + public virtual void LocalStart() {} + + void Update() { + AEnemyAI ai = GetComponents().Where( x => x.InControl ).FirstOrDefault(); + + if ( ai == null ) + return; + + if ( !OnlyAIsMatching().IsInstanceOfType( ai ) ) + return; + + if ( ShouldInterrupt( ai ) ) + ai.RelinquishControlTo( InterruptAI() ); + } + + public virtual Type OnlyAIsMatching() { + return typeof( AEnemyAI ); + } + + public abstract bool ShouldInterrupt( AEnemyAI ai ); + public abstract AEnemyAI InterruptAI(); + +} diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/AInterrupt.cs.meta b/Pop Pixie/Assets/Core Scripts/Enemy/AInterrupt.cs.meta new file mode 100644 index 0000000..7e0d873 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/AInterrupt.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 260554f3a515447b2a82418ebc96a80b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/AndersonsAlgorithm.cs b/Pop Pixie/Assets/Core Scripts/Enemy/AndersonsAlgorithm.cs index 94874ad..4367ef5 100644 --- a/Pop Pixie/Assets/Core Scripts/Enemy/AndersonsAlgorithm.cs +++ b/Pop Pixie/Assets/Core Scripts/Enemy/AndersonsAlgorithm.cs @@ -97,7 +97,7 @@ private RaycastHit2D ObstacleInDirection(Vector3 direction) { Radius, direction, Mathf.Infinity, - ~( 1 << 8 ) + ~( ( 1 << 8 ) | ( 1 << 9 ) ) // <-- neither 8 nor 9 ); } diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/AttackingAI.cs b/Pop Pixie/Assets/Core Scripts/Enemy/AttackingAI.cs deleted file mode 100644 index 7158fcf..0000000 --- a/Pop Pixie/Assets/Core Scripts/Enemy/AttackingAI.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class AttackingAI : MonoBehaviour { - - public float Speed; - public float Damage; - public SoundController SoundPlayer; - public List Sounds; - - private Rigidbody2D rb; - private GameObject target; - - // Use this for initialization - void Start () { - rb = gameObject.GetComponent(); - target = GameObject.FindGameObjectWithTag("Player"); - } - - // Update is called once per frame - void Update () { - if ( StateManager.Isnt( State.Playing ) ) { - rb.velocity = Vector3.zero; - return; - } - - Vector3 direction = ( target.transform.position - transform.position ).normalized; - rb.MovePosition(transform.position + direction * Speed * Time.deltaTime); - } - - void OnCollisionStay2D (Collision2D col) { - // Make sure AI is enabled - if ( !this.enabled ) - return; - - var obj = col.gameObject; - - // If body is player, - if ( obj.name == "Pixie" ) { - // Do damage - obj.GetComponent().Damage( Damage ); - - // Play attack sound - int i = UnityEngine.Random.Range(0, Sounds.Count); - var sound = Sounds[i]; - SoundPlayer.Play(sound); - - // Clear cooldown timer, ending Attacking AI - gameObject.GetComponent().ResetCoolDownTimer(); - } - } -} diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/ChargingAttackAI.cs b/Pop Pixie/Assets/Core Scripts/Enemy/ChargingAttackAI.cs new file mode 100644 index 0000000..fed783e --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/ChargingAttackAI.cs @@ -0,0 +1,73 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class ChargingAttackAI : AEnemyAI, IRequiresLineOfMovementAI { + + public float Speed; + public float Damage; + public float WiggleAmplitude; + public float PreparingAttackInterval; + public float GiveUpInterval; + + public SoundController SoundPlayer; + public List Sounds; + public float ChanceToPlaySound = 0f; + + public AEnemyAI WhenAttackFinished; + + IntervalTimer PreparingAttackTimer; + IntervalTimer GiveUpTimer; + + public override void ControlGained() { + PreparingAttackTimer = new IntervalTimer() { + Interval = PreparingAttackInterval + }; + + GiveUpTimer = new IntervalTimer() { + Interval = PreparingAttackInterval + GiveUpInterval + }; + + PreparingAttackTimer.Reset(); + GiveUpTimer.Reset(); + } + + public override void WhileInControl() { + var randomAngle = Random.Range( -WiggleAmplitude, WiggleAmplitude ); + transform.rotation = Quaternion.Euler( 0, 0, randomAngle ); + + if ( PreparingAttackTimer.Elapsed() ) + ApplyMovement( TargetDirection() * Speed ); + + if ( GiveUpTimer.Elapsed() ) + RelinquishControlTo( WhenAttackFinished ); + } + + public override void ControlRelinquished() { + transform.rotation = Quaternion.identity; + } + + public override void LocalOnCollisionEnter2D( Collision2D col ) { + if ( col.gameObject == Target ) { + PerformAttack(); + } + } + + void PerformAttack() { + DamageTarget( Damage ); + + if ( ShouldPlaySound() ) { + // Play attack sound + int i = Random.Range(0, Sounds.Count); + var sound = Sounds[i]; + SoundPlayer.Play(sound); + } + + RelinquishControlTo( WhenAttackFinished ); + } + + bool ShouldPlaySound() { + return UnityEngine.Random.value < ChanceToPlaySound; + } + +} diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/ChargingAttackAI.cs.meta b/Pop Pixie/Assets/Core Scripts/Enemy/ChargingAttackAI.cs.meta new file mode 100644 index 0000000..9867c64 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/ChargingAttackAI.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3cf6699b9ea874ff39374a3e2a7ccd18 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/CirclingAroundTargetAI.cs b/Pop Pixie/Assets/Core Scripts/Enemy/CirclingAroundTargetAI.cs new file mode 100644 index 0000000..2cc0d1f --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/CirclingAroundTargetAI.cs @@ -0,0 +1,77 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class CirclingAroundTargetAI : AEnemyAI, IRequiresLineOfMovementAI { + + public float TooFarThreshold, ApproachToDistance; + public float TooCloseThreshold, BackOffToDistance; + + public float ApproachSpeed, BackOffSpeed; + public float CircleSpeed; + + public float AttackInterval; + public float AttackIntervalRandomness; + + public AEnemyAI WhenAttacking; + + bool AdjustingDistance; + int CircleDirection; + + IntervalTimer AttackTimer; + + public override void ControlGained() { + float attackIntervalRandomModifier = Random.Range( + - AttackIntervalRandomness / 2, + AttackIntervalRandomness / 2 + ); + + AttackTimer = new IntervalTimer() { + Interval = AttackInterval + attackIntervalRandomModifier + }; + + AttackTimer.Reset(); + + var random = Random.Range(-1f, 1f); + + if ( random > 0 ) { + CircleDirection = 1; + } else { + CircleDirection = -1; + } + } + + public override void WhileInControl() { + if ( TargetDistance() > TooFarThreshold || TargetDistance() < TooCloseThreshold ) { + AdjustingDistance = true; + } + + if ( AdjustingDistance ) { + + if ( TargetDistance() > ApproachToDistance ) { + ApplyMovement( TargetDirection() * ApproachSpeed ); + } else if ( TargetDistance() < BackOffToDistance ) { + ApplyMovement( - TargetDirection() * BackOffSpeed ); + } else { + AdjustingDistance = false; + } + + } else { + + ApplyMovement( + Vector2.Perpendicular( TargetDirection() ) * CircleSpeed * CircleDirection + ); + + } + + AttackTimer.IfElapsed( + () => RelinquishControlTo( WhenAttacking ) + ); + + } + + public override void LocalOnCollisionEnter2D( Collision2D _ ) { + CircleDirection *= -1; + } + +} diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/CirclingAroundTargetAI.cs.meta b/Pop Pixie/Assets/Core Scripts/Enemy/CirclingAroundTargetAI.cs.meta new file mode 100644 index 0000000..447cfe4 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/CirclingAroundTargetAI.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 120abb17f99f8434da0c055e9dca49b0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/CoolingDownAI.cs b/Pop Pixie/Assets/Core Scripts/Enemy/CoolingDownAI.cs deleted file mode 100644 index 3e75061..0000000 --- a/Pop Pixie/Assets/Core Scripts/Enemy/CoolingDownAI.cs +++ /dev/null @@ -1,106 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class CoolingDownAI : MonoBehaviour { - - public float Speed; - public float ApproachDistance; - public float BackOffDistance; - - private Vector3[] Path; - private Rigidbody2D rb; - private GameObject target; - - // Use this for initialization - void Start () { - rb = gameObject.GetComponent(); - target = GameObject.FindGameObjectWithTag("Player"); - Path = null; - - // Calculate the path every half-second - InvokeRepeating("CalculatePath", 0.0f, 0.5f); - } - - // Update is called once per frame - void Update () { - if ( StateManager.Isnt( State.Playing ) ) { - rb.velocity = Vector3.zero; - return; - } - - if ( !ShouldApproach() ) { - if ( DistanceToTarget() < BackOffDistance ) { - MoveAwayFromPlayer(); - } else { - rb.velocity = Vector3.zero; - } - - return; - } - - if ( Path != null ) { - - Vector3 heading = Path[0] - transform.position; - rb.MovePosition(transform.position + heading.normalized * Speed * Time.deltaTime); - - if ( heading.magnitude < 0.2 ) - CalculatePath(); - - } else { - - MoveAwayFromPlayer(); - CalculatePath(); - - } - } - - private void MoveAwayFromPlayer() { - Vector3 direction = -1 * ( target.transform.position - transform.position ).normalized; - rb.MovePosition(transform.position + direction * Speed * Time.deltaTime); - } - - private Vector3 TargetHeading() { - return target.transform.position - transform.position; - } - - private float DistanceToTarget() { - return TargetHeading().magnitude; - } - - private bool ShouldApproach() { - - bool lineOfSight = false; - - var hit = Physics2D.CircleCast( - transform.position, - ColliderRadius(), - TargetHeading(), - Mathf.Infinity, - ~( 1 << 8 ) - ); - - if ( hit != null ) { - if (hit.transform == target.transform) { - lineOfSight = true; - } - } - - // Approach if too far away or cannot see target - return (DistanceToTarget() > ApproachDistance) || !lineOfSight; - } - - private float ColliderRadius() { - return gameObject.GetComponent().radius; - } - - private void CalculatePath() { - var pathfinder = new AndersonsAlgorithm( - start: transform.position, - destination: target.transform.position, - radius: ColliderRadius() - ); - - Path = pathfinder.Vertices(); - } -} diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/DamagedActivator.cs b/Pop Pixie/Assets/Core Scripts/Enemy/DamagedActivator.cs new file mode 100644 index 0000000..7e649d0 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/DamagedActivator.cs @@ -0,0 +1,28 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class DamagedActivator : AActivator, IHitPointEvents { + + bool Activated = false; + + public override bool IsActivated() { + if ( Activated ) { + Activated = false; + return true; + } + + return false; + } + + public void Updated (HitPoints hp) { + } + + public void Decreased (HitPoints hp) { + Activated = true; + } + + public void BecameZero (HitPoints hp) { + } + +} diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/DamagedActivator.cs.meta b/Pop Pixie/Assets/Core Scripts/Enemy/DamagedActivator.cs.meta new file mode 100644 index 0000000..c5f0e3d --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/DamagedActivator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 62ee4fc16bc4641b0ab2fe76a9dd9244 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/DeathAnimation.cs b/Pop Pixie/Assets/Core Scripts/Enemy/DeathAnimation.cs new file mode 100644 index 0000000..057a3e8 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/DeathAnimation.cs @@ -0,0 +1,46 @@ +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +public class DeathAnimation : MonoBehaviour { + + public float FadeOutDelay; + public float FadeOutDuration; + public SpriteRenderer SpriteRenderer; + public float DestroyTime; + public GameObject GameObject; + public List ParticleSystems; + public SpawnFlyingRingPull SpawnFlyingRingPull; + + private IntervalTimer Timer; + + void Awake() { + Timer = new IntervalTimer() { + Interval = FadeOutDuration + }; + } + + public void Play() { + ParticleSystems.ForEach( x => x.Play() ); + Invoke("StartFadeOut", FadeOutDelay); + Invoke("DestroyGameObject", DestroyTime); + + if ( SpawnFlyingRingPull != null ) + SpawnFlyingRingPull.Instantiate(); + } + + void StartFadeOut() { + Timer.Reset(); + } + + void Update() { + if ( Timer.Started ) + SpriteRenderer.color = new Color( 0, 0, 0, 1f - Timer.Progress() ); + } + + void DestroyGameObject() { + Destroy(GameObject); + } + +} diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/DeathAnimation.cs.meta b/Pop Pixie/Assets/Core Scripts/Enemy/DeathAnimation.cs.meta new file mode 100644 index 0000000..129f38d --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/DeathAnimation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: be0759ffc675d4e549c003e457cdcd9f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/DummyActivator.cs b/Pop Pixie/Assets/Core Scripts/Enemy/DummyActivator.cs new file mode 100644 index 0000000..24f7993 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/DummyActivator.cs @@ -0,0 +1,13 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class DummyActivator : AActivator { + + public bool Activated; + + public override bool IsActivated() { + return Activated; + } + +} diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/DummyActivator.cs.meta b/Pop Pixie/Assets/Core Scripts/Enemy/DummyActivator.cs.meta new file mode 100644 index 0000000..9c3417d --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/DummyActivator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 40c41fff0d63b40d48e3a673c13503f9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/EnemiesKilled.cs b/Pop Pixie/Assets/Core Scripts/Enemy/EnemiesKilled.cs index b4458b6..6a2886c 100644 --- a/Pop Pixie/Assets/Core Scripts/Enemy/EnemiesKilled.cs +++ b/Pop Pixie/Assets/Core Scripts/Enemy/EnemiesKilled.cs @@ -14,9 +14,7 @@ void Update () { if (Triggered) return; - bool all_dead = Enemies.All( - enemy => enemy == null - ); + bool all_dead = Enemies.All( x => EnemyUtils.IsDead(x) ); if (all_dead) { Triggered = true; diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/EnemyAI.cs b/Pop Pixie/Assets/Core Scripts/Enemy/EnemyAI.cs deleted file mode 100644 index 1254435..0000000 --- a/Pop Pixie/Assets/Core Scripts/Enemy/EnemyAI.cs +++ /dev/null @@ -1,124 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class EnemyAI : MonoBehaviour { - - public MonoBehaviour CoolingDown; - public MonoBehaviour Attacking; - public MonoBehaviour Unengaged; - - public float ActivationRadius; - public double CoolDownDuration; - public double GiveUpTime; - - // Making all attributes public for debugging purposes; - // Should be changed later to avoid clutter in the inspector - public bool Engaged; - public DateTime LastActive; - - // Solely for debugging - public double DebugCoolDownTimer; - - private GameObject target; - - // Use this for initialization - void Start () { - target = GameObject.FindGameObjectWithTag("Player"); - Engaged = false; - ResetCoolDownTimer(); - DisableAllAIs(); - } - - // Update is called once per frame - void Update () { - // Make the cool down appear in the inspector - DebugCoolDownTimer = CoolDownTimer(); - - if ( Engaged ) { - var t = CoolDownTimer(); // Avoid repeat calls - - if (t < CoolDownDuration) - SetSubAI( CoolingDown ); - if (t >= CoolDownDuration && t < GiveUpTime) - SetSubAI( Attacking ); - if (t >= GiveUpTime) - ResetCoolDownTimer(); - - } else { - - SetSubAI( Unengaged ); - - bool lineOfSight = false; - - var hit = Physics2D.Raycast( - transform.position, - TargetHeading(), - Mathf.Infinity, - ~( 1 << 8 ) - ); - - if ( hit != null ) { - if (hit.transform == target.transform) { - lineOfSight = true; - } - } - - if ( DistanceToTarget() < ActivationRadius && lineOfSight ) { - Engaged = true; - ResetCoolDownTimer(); - } - - } - } - - private Vector3 TargetHeading() { - return target.transform.position - transform.position; - } - - public void ResetCoolDownTimer() { - LastActive = DateTime.Now; - } - - private double CoolDownTimer() { - // Seconds since last active - return DateTime.Now.Subtract( LastActive ).TotalSeconds; - } - - private float DistanceToTarget() { - return TargetHeading().magnitude; - } - - private MonoBehaviour[] SubAIs() { - // Array of all sub-AIs - return new MonoBehaviour[] { - CoolingDown, - Attacking, - Unengaged - }; - } - - private MonoBehaviour CurrentAI; - - private void SetSubAI(MonoBehaviour ai) { - if ( ai == CurrentAI ) - return; - - Debug.Log("Starting new AI"); - Debug.Log(ai); - - DisableAllAIs(); - - CurrentAI = ai; - ai.enabled = true; - } - - private void DisableAllAIs() { - CurrentAI = null; - - foreach ( MonoBehaviour ai in SubAIs() ) { - ai.enabled = false; - } - } -} diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/EnemyHitPointEvents.cs b/Pop Pixie/Assets/Core Scripts/Enemy/EnemyHitPointEvents.cs index 77d73a3..3d97c00 100644 --- a/Pop Pixie/Assets/Core Scripts/Enemy/EnemyHitPointEvents.cs +++ b/Pop Pixie/Assets/Core Scripts/Enemy/EnemyHitPointEvents.cs @@ -1,41 +1,50 @@ -using System.Collections; +using System; +using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class EnemyHitPointEvents : MonoBehaviour, IHitPointEvents { + public SoundController SoundPlayer; + public float ChanceToPlaySound = 0f; + public Flash Flash; + public DeathAnimation DeathAnimation; + public Collider2D Collider; public List Sounds; + public bool IsDead = false; + public void Updated (HitPoints hp) { } public void Decreased (HitPoints hp) { - float duration = hp.DamageCooldown; - StartCoroutine( Flash(duration) ); + if ( Flash != null ) Flash.BeginFlashing(); - // Play hurt sound - int i = UnityEngine.Random.Range(0, Sounds.Count); - var sound = Sounds[i]; - SoundPlayer.Play(sound); + if ( Sounds.Count > 0 && ShouldPlaySound() ) { + // Play hurt sound + int i = UnityEngine.Random.Range(0, Sounds.Count); + var sound = Sounds[i]; + SoundPlayer.Play(sound); + } } - private IEnumerator Flash(float duration) { - var renderer = gameObject.GetComponent(); + bool ShouldPlaySound() { + return UnityEngine.Random.value < ChanceToPlaySound; + } - int flashes = (int)( duration / 0.2f ); + public void BecameZero (HitPoints hp) { + IsDead = true; + disableAIs(); + Collider.enabled = false; + DeathAnimation.Play(); + } - for(var n = 0; n < flashes; n++) { - renderer.enabled = true; - yield return new WaitForSeconds(0.1f); - renderer.enabled = false; - yield return new WaitForSeconds(0.1f); + void disableAIs() { + foreach ( var ai in GetComponents() ) { + if ( ai.InControl ) + ai.RelinquishControl(); } - - renderer.enabled = true; } - public void BecameZero (HitPoints hp) { - Destroy(gameObject); - } } diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/EnemyUtils.cs b/Pop Pixie/Assets/Core Scripts/Enemy/EnemyUtils.cs new file mode 100644 index 0000000..15c25e9 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/EnemyUtils.cs @@ -0,0 +1,12 @@ +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +public class EnemyUtils { + public static bool IsDead( GameObject enemyGO ) + => enemyGO == null || GetDeadFlag(enemyGO); + + static bool GetDeadFlag( GameObject enemyGO ) + => enemyGO.GetComponent().IsDead; +} diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/EnemyUtils.cs.meta b/Pop Pixie/Assets/Core Scripts/Enemy/EnemyUtils.cs.meta new file mode 100644 index 0000000..1e6c592 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/EnemyUtils.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 42b246f5f998b4e2591038bee33fb28d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/IRequiresLineOfMovementAI.cs b/Pop Pixie/Assets/Core Scripts/Enemy/IRequiresLineOfMovementAI.cs new file mode 100644 index 0000000..0258d2e --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/IRequiresLineOfMovementAI.cs @@ -0,0 +1 @@ +public interface IRequiresLineOfMovementAI {} diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/IRequiresLineOfMovementAI.cs.meta b/Pop Pixie/Assets/Core Scripts/Enemy/IRequiresLineOfMovementAI.cs.meta new file mode 100644 index 0000000..6316cd6 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/IRequiresLineOfMovementAI.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0d293ecdf05c647099db17d736477a7b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/LineOfSightActivator.cs b/Pop Pixie/Assets/Core Scripts/Enemy/LineOfSightActivator.cs new file mode 100644 index 0000000..4d891c2 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/LineOfSightActivator.cs @@ -0,0 +1,11 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class LineOfSightActivator : AActivator { + + public override bool IsActivated( AEnemyAI ai ) { + return ai.LineOfMovement(); // Since sight is not implemented yet + } + +} diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/LineOfSightActivator.cs.meta b/Pop Pixie/Assets/Core Scripts/Enemy/LineOfSightActivator.cs.meta new file mode 100644 index 0000000..de6ca90 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/LineOfSightActivator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 542ca81ef34a14330b20d3de131e86e2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/LookingForTargetAI.cs b/Pop Pixie/Assets/Core Scripts/Enemy/LookingForTargetAI.cs new file mode 100644 index 0000000..d645c05 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/LookingForTargetAI.cs @@ -0,0 +1,62 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class LookingForTargetAI : AEnemyAI { + + public float Speed; + public int PathfindingElbows = 1; + public float PathfindingUpdateRate; + + public AEnemyAI WhenTargetFound; + + IntervalTimer CalculatePathTimer; + Vector3[] Path; + + public override void ControlGained() { + CalculatePathTimer = new IntervalTimer() { + Interval = 1f / PathfindingUpdateRate + }; + + CalculatePathTimer.Start(); + + Path = null; + } + + public override void WhileInControl() { + if ( LineOfMovement() ) { + RelinquishControlTo( WhenTargetFound ); + } else if ( PathfindingElbows > 0 ) { + NavigateToTarget(); + } + } + + void NavigateToTarget() { + if ( Path == null ) { + CalculatePathTimer.IfElapsed( CalculatePath ); + return; + } + + var heading = Path[0] - transform.position; + + ApplyMovement( + heading.normalized * Speed + ); + + if ( heading.magnitude < 0.4 ) + CalculatePath(); + + } + + void CalculatePath() { + var pathfinder = new AndersonsAlgorithm( + start: transform.position, + destination: Target.transform.position, + radius: WidthRequiredForMovement() / 2, + remainingSteps: PathfindingElbows + ); + + Path = pathfinder.Vertices(); + } + +} diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/LookingForTargetAI.cs.meta b/Pop Pixie/Assets/Core Scripts/Enemy/LookingForTargetAI.cs.meta new file mode 100644 index 0000000..43b4057 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/LookingForTargetAI.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 37769e276774c407299222874f5027df +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/LostLineOfMovementInterrupt.cs b/Pop Pixie/Assets/Core Scripts/Enemy/LostLineOfMovementInterrupt.cs new file mode 100644 index 0000000..f147bd4 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/LostLineOfMovementInterrupt.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class LostLineOfMovementInterrupt : AInterrupt { + + public float Delay; + public AEnemyAI WhenLostLineOfMovement; + + IntervalTimer Timer; + + public override Type OnlyAIsMatching() { + return typeof( IRequiresLineOfMovementAI ); + } + + public override void LocalStart() { + Timer = new IntervalTimer() { + Interval = Delay, + TimeClass = "PlayingTime" + }; + + Timer.Start(); + } + + public override bool ShouldInterrupt( AEnemyAI ai ) { + if ( ai.LineOfMovement() ) + Timer.Reset(); + + return Timer.Elapsed(); + } + + public override AEnemyAI InterruptAI() { + return WhenLostLineOfMovement; + } + +} diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/LostLineOfMovementInterrupt.cs.meta b/Pop Pixie/Assets/Core Scripts/Enemy/LostLineOfMovementInterrupt.cs.meta new file mode 100644 index 0000000..6528e78 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/LostLineOfMovementInterrupt.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 33a256bef69524756a5b34c08aa67dbd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/MultiActivator.cs b/Pop Pixie/Assets/Core Scripts/Enemy/MultiActivator.cs new file mode 100644 index 0000000..48895e6 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/MultiActivator.cs @@ -0,0 +1,19 @@ +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +public class MultiActivator : AActivator { + + public bool RequireAll; + public List Activators; + + public override bool IsActivated( AEnemyAI ai ) { + if ( RequireAll ) { + return Activators.All( a => a.IsActivated(ai) ); + } else { + return Activators.Any( a => a.IsActivated(ai) ); + } + } + +} diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/MultiActivator.cs.meta b/Pop Pixie/Assets/Core Scripts/Enemy/MultiActivator.cs.meta new file mode 100644 index 0000000..8bb27dc --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/MultiActivator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0044160660b5c48618ff5305ebcbabeb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/RandomAIAI.cs b/Pop Pixie/Assets/Core Scripts/Enemy/RandomAIAI.cs new file mode 100644 index 0000000..6ab99cb --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/RandomAIAI.cs @@ -0,0 +1,26 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class RandomAIAI : AEnemyAI { + + public List AIs; + public int LastAI = -1; + + public override void ControlGained() { + RelinquishControlTo( RandomAI() ); + } + + AEnemyAI RandomAI() { + int i = LastAI; + + while ( i == LastAI ) { + i = Random.Range(0, AIs.Count); + } + + LastAI = i; + + return AIs[i]; + } + +} diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/RandomAIAI.cs.meta b/Pop Pixie/Assets/Core Scripts/Enemy/RandomAIAI.cs.meta new file mode 100644 index 0000000..a5300fa --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/RandomAIAI.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ecee26bd5e4d442bc8a966552f5161c9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/RangedAttackAI.cs b/Pop Pixie/Assets/Core Scripts/Enemy/RangedAttackAI.cs new file mode 100644 index 0000000..ab02706 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/RangedAttackAI.cs @@ -0,0 +1,21 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class RangedAttackAI : AEnemyAI, IRequiresLineOfMovementAI { + + public BulletEmitter BulletEmitter; + public Weapon Weapon; + + public AEnemyAI WhenAttackFinished; + + public override void ControlGained() { + PerformAttack(); + RelinquishControlTo( WhenAttackFinished ); + } + + void PerformAttack() { + BulletEmitter.Shoot( Weapon ); + } + +} diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/RangedAttackAI.cs.meta b/Pop Pixie/Assets/Core Scripts/Enemy/RangedAttackAI.cs.meta new file mode 100644 index 0000000..be80124 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/RangedAttackAI.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e9c4770ca36f344818bc24b4f3d995a5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/TriggerColliderActivator.cs b/Pop Pixie/Assets/Core Scripts/Enemy/TriggerColliderActivator.cs new file mode 100644 index 0000000..1fde8fd --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/TriggerColliderActivator.cs @@ -0,0 +1,21 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class TriggerColliderActivator : AActivator { + + public List CollidingObjects; + + void OnTriggerEnter2D( Collider2D col ) { + CollidingObjects.Add( col.gameObject ); + } + + void OnTriggerExit2D( Collider2D col ) { + CollidingObjects.Remove( col.gameObject ); + } + + public override bool IsActivated( AEnemyAI ai ) { + return CollidingObjects.Contains( ai.Target ); + } + +} diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/TriggerColliderActivator.cs.meta b/Pop Pixie/Assets/Core Scripts/Enemy/TriggerColliderActivator.cs.meta new file mode 100644 index 0000000..bbb2790 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/TriggerColliderActivator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ad7c5ce706f764807a15dc7bf55897d8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/UnengagedAI.cs b/Pop Pixie/Assets/Core Scripts/Enemy/UnengagedAI.cs deleted file mode 100644 index a982ff3..0000000 --- a/Pop Pixie/Assets/Core Scripts/Enemy/UnengagedAI.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class UnengagedAI : MonoBehaviour { - - // Use this for initialization - void Start () { - - } - - // Update is called once per frame - void Update () { - - } -} diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/WaitingForActivationAI.cs b/Pop Pixie/Assets/Core Scripts/Enemy/WaitingForActivationAI.cs new file mode 100644 index 0000000..64bf459 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/WaitingForActivationAI.cs @@ -0,0 +1,16 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class WaitingForActivationAI : AEnemyAI { + + public AActivator Activator; + public AEnemyAI WhenActivated; + + public override void WhileInControl() { + if ( Activator.IsActivated( this ) ) { + RelinquishControlTo( WhenActivated ); + } + } + +} diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/WaitingForActivationAI.cs.meta b/Pop Pixie/Assets/Core Scripts/Enemy/WaitingForActivationAI.cs.meta new file mode 100644 index 0000000..059c8bd --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/WaitingForActivationAI.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 826b2524332274285acf13c74d649953 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/WanderingBackAI.cs b/Pop Pixie/Assets/Core Scripts/Enemy/WanderingBackAI.cs new file mode 100644 index 0000000..9a7fcf6 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/WanderingBackAI.cs @@ -0,0 +1,57 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class WanderingBackAI : AEnemyAI { + + public float Speed; + public int PathfindingElbows; + + public AEnemyAI WhenArrivedBack; + public AEnemyAI WhenTargetFound; + + Vector3 OriginalPosition; + + Vector3[] Path; + + public override void LocalStart() { + OriginalPosition = transform.position; + } + + public override void ControlGained() { + CalculatePath(); + } + + public override void WhileInControl() { + if ( LineOfMovement() ) { + RelinquishControlTo( WhenTargetFound ); + return; + } + + if ( ( OriginalPosition - transform.position ).magnitude < 0.1 ) { + RelinquishControlTo( WhenArrivedBack ); + return; + } + + var heading = Path[0] - transform.position; + + ApplyMovement( + heading.normalized * Speed + ); + + if ( heading.magnitude < 0.4 ) + CalculatePath(); + } + + void CalculatePath() { + var pathfinder = new AndersonsAlgorithm( + start: transform.position, + destination: OriginalPosition, + radius: WidthRequiredForMovement() / 2, + remainingSteps: PathfindingElbows + ); + + Path = pathfinder.Vertices(); + } + +} diff --git a/Pop Pixie/Assets/Core Scripts/Enemy/WanderingBackAI.cs.meta b/Pop Pixie/Assets/Core Scripts/Enemy/WanderingBackAI.cs.meta new file mode 100644 index 0000000..19ae249 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Enemy/WanderingBackAI.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b04e49604810e4201b53559fa1c85657 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/AData.cs b/Pop Pixie/Assets/Core Scripts/Game Data/AData.cs new file mode 100644 index 0000000..6ebbe7b --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/AData.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +public abstract class AData { + public Dictionary Dictionary; + + public AData() { + Dictionary = LocalDefaultDictionary(); + } + + public virtual Dictionary LocalDefaultDictionary() { + return new Dictionary(); + } + + public dynamic Fetch( string key, dynamic orSetEqualTo = null ) { + BeforeFetch(); + + if ( Dictionary.ContainsKey(key) ) + return Dictionary[key]; + + if ( orSetEqualTo != null ) + return Dictionary[key] = orSetEqualTo; + + return null; + } + + public void Set( string key, dynamic val ) { + Dictionary[key] = val; + AfterUpdate(); + } + + public virtual void BeforeFetch() { + } + + public virtual void AfterUpdate() { + } + +} diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/AData.cs.meta b/Pop Pixie/Assets/Core Scripts/Game Data/AData.cs.meta new file mode 100644 index 0000000..79177aa --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/AData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: db8bf20e8b7ed4e6497cb0dba2960993 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/ComponentDeserializer.cs b/Pop Pixie/Assets/Core Scripts/Game Data/ComponentDeserializer.cs new file mode 100644 index 0000000..7bf8326 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/ComponentDeserializer.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +public class ComponentDeserializer : MonoBehaviour { + SerializedComponent SerializedComponent; + GameObject GameObject; + + public ComponentDeserializer( SerializedComponent serializedComponent, GameObject gameObject ) { + SerializedComponent = serializedComponent; + GameObject = gameObject; + } + + public void Deserialize() { + dynamic component = GameObject.GetComponent( SerializedComponent.Type ); + + foreach ( string fieldName in ( ( ISerializableComponent ) component ).SerializableFields ) { + var field = SerializedComponent.Type.GetField( fieldName ); + dynamic val = SerializedComponent.Fields[ fieldName ]; + field.SetValue( component, val ); + + if ( component is ISaveCallbacks ) { + ( (ISaveCallbacks) component ).AfterLoad(); + } + + } + } +} diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/ComponentDeserializer.cs.meta b/Pop Pixie/Assets/Core Scripts/Game Data/ComponentDeserializer.cs.meta new file mode 100644 index 0000000..042b222 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/ComponentDeserializer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f1592d326d47d4b12a4ab8a12961287a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/ComponentSerializer.cs b/Pop Pixie/Assets/Core Scripts/Game Data/ComponentSerializer.cs new file mode 100644 index 0000000..4b8652f --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/ComponentSerializer.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +public class ComponentSerializer { + private ISerializableComponent Component; + + public ComponentSerializer( ISerializableComponent component ) { + Component = component; + } + + public SerializedComponent Serialize() { + if ( Component is ISaveCallbacks ) { + ( (ISaveCallbacks) Component ).BeforeSave(); + } + + return new SerializedComponent() { + Type = Component.GetType(), + Fields = Fields() + }; + } + + Dictionary Fields() { + var dictionary = new Dictionary(); + + foreach ( string fieldName in Component.SerializableFields ) { + var field = Component.GetType().GetField( fieldName ); + var val = field.GetValue( Component ); + dictionary.Add( fieldName, val ); + } + + return dictionary; + } +} diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/ComponentSerializer.cs.meta b/Pop Pixie/Assets/Core Scripts/Game Data/ComponentSerializer.cs.meta new file mode 100644 index 0000000..e75dec5 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/ComponentSerializer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 51a6a50efc522403c9a26d9db07d5d5a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/ConfigData.cs b/Pop Pixie/Assets/Core Scripts/Game Data/ConfigData.cs new file mode 100644 index 0000000..4a6809b --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/ConfigData.cs @@ -0,0 +1,25 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class ConfigData : AData { + public static ConfigData Current = new ConfigData(); + + private bool loadData = true; + + public override void BeforeFetch() { + if ( loadData && DataOperation().Exists() ) { + loadData = false; + DataOperation().Read(); + } + } + + public override void AfterUpdate() { + DataOperation().Write(); + } + + DataOperation DataOperation() { + return new DataOperation( this, "config" ); + } + +} diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/ConfigData.cs.meta b/Pop Pixie/Assets/Core Scripts/Game Data/ConfigData.cs.meta new file mode 100644 index 0000000..d732684 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/ConfigData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5ccb6da0b47a2483ea70dc305aefe870 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/DataOperation.cs b/Pop Pixie/Assets/Core Scripts/Game Data/DataOperation.cs new file mode 100644 index 0000000..e6bfa6f --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/DataOperation.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Formatters.Binary; +using UnityEngine; + +public class DataOperation { + + AData Data; + string FileName; + + public DataOperation( AData data, string fileName ) { + Data = data; + FileName = fileName; + } + + public void Write() { + var bf = new BinaryFormatter(); + var file = File.Open( Path(), FileMode.OpenOrCreate ); + bf.Serialize(file, Data.Dictionary); + file.Close(); + } + + public void Read() { + var file = File.Open( Path(), FileMode.Open ); + var bf = new BinaryFormatter(); + + try { + Data.Dictionary = ( Dictionary ) bf.Deserialize( file ); + + } catch (SerializationException e) { + + Console.WriteLine("Failed to deserialize. Reason: " + e.Message); + throw; + + } finally { + + file.Close(); + + } + } + + public bool Exists() { + return File.Exists( Path() ); + } + + string Path() { + return System.IO.Path.Combine(Application.persistentDataPath, FileName); + } + +} diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/DataOperation.cs.meta b/Pop Pixie/Assets/Core Scripts/Game Data/DataOperation.cs.meta new file mode 100644 index 0000000..77d1414 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/DataOperation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 257a08e5cceee456d920adbd456ce948 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/GDCall.cs b/Pop Pixie/Assets/Core Scripts/Game Data/GDCall.cs new file mode 100644 index 0000000..4f71152 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/GDCall.cs @@ -0,0 +1,35 @@ +using System; + +public class GDCall { + static bool FirstTime, Load = false; + + public static void ExpectFirstTime() { + FirstTime = true; + Load = false; + } + + public static void ExpectLoad() { + FirstTime = false; + Load = true; + } + + public static void IfFirstTime( Action callback ) { + if ( FirstTime ) + callback(); + } + + public static void UnlessFirstTime( Action callback ) { + if ( !FirstTime ) + callback(); + } + + public static void IfLoad( Action callback ) { + if ( Load ) + callback(); + } + + public static void UnlessLoad( Action callback ) { + if ( !Load ) + callback(); + } +} diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/GDCall.cs.meta b/Pop Pixie/Assets/Core Scripts/Game Data/GDCall.cs.meta new file mode 100644 index 0000000..ff6ede1 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/GDCall.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 532080be3e3c5407cb51e2b542d55b45 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/GameData.cs b/Pop Pixie/Assets/Core Scripts/Game Data/GameData.cs index 9135cd2..2823479 100644 --- a/Pop Pixie/Assets/Core Scripts/Game Data/GameData.cs +++ b/Pop Pixie/Assets/Core Scripts/Game Data/GameData.cs @@ -1,12 +1,14 @@ using System.Collections; using System.Collections.Generic; -using System; -using System.Runtime.Serialization.Formatters.Binary; +using UnityEngine; -// An object containing all the data that is -// persisted from session to session. +public class GameData : AData { + public static GameData Current = new GameData(); + + public override Dictionary LocalDefaultDictionary() { + return new Dictionary { + { "VERSION", "1.1" } + }; + } -[Serializable] -public class GameData { - public int LevelId; } diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/GameDataController.cs b/Pop Pixie/Assets/Core Scripts/Game Data/GameDataController.cs deleted file mode 100644 index c08ba99..0000000 --- a/Pop Pixie/Assets/Core Scripts/Game Data/GameDataController.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using System; -using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters.Binary; -using System.IO; -using UnityEngine; -using UnityEngine.SceneManagement; - -public class GameDataController : MonoBehaviour { - public static GameDataController Current; - public GameData CurrentGame; - - void Awake () { - if ( Current == null ) { - Current = this; - } else { - Destroy( gameObject ); - } - - DontDestroyOnLoad( gameObject ); - } - - public void NewGame () { - Debug.Log("Starting a new game"); - - CurrentGame = new GameData(); - CurrentGame.LevelId = 1; - - Save(); - - SceneManager.LoadScene( CurrentGame.LevelId ); - } - - public void NextLevel () { - CurrentGame.LevelId += 1; - Save(); - SceneManager.LoadScene( CurrentGame.LevelId ); - } - - public bool GameDataExists () { - return File.Exists( GameDataPath() ); - } - - public void Save () { - Debug.Log("Attempting to save"); - Debug.Log( GameDataPath() ); - - var bf = new BinaryFormatter(); - var file = File.Open( GameDataPath(), FileMode.OpenOrCreate ); - bf.Serialize(file, CurrentGame); - file.Close(); - } - - public void Load () { - var file = File.Open( GameDataPath(), FileMode.Open ); - var bf = new BinaryFormatter(); - - try { - CurrentGame = (GameData) bf.Deserialize( file ); - - } catch (SerializationException e) { - - Console.WriteLine("Failed to deserialize. Reason: " + e.Message); - throw; - - } finally { - - file.Close(); - - } - - SceneManager.LoadScene( CurrentGame.LevelId ); - } - - private string GameDataPath () { - return Application.persistentDataPath + "/game_data.dat"; - } -} diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/GameDataController.cs.meta b/Pop Pixie/Assets/Core Scripts/Game Data/GameDataController.cs.meta deleted file mode 100644 index d7961cf..0000000 --- a/Pop Pixie/Assets/Core Scripts/Game Data/GameDataController.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 3bf1d464bed6a4e6aa0183ab70d771ce -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/GameObjectDeserializer.cs b/Pop Pixie/Assets/Core Scripts/Game Data/GameObjectDeserializer.cs new file mode 100644 index 0000000..6fccfd7 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/GameObjectDeserializer.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +public class GameObjectDeserializer : MonoBehaviour { + SerializedGameObject SerializedGameObject; + + public GameObjectDeserializer( SerializedGameObject serializedGameObject ) { + SerializedGameObject = serializedGameObject; + } + + public void Deserialize() { + GameObject gameObject = GuidManager.ResolveGuid( SerializedGameObject.Guid ); + + foreach ( SerializedComponent component in SerializedGameObject.Components ) { + new ComponentDeserializer( component, gameObject ).Deserialize(); + } + } +} diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/GameObjectDeserializer.cs.meta b/Pop Pixie/Assets/Core Scripts/Game Data/GameObjectDeserializer.cs.meta new file mode 100644 index 0000000..1d4b638 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/GameObjectDeserializer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 998134ffc066b41e9a5774f0cabafcb4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/GameObjectSerializer.cs b/Pop Pixie/Assets/Core Scripts/Game Data/GameObjectSerializer.cs new file mode 100644 index 0000000..0e3e7b1 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/GameObjectSerializer.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +public class GameObjectSerializer { + private GameObject GameObject; + + public GameObjectSerializer( GameObject go ) { + GameObject = go; + } + + public SerializedGameObject Serialize() { + var guidComponent = GameObject.GetComponent(); + + if ( guidComponent == null ) + return null; + + return new SerializedGameObject() { + Guid = guidComponent.GetGuid(), + Components = SerializedComponents() + }; + } + + SerializedComponent[] SerializedComponents() { + return SerializableComponents().ToList().Select( + component => new ComponentSerializer(component).Serialize() + ).ToArray(); + } + + ISerializableComponent[] SerializableComponents() { + return GameObject.GetComponents().ToList().Where( + component => component is ISerializableComponent + ).ToList().Select( + component => (ISerializableComponent) component + ).ToArray(); + } +} diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/GameObjectSerializer.cs.meta b/Pop Pixie/Assets/Core Scripts/Game Data/GameObjectSerializer.cs.meta new file mode 100644 index 0000000..667d374 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/GameObjectSerializer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 80d0c737f4034466bbc22a94a159b28c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/ISaveCallbacks.cs b/Pop Pixie/Assets/Core Scripts/Game Data/ISaveCallbacks.cs new file mode 100644 index 0000000..21d023f --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/ISaveCallbacks.cs @@ -0,0 +1,4 @@ +public interface ISaveCallbacks { + void BeforeSave(); + void AfterLoad(); +} diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/ISaveCallbacks.cs.meta b/Pop Pixie/Assets/Core Scripts/Game Data/ISaveCallbacks.cs.meta new file mode 100644 index 0000000..ff7d6ce --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/ISaveCallbacks.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d9ae571168c7749d7b139bbbd10c9d46 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/ISerializableComponent.cs b/Pop Pixie/Assets/Core Scripts/Game Data/ISerializableComponent.cs new file mode 100644 index 0000000..86ad1e0 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/ISerializableComponent.cs @@ -0,0 +1,3 @@ +public interface ISerializableComponent { + string[] SerializableFields { get; } +} diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/ISerializableComponent.cs.meta b/Pop Pixie/Assets/Core Scripts/Game Data/ISerializableComponent.cs.meta new file mode 100644 index 0000000..7051057 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/ISerializableComponent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d7d9ed21208614fe0acc47300cce9390 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/OptionsData.cs b/Pop Pixie/Assets/Core Scripts/Game Data/OptionsData.cs new file mode 100644 index 0000000..5c0af28 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/OptionsData.cs @@ -0,0 +1,28 @@ +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +public class OptionsData { + + public static decimal MusicVolume { + get { + return ConfigData.Current.Fetch("options-music-volume", orSetEqualTo: 1M); + } + + set { + ConfigData.Current.Set("options-music-volume", value); + } + } + + public static decimal SoundsVolume { + get { + return ConfigData.Current.Fetch("options-sounds-volume", orSetEqualTo: 1M); + } + + set { + ConfigData.Current.Set("options-sounds-volume", value); + } + } + +} diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/OptionsData.cs.meta b/Pop Pixie/Assets/Core Scripts/Game Data/OptionsData.cs.meta new file mode 100644 index 0000000..2a58683 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/OptionsData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: afca5eaefee2b43e6b595e316d243414 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/SaveComponents.meta b/Pop Pixie/Assets/Core Scripts/Game Data/SaveComponents.meta new file mode 100644 index 0000000..bacb456 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/SaveComponents.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 93b576aaf25aa41aab1605715f6d324d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/SaveComponents/SaveCameraZoom.cs b/Pop Pixie/Assets/Core Scripts/Game Data/SaveComponents/SaveCameraZoom.cs new file mode 100644 index 0000000..99b0cb4 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/SaveComponents/SaveCameraZoom.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class SaveCameraZoom : MonoBehaviour, ISerializableComponent, ISaveCallbacks { + + public string[] SerializableFields { get; } = { "size" }; + + public Camera Camera; + + public float size; + + public void BeforeSave() { + size = Camera.orthographicSize; + } + + public void AfterLoad() { + Camera.orthographicSize = size; + } + +} diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/SaveComponents/SaveCameraZoom.cs.meta b/Pop Pixie/Assets/Core Scripts/Game Data/SaveComponents/SaveCameraZoom.cs.meta new file mode 100644 index 0000000..46266e3 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/SaveComponents/SaveCameraZoom.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: de089b5ea32414a6694321ca43d63d18 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/SaveComponents/SaveTransform.cs b/Pop Pixie/Assets/Core Scripts/Game Data/SaveComponents/SaveTransform.cs new file mode 100644 index 0000000..b190389 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/SaveComponents/SaveTransform.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class SaveTransform : MonoBehaviour, ISerializableComponent, ISaveCallbacks { + + public string[] SerializableFields { get; } = { "x", "y", "z" }; + + public Transform Transform; + + public float x, y, z; + + public void BeforeSave() { + x = Transform.position.x; + y = Transform.position.y; + z = Transform.position.z; + } + + public void AfterLoad() { + Transform.position = new Vector3( x, y, z ); + } + +} diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/SaveComponents/SaveTransform.cs.meta b/Pop Pixie/Assets/Core Scripts/Game Data/SaveComponents/SaveTransform.cs.meta new file mode 100644 index 0000000..bb6c01c --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/SaveComponents/SaveTransform.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b397b7c32e21f473da65ec3fd9264959 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/SaveGame.cs b/Pop Pixie/Assets/Core Scripts/Game Data/SaveGame.cs new file mode 100644 index 0000000..69b5077 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/SaveGame.cs @@ -0,0 +1,40 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class SaveGame { + + public static void WriteSave() { + WriteTrueSave(); + WriteAutoSave(); + } + + public static void WriteTrueSave() { + Write("file0"); + } + + public static void WriteAutoSave() { + Write("file1"); + } + + public static void ReadSave() { + Read("file0"); + } + + public static void ReadAutoSave() { + Read("file1"); + } + + public static bool Exists() { + return new DataOperation( GameData.Current, "file1" ).Exists(); + } + + static void Write( string fileName ) { + new DataOperation( GameData.Current, fileName ).Write(); + } + + static void Read( string fileName ) { + new DataOperation( GameData.Current, fileName ).Read(); + } + +} diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/SaveGame.cs.meta b/Pop Pixie/Assets/Core Scripts/Game Data/SaveGame.cs.meta new file mode 100644 index 0000000..2697802 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/SaveGame.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5a985b646f5034abd9e7869cc78776b7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/SaveHopper.cs b/Pop Pixie/Assets/Core Scripts/Game Data/SaveHopper.cs new file mode 100644 index 0000000..a55683c --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/SaveHopper.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class SaveHopper : MonoBehaviour { + public bool AboutToSave = false; + public bool AboutToInvokeAutoSave = false; + + void Start() { + // Using Update so that everything had a chance to Start + GDCall.UnlessLoad( HopSaveYourGame ); + AboutToInvokeAutoSave = true; + } + + public void HopSaveYourGame() { + AboutToSave = true; + } + + void Update() { + if ( AboutToSave ) { + AboutToSave = false; + + SceneData.Save(); + SaveGame.WriteSave(); + } + + if ( AboutToInvokeAutoSave ) { + AboutToInvokeAutoSave = false; + InvokeRepeating( "AutoSave", 5.0f, 5.0f ); + } + } + + void AutoSave() { + if ( StateManager.Isnt( State.Playing ) ) + return; + + Debug.Log("Hop!"); + SceneData.Save(); + SaveGame.WriteAutoSave(); + } + +} diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/SaveHopper.cs.meta b/Pop Pixie/Assets/Core Scripts/Game Data/SaveHopper.cs.meta new file mode 100644 index 0000000..b88c283 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/SaveHopper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a10658fadb24f418f93920b6f5ae5b7d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/SaveLoadHelper.cs b/Pop Pixie/Assets/Core Scripts/Game Data/SaveLoadHelper.cs new file mode 100644 index 0000000..e3dbdba --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/SaveLoadHelper.cs @@ -0,0 +1,6 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class SaveLoadHelper : MonoBehaviour { +} diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/SaveLoadHelper.cs.meta b/Pop Pixie/Assets/Core Scripts/Game Data/SaveLoadHelper.cs.meta new file mode 100644 index 0000000..e31c40d --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/SaveLoadHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4b919482a72a144c880fde0085cb8046 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/SceneData.cs b/Pop Pixie/Assets/Core Scripts/Game Data/SceneData.cs new file mode 100644 index 0000000..b9f3fb9 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/SceneData.cs @@ -0,0 +1,23 @@ +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +public class SceneData { + + public static void Save() { + GameData.Current.Set( + "scene", + new SceneSerializer().Serialize() + ); + } + + public static void Load() { + GDCall.ExpectLoad(); + + new SceneDeserializer( + GameData.Current.Fetch("scene") + ).Deserialize(); + } + +} diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/SceneData.cs.meta b/Pop Pixie/Assets/Core Scripts/Game Data/SceneData.cs.meta new file mode 100644 index 0000000..e299177 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/SceneData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bd2217afb83c8488695f9003a654b3fa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/SceneDeserializer.cs b/Pop Pixie/Assets/Core Scripts/Game Data/SceneDeserializer.cs new file mode 100644 index 0000000..d10bcee --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/SceneDeserializer.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; +using UnityEngine.SceneManagement; + +public class SceneDeserializer : MonoBehaviour { + SerializedScene SerializedScene; + bool WaitingForSceneLoad = false; + + public SceneDeserializer( SerializedScene serializedScene ) { + SerializedScene = serializedScene; + } + + public void Deserialize() { + WaitingForSceneLoad = true; + SceneManager.sceneLoaded += OnSceneLoaded; + SceneManager.LoadSceneAsync( SerializedScene.Name ); + } + + public void OnSceneLoaded( Scene scene, LoadSceneMode mode ) { + if ( !WaitingForSceneLoad ) + return; + + WaitingForSceneLoad = false; + + foreach ( GameObject go in SerializableGameObjects() ) { + var matchingSerializedGameObjects = SerializedScene.GameObjects.Where( + sgo => sgo.Guid == go.GetComponent().GetGuid() + ).ToList(); + + switch ( matchingSerializedGameObjects.Count ) { + case 0: + Destroy(go); + break; + + case 1: + var sgo = matchingSerializedGameObjects[0]; + new GameObjectDeserializer( sgo ).Deserialize(); + break; + } + } + } + + GameObject[] SerializableGameObjects() { + return FindObjectsOfType().Where( + go => go.GetComponent() != null + ).ToArray(); + } +} diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/SceneDeserializer.cs.meta b/Pop Pixie/Assets/Core Scripts/Game Data/SceneDeserializer.cs.meta new file mode 100644 index 0000000..415986c --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/SceneDeserializer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d507e0b2c407a4574ab8c004d1f566c9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/SceneSerializer.cs b/Pop Pixie/Assets/Core Scripts/Game Data/SceneSerializer.cs new file mode 100644 index 0000000..338c007 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/SceneSerializer.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; +using UnityEngine.SceneManagement; + +public class SceneSerializer : MonoBehaviour { + public SerializedScene Serialize() { + return new SerializedScene() { + Name = SceneName(), + GameObjects = GameObjects() + }; + } + + string SceneName() { + return SceneManager.GetActiveScene().name; + } + + SerializedGameObject[] GameObjects() { + return FindObjectsOfType().Select( + go => new GameObjectSerializer(go).Serialize() + ).ToArray().Where( sgo => sgo != null ).ToArray(); + } +} diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/SceneSerializer.cs.meta b/Pop Pixie/Assets/Core Scripts/Game Data/SceneSerializer.cs.meta new file mode 100644 index 0000000..fefee89 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/SceneSerializer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a9766cad8023345ca802f748d540d9e6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/SerializedComponent.cs b/Pop Pixie/Assets/Core Scripts/Game Data/SerializedComponent.cs new file mode 100644 index 0000000..b704197 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/SerializedComponent.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +[Serializable] +public class SerializedComponent { + public Type Type; + public Dictionary Fields; +} diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/SerializedComponent.cs.meta b/Pop Pixie/Assets/Core Scripts/Game Data/SerializedComponent.cs.meta new file mode 100644 index 0000000..2d69a12 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/SerializedComponent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 36eca9c2152c841b890cb8837f7e886a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/SerializedGameObject.cs b/Pop Pixie/Assets/Core Scripts/Game Data/SerializedGameObject.cs new file mode 100644 index 0000000..a1668dc --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/SerializedGameObject.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +[Serializable] +public class SerializedGameObject { + public Guid Guid; + public SerializedComponent[] Components; +} diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/SerializedGameObject.cs.meta b/Pop Pixie/Assets/Core Scripts/Game Data/SerializedGameObject.cs.meta new file mode 100644 index 0000000..c744467 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/SerializedGameObject.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c20c0e89e7a4247209c5130d4741e68c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/SerializedScene.cs b/Pop Pixie/Assets/Core Scripts/Game Data/SerializedScene.cs new file mode 100644 index 0000000..01ee284 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/SerializedScene.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +[Serializable] +public class SerializedScene { + public string Name; + public SerializedGameObject[] GameObjects; +} diff --git a/Pop Pixie/Assets/Core Scripts/Game Data/SerializedScene.cs.meta b/Pop Pixie/Assets/Core Scripts/Game Data/SerializedScene.cs.meta new file mode 100644 index 0000000..0c20442 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Game Data/SerializedScene.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 07e0d8d3f0de14f46bdb5fb30596034b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Game Over/GameOverEvents.cs b/Pop Pixie/Assets/Core Scripts/Game Over/GameOverEvents.cs deleted file mode 100644 index c4f5dc8..0000000 --- a/Pop Pixie/Assets/Core Scripts/Game Over/GameOverEvents.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class GameOverEvents : MonoBehaviour { - - public ScreenFade Fader; - public AudioClip Music; - - public void Start () { - Fader.Fade("from black", 1.0f); - MusicController.Current.Play(Music, "game over"); - } - - public void TryAgain() { - Fader.Fade("to black", 2.0f); - MusicController.Current.Fade(1.0f, 0.0f, 2.0f); - Invoke("ReloadLevel", 2.5f); - } - - void ReloadLevel () { - GameDataController.Current.Load(); - } - - public void QuitGame() { -#if UNITY_EDITOR - UnityEditor.EditorApplication.isPlaying = false; -#else - Application.Quit(); -#endif - } - -} diff --git a/Pop Pixie/Assets/Core Scripts/HitPoints/ACanBeDamagedArbiter.cs b/Pop Pixie/Assets/Core Scripts/HitPoints/ACanBeDamagedArbiter.cs new file mode 100644 index 0000000..a2a76eb --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/HitPoints/ACanBeDamagedArbiter.cs @@ -0,0 +1,9 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public abstract class ACanBeDamagedArbiter : MonoBehaviour { + public virtual bool CanBeDamaged(HitPoints hp) { + return true; + } +} diff --git a/Pop Pixie/Assets/Core Scripts/HitPoints/ACanBeDamagedArbiter.cs.meta b/Pop Pixie/Assets/Core Scripts/HitPoints/ACanBeDamagedArbiter.cs.meta new file mode 100644 index 0000000..cca28f3 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/HitPoints/ACanBeDamagedArbiter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 556ab670ec7dc41558e43af25441836d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/HitPoints/HPCooldownArbiter.cs b/Pop Pixie/Assets/Core Scripts/HitPoints/HPCooldownArbiter.cs new file mode 100644 index 0000000..01a5da9 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/HitPoints/HPCooldownArbiter.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class HPCooldownArbiter : ACanBeDamagedArbiter { + public float DamageCooldown; + + public override bool CanBeDamaged(HitPoints hp) { + var since = DateTime.Now.Subtract( + hp.LastDamaged + ).TotalSeconds; + + return since > DamageCooldown; + } +} diff --git a/Pop Pixie/Assets/Core Scripts/HitPoints/HPCooldownArbiter.cs.meta b/Pop Pixie/Assets/Core Scripts/HitPoints/HPCooldownArbiter.cs.meta new file mode 100644 index 0000000..42764fe --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/HitPoints/HPCooldownArbiter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ef4dc502e71444983a20288d1bd7dc7f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/HitPoints/HitPoints.cs b/Pop Pixie/Assets/Core Scripts/HitPoints/HitPoints.cs index d8e5bcb..add9a64 100644 --- a/Pop Pixie/Assets/Core Scripts/HitPoints/HitPoints.cs +++ b/Pop Pixie/Assets/Core Scripts/HitPoints/HitPoints.cs @@ -1,18 +1,33 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Reflection; +using System.Linq; using UnityEngine; -public class HitPoints : MonoBehaviour { +public class HitPoints : MonoBehaviour, ISerializableComponent { + public string[] SerializableFields { + get { + List fields = new List(); + + if (ShouldSave) { + fields.Add("Current"); + } + + return fields.ToArray(); + } + } + + public bool ShouldSave = true; public float Maximum; public float Current; - public float DamageCooldown; public float RegenerateRate; + public List CanBeDamagedArbiters; - private DateTime LastDamaged; + public DateTime LastDamaged; - private IHitPointEvents EventHandler; + private IHitPointEvents[] EventHandlers; public void Cap () { // Make sure HP is between 0 and max @@ -32,18 +47,22 @@ public float Increase (float val) { } public float Decrease (float val) { + if ( Current == 0 ) + return 0.0f; // <-- Bypass callbacks + Increase(-val); - EventHandler.Decreased(this); + SendEventHandlerMessage("Decreased"); if ( Current == 0 ) - EventHandler.BecameZero(this); + SendEventHandlerMessage("BecameZero"); return Current; } bool CanBeDamaged () { - var since = DateTime.Now.Subtract( LastDamaged ).TotalSeconds; - return since > DamageCooldown; + return CanBeDamagedArbiters.ToArray().All( + arbiter => arbiter.CanBeDamaged(this) + ); } public float Damage (float val) { @@ -57,15 +76,31 @@ public float Damage (float val) { // Use this for initialization void Start () { - Current = Maximum; - EventHandler = gameObject.GetComponent(); + GDCall.UnlessLoad( InitHitPoints ); + + if ( !ShouldSave ) + InitHitPoints(); + + EventHandlers = gameObject.GetComponents(); } + + public void InitHitPoints() { + Current = Maximum; + } // Update is called once per frame void Update () { - EventHandler.Updated(this); + SendEventHandlerMessage("Updated"); if ( StateManager.Is( State.Playing ) ) Increase( RegenerateRate * Time.deltaTime ); } + + void SendEventHandlerMessage(string message) { + foreach (IHitPointEvents eventHandler in EventHandlers) { + MethodInfo method = eventHandler.GetType().GetMethod(message); + method.Invoke(eventHandler, new object[] { this } ); + } + } + } diff --git a/Pop Pixie/Assets/Core Scripts/HitPoints/RollInvulnerabilityArbiter.cs b/Pop Pixie/Assets/Core Scripts/HitPoints/RollInvulnerabilityArbiter.cs new file mode 100644 index 0000000..2b18569 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/HitPoints/RollInvulnerabilityArbiter.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class RollInvulnerabilityArbiter : ACanBeDamagedArbiter { + public Roll Roll; + + public override bool CanBeDamaged(HitPoints hp) { + return !Roll.Rolling; + } +} diff --git a/Pop Pixie/Assets/Core Scripts/HitPoints/RollInvulnerabilityArbiter.cs.meta b/Pop Pixie/Assets/Core Scripts/HitPoints/RollInvulnerabilityArbiter.cs.meta new file mode 100644 index 0000000..0776f24 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/HitPoints/RollInvulnerabilityArbiter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2ce6d2b595e49412a8b07d3135cf1bbd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Lore/LevelLoreManager.cs b/Pop Pixie/Assets/Core Scripts/Lore/LevelLoreManager.cs new file mode 100644 index 0000000..7a32200 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Lore/LevelLoreManager.cs @@ -0,0 +1,35 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class LevelLoreManager : MonoBehaviour, ILoreEventHandler { + + public static LevelLoreManager Current; + + public LoreManager LoreManager; + private ILoreEventHandler EventHandler; + + void Start() { + Current = this; + } + + public void Open (string item_name, ILoreEventHandler event_handler=null) { + string json = Resources.Load(item_name).text; + var item = LoreItem.ParseJSON(json); + + LoreItemData.RecordRead(item); + + StateManager.SetState( State.Lore ); + EventHandler = event_handler; + + LoreManager.Open( item, this ); + } + + public void Closed() { + if ( EventHandler != null ) + EventHandler.Closed(); + + StateManager.SetState( State.Playing ); + } + +} diff --git a/Pop Pixie/Assets/Core Scripts/Lore/LevelLoreManager.cs.meta b/Pop Pixie/Assets/Core Scripts/Lore/LevelLoreManager.cs.meta new file mode 100644 index 0000000..7b6bf27 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Lore/LevelLoreManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b97cb61c930a543b9a0ce80bae0aa9a6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Lore/LoreItem.cs b/Pop Pixie/Assets/Core Scripts/Lore/LoreItem.cs index 8adad5a..0eece47 100644 --- a/Pop Pixie/Assets/Core Scripts/Lore/LoreItem.cs +++ b/Pop Pixie/Assets/Core Scripts/Lore/LoreItem.cs @@ -1,10 +1,18 @@ using System.Collections; using System.Collections.Generic; +using System.Globalization; using UnityEngine; [System.Serializable] public class LoreItem { public string Text; + public string UniqueId = null; + + public string Name { + get { + return CultureInfo.CurrentCulture.TextInfo.ToTitleCase( UniqueId ).Replace("-", " "); + } + } public static LoreItem ParseJSON (string json) { return JsonUtility.FromJson(json); diff --git a/Pop Pixie/Assets/Core Scripts/Lore/LoreItemData.cs b/Pop Pixie/Assets/Core Scripts/Lore/LoreItemData.cs new file mode 100644 index 0000000..4d47fc6 --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Lore/LoreItemData.cs @@ -0,0 +1,29 @@ +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +public class LoreItemData { + + public static void RecordRead( LoreItem loreItem ) { + if ( loreItem.UniqueId == null ) + return; + + if ( AlreadyRead(loreItem) ) + return; + + ReadLoreItems().Add(loreItem); + } + + public static List ReadLoreItems() { + return GameData.Current.Fetch( + "lore-items", + orSetEqualTo: new List() + ); + } + + static bool AlreadyRead( LoreItem loreItem ) { + return ReadLoreItems().Any( l => l.UniqueId == loreItem.UniqueId ); + } + +} diff --git a/Pop Pixie/Assets/Core Scripts/Lore/LoreItemData.cs.meta b/Pop Pixie/Assets/Core Scripts/Lore/LoreItemData.cs.meta new file mode 100644 index 0000000..9cb5f3e --- /dev/null +++ b/Pop Pixie/Assets/Core Scripts/Lore/LoreItemData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b8600682511fc48babf54ce044dd5537 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pop Pixie/Assets/Core Scripts/Lore/LoreItemSprite.cs b/Pop Pixie/Assets/Core Scripts/Lore/LoreItemSprite.cs index cfb6259..4ce0995 100644 --- a/Pop Pixie/Assets/Core Scripts/Lore/LoreItemSprite.cs +++ b/Pop Pixie/Assets/Core Scripts/Lore/LoreItemSprite.cs @@ -2,27 +2,24 @@ using System.Collections.Generic; using UnityEngine; -public class LoreItemSprite : MonoBehaviour, IPromptButtonEventHandler { +public class LoreItemSprite : AInspectable, IPromptButtonEventHandler { - public LoreManager Lore; public string LoreItemResourceName; public string PromptText; public DialoguePromptManager PromptManager; - void OnTriggerEnter2D (Collider2D other) { - if ( other.tag == "Player" ) { - PromptManager.Display( - PromptText + "\n(Do you read it?)", - "Read it", - "Do not", - this - ); - } + public override void OnInspect() { + PromptManager.Display( + PromptText + "\n(Do you read it?)", + "Read it", + "Do not", + this + ); } public void ButtonPressed (string button) { if ( button == "positive" ) { - Lore.Open("Lore/" + LoreItemResourceName); + LevelLoreManager.Current.Open("Lore/" + LoreItemResourceName); } } } diff --git a/Pop Pixie/Assets/Core Scripts/Lore/LoreManager.cs b/Pop Pixie/Assets/Core Scripts/Lore/LoreManager.cs index 78a57f5..3d606b7 100644 --- a/Pop Pixie/Assets/Core Scripts/Lore/LoreManager.cs +++ b/Pop Pixie/Assets/Core Scripts/Lore/LoreManager.cs @@ -5,38 +5,36 @@ public class LoreManager : MonoBehaviour { public LoreWindowController LoreWindow; - private ILoreEventHandler EventHandler; - public void Open (string item_name, ILoreEventHandler event_handler=null) { - string json = Resources.Load(item_name).text; - var item = LoreItem.ParseJSON(json); + private ILoreEventHandler EventHandler; + private bool IsOpen; - MusicController.Current.SetVolume(0.25f); - StateManager.SetState( State.Lore ); + public void Open (LoreItem item, ILoreEventHandler event_handler=null) { EventHandler = event_handler; + IsOpen = true; LoreWindow.Write( item.Text ); LoreWindow.Show(); } // Use this for initialization void Start () { + IsOpen = false; LoreWindow.Hide(); } // Update is called once per frame void Update () { - if ( StateManager.Isnt( State.Lore ) ) + if ( !IsOpen ) return; - if ( Input.GetButton("Cancel") ) { + if ( WrappedInput.GetButtonDown("Cancel") ) { LoreWindow.Hide(); if ( EventHandler != null ) EventHandler.Closed(); - StateManager.SetState( State.Playing ); - MusicController.Current.SetVolume(1.0f); + IsOpen = false; } } diff --git a/Pop Pixie/Assets/Core Scripts/Lore/LoreWindowController.cs b/Pop Pixie/Assets/Core Scripts/Lore/LoreWindowController.cs index e6ba05a..e3c0591 100644 --- a/Pop Pixie/Assets/Core Scripts/Lore/LoreWindowController.cs +++ b/Pop Pixie/Assets/Core Scripts/Lore/LoreWindowController.cs @@ -3,15 +3,21 @@ using UnityEngine; using UnityEngine.UI; using UnityEngine.EventSystems; +using TMPro; public class LoreWindowController : MonoBehaviour { - public Text TextBox; + public TMP_Text TextBox; + public RectTransform TextBoxTransform; public GameObject LoreWindow; public GameObject ScrollBar; public void Write (string text) { TextBox.text = text; + TextBoxTransform.sizeDelta = new Vector2( + 0, + TextBox.GetPreferredValues().y + ); } public void Show () { diff --git a/Pop Pixie/Assets/Core Scripts/Main Menu/ContinueButtonAvailabilityChecker.cs b/Pop Pixie/Assets/Core Scripts/Main Menu/ContinueButtonAvailabilityChecker.cs deleted file mode 100644 index b6f04f4..0000000 --- a/Pop Pixie/Assets/Core Scripts/Main Menu/ContinueButtonAvailabilityChecker.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.UI; - -public class ContinueButtonAvailabilityChecker : MonoBehaviour { - - // Update is called once per frame - void Update () { - var controller = GameDataController.Current; - var button = gameObject.GetComponent