Example #1
0
 public static void EditorConfigureTarget(MultiTargetAbstractBehaviour mtb, SerializedMultiTarget serializedObject)
 {
     if (mtb == null)
     {
         Debug.LogError("MultiTargetAbstractBehaviour parameter is null !");
         return;
     }
     if (VuforiaUtilities.GetPrefabType(mtb) == PrefabType.Prefab)
     {
         return;
     }
     if (!SceneManager.Instance.SceneInitialized)
     {
         SceneManager.Instance.InitScene();
     }
     using (serializedObject.Edit())
     {
         if (!serializedObject.InitializedInEditor && !EditorApplication.isPlaying)
         {
             ConfigData.MultiTargetData multiTargetData;
             ConfigDataManager.Instance.GetConfigData("--- EMPTY ---").GetMultiTarget("--- EMPTY ---", out multiTargetData);
             serializedObject.DataSetPath   = "--- EMPTY ---";
             serializedObject.TrackableName = "--- EMPTY ---";
             List <ConfigData.MultiTargetPartData> parts = multiTargetData.parts;
             MultiTargetEditor.UpdateParts(serializedObject, parts.ToArray());
             serializedObject.InitializedInEditor = true;
         }
         else if (!EditorApplication.isPlaying)
         {
             MultiTargetEditor.CheckMesh(mtb);
         }
     }
 }
Example #2
0
 public override void ApplyDataSetProperties()
 {
     if (VuforiaUtilities.GetPrefabType(this.mTarget) == PrefabType.Prefab)
     {
         return;
     }
     using (this.mSerializedObject.Edit())
     {
         ConfigData.MultiTargetData multiTargetData;
         if (this.TrackableInDataSet(this.mSerializedObject.TrackableName, this.mSerializedObject.GetDataSetName()))
         {
             ConfigDataManager.Instance.GetConfigData(this.mSerializedObject.GetDataSetName()).GetMultiTarget(this.mSerializedObject.TrackableName, out multiTargetData);
         }
         else
         {
             ConfigDataManager.Instance.GetConfigData("--- EMPTY ---").GetMultiTarget("--- EMPTY ---", out multiTargetData);
             this.mSerializedObject.DataSetPath   = "--- EMPTY ---";
             this.mSerializedObject.TrackableName = "--- EMPTY ---";
         }
         List <ConfigData.MultiTargetPartData> parts = multiTargetData.parts;
         MultiTargetEditor.UpdateParts(this.mSerializedObject, parts.ToArray());
     }
 }