public void OnBeginDrag(PointerEventData eventData) { if (eventData.button == PointerEventData.InputButton.Left) { currentDrag = DraggableChord.Instantiate(prefab, camera, Chord); } }
public void AttachChord(DraggableChord chord) { if (Attached != null) { Destroy(Attached.gameObject); } chord.transform.parent = transform; Attached = chord; chord.Slot = this; ChordAttached.Invoke(); }
public static ChordSlot Instantiate(ChordSlot prefab, Transform parent, Vector3 localPosition, DraggableChord chordPrefab, ChordEditor chordEditor) { ChordSlot instance = Instantiate(prefab, parent); instance.transform.localPosition = Helpers.ReplaceZ(localPosition, -0.1f); instance.chordPrefab = chordPrefab; instance.editor = chordEditor; instance.camera = Camera.main; instance.isProperlyInstantiated = true; return(instance); }
public void FreeChord() { Attached = null; ChordAttached.Invoke(); }
public void AttachChord(ChordName chord) { AttachChord(DraggableChord.Instantiate(chordPrefab, transform, camera, chord, this)); }