Ejemplo n.º 1
0
        public void Init(ref Grid grid)
        {
            target = -1;
            alive = false;
            health = 100;
            pos = grid.cells[grid.indexOfExit].centre;
            safe = Rnd.r.NextDouble() > 0.5;
            progress = 0;
            prevCell = grid.indexOfExit;
            nextCell = prevCell;

            strategy = GuardStrategy.GoForMostCritical;
            pathing = GuardPathfinding.Dumb;
            targetLookAhead = false;
        }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        if (type == GuardType.Regular)
        {
            state = GuardState.Patrol;
        }

        fovSensor   = GetComponent <FieldOfView>();
        patrolPath  = GetComponent <GuardPathfinding>();
        agent       = GetComponent <NavMeshAgent>();
        searchTimer = searchTime;
        levelstate  = GameObject.Find("GameManager").GetComponent <LevelState>();
        animator    = GetComponentInChildren <Animator>();
        visibility  = GetComponent <GuardVisibility>();
        animator.SetBool("kävelee", true);
        guimanager = GameObject.Find("GameManager").GetComponent <GUIManager>();
    }
Ejemplo n.º 3
0
 public void SwitchPathing()
 {
     if (pathing == GuardPathfinding.Dumb) pathing = GuardPathfinding.Smart;
     else pathing = GuardPathfinding.Dumb;
 }