Created
April 23, 2018 17:39
-
-
Save jhorikawa/525d886c2ea68e4fd888d23d201950f3 to your computer and use it in GitHub Desktop.
Unity C# script to control digital asset from Houdini on runtime (only on Unity Editor) using Houdini Engine.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class ParameterController : MonoBehaviour { | |
private HoudiniApiAssetAccessor myAsset; | |
public GameObject digitalAssetObject; | |
// Use this for initialization | |
void Start () { | |
myAsset = HoudiniApiAssetAccessor.getAssetAccessor(digitalAssetObject); | |
} | |
// Update is called once per frame | |
void Update () { | |
} | |
public void UpdateWaveHeight(float val) | |
{ | |
myAsset.setParmFloatValue("wave_height", 0, val); | |
} | |
public void UpdateNoiseScale(float val) | |
{ | |
myAsset.setParmFloatValue("noise_scale", 0, val); | |
} | |
public void UpdateNoiseSeed(float val) | |
{ | |
myAsset.setParmFloatValue("noise_seed", 0, val); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment