From 6761201c6321b50cd8d7517f8e502162b925ca0a Mon Sep 17 00:00:00 2001
From: miepzerino <o.skotnik@gmail.com>
Date: Sun, 10 Dec 2023 01:37:08 +0000
Subject: [PATCH] Added class for animation strings
---
Assets/Scripts/AnimationStrings.cs.meta | 11 +++++++++++
Assets/Scripts/PlayerController.cs | 6 ++----
Assets/Scripts/AnimationStrings.cs | 11 +++++++++++
3 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/Assets/Scripts/AnimationStrings.cs b/Assets/Scripts/AnimationStrings.cs
new file mode 100644
index 0000000..ac9b492
--- /dev/null
+++ b/Assets/Scripts/AnimationStrings.cs
@@ -0,0 +1,11 @@
+using System.Collections;
+using UnityEngine;
+
+internal class AnimationStrings
+{
+ internal class Player
+ {
+ internal static string IsMoving = "IsMoving";
+ internal static string IsFlying = "IsFlying";
+ }
+}
\ No newline at end of file
diff --git a/Assets/Scripts/AnimationStrings.cs.meta b/Assets/Scripts/AnimationStrings.cs.meta
new file mode 100644
index 0000000..796055d
--- /dev/null
+++ b/Assets/Scripts/AnimationStrings.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 9d7e1e1761a99344e9a9982a76ed283a
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/PlayerController.cs b/Assets/Scripts/PlayerController.cs
index 8004533..3381b36 100644
--- a/Assets/Scripts/PlayerController.cs
+++ b/Assets/Scripts/PlayerController.cs
@@ -18,7 +18,7 @@
private set
{
_isMoving = value;
- animator.SetBool("IsMoving", value);
+ animator.SetBool(AnimationStrings.Player.IsMoving, value);
}
}
@@ -30,7 +30,7 @@
private set
{
_isFlying = value;
- animator.SetBool("IsFlying", value);
+ animator.SetBool(AnimationStrings.Player.IsFlying, value);
rotorSprite.enabled = value;
}
}
@@ -75,8 +75,6 @@
private void FixedUpdate()
{
-
- Debug.Log(moveInput.x);
if (moveInput.y == 0)
{
if (rb.velocity.y <= maxFallSpeed)
--
Gitblit v1.10.0