Beispiel #1
0
        private List <MenuTree> RecursionMenuButton(List <RoleMenuButtonList> data, List <DistinctMenu> menuData, Guid menuId, Guid roleId)
        {
            var list      = new List <MenuTree>();
            var childMenu = menuData.Where(d => d.ParentId == menuId);

            foreach (var menu in childMenu)
            {
                var buttonList = new List <ButtonTree>();
                var menuButton = new MenuTree();
                var attributes = new MenuButtonAttributes();
                menuButton.Id           = menu.Id;
                menuButton.Title        = menu.Name;
                attributes.MenuButtonId = null;
                menuButton.Attributes   = attributes;
                var buttonTree = data.Where(d => d.MenuId == menu.Id && d.ButtonId.HasValue);
                if (buttonTree.Any())
                {
                    foreach (var button in buttonTree)
                    {
                        var buttons         = new ButtonTree();
                        var buttonAttribute = new MenuButtonAttributes();
                        buttons.Id                   = roleId;
                        buttons.Title                = button.ButtonName;
                        buttons.Checked              = button.Checked;
                        buttons.Attributes           = buttonAttribute;
                        buttonAttribute.MenuButtonId = button.MenuButtonId;
                        buttonList.Add(buttons);
                    }
                }
                menuButton.Children = buttonList;
                list.Add(menuButton);
            }
            return(list);
        }
Beispiel #2
0
        private List <MenuTree> RecursionMenuButton(List <MenuButtonList> data, List <DistinctMenu> menuData, Guid menuId, Guid roleId, string stateStr)
        {
            var list      = new List <MenuTree>();
            var childMenu = menuData.Where(d => d.ParentId == menuId);

            foreach (var menu in childMenu)
            {
                var buttonList = new List <ButtonTree>();
                var menuButton = new MenuTree();
                var attributes = new Attributess();
                menuButton.id         = menu.Id;
                menuButton.state      = stateStr;
                menuButton.text       = menu.Name;
                attributes.buttonid   = null;
                attributes.menuid     = menu.Id;
                menuButton.attributes = attributes;
                var buttonTree = data.Where(d => d.MenuId == menu.Id && d.ButtonId.HasValue);
                if (buttonTree.Any())
                {
                    foreach (var button in buttonTree)
                    {
                        var buttons         = new ButtonTree();
                        var buttonAttribute = new Attributess();
                        buttons.id               = roleId;
                        buttons.text             = button.ButtonName;
                        buttons.@checked         = button.Checked;
                        buttons.attributes       = buttonAttribute;
                        buttonAttribute.buttonid = button.ButtonId;
                        buttonAttribute.menuid   = button.MenuId;
                        buttonList.Add(buttons);
                    }
                }
                menuButton.children = buttonList;
                list.Add(menuButton);
            }
            return(list);
        }
