Пример #1
0
        void CloseWindow()
        {
            try
            {
                WindowState      = false;
                Cursor.lockState = CursorLockMode.Locked;
                Cursor.visible   = false;

                //initialize
                selectEmType = 0;

                levelSliderValue = 1;
                numSliderValue   = 1;
            }
            catch (Exception ex)
            {
                OutputLog(LogLevel.Warning, GetCultureString("Error") + ex.Message.ToString());
            }
        }
Пример #2
0
        void DoSummon()
        {
            try
            {
                WindowState      = false;
                Cursor.lockState = CursorLockMode.Locked;
                Cursor.visible   = false;

                var inst = SingletonMonoBehaviour <OcPlMng> .Inst;
                var plV3 = inst.getPlPos(0).Value;

                var pl = inst.getPl(0);

                if (pl != null && plV3 != null)
                {
                    plV3 += pl.Cmd.calcLookMoveDir() * 8f;

                    for (int i = 0; i < numSliderValue; i++)
                    {
                        Vector3 v3 = new Vector3();
                        v3    = plV3;
                        v3.x += UnityEngine.Random.Range(0f, 0.5f);
                        v3.z += UnityEngine.Random.Range(0f, 0.5f);

                        SingletonMonoBehaviour <OcEmMng> .Inst.doSpawn_FreeSlot_CheckHost_WithRayCheck(selectEmType, false, v3, (byte)levelSliderValue, true, null, null);
                    }
                }
            }
            catch (Exception ex)
            {
                OutputLog(LogLevel.Warning, GetCultureString("Error") + ex.Message.ToString());
            }
            finally
            {
                //initialize
                selectEmType = 0;

                levelSliderValue = 1;
                numSliderValue   = 1;
            }
        }
Пример #3
0
 public OcEm SearchEnemy(Vector3 position, OcEmType emType)
 {
     return(SearchEnemy(position, new OcEmType[] { emType }));
 }
Пример #4
0
        void WindowFunc(int windowId)
        {
            try
            {
                ScrollViewVector = GUILayout.BeginScrollView(ScrollViewVector, false, false);

                GUILayout.BeginVertical();

                var applyStyle = new GUIStyle(GUI.skin.button)
                {
                    richText = true
                };
                applyStyle.normal.textColor = Color.cyan;

                var sliderStringStyle = new GUIStyle(GUI.skin.label)
                {
                    fontStyle = FontStyle.Bold,
                    richText  = true,
                    normal    = new GUIStyleState {
                        textColor = SliderStringColor
                    }
                };

                GUILayout.BeginVertical(GUI.skin.box);

                GUILayout.BeginHorizontal();

                int count = 1;

                foreach (var kvp in emDic)
                {
                    //make selected encs red
                    var style = new GUIStyle(GUI.skin.button)
                    {
                        richText = true
                    };

                    if (kvp.Key == selectEmType)
                    {
                        style.normal.textColor = Color.red;
                    }

                    if (GUILayout.Button(kvp.Value, style))
                    {
                        selectEmType = kvp.Key;
                    }

                    GUILayout.FlexibleSpace();

                    if (count < MAX_COLUMN_LENGTH)
                    {
                        count++;
                    }
                    else
                    {
                        count = 1;

                        GUILayout.EndHorizontal();
                        GUILayout.BeginHorizontal();
                    }
                }

                for (int i = count; i < MAX_COLUMN_LENGTH; i++)
                {
                    GUILayout.FlexibleSpace();
                }

                GUILayout.EndHorizontal();

                GUILayout.EndVertical();

                //level slider
                GUILayout.Label("Level : " + levelSliderValue.ToString(), sliderStringStyle);
                levelSliderValue = (int)GUILayout.HorizontalSlider(levelSliderValue, 1, 255);

                //enemy number slider
                GUILayout.Label("Num : " + numSliderValue.ToString(), sliderStringStyle);
                numSliderValue = (int)GUILayout.HorizontalSlider(numSliderValue, 1, 94);

                GUILayout.BeginHorizontal();
                GUILayout.FlexibleSpace();

                if (GUILayout.Button(GetCultureString("SummonButton"), applyStyle))
                {
                    DoSummon();
                }

                GUILayout.FlexibleSpace();

                if (GUILayout.Button(GetCultureString("CloseButton")))
                {
                    CloseWindow();
                }

                GUILayout.FlexibleSpace();
                GUILayout.EndHorizontal();

                GUILayout.EndVertical();
                GUILayout.EndScrollView();
            }
            catch (Exception ex)
            {
                OutputLog(LogLevel.Warning, GetCultureString("Error") + ex.Message.ToString());
            }
        }