Example #1
0
    void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
        }
        else if (Instance != this)
        {
            Destroy(gameObject);
            DontDestroyOnLoad(gameObject);
        }

        playerController = FindObjectOfType <PlayerController>();
        playerFunction   = FindObjectOfType <PlayerFunction>();
    }
Example #2
0
 /// <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;
 }
Example #3
0
 void Start()
 {
     pc = GameManager.Instance.playerFunction;
 }
Example #4
0
 private void Start()
 {
     pf = GameManager.Instance.playerFunction;
     pc = GameManager.Instance.playerController;
 }