예제 #1
0
        public bool isDirty = false; //needs apply

        public CombinedMesh(int maxNumVertsInMesh, GameObject resultSceneObject, SA2LogLevel ll)
        {
            combinedMesh = new SA3MeshCombinerSingle();
            combinedMesh.resultSceneObject = resultSceneObject;
            combinedMesh.LOG_LEVEL         = ll;
            extraSpace             = maxNumVertsInMesh;
            numVertsInListToDelete = 0;
            numVertsInListToAdd    = 0;
            gosToAdd    = new List <GameObject>();
            gosToDelete = new List <int>();
            gosToUpdate = new List <GameObject>();
        }
예제 #2
0
 void _setMBValues(SA3MeshCombinerSingle targ)
 {
     targ.validationLevel    = _validationLevel;
     targ.renderType         = renderType;
     targ.outputOption       = SA2OutputOptions.bakeIntoSceneObject;
     targ.lightmapOption     = lightmapOption;
     targ.textureBakeResults = textureBakeResults;
     targ.doNorm             = doNorm;
     targ.doTan = doTan;
     targ.doCol = doCol;
     targ.doUV  = doUV;
     targ.doUV1 = doUV1;
 }
예제 #3
0
 public static void RebuildPrefab(SA3MeshCombineCommon mom)
 {
     if (SA3MeshCombiner.EVAL_VERSION)
     {
         return;
     }
     if (mom is SA3MeshCombine)
     {
         SA3MeshCombine        mb         = (SA3MeshCombine)mom;
         SA3MeshCombinerSingle mbs        = (SA3MeshCombinerSingle)mb.meshCombiner;
         GameObject            prefabRoot = mom.resultPrefab;
         GameObject            rootGO     = (GameObject)PrefabUtility.InstantiatePrefab(prefabRoot);
         SA3MeshCombinerSingle.BuildSceneHierarch(mbs, rootGO, mbs.GetMesh());
         string prefabPth = AssetDatabase.GetAssetPath(prefabRoot);
         PrefabUtility.ReplacePrefab(rootGO, AssetDatabase.LoadAssetAtPath(prefabPth, typeof(GameObject)), ReplacePrefabOptions.ConnectToPrefab);
         Editor.DestroyImmediate(rootGO);
     }
     else if (mom is SA3MultiMeshCombine)
     {
         SA3MultiMeshCombine  mmb        = (SA3MultiMeshCombine)mom;
         SA3MultiMeshCombiner mbs        = (SA3MultiMeshCombiner)mmb.meshCombiner;
         GameObject           prefabRoot = mom.resultPrefab;
         GameObject           rootGO     = (GameObject)PrefabUtility.InstantiatePrefab(prefabRoot);
         for (int i = 0; i < mbs.meshCombiners.Count; i++)
         {
             SA3MeshCombinerSingle.BuildSceneHierarch(mbs.meshCombiners[i].combinedMesh, rootGO, mbs.meshCombiners[i].combinedMesh.GetMesh(), true);
         }
         string prefabPth = AssetDatabase.GetAssetPath(prefabRoot);
         PrefabUtility.ReplacePrefab(rootGO, AssetDatabase.LoadAssetAtPath(prefabPth, typeof(GameObject)), ReplacePrefabOptions.ConnectToPrefab);
         Editor.DestroyImmediate(rootGO);
     }
     else
     {
         Debug.LogError("Argument was not a SA3MeshCombine or an SA3MultiMeshCombine.");
     }
 }