From 11365b16b9d90cec47dda10b561971e5825cc686 Mon Sep 17 00:00:00 2001 From: wuhao Date: Wed, 19 Jun 2019 17:20:17 +0800 Subject: [PATCH] default name for all nodes --- Scripts/Node.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Scripts/Node.cs b/Scripts/Node.cs index cd86b95..4b68a0a 100644 --- a/Scripts/Node.cs +++ b/Scripts/Node.cs @@ -40,6 +40,12 @@ namespace XNode { /// always override the current connection Override, } + protected virtual void Reset() + { + name = this.GetType().ToString(); + var idx = name.LastIndexOf(".")+1; + name = name.Substring(idx, name.Length - idx); + } /// Tells which types of input to allow public enum TypeConstraint {