Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1. if (isActive == true)
  2. {
  3.  
  4. // Debug.Log("Is active");
  5. //transformer.eulerAngles = new Vector3(transformer.eulerAngles.x, transformer.eulerAngles.y, transformer.transform.rotation.z);
  6. //transformer.transform.position = this.transform.position;
  7. //mappedCurPos = Mathf.Lerp(0f, 1f, Mathf.InverseLerp(-0.9f, 0.8f, rotate.transform.rotation.x));
  8. ////Debug.Log(mappedCurPos);
  9. //knobRotate = Mathf.Lerp(30f, 330f, Mathf.InverseLerp(-0.9f, 0.8f, rotate.transform.rotation.x));
  10. //this.transform.localRotation = Quaternion.Euler(0, knobRotate, 0);
  11.  
  12.  
  13. displayValue = Mathf.RoundToInt(mappedCurPos * 100);
  14. textValue.text = displayValue.ToString();
  15. holderTemp.GetComponent<PhotonView>().RPC("UpdateKnobVolume", RpcTarget.All, mappedCurPos, this.gameObject.name);
  16.  
  17.  
  18. }
  19.  
  20.  
  21. if (_triggerDown._Trigger == true && isActive == true)
  22. {
  23.  
  24. //Debug.Log("Trigger not pressed");
  25.  
  26. //transformer.SetParent(GameObject.Find("RightHandAnchor").transform);
  27. //transformer.localPosition = new Vector3(0, 0, 0);
  28. //transformer.localRotation = new Quaternion(0, 0, 0, 0);
  29.  
  30.  
  31. isActive = false;
  32.  
  33.  
  34.  
  35. }
  36.  
  37. }
  38. void OnCollisionStay(Collision col) //change to stay
  39. {
  40.  
  41. if (col.gameObject.tag == "JazzHands" && _soundPlace == TheStaticScript.frontPosition)
  42. {
  43. if (_triggerDown._Trigger == false && displayValue == 0 && isActive == false)
  44. {
  45. Debug.Log("100!");
  46. // transformerTemp.transform.parent = null;
  47. isActive = true;
  48. mappedCurPos = 1;
  49.  
  50.  
  51. }else if (_triggerDown._Trigger == false && displayValue == 100 && isActive == false)
  52. {
  53. isActive = true;
  54. mappedCurPos = 0;
  55. Debug.Log("0!");
  56. }
  57. }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement