Example #1
0
    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());
        }
    }
Example #2
0
 public void BuyLife()
 {
     audio.clip = shopBuy;
     audio.Play();
     Life_Manager.Instance().ResetLifes();
     lfsConfirm.SetActive(true);
 }
Example #3
0
 public void ComfirmQuit()
 {
     Time.timeScale = 1;
     Life_Manager.Instance().SubstractLife();
     loadingScreen.SetActive(true);
     StartCoroutine(LoadScreen4());
 }
Example #4
0
 public void CloseLifeShop()
 {
     audio.clip = clickSound;
     audio.Play();
     Life_Manager.Instance().FalseToLifeStore();
     lifeShopPanel.SetActive(false);
 }
Example #5
0
 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;
     }
 }
Example #6
0
 public void ReturnToLifeShop()
 {
     Life_Manager.Instance().TrueToLifeStore();
     audio.clip = clickSound;
     audio.Play();
     Time.timeScale = 1;
     loadingScreen.SetActive(true);
     StartCoroutine(LoadScreen4());
 }
Example #7
0
 // 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);
 }
Example #9
0
    void Awake()

    {
        if (instance != null)
        {
            Destroy(gameObject);
        }
        else
        {
            instance = this;
        }
    }
Example #10
0
    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;
    }
Example #11
0
 // 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();
 }
Example #12
0
 public void NoLifes()
 {
     noLife = Life_Manager.Instance().NoLifeAsk();
 }
Example #13
0
 public void LoadLifes()
 {
     lifeCount = Life_Manager.Instance().SendLifeCount();
 }
Example #14
0
 public void ResetLvl()
 {
     Life_Manager.Instance().LockLvl();
 }