コード例 #1
0
    // --------- Init stuff ---------
    void Start()
    {
        DontDestroyOnLoad(this);
        MasterServer.dedicatedServer = true;
        MasterServer.ipAddress = "84.113.142.137";

        Application.targetFrameRate = 60;

        guiScript = GetComponent<FPSGUI>();
        messageScript = GetComponent<FPSMessages>();
        artilleryScript = GetComponent<FPSArtillery>();
        gameSettings = GetComponent<GameModeScript>();

        Application.LoadLevel("MenuScene");
    }
コード例 #2
0
ファイル: FPSGUI.cs プロジェクト: madpew/SplatDeathSalad
    void Start()
    {
        theNetwork = GetComponent<SophieNetworkScript>();
        messageScript = GetComponent<FPSMessages>();
        artillery = GetComponent<FPSArtillery>();

        //make local player
        theNetwork.localPlayer = new FPSPlayer();
        theNetwork.localPlayer.local = true;
        theNetwork.localPlayer.name = PlayerPrefs.GetString("PlayerName", "Player Playerson");
        theNetwork.localPlayer.headType = PlayerPrefs.GetInt("PlayerHead", 0);
        theNetwork.localPlayer.colA.r = PlayerPrefs.GetFloat("PlayerColA_R", Color.red.r);
        theNetwork.localPlayer.colA.g = PlayerPrefs.GetFloat("PlayerColA_G", Color.red.g);
        theNetwork.localPlayer.colA.b = PlayerPrefs.GetFloat("PlayerColA_B", Color.red.b);
        theNetwork.localPlayer.colA.a = 1;
        theNetwork.localPlayer.colB.r = PlayerPrefs.GetFloat("PlayerColB_R", Color.green.r);
        theNetwork.localPlayer.colB.g = PlayerPrefs.GetFloat("PlayerColB_G", Color.green.g);
        theNetwork.localPlayer.colB.b = PlayerPrefs.GetFloat("PlayerColB_B", Color.green.b);
        theNetwork.localPlayer.colB.a = 1;
        theNetwork.localPlayer.colC.r = PlayerPrefs.GetFloat("PlayerColC_R", Color.cyan.r);
        theNetwork.localPlayer.colC.g = PlayerPrefs.GetFloat("PlayerColC_G", Color.cyan.g);
        theNetwork.localPlayer.colC.b = PlayerPrefs.GetFloat("PlayerColC_B", Color.cyan.b);
        theNetwork.localPlayer.colC.a = 1;

        //load settings
        invX = PlayerPrefs.GetInt("InvertX", 0) == 1;
        invY = PlayerPrefs.GetInt("InvertY", 0) == 1;
        mouseSensitivity = PlayerPrefs.GetFloat("MouseSensitivity", 2f);
        messageScript.textFadeTime = PlayerPrefs.GetFloat("textFadeTime", 10f);
        theNetwork.gunBobbing = PlayerPrefs.GetInt("GunBobbing",1)==1;
        theNetwork.autoPickup = PlayerPrefs.GetInt("autoPickup",0)==1;
        theNetwork.autoPickupHealth = PlayerPrefs.GetInt("autoPickupHealth",0)==1;
        theNetwork.announcer = PlayerPrefs.GetInt("announcer", 1)==1;
        theNetwork.autoSwitch = PlayerPrefs.GetInt ("autoSwitch",0)==1;
        theNetwork.gameVolume = PlayerPrefs.GetFloat("GameVolume", 1f);
    }