virtual public void ExtendedControl() { //Debug.Log("EXT"); AudioSource audio = GetComponent <AudioSource>(); bool buttonAction = NAInput.GetControlDown(NAControl.Action); bool buttonJump = NAInput.GetControlDown(NAControl.Jump); bool buttonCamera = NAInput.GetControlDown(NAControl.Camera); bool buttonMenu = NAInput.GetControlDown(NAControl.Menu); if (buttonAction) { //Debug.Log("stop"); /*audio.Stop(); * NetworkSync ns = GetComponent<NetworkSync>(); * if (ns) * { * ns.SyncAudioSource(); * }*/ Stop(); } if (buttonCamera) { /*audio.Play(); * NetworkSync ns = GetComponent<NetworkSync>(); * if (ns) * { * ns.SyncAudioSource(); * }*/ Play(); } }
public override void ExtendedControl() { base.ExtendedControl(); float dt = Time.deltaTime; float x1 = NAInput.GetAxis(NAControl.MoveHorizontal); float y1 = NAInput.GetAxis(NAControl.MoveVertical); float x2 = NAInput.GetAxis(NAControl.ViewHorizontal); float y2 = NAInput.GetAxis(NAControl.ViewVertical); bool buttonAction = NAInput.GetControlDown(NAControl.Action); bool buttonJump = NAInput.GetControlDown(NAControl.Jump); bool buttonCamera = NAInput.GetControlDown(NAControl.Camera); bool buttonMenu = NAInput.GetControlDown(NAControl.Menu); AudioSource audio = GetComponent <AudioSource>(); if (buttonCamera) { RecorderPlay(); } if (buttonMenu) { Record(); } if (buttonAction) { RecorderStop(); } if (buttonJump) { audio.loop = !audio.loop; } }
//put your logic inside this function public override void ExtendedControl() { //contrôles custom pos += Time.deltaTime * NAInput.GetAxis(NAControl.MoveHorizontal); duration += Time.deltaTime * NAInput.GetAxis(NAControl.MoveVertical); pos = Mathf.Clamp(pos, 0f, 1f); duration = Mathf.Clamp(duration, 0.0001f, 1f); if (NAInput.GetControlDown(NAControl.Jump)) { Generate(); } if (NAInput.GetControlDown(NAControl.Camera)) { Randomize(); } }
//manages the Extended control public override void ExtendedControl() { float dt = Time.deltaTime; float x1 = NAInput.GetAxis(NAControl.MoveHorizontal); float y1 = NAInput.GetAxis(NAControl.MoveVertical); float x2 = NAInput.GetAxis(NAControl.ViewHorizontal); float y2 = NAInput.GetAxis(NAControl.ViewVertical); bool buttonJump = NAInput.GetControlDown(NAControl.Jump); bool buttonCamera = NAInput.GetControlDown(NAControl.Camera); bool buttonMenu = NAInput.GetControlDown(NAControl.Menu); Light light = target.GetComponent <Light>(); //light.range += y1*dt*1f; light.spotAngle += x2 * dt * 45f; light.intensity -= y2 * dt * 1f; light.intensity = Mathf.Clamp(light.intensity, 0, 2f); light.spotAngle = Mathf.Clamp(light.spotAngle, 0, 179f); if (LightName == "MainLightViewer") { //target.transform.Rotate(y1*dt*45f,x1*dt*45f,0); target.transform.RotateAround(transform.position, transform.up, x1 * dt * 45f); target.transform.RotateAround(transform.position, transform.right, y1 * -1f * dt * 45f); } if (buttonCamera) { light.color = new Color(Random.value, Random.value, Random.value); } if (buttonJump) { light.color = Color.white; } dirty = true; }
public override void ExtendedControl() { base.ExtendedControl(); float dt = Time.deltaTime; float x1 = NAInput.GetAxis(NAControl.MoveHorizontal); float y1 = NAInput.GetAxis(NAControl.MoveVertical); float x2 = NAInput.GetAxis(NAControl.ViewHorizontal); float y2 = NAInput.GetAxis(NAControl.ViewVertical); bool buttonAction = NAInput.GetControlDown(NAControl.Action); bool buttonJump = NAInput.GetControlDown(NAControl.Jump); bool buttonCamera = NAInput.GetControlDown(NAControl.Camera); bool buttonMenu = NAInput.GetControlDown(NAControl.Menu); frequency += x1 * dt * 100f; duration += y1 * dt; duration = Mathf.Clamp(duration, 0.1f, 10); if (buttonJump) { Generate(); //Play(); } float padx = NAInput.GetAxis(NAControl.PadHorizontal); float pady = NAInput.GetAxis(NAControl.PadVertical); if (NAInput.PadHorizontalPressed && padx > 0) { waveform = waveform++; } else if (NAInput.PadHorizontalPressed && padx < 0) { waveform = waveform--; } }