예제 #1
0
    public void Initialize(Hero hero, TapBattleInterface tapBattleRef, TapBattleController controller, TapCharacterHandler handler)
    {
        this.hero         = hero;
        this.tapBattleRef = tapBattleRef;
        this.controller   = controller;
        this.fctInterface = controller.FCTInterface;
        this.handler      = handler;

        portrait.sprite  = hero.LoadPortraitSprite();
        skillIcon.sprite = hero.tapSkill.sprite;// Resources.Load<Sprite>("Hero/" + hero.data.Identity.ToLower() + "/portrait");

        switch (hero.tapSkill.element)
        {
        case ElementalTypes.Fire:
            Element.sprite           = Resources.Load <Sprite>("Items/None/element_fire");
            ElementBackground.sprite = Element.sprite;
            break;

        case ElementalTypes.Water:
            Element.sprite           = Resources.Load <Sprite>("Items/None/element_water");
            ElementBackground.sprite = Element.sprite;
            break;

        case ElementalTypes.Nature:
            Element.sprite           = Resources.Load <Sprite>("Items/None/element_nature");
            ElementBackground.sprite = Element.sprite;
            break;

        case ElementalTypes.Light:
            Element.sprite           = Resources.Load <Sprite>("Items/None/element_light");
            ElementBackground.sprite = Element.sprite;
            break;

        case ElementalTypes.Dark:
            Element.sprite           = Resources.Load <Sprite>("Items/None/element_dark");
            ElementBackground.sprite = Element.sprite;
            break;

        default:
            Element.gameObject.SetActive(false);
            ElementBackground.gameObject.SetActive(false);
            break;
        }

        tooltip.Initialize(hero.tapSkill);
        cooldownTotal = hero.tapSkill.cooldown * 60f;// 90f - (60f * ((float) hero.GetPrimaryStat(PrimaryStats.Speed) / 100f));
    }
    public void Loading()
    {
        data = PlayerManager.Instance.SelectedBattle;

        // Get the BattleRoot Object and Load the UI
        if (battleRoot == null)
        {
            battleRoot = FindObjectOfType <BattleRootController>();
        }
        if (FCTInterface == null)
        {
            FCTInterface = (FloatingCombatTextInterface)MenuManager.Instance.Load("Interface_FloatingCombatText");
        }
        if (TapInterface == null)
        {
            TapInterface = (TapBattleInterface)MenuManager.Instance.Push("Interface_TapBattle");
        }

        // If the battleRoot object is not null go to the next phase
        if (battleRoot != null && FCTInterface != null && TapInterface != null)
        {
            Phase++;
        }
    }