Пример #1
0
    void RemoveGemstone(Gemstone c)
    {
        Debug.Log("RemoveGemstone");
        c.ClearGemstone();
        //audiosource.PlayOneShot(Match3Sound);
        for (int i = c.RowIndex + 1; i < RowNumber; i++)
        {
            Gemstone tmpgemstone = GetGemstone(i, c.ColIndex);
            tmpgemstone.RowIndex--;
            SetGemstone(tmpgemstone.RowIndex, tmpgemstone.ColIndex, tmpgemstone);
            tmpgemstone.TweenToPosition(tmpgemstone.RowIndex, tmpgemstone.ColIndex);//tmpgemstone.UpdatePosition(tmpgemstone.RowIndex,tmpgemstone.ColIndex);
        }

        Gemstone newgemstone = CreateGemstone(RowNumber, c.ColIndex);

        newgemstone.RowIndex--;
        SetGemstone(newgemstone.RowIndex, newgemstone.ColIndex, newgemstone);
        newgemstone.TweenToPosition(newgemstone.RowIndex, newgemstone.ColIndex);//newgemstone.UpdatePosition(newgemstone.RowIndex,newgemstone.ColIndex);
    }