示例#1
0
        /// <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();
        }
示例#2
0
 public static void FindAllARCards()
 {
     string[] cardList = NcHelpers.FindAllARTargetNames();
     foreach (string name in cardList)
     {
         Debug.Log(name);
     }
 }
示例#3
0
 void Awake()
 {
     //add NCARmodel to ar models
     GameObject[] modelList = NcHelpers.FindAllSceneModelsByTag();
     foreach (GameObject model in modelList)
     {
         model.AddComponent <NCARModelData> ();
     }
     Debug.Log("-----> NCARModelData Component Attached");
 }