public void OnDespawn() { _emitter.stop(STOP_MODE.ALLOWFADEOUT); _airspeedParam.setValue(0f); _angleOfAttackParam.setValue(0f); }
public void OnDespawn() { _emitter.stop(STOP_MODE.IMMEDIATE); _airspeedParam.setValue(0f); _angleOfAttackParam.setValue(0f); _groundProximityParam.setValue(100f); }
// Update is called once per frame void Update() { menuSoundTimer += Time.deltaTime; if (menuSoundTimer >= 7) { menuSampleInstance.setValue(UnityEngine.Random.Range(0, 3)); menuSoundTimer = 0; } }
void Update() { if (hasParameter) { if (emitter.IsPlaying()) { parameter.setValue(ExtensionsManager.GetOcclusionAmout(transform.position)); } } }
private void Update() { #if UNITY_EDITOR if (Input.GetKeyDown(KeyCode.Y)) { Die(); } #endif if (!playingSound) { return; } if (Time.time - lastTimeOfDamage > TimeForCoreDamageLoop) { LoopingPrameter.setValue(0); playingSound = false; } }
private void OnCollisionEnter(Collision collision) { if (collision.gameObject.CompareTag("Floor")) { isOnFloor = true; } else { truckCrash.setValue(1f); StartCoroutine(DestroyTruck()); } }
// Update is called once per frame void Update() { if ((Input.GetKey(KeyCode.Mouse0) || Input.GetKey(KeyCode.Space)) && isOnFloor) { if (!fired) { CanvasScore.instance.NextTurn(); } WeaponController.instance.cameraLocked = false; truckDrive.setValue(1f); fired = true; } if (fired) { rb.AddForce(transform.parent.forward * speed); } }
private void Update() { soundTimer += Time.deltaTime; if (soundTimer >= 7) { sampleInstance.setValue(UnityEngine.Random.Range(0, 3)); soundTimer = 0; } OneTankLeft(); if (timeText.IsActive() == true && isRoundPlaying) { timeLeft -= Time.deltaTime; } timeText.text = ("Time\n" + (int)timeLeft); if (timeLeft <= 1f) { m_ActiveBarrels = 0; } }
private void OnCollisionEnter(Collision collision) { impactParam.setValue(1); Vector3 explosionPos = transform.position; Collider[] colliders = Physics.OverlapSphere(explosionPos, explosionRadius); foreach (Collider hit in colliders) { Rigidbody rigidBody = hit.GetComponent <Rigidbody>(); if (rigidBody != null) { rigidBody.AddExplosionForce(explosionStrength, explosionPos, explosionRadius); } } var particle = Instantiate(explosionPrefab, transform.position, Quaternion.identity); Destroy(particle, 1f); Destroy(this.gameObject, 0.05f); }
void Update() { if (Input.GetKey(KeyCode.Mouse0) && !ballShot) { CanvasScore.instance.NextTurn(); eventStart.start(); RaycastHit hit; Ray ray = camera.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray, out hit)) { target = hit.point - transform.position; Rigidbody ballRigid = GetComponent <Rigidbody>(); ballRigid.useGravity = true; ballRigid.AddForce(target.normalized * fireSpeed + Vector3.up * fireSpeed / 10, ForceMode.Impulse); ballRigid.AddTorque(transform.up * 1000 - transform.right * 1000); WeaponController.instance.firingWeapon = true; ballShot = true; audioParam.setValue(1f); } } }
private void AddIntensity(float intensity) { CombatIntensity += intensity; intensityParam.setValue(CombatIntensity); }
void OnGUI() { boundactive = false; GUI.depth = -5000; if (editing == this) { if (Vector3.Dot(Camera.main.transform.forward, (transform.position - Camera.main.transform.position).normalized) > 0.1f) { GUI.skin = gskin; Vector3 screenPoint = Camera.main.WorldToScreenPoint(transform.position); screenPoint.x -= 30f; screenPoint.y -= 25f; int height = 120; if (audioSrc.audioInst != null) { int slidercnt = 0; audioSrc.audioInst.getParameterCount(out slidercnt); height = 304 + 25 * slidercnt; } GUI.BeginGroup(new Rect(screenPoint.x, Screen.height - screenPoint.y, 300, height)); GUI.Box(new Rect(0, 0, 300, height), ""); GUILayout.BeginHorizontal(); GUILayout.Space(5); GUILayout.BeginVertical(); GUILayout.Space(8); { GUILayout.Label("Load Event"); GUILayout.BeginHorizontal(); { GUILayout.Space(13); inputPath = GUILayout.TextField(inputPath, GUILayout.Width(200)); if (GUILayout.Button("Load", GUILayout.Width(50))) { audioSrc.path = inputPath; } } GUILayout.EndHorizontal(); GUILayout.Space(15); GUILayout.Label("Audio Settings"); if (audioSrc.audioInst != null) { EventDescription desc = null; audioSrc.audioInst.getDescription(out desc); if (desc != null && desc.isValid()) { bool is3D = false; desc.is3D(out is3D); bool isOneshot = false; desc.isOneshot(out isOneshot); float mindist = 0, maxdist = 0; if (is3D) { desc.getMinimumDistance(out mindist); desc.getMaximumDistance(out maxdist); boundactive = true; bound.transform.localScale = Vector3.one * audioSrc.maxDistance * 2f; } string is3Dstr = is3D ? "3D Sound" : "2D Sound"; string diststr = is3D ? ("Distance Area ( " + mindist.ToString("0.##") + "m ~ " + maxdist.ToString("0.##") + "m )") : (""); if (listener != null) { LabelField("Distance", listenDist.ToString("#,##0.00") + " m"); } else { LabelField("Distance", "-"); } LabelField(is3Dstr, diststr); audioSrc.minDistance = FloatField("Min Dist", audioSrc.minDistance); audioSrc.maxDistance = FloatField("Max Dist", audioSrc.maxDistance); LabelField("Is Oneshot", isOneshot.ToString()); audioSrc.volume = Slider("Volume", audioSrc.volume, 0f, 1f); audioSrc.pitch = Slider("Pitch", audioSrc.pitch, 0f, 4f); int pcnt = 0; audioSrc.audioInst.getParameterCount(out pcnt); for (int i = 0; i < pcnt; ++i) { ParameterInstance pinst = null; audioSrc.audioInst.getParameterByIndex(i, out pinst); PARAMETER_DESCRIPTION pdesc = new PARAMETER_DESCRIPTION(); pinst.getDescription(out pdesc); float val = 0f, _val = 0f; pinst.getValue(out val); _val = Slider(pdesc.name, val, pdesc.minimum, pdesc.maximum); if (_val != val) { pinst.setValue(_val); } } GUILayout.Space(8); GUILayout.BeginHorizontal(); { GUILayout.Space(17); if (GUILayout.Button("Play", GUILayout.Width(80))) { audioSrc.Play(); } GUILayout.Space(4); if (GUILayout.Button("Stop", GUILayout.Width(80))) { audioSrc.Stop(); } GUILayout.Space(4); if (GUILayout.Button("Unload", GUILayout.Width(80))) { audioSrc.path = ""; } } GUILayout.EndHorizontal(); } } else { GUILayout.BeginHorizontal(); { GUILayout.Space(13); GUILayout.Label("No Event Loaded"); } GUILayout.EndHorizontal(); } } GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUI.EndGroup(); } else { if (audioSrc.is3D) { boundactive = true; bound.transform.localScale = Vector3.one * audioSrc.maxDistance * 2f; } } } }
private void Update() { _altitude.setValue(Mathf.Clamp(transform.position.y, 0f, 6000f)); }
public void OnDespawn() { _emitter.stop(STOP_MODE.IMMEDIATE); _altitudeGround.setValue(100f); _airspeed.setValue(0f); }
public void SetIntensity(float intensity) { CombatIntensity = intensity; intensityParam.setValue(CombatIntensity); }
/// <summary> /// Chang event parameter with a new value (Integer) /// </summary> /// <param name="_eventParameter"></param> /// <param name="_value"></param> public FMOD.RESULT ChangeParameter(ref ParameterInstance _eventParameter, int _value) { return(_eventParameter.setValue(_value)); }