Esempio n. 1
0
    void Start()
    {
        ScriptHeadShot.checkwin = false;

        ScriptHPStam.isdead    = false;
        ScriptHPStam.currentHP = 100;
        showscoregame.SetActive(false);


        Sound = GetComponent <AudioSource>();


        AmmoR = 25;
        AmmoL = 25;

        textammoL.text = AmmoL.ToString();
        textammoR.text = AmmoR.ToString();



        GunmaxLShow.GetComponent <Collider>().enabled = false;
        GunmaxRShow.GetComponent <Collider>().enabled = false;
        ani                = GetComponent <Animator>();
        checkstate         = 0;
        Time.timeScale     = 1;
        laserLineRendererL = laserLineRendererL.GetComponent <LineRenderer>();
        laserLineRendererR = laserLineRendererR.GetComponent <LineRenderer>();
        Vector3[] initLaserPositions = new Vector3[2] {
            Vector3.zero, Vector3.zero
        };
        laserLineRendererL.SetPositions(initLaserPositions);

#pragma warning restore CS0618 // Type or member is obsolete
        laserLineRendererL.enabled = true;
        laserLineRendererR.SetPositions(initLaserPositions);
        laserLineRendererL.SetPositions(initLaserPositions);

#pragma warning restore CS0618 // Type or member is obsolete
        laserLineRendererR.enabled = true;
    }
Esempio n. 2
0
    void Update()
    {
        textammoL.text = AmmoL.ToString();
        textammoR.text = AmmoR.ToString();



        if (checkstate == 3)//(ScriptSpawnState.gos2 == true)
        {
            ani.SetBool("GOS2", true);
        }
        if (checkstate == 12)//(ScriptSpawnState.gos3 == true)
        {
            ani.SetBool("GOS3", true);
        }
        if (checkstate == 19)//(ScriptSpawnState.gos4 == true)
        {
            ani.SetBool("GOS4", true);
        }
        if (checkstate == 34)//(ScriptSpawnState.gos4 == true)
        {
            ani.SetBool("GOBOSS", true);
        }
        if (checkstate == 41 && ScriptHeadShot.checkwin == true)
        {
            ani.SetBool("win", true);
            Invoke("showbtn", 8f);
            ScriptHPStam.timerActive = false;
        }



        ShootLaserFromTargetPositionL(laserLineRendererL.transform.position, laserLineRendererL.transform.forward, laserMaxLength);



        ShootLaserFromTargetPositionR(laserLineRendererR.transform.position, laserLineRendererR.transform.forward, laserMaxLength);

        if (TouchdownR.GetStateDown(handTypeR))
        {
            if (GunmaxR != null)
            {
                GunmaxRShow.gameObject.GetComponent <CheckOnAmmo>().OnGun = false;
                Sound.PlayOneShot(soundReload);
                GunmaxR.GetComponent <GunMax>().HasUse = true;
                GunmaxR.transform.SetParent(null);
                GunmaxR.isKinematic = false;
                GunmaxR.GetComponent <Rigidbody>().AddForce(GunmaxRShow.transform.forward * 200);
                GunmaxRShow.enabled = true;
                AmmoR = 0;


                Destroy(GunmaxR.gameObject, 10);

                GunmaxR = null;


                print("outs");
            }
            print("RRR");
        }
        if (TouchdownL.GetStateDown(handTypeL))
        {
            if (GunmaxL != null)
            {
                Sound.PlayOneShot(soundReload);
                GunmaxL.GetComponent <GunMax>().HasUse = true;
                GunmaxL.transform.SetParent(null);
                GunmaxL.isKinematic = false;
                GunmaxL.GetComponent <Rigidbody>().AddForce(GunmaxLShow.transform.forward * 200);
                GunmaxLShow.enabled = true;
                GunmaxLShow.GetComponent <CheckOnAmmo>().OnGun = false;

                AmmoL = 0;
                Destroy(GunmaxL.gameObject, 10);

                GunmaxL = null;

                print("outs");
            }

            print("LLL");
        }

        if (SlowAction1R.GetState(handTypeR))
        {
            if (ScriptHPStam.currentStam > 0)
            {
                ScriptHPStam.checkslow = true;
                Time.timeScale         = 0.2f;
            }
            else if (ScriptHPStam.currentStam <= 0)
            {
                ScriptHPStam.checkslow = false;
                Time.timeScale         = 1f;
            }


            print("outs");
        }
        if (SlowAction1R.GetStateUp(handTypeR))
        {
            ScriptHPStam.checkslow = false;
            Time.timeScale         = 1f;

            print("outs");
        }
        if (SlowAction1L.GetStateDown(handTypeL))
        {
            if (ScriptHPStam.currentStam > 0)
            {
                ScriptHPStam.checkslow = true;
                Time.timeScale         = 0.2f;
            }
            else if (ScriptHPStam.currentStam <= 0)
            {
                ScriptHPStam.checkslow = false;
                Time.timeScale         = 1f;
            }

            print("outs");
        }
        if (SlowAction1L.GetStateUp(handTypeL))
        {
            ScriptHPStam.checkslow = false;
            Time.timeScale         = 1f;

            print("outs");
        }
    }