// Use this for initialization void Start() { timer = 0; ThisSpriteRenderer = this.GetComponent <SpriteRenderer>(); Button.AddComponent <BoxCollider2D>(); current = null; triger = true; count = 0; }
// Update is called once per frame void Update() { if (triger && count >= Cards.Count) { TutorialOut(); } if (triger && count < Cards.Count && timer <= 0) { timer = 0.5f; current = Cards[count]; ThisSpriteRenderer.sprite = current.Image; count++; SetButton(); } else //Tutorial is ended { timer -= Time.deltaTime; } triger = false; }