Esempio n. 1
0
        private void Start()
        {
            upg = Player.GetComponent <Upgrades>();

            earningsText.text = upg.Earnings.ToString();
            killsText.text    = upg.AllKills.ToString();
            matchesText.text  = upg.Matches.ToString();
            goldText.text     = upg.GoldMedals.ToString();
            silverText.text   = upg.SilverMedals.ToString();
            bronzeText.text   = upg.BronzeMedals.ToString();

            moneyText.text = PlayerPrefs.GetInt("Money").ToString();

            if (upg.UnlockedLeague == 1)
            {
                interBtn.SetActive(true);
                eliteBtn.SetActive(false);
            }
            else if (upg.UnlockedLeague == 2)
            {
                interBtn.SetActive(true);
                eliteBtn.SetActive(true);
            }
            else
            {
                interBtn.SetActive(false);
                eliteBtn.SetActive(false);
            }
        }
        void Start()
        {
            upg            = Upgrades.Instance;
            MoneyEarned    = 0;
            Dead           = false;
            heatLevel      = 0;
            heatSinkLevel  = 5 + upg.heatLevel;
            audioSource    = gameObject.GetComponent <AudioSource>();
            fuel           = Mathf.Floor(150);
            flySpeed       = 1700f;
            Time.timeScale = 1;
            takeDamage     = gameObject.GetComponent <TakeDamage>();

            VRTK_SlideObjectControlAction[] slidespeeds = gameObject.GetComponents <VRTK_SlideObjectControlAction>();

            for (int i = 0; i < slidespeeds.Length; i++)
            {
                slidespeeds[i].maximumSpeed += (2 * upg.speedLevel);
            }

            takeDamage.LeftArmHealth  = 64 + (9 * upg.armsLevel);
            takeDamage.RightArmHealth = 64 + (9 * upg.armsLevel);
            takeDamage.LeftLegHealth  = 68 + (9 * upg.legsLevel);
            takeDamage.RightLegHealth = 68 + (9 * upg.legsLevel);
            takeDamage.TorsoHealth    = 75 + (10 * upg.torsoLevel);

            if (PlayerPrefs.HasKey("Money"))
            {
                Money = PlayerPrefs.GetInt("Money");
            }
            else
            {
                Money = 0;
            }

            PlayerPrefs.SetInt("Money", Money);

            // UI stuff
            time = 0.05f;
            playerTorsoHealth = takeDamage.TorsoHealth;
            playerRarmHealth  = takeDamage.RightArmHealth;
            playerLarmHealth  = takeDamage.LeftArmHealth;
            playerRlegHealth  = takeDamage.RightLegHealth;
            playerLlegHealth  = takeDamage.LeftLegHealth;
        }
Esempio n. 3
0
        protected virtual void Start()
        {
            upg = Upgrades.Instance;

            crosshair = GameObject.FindGameObjectWithTag("Crosshair");

            playerMechLayer = LayerMask.NameToLayer("PlayerMech");

            leftController = GameObject.FindGameObjectWithTag("LeftController");

            rightController = GameObject.FindGameObjectWithTag("RightController");

            weaponAudioSource = gameObject.GetComponent <AudioSource>();

            laserSight = transform.GetChild(1).gameObject;

            laserSightLine = laserSight.GetComponent <LineRenderer>();

            shooter = transform.root.gameObject;

            laserReady    = new Color(0, 1, 0, 0.6f);
            laserNotReady = new Color(1, 0, 0, 0.6f);

            leftController.GetComponent <VRTK_ControllerEvents>().TriggerPressed += OnLeftTriggerPressed;

            leftController.GetComponent <VRTK_ControllerEvents>().TriggerHairlineStart += OnLeftTriggerHairline;

            leftController.GetComponent <VRTK_ControllerEvents>().TriggerReleased += OnLeftTriggerReleased;

            leftController.GetComponent <VRTK_ControllerEvents>().GripPressed += OnLeftGripPressed;

            leftController.GetComponent <VRTK_ControllerEvents>().GripReleased += OnLeftGripReleased;

            rightController.GetComponent <VRTK_ControllerEvents>().TriggerPressed += OnRightTriggerPressed;

            rightController.GetComponent <VRTK_ControllerEvents>().TriggerHairlineEnd += OnRightTriggerReleased;

            rightController.GetComponent <VRTK_ControllerEvents>().GripPressed += OnRightGripPressed;

            rightController.GetComponent <VRTK_ControllerEvents>().GripReleased += OnRightGripReleased;
        }
Esempio n. 4
0
        void Start()
        {
            ChosenLeague = PlayerPrefs.GetInt("ChosenLeague");
            audioSource  = gameObject.GetComponent <AudioSource>();
            upg          = Player.GetComponent <Upgrades>();

            //  matsOP[0] = windowOP;
            //  matsOP[1] = windowOP;
            //  matsTP[0] = windowTP;
            //  matsTP[1] = windowTP;

            victoryOrDeath = false;
            heatOverload   = false;
            enemiesOnField = GameObject.FindGameObjectsWithTag("Enemy");
            EnemiesLeft    = enemiesOnField.Length;
            victoryText    = VictoryScreen.transform.GetChild(0).GetComponent <Text>();
            killsText      = VictoryScreen.transform.GetChild(1).GetComponent <Text>();
            deathText      = gameOverPanel.transform.GetChild(0).GetComponent <Text>();

            StartCoroutine(MatchStartup());
        }
Esempio n. 5
0
 private void Awake()
 {
     Instance = this;
 }