コード例 #1
0
    void RemoveGemstone(GemStone c)
    {
        c.Dispose();
        audio.PlayOneShot(match3Clip);
        for (int i = c.rowIndex + 1; i < rowNum; i++)
        {
            GemStone temGemstone = GetGemStone(i, c.columIndex);
            temGemstone.rowIndex--;
            SetGemStone(temGemstone.rowIndex, temGemstone.columIndex, temGemstone);
            temGemstone.UpdatePosition(temGemstone.rowIndex, temGemstone.columIndex);
        }
        GemStone newGemstone = AddGemstone(rowNum, c.columIndex);

        newGemstone.rowIndex--;
        SetGemStone(newGemstone.rowIndex, newGemstone.columIndex, newGemstone);
        newGemstone.UpdatePosition(newGemstone.rowIndex, newGemstone.columIndex);
    }
コード例 #2
0
    public void RemoveGemStone(GemStone c)
    {
        Debug.Log("移除");
        c.Dispose();
        audioSource.PlayOneShot(matchClip);
        for (int r = c._row + 1; r < rowNum; r++)
        {
            GemStone t = GetGemStone(r, c._col);
            t._row--;
            setGemStone(t._row, t._col, t);
            //t.UpdatePosition(t._row, t._col);
            t.TweenToPosition(t._row, t._col);
        }

        GemStone newGemStone = AddGemStone(rowNum, c._col);

        newGemStone._row--;
        setGemStone(newGemStone._row, newGemStone._col, newGemStone);
        //newGemStone.UpdatePosition(newGemStone._row, newGemStone._col);
        newGemStone.TweenToPosition(newGemStone._row, newGemStone._col);
    }