public void OnBeginDrag(PointerEventData eventData)
 {
     if (eventData.button == PointerEventData.InputButton.Left)
     {
         currentDrag = DraggableChord.Instantiate(prefab, camera, Chord);
     }
 }
Beispiel #2
0
 public void AttachChord(DraggableChord chord)
 {
     if (Attached != null)
     {
         Destroy(Attached.gameObject);
     }
     chord.transform.parent = transform;
     Attached   = chord;
     chord.Slot = this;
     ChordAttached.Invoke();
 }
Beispiel #3
0
        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);
        }
Beispiel #4
0
 public void FreeChord()
 {
     Attached = null;
     ChordAttached.Invoke();
 }
Beispiel #5
0
 public void AttachChord(ChordName chord)
 {
     AttachChord(DraggableChord.Instantiate(chordPrefab, transform, camera, chord, this));
 }