示例#1
0
    public void AddZone()
    {
        Zone t = new Zone();

        t.Name = "NewZone_" + t.GUID;
        FromBZW.AddMapObject <BZWZone>(FromBZW.GetZonePrefab(), t);
    }
示例#2
0
    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);
    }
示例#3
0
    public void AddLink()
    {
        Link t = new Link();

        t.Name = "NewLink_" + t.GUID;
        FromBZW.NewMapObject <BZWLink>(t);
    }
示例#4
0
    public void AddWaterLevel()
    {
        WaterLevel t = new WaterLevel();

        t.Name   = "WaterLevel";
        t.Height = 1;
        FromBZW.NewMapObject <BZWWaterLevel>(t);
    }
示例#5
0
    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);
    }
示例#6
0
    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);
    }
示例#7
0
    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);
    }
示例#8
0
    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);
    }
示例#9
0
    static void ImportBZW()
    {
        string path = EditorUtility.OpenFilePanelWithFilters("Select BZW file", string.Empty, GetBZWFilter());

        if (path != string.Empty)
        {
            FromBZW.ReadUserBZW(path);
        }
    }
示例#10
0
    public static GameObject GetRoot()
    {
        BZWWorld root = GameObject.FindObjectOfType <BZWWorld>();

        if (root != null)
        {
            return(root.gameObject);
        }

        return(FromBZW.CreateNewBZWRoot(new WorldMap()));
    }
示例#11
0
 public void AddPhysics()
 {
     BZFlag.Map.Elements.Physics t = new BZFlag.Map.Elements.Physics();
     t.Name = "NewPhysics_" + t.GUID;
     FromBZW.NewMapObject <BZWPhysics>(t);
 }
示例#12
0
 static void NewBZW()
 {
     FromBZW.CreateNewBZWRoot(new WorldMap());
 }