/// <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(); }
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; } }
/// <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(); }
protected void Stop() { if (null != iface) { Object.Destroy(iface); iface = null; } PathHolder holder = GetComponent <PathHolder>(); if (null != holder) { Object.Destroy(holder); } }
protected void Stop() { if (null != iface) { Object.Destroy(iface); iface = null; } PathHolder holder = GetComponent<PathHolder>(); if (null != holder) { Object.Destroy(holder); } }
/// <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(); }