Exemplo n.º 1
0
        public ActionResult Create(EventMaker eventMaker)
        {
            try
            {
                // TODO: Add insert logic here
                db.EventMakers.Add(eventMaker);
                db.SaveChanges();

                return(RedirectToAction("Index", "EventMaker"));
            }
            catch
            {
                return(View());
            }
        }
Exemplo n.º 2
0
        public ActionResult Delete(int ID, EventMaker eventMaker)
        {
            try
            {
                // TODO: Add delete logic here
                eventMaker = db.EventMakers.Where(c => c.ID == ID).FirstOrDefault();
                db.EventMakers.Remove(eventMaker);
                db.SaveChanges();

                return(RedirectToAction("Index", eventMaker));
            }
            catch
            {
                return(View(ID));
            }
        }
Exemplo n.º 3
0
        public ActionResult Edit(int ID, EventMaker eventMaker)
        {
            try {
                EventMaker dbEventMaker = db.EventMakers.Where(c => c.ID == ID).FirstOrDefault();
                dbEventMaker.FirstName = eventMaker.FirstName;
                dbEventMaker.LastName  = eventMaker.LastName;
                db.SaveChanges();


                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Exemplo n.º 4
0
        // GET: EventMaker/Delete/5
        public ActionResult Delete(int ID)
        {
            EventMaker eventMaker = db.EventMakers.Where(c => c.ID == ID).FirstOrDefault();

            return(View(eventMaker));
        }
Exemplo n.º 5
0
        // GET: EventMaker/Create
        public ActionResult  Create()
        {
            EventMaker eventMaker = new EventMaker();

            return(View(eventMaker));
        }
Exemplo n.º 6
0
        // GET: EventMaker/Details/5
        public ActionResult Details(int ID)
        {
            EventMaker eventMaker = db.EventMakers.Where(e => e.ID == ID).FirstOrDefault();

            return(View(eventMaker));
        }
Exemplo n.º 7
0
 public EventServiceImpl(EventRepository eventRepository, EventMaker eventMaker, IHostingEnvironment hostingEnvironment)
 {
     _eventRepository    = eventRepository;
     _eventMaker         = eventMaker;
     _hostingEnvironment = hostingEnvironment;
 }
Exemplo n.º 8
0
    private void DrawSelectFunction(NodeOutput outPut, NodeInput inPut)
    {
        var functions = selects[outPut].functions;
        var target    = functions[inPut];

        if (!selects.ContainsKey(outPut) || !functions.ContainsKey(inPut))
        {
            return;
        }
        inPut.DisplayLayout();
        if (isExpanded)
        {
            if (target is SpriteChanger)
            {
                GUILayout.BeginHorizontal();
                GUILayout.Label(selectOptions[0]);
                if (GUILayout.Button("기능 삭제"))
                {
                    if (!selects.ContainsKey(outPut) || !functions.ContainsKey(inPut))
                    {
                        return;
                    }
                    DestroyImmediate((MonoBehaviour)functions[inPut]);
                    DestroyImmediate(target, true);
                    functions.Remove(inPut);
                    try
                    {
                        inPut.connection.connections.Remove(inPut);
                    }
                    catch (NullReferenceException e)
                    {
                    }
                    Inputs.Remove(inPut);
                    Vector2 topLeft = rect.position;
                    rect = new Rect(topLeft.x, topLeft.y, 200, 100);
                    DrawConnectors();
                    return;
                }
                GUILayout.EndHorizontal();
                target.delay = EditorGUILayout.FloatField("발동 딜레이(초)", target.delay);

                SpriteChanger changer = (SpriteChanger)target;
                GUILayout.BeginHorizontal();
                GUILayout.Label("기본 스프라이트");
                changer.baseSprite = EditorGUILayout.ObjectField(changer.baseSprite, typeof(Sprite), true) as Sprite;
                GUILayout.Label("선택 스프라이트");
                changer.selectedSprite = EditorGUILayout.ObjectField(changer.selectedSprite, typeof(Sprite), true) as Sprite;
                GUILayout.EndHorizontal();
            }
            else if (target is Enabler)
            {
                GUILayout.BeginHorizontal();
                GUILayout.Label(selectOptions[1]);
                if (GUILayout.Button("기능 삭제"))
                {
                    if (!selects.ContainsKey(outPut) || !functions.ContainsKey(inPut))
                    {
                        return;
                    }
                    DestroyImmediate((MonoBehaviour)functions[inPut]);
                    DestroyImmediate(target, true);
                    functions.Remove(inPut);
                    try
                    {
                        inPut.connection.connections.Remove(inPut);
                    }
                    catch (NullReferenceException e)
                    {
                    }
                    Inputs.Remove(inPut);
                    Vector2 topLeft = rect.position;
                    rect = new Rect(topLeft.x, topLeft.y, 200, 100);
                    DrawConnectors();
                    return;
                }
                GUILayout.EndHorizontal();
                target.delay = EditorGUILayout.FloatField("발동 딜레이(초)", target.delay);

                Enabler enabler = (Enabler)target;
                enabler.option = (EnableOption)EditorGUILayout.EnumPopup("옵션", enabler.option);
            }
            else if (target is SoundPlayer)
            {
                GUILayout.BeginHorizontal();
                GUILayout.Label(selectOptions[2]);
                if (GUILayout.Button("기능 삭제"))
                {
                    if (!selects.ContainsKey(outPut) || !functions.ContainsKey(inPut))
                    {
                        return;
                    }
                    DestroyImmediate((MonoBehaviour)functions[inPut]);
                    DestroyImmediate(target, true);
                    functions.Remove(inPut);
                    try
                    {
                        inPut.connection.connections.Remove(inPut);
                    }
                    catch (NullReferenceException e)
                    {
                    }
                    Inputs.Remove(inPut);
                    Vector2 topLeft = rect.position;
                    rect = new Rect(topLeft.x, topLeft.y, 200, 100);
                    DrawConnectors();
                    return;
                }
                GUILayout.EndHorizontal();
                target.delay = EditorGUILayout.FloatField("발동 딜레이(초)", target.delay);

                SoundPlayer player = (SoundPlayer)target;
                player.sound = EditorGUILayout.ObjectField("효과음", player.sound, typeof(AudioClip), true) as AudioClip;
            }
            else if (target is MessageDisplayer)
            {
                GUILayout.BeginHorizontal();
                GUILayout.Label(selectOptions[3]);
                if (GUILayout.Button("기능 삭제"))
                {
                    if (!selects.ContainsKey(outPut) || !functions.ContainsKey(inPut))
                    {
                        return;
                    }
                    DestroyImmediate((MonoBehaviour)functions[inPut]);
                    DestroyImmediate(target, true);
                    functions.Remove(inPut);
                    try
                    {
                        inPut.connection.connections.Remove(inPut);
                    }
                    catch (NullReferenceException e)
                    {
                    }
                    Inputs.Remove(inPut);
                    Vector2 topLeft = rect.position;
                    rect = new Rect(topLeft.x, topLeft.y, 200, 100);
                    DrawConnectors();
                    return;
                }
                GUILayout.EndHorizontal();
                target.delay = EditorGUILayout.FloatField("발동 딜레이(초)", target.delay);

                GUILayout.BeginHorizontal();
                MessageDisplayer displayer = (MessageDisplayer)target;
                displayer.inputMessage = EditorGUILayout.TextArea(displayer.inputMessage);
                GUILayout.EndHorizontal();
            }
            else if (target is ItemGainer)
            {
                GUILayout.BeginHorizontal();
                GUILayout.Label(selectOptions[4]);
                if (GUILayout.Button("기능 삭제"))
                {
                    if (!selects.ContainsKey(outPut) || !functions.ContainsKey(inPut))
                    {
                        return;
                    }
                    DestroyImmediate((MonoBehaviour)functions[inPut]);
                    DestroyImmediate(target, true);
                    functions.Remove(inPut);
                    try
                    {
                        inPut.connection.connections.Remove(inPut);
                    }
                    catch (NullReferenceException e)
                    {
                    }
                    Inputs.Remove(inPut);
                    Vector2 topLeft = rect.position;
                    rect = new Rect(topLeft.x, topLeft.y, 200, 100);
                    DrawConnectors();
                    return;
                }
                GUILayout.EndHorizontal();
                target.delay = EditorGUILayout.FloatField("발동 딜레이(초)", target.delay);
            }
            else if (target is DangerChanger)
            {
                GUILayout.BeginHorizontal();
                GUILayout.Label(selectOptions[5]);
                if (GUILayout.Button("기능 삭제"))
                {
                    if (!selects.ContainsKey(outPut) || !functions.ContainsKey(inPut))
                    {
                        return;
                    }
                    DestroyImmediate((MonoBehaviour)functions[inPut]);
                    DestroyImmediate(target, true);
                    functions.Remove(inPut);
                    try
                    {
                        inPut.connection.connections.Remove(inPut);
                    }
                    catch (NullReferenceException e)
                    {
                    }
                    Inputs.Remove(inPut);
                    Vector2 topLeft = rect.position;
                    rect = new Rect(topLeft.x, topLeft.y, 200, 100);
                    DrawConnectors();
                    return;
                }
                GUILayout.EndHorizontal();
                target.delay = EditorGUILayout.FloatField("발동 딜레이(초)", target.delay);

                DangerChanger dChanger = (DangerChanger)target;
                dChanger.newDanger = EditorGUILayout.IntField("새 위험도", dChanger.newDanger);
            }
            else if (target is SpriteShower)
            {
                GUILayout.BeginHorizontal();
                GUILayout.Label(selectOptions[6]);
                if (GUILayout.Button("기능 삭제"))
                {
                    if (!selects.ContainsKey(outPut) || !functions.ContainsKey(inPut))
                    {
                        return;
                    }
                    DestroyImmediate((MonoBehaviour)functions[inPut]);
                    DestroyImmediate(target, true);
                    functions.Remove(inPut);
                    try
                    {
                        inPut.connection.connections.Remove(inPut);
                    }
                    catch (NullReferenceException e)
                    {
                    }
                    Inputs.Remove(inPut);
                    Vector2 topLeft = rect.position;
                    rect = new Rect(topLeft.x, topLeft.y, 200, 100);
                    DrawConnectors();
                    return;
                }
                GUILayout.EndHorizontal();
                target.delay = EditorGUILayout.FloatField("발동 딜레이(초)", target.delay);

                SpriteShower shower = (SpriteShower)target;
                for (int i = 0; i < shower.sprites.Count; i++)
                {
                    shower.sprites[i] = EditorGUILayout.ObjectField(shower.sprites[i], typeof(Sprite), true) as Sprite;
                }
                Sprite newSprite = null;
                newSprite = EditorGUILayout.ObjectField(newSprite, typeof(Sprite), true) as Sprite;
                if (newSprite != null)
                {
                    shower.sprites.Add(newSprite);
                }
            }
            else if (target is EventMaker)
            {
                GUILayout.BeginHorizontal();
                GUILayout.Label(selectOptions[7]);
                if (GUILayout.Button("기능 삭제"))
                {
                    if (!selects.ContainsKey(outPut) || !functions.ContainsKey(inPut))
                    {
                        return;
                    }
                    DestroyImmediate((MonoBehaviour)functions[inPut]);
                    functions.Remove(inPut);
                    try
                    {
                        inPut.connection.connections.Remove(inPut);
                    }
                    catch (NullReferenceException e)
                    {
                    }
                    Inputs.Remove(inPut);
                    Vector2 topLeft = rect.position;
                    rect = new Rect(topLeft.x, topLeft.y, 200, 100);
                    DrawConnectors();
                    return;
                }
                GUILayout.EndHorizontal();
                target.delay = EditorGUILayout.FloatField("발동 딜레이(초)", target.delay);

                GUILayout.BeginHorizontal();
                EventMaker eventMaker = (EventMaker)target;
                eventMaker.eventFlag = EditorGUILayout.TextField("이벤트명", eventMaker.eventFlag);
                GUILayout.EndHorizontal();
            }
            GUILayout.Space(10);
        }
    }