public override void OnInspectorGUI() { DrawDefaultInspector(); //This goes first if (GUILayout.Button("Change Link Name")) // If the button is clicked { LinkGo linkgo = (LinkGo)target; //The target script linkgo.ChangeName(); } }
void CreateLinkCloudGos() { var lcld = getLinkCloud(); if (linkcloudgos == null) { linkcloudgos = new GameObject(); linkcloudgos.name = "LinkCloud-" + gogencount; linkcloudgos.transform.parent = rman.rgo.transform; gogencount++; } if (linksvisible) { foreach (var lnkname in lcld.linknamelist) { var lnk = lcld.GetLink(lnkname); var cname = linkcolor(lnk.name); var go = LinkGo.MakeNewLinkGo(rman, lnk, linkRadius, cname); go.transform.parent = linkcloudgos.transform; } } if (nodesvisible) { foreach (string lptname in lcld.linkpoints()) { var lpt = lcld.GetNode(lptname); var cname = nodecolor(lpt.name); var go = NodeGo.MakeNewNodeGo(rman, lpt, linkNodeSize, cname); go.transform.parent = linkcloudgos.transform; } if (showNearestPoint) { var npt = FindClosestPointOnLineCloud(nearestPointRef); var nname = "linknearsph-"; var pnsph = GraphUtil.CreateMarkerSphere(nname, npt, size: 2.5f * linkNodeSize, clr: "red"); pnsph.transform.parent = linkcloudgos.transform; } } stats_nodes_links.x = lcld.nodecount(); stats_nodes_links.y = lcld.linkcount(); }