Esempio n. 1
0
 void HitBoxHit(int carriedAnswer)      //Pass weakspotnya hit --> do something
 {
     Instantiate(hitbyprojectile);
     if (soalManager.angkaJawab == carriedAnswer)
     {
         statManager.tambahScore();
         soalManager.callBuatSoal();
         nyawaBoss--;
         statManager.refreshUInyawaBoss(nyawaBoss);
         RegenJawaban();
         if (nyawaBoss <= 0)
         {
             statManager.tambahScore(carriedScore);
             statManager.enableUInyawaBoss(false);
             if (endlessModeBoss)
             {
                 spawnManager.changeBossTimeState();
             }
             else
             {
                 statManager.loadNextLevel();                      //load level selanjutnya
             }
             Destroy(this.gameObject);
         }
     }
     else
     {
         statManager.kurangScore();
         soalManager.callBuatSoal();
         RegenJawaban();
     }
 }
Esempio n. 2
0
    void Start()
    {
        if (manager == null)           //Init Ref GameObject Manager
        {
            manager = GameObject.Find("GameManager").gameObject;
        }

        spawnManager = manager.transform.Find("Spawner").GetComponent <bhv_spawner> ();

        soalManager = manager.GetComponent <mng_soalGenerator> ();
        statManager = manager.GetComponent <mng_playerStat> ();
        statManager.enableUInyawaBoss(true);
        statManager.refreshUInyawaBoss(nyawaBoss);
        originalPos = this.transform.position;
        RegenJawaban();
        StartCoroutine(IBehaviorBoss());
        StartCoroutine(IBehaviorBoss2());
        StartCoroutine(IBehaviorBoss3());
    }