示例#1
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.F) && bCanStart && bUsable)
        {
            if (scriptTimer == null)
            {
                Debug.LogError("There is no Script assigned, please assign one.");
                return;
            }

            scriptSpeed.speed = 15;
            scriptSpeed.SetAgentProperties();
            scriptTimer.startTimer();

            if (PortesSpawn != null)
            {
                PortesSpawn.SetActive(false);
            }
            if (OxyScript != null)
            {
                OxyScript.Begin();
            }
            bUsable = false;
            if (InteractText != null)
            {
                InteractText.enabled = false;
            }
            GMScript.AfficheNbTache();
        }
    }
示例#2
0
 private void OnTriggerEnter2D()
 {
     if (GMScript != null)
     {
         GMScript.bTache2 = true;
         GMScript.AfficheNbTache();
     }
     GameObject.Find("PresentoirRacing").GetComponent <RacingManager>().Interact();
 }
示例#3
0
    public IEnumerator Validate()
    {
        yield return(new WaitForSeconds(0.5f));

        GameObject.Find("LaserEnd").GetComponent <Image>().color = Color.green;
        yield return(new WaitForSeconds(2f));

        GameObject presentoir = GameObject.Find("PresentoirLaser");

        presentoir.GetComponent <LaserManager>().Interact();
        presentoir.GetComponent <LaserManager>().enabled = false;

        if (GMScript != null)
        {
            GMScript.bTache3 = true;
            GMScript.AfficheNbTache();
        }
    }
    private void OnOK()
    {
        string texteCible = "0 0";

        switch (nSolution)
        {
        case 2:
            texteCible = sBlueNumber;
            break;

        case 3:
            texteCible = sGreenNumber;
            break;

        default:
            texteCible = sRedNumber;
            break;
        }
        if (input.text.Length > 1 && input.text[0] + " " + input.text[1] == texteCible)
        {
            if (Affichage != null)
            {
                Affichage.text = "Congratulation !";
            }
            if (GMScript != null)
            {
                GMScript.bTache1 = true;
                GMScript.AfficheNbTache();
            }
            bStart = false;
        }
        else
        {
            if (Affichage != null)
            {
                Affichage.text = "Error. Try again.";
            }
            input.text = "";
            //Nombre.text = GenererAleatoire();
        }
    }