Пример #1
0
    public override void OnUpdate()
    {
        //Debug.Log("Ref Update");

        // Ref Character

        if (AiNum == 1)
        {
            float DesiredScore = 0;
            foreach (PointScoring PS in PointList)
            {
                distanceScore = PS.GetTertiaryScore();
                float score = PS.GetPrimaryScore() + PS.GetSecondaryScore() - distanceScore;
                if (score > DesiredScore)
                {
                    DesiredScore     = score;
                    LowestScorePoint = PS;
                }
            }

            //Debug.Log("Desired Score: " + DesiredScore);
            NA.SetDestination(LowestScorePoint.transform.position);
        }
        else if (AiNum == 2)
        {
            float DesiredScore = 0;
            foreach (PointScoring PS in PointList)
            {
                distanceScore = PS.GetExtraScore();
                float score = PS.GetPrimaryScore() + PS.GetSecondaryScore() + PS.GetTertiaryScore() - distanceScore;
                if (score > DesiredScore)
                {
                    DesiredScore     = score;
                    LowestScorePoint = PS;
                }
            }

            //Debug.Log("Desired Score: " + DesiredScore);
            NA.SetDestination(LowestScorePoint.transform.position);
        }
    }
Пример #2
0
    public override void OnUpdate()
    {
        //Debug.Log("FLEE Update");

        // FLEE Character
        // Calculate direction to target
        if (AiNum == 1)
        {
            float DesiredScore = 0;
            foreach (PointScoring PS in PointList)
            {
                float score = PS.GetPrimaryScore();
                if (score > DesiredScore)
                {
                    DesiredScore     = score;
                    LowestScorePoint = PS;
                }
            }

            //Debug.Log("Desired Score: " + DesiredScore);
            NA.SetDestination(LowestScorePoint.transform.position);
        }
        else if (AiNum == 2)
        {
            float DesiredScore = 0;
            foreach (PointScoring PS in PointList)
            {
                float score = PS.GetPrimaryScore();
                if (score > DesiredScore)
                {
                    DesiredScore     = score;
                    LowestScorePoint = PS;
                }
            }

            //Debug.Log("Desired Score: " + DesiredScore);
            NA.SetDestination(LowestScorePoint.transform.position);
        }
    }