예제 #1
0
    // Use this for initialization
    void Start()
    {
        // choose the farest lookat
        lookat = GameObject.FindGameObjectWithTag ("dog").GetComponent<DogController> ().lookats [3];

        aiMoveCamera = new AIMoveCamera ();
        aiMoveCamera.Start (this);
        lastAI = new AITurn ();
        lastAI.Start (this);
    }
예제 #2
0
    // Use this for initialization
    void Start()
    {
        GameObject goDog = GameObject.FindGameObjectWithTag("dog");
        goDog.GetComponent<Animator> ().Play ("Stand");
        Vector3 direction = Camera.main.transform.position - goDog.GetComponent<DogController>().GetDogPivot();
        if (!Physics.Raycast (goDog.GetComponent<DogController>().GetDogPivot(), direction.normalized, direction.magnitude)
            && (Camera.main.transform.position - goDog.GetComponent<DogController>().GetDogPivot()).magnitude > 1.0f) {
            ToBall();
            return;
        }

        // choose the farest lookat
        lookat = goDog.GetComponent<DogController> ().ChooseLookat ();

        aiMoveCamera = new AIMoveCamera ();
        aiMoveCamera.Start (this);
    }