Пример #1
0
            public Square(ChessGameState game, Square previous)
            {
                Game = game;

                if (previous.Piece != null)
                {
                    Piece = new SinglePiece(previous.Piece);
                }

                LastUpdate = previous.LastUpdate;
            }
Пример #2
0
 public SinglePiece(SinglePiece previous)
 {
     Piece = previous.Piece;
     Color = previous.Color;
     ID    = previous.ID;
 }
Пример #3
0
        // Start is called before the first frame update
        void Start()
        {
            particleSystemObject = GameObject.Find("ParticleEmitter");
            particleSystem       = particleSystemObject.GetComponent <ParticleEmitter>();
            animate = false;
            // // Step1
            // small2x8();
            // //Step2
            // //RightSide
            // movePiece(doubleDiagonal(), 0,1.3f,-2);
            // movePiece(doubleDiagonal(), 0,1.3f,-6);
            // movePiece(doubleDiagonal(), 0,1.3f,-10);
            // //LeftSide
            // movePiece(doubleDiagonal180(), 2,1.3f,-2);
            // movePiece(doubleDiagonal180(), 2,1.3f,-6);
            // movePiece(doubleDiagonal180(), 2,1.3f,-10);
            // //Tail
            // movePiece(doubleDiagonal90(), 2,1.3f,0);

            // //Step3
            // movePiece(small2x1(), 0,2.5f,-12);
            // movePiece(small2x1(), 4,2.5f,-12);

            // movePiece(regular1x2(singlePrefab), -2,3.2f,-8);
            // movePiece(regular1x2(singlePrefab), 4,3.2f,-8);

            // movePiece(small1x4(), -2,2.5f,0);
            // movePiece(small1x4(), 4,2.5f,0);
            // //BeigeCenter
            // movePiece(small2x4(singleSmallBeigePrefab), 0,2.5f,-4);

            // //Step4
            // movePiece(singlePiece(circleSmallPrefab),3.5f,4.5f,-11.2f);
            // movePiece(singlePiece(circleSmallPrefab),-1f,4.5f,-11.2f);

            // movePiece(singlePiece90(diagonalPrefab),4,3.8f,0);
            // movePiece(singlePiece90(diagonalPrefab),-2,3.8f,0);

            // //NeckBase
            // movePiece(singlePiece180(neckBasePrefab),1,1.3f,-14);

            // //Tail
            // movePiece(singlePiece(single2x1Prefab), 1,2.6f,2);
            // movePiece(small1x4(), 1,3,8);
            // movePiece(regular1x2(singleFlatPrefab), 1,3.5f,8);

            // //Step 5 (Head)
            // movePiece(singlePiece(neckConnectionPrefab),1,5,-15);
            // movePiece(singlePiece(single2x1Prefab),0,5,-15);
            // movePiece(singlePiece(single2x1Prefab),0,5,-17);
            // //DownBlocks W nose
            // movePiece(piecel3x1(singleSmallBrownPrefab),2,5.5f,-17);
            // movePiece(singlePiece(singlePrefab),2,6.2f,-15);
            // movePiece(singlePiece(singlePrefab),-2,6.2f,-15);
            // movePiece(singlePiece90(noseBasePrefab),0,6.2f,-15);
            // movePiece(noseDotPostion(noseDotPrefab),0,6.2f,-13.6f);
            // //MediumBlocks W eyes
            // movePiece(singlePiece(singlePrefab),2,6.8f,-17);
            // movePiece(singlePiece(singlePrefab),-2,6.8f,-17);
            // movePiece(singlePiece(singlePrefab),0,6.8f,-17);
            // movePiece(singlePiece270(singleWSidePrefab),2,8.2f,-15);
            // movePiece(singlePiece270(singleWSidePrefab),-2,8.2f,-15);
            // movePiece(singlePiece(singlePrefab),0,8.2f,-15);
            // movePiece(singlePiece90(eyePiecePrefab),2,8f,-17);
            // movePiece(singlePiece90(eyePiecePrefab),-2,8f,-17);
            // //TopBlocks
            // movePiece(singlePiece(singlePrefab),2,8.8f,-17);
            // movePiece(singlePiece(singlePrefab),-2,8.8f,-17);
            // movePiece(singlePiece(singlePrefab),0,8.8f,-17);
            // movePiece(piecel3x1(singleSmallBrownPrefab),2,9.5f,-15);
            // //HairBlocks
            // movePiece(regular1x2(singleSmallBrownPrefab),2,10,-15);
            // movePiece(regular1x2(singleSmallBrownPrefab),-2,10,-15);
            // movePiece(singlePiece(halfTrianglePrefab),0,11,-15);
            // movePiece(singlePiece(singleSmallBrownPrefab),0,10,-17);

            // headMovement();

            // -----------------------------------------------
            // *******************HeadStart*******************
            // -----------------------------------------------
            newNeckConnection = Instantiate(neckConnectionPrefab).GetComponentInChildren <SinglePiece>();
            newNeckConnection.Create();
            newNeckConnection.ChangeEnable(false);

            //2x1 Only middle Pieces
            flatMiddle1 = Instantiate(newsingle2x1Prefab).GetComponentInChildren <SinglePiece>();
            flatMiddle1.Create();
            flatMiddle1.ChangeEnable(false);
            flatMiddle2 = Instantiate(newsingle2x1Prefab).GetComponentInChildren <SinglePiece>();
            flatMiddle2.Create();
            flatMiddle2.ChangeEnable(false);

            //BottomPieces
            flat3x1 = Instantiate(small3x1Prefab).GetComponentInChildren <Flat3x1>();
            flat3x1.Create();
            flat3x1.ChangeEnable(false);
            bottomSingle1 = Instantiate(newSinglePrefab).GetComponentInChildren <SinglePiece>();
            bottomSingle1.Create();
            bottomSingle1.ChangeEnable(false);
            bottomNoseConnection = Instantiate(noseBasePrefab).GetComponentInChildren <SinglePiece>();
            bottomNoseConnection.Create();
            bottomNoseConnection.ChangeEnable(false);
            noseDot = Instantiate(noseDotPrefab).GetComponentInChildren <SinglePiece>();
            noseDot.Create();
            noseDot.ChangeEnable(false);
            bottomSingle2 = Instantiate(newSinglePrefab).GetComponentInChildren <SinglePiece>();
            bottomSingle2.Create();
            bottomSingle2.ChangeEnable(false);

            // MiddlePieces
            backMiddleSingle1 = Instantiate(newSinglePrefab).GetComponentInChildren <SinglePiece>();
            backMiddleSingle1.Create();
            backMiddleSingle1.ChangeEnable(false);
            backMiddleSingle2 = Instantiate(newSinglePrefab).GetComponentInChildren <SinglePiece>();
            backMiddleSingle2.Create();
            backMiddleSingle2.ChangeEnable(false);
            backMiddleSingle3 = Instantiate(newSinglePrefab).GetComponentInChildren <SinglePiece>();
            backMiddleSingle3.Create();
            backMiddleSingle3.ChangeEnable(false);

            eyeConnection1 = Instantiate(singleWSidePrefab).GetComponentInChildren <SinglePiece>();
            eyeConnection1.Create();
            eyeConnection1.ChangeEnable(false);
            eyeConnection2 = Instantiate(singleWSidePrefab).GetComponentInChildren <SinglePiece>();
            eyeConnection2.Create();
            eyeConnection2.ChangeEnable(false);
            middleSingle = Instantiate(newSinglePrefab).GetComponentInChildren <SinglePiece>();
            middleSingle.Create();
            middleSingle.ChangeEnable(false);
            eye1 = Instantiate(eyePiecePrefab).GetComponentInChildren <SinglePiece>();
            eye1.Create();
            eye1.ChangeEnable(false);
            eye2 = Instantiate(eyePiecePrefab).GetComponentInChildren <SinglePiece>();
            eye2.Create();
            eye2.ChangeEnable(false);

            // Top1 Pieces
            flat3x1Top = Instantiate(small3x1Prefab).GetComponentInChildren <Flat3x1>();
            flat3x1Top.Create();
            flat3x1Top.ChangeEnable(false);
            topSingle1 = Instantiate(newSinglePrefab).GetComponentInChildren <SinglePiece>();
            topSingle1.Create();
            topSingle1.ChangeEnable(false);
            topSingle2 = Instantiate(newSinglePrefab).GetComponentInChildren <SinglePiece>();
            topSingle2.Create();
            topSingle2.ChangeEnable(false);
            topSingle3 = Instantiate(newSinglePrefab).GetComponentInChildren <SinglePiece>();
            topSingle3.Create();
            topSingle3.ChangeEnable(false);

            // Top2 Pieces
            backTopSmall = Instantiate(newSingleSmallPrefab).GetComponentInChildren <SinglePiece>();
            backTopSmall.Create();
            backTopSmall.ChangeEnable(false);
            flat1x21 = Instantiate(small1x2Prefab).GetComponentInChildren <Flat1x2>();
            flat1x21.Create();
            flat1x21.ChangeEnable(false);
            flat1x22 = Instantiate(small1x2Prefab).GetComponentInChildren <Flat1x2>();
            flat1x22.Create();
            flat1x22.ChangeEnable(false);
            halfTriangle = Instantiate(halfTrianglePrefab).GetComponentInChildren <SinglePiece>();
            halfTriangle.Create();
            halfTriangle.ChangeEnable(false);

            // TailMovement
            tailStart = Instantiate(small3x1Prefab).GetComponentInChildren <Flat3x1>();
            tailStart.Create();
            tailStart.ChangeEnable(false);
            tailNext = Instantiate(flat1x2Prefab).GetComponentInChildren <Flat1x2>();
            tailNext.Create();
            tailNext.ChangeEnable(false);


            // setPiece(headPieces[0].getMesh(), Otter.MatrixOperations.opTranslate(1,5,-15));
            // headPieces[1] = Instantiate(single2x1Prefab).GetComponentInChildren<Otter.BasicLego>();
            // setPiece(headPieces[1].getMesh(), Otter.MatrixOperations.opTranslate(0,5,-15));


            // Pieces.Add(movePiece(regular1x2(singleSmallBrownPrefab),2,10,-15));
            //Add to head and then rotate
            // movePiece(neckConnectionPosition(neckConnectionPrefab),0,2,-15);
        }