<fix> 로봇좌표 TCP전달 수정
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
@@ -48,6 +49,13 @@ public class AppManager : MonoBehaviour
|
||||
model = new ProgramModel(hostip, tcpPort, udpPort, robotController);
|
||||
await model.InitializeAsync();
|
||||
|
||||
if (view == null || tcpView == null || robotController == null ||
|
||||
pointManagerView == null || popupView == null || pathLineView == null)
|
||||
{
|
||||
Debug.LogError("AppManager의 인스펙터에 [Static Views]가 모두 할당되지 않음", this);
|
||||
return;
|
||||
}
|
||||
|
||||
isModelAndStaticViewsReady = true;
|
||||
TryCreatePresenter();
|
||||
}
|
||||
@@ -64,15 +72,32 @@ public class AppManager : MonoBehaviour
|
||||
{
|
||||
if (presenter != null) return;
|
||||
|
||||
presenter = new ProgramPresenter(
|
||||
model,
|
||||
view,
|
||||
tcpView,
|
||||
interactionView,
|
||||
pointManagerView,
|
||||
popupView,
|
||||
pathLineView
|
||||
);
|
||||
if (!isModelAndStaticViewsReady || interactionView == null)
|
||||
{
|
||||
string log = "Presenter 생성 대기 중... (";
|
||||
log += "Model&StaticView: " + (isModelAndStaticViewsReady ? "Ready" : "Waiting") + ", ";
|
||||
log += "InteractionView: " + (interactionView != null ? "Ready" : "Waiting") + ")";
|
||||
Debug.Log(log);
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
presenter = new ProgramPresenter(
|
||||
model,
|
||||
view,
|
||||
tcpView,
|
||||
interactionView,
|
||||
pointManagerView,
|
||||
popupView,
|
||||
pathLineView
|
||||
);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError($"Presenter 생성자에서 오류 발생: {e.Message}\n{e.StackTrace}");
|
||||
return; // 생성 실패
|
||||
}
|
||||
|
||||
presenter.RegisterControlledRobot(robotController);
|
||||
_ = presenter.UpdateMotorStateAsync();
|
||||
|
||||
Reference in New Issue
Block a user