1
0
mirror of https://github.com/Siccity/xNode.git synced 2025-12-21 01:36:03 +08:00
This commit is contained in:
Thor Brigsted 2018-02-19 17:15:58 +01:00
commit 14af49468e
2 changed files with 32 additions and 2 deletions

23
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,23 @@
## Contributing to xNode
💙Thank you for taking the time to contribute💙
If you haven't already, join our [Discord channel](https://discord.gg/qgPrHv4)!
## Pull Requests
Try to keep your pull requests relevant, neat, and manageable. If you are adding multiple features, try splitting them into separate commits.
* Avoid including irellevant whitespace or formatting changes.
* Comment your code.
* Spell check your code / comments
## New features
xNode aims to be simple and extendible, not trying to fix all of Unity's shortcomings.
If your feature aims to cover something not related to editing nodes, it generally won't be accepted. If in doubt, ask on the Discord channel.
## Coding conventions
Skim through the code and you'll get the hang of it quickly.
* Methods, Types and properties PascalCase
* Variables camelCase
* Public methods XML commented
* Open braces on same line as condition
* 4 spaces for indentation.

View File

@ -9,8 +9,15 @@ namespace XNode {
public enum IO { Input, Output }
public int ConnectionCount { get { return connections.Count; } }
/// <summary> Return the first connection </summary>
public NodePort Connection { get { return connections.Count > 0 ? connections[0].Port : null; } }
/// <summary> Return the first non-null connection </summary>
public NodePort Connection {
get {
for (int i = 0; i < connections.Count; i++) {
if (connections[i] != null) return connections[i].Port;
}
return null;
}
}
public IO direction { get { return _direction; } }
public Node.ConnectionType connectionType { get { return _connectionType; } }