Exemple #1
0
    void ShowPanelTarget()
    {
        hammerControl.HideHammer();
        objTarget.transform.Find("ButtonBack").GetComponent <Button>().onClick.AddListener(delegate
        {
            SceneManager.LoadScene(1);
        });

        objTarget.transform.Find("ButtonStart").GetComponent <Button>().onClick.AddListener(delegate
        {
            StartCoroutine(StartRunTimeBeforePlay());
            buttonPause.gameObject.SetActive(true);
            objTarget.SetActive(false);
            hammerControl.DisplayHammer();
        });

        objTarget.transform.Find("TextTargetMouse").GetComponent <Text>().text   = "" + Database.Target(GameManager.LevelCurret).x;
        objTarget.transform.Find("TextTargetCombo").GetComponent <Text>().text   = "" + Database.Target(GameManager.LevelCurret).y;
        objTarget.transform.Find("TextTargetDiamond").GetComponent <Text>().text = "" + Database.Target(GameManager.LevelCurret).z;
    }
Exemple #2
0
 private void Start()
 {
     SetUpBeforeStart();
     //--------------------
     eventDispatcher = EventDispatcher.Instance;
     gameManager     = GameManager.Instance;
     hammerControl   = GameObject.FindObjectOfType <HammerControl>();
     //--------------------
     SetMouseHited(gameManager.SumMouseHited);
     SetCombo(gameManager.SumCombo);
     SetDiamondHited(gameManager.SumDiamond);
     //--------------------
     ShowPanelTarget();
     //--------------------
     ControlPanelOvergame();
     ControlPanelInformation();
     ControlPanelPause();
     //--------------------
     buttonPause.onClick.AddListener(delegate
     {
         hammerControl.HideHammer();
         objPausegame.SetActive(true);
         buttonPause.gameObject.SetActive(false);
         Time.timeScale = 0;
     });
     //--------------------
     eventDispatcher.RegisterListener(EventID.HitOldman, (param) =>
     {
         oldmanHiited -= 1;
         if (oldmanHiited == 0)
         {
             gameManager.isWin = false;
             eventDispatcher.PostEvent(EventID.OverGame);
         }
     });
     //------------------
     eventDispatcher.RegisterListener(EventID.HitCombo, (param) =>
     {
         if (gameManager.isCombo)
         {
             txtCombo.text    = "Combo x" + gameManager.SumCombo;
             txtCombo.enabled = true;
             StartCoroutine(HideCombo());
         }
     });
 }