Problem with Mobile Control Add-on

Support for MFPS 2.0
Post Reply
User avatar
hersa
New Member
New Member
Posts: 5
Joined: Fri Jul 31, 2020 9:04 pm

Thu Sep 10, 2020 5:49 pm

I have purchased and used the mobile control addon. I've imported and enabled it, but I can't make it integrated because the "integrate" tool in the MFPS menu is disabled. Actually the addon works fine, but when the game is paused or the score UI is showing the mobile control UI keep appear (not hidden)
User avatar
hersa
New Member
New Member
Posts: 5
Joined: Fri Jul 31, 2020 9:04 pm

Sat Oct 03, 2020 4:37 am

Hello, is there any solution for my problem?
User avatar
tr0picana
New Member
New Member
Posts: 1
Joined: Sun Sep 27, 2020 8:55 pm

Mon Oct 05, 2020 3:29 pm

This is how I fixed it, not sure if it's the best solution.

All code is in bl_UIReferences.cs

1. Add a public GameObject representing the Mobile UI object:

Code: Select all

public GameObject ChatInputField;
public GameObject MobileUI; //New variable
[SerializeField] private Button[] ClassButtons;
[SerializeField] private GameObject[] TDMJoinButton;
    
2. At the top of function SetUpUI():

Code: Select all

if(MobileUI == null)
{
  GameObject mui = GameObject.Find("MobileControls");
    if(mui != null)
    {
      MobileUI = mui;
    }
}
3. At the top of function ShowMenu(bool active):

Code: Select all

if (MobileUI)
{
  MobileUI.SetActive(!active);
}
4. At the bottom of function JoinTeam(int id):

Code: Select all

if (MobileUI && !MobileUI.activeInHierarchy)
{
  MobileUI.SetActive(true);
}
Post Reply