示例#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;
        }
    // 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>();
    }
示例#3
0
 public void SwitchPathing()
 {
     if (pathing == GuardPathfinding.Dumb) pathing = GuardPathfinding.Smart;
     else pathing = GuardPathfinding.Dumb;
 }