private void Start() { isShow = false; middleClickDetected = false; cameraActionDetected = false; skin = (GUISkin) Resources.Load("uteForEditor/uteUI"); // Get runtime builder main class runtimeBuilder = (uteRuntimeBuilder) this.gameObject.GetComponent<uteRuntimeBuilder>(); // List all available category names List<string> allCategoryNames = runtimeBuilder.GetListOfCategoryNames(); for(int i=0;i<allCategoryNames.Count;i++) { // Get all Category tiles and info by name allCategories.Add(runtimeBuilder.GetCategoryByCategoryName(allCategoryNames[i])); } }
private void Start() { isShow = false; middleClickDetected = false; cameraActionDetected = false; skin = (GUISkin)Resources.Load("uteForEditor/uteUI"); // Get runtime builder main class runtimeBuilder = (uteRuntimeBuilder)this.gameObject.GetComponent <uteRuntimeBuilder>(); // List all available category names List <string> allCategoryNames = runtimeBuilder.GetListOfCategoryNames(); for (int i = 0; i < allCategoryNames.Count; i++) { // Get all Category tiles and info by name allCategories.Add(runtimeBuilder.GetCategoryByCategoryName(allCategoryNames[i])); } }
public override void OnInspectorGUI() { base.OnInspectorGUI(); uteRuntimeBuilder myTarget = (uteRuntimeBuilder)target; if (GUILayout.Button("Prepare for Runtime")) { if (!File.Exists(Application.streamingAssetsPath)) { Directory.CreateDirectory(Application.streamingAssetsPath); } if (!File.Exists(Application.streamingAssetsPath + "/uteMaps/")) { Directory.CreateDirectory(Application.streamingAssetsPath + "/uteMaps/"); } if (!File.Exists(Application.streamingAssetsPath + "/uteMaps/uteMapList___R.txt")) { StreamWriter sw = new StreamWriter(Application.streamingAssetsPath + "/uteMaps/uteMapListForRuntime.txt"); sw.Write(""); sw.Close(); } myTarget.SetTiles(); } /*EditorGUILayout.BeginHorizontal(); * myTarget.currentMapIndex = EditorGUILayout.Popup("Map to Load: ",myTarget.currentMapIndex, mapListOptions, EditorStyles.popup); * EditorGUILayout.EndHorizontal(); * * GUILayout.Label("-------------"); * * GUILayout.Label("Loading in EDITOR:"); * if(GUILayout.Button("Load Map In Editor Scene Now")) * { * myTarget.LoadMap(); * }*/ }
private void Start() { QualitySettings.shadowDistance = 100; Weapon = GameObject.Find("weapon"); isShow = false; // Get runtime builder main class runtimeBuilder = (uteRuntimeBuilder) this.gameObject.GetComponent<uteRuntimeBuilder>(); // Set Raycast distance (to not let build far away) runtimeBuilder.SetRaycastDistance(3.0f); // Set snapping to be fixed 1.0f runtimeBuilder.SetSnapOption("fixed"); // Set fixed raycast position from Screen point (form center of the screen) runtimeBuilder.SetFixedRaycastPosition(new Vector2(Screen.width/2,Screen.height/2)); // Get mcraft Category mCraftCategory = runtimeBuilder.GetCategoryByCategoryName("mcraft"); // Get mouseLook component to disable or enable looking if UI shown if(!GameObject.Find("iOSControls")) { isiOSExample = false; mouseLookX = GameObject.Find("First Person Controller").GetComponent<MouseLook>(); mouseLookY = GameObject.Find("First Person Controller/Main Camera").GetComponent<MouseLook>(); } else { isiOSExample = true; // Disale shadows for iOS GameObject.Find("Directional light").GetComponent<Light>().shadows = LightShadows.None; } StartCoroutine(GenerateMapProcedurally()); }
private void Start() { QualitySettings.shadowDistance = 100; Weapon = GameObject.Find("weapon"); isShow = false; // Get runtime builder main class runtimeBuilder = (uteRuntimeBuilder)this.gameObject.GetComponent <uteRuntimeBuilder>(); // Set Raycast distance (to not let build far away) runtimeBuilder.SetRaycastDistance(3.0f); // Set snapping to be fixed 1.0f runtimeBuilder.SetSnapOption("fixed"); // Set fixed raycast position from Screen point (form center of the screen) runtimeBuilder.SetFixedRaycastPosition(new Vector2(Screen.width / 2, Screen.height / 2)); // Get mcraft Category mCraftCategory = runtimeBuilder.GetCategoryByCategoryName("mcraft"); // Get mouseLook component to disable or enable looking if UI shown if (!GameObject.Find("iOSControls")) { isiOSExample = false; mouseLookX = GameObject.Find("First Person Controller").GetComponent <MouseLook>(); mouseLookY = GameObject.Find("First Person Controller/Main Camera").GetComponent <MouseLook>(); } else { isiOSExample = true; // Disale shadows for iOS GameObject.Find("Directional light").GetComponent <Light>().shadows = LightShadows.None; } StartCoroutine(GenerateMapProcedurally()); }