Esempio n. 1
0
        public override void Entered(State s, State fromPrevious)
        {
            characterCustomization.character.race = null;
            base.Entered(s, fromPrevious);



            characterCustomization.manager.optionsWindow.SetTitle("Choose Race");


            OptButton human = characterCustomization.manager.optionsWindow.AddButton("Human");

            human.OnOptLeftClicked += SelectedHuman;
            Race race = new Race(RaceName.HUMAN);

            race.DressOptButtonForTooltip(human, Tooltip.TooltipPosition.RIGHT);

            race = new Race(RaceName.HALF_ORC);
            OptButton halfOrc = characterCustomization.manager.optionsWindow.AddButton("Half-Orc");

            race.DressOptButtonForTooltip(halfOrc, Tooltip.TooltipPosition.RIGHT);
            halfOrc.OnOptLeftClicked += SelectedHalfOrc;



            human.WasLeftClicked();
        }
        public override void Entered(State s, State fromPrevious)
        {
            base.Entered (s, fromPrevious);
            characterCustomization.manager.optionsWindow.SetTitle("Choose Class");

            OptButton fighter = characterCustomization.manager.optionsWindow.AddButton ("Fighter");
            fighter.OnOptMousedOver += (button) => {
                int lvl;
                if(lastClassChosen != null && lastClassChosen.classType == ClassType.FIGHTER) {
                    lvl = characterCustomization.character.ClassLevelIn(ClassType.FIGHTER) - 1;
                } else {
                    lvl = characterCustomization.character.ClassLevelIn(ClassType.FIGHTER);
                }
                ClassLevel5e fgterStub = new ClassLevel5e(ClassType.FIGHTER, lvl);
                fgterStub.InitDefaultFeatures();
                Tooltip.instance.SetText(fgterStub.TooltipHoverText());
                Tooltip.instance.Show(fighter.transform as RectTransform, Tooltip.TooltipPosition.RIGHT);
            };
            fighter.OnOptMousedOut += (button) => {
                Tooltip.instance.Hide();
            };

            fighter.OnOptLeftClicked += SelectedFighter;

            OptButton wizard = characterCustomization.manager.optionsWindow.AddButton ("Wizard");
            wizard.OnOptMousedOver += (button) => {
                int lvl;
                if(lastClassChosen != null && lastClassChosen.classType == ClassType.WIZARD) {
                    lvl = characterCustomization.character.ClassLevelIn(ClassType.WIZARD) - 1;
                } else {
                    lvl = characterCustomization.character.ClassLevelIn(ClassType.WIZARD);
                }
                ClassLevel5e wizardStub = new ClassLevel5e(ClassType.WIZARD, lvl);
                wizardStub.InitDefaultFeatures();
                Tooltip.instance.SetText(wizardStub.TooltipHoverText());
                Tooltip.instance.Show(wizard.transform as RectTransform, Tooltip.TooltipPosition.RIGHT);
            };
            wizard.OnOptMousedOut += (button) => {
                Tooltip.instance.Hide();
            };

            wizard.OnOptLeftClicked += SelectedWizard;

            fighter.WasLeftClicked ();
        }