Exemplo n.º 1
0
 // Creates a new Accessor object of the appropriate type. The accessor takes
 // a TrackableBehaviour as a target (the Accessor instance accesses this
 // single object).
 public static TrackableAccessor Create(TrackableBehaviour target)
 {
     if (target is MarkerBehaviour)
     {
         return new MarkerAccessor((MarkerBehaviour)target);
     }
     else if (target is ImageTargetBehaviour)
     {
         return new ImageTargetAccessor((ImageTargetBehaviour)target);
     }
     else if (target is MultiTargetBehaviour)
     {
         return new MultiTargetAccessor((MultiTargetBehaviour)target);
     }
     else if (target is CylinderTargetBehaviour)
     {
         return new CylinderTargetAccessor((CylinderTargetBehaviour)target);
     }
     else
     {
         Debug.LogWarning(target.GetType().ToString() +
                          " is not derived from TrackableBehaviour.");
         return null;
     }
 }
Exemplo n.º 2
0
 public static TrackableAccessor Create(TrackableBehaviour target)
 {
     if (target is ImageTargetAbstractBehaviour)
     {
         return(new ImageTargetAccessor((ImageTargetAbstractBehaviour)target));
     }
     if (target is MultiTargetAbstractBehaviour)
     {
         return(new MultiTargetAccessor((MultiTargetAbstractBehaviour)target));
     }
     if (target is CylinderTargetAbstractBehaviour)
     {
         return(new CylinderTargetAccessor((CylinderTargetAbstractBehaviour)target));
     }
     if (target is VuMarkAbstractBehaviour)
     {
         return(new VuMarkAccessor((VuMarkAbstractBehaviour)target));
     }
     if (target is ObjectTargetAbstractBehaviour)
     {
         return(new ObjectTargetAccessor((ObjectTargetAbstractBehaviour)target));
     }
     Debug.LogWarning(target.GetType().ToString() + " is not derived from TrackableBehaviour.");
     return(null);
 }
 public static TrackableAccessor Create(TrackableBehaviour target)
 {
     if (target is MarkerAbstractBehaviour)
     {
         return(new MarkerAccessor((MarkerAbstractBehaviour)target));
     }
     if (target is ImageTargetAbstractBehaviour)
     {
         return(new ImageTargetAccessor((ImageTargetAbstractBehaviour)target));
     }
     if (target is MultiTargetAbstractBehaviour)
     {
         return(new MultiTargetAccessor((MultiTargetAbstractBehaviour)target));
     }
     if (target is CylinderTargetAbstractBehaviour)
     {
         return(new CylinderTargetAccessor((CylinderTargetAbstractBehaviour)target));
     }
     if (target is IEditorRigidBodyTargetBehaviour)
     {
         return(new RigidBodyTargetAccessor((IEditorRigidBodyTargetBehaviour)target));
     }
     Debug.LogWarning(target.GetType().ToString() + " is not derived from TrackableBehaviour.");
     return(null);
 }
 // Creates a new Accessor object of the appropriate type. The accessor takes
 // a TrackableBehaviour as a target (the Accessor instance accesses this
 // single object).
 public static TrackableAccessor Create(TrackableBehaviour target)
 {
     if (target is MarkerBehaviour)
     {
         return(new MarkerAccessor((MarkerBehaviour)target));
     }
     else if (target is ImageTargetBehaviour)
     {
         return(new ImageTargetAccessor((ImageTargetBehaviour)target));
     }
     else if (target is MultiTargetBehaviour)
     {
         return(new MultiTargetAccessor((MultiTargetBehaviour)target));
     }
     else
     {
         Debug.LogWarning(target.GetType().ToString() +
                          " is not derived from TrackableBehaviour.");
         return(null);
     }
 }
Exemplo n.º 5
0
    // Creates a new Accessor object of the appropriate type. The accessor takes
    // a TrackableBehaviour as a target (the Accessor instance accesses this
    // single object).
    public static TrackableAccessor Create(TrackableBehaviour target)
    {
        System.Type trackableType = target.GetType();

        if (trackableType == typeof(MarkerBehaviour))
        {
            return new MarkerAccessor((MarkerBehaviour)target);
        }
        else if (trackableType == typeof(ImageTargetBehaviour))
        {
            return new ImageTargetAccessor((ImageTargetBehaviour)target);
        }
        else if (trackableType == typeof(MultiTargetBehaviour))
        {
            return new MultiTargetAccessor((MultiTargetBehaviour)target);
        }
        else
        {
            Debug.LogWarning(trackableType.ToString() +
                             " is not derived from TrackableBehaviour.");
            return null;
        }
    }
Exemplo n.º 6
0
    // Creates a new Accessor object of the appropriate type. The accessor takes
    // a TrackableBehaviour as a target (the Accessor instance accesses this
    // single object).
    public static TrackableAccessor Create(TrackableBehaviour target)
    {
        System.Type trackableType = target.GetType();

        if (trackableType == typeof(MarkerBehaviour))
        {
            return(new MarkerAccessor((MarkerBehaviour)target));
        }
        else if (trackableType == typeof(ImageTargetBehaviour))
        {
            return(new ImageTargetAccessor((ImageTargetBehaviour)target));
        }
        else if (trackableType == typeof(MultiTargetBehaviour))
        {
            return(new MultiTargetAccessor((MultiTargetBehaviour)target));
        }
        else
        {
            Debug.LogWarning(trackableType.ToString() +
                             " is not derived from TrackableBehaviour.");
            return(null);
        }
    }