Exemplo n.º 1
0
    void OnBuildEnableSelected(bool selected)
    {
        if (null == PlayerNetwork.mainPlayer)
        {
            return;
        }

        if (ServerAdministrator.IsBuildLock(mRoleId) != selected)
        {
            return;
        }

        if (!selected)
        {
            ServerAdministrator.RequestBuildLock(mRoleId);
        }
        else
        {
            ServerAdministrator.RequestBuildUnLock(mRoleId);
        }
    }
Exemplo n.º 2
0
    public void SetPlayerInfo(UserAdmin ud)
    {
        mName.text = ud.RoleName;
        mRoleId    = ud.Id;

        if (ServerAdministrator.IsAdmin(mRoleId))
        {
            mManagerMask.spriteName = "AdministratorMask";
            mIsAssistantText.text   = "Set";
            mBuildEnableText.text   = "Forbidden";

            mIsAssistant.isChecked = false;
            mBuildEnable.isChecked = true;
        }
        else
        {
            if (ServerAdministrator.IsAssistant(mRoleId))
            {
                mManagerMask.spriteName = "AssistantMask";
                mIsAssistantText.text   = "Dismiss";
            }
            else
            {
                mManagerMask.spriteName = "Null";
                mIsAssistantText.text   = "Set";
            }

            if (ServerAdministrator.IsBuildLock(mRoleId))
            {
                mBuildEnableText.text = "Allow";
            }
            else
            {
                mBuildEnableText.text = "Forbidden";
            }

            mIsAssistant.isChecked = ServerAdministrator.IsAssistant(mRoleId);
            mBuildEnable.isChecked = !ServerAdministrator.IsBuildLock(mRoleId);
        }
    }