using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using Random = UnityEngine.Random; public class RobotManager : Regist { #region Config public static List Robots = new List(); #endregion public static void AddRobot(int currentRobotAmt, long robotConfigID, bool randomPos, string nickname, List dressdatas) { Robot.Initialize(); int sfsRoomID = SFSManager.GardenSmartFox.PlazaRoomManager.CurrentPlazaRoom.Id; int maxPlayer = SFSManager.GardenSmartFox.PlazaRoomManager.CurrentRoomData.MaxPlayer; int maxRobot = (int) Auxiliary.FmlParse(Robot.MaxRobotAmtFml, "p", maxPlayer.ToString()); //Debug.Log(currentRobotAmt + " " + maxRobot); if (currentRobotAmt < maxRobot) { Robot robot = new Robot(robotConfigID, randomPos, nickname, dressdatas); robot.Connect(sfsRoomID, maxRobot); Robots.Add(robot); } } public static void DeactivateAllRobots(bool delay) { for (int i = 0; i < Robots.Count; i++) { Robots[i].Deactivate(delay); if (!delay) { i--; } } } public void Update() { for (int i = 0; i < Robots.Count; i++) { if (Robots[i].Update()) { Robots[i--].Deactivate(false); } } } }