Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.Networking;
- using UnityEngine.UI;
- public class PlayerConfig : NetworkBehaviour {
- public Text ExpText;
- [SyncVar]
- public int curExp = 0;
- public override void OnStartLocalPlayer()
- {
- ExpText = GameObject.Find("EXPTEXT").GetComponent<Text>();
- }
- [ClientRpc]
- public void recieveExp(int amount) {
- if (isServer) { return; }
- else
- {
- curExp += amount;
- ExpText.text = curExp.ToString();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment