private void Awake() { if (instance == null) { instance = this; } }
void ShowDeathPanel() { deathPanel.SetActive(true); DeathPanel dPanel = deathPanel.GetComponent <DeathPanel>(); dPanel.ShowDeathPanel(); }
void Start() { #if UNITY_EDITOR editor = true; #endif Time.timeScale = 0; //You get the Rigidbody component you attach to the GameObject m_Rigidbody = GetComponent <Rigidbody2D>(); anim = GetComponent <Animator> (); rend = GetComponent <SpriteRenderer>(); ft = FlashingText.ft; DP = DeathPanel.instance; WP = WinPanel.instance; UIP = UIPanel.instance; //Initialising the force which is used on GameObject in various ways m_JumpForce = new Vector3(0.0f, jumpStrength, 0.0f); m_DashForce = new Vector3(dashStrength, 0.0f, 0.0f); doublejump = PlayerPrefs.GetInt("double jump", 0); if (doublejump == 1) { print("doublejump unlocked"); } jumpStart = false; tRight = false; tLeft = false; }
public void OnStart() { for (int i = 0; i <= mRows * mCols + 1; ++i) { GameObject go = GameObject.GetGameObjectByName(Common.prefix + dDeathPanel + i.ToString(), false); if (go != null) { DeathPanel script = GetScript <DeathPanel>(go, false); if (script != null) { mDeathPanels.Add(script); } } } foreach (GameObject obj in GameObject.GetGameObjectsWithTag("endlights")) { mLights.Add(obj.RequireComponent <CLight>()); } if (mDeathPanels.Count != (mRows * mCols + mAdditional)) { Logger.Log("Wrong init for DeathPanelController, less than 14 panels registered!"); } envControllerScript = GetScript <PuzzleCEnvironmentController>(gameObject); if (envControllerScript == null) { Logger.Log("Missing dependency script"); } RandomizePanels(); }
public void OnFireBoots(InputValue val) { DeathPanel.OnFireBoots(); if (!Pause.Paused) { if (MainGun != null) { MainGun.TryShootGun(); } } }
protected override void Awake() { base.Awake(); healthInfo = GameObject.FindObjectOfType <HealthUI>(); ammoInfo = GameObject.FindObjectOfType <BulletUI>(); activeItemInfo = GameObject.FindObjectOfType <ActiveItemUI>(); notificationPanel = GameObject.FindObjectOfType <NotificationUI>(); deathPanel = GameObject.FindObjectOfType <DeathPanel>(); notificationPanel.gameObject.SetActive(false); EventManager.Instance.OnNotifyChange += SendNotification; EventManager.Instance.onAmmoChange += updateAmmoUI; EventManager.Instance.onHealthTrigger += updatehealthUI; EventManager.Instance.onMaxHealthTrigger += updateMaxHealthUI; EventManager.Instance.onItemPickupTrigger += updateActiveItemPickupUI; EventManager.Instance.onItemActivateTrigger += updateActiveItemUseUI; }
void Awake() { deathPanel = FindObjectOfType <DeathPanel>(); levelCompletePanel = FindObjectOfType <LevelComplete>(); musicController = FindObjectOfType <Music>(); }