Ejemplo n.º 1
0
 void ProgressHandler(PlayerProgressEvent e)
 {
     if (e.PlayerID == PlayerID)
     {
         if (e.progress == "first buff")
         {
             string key = (PlayerID == 1) ? "Q" : ".";
             StartCoroutine(LeaveAndBack("Press " + key + " to prune a branch."));
         }
         if (e.progress == "first prune")
         {
             string key = (PlayerID == 1) ? "SPACE" : "R SHIFT";
             StartCoroutine(LeaveAndBack("Hold " + key + " to create a bomb. Left/Right to aim. Release to launch."));
         }
         if (e.progress == "first bomb")
         {
             StartCoroutine(LeaveAndBack("Get free bombs from chests!"));
         }
         if (e.progress == "first chest")
         {
             StartCoroutine(LeaveAndBack("Grow to a shield for protection!"));
         }
         if (e.progress == "first shield")
         {
             StartCoroutine(LeaveAndBack("Get a star! You will need 3 stars to win the game!"));
         }
         if (e.progress == "first checkpoint")
         {
             StartCoroutine(LeaveAndBack("Excellent! Now you will compete to grow into the sky!"));
         }
     }
 }
Ejemplo n.º 2
0
 void PlayerProgressEventHandler(PlayerProgressEvent e)
 {
     if (!isActiveAndEnabled)
     {
         return;
     }
     if (e.PlayerID == PlayerID)
     {
         if (e.progress == "reach root")
         {
             if (PlayerID == 1)
             {
                 t.text = "Press E!";
             }
             else
             {
                 t.text = "Press /!";
             }
         }
         if (e.progress == "first grow")
         {
             GetComponentInParent <PanelLerp>().Move(new Vector3(0, -200f, 0));
         }
     }
 }
Ejemplo n.º 3
0
 private void OnPlayerProgress(PlayerProgressEvent data)
 {
     if (!this.delayUpdate)
     {
         this.targetExperience = data.experience;
     }
     this.currentRealExperience = data.experience;
 }
Ejemplo n.º 4
0
 void PlayerProgressEventHandler(PlayerProgressEvent e)
 {
     if (!isActiveAndEnabled)
     {
         return;
     }
     if (e.PlayerID == PlayerID)
     {
         if (e.progress == "first grow")
         {
             t.text = "Grow to a log for extra resources!";
             GetComponentInParent <PanelLerp>().Move(new Vector3(0f, 500f, 0f));
         }
         if (e.progress == "first buff")
         {
             GetComponentInParent <PanelLerp>().BackToInit();
         }
     }
 }
Ejemplo n.º 5
0
 void PlayerProgressEventHandler(PlayerProgressEvent e)
 {
     if (!isActiveAndEnabled)
     {
         return;
     }
     if (e.progress == "first buff")
     {
         ++first_buff_cnt;
     }
     if (e.progress == "first checkpoint")
     {
         ++first_cp_cnt;
     }
     if (!t.enabled && first_buff_cnt == 2)
     {
         t.enabled = true;
         GetComponentInParent <PanelLerp>().Move(new Vector3(0f, -500f, 0f));
         StartCoroutine(WaitAndHide());
     }
 }
Ejemplo n.º 6
0
 void ObjectiveGenerator(PlayerProgressEvent e)
 {
     if (e.PlayerID == PlayerID)
     {
         if (e.progress == "first grow")
         {
             GameObject buff = Instantiate(buffPrefab, new Vector3(1f, 3f, 0) + transform.position, Quaternion.identity);
             buff.GetComponent <BuffController>().playerIndex = PlayerID;
         }
         if (e.progress == "first bomb")
         {
             GameObject buff = Instantiate(buffPrefab, new Vector3(-1f, 4f, 0) + transform.position, Quaternion.identity);
             buff.GetComponent <BuffController>().playerIndex = PlayerID;
             StartCoroutine(ConvertChest());
         }
         if (e.progress == "first chest")
         {
             GameObject shield = Instantiate(shieldPrefab, new Vector3(3f, 4f, 0) + transform.position, Quaternion.identity);
             shield.GetComponent <ShieldController>().playerID = PlayerID;
         }
         if (e.progress == "first shield")
         {
             GameObject checkpoint = Instantiate(checkpointPrefab, new Vector3(-3f, 5f, 0) + transform.position, Quaternion.identity);
             checkpoint.GetComponent <GoalPointController>().playerID = PlayerID;
         }
         if (e.progress == "first checkpoint" && opponent_done)
         {
             EventBus.Publish <TutorialEndEvent>(new TutorialEndEvent());
         }
     }
     else
     {
         if (e.progress == "first checkpoint")
         {
             opponent_done = true;
         }
     }
 }
Ejemplo n.º 7
0
 private void OnPlayerProgressEvent(PlayerProgressEvent data)
 {
     this.Lock(this.levelRequirement > Singleton <PlayerProgress> .Instance.Level);
 }