public void NewOverworld(DoorToLocation door, Vector3 offset) { GameScene gs = door.GetTargetScene(); DatabaseSceneEntrance dse = gs.GuidToEntrance(door.targetGuidString); NewOverworldAt ( gs.name, dse.position + offset, dse.facingDirection, !door.stopOnTransition, false ); }
private void OnEnable() { door = (DoorToLocation)target; GameObject sceneatt = GameObject.Find("SceneAttributes"); if (sceneatt != null) { door.attributes = sceneatt.GetComponent <SceneAttributes>(); door.attributes.RefreshDoors(); if (door.GetTargetScene() != null) { fallbackIndex = door.GetTargetScene().EntranceGuidToInt(door.targetGuidString); } } }
public void RefreshDoors() { GameObject[] doors = GameObject.FindGameObjectsWithTag("Door"); GetCurrentScene().entranceList.Clear(); database.GetScenesArray(); foreach (GameObject door in doors) { DoorToLocation d = door.GetComponent <DoorToLocation>(); DatabaseSceneEntrance dse = new DatabaseSceneEntrance(); dse.name = d.name; dse.facingDirection = d.exitDirection; dse.position = Vector3Int.FloorToInt(d.transform.position); dse.guid = d.GetComponent <GuidComponent>().GetGuid(); dse.guidString = dse.guid.ToString(); GetCurrentScene().entranceList.Add(dse); } doorArray = GetCurrentScene().GetEntrancesArray(); }