Esempio n. 1
0
        public void CopyFrom(DMKDanmaku danmaku)
        {
            this.playMode         = danmaku.playMode;
            this.playInterval     = danmaku.playInterval;
            this.parentController = danmaku.parentController;

            this.shooters.Clear();
            foreach (DMKBulletShooterController shooterController in danmaku.shooters)
            {
                DMKBulletShooterController newController = (DMKBulletShooterController)ScriptableObject.CreateInstance <DMKBulletShooterController>();
                newController.CopyFrom(shooterController);
                this.shooters.Add(newController);
            }

            this.modifiers.Clear();
            foreach (DMKShooterModifier modifier in danmaku.modifiers)
            {
                DMKShooterModifier newModifier = (DMKShooterModifier)ScriptableObject.CreateInstance(modifier.GetType());
                newModifier.CopyFrom(modifier);
                this.modifiers.Add(newModifier);
            }

            this.triggers.Clear();
            foreach (DMKTrigger trigger in danmaku.triggers)
            {
                DMKTrigger newTrigger = (DMKTrigger)ScriptableObject.CreateInstance(trigger.GetType());
                newTrigger.CopyFrom(trigger);
                this.triggers.Add(newTrigger);
            }
        }
Esempio n. 2
0
        void OnAddTriggerClicked(object userData)
        {
            DMKTrigger trigger = ScriptableObject.CreateInstance(userData as Type) as DMKTrigger;

            selectedDanmaku.triggers.Add(trigger);
            // to do
            //selectedShooter.shooter.AddModifier(modifier);
        }
Esempio n. 3
0
        void OnTriggerMenuCreateLinkClicked()
        {
            DMKTrigger trigger = selectedGraphObject as DMKTrigger;

            creatingLink   = true;
            linkSourceType = typeof(DMKTrigger);
            linkStartPos   = trigger.editorWindowRect;
        }
Esempio n. 4
0
        void DisplayTriggerToolsMenu()
        {
            GenericMenu menu = new GenericMenu();

            DMKTrigger trigger = selectedGraphObject as DMKTrigger;

            if (!trigger)
            {
                return;
            }

            menu.AddItem(new GUIContent("Remove"), false, OnTriggerMenuRemoveClicked);
            menu.ShowAsContext();
        }
Esempio n. 5
0
        void OnTriggerWindow(DMKTrigger trigger)
        {
            if ((Event.current.button == 0 || Event.current.button == 1))
            {
                if (Event.current.type == EventType.MouseDown)
                {
                    if (!creatingLink)
                    {
                        selectedGraphObject = trigger;
                        GUI.FocusControl("");
                    }
                    Event.current.Use();
                }
                else if (Event.current.type == EventType.MouseUp)
                {
                    if (Event.current.button == 0 && creatingLink)
                    {
                        creatingLink = false;
                    }
                    else if (Event.current.button == 1)
                    {
                        if (creatingLink)
                        {
                            creatingLink = false;
                        }
                        else
                        {
                            this.DisplayTriggerToolsMenu();
                        }
                    }
                    Event.current.Use();
                }
            }

            GUIStyle s = new GUIStyle(GUI.skin.label);

            s.fontSize         = 12;
            s.normal.textColor = new Color(255, 255, 255, 1);
            s.alignment        = TextAnchor.MiddleCenter;
            s.wordWrap         = true;
            GUI.Label(new Rect(0, 0, TriggerNodeWindowWidth, TriggerNodeWindowHeight),
                      trigger.DMKName(),
                      s);
            s.wordWrap = false;
        }
Esempio n. 6
0
 public DMKTriggerInfo(UnityEngine.Object obj, DMKTrigger p)
 {
     currentFrame   = 0;
     trackingObject = new WeakReference(obj);
     parent         = p;
 }
Esempio n. 7
0
 public virtual void CopyFrom(DMKTrigger trigger)
 {
     this.triggerFrame  = trigger.triggerFrame;
     this.triggerType   = trigger.triggerType;
     this.triggerTarget = trigger.triggerTarget;
 }