void OnCollisionEnter(Collision col) { if (!Activated) { Activated = true; an.SetBool("Open", true); try { Stats Entity = col.gameObject.GetComponent <Stats>(); if (Entity != null) { Entity.Health -= 50; } Life_Manager Player = col.gameObject.GetComponent <Life_Manager>(); if (Player != null) { Player.Health -= 50; } } catch {} StartCoroutine(Reset()); } }
public void BuyLife() { audio.clip = shopBuy; audio.Play(); Life_Manager.Instance().ResetLifes(); lfsConfirm.SetActive(true); }
public void ComfirmQuit() { Time.timeScale = 1; Life_Manager.Instance().SubstractLife(); loadingScreen.SetActive(true); StartCoroutine(LoadScreen4()); }
public void CloseLifeShop() { audio.clip = clickSound; audio.Play(); Life_Manager.Instance().FalseToLifeStore(); lifeShopPanel.SetActive(false); }
public void VictoryOrDefeat() { if (playerHp.fillAmount == 0f) { audiomanag.Stop(); audio.clip = defeatSound; audio.Play(); losePanel.SetActive(true); endGame = true; Life_Manager.Instance().SubstractLife(); } if (ennemyHp.fillAmount == 0f) { if (SceneManager.GetActiveScene().name.ToString() == "LVL2_Scene") { Life_Manager.Instance().UnlockLvl(); } if (SceneManager.GetActiveScene().name.ToString() == "LVL3_Scene") { Boost_Manager.Instance().AddBoost1(); congratPanel.SetActive(true); } audiomanag.Stop(); audio.clip = victorySound; audio.Play(); winPanel.SetActive(true); endGame = true; } }
public void ReturnToLifeShop() { Life_Manager.Instance().TrueToLifeStore(); audio.clip = clickSound; audio.Play(); Time.timeScale = 1; loadingScreen.SetActive(true); StartCoroutine(LoadScreen4()); }
// Update is called once per frame void Update() { DisplayLifes(); NoLifes(); LoadLifes(); lvlUnlock = Life_Manager.Instance().ReturnLVL3(); CheckLvl3(); lifeShopNeed = Life_Manager.Instance().ReturnLifeStore(); LifeShopNeed(); }
void Start() { an = GetComponentInChildren <Animator>(); r = GetComponent <Rigidbody>(); Player = GameObject.FindWithTag("Player"); life = Player.GetComponent <Life_Manager>(); inv = Player.GetComponent <Inventory>(); stats = GetComponent <Stats>(); InvokeRepeating("Damage", 0.20f, 0.20f); }
void Awake() { if (instance != null) { Destroy(gameObject); } else { instance = this; } }
void Start() { mov = gameObject.GetComponent <PlayerController>(); blan = blank.GetComponent <RawImage>(); na = blank.GetComponentInChildren <TextMeshProUGUI>(); an = body.GetComponent <Animator> (); LifeManager = gameObject.GetComponent <Life_Manager>(); select_tran = Selector.GetComponent <RectTransform>(); CreateInventory(); CreateHotbar(); Cursor.visible = false; }
// Update is called once per frame void Update() { if (endGame == false) { MaxMatchs(); CooldownPlayerHp(); VictoryOrDefeat(); CooldownTimer(); CooldownSprites(); } NoLifeIG(); CheckBoostsNb(); CheckBoostsDispo(); lifeCount = Life_Manager.Instance().SendLifeCount(); lifeText.text = " : " + lifeCount.ToString(); }
public void NoLifes() { noLife = Life_Manager.Instance().NoLifeAsk(); }
public void LoadLifes() { lifeCount = Life_Manager.Instance().SendLifeCount(); }
public void ResetLvl() { Life_Manager.Instance().LockLvl(); }