Example #1
0
 // Update is called once per frame
 void Update()
 {
     if (startToast && index < instructionList.Length && ((float)bossHealth.getHealth() / (float)bossHealth.maxHealth) <= instructionPercentages[index])
     {
         //Debug.Log((float)bossHealth.getHealth() / (float)bossHealth.maxHealth);
         ToastManager.Toast(instructionList[index]);
         for (int i = 0; i < instructionImgs.Length; ++i)
         {
             if (instructionImgs[i])
             {
                 instructionImgs[i].SetActive(false);
             }
         }
         StartCoroutine(DisableAllImgs());
         if (instructionImgs[index])
         {
             instructionImgs[index].SetActive(true);
         }
         ++index;
         if (!calledFunc && ((float)bossHealth.getHealth() / (float)bossHealth.maxHealth) <= 0.4)
         {
             calledFunc = true;
             StartCoroutine(FlashOnCommand.DoFlash());
         }
         if (!calledFunc && bossHealth.getHealth() <= 0)
         {
             calledFunc = true;
             bc.enabled = true;
         }
     }
     if (!startToast && !funcCalled && bossHealth.getHealth() <= 0)
     {
         //give the instructions for stepping on the platform if it was skipped
         ToastManager.Toast("Step on the BLUE plate to fight Pluto (easy) \n Step on the RED plate to fight Mars (harder)");
         funcCalled = true;
     }
 }
 //public GameObject ref7;
 //public GameObject ref8;
 // Start is called before the first frame update
 void Awake()
 {
     instance = this;
 }