TheZombrex

Cambio De Arma

Apr 7th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var manos : GameObject;
  2. var arma: GameObject;
  3. var escopeta: GameObject;
  4. var lanzapepos: GameObject;
  5. var arma2 : GameObject;
  6. var mira1 : GameObject;
  7. var mira2 : GameObject;
  8. var mira3 : GameObject;
  9. var mira4: GameObject;
  10. var miralp: GameObject;
  11. var anim: Animation;
  12. var anim2: Animation;
  13. var anim3: Animation;
  14. var anim4: Animation;
  15. var Disparador: GameObject;
  16. var Disparador2: GameObject;
  17. var DisparadorPepos: GameObject;
  18. var swich: int = 1;
  19. var swiches: int = 1;
  20. var canshootpistola: GameObject;
  21. var canshootescopeta: GameObject;
  22. var canshootlanzapepos: GameObject;
  23.  
  24.  
  25.  private var blur : TiltShiftHdr;
  26.  blur = GameObject.Find("MainCamera").GetComponent(TiltShiftHdr);
  27.  var cameras: Camera;
  28. function Start() {
  29.  
  30.     manos.SetActive(true);
  31.     arma.SetActive(false);
  32.     escopeta.SetActive(false);
  33.     lanzapepos.SetActive(false);
  34.     //mira1.SetActive (true);
  35.     //mira2.SetActive (false);
  36.     //mira3.SetActive (false);
  37.     //mira4.SetActive (false);
  38.     // Disparador.SetActive(false);
  39.     // Disparador2.SetActive(false);
  40.     // DisparadorPepos.SetActive(false);
  41.     cameras.GetComponent.<Camera>().fieldOfView = 60;
  42.     blur.enabled = false;
  43.     swich = 1;
  44.     swiches = 2;
  45.     canshootpistola.GetComponent(disparoyrecarga).enabled = false;
  46.     canshootescopeta.GetComponent(escopeta).enabled = false;
  47.     canshootlanzapepos.GetComponent(lanzapepos).enabled = false;
  48. }
  49.  
  50. function Update() {
  51.  
  52.     if (Input.GetKeyDown("1")) {
  53.         //if(swich ==1){
  54.         manos.SetActive(true);
  55.         arma.SetActive(false);
  56.         arma2.SetActive(false);
  57.         escopeta.SetActive(false);
  58.         lanzapepos.SetActive(false);
  59.         mira1.SetActive(true);
  60.         mira2.SetActive(false);
  61.         mira3.SetActive(false);
  62.         mira4.SetActive(false);
  63.         miralp.SetActive(false);
  64.         anim2.Play("aparecermanos");
  65.         canshootpistola.GetComponent(disparoyrecarga).enabled = false;
  66.         canshootescopeta.GetComponent(escopeta).enabled = false;
  67.         canshootlanzapepos.GetComponent(lanzapepos).enabled = false;
  68.       //  Disparador.SetActive(false);
  69.        // Disparador2.SetActive(false);
  70.        // DisparadorPepos.SetActive(false);
  71.         cameras.GetComponent.<Camera>().fieldOfView = 60;
  72.         blur.enabled = false;
  73.         // swich = 2;
  74.         //  }
  75.     }
  76.     if (Input.GetKeyDown("1")) {
  77.         //  if(swich ==1){
  78.         manos.SetActive(true);
  79.         arma.SetActive(false);
  80.         arma2.SetActive(false);
  81.         escopeta.SetActive(false);
  82.         lanzapepos.SetActive(false);
  83.         mira1.SetActive(true);
  84.         mira2.SetActive(false);
  85.         mira3.SetActive(false);
  86.         mira4.SetActive(false);
  87.         miralp.SetActive(false);
  88.         anim2.Play("aparecermanos");
  89.         canshootpistola.GetComponent(disparoyrecarga).enabled = false;
  90.         canshootescopeta.GetComponent(escopeta).enabled = false;
  91.         canshootlanzapepos.GetComponent(lanzapepos).enabled = false;
  92.        // Disparador.SetActive(false);
  93.       //  Disparador2.SetActive(false);
  94.       //  DisparadorPepos.SetActive(false);
  95.         cameras.GetComponent.<Camera>().fieldOfView = 60;
  96.         blur.enabled = false;
  97.         // swich = 2;
  98.         // }
  99.     }
  100.     if (Input.GetKeyDown("2")) {
  101.         // if(swich ==2){
  102.         manos.SetActive(false);
  103.         arma.SetActive(true);
  104.         escopeta.SetActive(false);
  105.         lanzapepos.SetActive(false);
  106.         mira1.SetActive(false);
  107.         mira2.SetActive(true);
  108.         mira3.SetActive(false);
  109.         mira4.SetActive(false);
  110.         miralp.SetActive(false);
  111.         anim.Play("Aparecearma");
  112.         canshootpistola.GetComponent(disparoyrecarga).enabled = true;
  113.         canshootescopeta.GetComponent(escopeta).enabled = false;
  114.         canshootlanzapepos.GetComponent(lanzapepos).enabled = false;
  115.        // Disparador.SetActive(true);
  116.        // Disparador2.SetActive(false);
  117.        // DisparadorPepos.SetActive(false);
  118.         cameras.GetComponent.<Camera>().fieldOfView = 60;
  119.         blur.enabled = false;
  120.         // swich = 1;
  121.         //  }
  122.     }
  123.     if (Input.GetKeyDown("2")) {
  124.         // if(swich ==1){
  125.         manos.SetActive(false);
  126.         arma.SetActive(true);
  127.         escopeta.SetActive(false);
  128.         lanzapepos.SetActive(false);
  129.         mira1.SetActive(false);
  130.         mira2.SetActive(true);
  131.         mira3.SetActive(false);
  132.         mira4.SetActive(false);
  133.         miralp.SetActive(false);
  134.         anim.Play("Aparecearma");
  135.         canshootpistola.GetComponent(disparoyrecarga).enabled = true;
  136.         canshootescopeta.GetComponent(escopeta).enabled = false;
  137.         canshootlanzapepos.GetComponent(lanzapepos).enabled = false;
  138.        // Disparador.SetActive(true);
  139.        // Disparador2.SetActive(false);
  140.        // DisparadorPepos.SetActive(false);
  141.         cameras.GetComponent.<Camera>().fieldOfView = 60;
  142.         blur.enabled = false;
  143.         swich = 1;
  144.         // }
  145.     }
  146.  
  147.     if (Input.GetKeyDown("3")) {
  148.         // if (swiches == 1) {
  149.         manos.SetActive(false);
  150.         arma.SetActive(false);
  151.         arma2.SetActive(false);
  152.         escopeta.SetActive(true);
  153.         lanzapepos.SetActive(false);
  154.         mira1.SetActive(false);
  155.         mira2.SetActive(true);
  156.         mira3.SetActive(false);
  157.         mira4.SetActive(false);
  158.         miralp.SetActive(false);
  159.         anim3.Play("aparecescopeta");
  160.         canshootpistola.GetComponent(disparoyrecarga).enabled = false;
  161.         canshootescopeta.GetComponent(escopeta).enabled = true;
  162.         canshootlanzapepos.GetComponent(lanzapepos).enabled = false;
  163.        // Disparador.SetActive(false);
  164.        // Disparador2.SetActive(true);
  165.        // DisparadorPepos.SetActive(false);
  166.         cameras.GetComponent.<Camera>().fieldOfView = 60;
  167.         blur.enabled = false;
  168.         // swich = 3;
  169.         //}
  170.     }
  171.     if (Input.GetKeyDown("3")) {
  172.         //if (swiches == 2) {
  173.         manos.SetActive(false);
  174.         arma.SetActive(false);
  175.         arma2.SetActive(false);
  176.         escopeta.SetActive(true);
  177.         lanzapepos.SetActive(false);
  178.         mira1.SetActive(false);
  179.         mira2.SetActive(true);
  180.         mira3.SetActive(false);
  181.         mira4.SetActive(false);
  182.         miralp.SetActive(false);
  183.         anim3.Play("aparecescopeta");
  184.         canshootpistola.GetComponent(disparoyrecarga).enabled = false;
  185.         canshootescopeta.GetComponent(escopeta).enabled = true;
  186.         canshootlanzapepos.GetComponent(lanzapepos).enabled = false;
  187.         //Disparador.SetActive(false);
  188.       //  Disparador2.SetActive(true);
  189.        // DisparadorPepos.SetActive(false);
  190.         cameras.GetComponent.<Camera>().fieldOfView = 60;
  191.         blur.enabled = false;
  192.         //swich = 3;
  193.    // }
  194.  
  195. }
  196.             else
  197.                 if (Input.GetKeyDown("3")) {
  198.                     //if (swiches == 3) {
  199.                         manos.SetActive(false);
  200.                         arma.SetActive(false);
  201.                         arma2.SetActive(false);
  202.                         escopeta.SetActive(true);
  203.                         lanzapepos.SetActive(false);
  204.                         mira1.SetActive(false);
  205.                         mira2.SetActive(true);
  206.                         mira3.SetActive(false);
  207.                         mira4.SetActive(false);
  208.                         miralp.SetActive(false);
  209.                         anim3.Play("aparecescopeta");
  210.                         canshootpistola.GetComponent(disparoyrecarga).enabled = false;
  211.                         canshootescopeta.GetComponent(escopeta).enabled = true;
  212.                         canshootlanzapepos.GetComponent(lanzapepos).enabled = false;
  213.                       //  Disparador.SetActive(false);
  214.                        // Disparador2.SetActive(true);
  215.                        // DisparadorPepos.SetActive(false);
  216.                         cameras.GetComponent.<Camera>().fieldOfView = 60;
  217.                         blur.enabled = false;
  218.                        // swich = 3;
  219.                     //}
  220.                 }
  221.     if (Input.GetKeyDown("4")) {
  222.         //if(swich ==1){
  223.         manos.SetActive(false);
  224.         arma.SetActive(false);
  225.         arma2.SetActive(false);
  226.         escopeta.SetActive(false);
  227.         lanzapepos.SetActive(true);
  228.         mira1.SetActive(false);
  229.         mira2.SetActive(false);
  230.         mira3.SetActive(false);
  231.         mira4.SetActive(false);
  232.         miralp.SetActive(true);
  233.         anim4.Play("aparecelanzapepos");
  234.         canshootpistola.GetComponent(disparoyrecarga).enabled = false;
  235.         canshootescopeta.GetComponent(escopeta).enabled = false;
  236.         canshootlanzapepos.GetComponent(lanzapepos).enabled = true;
  237.        // Disparador.SetActive(false);
  238.         //Disparador2.SetActive(false);
  239.         //DisparadorPepos.SetActive(true);
  240.         cameras.GetComponent.<Camera>().fieldOfView = 60;
  241.         blur.enabled = false;
  242.         // swich = 2;
  243.         //  }
  244.     }
  245.  
  246.  
  247.             if (Input.GetAxis("Mouse ScrollWheel") > 0f ){
  248.  
  249.                 if (swich == 1) {
  250.                     manos.SetActive(false);
  251.                     arma.SetActive(true);
  252.                     escopeta.SetActive(false);
  253.                     lanzapepos.SetActive(false);
  254.                     mira1.SetActive(false);
  255.                     mira2.SetActive(true);
  256.                     mira3.SetActive(false);
  257.                     mira4.SetActive(false);
  258.                     miralp.SetActive(false);
  259.                     anim.Play("Aparecearma");
  260.                     canshootpistola.GetComponent(disparoyrecarga).enabled = true;
  261.                     canshootescopeta.GetComponent(escopeta).enabled = false;
  262.                     canshootlanzapepos.GetComponent(lanzapepos).enabled = false;
  263.                    /// Disparador.SetActive(true);
  264.                    /// Disparador2.SetActive(false);
  265.                     ///DisparadorPepos.SetActive(false);
  266.                     cameras.GetComponent.<Camera>().fieldOfView = 60;
  267.                     blur.enabled = false;
  268.                     swich = 2;
  269.                 }
  270.                 else
  271.                 if (swich == 2) {
  272.                     manos.SetActive(false);
  273.                     arma.SetActive(false);
  274.                     escopeta.SetActive(true);
  275.                     lanzapepos.SetActive(false);
  276.                     mira1.SetActive(false);
  277.                     mira2.SetActive(true);
  278.                     mira3.SetActive(false);
  279.                     mira4.SetActive(false);
  280.                     miralp.SetActive(false);
  281.                     anim3.Play("aparecescopeta");
  282.                     canshootpistola.GetComponent(disparoyrecarga).enabled = false;
  283.                     canshootescopeta.GetComponent(escopeta).enabled = true;
  284.                     canshootlanzapepos.GetComponent(lanzapepos).enabled = false;
  285.                    // Disparador.SetActive(false);
  286.                    // Disparador2.SetActive(true);
  287.                    // DisparadorPepos.SetActive(false);
  288.                     cameras.GetComponent.<Camera>().fieldOfView = 60;
  289.                     blur.enabled = false;
  290.                     swich = 3;
  291.                 }
  292.                     else if (swich == 3) {
  293.                     manos.SetActive(false);
  294.                     arma.SetActive(false);
  295.                     escopeta.SetActive(false);
  296.                     lanzapepos.SetActive(true);
  297.                     mira1.SetActive(false);
  298.                     mira2.SetActive(false);
  299.                     mira3.SetActive(false);
  300.                     mira4.SetActive(false);
  301.                     miralp.SetActive(true);
  302.                     anim4.Play("aparecelanzapepos");
  303.                     canshootpistola.GetComponent(disparoyrecarga).enabled = false;
  304.                     canshootescopeta.GetComponent(escopeta).enabled = false;
  305.                     canshootlanzapepos.GetComponent(lanzapepos).enabled = true;
  306.                     Disparador.SetActive(false);
  307.                     Disparador2.SetActive(false);
  308.                     DisparadorPepos.SetActive(true);
  309.                     cameras.GetComponent.<Camera>().fieldOfView = 60;
  310.                     blur.enabled = false;
  311.                     swich = 4;
  312.                 }
  313.         else
  314.                     if (swich == 4) {
  315.                         manos.SetActive(true);
  316.                         arma.SetActive(false);
  317.                         arma2.SetActive(false);
  318.                         escopeta.SetActive(false);
  319.                         lanzapepos.SetActive(false);
  320.                         mira1.SetActive(false);
  321.                         mira2.SetActive(true);
  322.                         mira3.SetActive(false);
  323.                         mira4.SetActive(false);
  324.                         miralp.SetActive(false);
  325.                         anim2.Play("aparecermanos");
  326.                         canshootpistola.GetComponent(disparoyrecarga).enabled = false;
  327.                         canshootescopeta.GetComponent(escopeta).enabled = false;
  328.                         canshootlanzapepos.GetComponent(lanzapepos).enabled = false;
  329.                         Disparador.SetActive(false);
  330.                         Disparador2.SetActive(false);
  331.                         DisparadorPepos.SetActive(false);
  332.                         cameras.GetComponent.<Camera>().fieldOfView = 60;
  333.                         blur.enabled = false;
  334.                         swich = 1;
  335.                     }
  336.             }
  337.            
  338.            if (Input.GetAxis("Mouse ScrollWheel") < 0f ){
  339.         if(swich >=2){
  340.                 manos.SetActive (false);
  341.                 arma.SetActive (true);
  342.                 mira1.SetActive (false);
  343.                 mira2.SetActive (true);
  344.                 mira3.SetActive (false);
  345.                 mira4.SetActive (false);
  346.                 anim.Play("Aparecearma");
  347.                 Disparador.SetActive (true);
  348.                 cameras.GetComponent.<Camera>().fieldOfView = 60;
  349.                 blur.enabled = false;
  350.                 swich = 0;
  351.                 }
  352.                
  353.                
  354.        else
  355.         if(swich <=1){
  356.                   manos.SetActive (true);
  357.                 arma.SetActive (false);
  358.                 arma2.SetActive (false);
  359.                 mira1.SetActive (true);
  360.                 mira2.SetActive (false);
  361.                 mira3.SetActive (false);
  362.                 mira4.SetActive (false);
  363.                 anim2.Play("aparecermanos");
  364.                 Disparador.SetActive (false);
  365.                 cameras.GetComponent.<Camera>().fieldOfView = 60;
  366.                 blur.enabled = false;
  367.                 swich = 2;
  368.                 }
  369.                 }
  370. }
Advertisement
Add Comment
Please, Sign In to add comment