Example #1
0
    // Use this for initialization
    void Start()
    {
        i    = GetComponent <Image> ();
        tpsi = FindObjectOfType(typeof(TransPageSI)) as TransPageSI;
        tpbg = FindObjectOfType(typeof(TransPageBackground)) as TransPageBackground;

        timer        = 0;
        currentFrame = 0;
        animPlayed   = false;


        currentLevel = PlayerPrefs.GetInt("CurrentStoryLevel");

        if (currentLevel < 4)
        {
            PlayAnim = false;
            if (currentLevel == 3)
            {
                showAnim = true;
                Debug.Log("show LI");
            }
            else
            {
                showAnim = false;
                Debug.Log("Don't show LI");
            }
        }
        else
        {
            showAnim = true;
            PlayAnim = true;
        }
    }
Example #2
0
    // Use this for initialization
    void Start()
    {
        i = GetComponent <Image> ();

        tpm  = FindObjectOfType(typeof(TransPageMouth)) as TransPageMouth;
        tpsi = FindObjectOfType(typeof(TransPageSI)) as TransPageSI;
        tps  = FindObjectOfType(typeof(TransPageStomach)) as TransPageStomach;
        tpli = FindObjectOfType(typeof(TransPageLI)) as TransPageLI;
        tqm  = FindObjectOfType(typeof(TransQuesMark)) as TransQuesMark;

        timer   = 0;
        counter = 0;

        //currentLevel = 3;
        currentLevel = PlayerPrefs.GetInt("CurrentStoryLevel");
        tqm.setStart(currentLevel);

        /*
         * if (PlayerPrefs.GetInt ("CurrentStoryLevel") == 3)
         *      currentLevel = 3;
         * else if (PlayerPrefs.GetInt ("CurrentStoryLevel") == 2)
         *      currentLevel = 2;
         * else if (PlayerPrefs.GetInt ("CurrentStoryLevel") == 1)
         *      currentLevel = 1;
         * else
         *      currentLevel = 1;
         */


        Debug.Log(currentLevel);



        currentFrame = (currentLevel - 1) * 2;
        i.sprite     = BGs [currentFrame];



        Debug.Log("currentlevel: " + currentLevel);
    }