using System; using System.Collections.Generic; using Sfs2X.Requests; using UnityEngine; public class CounterAction { public int Count; public int Counter; public Action Action; public CounterAction(Action action, int count = 1) { Count = count; Action = action; } public void Invoke() { if (Counter++ < Count) { Action.Invoke(); } } public void Bind(ref Action parent) { parent += Invoke; } } public class CounterAction { public int Count; public int Counter; public Action Action; public CounterAction(Action action, int count = 1) { Count = count; Action = action; } public void Invoke(T t) { if (Counter++ < Count) { Action.Invoke(t); } } public void Bind(ref Action parent) { parent += Invoke; } } public class CounterAction { public int Count; public int Counter; public Action Action; public CounterAction(Action action, int count = 1) { Count = count; Action = action; } public void Invoke(T1 t1, T2 t2) { if (Counter++ < Count) { Action.Invoke(t1, t2); } } public void Bind(ref Action parent) { parent += Invoke; } } public class GardenSmartFoxManager : Regist { #region Variable public static GardenSmartFox GardenSmartFox; #endregion public override bool RegistImmed() { enabled = true; return base.RegistImmed(); } public void Start() { GardenSmartFox = new GardenSmartFox(new Loggor(), new Connector()); //GardenSmartFox.Connector.Connect(); } public void OnDisable() { if (GardenSmartFox != null) GardenSmartFox.Connector.Disconnect(); } public void Update() { GardenSmartFox.SmartFox.ProcessEvents(); GardenSmartFox.SFSPlazaRoomManager.Update(); GardenSmartFox.ProcessRequest(); } }