示例#1
0
    public void ToggleJoinButton()
    {
        // Get our GAme Objrct
        PWGame pwg = (PWGame)Game.Self;

        if (!pwg)
        {
            Debug.LogError("No Game Object!");
            return;
        }

        // Is Player in Active List already
        if (pwg.ActivePlayerList.Contains(this))
        {
            // if true, remove them....
            pwg.ActivePlayerList.Remove(this);
            ButtonText.text = "Join";
        }
        else
        {
            // if flase, adds them
            pwg.ActivePlayerList.Add(this);
            ButtonText.text = "Leave";
        }

        //JoinButton.SetActive(false);
    }
    // Use this for initialization
    void Start()
    {
        PWGame pwg = (PWGame)Game.Self;

        if (!pwg)
        {
            Debug.LogError("No Game Object!");
            return;
        }
        pwg.OnEnterMainMenu();
    }