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; }
private void CleanUpFloatingHealthBar() { if (_healthbarInterface != null) { _healthbarInterface.Destroy(); } _healthbarInterface = null; }