//spawns a button for the user to enter their name
    private void CreateEnterButton(Vector3 position, string buttonName)
    {
        GameObject newButtonObject = Instantiate(nameButtonPrefab, position, Quaternion.identity);
        NameButton newButton       = newButtonObject.GetComponent <NameButton>();

        newButton.Init(buttonName);
    }
Example #2
0
        void ReleaseDesignerOutlets()
        {
            if (BackgroundView != null)
            {
                BackgroundView.Dispose();
                BackgroundView = null;
            }

            if (BenefitButton != null)
            {
                BenefitButton.Dispose();
                BenefitButton = null;
            }

            if (CancelButton != null)
            {
                CancelButton.Dispose();
                CancelButton = null;
            }

            if (NameButton != null)
            {
                NameButton.Dispose();
                NameButton = null;
            }

            if (NormalButton != null)
            {
                NormalButton.Dispose();
                NormalButton = null;
            }

            if (OKButton != null)
            {
                OKButton.Dispose();
                OKButton = null;
            }

            if (PrerequisitesButton != null)
            {
                PrerequisitesButton.Dispose();
                PrerequisitesButton = null;
            }

            if (SpecialButton != null)
            {
                SpecialButton.Dispose();
                SpecialButton = null;
            }

            if (TypesButton != null)
            {
                TypesButton.Dispose();
                TypesButton = null;
            }
        }
Example #3
0
    // Use this for initialization
    void Start()
    {
        playerName = PlayerPrefs.GetString("PlayerName");
        if (playerName == "")
        {
            playerName = "PlayerName";
        }
        mute = PlayerPrefs.GetInt("Mute") == 1 ? true : false;
        tilt = PlayerPrefs.GetInt("Tilt") == 1 ? true : false;
        if (tilt)
        {
            TiltButton.GetComponent <SpriteRenderer> ().sprite = tiltOn;
        }
        else
        {
            TiltButton.GetComponent <SpriteRenderer> ().sprite = tiltOff;
        }
        if (mute)
        {
            OnOffButton.GetComponent <SpriteRenderer> ().sprite = on;
            AudioListener.pause = true;
        }
        else
        {
            OnOffButton.GetComponent <SpriteRenderer> ().sprite = off;
            AudioListener.pause = false;
        }

        if (Application.platform == RuntimePlatform.WindowsEditor || Application.platform == RuntimePlatform.WindowsPlayer || Application.platform == RuntimePlatform.WindowsWebPlayer)
        {
            TiltButton.GetComponent <SpriteRenderer>().color = new Color(1, 1, 1, 0.3f);
            tiltButtonEnabled = false;
        }

        hostOn.SetActive(false);
        joinOn.SetActive(false);
        NameButton.SetActive(false);
        TiltButton.SetActive(false);
        BackButton.SetActive(false);
        MuteButton.SetActive(false);
        OnOffButton.SetActive(false);

        textScale = (nameInputFieldStyle.fontSize * (Screen.width * 0.001f));
        nameInputFieldStyle.fontSize = (int)textScale;

        serverNameLabel = nameInputFieldStyle;

        InvokeRepeating("GetHostList", 0.0f, 2.0f);
    }
Example #4
0
 public void MenuReset()
 {
     hostOn.SetActive(false);
     joinOn.SetActive(false);
     NameButton.SetActive(false);
     TiltButton.SetActive(false);
     SetBackButtonEnable(false);
     optionsClicked    = false;
     startClicked      = false;
     nameClicked       = false;
     hostClicked       = false;
     serverListIsShown = false;
     MuteButton.SetActive(false);
     OnOffButton.SetActive(false);
     gameObject.GetComponent <SplashScreen> ().Hide();
     gameObject.GetComponent <SplashScreen> ().SetText("No Text");
     if (lobbyActive)
     {
         lobbyActive = false;
     }
     StartButton.SetActive(true);
     OptionButton.SetActive(true);
     ExitButton.SetActive(true);
 }
