public void Start() { //Debug.Log( "HoudiniApiAssetAccessorExample: Start" ); parmIndex = 0; parmNames = null; myAsset = null; parmName = ""; parmSize = 0; parmType = HoudiniApiAssetAccessor.ParmType.INVALID; parmIntValue = null; parmFloatValue = null; parmStringValue = null; // If the game object has a HAPI_Asset component then get // the parameters for this asset and set the selected // parameter to be the asset's first parameter myAsset = HoudiniApiAssetAccessor.getAssetAccessor(gameObject); if (myAsset != null) { Debug.Log("Asset name: " + myAsset.prName); parmNames = myAsset.getParameters(); setSelectedParameter(); } }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Public Methods // Static methods used to get HAPI_AssetAccessor(s) ------------------------------------------------------------- public static HoudiniApiAssetAccessor[] getAllAssetAccessors() { HoudiniAsset[] assets = UnityEngine.Object.FindObjectsOfType(typeof(HoudiniAsset)) as HoudiniAsset[]; HoudiniApiAssetAccessor[] accessors = new HoudiniApiAssetAccessor[assets.Length]; for (int i = 0; i < assets.Length; i++) { accessors[i] = new HoudiniApiAssetAccessor(assets[i]); } return(accessors); }