
ดาวน์โหลด / ร้านค้าสินทรัพย์ / เอกสารประกอบ
รองรับ xnode บน ko-fi หรือ patreon
สำหรับการสนับสนุนอย่างเต็มรูปแบบให้พิจารณาใช้ส้อมของ Kajed82
กำลังคิดที่จะพัฒนาปลั๊กอินที่ใช้โหนดหรือไม่? แล้วนี่คือสำหรับคุณ คุณสามารถดาวน์โหลดเป็นไฟล์เก็บถาวรและแกะออกไปยังโครงการ Unity ใหม่หรือเชื่อมต่อเป็น Git Submodule
Xnode เป็นคนที่ใช้งานได้ง่ายและใช้งานง่ายและจะช่วยให้คุณได้รับประโยชน์จากกราฟโหนดในเวลาไม่นาน ด้วยรอยเท้าที่น้อยที่สุดมันเหมาะอย่างยิ่งเป็นฐานสำหรับเครื่องจักรของรัฐที่กำหนดเองระบบบทสนทนาผู้มีอำนาจตัดสินใจ ฯลฯ

ผ่าน GIT URL (ต้องใช้ Unity Version 2018.3.0b7 หรือสูงกว่า)
ในการติดตั้งโครงการนี้เป็นการพึ่งพา GIT โดยใช้ Unity Package Manager ให้เพิ่มบรรทัดต่อไปนี้ใน manifest.json ของโครงการของคุณ 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 Submodule
หากต้องการเพิ่ม Xnode เป็น submodule ในโครงการ GIT ที่มีอยู่ของคุณให้เรียกใช้คำสั่ง 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 เพื่อแสดงความคิดเห็นหรือรับการสนับสนุน อย่าลังเลที่จะทิ้งคำแนะนำ/คำขอไว้ในหน้าปัญหา