GKObstacleGraph<NodeType> 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
GKObstacleGraph<NodeType>(NSCoder) |
從儲存在 unarchiver 物件中的資料初始化 物件的建構函式。 |
GKObstacleGraph<NodeType>(GKPolygonObstacle[], Single) |
GKObstacleGraph<NodeType>(NSCoder)
從儲存在 unarchiver 物件中的資料初始化 物件的建構函式。
public GKObstacleGraph (Foundation.NSCoder coder);
new GameplayKit.GKObstacleGraph<'NodeType (requires 'NodeType :> GameplayKit.GKGraphNode2D)> : Foundation.NSCoder -> GameplayKit.GKObstacleGraph<'NodeType (requires 'NodeType :> GameplayKit.GKGraphNode2D)>
參數
- coder
- NSCoder
unarchiver 物件。
備註
提供這個建構函式,以允許在 NIB 還原序列化) 期間,從 unarchiver (初始化 類別。 這是通訊協定的 NSCoding 一部分。
如果開發人員想要建立此物件的子類別,並繼續支援從封存還原序列化,他們應該使用相同的簽章來實作建構函式:採用類型的 NSCoder 單一參數,並使用 [Export (「initWithCoder:」] 屬性宣告裝飾它。
此物件的狀態也可以使用隨附方法 EncodeTo 來序列化。
適用於
GKObstacleGraph<NodeType>(GKPolygonObstacle[], Single)
public GKObstacleGraph (GameplayKit.GKPolygonObstacle[] obstacles, float bufferRadius);
new GameplayKit.GKObstacleGraph<'NodeType (requires 'NodeType :> GameplayKit.GKGraphNode2D)> : GameplayKit.GKPolygonObstacle[] * single -> GameplayKit.GKObstacleGraph<'NodeType (requires 'NodeType :> GameplayKit.GKGraphNode2D)>
參數
- obstacles
- GKPolygonObstacle[]
- bufferRadius
- Single