Example #1
0
 public void SetCurrentPiece(DragablePiece piece)
 {
     if (!piecePickedUp)
     {
         currentPiece = piece;
     }
 }
Example #2
0
    private void SpawnPiece(DragablePiece piece)
    {
        DragablePiece newPiece = Instantiate(piece);
        Vector3       spawnPos = RandomSpawnPosition();

        newPiece.transform.rotation = Quaternion.Euler(0, 0, Random.Range(0f, 360f));
        if (Random.Range(0f, 1f) >= 0.5f)
        {
            Vector3 currentScale = newPiece.transform.localScale;
            newPiece.transform.localScale = new Vector3(-currentScale.x, currentScale.y, currentScale.z);
        }
        newPiece.MovePieceIn(spawnPos * 2, spawnPos);
    }