protected override bool Init(ACTkDetectorBase instance, string detectorName) { if (cachedUri == null) { cachedUri = UrlToUri(requestUrl); } return(base.Init(instance, detectorName)); }
private static void DestroyDetectorImmediate(ACTkDetectorBase component) { if (component.transform.childCount == 0 && component.GetComponentsInChildren <Component>(true).Length <= 2) { DestroyImmediate(component.gameObject); } else { DestroyImmediate(component); } }
protected virtual bool Init(ACTkDetectorBase instance, string detectorName) { if (instance != null && instance != this && instance.keepAlive) { Debug.LogWarning(ACTkConstants.LogPrefix + name + ": self-destroying, other instance already exists & only one instance allowed!", gameObject); Destroy(this); return(false); } DontDestroyOnLoad(transform.parent != null ? transform.root.gameObject : gameObject); return(true); }