void Awake() { if (Instance == null) { Instance = this; } else if (Instance != this) { Destroy(gameObject); DontDestroyOnLoad(gameObject); } playerController = FindObjectOfType <PlayerController>(); playerFunction = FindObjectOfType <PlayerFunction>(); }
/// <summary> /// Initializes a new instance of the <see cref="PlayerInfo"/> class. /// </summary> /// <param name="role">Принадлежность команде.</param> /// <param name="index">Индекс в списке (начинается с 0).</param> /// <param name="number">Номер игрока.</param> /// <param name="function">Функция игрока в команде.</param> /// <param name="name">Имя игрока.</param> /// <param name="country">Страна/город.</param> /// <param name="info">Дополнительная информация.</param> public PlayerInfo( TeamRole role, int index, int number, PlayerFunction function, string name, string country, string info) { Role = role; Index = index; Number = number; Function = function; Name = name ?? string.Empty; Country = country ?? string.Empty; Info = info ?? string.Empty; }
void Start() { pc = GameManager.Instance.playerFunction; }
private void Start() { pf = GameManager.Instance.playerFunction; pc = GameManager.Instance.playerController; }