Beispiel #1
0
    /// <summary>
    /// Randomly select the next target to assassinate.
    /// </summary>
    public void NextContract()
    {
        //Times to cycle to find a new target if none is found in previous cycles
        int CycleTime = 0;

        GameObject[] targetObjs;
        int          randomSelect;
        string       targetType = "";

        contractTarget = null;

        while (contractTarget == null && CycleTime < 3)
        {
            randomSelect = Random.Range(0, 2);
            switch (randomSelect)
            {
            case 0:
                targetType = "GovForce";
                break;

            case 1:
                targetType = "Boid";
                break;

            //case 2:
            //    targetType = "Pacifist";
            //break;
            default:
                CycleTime++;
                break;
            }
            targetObjs   = GameObject.FindGameObjectsWithTag(targetType);
            randomSelect = Random.Range(0, targetObjs.Length);
            //set new contract speculations
            contractTarget = targetObjs[randomSelect];
            contractAspect = contractTarget.GetComponent <SightTouchAspect>().aspect;
        }
    }
Beispiel #2
0
 public void ResetDisplayTime(Aspect.AspectName _otheraspect)
 {
     otherAspect = _otheraspect;
     currentTime = 0;
     startTimer  = true;
 }