using UnityEngine; using UnityEngine.UI; using System.Collections; public class Number : MonoBehaviour { private Image image; private float frequency; private int[] patternArray; private int patternArrayIdx; private Renderer rdr; public void Init() { this.rdr = GetComponent(); } public bool hasRemainingPattern() { if (patternArrayIdx > patternArray.Length -1 ) return false; return true; } public int getNextPatternArray() { // Logger.Print (this.patternArray [patternArrayIdx]+""); return this.patternArray[patternArrayIdx++]; } public void reset() { this.patternArrayIdx = 0; } public void show() { this.rdr.enabled = true; // this.Image.color = Color.white; } public void hide() { this.rdr.enabled = false; // this.Image.color = Color.black; } public int getPatternArrayIndex() { return this.patternArrayIdx; } public void setPositionOffset(float xPosOffset, float yPosOffset) { Vector3 prevPos = this.transform.localPosition; this.transform.localPosition = new Vector3 (prevPos.x + xPosOffset, prevPos.y + yPosOffset); } // Properties public Image Image { get { return this.image; } set { this.image = value; } } public float Frequency { get { return this.frequency; } set { this.frequency = value; } } public int[] PatternArray { get { return this.patternArray; } set { this.patternArray = value; } } public Vector3 Position { get { return this.transform.localPosition; } set { this.transform.localPosition = value; } } }