Beispiel #3
0
    void Start()
    {
        // 성경구절 불러오기
        bibleClickManager = bibleVersus.GetComponent <BibleButtonClickManager>();
        bibleClickManager.BibleState(0);
        bibleTurnOff = GameObject.FindGameObjectsWithTag("BibleTurnOff");

        // 버튼들 모두 불러오기
        allUIOnOff = GameObject.FindGameObjectsWithTag("ButtonOnOff");

        // 버추어 카메라 POV 리셋 설정
        cmPOVreset = GameObject.FindGameObjectsWithTag("VirtualCam");

        // 카메라 시작 시점. 해와 달 마스크
        mainCamera.cullingMask = (1 << cullingLayerDefault) | (1 << cullingLayerSunNMoon);

        audioSee             = edenCam.GetComponent <AudioSource>();
        audioEden            = edenSound.GetComponent <AudioSource>();
        audioIdol            = idolCam.GetComponent <AudioSource>();
        audioGameAddict      = gameAddictCam.GetComponent <AudioSource>();
        audioGameAddictLight = gameAddictSpotlight.GetComponent <AudioSource>();
        audioDrugAddict      = drugAddictCam.GetComponent <AudioSource>();
        audioDrugAddictLight = drugAddictSpotlight.GetComponent <AudioSource>();
        audioHospital        = hosptialCam.GetComponent <AudioSource>();
        audioHospitalLight   = hospitalSpotlight.GetComponent <AudioSource>();
        audioDead            = deadCam.GetComponent <AudioSource>();
        audioChrist          = threeJobsCam.GetComponent <AudioSource>();

        anim_EdenRotation = edenPivot.GetComponent <Animator>();
        anim_EdenRotation.SetBool("Rotate", true);
        anim_CrossFade  = cross.GetComponent <Animator>();
        anim_CrossFade2 = cross2.GetComponent <Animator>();
        anim_CrossFade.SetBool("Fade", false);
        anim_CrossFade2.SetBool("Fade", false);

        //영접기도문 켜고끄기
        prayerPanelRaycast = GameObject.Find("PrayerPanel").GetComponent <CanvasGroup>();



        gameAddictLight         = gameAddictLight.GetComponent <Light>();
        gameAddictLight.enabled = false;
        drugAddictLight         = drugAddictLight.GetComponent <Light>();
        drugAddictLight.enabled = false;
        hospitalLight           = hospitalLight.GetComponent <Light>();
        hospitalLight.enabled   = false;
        edenSpotlight           = GameObject.Find("Eden Spotlight").GetComponent <Light>();

        idolLights.SetActive(false);
        deadLights.SetActive(false);
        christLights.SetActive(false);
        gameAddictLightS.SetActive(false);



        // 제목 셋팅 시작
        god                         = GameObject.Find("God").GetComponent <TextFade>();
        originalMan                 = GameObject.Find("OriginalMan").GetComponent <TextFade>();
        originalMan.displayInfo     = false;
        originalProblem             = GameObject.Find("OriginalProblem").GetComponent <TextFade>();
        originalProblem.displayInfo = false;
        problemsOfMan               = GameObject.Find("ProblemsOfMan").GetComponent <TextFade>();
        problemsOfMan.displayInfo   = false;
        theWay                      = GameObject.Find("TheWay").GetComponent <TextFade>();
        theWay.displayInfo          = false;


        // 선악과 버튼 셋팅
        buttonTree     = mainTree.GetComponent <ButtonTree>();
        outLineForTree = mainTreeOutline.GetComponent <Outline>();

        // 선악과 텍스트 셋팅
        treeGen0217 = treeText.GetComponent <TextMeshPro>();

        // 선악과 콜라이더 on off
        forbiddenFruitsTree = mainTree.GetComponent <CapsuleCollider>();

        // 십자가 아웃라인 셋팅
        outLineForCross = CrossOutline.GetComponent <Outline>();

        // 우상신전 연기 피우기 셋팅
        smoke = whiteSmoke.GetComponent <ParticleSystem>();
        smoke.Stop(true);


        // 페이지 시작
        TurnSunNMoonOn();
    }