Example #5
0
        void ReleaseDesignerOutlets()
        {
            if (AreaButton != null)
            {
                AreaButton.Dispose();
                AreaButton = null;
            }

            if (BackgroundView != null)
            {
                BackgroundView.Dispose();
                BackgroundView = null;
            }

            if (CastingTimeButton != null)
            {
                CastingTimeButton.Dispose();
                CastingTimeButton = null;
            }

            if (DescriptionButton != null)
            {
                DescriptionButton.Dispose();
                DescriptionButton = null;
            }

            if (DescriptorButton != null)
            {
                DescriptorButton.Dispose();
                DescriptorButton = null;
            }

            if (DismissableButton != null)
            {
                DismissableButton.Dispose();
                DismissableButton = null;
            }

            if (DivineFocusButton != null)
            {
                DivineFocusButton.Dispose();
                DivineFocusButton = null;
            }

            if (DurationButton != null)
            {
                DurationButton.Dispose();
                DurationButton = null;
            }

            if (FocusButton != null)
            {
                FocusButton.Dispose();
                FocusButton = null;
            }

            if (FocusTextButton != null)
            {
                FocusTextButton.Dispose();
                FocusTextButton = null;
            }

            if (LevelsButton != null)
            {
                LevelsButton.Dispose();
                LevelsButton = null;
            }

            if (MaterialButton != null)
            {
                MaterialButton.Dispose();
                MaterialButton = null;
            }

            if (MaterialTextButton != null)
            {
                MaterialTextButton.Dispose();
                MaterialTextButton = null;
            }

            if (NameButton != null)
            {
                NameButton.Dispose();
                NameButton = null;
            }

            if (RangeButton != null)
            {
                RangeButton.Dispose();
                RangeButton = null;
            }

            if (SavingThrowButton != null)
            {
                SavingThrowButton.Dispose();
                SavingThrowButton = null;
            }

            if (SchoolButton != null)
            {
                SchoolButton.Dispose();
                SchoolButton = null;
            }

            if (SomaticButton != null)
            {
                SomaticButton.Dispose();
                SomaticButton = null;
            }

            if (SpellResistanceButton != null)
            {
                SpellResistanceButton.Dispose();
                SpellResistanceButton = null;
            }

            if (SubschoolButton != null)
            {
                SubschoolButton.Dispose();
                SubschoolButton = null;
            }

            if (TargetsButton != null)
            {
                TargetsButton.Dispose();
                TargetsButton = null;
            }

            if (VerbalButton != null)
            {
                VerbalButton.Dispose();
                VerbalButton = null;
            }
        }
Example #6
0
        void ReleaseDesignerOutlets()
        {
            if (AbilityArea != null)
            {
                AbilityArea.Dispose();
                AbilityArea = null;
            }

            if (AlignmentButton != null)
            {
                AlignmentButton.Dispose();
                AlignmentButton = null;
            }

            if (CharismaButton != null)
            {
                CharismaButton.Dispose();
                CharismaButton = null;
            }

            if (ClassButton != null)
            {
                ClassButton.Dispose();
                ClassButton = null;
            }

            if (ConstitutionButton != null)
            {
                ConstitutionButton.Dispose();
                ConstitutionButton = null;
            }

            if (CRButton != null)
            {
                CRButton.Dispose();
                CRButton = null;
            }

            if (CreatureSubtypeButton != null)
            {
                CreatureSubtypeButton.Dispose();
                CreatureSubtypeButton = null;
            }

            if (CreatureTypeButton != null)
            {
                CreatureTypeButton.Dispose();
                CreatureTypeButton = null;
            }

            if (DexterityButton != null)
            {
                DexterityButton.Dispose();
                DexterityButton = null;
            }

            if (HeaderArea != null)
            {
                HeaderArea.Dispose();
                HeaderArea = null;
            }

            if (InitButton != null)
            {
                InitButton.Dispose();
                InitButton = null;
            }

            if (IntelligenceButton != null)
            {
                IntelligenceButton.Dispose();
                IntelligenceButton = null;
            }

            if (NameButton != null)
            {
                NameButton.Dispose();
                NameButton = null;
            }

            if (RaceButton != null)
            {
                RaceButton.Dispose();
                RaceButton = null;
            }

            if (SensesButton != null)
            {
                SensesButton.Dispose();
                SensesButton = null;
            }

            if (SizeButton != null)
            {
                SizeButton.Dispose();
                SizeButton = null;
            }

            if (StrengthButton != null)
            {
                StrengthButton.Dispose();
                StrengthButton = null;
            }

            if (WisdomButton != null)
            {
                WisdomButton.Dispose();
                WisdomButton = null;
            }
        }
