Example #1
0
 public void InitializeSpellButtonRecursive(SpellButton button)
 {
     foreach (SpellTree.Node spell in button.Spell.Children)
     {
         SpellButton newButton = new SpellButton()
         {
             Spell       = spell,
             ImageButton = new Button(GUI, MainPanel, spell.Spell.Name, GUI.SmallFont, Button.ButtonMode.ImageButton, spell.Spell.Image)
             {
                 ToolTip         = spell.Spell.Description,
                 KeepAspectRatio = true,
                 DontMakeSmaller = true,
                 DontMakeBigger  = true
             },
             Level    = button.Level + 1,
             Children = new List <SpellButton>(),
             Parent   = button
         };
         SpellTree.Node rSpell = spell;
         newButton.ImageButton.OnClicked += () => ImageButton_OnClicked(rSpell);
         button.Children.Add(newButton);
         SpellButtons.Add(newButton);
         InitializeSpellButtonRecursive(newButton);
     }
 }
Example #2
0
        void Start()
        {
            GameObject tempGO1 = GameObject.FindGameObjectWithTag("GameController");

            if (tempGO1)
            {
                gridController = tempGO1.GetComponent <GridController>();
                turnManager    = tempGO1.GetComponent <TurnManager>();
            }
            GameObject tempGO2 = GameObject.FindGameObjectWithTag("PlayerController");

            if (tempGO2)
            {
                playerBehaviour = tempGO2.GetComponent <PlayerBehaviour>();
                spellButtons    = tempGO2.GetComponent <SpellButtons>();
                spellHandler    = tempGO2.GetComponent <SpellHandler>();
                spellCasting    = tempGO2.GetComponent <SpellCasting>();
                spellChecker    = tempGO2.GetComponent <SpellChecker>();
            }
            tilesToBeReset     = new List <Tile>();
            movementRangeTiles = new List <Tile>();
            SubscribtionOn();
            movementEnabled = true;
            stillMoving     = false;
            rangeTiles      = null;
        }
Example #3
0
 private void End()
 {
     Game.Unpause();
     casting = false;
     SpellButtons.ActivateCastingButtons(true);
     activeSpell = null;
     GameplayUI.HideInstructions();
 }
Example #4
0
    protected IEnumerator WaitForClick()
    {
        SpellButtons.ActivateCastingButtons(false);

        while (waiting)
        {
            yield return(null);
        }
    }
Example #5
0
    public void OnLevelUpClick(Button button)
    {
        LevelUpMenu.SpendLevelUpPoints();
        Player.LearnSpell(spellName);
        SpellButtons.CheckIfKnown(button);

        int buttonIndex = allSpellNames.IndexOf(spellName);

        Button castingButton = SpellButtons.GetAllCastingButtons() [buttonIndex];

        SpellButtons.UpdateSpellSlots(castingButton);
    }
        void Start()
        {
            Button next = nextTurnButton.GetComponent <Button>();

            next.onClick.AddListener(NextTurn);
            if (!teamManager)
            {
                teamManager = gameObject.GetComponent <TeamManager>();
            }
            spellButtons       = GameObject.FindGameObjectWithTag("PlayerController").GetComponent <SpellButtons>();
            turnNumber         = 1;
            maxHealthReduction = 0;

            Invoke("Purkka", 0.1f);
        }
Example #7
0
        ////////////public EffectValues testing;


        void Start()
        {
            if (!gridController)
            {
                gridController = GameObject.FindGameObjectWithTag("GameController").GetComponent <GridController>();
            }
            if (!gridController)
            {
                Debug.LogWarning("Gridcontroller is null!");
            }
            if (!aControll)
            {
                aControll = GameObject.FindGameObjectWithTag("AudioController").GetComponent <AudioController>();
            }
            if (!spellbuttons)
            {
                spellbuttons = GameObject.FindGameObjectWithTag("PlayerController").GetComponent <SpellButtons>();
            }

            //if (!currentTile)
            //    currentTile = gridController.GetTile((int)transform.localPosition.x, (int)transform.localPosition.z);

            //currentCharacter.currentTile = new PositionContainer(12, 12);

            turnManager             = GameObject.FindGameObjectWithTag("GameController").GetComponent <TurnManager>();
            turnManager.TurnChange += HandleTurnChange;

            //Tab testing V V V

            //////////////foreach (GameObject tab in charTabList)
            //////////////{
            //////////////    tab.GetComponent<CharacterTab>().AddEffectIcon(testing);
            //////////////    tab.GetComponent<CharacterTab>().AddEffectIcon(testing);
            //////////////    tab.GetComponent<CharacterTab>().AddEffectIcon(testing);
            //////////////}
        }