Beispiel #4
0
        private void buttonPlay_Click(object sender, EventArgs e)
        {
            if (!playing && character != null && finalXY.X > -1)
            {   //Empezar
                moveList.Clear();
                resetMapNumbers();
                buttonExamine.Enabled     = false;
                buttonInitialCord.Enabled = false;
                buttonPlay.Text           = "STOP";
                GroundButton.Enabled      = false;
                buttonCharacter.Enabled   = false;
                buttonFinalCoord.Enabled  = false;
                buttonUp.Enabled          = false;
                buttonDown.Enabled        = false;

                ButtonTree.Enabled = true;
                playing            = !playing;

                character.currentStep = 1;
                character.coordinateX = initXY.X;
                character.coordinateY = initXY.Y;
                mapa[character.coordinateY][character.coordinateX].listSteps.Add(character.currentStep);
                unveilKnown();
                panelMap.Refresh();

                if (checkBoxBacktracking.Checked == true)
                {
                    visitedBT = new List <Point>();
                    routeBT   = new List <Point>();
                    //Backtracking
                    visitedBT.Add(new Point(character.coordinateX, character.coordinateY));
                    routeBT.Add(new Point(character.coordinateX, character.coordinateY));
                    doBackTrack();
                    string result = "";
                    for (int i = 0; i < routeBT.Count; i++)
                    {
                        char c = 'A';
                        c      += (char)routeBT[i].X;
                        result += c.ToString() + "," + (routeBT[i].Y + 1);
                        if (i < routeBT.Count - 1)
                        {
                            result += " -> ";
                        }
                    }
                    labelSteps.Text = result;
                    ButtonTree.PerformClick();
                }
                else if (checkBoxAStar.Checked == true)
                {
                    if (checkBoxRepeat.Checked == true)
                    {
                        //AStar Repeat
                    }
                    else
                    {
                        //AStar no repeat
                        while (playing)
                        {
                            int    minimum = -1;
                            double minFn   = -1;
                            for (int i = 0; i < expantionOrder.Count; i++)
                            {
                                switch (expantionOrder[i])
                                {
                                //UP
                                case 0:
                                    for (int j = 0; j < character.idCostList.Count; j++)
                                    {
                                        //Si encuentra el id
                                        if ((character.coordinateY - 1) > -1 && character.idCostList[j].id == mapa[character.coordinateY - 1][character.coordinateX].TerrainId)
                                        {
                                            // y este no es N/A
                                            if (character.idCostList[j].cost > -1)
                                            {
                                                double manhattan = Math.Sqrt(Math.Pow(finalXY.X - character.coordinateX, 2) + Math.Pow(finalXY.Y - (character.coordinateY - 1), 2));
                                                int    child     = 0;
                                                child += checkChild(-1, 1);
                                                child += checkChild(-1, -1);
                                                child += checkChild(0, 0);
                                                child += checkChild(-2, 0);
                                                moveList.Add(new Move(character.coordinateX, character.coordinateY - 1, child));
                                                if (minimum == -1)
                                                {
                                                    minimum = expantionOrder[i];
                                                    minFn   = manhattan;
                                                }
                                                else if (manhattan < minFn)
                                                {
                                                    minimum = expantionOrder[i];
                                                    minFn   = manhattan;
                                                }
                                            }
                                            break;
                                        }
                                    }
                                    break;

                                //DOWN
                                case 1:
                                    for (int j = 0; j < character.idCostList.Count; j++)
                                    {
                                        //Si encuentra el id
                                        if ((character.coordinateY + 1) < mapa.Count && character.idCostList[j].id == mapa[character.coordinateY + 1][character.coordinateX].TerrainId)
                                        {
                                            // y este no es N/A
                                            if (character.idCostList[j].cost > -1)
                                            {
                                                double manhattan = Math.Sqrt(Math.Pow(finalXY.X - character.coordinateX, 2) + Math.Pow(finalXY.Y - (character.coordinateY + 1), 2));
                                                if (minimum == -1)
                                                {
                                                    minimum = expantionOrder[i];
                                                    minFn   = manhattan;
                                                }
                                                else if (manhattan < minFn)
                                                {
                                                    minimum = expantionOrder[i];
                                                    minFn   = manhattan;
                                                }
                                            }
                                            break;
                                        }
                                    }
                                    break;

                                //LEFT
                                case 2:
                                    for (int j = 0; j < character.idCostList.Count; j++)
                                    {
                                        //Si encuentra el id
                                        if ((character.coordinateX - 1) > -1 && character.idCostList[j].id == mapa[character.coordinateY][character.coordinateX - 1].TerrainId)
                                        {
                                            // y este no es N/A
                                            if (character.idCostList[j].cost > -1)
                                            {
                                                double manhattan = Math.Sqrt(Math.Pow(finalXY.X - (character.coordinateX - 1), 2) + Math.Pow(finalXY.Y - character.coordinateY, 2));
                                                if (minimum == -1)
                                                {
                                                    minimum = expantionOrder[i];
                                                    minFn   = manhattan;
                                                }
                                                else if (manhattan < minFn)
                                                {
                                                    minimum = expantionOrder[i];
                                                    minFn   = manhattan;
                                                }
                                            }
                                            break;
                                        }
                                    }
                                    break;

                                //RIGHT
                                case 3:
                                    for (int j = 0; j < character.idCostList.Count; j++)
                                    {
                                        //Si encuentra el id
                                        if ((character.coordinateX + 1) < mapa[0].Count && character.idCostList[j].id == mapa[character.coordinateY][character.coordinateX + 1].TerrainId)
                                        {
                                            // y este no es N/A
                                            if (character.idCostList[j].cost > -1)
                                            {
                                                double manhattan = Math.Sqrt(Math.Pow(finalXY.X - (character.coordinateX + 1), 2) + Math.Pow(finalXY.Y - character.coordinateY, 2));
                                                if (minimum == -1)
                                                {
                                                    minimum = expantionOrder[i];
                                                    minFn   = manhattan;
                                                }
                                                else if (manhattan < minFn)
                                                {
                                                    minimum = expantionOrder[i];
                                                    minFn   = manhattan;
                                                }
                                            }
                                            break;
                                        }
                                    }
                                    break;
                                }
                            }
                            switch (minimum)
                            {
                            case 0:
                                MoveCharacterUp();
                                break;

                            case 1:
                                MoveCharacterDown();
                                break;

                            case 2:
                                MoveCharacterLeft();
                                break;

                            case 3:
                                MoveCharacterRight();
                                break;
                            }
                            Thread.Sleep(slp);
                        }
                    }
                }
            }
            else if (playing && character != null)
            {   //Dejar de jugar
                buttonExamine.Enabled     = true;
                buttonInitialCord.Enabled = true;
                buttonPlay.Text           = "Play";
                GroundButton.Enabled      = true;
                buttonCharacter.Enabled   = true;
                buttonFinalCoord.Enabled  = true;
                buttonUp.Enabled          = true;
                buttonDown.Enabled        = true;
                playing = !playing;

                FormTreeView TreeWindow = new FormTreeView(ref moveList);
                TreeWindow.ShowDialog();
            }
            if (character == null)
            {
                MessageBox.Show("Debe haber un personaje para jugar", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (finalXY.X == -1)
            {
                MessageBox.Show("Debe haber un estado final", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            panelMap.Refresh();
        }