public static void ReplacePrefab(GameObject gameObject, string assetPath, MB_ReplacePrefabOption replacePrefabOptions)
 {
     if (_MBVersion == null)
     {
         _MBVersion = _CreateMBVersionConcrete();
     }
     _MBVersion.ReplacePrefab(gameObject, assetPath, replacePrefabOptions);
 }
Ejemplo n.º 2
0
        public void ReplacePrefab(GameObject gameObject, string assetPath, MB_ReplacePrefabOption replacePrefabOptions)
        {
#if UNITY_2018_3_OR_NEWER
            PrefabUtility.SaveAsPrefabAssetAndConnect(gameObject, assetPath, InteractionMode.AutomatedAction);
#else
            GameObject obj = (GameObject)AssetDatabase.LoadAssetAtPath(assetPath, typeof(GameObject));
            PrefabUtility.ReplacePrefab(gameObject, obj, (ReplacePrefabOptions)replacePrefabOptions);
#endif
        }
Ejemplo n.º 3
0
 public static void ReplacePrefab(GameObject gameObject, string assetPath, MB_ReplacePrefabOption replacePrefabOptions)
 {
     GetInstance().ReplacePrefab(gameObject, assetPath, replacePrefabOptions);
 }