123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- 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<T>
- {
- public int Count;
- public int Counter;
- public Action<T> Action;
- public CounterAction(Action<T> action, int count = 1)
- {
- Count = count;
- Action = action;
- }
- public void Invoke(T t)
- {
- if (Counter++ < Count)
- {
- Action.Invoke(t);
- }
- }
- public void Bind(ref Action<T> parent)
- {
- parent += Invoke;
- }
- }
- public class CounterAction<T1, T2>
- {
- public int Count;
- public int Counter;
- public Action<T1, T2> Action;
- public CounterAction(Action<T1, T2> 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<T1, T2> 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();
- }
- }
|