Ejemplo n.º 1
0
        private byte OnCharacterSelectTask()
        {
            LastTask        = Tasks.CharacterSelect;
            CharacterSelect = (Task <CharacterSelect, CharacterSelectTaskState> *) * State.CurrentTask;
            OnCharacterSelect?.Invoke(CharacterSelect);
            var result = _onCharaSelectHook.OriginalFunction();

            AfterCharacterSelect?.Invoke(CharacterSelect);
            return(result);
        }
Ejemplo n.º 2
0
    /// <summary>
    /// Tries to select a character at the grid location the user just clicked on. If successful, show that characters move/attack ranges
    /// </summary>
    /// <param name="selNode">The node that was just selected</param>
    private void AttemptSelect(Node selNode)
    {
        // Try to get the MoveAttack script off the character
        _charSelected = _mAContRef.GetCharacterMAByNode(selNode);
        // Make sure the MoveAttack script is valid and that the character is active in the hierarchy
        if (_charSelected != null && _charSelected.gameObject.activeInHierarchy)
        {
            // Set the recent selected character
            _recentCharSel = _charSelected;
            // If it hasn't moved this turn yet or hasn't attacked this turn
            if (!(_charSelected.HasMoved && _charSelected.HasAttacked))
            {
                //Debug.Log("Select character");
                // Calculate its valid tiles
                _charSelected.CalculateAllTiles();
                // Set the visuals of it to be on
                _mAContRef.SetActiveVisuals(_charSelected);
            }

            // Call the character selected event
            OnCharacterSelect?.Invoke(_charSelected);
        }
    }