private void LateUpdate()
        {
            // PreviewCameraなどはこのタイミングでnullになっているようなのでチェック
            if (parentCamera == null)
            {
                Destroy(gameObject);
                return;
            }

            camera_.enabled = parentGate.IsVisible(parentCamera);
            if (camera_.enabled)
            {
                var parentCamTrans  = parentCamera.transform;
                var parentGateTrans = parentGate.transform;

                parentGate.UpdateTransformOnPair(
                    transform,
                    parentCamTrans.position,
                    parentCamTrans.rotation
                    );


                UpdateCamera();
            }
        }
Beispiel #2
0
        void PassGate(PortalGate gate)
        {
            gate.UpdateTransformOnPair(transform);

            if (rigidbody_ != null)
            {
                rigidbody_.velocity    = gate.UpdateDirOnPair(rigidbody_.velocity);
                rigidbody_.useGravity  = false;
                ignoreGravityStartTime = Time.time;
            }

            if (fpController != null)
            {
                fpController.m_MoveDir = gate.UpdateDirOnPair(fpController.m_MoveDir);
                fpController.InitMouseLook();
            }
        }