public void Init()
    {
        if (GamePanel.rePlay)
        {
            GamePanel.rePlay = false;
            JoinGameRoom(LastJoinRoom);
        }
        else if (!PhotonNetwork.InLobby)
        {
            PhotonNetwork.JoinLobby(SystemManage.SqlLobby);

            StartCoroutine(OnUpdateRoomEvent());

            PlayerManage.UpdateInventory(showLobbyPlayerInfo); //更新金額
            PlayerManage.UpdateProfit(showLobbyPlayerInfo);    //更新個人資料
        }
    }
Exemple #2
0
    private void ShowBagItem()
    {
        //清除舊資料
        foreach (var g in ItemEntries)
        {
            Destroy(g.gameObject);
        }
        ItemEntries.Clear();

        //重新抓取商店資料
        PlayerManage.UpdateInventory(() => {
            foreach (var s in PlayerManage.Inventory)
            {
                GameObject entry = Instantiate(ItemPrefab);
                entry.transform.SetParent(ItemContent.transform);
                ItemEntries.Add(entry);
                entry.transform.localScale = Vector3.one;
                entry.GetComponent <ItemInBagPrefab>().Initialize(s, ShowBagItem);
            }

            BagInfo.text  = $"餘額: {PlayerManage.Wallet}\n";
            BagInfo.text += $"物品總數量: {PlayerManage.Inventory.Count}";
        });
    }
Exemple #3
0
    private Vector3 offset = new Vector3(0, 0, 0); //手柄轴心的偏移量

    void Start()
    {
        ts = GameObject.Find("handle_x").GetComponent <RectTransform>();
        pm = GameObject.Find("player").GetComponent <PlayerManage>();
    }
Exemple #4
0
 // Start is called before the first frame update
 void Start()
 {
     playerManager = GetComponent <PlayerManage>();
     playerRB      = GetComponent <Rigidbody>();
 }
Exemple #5
0
 // Start is called before the first frame update
 void Start()
 {
     playerAnim    = GetComponent <Animator>();
     playerManager = GetComponent <PlayerManage>();
 }
 // Start is called before the first frame update
 void Start()
 {
     playerAudio   = GetComponent <AudioSource>();
     playerManager = GetComponent <PlayerManage>();
 }
Exemple #7
0
 void Awake()
 {
     Instance = this;
 }
 private void Start()
 {
     playerManager = GetComponent <PlayerManage>();
 }
Exemple #9
0
 // Start is called before the first frame update
 void Start()
 {
     player = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerManage>();
 }
Exemple #10
0
 // Start is called before the first frame update
 void Start()
 {
     player = FindObjectOfType <PlayerManage>();
 }
 // Start is called before the first frame update
 void Start()
 {
     this.gameObject.layer = 8;
     playerManager         = GetComponent <PlayerManage>();
     UpdateHPText();
 }