commit ff6aacf829709c32a6fb408f27b0ba28ba2382ee
parent 30048e5593c8986c4ac83aa38a8eb5053be4511c
Author: PlutoTank <qwolkensperg@gmail.com>
Date: Thu, 16 Apr 2020 04:08:18 -0400
Orbital Dropping
Diffstat:
5 files changed, 63 insertions(+), 0 deletions(-)
diff --git a/Assets/Scripts/Slimecing/Swords/DropBehaviour/DropBehaviours.meta b/Assets/Scripts/Slimecing/Swords/DropBehaviour/DropBehaviours.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 2778a57bec62b3e4d9bfd30f93992113
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Slimecing/Swords/DropBehaviour/DropBehaviours/RigidbodyDropLogic.cs b/Assets/Scripts/Slimecing/Swords/DropBehaviour/DropBehaviours/RigidbodyDropLogic.cs
@@ -0,0 +1,24 @@
+using UnityEngine;
+
+namespace Slimecing.Swords.DropBehaviour.DropBehaviours
+{
+ public class RigidbodyDropLogic : DropLogic
+ {
+ [SerializeField] private Rigidbody rigidbody;
+
+ public override void Drop()
+ {
+ if (rigidbody.isKinematic)
+ {
+ rigidbody.isKinematic = false;
+ }
+
+ if (!rigidbody.useGravity)
+ {
+ rigidbody.useGravity = true;
+ }
+
+ rigidbody.velocity = Vector3.zero;
+ }
+ }
+}
diff --git a/Assets/Scripts/Slimecing/Swords/DropBehaviour/DropBehaviours/RigidbodyDropLogic.cs.meta b/Assets/Scripts/Slimecing/Swords/DropBehaviour/DropBehaviours/RigidbodyDropLogic.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: c493037ae95819d4fa0c1961a904570a
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Slimecing/Swords/DropBehaviour/DropLogic.cs b/Assets/Scripts/Slimecing/Swords/DropBehaviour/DropLogic.cs
@@ -0,0 +1,9 @@
+using UnityEngine;
+
+namespace Slimecing.Swords.DropBehaviour
+{
+ public abstract class DropLogic : MonoBehaviour
+ {
+ public abstract void Drop();
+ }
+}
diff --git a/Assets/Scripts/Slimecing/Swords/DropBehaviour/DropLogic.cs.meta b/Assets/Scripts/Slimecing/Swords/DropBehaviour/DropLogic.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 2e271858cded4c44a8924b7eaf9794c0
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant: