public NodeParent m_EditorNode; //编辑器视图对象 public EditorRecordNode(ActionTreeNode node, Vector2 mousPos) { m_Node = node; m_ShowPos = mousPos; m_UID = GenerateUID.GetUID64(); Debug.Log("m_Node.m_AttachType=" + m_Node.m_AttachType + "mousPos=" + mousPos); object obj = m_Node.m_AttachType.Assembly.CreateInstance(m_Node.m_AttachType.Name); if (obj == null) { Debug.LogError(" m_Node.m_AttachType=" + m_Node.m_AttachType); return; } m_ActionScript = obj as NodeActionParent; m_EditorNode = new NodeParent(m_ActionScript); var attributes = m_Node.m_AttachType.GetCustomAttributes(false).OfType <BehaviorActionAttribute>(); foreach (var item in attributes) { if (m_ActionScript.m_BehaviorActionAttribute == null) { m_ActionScript.m_BehaviorActionAttribute = item; } // Debug.Log("zz " + item.ActionArrangement); } // m_ShowNode.m_BehaviorActionAttribute = attributes[0]; m_EditorNode.m_Pos = mousPos; }
private void Update() { if (Input.GetKeyDown(KeyCode.A)) { Debug.Log("32.>>" + GenerateUID.GetUID32()); Debug.Log("64.>>" + GenerateUID.GetUID64()); Debug.Log(""); } }
public void RecordSelectNode(ActionTreeNode node, Vector2 relativePos) { EditorRecordNode recordNode = new EditorRecordNode(node, relativePos); while (m_AllShowingNode.ContainsKey(recordNode.m_UID)) { recordNode.m_UID = GenerateUID.GetUID64(); } m_AllShowingNode.Add(recordNode.m_UID, recordNode); }
} //标识该节点连线的ID public NodeLineInfor(FieldInfo field, NodeInOutEnum fieldType, bool isSignalConnect, NodeParent belongto) { m_NodeFieldInfor = field; m_LineType = fieldType; m_IsSignalConnected = isSignalConnect; m_BelongNode = belongto; NodeLinePointID = GenerateUID.GetUID64(); //获得64位的ID; while (m_AllNodeLinePointID.Contains(NodeLinePointID)) { NodeLinePointID = GenerateUID.GetUID64(); //获得64位的ID; } }