// Use this for initialization
 void Start()
 {
     move     = GetComponent <Move>();
     seek     = GetComponent <SteeringSeek>();
     arrive   = GetComponent <SteeringArrive>();
     Movenemy = enemy.GetComponent <Move>();
 }
Пример #2
0
 void Start()
 {
     move       = GetComponent <Move>();
     seek       = GetComponent <SteeringArrive>();
     steer      = GetComponent <SteeringSeek>();
     police     = GetComponent <NavMeshAgent>();
     m_animator = GetComponent <Animator>();
 }
Пример #3
0
 // Use this for initialization
 void Start()
 {
     //animatorGame = robberGame.GetComponent<Animator>();
     move     = GetComponent <Move>();
     seek     = GetComponent <SteeringArrive>();
     robber   = GetComponent <Animator>();
     m_robber = GetComponent <NavMeshAgent>();
 }
Пример #4
0
 // Use this for initialization
 void Start()
 {
     animatorGame = Game.GetComponent <Animator>();
     move         = GetComponent <Move>();
     m_agent      = GetComponent <NavMeshAgent>();
     animator     = GetComponent <Animator>();
     seek         = GetComponent <SteeringArrive>();
     //casher = new Vector3(-23.22f, 21.41f, 42.22f);
     animator.SetBool("Buy", false);
 }
Пример #5
0
    // Use this for initialization

    // Update is called once per frame


    void Start()
    {
        RAnimator = rubishGo.GetComponent <Animator>();

        agent      = GetComponent <NavMeshAgent>();
        m_animator = GetComponent <Animator>();
        seek       = GetComponent <SteeringArrive>();

        //avoidance = false;
    }
Пример #6
0
    // Use this for initialization
    void Start()
    {
        move   = GetComponent <Move>();
        arrive = GetComponent <SteeringArrive>();
        seek   = GetComponent <SteeringSeek>();
        align  = GetComponent <SteeringAlign>();
        Vector3 x = Vector3.zero;

        path = new NavMeshPath();
    }
Пример #7
0
    // Use this for initialization
    void Start()
    {
        move  = GetComponent <Move>();
        seek  = GetComponent <SteeringArrive>();
        agent = GetComponent <PoliceBehaviour>();

        // TODO 1: Calculate the closest point in the range [0,1] from this gameobject to the path
        float startDistance;
        float distance = path.GetDistance();

        desiredPoint = path.CalcPositionByClosestPoint(transform.position, out startDistance);
        currentRatio = startDistance / distance;
    }
Пример #8
0
    protected void Awake()
    {
        // Init Vars
        InitializeVars();

        // Initialize behaviors
        arrive    = new Behavior[2];
        arrive[0] = new KinematicArrive()
        {
            maxSpeed = maxSpeed
        };
        arrive[1] = new SteeringArrive()
        {
            maxSpeed = maxSpeed, timeToTarget = timeToTarget, slowRadius = slowRadius, targetRadius = targetRadius
        };

        wander = new KinematicWander(wanderSpeed);
        pursue = new KinematicPursue(maxSpeed)
        {
            maxPredication = maxPrediction
        };

        // Initialize Rotation behaviors
        align    = new Align[2];
        align[0] = new KinematicAlign(rotationSpeed);
        align[1] = new SteeringAlign();

        if (steeringAtStart)
        {
            behaviorIndex = 1;
        }
        else
        {
            behaviorIndex = 0;
        }
    }
Пример #9
0
 // Use this for initialization
 void Start()
 {
     move   = GetComponent <Move>();
     arrive = GetComponent <SteeringArrive>();
 }
Пример #10
0
 void Awake()
 {
     agent  = GetComponent <NavMeshAgent>();
     arrive = GetComponent <SteeringArrive>();
 }