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); }
private void Awake() { IPiece = PieceFactory.createInstance(type); allowedMovesDeltas = IPiece.GetAllowedMoves(); //FindObjectOfType<GameManager>().AddPiece(this); }