/// <summary> /// rebuild ar database /// </summary> public static void Rebuild() { //if in playmode, do not update. if (EditorApplication.isPlaying) { return; } Debug.Log("-->DB Refreshed"); //get all scene models and their names sceneModels = GameObject.FindGameObjectsWithTag("NCAR_model"); sceneModelNames = NCARappDB.sceneModels.Select(p => p.name).ToArray(); //get all the model guis assetModelGuis = NcHelpers.FindAllARAssetModels(isGuid: true); //get all the model names assetModelNames = NcHelpers.FindAllARAssetModels(isGuid: false); //get all the target object targets = NcHelpers.FindAllARTargets(); //get all the target names targetNames = NCARappDB.targets.Select(p => p.gameObject.name).ToArray(); //get all the conditions as methodInfo conditions = typeof(ARTargetCondition).GetMethods(BindingFlags.Public | BindingFlags.Static); //get all the condition function names conditionNames = NCARappDB.conditions.Select(p => p.Name).ToArray(); //get all the conditiondeligates conditionDeligates = NCARappDB.conditions.Select(p => (Func <NCARTrackableEventHandler, NCARTrackableEventHandler, float, float, bool>)System.Delegate.CreateDelegate(typeof(Func <NCARTrackableEventHandler, NCARTrackableEventHandler, float, float, bool>), null, p)).ToArray(); }
public static void FindAllARCards() { string[] cardList = NcHelpers.FindAllARTargetNames(); foreach (string name in cardList) { Debug.Log(name); } }
void Awake() { //add NCARmodel to ar models GameObject[] modelList = NcHelpers.FindAllSceneModelsByTag(); foreach (GameObject model in modelList) { model.AddComponent <NCARModelData> (); } Debug.Log("-----> NCARModelData Component Attached"); }