コード例 #1
0
 public void Attack(CombatTarget combatTarget)
 {
     //calls the script for cancelling the action
     GetComponent <ActionScheduler>().StartAction(this);
     //player will know weather to attack a target or not
     target = combatTarget.GetComponent <Health>();
 }
コード例 #2
0
 public void Attack(CombatTarget combatTarget)
 {
     //call action scheduler for cancelling action if neccessary
     GetComponent <ActionScheduler>().StartAction(this);
     //store the correct combat target into target variable
     target = combatTarget.GetComponent <Health>();
 }
コード例 #3
0
ファイル: Fighter.cs プロジェクト: booglepss12/NewRPG
        public bool CanAttack(CombatTarget combatTarget)
        {
            if (combatTarget == null)
            {
                return(false);
            }
            Health targetToTest = combatTarget.GetComponent <Health>();

            return(targetToTest != null && !targetToTest.IsDead());
        }
コード例 #4
0
ファイル: Projectile.cs プロジェクト: WayneDelinquent/RPGDemo
        private Vector3 GetAimLocation()
        {
            CapsuleCollider targetCollider = _target.GetComponent <CapsuleCollider>();

            if (targetCollider == null)
            {
                return(_target.transform.position);
            }
            return(_target.transform.position + Vector3.up * targetCollider.height / 1.7f);
        }
コード例 #5
0
        //ignores dead enimies such as their hit box (checks is they are dead)
        public bool CanAttack(CombatTarget combatTarget)
        {
            //if we click on the terrain instead of target return false
            if (combatTarget == null)
            {
                return(false);
            }
            Health targetToTest = combatTarget.GetComponent <Health>();

            return(targetToTest != null && !targetToTest.IsDead());
        }
コード例 #6
0
        //function to check if the enemy that was hit by raycast is targetable
        public bool CanAttack(CombatTarget combatTarget)
        {
            //if the combatTarget passed in is null then return false (we cannot attack a null object)
            if (combatTarget == null)
            {
                return(false);
            }

            //get Health component from the passed combatTarget
            Health targetToTest = combatTarget.GetComponent <Health>();

            //return true if target is not null AND target is not dead
            return(targetToTest != null && !targetToTest.IsDead());
        }
コード例 #7
0
ファイル: Fighter.cs プロジェクト: booglepss12/NewRPG
 public void Attack(CombatTarget combatTarget)
 {
     GetComponent <ActionScheduler>().StartAction(this);
     target = combatTarget.GetComponent <Health>();
 }
コード例 #8
0
ファイル: Fighter.cs プロジェクト: BeetYeet/PRR-Action-RPG
 public bool CanAttack(CombatTarget combatTarget)
 {
     return(attackableAlignments.Contains(combatTarget.Alignment) && combatTarget.GetComponent <Health>().Alive);
 }