public void Awake()
	{
		if(!singleton) {
			singleton = this;
		} else {
			Destroy(this.gameObject);
		}
	}
 public void Awake()
 {
     if (!singleton)
     {
         singleton = this;
     }
     else
     {
         Destroy(this.gameObject);
     }
 }
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Debug.Log("Instance already exists, destroying object");
         Destroy(this);
     }
 }
    void Start()
    {
        _instance   = this;
        _controller = new LobbyMenuController(this);
        //Debug.Log("Avatar " + GameManager.GameUser.Avatar);
        avatar.mainTexture = Helper.LoadTextureForAvatar(GameManager.GameUser.Base.Avatar);
        lblNickName.text   = string.Format("{0}", GameManager.GameUser.Base.NickName);
        lblLevel.text      = GameManager.localization.GetText("Global_Level") + GameManager.GameUser.Base.Level;

        if (GameManager.GameUser.Base.Level < UserConfig.LEVEL_MAX)
        {
            lblExp.text = GameManager.localization.GetText("Global_btn_Exp") + string.Format(": {0}/{1}", GameManager.GameUser.Base.Exp, UserConfig.LEVELS_EXP[GameManager.GameUser.Base.Level]);
        }
        else
        {
            lblExp.text = "";
        }

        InitAvatarSet();
        StartCoroutine(InitListPlayerInZoneUI());
    }
Exemple #5
0
 void Awake()
 {
     instance = this;
 }
 public LobbyMenuController(UILobbyManager uiLobbyManager)
     : base()
 {
     _uiLobbyManager = uiLobbyManager;
     islock          = false;
 }
 void OnDestroy()
 {
     _instance = null;
 }
Exemple #8
0
 public override void OnStartClient()
 {
     m_PlayerListingEntry = UILobbyManager.AddToPlayerList(this.GetComponent <NetworkLobbyPlayer>());
 }