- Home /
Question by
surfuay · Sep 11, 2019 at 05:41 PM ·
toggletoggle buttongroup
toggle group bug
My toggle group is "working" The default is 0 with options up to 5 whenever i open the window with the toggle group it swtiches to "1" When I close it, regardless of the toggle I choose, it switches to "5"
My open button is not linked to a number and my close button is not linked to a number
Character Toggle Control Sccript
public class ToggleCharacter : MonoBehaviour
{
public void ChosenNinja(int newNinja)
{
CharacterSelectionManager.character.activeNinja = newNinja;
}
}
The control for opening and closing windows that hold the toggle buttons themselves
public class ShopWindowButton : MonoBehaviour {
public GameObject Upgrades; //the windows containing buttons n toggles
public GameObject IAP;
public GameObject Characters;
public GameObject Supers;
public GameObject UpgradesButton; // the buttons that open or close those windows
public GameObject IAPButton;
public GameObject CharactersButton;
public GameObject SupersButton;
public GameObject HomeButton;
public void ClosePanel()
{
Upgrades.SetActive(false);
IAP.SetActive(false);
Characters.SetActive(false);
Supers.SetActive(false);
UpgradesButton.SetActive(true);
IAPButton.SetActive(true);
CharactersButton.SetActive(true);
SupersButton.SetActive(true);
HomeButton.SetActive(true);
}
public void OpenCharacter()
{
Upgrades.SetActive(false);
IAP.SetActive(false);
Characters.SetActive(true);
Supers.SetActive(false);
UpgradesButton.SetActive(false);
IAPButton.SetActive(false);
CharactersButton.SetActive(false);
SupersButton.SetActive(false);
HomeButton.SetActive(false);
}
there are 3 other methods that open the other 3 windows which I've removed those for simple readability
lastly a photo of the editor and how the toggle script is applied to each of the character selections
screen-shot-2019-09-11-at-20504-pm.png
(36.5 kB)
Comment
please add more info. perhaps some code samples...