示例#1
0
        void WelcomeFirstTimePlayer()
        {
            WUMoney.AwardCurrency(100, WULogin.CurrencyNames [1]);

            Stock        = new CMLData();
            AmmoLevels   = new CMLData();
            DamageLevels = new CMLData();
            RangeLevels  = new CMLData();
            Settings     = new CMLData();
            Unlocked     = new CMLData();
            Settings.Seti("bgm", 1);
            Settings.Seti("sfx", 1);
            Stock.Seti(Ammo[0].Weapon.WeaponName, Ammo [0].MaxAmmo);
            SavePlayerData();
        }
        void Die()
        {
            anim.SetTrigger("Die");

            // Set the audiosource to play the death clip and play it (this will stop the hurt sound from playing).
            playerAudio.clip = deathClip;
            playerAudio.Play();

            // Turn off the movement and shooting scripts.
            playerMovement.enabled = false;
            playerShooting.enabled = false;

            //give the player cash to buy upgrades/stock with
            int points = Data.score / 10;

            if (points > 0)
            {
                WUMoney.AwardCurrency(points, "dust");
            }
        }