Esempio n. 1
0
    public void swapBlock(BlockControl block0, Block.DIR4 dir, BlockControl block1)
    {
        Block.COLOR color0 = block0.color;
        Block.COLOR color1 = block1.color;

        Vector3 scale0 = block0.transform.localScale;
        Vector3 scale1 = block1.transform.localScale;

        float vanish_timer0 = block0.vanish_timer;
        float vanish_timer1 = block1.vanish_timer;

        Vector3 offset0 = BlockRoot.getDirVector(dir);
        Vector3 offset1 = BlockRoot.getDirVector(BlockRoot.getOppositeDir(dir));

        block0.setColor(color1);
        block1.setColor(color0);

        block0.transform.localScale = scale1;
        block1.transform.localScale = scale0;

        block0.vanish_timer = vanish_timer1;
        block1.vanish_timer = vanish_timer0;

        block0.beginSlide(offset0);
        block1.beginSlide(offset1);
    }