コード例 #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;
 }