Скрипты: Исправлена стилистика GameManager
This commit is contained in:
parent
3ade281440
commit
e9bfcb2cd0
@ -2784,7 +2784,7 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: 51375d97c071d8c4f93cf2aa6881d048, type: 3}
|
m_Script: {fileID: 11500000, guid: 51375d97c071d8c4f93cf2aa6881d048, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
coinText: {fileID: 6614787374390785080}
|
_coinText: {fileID: 6614787374390785080}
|
||||||
--- !u!114 &1102420991
|
--- !u!114 &1102420991
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -1,29 +1,25 @@
|
|||||||
using System;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
|
||||||
using TMPro;
|
using TMPro;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
public class GameManager : MonoBehaviour
|
public class GameManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
public static List<PlayerState> players = new List<PlayerState>();
|
#region Static Fields
|
||||||
|
|
||||||
|
public static List<PlayerState> players = new List<PlayerState>();
|
||||||
public static List<PlayerState> activePlayers = new List<PlayerState>();
|
public static List<PlayerState> activePlayers = new List<PlayerState>();
|
||||||
public static List<PlayerState> tempDeadPlayers = new List<PlayerState>();
|
public static List<PlayerState> tempDeadPlayers = new List<PlayerState>();
|
||||||
public static List<PlayerState> deadPlayers = new List<PlayerState>();
|
|
||||||
|
|
||||||
public static List<TileOwner> deadOwners = new List<TileOwner>();
|
public static List<TileOwner> deadOwners = new List<TileOwner>();
|
||||||
|
|
||||||
public static int coinsPerTree = 50;
|
public static int coinsPerTree = 50;
|
||||||
|
|
||||||
[SerializeField]
|
#endregion
|
||||||
private TextMeshProUGUI coinText;
|
|
||||||
|
[SerializeField] private TextMeshProUGUI _coinText;
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
activePlayers.Clear();
|
activePlayers.Clear();
|
||||||
tempDeadPlayers.Clear();
|
tempDeadPlayers.Clear();
|
||||||
deadPlayers.Clear();
|
|
||||||
players.Clear();
|
players.Clear();
|
||||||
DeathChecker.OnPlayerDeath += KillPlayer;
|
DeathChecker.OnPlayerDeath += KillPlayer;
|
||||||
DeathChecker.OnPlayerRes += ResPlayer;
|
DeathChecker.OnPlayerRes += ResPlayer;
|
||||||
@ -31,12 +27,11 @@ public class GameManager : MonoBehaviour
|
|||||||
GameData.OnCoinsCollected += UpdateCoinUI;
|
GameData.OnCoinsCollected += UpdateCoinUI;
|
||||||
players = FindPlayers();
|
players = FindPlayers();
|
||||||
SetupActivePlayers(players);
|
SetupActivePlayers(players);
|
||||||
//playersNOnStatic = players;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateCoinUI()
|
private void UpdateCoinUI()
|
||||||
{
|
{
|
||||||
coinText.text = GameData.coins.ToString();
|
_coinText.text = GameData.coins.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetupActivePlayers(List<PlayerState> allPlayers)
|
private void SetupActivePlayers(List<PlayerState> allPlayers)
|
||||||
@ -68,8 +63,8 @@ public class GameManager : MonoBehaviour
|
|||||||
{
|
{
|
||||||
player.ResetEnemies();
|
player.ResetEnemies();
|
||||||
}
|
}
|
||||||
|
|
||||||
deadOwners.Add(deadPlayer.ownerIndex);
|
deadOwners.Add(deadPlayer.ownerIndex);
|
||||||
//deadPlayers.Add(deadPlayer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<PlayerState> FindPlayers()
|
private List<PlayerState> FindPlayers()
|
||||||
@ -80,6 +75,7 @@ public class GameManager : MonoBehaviour
|
|||||||
{
|
{
|
||||||
resultPlayerList.Add(player);
|
resultPlayerList.Add(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
return resultPlayerList;
|
return resultPlayerList;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user