API
This commit is contained in:
@@ -1,24 +1,28 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine; using Game; using Music; using Player;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
public class PlayerCardCreator : MonoBehaviour
|
||||
namespace Game
|
||||
{
|
||||
public static PlayerCardCreator Instance;
|
||||
|
||||
public GameObject playerJoinCardPrefab;
|
||||
|
||||
private void Awake() // Ensures only one instance of PlayerCardCreator exists
|
||||
public class PlayerCardCreator : MonoBehaviour
|
||||
{
|
||||
if (Instance == null) Instance = this;
|
||||
else
|
||||
public static PlayerCardCreator Instance;
|
||||
|
||||
public GameObject playerJoinCardPrefab;
|
||||
|
||||
private void Awake() // Ensures only one instance of PlayerCardCreator exists
|
||||
{
|
||||
Destroy(gameObject);
|
||||
if (Instance == null) Instance = this;
|
||||
else
|
||||
{
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
public PlayerJoinCard CreateCard() // Creates a player join card
|
||||
{
|
||||
GameObject card = Instantiate(playerJoinCardPrefab, transform);
|
||||
return card.GetComponent<PlayerJoinCard>();
|
||||
}
|
||||
}
|
||||
|
||||
public PlayerJoinCard CreateCard() // Creates a player join card
|
||||
{
|
||||
GameObject card = Instantiate(playerJoinCardPrefab, transform);
|
||||
return card.GetComponent<PlayerJoinCard>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine; using Game; using Music; using Player;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
namespace Game
|
||||
{
|
||||
public class EventSystemizer : MonoBehaviour
|
||||
{
|
||||
private void Update() // Ensures only one instance of EventSystem exists
|
||||
@@ -12,3 +14,4 @@ public class EventSystemizer : MonoBehaviour
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,8 @@
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
using UnityEngine; using Game; using Music; using Player;
|
||||
|
||||
namespace Game
|
||||
{
|
||||
|
||||
public class FallPlatform : MonoBehaviour
|
||||
{
|
||||
@@ -52,3 +55,4 @@ public class FallPlatform : MonoBehaviour
|
||||
transform.parent.rotation = Quaternion.identity;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,12 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine; using Game; using Music; using Player;
|
||||
using UnityEngine.Events;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace Game
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// The GameManager class manages the overall game logic, including game modes, player states,
|
||||
/// game events, and game-over conditions. It ensures a single instance exists and provides
|
||||
@@ -307,3 +311,4 @@ public class GameManager : MonoBehaviour
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine; using Game; using Music; using Player;
|
||||
namespace Game
|
||||
{
|
||||
|
||||
[ExecuteAlways]
|
||||
public class GameManagerHelper : MonoBehaviour
|
||||
@@ -21,3 +23,4 @@ public class GameManagerHelper : MonoBehaviour
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine; using Game; using Music; using Player;
|
||||
using UnityEngine.UI;
|
||||
namespace Game
|
||||
{
|
||||
|
||||
public class GameTimer : MonoBehaviour
|
||||
{
|
||||
@@ -56,3 +58,4 @@ public class GameTimer : MonoBehaviour
|
||||
GameManager.Instance.GameOver();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine; using Game; using Music; using Player;
|
||||
namespace Game
|
||||
{
|
||||
|
||||
public class HatRespawn : MonoBehaviour
|
||||
{
|
||||
@@ -54,3 +56,4 @@ public class HatRespawn : MonoBehaviour
|
||||
isDropped = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine; using Game; using Music; using Player;
|
||||
namespace Game
|
||||
{
|
||||
|
||||
public class HealthBarManager : MonoBehaviour
|
||||
{
|
||||
@@ -53,3 +55,4 @@ public class HealthBarManager : MonoBehaviour
|
||||
playerHealthBars.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using UnityEngine;
|
||||
|
||||
using UnityEngine; using Game; using Music; using Player;
|
||||
namespace Game
|
||||
{
|
||||
public class InfiniteScroll : MonoBehaviour
|
||||
{
|
||||
public float speed;
|
||||
@@ -20,3 +21,4 @@ public class InfiniteScroll : MonoBehaviour
|
||||
transform.position += speed * Time.deltaTime * Vector3.right;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine; using Game; using Music; using Player;
|
||||
using TMPro;
|
||||
using UnityEngine.UI;
|
||||
namespace Game
|
||||
{
|
||||
|
||||
public class LeaderboardManager : MonoBehaviour
|
||||
{
|
||||
@@ -85,4 +87,4 @@ public class LeaderboardManager : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine; using Game; using Music; using Player;
|
||||
using UnityEngine.UI;
|
||||
namespace Game
|
||||
{
|
||||
|
||||
public class LifeDisplayManager : MonoBehaviour
|
||||
{
|
||||
@@ -44,3 +46,4 @@ public class LifeDisplayManager : MonoBehaviour
|
||||
players.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine; using Game; using Music; using Player;
|
||||
using UnityEngine.UI;
|
||||
namespace Game
|
||||
{
|
||||
|
||||
public class MapSelect : MonoBehaviour
|
||||
{
|
||||
@@ -16,3 +18,4 @@ public class MapSelect : MonoBehaviour
|
||||
GameManager.map = toggle.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine; using Game; using Music; using Player;
|
||||
using UnityEngine.UI;
|
||||
namespace Game
|
||||
{
|
||||
|
||||
public class ModeSelect : MonoBehaviour
|
||||
{
|
||||
@@ -27,3 +29,4 @@ public class ModeSelect : MonoBehaviour
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine; using Game; using Music; using Player;
|
||||
namespace Game
|
||||
{
|
||||
|
||||
public class MovingPlatform : MonoBehaviour
|
||||
{
|
||||
@@ -28,4 +30,4 @@ public class MovingPlatform : MonoBehaviour
|
||||
// transform.position = Vector2.MoveTowards(transform.position, points[i].position, speed * Time.deltaTime);
|
||||
GetComponent<Rigidbody2D>().MovePosition(Vector2.MoveTowards(transform.position, points[i].position, speed * Time.fixedDeltaTime));
|
||||
}
|
||||
}
|
||||
}}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using UnityEngine;
|
||||
|
||||
using UnityEngine; using Game; using Music; using Player;
|
||||
namespace Game
|
||||
{
|
||||
public class ObjectVisibility : MonoBehaviour
|
||||
{
|
||||
void Start()
|
||||
@@ -24,3 +25,4 @@ public class ObjectVisibility : MonoBehaviour
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine; using Game; using Music; using Player;
|
||||
namespace Game
|
||||
{
|
||||
|
||||
public class PlayerJoinCard : MonoBehaviour
|
||||
{
|
||||
@@ -12,3 +14,4 @@ public class PlayerJoinCard : MonoBehaviour
|
||||
playerNumberText.text = playerNumber.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using UnityEngine;
|
||||
|
||||
using UnityEngine; using Game; using Music; using Player;
|
||||
namespace Game
|
||||
{
|
||||
public class RespawnOnTriggerEnter : MonoBehaviour
|
||||
{
|
||||
public Vector2 spawnPoint;
|
||||
@@ -25,4 +26,4 @@ public class RespawnOnTriggerEnter : MonoBehaviour
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}}
|
||||
@@ -1,7 +1,9 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine; using Game; using Music; using Player;
|
||||
using TMPro;
|
||||
namespace Game
|
||||
{
|
||||
|
||||
public class TerribleHealthBarScript : MonoBehaviour
|
||||
{
|
||||
@@ -78,3 +80,4 @@ public class TerribleHealthBarScript : MonoBehaviour
|
||||
targetActualColor = actualHealthVisual.GetComponent<SpriteRenderer>().color;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine; using Game; using Music; using Player;
|
||||
namespace Game
|
||||
{
|
||||
|
||||
public class WinScreen : MonoBehaviour
|
||||
{
|
||||
@@ -33,3 +35,4 @@ public class WinScreen : MonoBehaviour
|
||||
GetComponent<Animator>().SetTrigger("win");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user