public override bool AddDockableAttachment(BaseAttachment attach) { if (base.AddDockableAttachment(attach)) { ClipCubeHolder holder = FindClosestHolder(attach.transform.position); if (holder.attach == null) { attach.SetCloneable(false); holder.attach = attach; attach.transform.parent = holder.placeholder; iTween.MoveTo(attach.gameObject, iTween.Hash("position", Vector3.zero, "islocal", true, "time", 0.5f)); attach.transform.rotation = holder.placeholder.rotation; return(true); } } 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); }