void Start()
 {
     _playerDeath = gameObject.GetComponent <Player_Death>();
     playerLight  = playerFlashlight.GetComponent <Light>();
     _audioSource = gameObject.GetComponent <AudioSource>();
     _batteryLife = 50;
 }
Exemple #2
0
    void Start()
    {
        _player_currentHealth   = _player_maxHealth;
        _PlayerHealthGeneration = gameObject.GetComponent <Player_HealthRegeneration>();
        _player_Death           = GameObject.FindObjectOfType <Player_Death>();

        StartCoroutine("HealthCheck");
    }
Exemple #3
0
    // Use this for initialization
    void Start()
    {
        //if (isLocalPlayer) {

        variablesScript       = GetComponent <variables>();
        playerBoostScript     = GetComponent <Player_Boost>();
        playerDeathScript     = GetComponent <Player_Death>();
        playerRespawnScript   = GetComponent <Player_Respawn>();
        playerFireScript      = GetComponent <Player_Fire>();
        playerHealthScript    = GetComponent <Player_Health>();
        playerIDScript        = GetComponent <Player_ID>();
        shipControlScript     = GetComponent <ShipControl>();
        playerEngineScript    = GetComponent <Player_Engine>();
        playerSpotlightScript = GetComponent <Player_Spotlight>();
        playerNetworkSetup    = GetComponent <Player_NetworkSetup>();

        if (isLocalPlayer)
        {
            playerType = PlayerPrefs.GetString("ShipType");
            //print("Setting player type to: " + playerType);
            if (playerType != "Large" && playerType != "Medium" && playerType != "Small")
            {
                playerType = "Medium";
            }
            if (playerType == "Small")
            {
                Cmd_EnableSmallShip();
            }
            else if (playerType == "Medium")
            {
                Cmd_EnableMediumShip();
            }
            else if (playerType == "Large")
            {
                Cmd_EnableLargeShip();
            }
            CmdTellServerMyShip(playerType);
        }

        /*
         * if (!isLocalPlayer) {
         *  if (playerTypeGlobal == "Small") {
         *      Cmd_EnableSmallShip();
         *  }
         *  else if (playerTypeGlobal == "Medium") {
         *      Cmd_EnableMediumShip();
         *  }
         *  else if (playerTypeGlobal == "Large") {
         *      Cmd_EnableLargeShip();
         *  }
         * }
         */
    }
 void Start()
 {
     hungerScript = this.GetComponent<Player_Hunger> ();
     deathScript = this.GetComponent<Player_Death> ();
     if (!isLocalPlayer)
         return;
     StartCoroutine ("StartHealthRegen");
 }