public void AddZone() { Zone t = new Zone(); t.Name = "NewZone_" + t.GUID; FromBZW.AddMapObject <BZWZone>(FromBZW.GetZonePrefab(), t); }
static void OpenBZW() { string path = EditorUtility.OpenFilePanelWithFilters("Select BZW file", string.Empty, GetBZWFilter()); if (path == string.Empty) { return; } if (EditorUtility.DisplayDialog("Clear Scene Objects?", "Opening a BZW file will clear any existing scene objects, are you sure you wish to continue?", "Yes", "No, import instead")) { // flush out any old objects foreach (var obj in GameObject.FindObjectsOfType(typeof(GameObject))) { GameObject mb = obj as GameObject; if (mb.GetComponent <Camera>() != null || mb.GetComponent <Light>() != null) { continue; } UnityEngine.Object.DestroyImmediate(obj); } } FromBZW.ReadUserBZW(path); }
public void AddLink() { Link t = new Link(); t.Name = "NewLink_" + t.GUID; FromBZW.NewMapObject <BZWLink>(t); }
public void AddWaterLevel() { WaterLevel t = new WaterLevel(); t.Name = "WaterLevel"; t.Height = 1; FromBZW.NewMapObject <BZWWaterLevel>(t); }
public void AddPyramid() { Pyramid p = new Pyramid(); p.Size = new BZFlag.Data.Types.Vector3F(1, 1, 1); p.Name = "NewPyramid_" + p.GUID; FromBZW.NewMapObject <BZWPyramid>(p); }
public void AddBox() { Box box = new Box(); box.Size = new BZFlag.Data.Types.Vector3F(1, 1, 1); box.Name = "NewBox_" + box.GUID; FromBZW.NewMapObject <BZWBox>(box); }
public void AddBase() { Base t = new Base(); t.Size = new BZFlag.Data.Types.Vector3F(1, 1, 1); t.TeamColor = BZFlag.Data.Teams.TeamColors.RedTeam; t.Name = "NewBase_" + t.GUID; FromBZW.NewMapObject <BZWBase>(t); }
public void AddTeleporter() { Teleporter t = new Teleporter(); t.Size = new BZFlag.Data.Types.Vector3F(0.25f, 3, 10); t.Border = 0.5f; t.Name = "NewTeleporter_" + t.GUID; FromBZW.NewMapObject <BZWTeleporter>(t); }
static void ImportBZW() { string path = EditorUtility.OpenFilePanelWithFilters("Select BZW file", string.Empty, GetBZWFilter()); if (path != string.Empty) { FromBZW.ReadUserBZW(path); } }
public static GameObject GetRoot() { BZWWorld root = GameObject.FindObjectOfType <BZWWorld>(); if (root != null) { return(root.gameObject); } return(FromBZW.CreateNewBZWRoot(new WorldMap())); }
public void AddPhysics() { BZFlag.Map.Elements.Physics t = new BZFlag.Map.Elements.Physics(); t.Name = "NewPhysics_" + t.GUID; FromBZW.NewMapObject <BZWPhysics>(t); }
static void NewBZW() { FromBZW.CreateNewBZWRoot(new WorldMap()); }