/* * Dock modifiers */ public virtual bool AddDockableAttachment(BaseAttachment attach) { if (m_childDockables == null) { m_childDockables = new List <BaseAttachment>(); } if (DockAcceptsType(attach.GetType())) { m_childDockables.Add(attach); attach.transform.parent = transform; return(true); } else { Debug.LogError(this + " can't dock with a " + attach.GetType()); } return(false); }
public static BaseAttachment CreateGhostDragger(BaseAttachment attach) { BaseAttachment ghostAttach = null; if (attach.GetType() == typeof(SliderAttachment)) { SliderAttachment slider = attach as SliderAttachment; ghostAttach = UIFactory.CreateSlider(slider.musicRef, UIFrame.AnchorLocation.BOTTOM_LEFT); } else if (attach.GetType() == typeof(ClipButtonAttachment)) { ClipButtonAttachment clipButton = attach as ClipButtonAttachment; ghostAttach = UIFactory.CreateClipButton(clipButton.musicRef, UIFrame.AnchorLocation.BOTTOM_LEFT); } else if (attach.GetType() == typeof(ClipCubeAttachment)) { ClipCubeAttachment cubeButton = attach as ClipCubeAttachment; ghostAttach = UIFactory.CreateClipCube(cubeButton.musicRef); } else if (attach.GetType() == typeof(InstrumentAttachment)) { InstrumentAttachment instrument = attach as InstrumentAttachment; ghostAttach = UIFactory.CreateInstrument(instrument.musicRef); } else if (attach.GetType() == typeof(RBFTrainingSpawnerAttachment)) { ghostAttach = UIFactory.CreateRBFSphereTraining(); } ghostAttach.transform.parent = attach.transform; ghostAttach.transform.position = attach.transform.position; ghostAttach.transform.localScale = attach.transform.localScale; ghostAttach.transform.parent = null; ghostAttach.SetTransient(true); ghostAttach.SetCloneable(false); return(ghostAttach); }