Ejemplo n.º 1
0
            /// <summary>
            /// Call from your Start method
            /// </summary>
            protected void Start()
            {
                if (null != iface)
                {
                    return;
                }
                AdvertisePath();
                GameObject go       = this.gameObject;
                PathHolder holder   = null;
                string     usedPath = path;

                while (null != go && 0 == usedPath.Length)
                {
                    holder = go.GetComponent <PathHolder>();
                    if (null != holder)
                    {
                        usedPath = holder.path;
                        //print("[OSVR] " + name + ": Found path " + usedPath + " in ancestor " + go.name);
                    }
                    go = GetParent.Get(go);
                }

                if (0 == usedPath.Length)
                {
                    Debug.LogError("[OSVR] Missing path for " + name + " - no path found in this object's InterfaceGameObject or any ancestor!");
                    return;
                }

                iface      = ScriptableObject.CreateInstance <InterfaceCallbacks>();
                iface.path = usedPath;
                iface.Start();
            }
Ejemplo n.º 2
0
 protected override void Stop()
 {
     base.Stop();
     if (null != iface)
     {
         Object.Destroy(iface);
         iface = null;
     }
 }
 protected override void Stop()
 {
     base.Stop ();
     if (null != iface)
     {
         Object.Destroy(iface);
         iface = null;
     }
 }
Ejemplo n.º 4
0
            /// <summary>
            /// Call from your Start method
            /// </summary>
            protected override void Start()
            {
                base.Start();
                if (null != iface)
                {
                    return;
                }

                iface      = ScriptableObject.CreateInstance <InterfaceCallbacks>();
                iface.path = usedPath;
                iface.Start();
            }
            /// <summary>
            /// Call from your Start method
            /// </summary>
            protected override void Start()
            {
                base.Start ();
                if (null != iface)
                {
                    return;
                }

                iface = ScriptableObject.CreateInstance<InterfaceCallbacks>();
                iface.path = usedPath;
                iface.Start();
            }
Ejemplo n.º 6
0
            protected void Stop()
            {
                if (null != iface)
                {
                    Object.Destroy(iface);
                    iface = null;
                }
                PathHolder holder = GetComponent <PathHolder>();

                if (null != holder)
                {
                    Object.Destroy(holder);
                }
            }
Ejemplo n.º 7
0
 protected void Stop()
 {
     if (null != iface)
     {
         Object.Destroy(iface);
         iface = null;
     }
     PathHolder holder = GetComponent<PathHolder>();
     if (null != holder)
     {
         Object.Destroy(holder);
     }
 }
Ejemplo n.º 8
0
            /// <summary>
            /// Call from your Start method
            /// </summary>
            protected void Start()
            {
                if (null != iface)
                {
                    return;
                }
                AdvertisePath();
                GameObject go = this.gameObject;
                PathHolder holder = null;
                string usedPath = path;
                while (null != go && 0 == usedPath.Length)
                {
                    holder = go.GetComponent<PathHolder>();
                    if (null != holder)
                    {
                        usedPath = holder.path;
                        //print("[OSVR] " + name + ": Found path " + usedPath + " in ancestor " + go.name);
                    }
                    go = GetParent.Get(go);
                }

                if (0 == usedPath.Length)
                {
                    Debug.LogError("[OSVR] Missing path for " + name + " - no path found in this object's InterfaceGameObject or any ancestor!");
                    return;
                }

                iface = ScriptableObject.CreateInstance<InterfaceCallbacks>();
                iface.path = usedPath;
                iface.Start();
            }