目录
(转到“利用 Game Parameter 实现多样变化”)
using System.Collections; using System.Collections.Generic; using UnityEngine; public class SetRTPCToDistance : MonoBehaviour { public AK.Wwise.RTPC GameParameter; public Transform OtherTransform; // 每帧调用 Update 函数一次。 void Update () { float distance = Vector3.Distance(OtherTransform.position, transform.position); GameParameter.SetGlobalValue(distance); } }