I m reading a Kudan for Unity exaple project (Kudan is a framework for AR)
in the file KudanTracker.cs they use a TrackerBase object called _trackerPlugin
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
#if UNITY_EDITOR
using UnityEditor;
#endif
namespace Kudan.AR
{
[DisallowMultipleComponent]
[RequireComponent(typeof(Camera))]
[AddComponentMenu("Kudan AR/Kudan Tracker")]
public class KudanTracker : MonoBehaviour
{
protected TrackerBase _trackerPlugin;
public bool ArbiTrackIsTracking()
{
return _trackerPlugin.ArbiTrackIsTracking();
}
...
}
So i head over to TrackerBase.cs to see the implementation for ArbiTrackIsTracking() but all i find is this:
using UnityEngine;
using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
namespace Kudan.AR
{
/// <summary>
/// Base class for the tracker plugin. This abstracts the native plugin for each operating system.
/// </summary>
public abstract class TrackerBase : ITracker
{
public abstract bool ArbiTrackIsTracking ();
...
}
}
How is it possible to call a method that was never implemented?
where is the implementation hiding?
thank you
This is perfectly normal.
Such behavior is normal, IF the class is properly instantiated with a non-abstract version of Trackerbase.
However, you don't provide the relevant instantiation code, so its impossible for me to verify if the code sample you provided is properly instantiated or not, without myself going to get that code.
Theoretically, the instantiation code might look like this:
//Constructor
public KudanTracker(TrackerImplementation track) {
_trackerPlugin = track;
}
IF the code has proper instantiation, such as above, you're fine.