xNode
1.8.0

下載 /資產商店 /文檔
支持KO-FI或Patreon上的XNODE
要獲得全面的ODIN支持,請考慮使用Kajed82的叉子
想開發基於節點的插件嗎?那是給你的。您可以將其作為存檔下載並拆開新的Unity項目,也可以將其連接為GIT子模塊。
Xnode是超級用戶友好,直觀的,並且將立即幫助您獲得節點圖的好處。它的佔地面積最小,它是定制狀態機器,對話系統,決策者等的理想基礎。

通過git URL (需要Unity版本2018.3.0b7或更高版本)
要使用Unity軟件包管理器將該項目作為GIT依賴性安裝,請將以下行添加到您的項目的manifest.json中。
"com.github.siccity.xnode": "https://github.com/siccity/xNode.git"
您將需要在系統的路徑中安裝git並提供。
如果您在項目中使用彙編定義,則需要添加XNode和/或XNodeEditor作為彙編定義引用。
通過OpenUpm
該軟件包可在OpenUPM註冊表中找到。建議通過OpenUPM-CLI安裝它。
openupm add com.github.siccity.xnode
通過git子模塊
要在您現有的GIT項目中添加Xnode作為子模塊,請從您的項目root中運行以下GIT命令:
git submodule add [email protected]:Siccity/xNode.git Assets/Submodules/xNode
如果您沒有源控製或軟件包管理器可用,則可以簡單地將源文件複製到資產文件夾中。
// public classes deriving from Node are registered as nodes for use within a graph
public class MathNode : Node {
// Adding [Input] or [Output] is all you need to do to register a field as a valid port on your node
[ Input ] public float a ;
[ Input ] public float b ;
// The value of an output node field is not used for anything, but could be used for caching output results
[ Output ] public float result ;
[ Output ] public float sum ;
// The value of 'mathType' will be displayed on the node in an editable format, similar to the inspector
public MathType mathType = MathType . Add ;
public enum MathType { Add , Subtract , Multiply , Divide }
// GetValue should be overridden to return a value for any specified output port
public override object GetValue ( NodePort port ) {
// Get new a and b values from input connections. Fallback to field values if input is not connected
float a = GetInputValue < float > ( "a" , this . a ) ;
float b = GetInputValue < float > ( "b" , this . b ) ;
// After you've gotten your input values, you can perform your calculations and return a value
if ( port . fieldName == "result" )
switch ( mathType ) {
case MathType . Add : default : return a + b ;
case MathType . Subtract : return a - b ;
case MathType . Multiply : return a * b ;
case MathType . Divide : return a / b ;
}
else if ( port . fieldName == "sum" ) return a + b ;
else return 0f ;
}
}插件是將功能添加到Xnode的存儲庫
加入Discord服務器以留下反饋或獲得支持。請隨時在“問題”頁面中留下建議/請求。