Exemplo n.º 1
0
    void AcquireNewTarget()
    {
        if (goToPoints != null && goToPoints.Length > 0)
        {
            if (WayPointNumber < goToPoints.Length)
            {
                target = goToPoints[WayPointNumber];
            }
        }
        else
        {
            nextTargetAcquireTime = Time.time + targetAcquireInterval;

            UnitType[] targetableTypes = { UnitType.BATTLESHIP, UnitType.CRUISER, UnitType.STRUCTURE, UnitType.TURRET };

            target = TargetAcquirer.GetClosestEnemy(gameObject, targetableTypes, true);

            if (target == null)
            {
                target = TargetAcquirer.GetClosestEnemy(gameObject, targetableTypes, false);
            }

            //Debug.Log(target);
        }
    }
Exemplo n.º 2
0
    void AcquireNewTarget()
    {
        nextTargetAcquireTime = Time.time + targetAcquireInterval;

        target = TargetAcquirer.GetClosestEnemy(gameObject, maxTargetDistance);
    }