Example #1
0
        /*
         * Button
         * Pressable clip button
         */
        public static ClipButtonAttachment CreateClipButton(InstrumentClip clip, UIFrame.AnchorLocation anchor)
        {
            GameObject button = Instantiate(Instance.clipButtonPrefab) as GameObject;

            ClipButtonAttachment attach = button.GetComponent <ClipButtonAttachment>();

            attach.Init(clip);

            UIFrame frame = button.GetComponent <UIFrame>();

            frame.SetAnchor(anchor);

            return(attach);
        }
Example #2
0
        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);
        }