Beispiel #1
0
    // Main Update function that get called for every frame.
    public override void updateStage()
    {
        // This is needed for calling step update.
        base.updateStage();

        if (currentCombatSubStage.Equals(CombatSubStages.InCover))
        {
            if (opponent.isHidden())
            {
                if (opponent.isAimed())
                {
                    m_selfAgent.setTargetPoint(opponent.getTransfrom().position + new Vector3(0, 1.1f, 0) + randomOffset);
                }
                else
                {
                    m_selfAgent.setTargetPoint(opponent.getTransfrom().position + new Vector3(0, 0.4f, 0) + randomOffset);
                }
            }
            else
            {
                m_selfAgent.setTargetPoint(opponent.getTransfrom().position + new Vector3(0, 1.25f, 0) + randomOffset);
            }


            //m_selfAgent.setTargetPoint(opponent.getTransfrom().position  + randomOffset);
        }
        else
        {
            m_selfAgent.setTargetPoint(targetLocation.position + randomOffset);
        }
    }
Beispiel #2
0
 public CombatStage(ICyberAgent selfAgent, ICyberAgent target, NavMeshAgent navMeshAgent) : base(selfAgent, navMeshAgent)
 {
     this.opponent = target;
     coverPoints   = GameObject.FindObjectsOfType <CoverPoint>();
     selfAgent.toggleHide();
     selfAgent.aimWeapon();
     //selfAgent.togglepSecondaryWeapon();
     selfAgent.togglePrimaryWeapon();
     targetLocations = opponent.getTransfrom().gameObject.GetComponentsInChildren <Collider>();
     findTargetLocationToFire();
 }