protected void Move(MoveSpeedLevel speedLevel = MoveSpeedLevel.Normal)
    {
        if (speedLevel == MoveSpeedLevel.Slow)
        {
            if (!this.isSlow)
            {
                this.isSlow = true;

                this.soundManager.Stop();
                this.soundManager.clip   = this.engineOffSound;
                this.soundManager.volume = 0.5f;
                this.soundManager.Play();
            }

            this.speed = new Vector3(speed.x, 0f, this.deaccelerated);
        }
        else if (speedLevel == MoveSpeedLevel.Normal)
        {
            if (this.isSlow)
            {
                this.isSlow = false;

                this.soundManager.Stop();
                this.soundManager.clip   = this.engineOnSound;
                this.soundManager.volume = 0.3f;
                this.soundManager.Play();
            }

            this.speed = new Vector3(speed.x, 0f, this.forwardSpeed);
        }
        else if (speedLevel == MoveSpeedLevel.Fast)
        {
            //if (!this.isSlow)
            //{
            //    this.isSlow = true;

            //    this.soundManager.Stop();
            //    this.soundManager.clip = this.engineOffSound;
            //    this.soundManager.volume = 0.5f;
            //    this.soundManager.Play();
            //}

            this.speed = new Vector3(speed.x, 0f, this.accelerated);
        }
    }
Exemple #2
0
    // Update is called once per frame
    void Update()
    {
        CurrentGeneralSkillPoint.text   = Skillpoint.ToString();
        CurrentCharacterSkillPoint.text = Skillpoint.ToString();

        // -----------------------------MaxHp----------------------------- //
        MaxHpLevelDisplay.text = MaxHpLevel.ToString() + "/30";
        MaxHpStatsDisplay.text = "+" + CurrentMaxHpStats.ToString();

        // -----------------------------Ammunition Size----------------------------- //
        MaxAmmoSizeLevelDisplay.text = MaxAmmoSizeLevel.ToString() + "/10";
        MaxAmmoSizeStatsDisplay.text = "+" + CurrentMaxAmmoSizeStats.ToString();

        // ----------------------------------MaxEnergy-------------------------------------- //
        MaxEnergyLevelDisplay.text = MaxEnergyLevel.ToString() + "/20";
        MaxEnergyStatsDisplay.text = "+" + MaxEnergyStats.ToString();

        // ----------------------------------ReloadSpeed-------------------------------------- // 这里需要确定 怎么表达 属性
        ReloadSpeedLevelDisplay.text = ReloadSpeedLevel.ToString() + "/10";
        ReloadSpeedStatsDisplay.text = "-" + CurrentReloadSpeedStats.ToString() + "s";

        // ----------------------------------MoveSpeed-------------------------------------- //  这里需要确定 怎么表达 属性
        MoveSpeedLevelDisplay.text = MoveSpeedLevel.ToString() + "/10";
        MoveSpeedStatsDisplay.text = "+" + CurrentMoveSpeedStats.ToString();

        // ----------------------------------Skill CDR-------------------------------------- // 这里需要确定 怎么表达 属性
        SkillCDRLevelDisplay.text = SkillCDRLevel.ToString() + "/10";
        SkillCDRStatsDisplay.text = "-" + CurrentSkillCDRStats.ToString() + "s";

        // ----------------------------------Fire rate-------------------------------------- //  这里需要确定 怎么表达 属性
        FireRateLevelDisplay.text = FireRateLevel.ToString() + "/10";
        FireRateStatsDisplay.text = "+" + CurrentFireRateStats.ToString();

        // ----------------------------------Grenade Damage Area-------------------------------------- //  这里需要确定 怎么表达 属性
        GrenadeDamageAreaLevelDisplay.text = GrenadeDamageAreaLevel.ToString() + "/10";
        GrenadeDamageAreaStatsDisplay.text = "+" + CurrentGrenadeDamageAreaStats.ToString();

        // ----------------------------------Gun Damage Increase-------------------------------------- // 这里需要确定 怎么表达 属性
        GunDamageLevelDisplay.text = GunDamageLevel.ToString() + "/10";
        GunDamageStatsDisplay.text = "+" + CurrentGunDamageStats.ToString();

        // ----------------------------------Grenade Damage Increase-------------------------------------- // 这里需要确定 怎么表达 属性
        GrenadeDamageLevelDisplay.text = GrenadeDamageLevel.ToString() + "/10";
        GrenadeDamageStatsDisplay.text = "+" + CurrentGrenadeDamageStats.ToString();



        /*
         *     LevelText.text = Level.ToString();
         *
         *    MaxHp.text = MaxHealth.ToString();
         *    CurrentHp.text = CurrentHealth.ToString();
         *
         *    MaxExpText.text = MaxExp.ToString();
         *    CurrentExpText.text = CurrentExp.ToString();
         *
         *    if (CurrentHealth != 0)
         *     {
         *         if (Input.GetKeyDown(KeyCode.A))
         *         {
         *             TakeDamage(10);
         *         }
         *     }
         *     if (Input.GetKeyDown(KeyCode.B))
         *     {
         *         addmaxhp(10);
         *     }
         *     if (Input.GetKeyDown(KeyCode.C))
         *         Addexp(10);
         *
         */
    }