public void UpdateWithCreatedLink(MagicCircleLinks mcl) { GameObject obj = (GameObject)Instantiate(uiLinkPrefab, UiBoard); UILineRender uiLine = obj.GetComponent <UILineRender>(); uiLine.linkedLink = mcl; uiLine.mcmm = this; uiLine.points.Clear(); Vector3 offset = (mcl.GetLinkType() == LinkTypes.Transition ? Vector3.up * 5f : Vector3.zero); for (int i = 0; i < uiSpellNodeList.Count; i++) { if (uiSpellNodeList[i].linkedSpellNode == mcl.source) { uiLine.AddReference(uiSpellNodeList[i], offset); break; } } for (int i = 0; i < uiSpellNodeList.Count; i++) { if (uiSpellNodeList[i].linkedSpellNode == mcl.destination) { uiLine.AddReference(uiSpellNodeList[i], offset); break; } } // uiLine.AddReference( selectedUISN ); uiLinkList.Add(uiLine); uiLine.deleteOnNoSource = true; }
public void Delete() { if (linkedLink != null && linkedLink.GetLinkType() == LinkTypes.Data) { MagicCircleDataLinks dl = (MagicCircleDataLinks)linkedLink; if (isProperty) { dl.ResetProperty(dl.selectedLinkableProperty); } } Destroy(linkedLink); linkedLink = null; Destroy(this.gameObject); }
public void RemoveLink(MagicCircleLinks link) { links.Remove(link); }
public void DestroyLink(MagicCircleLinks link) { RemoveLink(link); Destroy(link); }