SampleApp1でScene切り替え
SampleApp1を元に実装していたのですが、Live2Dモデルが配置されたシーンを二つ用意して、再生し、スクリプトでシーンを切り替えて、ゲームビューをクリックするとストップし、以下のエラーメッセージが出ます。
MissingReferenceException: The object of type 'Transform' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.Transform.TransformPoint (Vector3 position)
LAppView.UpdateTouchPos_2DCamera (Vector3 inputPos)
LAppView.TouchesEnded (Vector3 inputPos)
SampleApp1を元にした実装で、シーン切り替えを行うにはどうすればいいでしょうか?
MissingReferenceException: The object of type 'Transform' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.Transform.TransformPoint (Vector3 position)
LAppView.UpdateTouchPos_2DCamera (Vector3 inputPos)
LAppView.TouchesEnded (Vector3 inputPos)
SampleApp1を元にした実装で、シーン切り替えを行うにはどうすればいいでしょうか?
0
コメント
以下のようにコード追加すれば、シーン切替できるかと思います
[LAppView.cs]284行目あたり
/* * カメラの Projection が Orthographic である場合(2Dカメラ) */ protected void UpdateTouchPos_2DCamera(Vector3 inputPos) { // コード追加 Start if (transform == null) { return; } // コード追加 End //--- calc local plane coord --- { Vector3 worldP_LT = transform.TransformPoint( localP_LT ) ; Vector3 worldP_RT = transform.TransformPoint( localP_RT ) ; Vector3 worldP_LB = transform.TransformPoint( localP_LB ) ; Vector3 ScreenLT = Camera.main.WorldToScreenPoint( worldP_LT ) ; Vector3 ScreenRT = Camera.main.WorldToScreenPoint( worldP_RT ) ; Vector3 ScreenLB = Camera.main.WorldToScreenPoint( worldP_LB ) ; Vector3 sVX = ScreenRT - ScreenLT; Vector3 sVY = ScreenLB - ScreenLT; ・ ・ } }