/// <summary>
        /// Attempt to register handlers to client/server objects
        /// Invokes MmStart on listeners.
        /// </summary>
        public virtual void Start()
        {
            MmLogger.LogResponder(gameObject.name + ": MmNetworkManager Started");

            if (NetworkClient == null && NetworkManager.singleton != null)
            {
                NetworkClient = NetworkManager.singleton.client;
            }

            if (NetworkClient != null)
            {
                foreach (var value in Enum.GetValues(typeof(MmMessageType)).Cast <short>())
                {
                    NetworkClient.RegisterHandler(value, ReceivedMessage);
                }
            }

            if (isServer)
            {
                foreach (var value in Enum.GetValues(typeof(MmMessageType)).Cast <short>())
                {
                    NetworkServer.RegisterHandler(value, ReceivedMessage);
                }
            }

            if (MmStart != null)
            {
                MmStart();
            }

            //NetworkManager.singleton.globalConfig.MaxPacketSize = 2500;
        }
        /// <summary>
        /// Invoke MmAwake on listeners.
        /// </summary>
        public virtual void Awake()
        {
            MmLogger.LogResponder(gameObject.name + ": MmNetworkManager Awake");

            Instance = this;

            if (MmAwake != null)
            {
                MmAwake();
            }
        }
Exemple #3
0
 /// <summary>
 /// Handle MmMethod: Refresh
 /// </summary>
 /// <param name="transformList">List of transforms needed in refreshing an MmResponder.</param>
 public virtual void Refresh(List <MmTransform> transformList)
 {
     MmLogger.LogResponder("Refresh called on " + gameObject.name);
 }
Exemple #4
0
 /// <summary>
 /// Handle MmMethod: Initialize
 /// Initialize allows you to provide additional initialization logic
 /// in-between calls to Monobehavior provided Awake() and Start() calls.
 /// </summary>
 public virtual void Initialize()
 {
     MmLogger.LogResponder("Initialize called on " + gameObject.name);
 }
Exemple #5
0
        /// <summary>
        /// Handle MmMethod: SetActive
        /// </summary>
        /// <param name="active">Value of active state.</param>
        public virtual void SetActive(bool active)
        {
            gameObject.SetActive(active);

            MmLogger.LogResponder("SetActive(" + active + ") called on " + gameObject.name);
        }
        /// <summary>
        /// Awake: Invokes MmOnAwakeComplete
        /// </summary>
        public virtual void Awake()
        {
            MmLogger.LogResponder(gameObject.name + " responder awoken.");

            MmOnAwakeComplete();
        }
        /// <summary>
        /// Start: Invokes MmOnStartComplete
        /// </summary>
        public virtual void Start()
        {
            MmLogger.LogResponder(gameObject.name + " responder started.");

            MmOnStartComplete();
        }