Ejemplo n.º 1
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();
         *  }
         * }
         */
    }
Ejemplo n.º 2
0
	public override void PreStartClient ()
	{
		healthScript = GetComponent<Player_Health>();
		respawnScript = GetComponent<Player_Respawn>();
		healthScript.EventDie += DisablePlayer;
	}