Exemple #1
0
        internal void OnStartClient()
        {
            m_IsClient = true;
            CacheBehaviours();

            if (LogFilter.logDev)
            {
                Debug.Log("OnStartClient " + gameObject + " GUID:" + netId + " localPlayerAuthority:" + localPlayerAuthority);
            }
            for (int i = 0; i < m_NetworkBehaviours.Length; i++)
            {
                NetworkBehaviour comp = m_NetworkBehaviours[i];
                try
                {
                    comp.PreStartClient(); // generated startup to resolve object references
                    comp.OnStartClient();  // user implemented startup
                }
                catch (Exception e)
                {
                    Debug.LogError("Exception in OnStartClient:" + e.Message + " " + e.StackTrace);
                }
            }
        }