Beispiel #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();
         *  }
         * }
         */
    }
Beispiel #2
0
    // Use this for initialization
    void Start()
    {
        variablesScript = GetComponent <variables>();
        boostScript     = GetComponent <Player_Boost>();

        rb = GetComponent <Rigidbody>();
        //maxSpeed = variablesScript.maxSpeed;
        speed = maxSpeed;

        //Screen.lockCursor = true;
        mousePos     = Input.mousePosition;
        mouseLastPos = Input.mousePosition;

        Screen.lockCursor = true;
        rotationX         = MainShip.transform.rotation.x;
        rotationX         = MainShip.transform.rotation.y;
    }
Beispiel #3
0
    // Use this for initialization
    void Start()
    {
        playerHealthScript = GetComponent <Player_Health>();
        variablesScript    = GetComponent <variables>();
        playerFireScript   = GetComponent <Player_Fire>();
        playerBoostScript  = GetComponent <Player_Boost>();

        healthText  = GameObject.Find("Health Text").GetComponent <Text> ();
        healthBar   = GameObject.Find("Health Bar").GetComponent <Image>();
        fireText    = GameObject.Find("Fire Text").GetComponent <Text>();
        fireBar     = GameObject.Find("Fire Bar").GetComponent <Image>();
        specialText = GameObject.Find("Special Text").GetComponent <Text>();
        specialBar  = GameObject.Find("Special Bar").GetComponent <Image>();
        boostText   = GameObject.Find("Boost Text").GetComponent <Text>();
        boostBar    = GameObject.Find("Boost Bar").GetComponent <Image>();


        healthText.text      = playerHealthScript.health.ToString();
        healthBar.fillAmount = 1;
    }