Пример #1
0
    // This method updates the respective Trackable properties (e.g. size)
    // with data set data.
    public override void ApplyDataSetProperties()
    {
        // Prefabs should not be editable
        if (QCARUtilities.GetPrefabType(mTarget) == PrefabType.Prefab)
        {
            return;
        }

        IEditorCylinderTargetBehaviour ctb = (CylinderTargetBehaviour)mTarget;

        ConfigData.CylinderTargetData ctConfig;
        if (TrackableInDataSet(ctb.TrackableName, ctb.DataSetName))
        {
            ConfigData dataSetData = ConfigDataManager.Instance.GetConfigData(ctb.DataSetName);
            dataSetData.GetCylinderTarget(ctb.TrackableName, out ctConfig);
        }
        else
        {
            // If the Trackable has been removed from the data set we reset it to default.
            ConfigData dataSetData =
                ConfigDataManager.Instance.GetConfigData(QCARUtilities.GlobalVars.DEFAULT_DATA_SET_NAME);
            dataSetData.GetCylinderTarget(QCARUtilities.GlobalVars.DEFAULT_TRACKABLE_NAME, out ctConfig);
            ctb.SetDataSetPath(QCARUtilities.GlobalVars.DEFAULT_DATA_SET_NAME);
            ctb.SetNameForTrackable(QCARUtilities.GlobalVars.DEFAULT_TRACKABLE_NAME);
        }

        CylinderTargetEditor.UpdateScale(ctb, ctConfig.sideLength);
    }
Пример #2
0
 public override void ApplyDataSetProperties()
 {
     if (QCARUtilities.GetPrefabType(base.mTarget) != PrefabType.Prefab)
     {
         ConfigData.CylinderTargetData  data;
         IEditorCylinderTargetBehaviour mTarget = (CylinderTargetAbstractBehaviour)base.mTarget;
         if (this.TrackableInDataSet(mTarget.TrackableName, mTarget.DataSetName))
         {
             ConfigDataManager.Instance.GetConfigData(mTarget.DataSetName).GetCylinderTarget(mTarget.TrackableName, out data);
         }
         else
         {
             ConfigDataManager.Instance.GetConfigData("--- EMPTY ---").GetCylinderTarget("--- EMPTY ---", out data);
             mTarget.SetDataSetPath("--- EMPTY ---");
             mTarget.SetNameForTrackable("--- EMPTY ---");
         }
         CylinderTargetEditor.UpdateScale(mTarget, data.sideLength);
     }
 }