Exemple #1
0
    public void OnMouseDown()
    {
        BattleManager battleManager = GameObject.FindObjectOfType <BattleManager>();


        if (battleManager.selectedActor == null)
        {
            if (battleManager.context == BattleManager.Context.SearchingForCombatant && this.type == Type.combatant)
            {
                battleManager.selectedActor = this;
                battleManager.context       = BattleManager.Context.SelectingOption;
                OptionsCrescent optionsCrescent = GameObject.FindObjectOfType <OptionsCrescent>();
                optionsCrescent.RevealOptions();
                optionsCrescent.transform.position = this.transform.position;
            }
        }

        if (battleManager.context == BattleManager.Context.attack_ChoosingTarget)
        {
            if (battleManager.selectedActor != this && battleManager.targetedActor == null)
            {
                battleManager.targetedActor = this;
                battleManager.context       = BattleManager.Context.attack_DealingDamage;
                //battleManager.selectedActor.primaryAttack.Invoke();

                DamageTarget damageTarget = GameObject.FindObjectOfType <DamageTarget>();
                damageTarget.AttackTarget(battleManager.selectedActor, battleManager.targetedActor);
                damageTarget.transform.position = this.transform.position;
            }
        }
    }
Exemple #2
0
    public void NextTurn()
    {
        selectedActor = null;
        targetedActor = null;
        OptionsCrescent optionsCrescent = GameObject.FindObjectOfType <OptionsCrescent>();

        optionsCrescent.HideOptions();
        context = Context.SearchingForCombatant;
        targetSelection.selectionComplete = false;
    }