first commit

This commit is contained in:
lethanhsonvsp
2025-11-17 15:16:36 +07:00
commit a40d0921eb
17012 changed files with 2652386 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
using System.Collections;
using UnityEngine;
public class RobotManager : MonoBehaviour
{
public RobotController abb;
public Robot2Controller yas;
void Start()
{
StartCoroutine(AbbLoop());
StartCoroutine(YasLoop());
}
bool IsAtTarget3()
{
return yas.HasPhoiAtTarget3();
}
IEnumerator AbbLoop()
{
for (int i = 0; i < abb.stackCount; i++)
{
yield return new WaitUntil(() => !IsAtTarget3());
yield return StartCoroutine(abb.RunStepsExternal());
// ✅ Sau khi ABB đặt phôi, đưa phôi vào queue của YAS
yas.EnqueuePhoi(abb.LastStackObject);
}
Debug.Log("ABB hoàn thành tất cả vòng");
}
IEnumerator YasLoop()
{
for (int i = 0; i < abb.stackCount; i++)
{
// Đợi tới khi có phôi ở target3
yield return new WaitUntil(() => IsAtTarget3());
yield return StartCoroutine(yas.RunStepsExternal());
}
Debug.Log("YAS hoàn thành tất cả vòng");
}
}