diff options
Diffstat (limited to 'Assets/Scripts')
| -rw-r--r-- | Assets/Scripts/DiscordController.cs | 48 | ||||
| -rw-r--r-- | Assets/Scripts/DiscordController.cs.meta | 11 | ||||
| -rw-r--r-- | Assets/Scripts/PlayerMovement.cs | 7 |
3 files changed, 59 insertions, 7 deletions
diff --git a/Assets/Scripts/DiscordController.cs b/Assets/Scripts/DiscordController.cs new file mode 100644 index 0000000..db0eec1 --- /dev/null +++ b/Assets/Scripts/DiscordController.cs @@ -0,0 +1,48 @@ +using UnityEngine;
+
+public class DiscordController : MonoBehaviour
+{
+
+ public Discord.Discord discord;
+
+ // Use this for initialization
+ void Start () {
+ System.Environment.SetEnvironmentVariable("DISCORD_INSTANCE_ID", "0");
+ discord = new Discord.Discord(784835227338932244, (System.UInt64)Discord.CreateFlags.Default);
+ var activityManager = discord.GetActivityManager();
+ var activity = new Discord.Activity
+ {
+ State = "In Development...",
+ Details = "An upcoming Unity game by Alee!",
+ Assets =
+ {
+ LargeImage = "wip",
+ LargeText = "Work in Progress!"
+ }
+ };
+ activityManager.UpdateActivity(activity, (res) =>
+ {
+ if (res == Discord.Result.Ok)
+ {
+ Debug.LogWarning("Everything is fine!");
+ }
+ });
+
+ activityManager.ClearActivity((result) =>
+ {
+ if (result == Discord.Result.Ok)
+ {
+ Debug.Log("Success!");
+ }
+ else
+ {
+ Debug.LogError("Failed");
+ }
+ });
+ }
+
+ // Update is called once per frame
+ void Update () {
+ discord.RunCallbacks();
+ }
+}
diff --git a/Assets/Scripts/DiscordController.cs.meta b/Assets/Scripts/DiscordController.cs.meta new file mode 100644 index 0000000..7b42de8 --- /dev/null +++ b/Assets/Scripts/DiscordController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4cb25a675054556c4b6a193453e179c1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/PlayerMovement.cs b/Assets/Scripts/PlayerMovement.cs index cf131be..988bb88 100644 --- a/Assets/Scripts/PlayerMovement.cs +++ b/Assets/Scripts/PlayerMovement.cs @@ -8,8 +8,6 @@ public class PlayerMovement : MonoBehaviour public float gravity = -9.81f;
- public float jumpHeight = 3f;
-
public Transform groundCheck;
public float groundDistance = 0.4f;
@@ -36,11 +34,6 @@ public class PlayerMovement : MonoBehaviour controller.Move(move * speed * Time.deltaTime);
- if (Input.GetButtonDown("Jump") && isGrounded)
- {
- velocity.y = Mathf.Sqrt(jumpHeight * -2f * gravity);
- }
-
velocity.y += gravity * Time.deltaTime;
controller.Move(velocity * Time.deltaTime);
|
