예제 #1
0
        public override void Initialize()
        {
            name = $"NetPlayer_{photonView.owner.NickName}";
            transform.SetParent(GameObject.FindObjectOfType <PlayerContainer>().transform);

            AddListeners();
            Presenter.Initialize();

            _processInputs       = false;
            _jumpAwaitingRelease = false;
            _cleanedUp           = false;

            if (!photonView.isMine)
            {
                Properties.Rigidbody.isKinematic = true;
                Properties.MinimapEnemyIcon.SetActive(true);

                var container = FindObjectOfType <HealthbarContainer>();
                _healthbarInterface = Instantiate(Properties.HealthBarUI, container.transform, false) as IFloatingHealthBar;
                _healthbarInterface.Init(photonView, Properties.HealthbarAnchor);
            }
            else
            {
                Properties.MinimapCamera.SetActive(true);
            }

            _particlesContainer = FindObjectOfType <ParticleContainer>().transform;
        }
예제 #2
0
 private void CleanUpFloatingHealthBar()
 {
     if (_healthbarInterface != null)
     {
         _healthbarInterface.Destroy();
     }
     _healthbarInterface = null;
 }