void OnPress(bool press) { if (PuzzleGameLogic.Instance() == null) { return; } if (!press) { if (PuzzleGameLogic.Instance().GetDistance(transform.position, m_DestPos) <= DestDistance) { PuzzleGameLogic.Instance().PieceComplete(m_PieceIndex); } else { if (false == PuzzleGameLogic.Instance().PieceValidPos(m_PieceIndex)) { m_BackTween.from = transform.localPosition; m_BackTween.Reset(); m_BackTween.Play(); } } } }
void OnDestroy() { m_Instance = null; }
public void init(int value, int x, int y, PuzzleGameLogic logic) { theText.text = value.ToString(); pos = new int[] { x, y }; this.logic = logic; }
void Awake() { m_Instance = this; }