private void Awake() { isFixedRaycast = false; mouseInputBuildEnabled = true; cantBuildForced = false; isCurrentStatic = true; isContinuesBuild = false; isNormalBuild = true; isBuildingMass = false; isRotated = 0; offsetY = .0f; offsetX = .0f; offsetZ = .0f; lastPosZ = .0f; lastPosY = .0f; lastPosX = .0f; rayCastDistance = 1000f; canBuild = false; isMouseDown = false; currentObjectID = "-1"; yTypeOption = "auto"; lastTile = null; MAP_ALLTILES = new GameObject("uteMAP_ALLTILES"); MAP_STATIC = new GameObject("uteMAP_STATIC"); MAP_STATIC.transform.parent = MAP_ALLTILES.transform; MAP_DYNAMIC = new GameObject("uteMAP_DYNAMIC"); MAP_DYNAMIC.transform.parent = MAP_ALLTILES.transform; uMBE = (uteMassBuildEngine) this.gameObject.AddComponent<uteMassBuildEngine>(); }
private void Awake() { isFixedRaycast = false; mouseInputBuildEnabled = true; cantBuildForced = false; isCurrentStatic = true; isContinuesBuild = false; isNormalBuild = true; isBuildingMass = false; isRotated = 0; offsetY = .0f; offsetX = .0f; offsetZ = .0f; lastPosZ = .0f; lastPosY = .0f; lastPosX = .0f; rayCastDistance = 1000f; canBuild = false; isMouseDown = false; currentObjectID = "-1"; yTypeOption = "auto"; lastTile = null; MAP_ALLTILES = new GameObject("uteMAP_ALLTILES"); MAP_STATIC = new GameObject("uteMAP_STATIC"); MAP_STATIC.transform.parent = MAP_ALLTILES.transform; MAP_DYNAMIC = new GameObject("uteMAP_DYNAMIC"); MAP_DYNAMIC.transform.parent = MAP_ALLTILES.transform; uMBE = (uteMassBuildEngine)this.gameObject.AddComponent <uteMassBuildEngine>(); }
public IEnumerator uteInitMapEditorEngine() { rotationList.Add(0); rotationList.Add(90); rotationList.Add(180); rotationList.Add(270); isTileRandomizerEnabled = false; isTileRandomizerRotationEnabled = false; eraserIsEnabled = false; isAltPressed = false; isInTopView = false; currentTCID = 0; lastTile = null; currentLayer = 0; isContinuesBuild = false; isMouseDown = false; isBuildingTC = false; isShowCameraOptions = false; isCamGridMoving = false; isBuildingMass = false; isCommandPressed = false; isControlPressed = false; uteGLOBAL3dMapEditor.canBuild = true; editorIsLoading = true; canBuild = false; cameraGO = (GameObject) GameObject.Find("MapEditorCamera"); uteGLOBAL3dMapEditor.isEditorRunning = true; cameraOptionsRect = new Rect(Screen.width-505,Screen.height-70,410,30); uteHelp = (uteHelpBox) this.gameObject.AddComponent<uteHelpBox>(); ui = (GUISkin) Resources.Load("uteForEditor/uteUI"); catInfoPath = AssetDatabase.GUIDToAssetPath(uteGLOBAL3dMapEditor.uteCategoryInfotxt); settingsInfoPath = AssetDatabase.GUIDToAssetPath(uteGLOBAL3dMapEditor.uteSettingstxt); GUIComboBoxCollider = new Rect(10, 0, 200, 30); GUIComboBoxColliderTC = new Rect(10,0,200,30); gridsize = new Vector3(1000.0f,0.1f,1000.0f); previewObjTexture = new Texture2D(25,25); previewObjTextureTC = new Texture2D(25,25); erase = false; currentTcFamilyName = ""; currentObjectGUID = ""; currentFilter = ""; lastFilter = "_______!@#$%*&(*^*&(^*&"; MAP = new GameObject("MAP"); MAP_DYNAMIC = new GameObject("MAP_DYNAMIC"); MAP_DYNAMIC.transform.parent = MAP.transform; MAP_STATIC = new GameObject("MAP_STATIC"); MAP_STATIC.transform.parent = MAP.transform; MAP_STATIC.isStatic = true; mapLightGO = (GameObject) Instantiate((GameObject) Resources.Load("uteForEditor/uteMapLight")); mapLightGO.name = "MapLight"; GameObject tempGO = new GameObject(); tempGO.name = "TEMP"; LayersEngine = (uteLayersEngine) this.gameObject.AddComponent<uteLayersEngine>(); LayersEngine.ReadLayersFromMap(newProjectName,MAP_STATIC,MAP_DYNAMIC,this); previewT = new Texture2D(2,2); previewTTC = new Texture2D(2,2); isShowLineHelpers = false; GameObject help = (GameObject) Instantiate((GameObject)Resources.Load("uteForEditor/uteHELPERS"),Vector3.zero,Quaternion.identity); help.name = "uteHELPERS"; helpers_CANTBUILD = GameObject.Find("uteHELPERS/CANTBUILD"); helpers_CANBUILD = GameObject.Find("uteHELPERS/CANBUILD"); InitHelperLines(); uTCE = (uteTileConnectionsEngine) this.gameObject.AddComponent<uteTileConnectionsEngine>(); uMBE = (uteMassBuildEngine) this.gameObject.AddComponent<uteMassBuildEngine>(); yield return StartCoroutine(ReloadTileAssets()); uteOptions = (uteOptionsBox) this.gameObject.AddComponent<uteOptionsBox>(); saveMap.options = uteOptions; UndoSystem = (uteUndoSystem) this.gameObject.AddComponent<uteUndoSystem>(); StartCoroutine(EraserHandler()); if(isItLoad) { _uteLM = this.gameObject.AddComponent<uteLM>(); _uteLM.uMEE = this; yield return StartCoroutine(_uteLM.LoadMap(newProjectName,MAP_STATIC,MAP_DYNAMIC,isItNewMap)); yield return StartCoroutine(LoadCameraInfo()); yield return StartCoroutine(uteOptions.LoadOptions()); yield return StartCoroutine(AssignLayersToTiles()); editorIsLoading = false; LayersEngine.CheckIfAllTilesHasExistingLayer(); } else { editorIsLoading = false; } if(!isItLoad) { yield return StartCoroutine(saveMap.SaveMap(newProjectName,isItNewMap)); } yield return 0; }