void Start()
 {
     StageScene = "StageScene";
     Progress   = 1;
     Win        = 0;
     PhoneSR    = Phone.GetComponent <SpriteRenderer>();
     C1         = Covfefe1.GetComponent <Covfefe1Click>().Clicked;
     C2         = Covfefe3.GetComponent <Covfefe3Click>().Clicked;
     C3         = Covfefe2.GetComponent <Covfefe2Click>().Clicked;
     T          = PlayerPrefs.GetFloat("PTime");
     Curtain1.GetComponent <UpFlag>().enabled = true;
 }
Esempio n. 2
0
 void Start()
 {
     ScoreText.enabled = false;
     LivesText.enabled = false;
     RuleText.enabled  = false;
     StageScene        = "StageScene";
     Progress          = 1;
     Win      = 0;
     PhoneSR  = Phone.GetComponent <SpriteRenderer>();
     C1       = Covfefe1.GetComponent <ClickItem>().Clicked;
     C2       = Covfefe2.GetComponent <ClickItem>().Clicked;
     C3       = Covfefe3.GetComponent <ClickItem>().Clicked;
     FlagDown = false;
     T        = PlayerPrefs.GetFloat("PTime");
     tt       = T;
 }
Esempio n. 3
0
    void Update()
    {
        switch (Progress)
        {
        case (1):
            if (C1 == true)
            {
                Progress       = 2;
                PhoneSR.sprite = Phone2;
            }
            else if (C2 == true || C3 == true)
            {
                Progress       = 0;
                PhoneSR.sprite = Phone0;
                Win            = 0;
            }
            C1 = Covfefe1.GetComponent <ClickItem>().Clicked;
            C2 = Covfefe2.GetComponent <ClickItem>().Clicked;
            C3 = Covfefe3.GetComponent <ClickItem>().Clicked;
            break;

        case (2):
            if (C2 == true)
            {
                Progress       = 3;
                PhoneSR.sprite = Phone3;
            }
            else if (C3 == true)
            {
                Progress       = 0;
                PhoneSR.sprite = Phone0;
                Win            = 0;
            }
            C1 = Covfefe1.GetComponent <ClickItem>().Clicked;
            C2 = Covfefe2.GetComponent <ClickItem>().Clicked;
            C3 = Covfefe3.GetComponent <ClickItem>().Clicked;
            break;

        case (3):
            if (C3 == true)
            {
                Progress       = 4;
                PhoneSR.sprite = Phone4;
                Win            = 1;
            }
            C1 = Covfefe1.GetComponent <ClickItem>().Clicked;
            C2 = Covfefe2.GetComponent <ClickItem>().Clicked;
            C3 = Covfefe3.GetComponent <ClickItem>().Clicked;
            break;

        default:
            break;
        }

        if (T < 0)
        {
            PlayerPrefs.SetInt("Result", Win);
            Phone.GetComponent <PresentResults>().enabled = true;
            Phone.GetComponent <GamePhone>().enabled      = false;
        }
        else
        {
            T = T - Time.deltaTime;
        }
    }
    void Update()
    {
        switch (Progress)
        {
        case (1):
            if (C1 == true)
            {
                Progress       = 2;
                PhoneSR.sprite = Phone2;
            }
            else if (C2 == true || C3 == true)
            {
                Progress       = 0;
                PhoneSR.sprite = Phone0;
                Win            = 0;
            }
            C1 = Covfefe1.GetComponent <Covfefe1Click>().Clicked;
            C2 = Covfefe3.GetComponent <Covfefe3Click>().Clicked;
            C3 = Covfefe2.GetComponent <Covfefe2Click>().Clicked;
            break;

        case (2):
            if (C2 == true)
            {
                Progress       = 3;
                PhoneSR.sprite = Phone3;
            }
            else if (C3 == true)
            {
                Progress       = 0;
                PhoneSR.sprite = Phone0;
                Win            = 0;
            }
            C1 = Covfefe1.GetComponent <Covfefe1Click>().Clicked;
            C2 = Covfefe3.GetComponent <Covfefe3Click>().Clicked;
            C3 = Covfefe2.GetComponent <Covfefe2Click>().Clicked;
            break;

        case (3):
            if (C3 == true)
            {
                Progress       = 4;
                PhoneSR.sprite = Phone4;
                Win            = 1;
            }
            C1 = Covfefe1.GetComponent <Covfefe1Click>().Clicked;
            C2 = Covfefe3.GetComponent <Covfefe3Click>().Clicked;
            C3 = Covfefe2.GetComponent <Covfefe2Click>().Clicked;
            break;

        default:
            break;
        }

        if (T < 0)
        {
            PlayerPrefs.SetInt("Result", Win);
            SceneManager.LoadScene(StageScene);
        }
        else
        {
            T = T - Time.deltaTime;
        }
    }