Ejemplo n.º 1
0
    void Breakage()
    {
        int randomNum;
        randomNum = Random.Range(0, mechanisms.Length);
        brokenMech = mechanisms[randomNum];
        if (brokenMech.isBroken)
            Breakage();

        if (!brokenMech.isBroken)
        {
            brokenMech.BreakMechanism();
            breakageText.text = "The " + mechanisms[randomNum].deviceName + " has broken!";
            breakageText.enabled = true;
            brokenMech.icon.SetTarget(brokenMech.gameObject);
            currentBreaks++;
        }
    }
Ejemplo n.º 2
0
    void Breakage()
    {
        int randomNum;

        randomNum  = Random.Range(0, mechanisms.Length);
        brokenMech = mechanisms[randomNum];
        if (brokenMech.isBroken)
        {
            Breakage();
        }

        if (!brokenMech.isBroken)
        {
            brokenMech.BreakMechanism();
            breakageText.text    = "The " + mechanisms[randomNum].deviceName + " has broken!";
            breakageText.enabled = true;
            brokenMech.icon.SetTarget(brokenMech.gameObject);
            currentBreaks++;
        }
    }