コード例 #1
0
    //Public Methods
    public void Init(Party owner, CharInfo charInfo, CharacterVisual charVisual)
    {
        _extraSpellHandler = new ExtraSpellHandler();

        _charVisual = charVisual;
        _charVisual.Event_ActionsFinished += OnCharVisualActionsFinish;
        _charVisual.Event_SpellCast       += OnCharVisualSpellCast;

        _charInfo = charInfo;

        _currentStats = _charInfo.baseStats;
        DivineDebug.Log(moniker + " Created with hp: " + _currentStats.hp + " Shield: " + _currentStats.shield);

        SetOwnerParty(owner);

        _charVisual.charUI.Init(
            _charVisual.Tr_HUD_HelperPos,
            _charVisual.Tr_SelectionButton_HelperPos,
            _charVisual.Tr_decal_HelperPos);

        _charVisual.charUI.SubscribeForSelectTarget(SelectedAsTarget);

        _charVisual.charUI.newCharHUD.Init(_currentStats.maxHp, _currentStats.hp, _currentStats.maxShield, _currentStats.shield, _charInfo.level, side == PartySide.Player, isHero);

        ResetCharacterUIAndEffect();

        _isActive = charInfo.enableInStart;
    }
コード例 #2
0
    public void DestroyIt()
    {
        DivineDebug.Log("Deleting Character named: + " + moniker);

        Event_SelectAsTarget = null;
        Event_SpellCast      = null;
        Event_StateChange    = null;

        _extraSpellHandler.Die();
        _extraSpellHandler = null;

        _charVisual.DestroyIt();
        _charVisual = null;

        _charInfo     = null;
        _relatedParty = null;
    }