From 2a061be5b19e7b85e58ae6405368e28bdc073048 Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 3 Sep 2021 19:54:38 +0800 Subject: *misc --- Assets/Scripts/Unit/Events/EventProjectile.cs | 21 ++++++++++++++++----- Assets/Scripts/Unit/TimelineEventProxy.cs | 4 ++++ 2 files changed, 20 insertions(+), 5 deletions(-) (limited to 'Assets/Scripts') diff --git a/Assets/Scripts/Unit/Events/EventProjectile.cs b/Assets/Scripts/Unit/Events/EventProjectile.cs index 0c1dc22b..5f9a22aa 100644 --- a/Assets/Scripts/Unit/Events/EventProjectile.cs +++ b/Assets/Scripts/Unit/Events/EventProjectile.cs @@ -4,6 +4,12 @@ using UnityEngine; public class EventProjectile : AnimationEventBase { + public enum EMoveType + { + GoStraight, + Curve, + } + public override TimelineEventProxy.EEventType type { get { return TimelineEventProxy.EEventType.EventProjectile; } } public override string shortName { get { return "P"; } } @@ -23,18 +29,23 @@ public class EventProjectile : AnimationEventBase [Tooltip("Rotation in euler")] public Vector3 rotation; - [Tooltip("Scale")] + [When("moveType", EMoveType.GoStraight), Tooltip("Scale")] public Vector3 scale = Vector3.one; - [Tooltip("初始速度")] + [Comment("[ 运动方式 ]", TextAnchor.MiddleCenter)] + + public EMoveType moveType; + + [When("moveType", EMoveType.GoStraight), Tooltip("初始速度")] public Vector3 velocity; - [Tooltip("朝向运动方向")] public bool towardDirection; - [Tooltip("击中效果")] - public ColliderBox.EHitResponse hitResponse; + [Comment("[ 击中反馈 ]", TextAnchor.MiddleCenter)] public string sparkPath; + [Tooltip("击中效果")] + public ColliderBox.EHitResponse hitResponse; + } diff --git a/Assets/Scripts/Unit/TimelineEventProxy.cs b/Assets/Scripts/Unit/TimelineEventProxy.cs index 7d2231c6..da4185a7 100644 --- a/Assets/Scripts/Unit/TimelineEventProxy.cs +++ b/Assets/Scripts/Unit/TimelineEventProxy.cs @@ -155,6 +155,8 @@ public partial class TimelineEventProxy if (effect == null) return; string path = effect.effectPath; + if (path == null || path == "") + return; GameObject prefab = ResourceManager.Instance.LoadAsset(path); if (prefab != null) { @@ -186,6 +188,8 @@ public partial class TimelineEventProxy if (e == null) return; string projectilePath = e.projectilePath; + if (projectilePath == null || projectilePath == "") + return; GameObject prefab = ResourceManager.Instance.LoadAsset(projectilePath); if(prefab == null) { -- cgit v1.1-26-g67d0