void GetLevelCreatorInfo() { levelCreatorInfo = AssetDatabase.LoadAssetAtPath("Assets/Resources/Prefabs/LevelCreatorInfo.prefab", typeof(LevelCreatorInfo)) as LevelCreatorInfo; levelBasePrefab = levelCreatorInfo.levelBase; basicRoomPrefab = levelCreatorInfo.basicRoom; doorPrefab = levelCreatorInfo.doorPrefab; }
/// <summary> /// Creates the base for the level where rooms can be added in /// </summary> public void SpawnBaseLevel() { levelCreatorInfo = AssetDatabase.LoadAssetAtPath("Assets/Resources/Prefabs/LevelCreatorInfo.prefab", typeof(LevelCreatorInfo)) as LevelCreatorInfo; levelBaseMain = new GameObject(); levelBaseMain.name = "levelBaseMain"; levelBasePrefab = levelCreatorInfo.levelBase; LevelBase levelBaseStart = Instantiate(levelBasePrefab); levelBaseStart.transform.localScale = new Vector3(levelCreatorInfo.baseWidth, levelCreatorInfo.wallHeight, levelCreatorInfo.baseLenght); levelBaseStart.transform.parent = levelBaseMain.transform; levelBases = new List <LevelBase>(); rooms = new List <Room>(); roomBeingBuild = null; levelBases.Add(levelBaseStart); }
//Wall methods region #region public void SpawnWall() { //Instantiate wall levelCreatorInfo = AssetDatabase.LoadAssetAtPath("Assets/Resources/Prefabs/LevelCreatorInfo.prefab", typeof(LevelCreatorInfo)) as LevelCreatorInfo; levelBasePrefab = levelCreatorInfo.levelBase; wallBeingMade = Instantiate(levelBasePrefab); wallBeingMade.transform.localScale = new Vector3(2, levelCreatorInfo.wallHeight, 2); ActiveEditorTracker.sharedTracker.isLocked = true; GameObject[] selectObject = new GameObject[1]; selectObject[0] = wallBeingMade.gameObject; Selection.objects = selectObject; wallBeingMade.denominator = 1; wallBeingMade.numerator = 1; //Check if intersecting with walls //Cut of part that is intersecting with wall }
private void Awake() { _instance = this; }