Exemple #1
0
    // 작동 될 때
    private void OnEnable()
    {
        if (b_rigid == null)
        {
            transform.SetParent(null);                                          // 부모를 없애어, 플레이어의 시각으로부터 자유로워진다.
            b_rigid = GetComponent <Rigidbody>();
            //tf = GameObject.Find("LookChecker");
            //tf.transform.SetParent(null);                           // 부모를 없애어, 플레이어가 어디를 보고 치던 벨루가에게 날아가도록 한다.
            //player = GameObject.Find("Camera Container");
            veluga  = GameObject.Find("BelugaAxis");
            aiState = GameObject.Find("BelugaAxis").GetComponent <AIStateController>();
            input   = GameObject.Find("Main Camera").GetComponent <UInput>();
            caTF    = GameObject.Find("Main Camera").GetComponent <Transform>();
            //catchTF = GameObject.Find("CatchPoint");
            ballHit = GameObject.Find("Particle").transform.Find("Ball");
        }

        // off 한 후의 힘 초기화
        b_rigid.velocity = Vector3.zero;
        BallVelo         = Throwing(transform.position, veluga.transform.position + Vector3.up * 0.5f, degree);
        Throw(BallVelo);

        if (UInput.uIState == UInput.UIState.Ball)
        {
            //catchTF.transform.position = caTF.position;
            //catchTF.transform.SetParent(null);
            aiState.StartCoroutine(aiState.BallBall());
            StartCoroutine("DestroyBall");
        }
    }