Update() public method

public Update ( ) : void
return void
Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        mSpeed = Mathf.Min(mSpeed + kParam.NeutralAccel, kParam.NeutralHeadDegMax);
        // 当たり判定
        RaycastHit2D hitResult = Physics2D.CircleCast(mPos, kParam.BodyRadius, Vector2.right, mSpeed * Time.deltaTime);

        if (hitResult.collider != null)
        {
            mPos = hitResult.centroid;
        }
        else
        {
            mPos.x += mSpeed * Time.deltaTime;
        }
        // 移動
        transform.SetPositionAndRotation(mPos, Quaternion.identity);

        mFaceController.Update(mPos, mSpeed);
    }