Example #7
0
    void Click(Vector2 position)
    {
        Ray        ray = Camera.main.ScreenPointToRay(position);
        RaycastHit hit;

        if (Physics.Raycast(ray, out hit))
        {
            if (lobbyActive == false)
            {
                if (hit.collider.gameObject.name == "StartButton")
                {
                    if (!startClicked)
                    {
                        MenuReset();
                        hostOn.SetActive(true);
                        joinOn.SetActive(true);
                        refreshServerList = true;
                        startClicked      = true;
                    }
                    else
                    {
                        MenuReset();
                    }
                }
                else if (hit.collider.gameObject.name == "ExitButton")
                {
                    Application.Quit();
                }
                else if (hit.collider.gameObject.name == "HostButton")
                {
                    SavePreferences();
                    //startserver();
                    MenuHide();
                    hostClicked = true;
                }
                else if (hit.collider.gameObject.name == "JoinButton")
                {
                    SavePreferences();
                    PresentServerList();
                }
                else if (hit.collider.gameObject.name == "OptionButton")
                {
                    if (!optionsClicked)
                    {
                        TiltButton.SetActive(true);
                        hostOn.SetActive(false);
                        joinOn.SetActive(false);
                        NameButton.SetActive(true);
                        MuteButton.SetActive(true);
                        OnOffButton.SetActive(true);
                        optionsClicked = true;
                    }
                    else
                    {
                        MenuReset();
                    }
                }
                else if (hit.collider.gameObject.name == "TiltButton" && tiltButtonEnabled)
                {
                    if (tilt)
                    {
                        TiltButton.GetComponent <SpriteRenderer> ().sprite = tiltOff;
                    }
                    else
                    {
                        TiltButton.GetComponent <SpriteRenderer> ().sprite = tiltOn;
                    }
                    tilt = !tilt;
                    SavePreferences();
                }
                else if (hit.collider.gameObject.name == "NameButton")
                {
                    nameClicked = true;
                }
                else if (hit.collider.gameObject.name == "MuteButton")
                {
                    if (!mute)
                    {
                        OnOffButton.GetComponent <SpriteRenderer> ().sprite = on;
                        AudioListener.pause = true;
                    }
                    else
                    {
                        OnOffButton.GetComponent <SpriteRenderer> ().sprite = off;
                        AudioListener.pause = false;
                    }
                    mute = !mute;
                    SavePreferences();
                }
                else if (hit.collider.gameObject.name == "On/OffButton")
                {
                    if (!mute)
                    {
                        OnOffButton.GetComponent <SpriteRenderer> ().sprite = on;
                        AudioListener.pause = true;
                    }
                    else
                    {
                        OnOffButton.GetComponent <SpriteRenderer> ().sprite = off;
                        AudioListener.pause = false;
                    }
                    mute = !mute;
                    SavePreferences();
                }
            }
        }
        if (backButtonEnabled)
        {
            if (BackButtonClicked(position) && !lobbyActive)
            {
                MenuReset();
            }
        }
    }