Ejemplo n.º 1
0
	// ********************************************************************************************* Start

	void Start(){
		Mysql = GetComponent<MySQLCS>();
		BudynekClass = GetComponent<budynekClass>();
		SlotClass = GetComponent<slotClass>();
		GuiButton = GetComponent<guiButton>();
		GuiKomunikaty = komunikaty.GetComponent<guiKomunikaty>();
	}
Ejemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        if (!isLocalPlayer)
        {
            return;
        }

        float   hAxis    = Input.GetAxisRaw("Horizontal");
        float   vAxis    = Input.GetAxisRaw("Vertical");
        Vector3 movement = new Vector3(hAxis, vAxis);

        anim.SetFloat("Magnitude", movement.magnitude);

        //transform.position = transform.position + movement * movementSpeed * Time.deltaTime;
        if (movement.magnitude > 0)
        {
            anim.SetFloat("MoveX", movement.x);
            anim.SetFloat("MoveY", movement.y);
            rigid2D.velocity = movement * movementSpeed;
            ////transform.Translate(movement * movementSpeed * Time.deltaTime);
        }
        else
        {
            rigid2D.velocity = Vector2.zero;
        }

        if (Input.GetButtonDown("Fire1"))
        {
            Debug.Log("Trying to save this shit.");
            MySQLCS.UpdateCharacter(transform.gameObject, PlayerPrefs.GetInt("char_id"));
        }

        //if ( Input.GetAxisRaw("Horizontal") != 0f || Input.GetAxisRaw("Vertical") != 0f )
        //    transform.Translate(new Vector3(Input.GetAxisRaw("Horizontal") * movementSpeed * Time.deltaTime, Input.GetAxisRaw("Vertical") * movementSpeed * Time.deltaTime));
    }
Ejemplo n.º 3
0
 void Start()
 {
     Mysql = GetComponent<MySQLCS>();
 }
Ejemplo n.º 4
0
 public override void OnClientDisconnect(NetworkConnection connection)
 {
     Debug.Log(PlayerPrefs.GetFloat("last_x") + " " + PlayerPrefs.GetFloat("last_y") + " " + PlayerPrefs.GetInt("char_id") + "");
     MySQLCS.UpdateCharacter(connection.playerControllers[0].gameObject, PlayerPrefs.GetInt("char_id"));
 }
Ejemplo n.º 5
0
 private void OnApplicationQuit()
 {
     MySQLCS.UpdateCharacter(transform.gameObject, PlayerPrefs.GetInt("char_id"));
 }