예제 #1
0
 public void SetLocalPawn(PawnObserver pawn, UIHealthBarController healthBar)
 {
     if (LocalAsset != null)
     {
         UnityEngine.Object.Destroy(LocalAsset);
     }
     LocalAsset = pawn;
     SetPawn(PhotonNetwork.player, pawn, healthBar);
 }
예제 #2
0
        public void Init()
        {
            //Инициализировать данные
            m_HealthData = new Dictionary <AbilityTypes, HealthSegment>();
            for (int i = 0; i < HealthData.Length; i++)
            {
                if (!m_HealthData.ContainsKey(HealthData[i].Type))
                {
                    HealthData[i].Init();
                    m_HealthData.Add(HealthData[i].Type, HealthData[i]);
                }
            }

            //Инициализировать UI
            m_UIHealthBarController = PoolManager.GetObject(GameManager.Instance.PrefabLibrary.UIHealthBarPrefab) as UIHealthBarController;
            m_UIHealthBarController.transform.position = HealthBarSpawnPoint.position;
            m_UIHealthBarController.Init(transform, m_HealthData);
        }
예제 #3
0
 void Awake()
 {
     instance = this;
 }
예제 #4
0
 public void SetPawn(PhotonPlayer player, PawnObserver pawn, UIHealthBarController healthBar)
 {
     _pawns[pawn] = new PawnState(player, healthBar);
 }
예제 #5
0
 public PawnState(PhotonPlayer player, UIHealthBarController statusBar)
 {
     Player     = player;
     _statusBar = statusBar;
     Health     = HEALTH_START_I;
 }