Пример #1
0
    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();
                }
            }
        }
    }
Пример #2
0
 void OnDestroy()
 {
     m_Instance = null;
 }
Пример #3
0
 public void init(int value, int x, int y, PuzzleGameLogic logic)
 {
     theText.text = value.ToString();
     pos          = new int[] { x, y };
     this.logic   = logic;
 }
Пример #4
0
 void Awake()
 {
     m_Instance = this;
 }