예제 #1
0
        public void Load()
        {
            //player.transform.position = GameObject.Find ("info_player_start").transform.position;

            if (loadMap)
            {
                if (bsp == null)
                {
                    bsp = GetComponent <SourceBSPLoader>();
                }

                bsp.Load(mapName);
                if (exportMap)
                {
                    COLLADAExport.Geometry g = bsp.map.BSPToGeometry();
                    print("Exporting map.");
                    //COLLADAExport.Export(@"I:\uSource\test\"+mapName+".dae",g,false,false);
                    COLLADAExport.Export(exportLocation + mapName + ".dae ", g, false, false);
                }
            }

            if (loadModel)
            {
                GameObject modelObj = new GameObject("TestModel ");
                model.Load(@"models / " + modelName + ".mdl ");
                //model.GetInstance(modelObj,skinnedModel);
                model.GetInstance(modelObj, skinnedModel, 0);
                //modelObj.transform.localEulerAngles=new Vector3(270,0,0);
            }
        }
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();
        COLLADAExport script = (COLLADAExport)target;

        if (GUILayout.Button("Export"))
        {
            COLLADAExport.Export(script.filename, COLLADAExport.MeshToGeometry(script.curMesh), script.zUp, script.sourceUnits);
            Debug.Log("Exported to: " + script.filename);
        }
    }