DemoControls.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. //This asset was uploaded by https://unityassetcollection.com
  2. /// ProFlares - v1.08 - Copyright 2014-2015 All rights reserved - ProFlares.com
  3. using UnityEngine;
  4. using System.Collections;
  5. public class DemoControls : MonoBehaviour {
  6. public GameObject Setup1;
  7. public GameObject Setup1Extra;
  8. public Color Setup1Ambient;
  9. public GameObject Setup2;
  10. public GameObject Setup2Extra;
  11. public Color Setup2Ambient;
  12. public GameObject Setup3;
  13. public GameObject Setup3Extra;
  14. public Color Setup3Ambient;
  15. public bool Toggle;
  16. // Use this for initialization
  17. void Start () {
  18. Swap(1);
  19. }
  20. public void Swap(int number){
  21. switch(number){
  22. case(1):{
  23. Setup1.SetActive(true);
  24. Setup2.SetActive(false);
  25. if(Setup3)Setup3.SetActive(false);
  26. if(Setup1Extra) Setup1Extra.SetActive(true);
  27. if(Setup2Extra) Setup2Extra.SetActive(false);
  28. if(Setup3Extra) Setup3Extra.SetActive(false);
  29. RenderSettings.ambientLight = Setup1Ambient;
  30. }break;
  31. case(2):{
  32. Setup1.SetActive(false);
  33. Setup2.SetActive(true);
  34. if(Setup3)Setup3.SetActive(false);
  35. if(Setup1Extra) Setup1Extra.SetActive(false);
  36. if(Setup2Extra) Setup2Extra.SetActive(true);
  37. if(Setup3Extra) Setup3Extra.SetActive(false);
  38. RenderSettings.ambientLight = Setup2Ambient;
  39. }break;
  40. case(3):{
  41. Setup1.SetActive(false);
  42. Setup2.SetActive(false);
  43. if(Setup3)Setup3.SetActive(true);
  44. if(Setup1Extra) Setup1Extra.SetActive(false);
  45. if(Setup2Extra) Setup2Extra.SetActive(false);
  46. if(Setup3Extra) Setup3Extra.SetActive(true);
  47. RenderSettings.ambientLight = Setup3Ambient;
  48. }break;
  49. }
  50. }
  51. public bool hideGUI;
  52. public ProFlareBatch batchLeft;
  53. public ProFlareBatch batchRight;
  54. void Update(){
  55. if(Input.GetKeyUp("1")){
  56. Swap(1);
  57. }
  58. if(Input.GetKeyUp("2")){
  59. Swap(2);
  60. }
  61. if(batchLeft&&batchRight){
  62. if(Input.GetKeyUp(KeyCode.M)){
  63. batchLeft.VR_Depth = batchLeft.VR_Depth+0.05f;
  64. batchLeft.VR_Depth = Mathf.Clamp01(batchLeft.VR_Depth);
  65. batchRight.VR_Depth = batchLeft.VR_Depth;
  66. }
  67. if(Input.GetKeyUp(KeyCode.N)){
  68. batchLeft.VR_Depth = batchLeft.VR_Depth-0.05f;
  69. batchLeft.VR_Depth = Mathf.Clamp01(batchLeft.VR_Depth);
  70. batchRight.VR_Depth = batchLeft.VR_Depth;
  71. }
  72. }
  73. }
  74. void OnGUI(){
  75. if(hideGUI)
  76. return;
  77. }
  78. }