// Use this for initialization void Start() { i = GetComponent <Image> (); tps = FindObjectOfType(typeof(TransPageStomach)) as TransPageStomach; tpbg = FindObjectOfType(typeof(TransPageBackground)) as TransPageBackground; timer = 0; currentFrame = 0; animPlayed = false; currentLevel = PlayerPrefs.GetInt("CurrentStoryLevel"); if (currentLevel < 3) { PlayAnim = false; if (currentLevel == 2) { showAnim = true; Debug.Log("show SI"); } else { showAnim = false; Debug.Log("Don't show SI"); } } else { showAnim = true; PlayAnim = true; } }
// 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); }