1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using Random = UnityEngine.Random;
- public class RobotManager : Regist
- {
- #region Config
- public static List<Robot> Robots = new List<Robot>();
- #endregion
- public static void AddRobot(int currentRobotAmt, long robotConfigID, bool randomPos, string nickname, List<string> 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());
- if (currentRobotAmt < maxRobot)
- {
- Robot robot = new Robot(robotConfigID, randomPos, nickname, dressdatas);
- robot.Connect(sfsRoomID);
- 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);
- }
- }
- }
- }
|