コード例 #1
0
ファイル: Utils.cs プロジェクト: DorelBarbu/my-chess
    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);
    }
コード例 #2
0
ファイル: Piece.cs プロジェクト: DorelBarbu/my-chess
 private void Awake()
 {
     IPiece             = PieceFactory.createInstance(type);
     allowedMovesDeltas = IPiece.GetAllowedMoves();
     //FindObjectOfType<GameManager>().AddPiece(this);
 }