// Use this for initialization
 void Start()
 {
     steer     = this.gameObject.AddComponent <MySteeringBehaviour>();
     Speed     = 6.0f;
     turnSpeed = 1.0f;
     safeDist  = 20;
     minDist   = 5;
 }
예제 #2
0
    // Use this for initialization
    void Start()
    {
        day               = GameObject.FindObjectOfType <LevelManagerCs>();
        steer             = this.gameObject.AddComponent <MySteeringBehaviour>();
        agent.autoBraking = false;
        if (!string.IsNullOrEmpty(nameA))
        {
            pathToFollowA = GameObject.Find(nameA).GetComponentsInChildren <Transform>();
        }
        if (!string.IsNullOrEmpty(nameB))
        {
            pathToFollowB = GameObject.Find(nameB).GetComponentsInChildren <Transform>();
        }

        agent.autoBraking = false;
        isPathA           = true;
        isPathB           = false;
        //myAnimator = GetComponent<AiAnimator>();
    }