summaryrefslogtreecommitdiff
path: root/Assets/Scripts/Unit
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-07-23 18:42:13 +0800
committerchai <chaifix@163.com>2021-07-23 18:42:13 +0800
commit4ceee84cd45e4e3ec40ebd888e41bd47a938c2d5 (patch)
tree7ab020f3c784a90eec9e8a100db68039b5306b45 /Assets/Scripts/Unit
parentcb893e1e5e4820cb800836cf6b8a79a1cd986cdc (diff)
*misc
Diffstat (limited to 'Assets/Scripts/Unit')
-rw-r--r--Assets/Scripts/Unit/Events/AnimationEventBase.cs24
-rw-r--r--Assets/Scripts/Unit/Events/EventEffect.cs1
-rw-r--r--Assets/Scripts/Unit/Events/EventProjectile.cs32
-rw-r--r--Assets/Scripts/Unit/Events/EventProjectile.cs.meta11
4 files changed, 68 insertions, 0 deletions
diff --git a/Assets/Scripts/Unit/Events/AnimationEventBase.cs b/Assets/Scripts/Unit/Events/AnimationEventBase.cs
index 774f7b38..42fe6460 100644
--- a/Assets/Scripts/Unit/Events/AnimationEventBase.cs
+++ b/Assets/Scripts/Unit/Events/AnimationEventBase.cs
@@ -8,4 +8,28 @@ public abstract class AnimationEventBase : ScriptableObject
public int startFrame;
public abstract TimelineEvent.EEventType type { get; }
+
+ public string fullName
+ {
+ get
+ {
+ return this.type.ToString();
+ }
+ }
+
+ public string Name
+ {
+ get
+ {
+ string name = fullName.Replace("Event", "");
+ //int underscore = name.IndexOf('_');
+ //if (underscore != -1)
+ //{
+ // name = name.Substring(underscore + 1, name.Length - underscore - 1);
+ //}
+ return name;
+ }
+ }
+
+ public abstract string shortName { get; }
}
diff --git a/Assets/Scripts/Unit/Events/EventEffect.cs b/Assets/Scripts/Unit/Events/EventEffect.cs
index 449b1e23..9aaf8d9f 100644
--- a/Assets/Scripts/Unit/Events/EventEffect.cs
+++ b/Assets/Scripts/Unit/Events/EventEffect.cs
@@ -5,6 +5,7 @@ using UnityEngine;
public class EventEffect : AnimationEventBase
{
public override TimelineEvent.EEventType type { get { return TimelineEvent.EEventType.EventEffect; } }
+ public override string shortName { get { return "E"; } }
[Tooltip("Effect path")]
public string effectPath;
diff --git a/Assets/Scripts/Unit/Events/EventProjectile.cs b/Assets/Scripts/Unit/Events/EventProjectile.cs
new file mode 100644
index 00000000..526628e8
--- /dev/null
+++ b/Assets/Scripts/Unit/Events/EventProjectile.cs
@@ -0,0 +1,32 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class EventProjectile : AnimationEventBase
+{
+ public override TimelineEvent.EEventType type { get { return TimelineEvent.EEventType.EventProjectile; } }
+
+ public override string shortName { get { return "P"; } }
+
+ [Tooltip("Projectile path")]
+ public string projectilePath;
+
+ [Tooltip("Is attached to a bone")]
+ public bool attached;
+
+ [Tooltip("Bone path attach to")]
+ public string bone;
+
+ [Tooltip("Position offset")]
+ public Vector3 position;
+
+ [Tooltip("Rotation in euler")]
+ public Vector3 rotation;
+
+ [Tooltip("Scale")]
+ public Vector3 scale;
+
+ [Tooltip("Initial velocity")]
+ public Vector3 velocity;
+
+}
diff --git a/Assets/Scripts/Unit/Events/EventProjectile.cs.meta b/Assets/Scripts/Unit/Events/EventProjectile.cs.meta
new file mode 100644
index 00000000..4afba321
--- /dev/null
+++ b/Assets/Scripts/Unit/Events/EventProjectile.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 75c54c029c766614590737d26471b7a4
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant: