This commit is contained in:
2025-05-28 13:54:59 +09:00
parent c0826b3854
commit c9b7f7e3df
9 changed files with 63 additions and 35 deletions

View File

@@ -54,7 +54,7 @@ namespace Octopus.Simulator
panelConnectedObject.gameObject.SetActive(false);
panelPlacedObject.gameObject.SetActive(false);
LogicWindow.gameObject.SetActive(false);
FindAnyObjectByType<WebReceiver>().onParameterRecived += RequestInfo;
//FindAnyObjectByType<WebReceiver>().onParameterRecived += RequestInfo;
}
void ClearLogicBTN()
@@ -72,8 +72,9 @@ namespace Octopus.Simulator
onLogicDeSelected?.Invoke();
}
void RequestInfo(SimulatorConfig config)
public void RequestInfo(SimulatorConfig config)
{
Debug.Log("asdf");
ClearLogicBTN();
WebManager.webManager.Request_Get($"{WebManager.webManager.apiConfig.logic}/{WebParameters.config.logicId}", (flag, value) =>
{

View File

@@ -23,7 +23,7 @@ namespace Octopus.Simulator
void Awake()
{
rect = GetComponent<RectTransform>();
DataManager.I.onModelsUpdated += SetDropdown;
DataManager.I.onModelsUpdated += (value)=>SetDropdown();
}
public void SetDropdown(string mappingKey)

View File

@@ -12,13 +12,14 @@ public class ProjectDataManager : MonoBehaviour
Button projectMenuButton;
[SerializeField]
RectTransform menuPanel;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
FindAnyObjectByType<WebReceiver>().onParameterRecived += RequestInfo;
//FindAnyObjectByType<WebReceiver>().onParameterRecived += RequestInfo;
projectMenuButton.onClick.AddListener(SetActive);
}
void RequestInfo(SimulatorConfig config)
public void RequestInfo(SimulatorConfig config)
{
WebManager.webManager.Request_Get($"{WebManager.webManager.apiConfig.project}/{WebParameters.config.projectId}", (flag, value) =>
{

View File

@@ -3,6 +3,7 @@ using UnityEngine;
using System;
using TMPro;
using Octopus.Simulator.Networks;
using Octopus.Simulator;
public class WebReceiver : MonoBehaviour
{
@@ -10,10 +11,12 @@ public class WebReceiver : MonoBehaviour
public event Action<SimulatorConfig> onParameterRecived;
public void Start()
{
config.projectId = "12";
config.projectId = "17";
//config.simulationId = "15";
config.logicId = "25";
config.logicId = "46";
WebParameters.config = config;
onParameterRecived += FindAnyObjectByType<ProjectDataManager>().RequestInfo;
onParameterRecived += FindAnyObjectByType<LogicDataManager>().RequestInfo;
onParameterRecived?.Invoke(config);
}