コード例 #1
0
ファイル: EnterExercise.cs プロジェクト: nanalucky/Pet46
    // 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
ファイル: EnterBall.cs プロジェクト: nanalucky/Pet46
    // 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);
    }