Beispiel #1
0
    public static GameObject CreatePieceGameObject(string name, PieceControllerType type, ColorsEnum color)
    {
        GameObject newGameObject = new GameObject(name);

        newGameObject.AddComponent <Piece>();
        Piece PieceComponent = newGameObject.GetComponent <Piece>();

        PieceComponent.IPiece = PieceFactory.createInstance(type);
        PieceComponent.Type   = type;
        PieceComponent.SetColor(color);

        return(newGameObject);
    }
Beispiel #2
0
 private void Awake()
 {
     IPiece             = PieceFactory.createInstance(type);
     allowedMovesDeltas = IPiece.GetAllowedMoves();
     //FindObjectOfType<GameManager>().AddPiece(this);
 }