From 79ff94365b572d0e64ba945dcef2641ee508faa7 Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 6 Nov 2020 20:41:04 +0800 Subject: =?UTF-8?q?*=E7=A9=BA=E4=B8=AD=E6=94=BB=E5=87=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Prefabs/Characters/Saionji.prefab | 130 ++--------- Assets/Scenes/Demo/SaionjiShowOff.unity | 244 ++++++++++++++++----- Assets/Scripts/Avatar/Abilities/AttackAbility.cs | 5 + Assets/Scripts/Avatar/Abilities/IdleAbility.cs | 7 +- Assets/Scripts/Avatar/Abilities/MoveAbility.cs | 5 + Assets/Scripts/Avatar/Actions/ActionEffects.meta | 8 + .../ActionEffects/ActionActivateAfterImage.cs | 18 ++ .../ActionEffects/ActionActivateAfterImage.cs.meta | 11 + .../ActionEffects/ActionAfterImageInterval.cs | 18 ++ .../ActionEffects/ActionAfterImageInterval.cs.meta | 11 + .../Actions/ActionEffects/ActionPlayEffect.cs | 49 +++++ .../Actions/ActionEffects/ActionPlayEffect.cs.meta | 11 + Assets/Scripts/Avatar/Avatar.cs | 5 + Assets/Scripts/Avatar/Trigger.cs | 21 +- Assets/Scripts/Effects/AfterImage/AfterImage.cs | 3 - .../Scripts/Effects/AfterImage/AfterImagePool.cs | 27 ++- Assets/Scripts/Effects/Effect.cs | 30 +++ Assets/Scripts/Effects/Effect.cs.meta | 11 + Assets/Scripts/Effects/EffectsManager.cs | 73 ++++++ Assets/Scripts/Effects/EffectsManager.cs.meta | 11 + Assets/Scripts/Props.meta | 8 + Assets/Scripts/Test/SaionjiScript_Ability.cs | 34 ++- Assets/Scripts/Test/SaionjiScript_Effect.cs | 13 ++ Assets/Scripts/Test/SaionjiScript_Effect.cs.meta | 11 + 24 files changed, 570 insertions(+), 194 deletions(-) create mode 100644 Assets/Scripts/Avatar/Actions/ActionEffects.meta create mode 100644 Assets/Scripts/Avatar/Actions/ActionEffects/ActionActivateAfterImage.cs create mode 100644 Assets/Scripts/Avatar/Actions/ActionEffects/ActionActivateAfterImage.cs.meta create mode 100644 Assets/Scripts/Avatar/Actions/ActionEffects/ActionAfterImageInterval.cs create mode 100644 Assets/Scripts/Avatar/Actions/ActionEffects/ActionAfterImageInterval.cs.meta create mode 100644 Assets/Scripts/Avatar/Actions/ActionEffects/ActionPlayEffect.cs create mode 100644 Assets/Scripts/Avatar/Actions/ActionEffects/ActionPlayEffect.cs.meta create mode 100644 Assets/Scripts/Effects/Effect.cs create mode 100644 Assets/Scripts/Effects/Effect.cs.meta create mode 100644 Assets/Scripts/Effects/EffectsManager.cs create mode 100644 Assets/Scripts/Effects/EffectsManager.cs.meta create mode 100644 Assets/Scripts/Props.meta create mode 100644 Assets/Scripts/Test/SaionjiScript_Effect.cs create mode 100644 Assets/Scripts/Test/SaionjiScript_Effect.cs.meta (limited to 'Assets') diff --git a/Assets/Prefabs/Characters/Saionji.prefab b/Assets/Prefabs/Characters/Saionji.prefab index 4c288e6a..ca4a6084 100644 --- a/Assets/Prefabs/Characters/Saionji.prefab +++ b/Assets/Prefabs/Characters/Saionji.prefab @@ -60,61 +60,6 @@ Transform: m_Father: {fileID: 3741668520236251699} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &564123360 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 564123361} - - component: {fileID: 564123362} - m_Layer: 0 - m_Name: GhostEffect - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &564123361 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 564123360} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 8830573158430684054} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &564123362 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 564123360} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 76b355b49906df24cac5ccfb0de69331, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Renderer: {fileID: 7892098139105315744} - Materials: - - {fileID: 2100000, guid: e07419b2da43f394b9d0320522a98b97, type: 2} - - {fileID: 2100000, guid: fe27a77335691184a9614ea455f66a1b, type: 2} - - {fileID: 2100000, guid: 3bc37f9aaa16e434aa2bcf5dc4e7f464, type: 2} - - {fileID: 2100000, guid: 5384a215c78e13e4293236f2783b2c25, type: 2} - SubmeshShareMaterial: 1 - UseRangedSubmesh: 1 - SubmeshRange: {x: 4, y: 7} - IsEnable: 1 - Interval: 0.2 - LifeTime: 0.2 --- !u!1 &96903353853588326 GameObject: m_ObjectHideFlags: 0 @@ -2189,37 +2134,6 @@ MonoBehaviour: - Offset: {x: -0.00000000721775, y: 0.028092027, z: 0.016728269} Radius: 0.05000001 m_gizmoColor: {r: 1, g: 0, b: 1, a: 1} ---- !u!1 &2939528115390096390 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 8830573158430684054} - m_Layer: 0 - m_Name: Root_Effects - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &8830573158430684054 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2939528115390096390} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 564123361} - m_Father: {fileID: 5505303514460593431} - m_RootOrder: 5 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &3184494207204655298 GameObject: m_ObjectHideFlags: 0 @@ -2539,8 +2453,8 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 3741668520236251698} m_LocalRotation: {x: -0, y: 0.066068396, z: -0, w: 0.99781513} - m_LocalPosition: {x: 0.091, y: -0.0147, z: 0.259} - m_LocalScale: {x: 0.02, y: 0.03, z: 1} + m_LocalPosition: {x: 0.1096, y: -0.0147, z: 0.3989} + m_LocalScale: {x: 0.019999998, y: 0.03, z: 1.2822342} m_Children: - {fileID: 471762090} - {fileID: 321639732} @@ -2572,7 +2486,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: fb1a6b631853ec045bdfb595c327997c, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -2845,12 +2759,12 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4302075858485272031} m_LocalRotation: {x: -0, y: -0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 4705946546362071242} m_Father: {fileID: 5505303514460593431} - m_RootOrder: 3 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &4303571225169317279 GameObject: @@ -3669,7 +3583,7 @@ Transform: m_Children: - {fileID: 4721566464291151502} m_Father: {fileID: 5505303514460593431} - m_RootOrder: 2 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &5874474968815654177 GameObject: @@ -4024,7 +3938,6 @@ GameObject: - component: {fileID: 6037765075253890939} - component: {fileID: 6037765075253890940} - component: {fileID: 6037765075253890941} - - component: {fileID: 1314072688} m_Layer: 0 m_Name: Saionji m_TagString: Untagged @@ -4045,10 +3958,9 @@ Transform: m_Children: - {fileID: 9170381734520366874} - {fileID: 7348621143665497331} - - {fileID: 6694119557485470208} - {fileID: 3430717320292425031} + - {fileID: 6694119557485470208} - {fileID: 3798342049171889359} - - {fileID: 8830573158430684054} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 90.00001, z: 0} @@ -4321,6 +4233,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c2788004f7d291b40a1ac1c11c3bdc3d, type: 3} m_Name: m_EditorClassIdentifier: + Name: Saionji m_Body: {fileID: 6037765075253890941} m_BodyCollider: {fileID: 6037765075253890940} m_Hitbox: @@ -4334,7 +4247,7 @@ MonoBehaviour: UseBlade: 1 EnableAbilitySystem: 1 Effects: - - {fileID: 564123362} + - {fileID: 0} --- !u!114 &6037765075253890939 MonoBehaviour: m_ObjectHideFlags: 0 @@ -4393,19 +4306,6 @@ MonoBehaviour: m_AirFriction: 1 m_Force: {x: 0, y: 0, z: 0} m_Primitive: {fileID: 6037765075253890940} ---- !u!114 &1314072688 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6928613106012578342} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 12bdc2613cfcd9043ad58b1bcc15c8ce, type: 3} - m_Name: - m_EditorClassIdentifier: - GhostEffect: {fileID: 564123362} --- !u!1 &6992958801127855440 GameObject: m_ObjectHideFlags: 0 @@ -6024,18 +5924,18 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: ffe9971ac75494746b9dc21c63dc7836, type: 3} ---- !u!4 &1226857665675417915 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 400000, guid: ffe9971ac75494746b9dc21c63dc7836, - type: 3} - m_PrefabInstance: {fileID: 1226857665675281339} - m_PrefabAsset: {fileID: 0} --- !u!1 &1226857665675379995 stripped GameObject: m_CorrespondingSourceObject: {fileID: 100000, guid: ffe9971ac75494746b9dc21c63dc7836, type: 3} m_PrefabInstance: {fileID: 1226857665675281339} m_PrefabAsset: {fileID: 0} +--- !u!4 &1226857665675417915 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 400000, guid: ffe9971ac75494746b9dc21c63dc7836, + type: 3} + m_PrefabInstance: {fileID: 1226857665675281339} + m_PrefabAsset: {fileID: 0} --- !u!1001 &8973641233767210612 PrefabInstance: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/Demo/SaionjiShowOff.unity b/Assets/Scenes/Demo/SaionjiShowOff.unity index 8cc12b68..51818b25 100644 --- a/Assets/Scenes/Demo/SaionjiShowOff.unity +++ b/Assets/Scenes/Demo/SaionjiShowOff.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 170076734} - m_IndirectSpecularColor: {r: 0.44092834, g: 0.4896462, b: 0.5697487, a: 1} + m_IndirectSpecularColor: {r: 0.44092876, g: 0.4896468, b: 0.5697499, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -522,6 +522,7 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 476164676} + - component: {fileID: 476164677} m_Layer: 0 m_Name: Root_VisualEffects m_TagString: Untagged @@ -539,10 +540,27 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] + m_Children: + - {fileID: 1418006278} + - {fileID: 1156861647} m_Father: {fileID: 0} m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &476164677 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 476164675} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: db461c57209f8a241a28d33730ad12ef, type: 3} + m_Name: + m_EditorClassIdentifier: + EffectTemplates: + - {fileID: 683178337} + Root_Pool: {fileID: 1156861647} --- !u!1 &534669902 GameObject: m_ObjectHideFlags: 0 @@ -620,8 +638,8 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 534669902} - m_LocalRotation: {x: 0.026764132, y: -0.0017788075, z: 0.00004762537, w: 0.9996402} - m_LocalPosition: {x: 3.96505, y: -0.77492833, z: -2.8489904} + m_LocalRotation: {x: 0.008610075, y: -0.00048662993, z: 0.0000041900757, w: 0.9999628} + m_LocalPosition: {x: 3.9599998, y: -1.12, z: -1.4299998} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 1241327946} @@ -779,6 +797,32 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 86f7c62be03142846a1efe2b5645a42c, type: 3} +--- !u!1 &683178335 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 1840690549904964, guid: a8a6ba91edbeef2439175ecf0e08e6fb, + type: 3} + m_PrefabInstance: {fileID: 1239221725} + m_PrefabAsset: {fileID: 0} +--- !u!4 &683178336 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4851922120147866, guid: a8a6ba91edbeef2439175ecf0e08e6fb, + type: 3} + m_PrefabInstance: {fileID: 1239221725} + m_PrefabAsset: {fileID: 0} +--- !u!114 &683178337 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 683178335} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a0f48b3d527ef6c49999e8a4b9892cd9, type: 3} + m_Name: + m_EditorClassIdentifier: + Name: Air_Attk1 + LifeTime: 1 --- !u!1 &705651392 GameObject: m_ObjectHideFlags: 0 @@ -899,7 +943,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 801756637} - m_LocalRotation: {x: 0.026764132, y: -0.0017788075, z: 0.00004762537, w: 0.9996402} + m_LocalRotation: {x: 0.008610075, y: -0.00048662993, z: 0.0000041900757, w: 0.9999628} m_LocalPosition: {x: 3.9599998, y: -1.12, z: -1.4299998} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: @@ -1289,6 +1333,12 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: ac0b09e7857660247b1477e93731de29, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!4 &978997505 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4721566464291151502, guid: 83d445123a203b14298b7a7662a0a470, + type: 3} + m_PrefabInstance: {fileID: 3741668519200845148} + m_PrefabAsset: {fileID: 0} --- !u!1 &1010830242 GameObject: m_ObjectHideFlags: 0 @@ -1442,6 +1492,36 @@ Light: m_UseColorTemperature: 0 m_ShadowRadius: 0 m_ShadowAngle: 0 +--- !u!1 &1156861646 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1156861647} + m_Layer: 0 + m_Name: EffectsPool + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1156861647 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1156861646} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 476164676} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1189435617 GameObject: m_ObjectHideFlags: 0 @@ -1479,6 +1559,71 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &1239221725 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1418006278} + m_Modifications: + - target: {fileID: 1840690549904964, guid: a8a6ba91edbeef2439175ecf0e08e6fb, type: 3} + propertyPath: m_Name + value: Sword Slash 11 + objectReference: {fileID: 0} + - target: {fileID: 1840690549904964, guid: a8a6ba91edbeef2439175ecf0e08e6fb, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4851922120147866, guid: a8a6ba91edbeef2439175ecf0e08e6fb, type: 3} + propertyPath: m_LocalPosition.x + value: 3.96 + objectReference: {fileID: 0} + - target: {fileID: 4851922120147866, guid: a8a6ba91edbeef2439175ecf0e08e6fb, type: 3} + propertyPath: m_LocalPosition.y + value: 1.3 + objectReference: {fileID: 0} + - target: {fileID: 4851922120147866, guid: a8a6ba91edbeef2439175ecf0e08e6fb, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4851922120147866, guid: a8a6ba91edbeef2439175ecf0e08e6fb, type: 3} + propertyPath: m_LocalRotation.x + value: -0.9297926 + objectReference: {fileID: 0} + - target: {fileID: 4851922120147866, guid: a8a6ba91edbeef2439175ecf0e08e6fb, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4851922120147866, guid: a8a6ba91edbeef2439175ecf0e08e6fb, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4851922120147866, guid: a8a6ba91edbeef2439175ecf0e08e6fb, type: 3} + propertyPath: m_LocalRotation.w + value: 0.368084 + objectReference: {fileID: 0} + - target: {fileID: 4851922120147866, guid: a8a6ba91edbeef2439175ecf0e08e6fb, type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4851922120147866, guid: a8a6ba91edbeef2439175ecf0e08e6fb, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -136.805 + objectReference: {fileID: 0} + - target: {fileID: 4851922120147866, guid: a8a6ba91edbeef2439175ecf0e08e6fb, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4851922120147866, guid: a8a6ba91edbeef2439175ecf0e08e6fb, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4851922120147866, guid: a8a6ba91edbeef2439175ecf0e08e6fb, type: 3} + propertyPath: m_LocalScale.y + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: a8a6ba91edbeef2439175ecf0e08e6fb, type: 3} --- !u!1 &1241327945 GameObject: m_ObjectHideFlags: 0 @@ -1676,6 +1821,37 @@ MonoBehaviour: m_MaximumFOV: 60 m_MinimumOrthoSize: 1 m_MaximumOrthoSize: 5000 +--- !u!1 &1418006277 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1418006278} + m_Layer: 0 + m_Name: Templates + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1418006278 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1418006277} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 683178336} + m_Father: {fileID: 476164676} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1429005014 GameObject: m_ObjectHideFlags: 0 @@ -1720,7 +1896,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1429005014} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: 1000, y: 1000, z: -1000} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 902182892} @@ -2050,56 +2226,11 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 861183510} m_Modifications: - - target: {fileID: 758480958, guid: 83d445123a203b14298b7a7662a0a470, type: 3} - propertyPath: m_Size.x - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 758480958, guid: 83d445123a203b14298b7a7662a0a470, type: 3} - propertyPath: m_Center.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 758480958, guid: 83d445123a203b14298b7a7662a0a470, type: 3} - propertyPath: m_IsActive - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 758480958, guid: 83d445123a203b14298b7a7662a0a470, type: 3} - propertyPath: m_Size.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 758480958, guid: 83d445123a203b14298b7a7662a0a470, type: 3} - propertyPath: m_Center.y - value: 0 - objectReference: {fileID: 0} - target: {fileID: 3741668519095819896, guid: 83d445123a203b14298b7a7662a0a470, type: 3} - propertyPath: Name - value: Saionji - objectReference: {fileID: 0} - - target: {fileID: 3741668520236251693, guid: 83d445123a203b14298b7a7662a0a470, - type: 3} - propertyPath: m_Materials.Array.data[0] + propertyPath: m_Hips value: - objectReference: {fileID: 2100000, guid: fb1a6b631853ec045bdfb595c327997c, type: 2} - - target: {fileID: 3741668520236251699, guid: 83d445123a203b14298b7a7662a0a470, - type: 3} - propertyPath: m_LocalPosition.x - value: 0.1096 - objectReference: {fileID: 0} - - target: {fileID: 3741668520236251699, guid: 83d445123a203b14298b7a7662a0a470, - type: 3} - propertyPath: m_LocalPosition.z - value: 0.3989 - objectReference: {fileID: 0} - - target: {fileID: 3741668520236251699, guid: 83d445123a203b14298b7a7662a0a470, - type: 3} - propertyPath: m_LocalScale.z - value: 1.2822342 - objectReference: {fileID: 0} - - target: {fileID: 3741668520236251699, guid: 83d445123a203b14298b7a7662a0a470, - type: 3} - propertyPath: m_LocalScale.x - value: 0.019999998 - objectReference: {fileID: 0} + objectReference: {fileID: 978997505} - target: {fileID: 5505303514460593431, guid: 83d445123a203b14298b7a7662a0a470, type: 3} propertyPath: m_LocalPosition.x @@ -2155,6 +2286,11 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 6037765075253890941, guid: 83d445123a203b14298b7a7662a0a470, + type: 3} + propertyPath: m_Frication + value: 10 + objectReference: {fileID: 0} - target: {fileID: 6928613106012578342, guid: 83d445123a203b14298b7a7662a0a470, type: 3} propertyPath: m_Name @@ -2189,7 +2325,7 @@ PrefabInstance: - target: {fileID: 3674041106879106001, guid: 2bc84022d3389104b84680ddf3faeeda, type: 3} propertyPath: timeMax - value: 10 + value: 20 objectReference: {fileID: 0} - target: {fileID: 3674041106879106001, guid: 2bc84022d3389104b84680ddf3faeeda, type: 3} diff --git a/Assets/Scripts/Avatar/Abilities/AttackAbility.cs b/Assets/Scripts/Avatar/Abilities/AttackAbility.cs index 57e9541b..5a200cf8 100644 --- a/Assets/Scripts/Avatar/Abilities/AttackAbility.cs +++ b/Assets/Scripts/Avatar/Abilities/AttackAbility.cs @@ -85,6 +85,11 @@ public class AttackAbility : AbilityBase { hit.WipeRecords(); } + + foreach(var trigger in m_Triggers) + { + trigger.Reset(); + } } public override void OnExit() diff --git a/Assets/Scripts/Avatar/Abilities/IdleAbility.cs b/Assets/Scripts/Avatar/Abilities/IdleAbility.cs index d42308db..e692cc2a 100644 --- a/Assets/Scripts/Avatar/Abilities/IdleAbility.cs +++ b/Assets/Scripts/Avatar/Abilities/IdleAbility.cs @@ -24,7 +24,12 @@ public class IdleAbility : AbilityBase public override void OnEnter() { m_Animator.CrossFadeInFixedTime(m_AnimHash, 0.25f); - } + + foreach (var trigger in m_Triggers) + { + trigger.Reset(); + } + } public override void OnInit() { diff --git a/Assets/Scripts/Avatar/Abilities/MoveAbility.cs b/Assets/Scripts/Avatar/Abilities/MoveAbility.cs index cf9fa106..61efd0cf 100644 --- a/Assets/Scripts/Avatar/Abilities/MoveAbility.cs +++ b/Assets/Scripts/Avatar/Abilities/MoveAbility.cs @@ -31,6 +31,11 @@ public class MoveAbility : AbilityBase public override void OnEnter() { m_Animator.CrossFadeInFixedTime(m_AnimHash, 0.1f); + + foreach (var trigger in m_Triggers) + { + trigger.Reset(); + } } public override void OnExit() diff --git a/Assets/Scripts/Avatar/Actions/ActionEffects.meta b/Assets/Scripts/Avatar/Actions/ActionEffects.meta new file mode 100644 index 00000000..17a426dd --- /dev/null +++ b/Assets/Scripts/Avatar/Actions/ActionEffects.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0b5ccfefc2e6b104a8566f4da9a16c5f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Avatar/Actions/ActionEffects/ActionActivateAfterImage.cs b/Assets/Scripts/Avatar/Actions/ActionEffects/ActionActivateAfterImage.cs new file mode 100644 index 00000000..0b2ac361 --- /dev/null +++ b/Assets/Scripts/Avatar/Actions/ActionEffects/ActionActivateAfterImage.cs @@ -0,0 +1,18 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class ActionActivateAfterImage : ActionBase +{ + private bool m_IsActive; + + public ActionActivateAfterImage(bool isActive) + { + m_IsActive = isActive; + } + + public override void Execute() + { + AfterImagePool.Instance.Activate(m_IsActive); + } +} diff --git a/Assets/Scripts/Avatar/Actions/ActionEffects/ActionActivateAfterImage.cs.meta b/Assets/Scripts/Avatar/Actions/ActionEffects/ActionActivateAfterImage.cs.meta new file mode 100644 index 00000000..189e2f24 --- /dev/null +++ b/Assets/Scripts/Avatar/Actions/ActionEffects/ActionActivateAfterImage.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8df8331b2b9416b499e856b691c2326e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Avatar/Actions/ActionEffects/ActionAfterImageInterval.cs b/Assets/Scripts/Avatar/Actions/ActionEffects/ActionAfterImageInterval.cs new file mode 100644 index 00000000..1d5c2f8b --- /dev/null +++ b/Assets/Scripts/Avatar/Actions/ActionEffects/ActionAfterImageInterval.cs @@ -0,0 +1,18 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class ActionAfterImageInterval : ActionBase +{ + private int m_Interval; + + public ActionAfterImageInterval(int interval) + { + m_Interval = interval; + } + + public override void Execute() + { + AfterImagePool.Instance.SetInterval(m_Interval); + } +} diff --git a/Assets/Scripts/Avatar/Actions/ActionEffects/ActionAfterImageInterval.cs.meta b/Assets/Scripts/Avatar/Actions/ActionEffects/ActionAfterImageInterval.cs.meta new file mode 100644 index 00000000..fa144bad --- /dev/null +++ b/Assets/Scripts/Avatar/Actions/ActionEffects/ActionAfterImageInterval.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e87b2df9fee7956449df7dc2d430b862 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Avatar/Actions/ActionEffects/ActionPlayEffect.cs b/Assets/Scripts/Avatar/Actions/ActionEffects/ActionPlayEffect.cs new file mode 100644 index 00000000..6a00aaa8 --- /dev/null +++ b/Assets/Scripts/Avatar/Actions/ActionEffects/ActionPlayEffect.cs @@ -0,0 +1,49 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +// 播放特效 +public class ActionPlayEffect : ActionBase +{ + enum Type + { + GivenPosition, // 固定位置 + FollowObject, // 动态位置 + Avatar, // 角色 + } + + Type m_Type; + + string m_Effect; + Vector3 m_Position; + Vector3 m_Rotation; + Vector3 m_Scale; + Transform m_Follow; + Avatar m_Avatar; + + public ActionPlayEffect(string effect, Vector3 position, Vector3 rotation, Vector3 scale) + { + + } + + public ActionPlayEffect(string effect, Transform followPosition, Vector3 rotation, Vector3 scale) + { + + } + + public ActionPlayEffect(string effect, Avatar avatar, Vector3 rotation, Vector3 scale) + { + m_Type = Type.Avatar; + m_Effect = effect; + m_Avatar = avatar; + m_Rotation = rotation; + m_Scale = scale; + } + + public override void Execute() + { + if (m_Type == Type.Avatar) + m_Position = m_Avatar.GetEffectPosition(); + EffectsManager.Instance.PlayEffect(m_Effect, m_Position, m_Rotation, m_Scale); + } +} diff --git a/Assets/Scripts/Avatar/Actions/ActionEffects/ActionPlayEffect.cs.meta b/Assets/Scripts/Avatar/Actions/ActionEffects/ActionPlayEffect.cs.meta new file mode 100644 index 00000000..0e085fc4 --- /dev/null +++ b/Assets/Scripts/Avatar/Actions/ActionEffects/ActionPlayEffect.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ca4c24da837b8854f8510118217e063d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Avatar/Avatar.cs b/Assets/Scripts/Avatar/Avatar.cs index a8d90fa7..928d2197 100644 --- a/Assets/Scripts/Avatar/Avatar.cs +++ b/Assets/Scripts/Avatar/Avatar.cs @@ -131,4 +131,9 @@ public class Avatar : MonoBehaviour, IInteractable m_AbilitySystem.OnLateUpdate(); } + public virtual Vector3 GetEffectPosition() + { + return Vector3.zero; + } + } diff --git a/Assets/Scripts/Avatar/Trigger.cs b/Assets/Scripts/Avatar/Trigger.cs index 70a6d0f4..a885327c 100644 --- a/Assets/Scripts/Avatar/Trigger.cs +++ b/Assets/Scripts/Avatar/Trigger.cs @@ -31,17 +31,23 @@ public sealed class Trigger } private ConditionBase m_Condition; - private List m_ActionChain = new List(); - + private List m_ActionChain = new List(); + + private TriggerOnlyOnce m_OnlyOnce; + + private bool m_IsTriggered; + public Trigger(ConditionBase condition, List actions, TriggerOnlyOnce onlyOnce = TriggerOnlyOnce.Off, TriggerSwallow swallow = TriggerSwallow.On) { - m_Swallow = swallow; + m_OnlyOnce = onlyOnce; + m_Swallow = swallow; m_Condition = condition; m_ActionChain.AddRange(actions); } public Trigger(ConditionBase condition, ActionBase action, TriggerOnlyOnce onlyOnce = TriggerOnlyOnce.Off, TriggerSwallow swallow = TriggerSwallow.On) { - m_Swallow = swallow; + m_OnlyOnce = onlyOnce; + m_Swallow = swallow; m_Condition = condition; m_ActionChain.Add(action); } @@ -49,8 +55,8 @@ public sealed class Trigger //重置触发器的参数 public void Reset() { - - } + m_IsTriggered = false; + } /// /// 如果触发执行了,返回true,否则返回false @@ -58,12 +64,15 @@ public sealed class Trigger /// public bool Update() { + if (m_IsTriggered && m_OnlyOnce == TriggerOnlyOnce.On) + return false; if (m_Condition.Evaluate()) { foreach(var action in m_ActionChain) { action.Execute(); } + m_IsTriggered = true; return true; } return false; diff --git a/Assets/Scripts/Effects/AfterImage/AfterImage.cs b/Assets/Scripts/Effects/AfterImage/AfterImage.cs index 445a16c2..123c0300 100644 --- a/Assets/Scripts/Effects/AfterImage/AfterImage.cs +++ b/Assets/Scripts/Effects/AfterImage/AfterImage.cs @@ -48,9 +48,6 @@ public class AfterImage : MonoBehaviour { for(int i = 0;i < renderer.materials.Length; ++i) { - renderer.materials[i].SetColor("_Color", Color.red); - renderer.materials[i].SetColor("_Color1", Color.white); - renderer.materials[i].SetColor("_Color2", Color.white); renderer.materials[i].SetFloat("_Intensity", intensity); renderer.materials[i].SetFloat("_MKGlowPower", intensity); } diff --git a/Assets/Scripts/Effects/AfterImage/AfterImagePool.cs b/Assets/Scripts/Effects/AfterImage/AfterImagePool.cs index 8b32fe38..38d3488d 100644 --- a/Assets/Scripts/Effects/AfterImage/AfterImagePool.cs +++ b/Assets/Scripts/Effects/AfterImage/AfterImagePool.cs @@ -4,9 +4,10 @@ using UnityEngine; public class AfterImagePool : MonoBehaviour { - - //public CharacterControl myCharacterControl; - public GameObject targetObject; //Set these manually to the character object you're copying + public static AfterImagePool Instance; + + //public CharacterControl myCharacterControl; + public GameObject targetObject; //Set these manually to the character object you're copying public Animator targetAnimator; //Set these manually to the character object you're copying public GameObject prefab; //This is the prefab you made in the scene. It's a parent transform with an animator and AfterImage script on it, with Armature and SkinnedMeshRenderer children public int poolSize = 10; @@ -16,6 +17,8 @@ public class AfterImagePool : MonoBehaviour public int time = 0; + private bool isActive = false; + // Use this for initialization void Start() { @@ -32,13 +35,17 @@ public class AfterImagePool : MonoBehaviour afterImages.Add(nextAfterImage.GetComponent()); } + Instance = this; } // Update is called once per frame void Update() { + if (!isActive) + return; + time++; - if (time > interval) + if (time >= interval) { time = 0; AddAfterImage(); @@ -56,4 +63,16 @@ public class AfterImagePool : MonoBehaviour } } } + + public void Activate(bool isActive) + { + this.isActive = isActive; + time = isActive ? interval : 0; + } + + public void SetInterval(int interval) + { + this.interval = interval; + } + } \ No newline at end of file diff --git a/Assets/Scripts/Effects/Effect.cs b/Assets/Scripts/Effects/Effect.cs new file mode 100644 index 00000000..a8f0d37f --- /dev/null +++ b/Assets/Scripts/Effects/Effect.cs @@ -0,0 +1,30 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class Effect : MonoBehaviour +{ + public string Name; + public float LifeTime; + + private float time; + + private void Awake() + { + } + + private void OnEnable() + { + time = 0; + } + + private void Update() + { + time += Time.deltaTime; + if(time > LifeTime) + { + EffectsManager.Instance.CycleEffect(this); + } + } + +} diff --git a/Assets/Scripts/Effects/Effect.cs.meta b/Assets/Scripts/Effects/Effect.cs.meta new file mode 100644 index 00000000..ea99b00a --- /dev/null +++ b/Assets/Scripts/Effects/Effect.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a0f48b3d527ef6c49999e8a4b9892cd9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Effects/EffectsManager.cs b/Assets/Scripts/Effects/EffectsManager.cs new file mode 100644 index 00000000..f62b0bdb --- /dev/null +++ b/Assets/Scripts/Effects/EffectsManager.cs @@ -0,0 +1,73 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using System; + +public class EffectsManager : MonoBehaviour +{ + public static EffectsManager Instance; + + public Effect[] EffectTemplates; + + public Transform Root_Pool; + + List m_Pool = new List(); + + private void Awake() + { + Instance = this; + } + + Effect GetEffectTemplate(string name) + { + foreach(var effect in EffectTemplates) + { + if(effect != null && effect.Name == name) + { + return effect; + } + } + return null; + } + + Effect RecycleEffect(string name) + { + foreach(var effect in m_Pool) + { + if (effect != null && effect.Name == name) + { + return effect; + } + } + return null; + } + + public void PlayEffect(string name, Vector3 position, Vector3 rotation, Vector3 scale) + { + Effect effect = RecycleEffect(name); + if(effect == null) + { + Effect temp = GetEffectTemplate(name); + effect = UnityEngine.Object.Instantiate(temp); + } + else + { + m_Pool.Remove(effect); + } + + effect.transform.position = position; + effect.transform.rotation = Quaternion.Euler(rotation); + effect.transform.localScale = scale; + effect.transform.SetParent(this.transform); + effect.gameObject.SetActive(true); + } + + // 回收特效 + public void CycleEffect(Effect effect) + { + effect.gameObject.SetActive(false); + effect.transform.SetParent(Root_Pool); + m_Pool.Add(effect); + } + +} diff --git a/Assets/Scripts/Effects/EffectsManager.cs.meta b/Assets/Scripts/Effects/EffectsManager.cs.meta new file mode 100644 index 00000000..b8dd8f96 --- /dev/null +++ b/Assets/Scripts/Effects/EffectsManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: db461c57209f8a241a28d33730ad12ef +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Props.meta b/Assets/Scripts/Props.meta new file mode 100644 index 00000000..bb96602e --- /dev/null +++ b/Assets/Scripts/Props.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f299520ed9fcf4a45858ad4ef5a8d5d1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Test/SaionjiScript_Ability.cs b/Assets/Scripts/Test/SaionjiScript_Ability.cs index 665b787c..ae211b89 100644 --- a/Assets/Scripts/Test/SaionjiScript_Ability.cs +++ b/Assets/Scripts/Test/SaionjiScript_Ability.cs @@ -136,10 +136,15 @@ public partial class SaionjiScript : Avatar ActionEffectGhost enableGhost = new ActionEffectGhost(Effects[0] as CharacterGhostEffect); ActionDisableGhost disableGhost = new ActionDisableGhost(Effects[0] as CharacterGhostEffect); - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // conditions - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - ConditionCommand condLeftCmd = new ConditionCommand(GamepadButton.Left); + ActionActivateAfterImage enableAfterImage = new ActionActivateAfterImage(true); + ActionActivateAfterImage disaleAfterImage = new ActionActivateAfterImage(false); + ActionAfterImageInterval smallAfterImageInterval = new ActionAfterImageInterval(2); + ActionAfterImageInterval midiumAfterImageInterval = new ActionAfterImageInterval(5); + + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // conditions + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + ConditionCommand condLeftCmd = new ConditionCommand(GamepadButton.Left); ConditionCommand condRightCmd = new ConditionCommand(GamepadButton.Right); ConditionNoMoveButtonHold condNoMoveButtonHold = new ConditionNoMoveButtonHold(); ConditionButtonHold condRightButtonHold = new ConditionButtonHold(GamepadButton.Right); @@ -226,11 +231,11 @@ public partial class SaionjiScript : Avatar move.AddTrigger(trigger); // jump ability - trigger = new Trigger(Ands(condInAir, condRightCmd, condRight2Cmd), new List { towardRight, switchToAirDash, new ActionSetVelocity(m_Body, new Vector3(25, 0, 0)), new ActionDontUseGravity(m_Body) }); + trigger = new Trigger(Ands(condInAir, condRightCmd, condRight2Cmd), new List { towardRight, switchToAirDash, new ActionSetVelocity(m_Body, new Vector3(25, 0, 0)), new ActionDontUseGravity(m_Body), enableAfterImage, midiumAfterImageInterval}); jump.AddTrigger(trigger); - trigger = new Trigger(Ands(condInAir, condLeftCmd, condLeft2Cmd), new List { towardLeft, switchToAirDash, new ActionSetVelocity(m_Body, new Vector3(-25, 0, 0)), new ActionDontUseGravity(m_Body) }); + trigger = new Trigger(Ands(condInAir, condLeftCmd, condLeft2Cmd), new List { towardLeft, switchToAirDash, new ActionSetVelocity(m_Body, new Vector3(-25, 0, 0)), new ActionDontUseGravity(m_Body), enableAfterImage, midiumAfterImageInterval }); jump.AddTrigger(trigger); - trigger = new Trigger(Ands(condInAir, condCircleCmd), new List { switchToAirAttk1, new ActionSetLocalVelocity(m_Body, new Vector3(0, 0, 0)), new ActionDontUseGravity(m_Body)}); + trigger = new Trigger(Ands(condInAir, condCircleCmd), new List { switchToAirAttk1, new ActionSetLocalVelocity(m_Body, new Vector3(0, 0, 0)), new ActionDontUseGravity(m_Body), enableAfterImage, smallAfterImageInterval}); jump.AddTrigger(trigger); ConditionCheckJumpState condCheckJump = new ConditionCheckJumpState(jump, JumpAbility.State.None, JumpAbility.Direction.Neutral); trigger = new Trigger(And(condRightButtonHold, condCheckJump), new List { towardRight, new ActionSetVelocityX(m_Body, 4)}, TriggerOnlyOnce.Off, TriggerSwallow.Off); @@ -376,14 +381,21 @@ public partial class SaionjiScript : Avatar trigger = new Trigger(And(condGun4MotionRange, condLeft2Cmd), new List { switchToDash, towardLeft }); gun4.AddTrigger(trigger); - // air dash - trigger = new Trigger(new ConditionMotionAtEnd(animator, Anim_AirDash), new List { new ActionSetVelocity(m_Body, Vector3.zero), new ActionUseGravity(m_Body), toJump }); + // air dash + trigger = new Trigger(new ConditionMotionRange(animator, 0.8f, 1f), disaleAfterImage, TriggerOnlyOnce.On, TriggerSwallow.Off); + airDash.AddTrigger(trigger); + trigger = new Trigger(new ConditionMotionAtEnd(animator, Anim_AirDash), new List { new ActionSetVelocity(m_Body, Vector3.zero), new ActionUseGravity(m_Body), toJump }); airDash.AddTrigger(trigger); - trigger = new Trigger(new ConditionMotionAtEnd(animator, Anim_AirAttack1), new List { new ActionSetVelocity(m_Body, Vector3.zero), new ActionUseGravity(m_Body), toJump }); + trigger = new Trigger(new ConditionMotionRange(animator, 0.18f, 1f), new ActionPlayEffect("Air_Attk1", this, new Vector3(-136.805f, 0, 0), new Vector3(0.8f, 0.8f, 0.8f)), TriggerOnlyOnce.On, TriggerSwallow.Off); + airAttk1.AddTrigger(trigger); + trigger = new Trigger(new ConditionMotionRange(animator, 0.6f,1f), disaleAfterImage, TriggerOnlyOnce.On, TriggerSwallow.Off); + airAttk1.AddTrigger(trigger); + trigger = new Trigger(new ConditionMotionAtEnd(animator, Anim_AirAttack1), new List { new ActionSetVelocity(m_Body, Vector3.zero), new ActionUseGravity(m_Body), toJump}); airAttk1.AddTrigger(trigger); + airAttk1.AddHitDefination(hitDef); - m_AbilitySystem.ForceStart(idle); + m_AbilitySystem.ForceStart(idle); } } \ No newline at end of file diff --git a/Assets/Scripts/Test/SaionjiScript_Effect.cs b/Assets/Scripts/Test/SaionjiScript_Effect.cs new file mode 100644 index 00000000..f07ce915 --- /dev/null +++ b/Assets/Scripts/Test/SaionjiScript_Effect.cs @@ -0,0 +1,13 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public partial class SaionjiScript : Avatar +{ + public Transform m_Hips; + + public override Vector3 GetEffectPosition() + { + return m_Hips.position; + } +} diff --git a/Assets/Scripts/Test/SaionjiScript_Effect.cs.meta b/Assets/Scripts/Test/SaionjiScript_Effect.cs.meta new file mode 100644 index 00000000..d24fd6f2 --- /dev/null +++ b/Assets/Scripts/Test/SaionjiScript_Effect.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 69ccf56f65f14b84a89682dbe0cdb58e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: -- cgit v1.1-26-g67d0