public override void Awake() { if (uiManager == null) { uiManager = GetComponentInParent <BaseUIManager>(); } base.Awake(); }
void Awake() { playerController = GetComponent <PlayerController>(); switchManager = GetComponent <SwitchManager>(); baseUIManager = GameObject.FindGameObjectWithTag("BaseUI").GetComponent <BaseUIManager>(); keyHoldDelayReset = keyHoldDelay; }
void Start() { //ConsumableManager.instance.onConsumableUsedCallback += OnItemConsumed; animator = GetComponent <Animator>(); takeDamageHash = Animator.StringToHash("getHit"); loseHash = Animator.StringToHash("lose"); uiManager = FindObjectOfType <BaseUIManager>(); CurrentHealth = maxHealth; }
public virtual void Awake() { if (uiManager == null) { uiManager = GetComponentInParent <BaseUIManager>(); } if (uiAnimator == null) { uiAnimator = GetComponent <Animator>(); } AutoLinkUI(); }
void InstanceManagement() { if (baseUIManager != null && baseUIManager != this) { Destroy(gameObject); return; } else { baseUIManager = this; } DontDestroyOnLoad(gameObject); }
protected override void OnPrimaryFire() { GameObject bullet = Instantiate(bulletPrefab, bulletSpawnPoint.position, bulletSpawnPoint.rotation); bullet.GetComponent <BaseBullet>().Team = team; bullet.GetComponent <BaseBullet>().Holder = holder; bullet.GetComponent <Rigidbody>().velocity += this.GetComponent <Rigidbody>().velocity; Physics.IgnoreCollision(this.GetComponentInParent <Collider>(), bullet.GetComponent <Collider>()); BaseUIManager holdersUI = Holder.GetComponent <BaseUIManager>(); if (holdersUI != null) { holdersUI.SetShownAmmo(ammo); } }
public static void PauseGame() { if (canPause) { if (isPaused) { Time.timeScale = 1; isPaused = false; state = "Playing"; BaseUIManager.PauseGameUI(); } else { Time.timeScale = 0; isPaused = true; state = "Paused"; BaseUIManager.PauseGameUI(); } } }