Example #1
0
    protected NetworkView _Creator(string prefabName, NetworkInstantiateArgs args, NetworkMessageInfo info)
    {
        NetInstance instance = this.Summon(this.proxyPrefab, false, ref args);

        if (instance == null)
        {
            return(null);
        }
        NetworkView networkView = instance.networkView;

        if (networkView == null)
        {
            return(null);
        }
        info = new NetworkMessageInfo(info, networkView);
        NetInstance instance2 = _currentNetInstance;

        try
        {
            _currentNetInstance = instance;
            instance.info       = info;
            instance.prepared   = true;
            instance.local      = args.viewID.isMine;
            bool     didAppend = false;
            IDRemote appended  = null;
            if (instance.local)
            {
                IDRemote localAppend = this.localAppend;
                if (localAppend != null)
                {
                    appended  = DoLocalAppend(localAppend, instance.idMain, this.GetLocalAppendTransform(instance.idMain));
                    didAppend = true;
                }
            }
            instance.zzz___onprecreate();
            this.StandardInitialization(didAppend, appended, instance, networkView, ref info);
            instance.zzz___onpostcreate();
        }
        finally
        {
            _currentNetInstance = instance2;
        }
        return(networkView);
    }
Example #2
0
    protected uLink.NetworkView _Creator(string prefabName, NetworkInstantiateArgs args, uLink.NetworkMessageInfo info)
    {
        NetInstance netInstance = this.Summon(this.proxyPrefab, false, ref args);

        if (!netInstance)
        {
            return(null);
        }
        Facepunch.NetworkView networkView = netInstance.networkView;
        if (!networkView)
        {
            return(null);
        }
        info = new uLink.NetworkMessageInfo(info, networkView);
        NetInstance netInstance1 = NetMainPrefab._currentNetInstance;

        try
        {
            NetMainPrefab._currentNetInstance = netInstance;
            netInstance.info     = info;
            netInstance.prepared = true;
            netInstance.local    = args.viewID.isMine;
            bool     flag    = false;
            IDRemote dRemote = null;
            if (netInstance.local)
            {
                IDRemote dRemote1 = this.localAppend;
                if (dRemote1)
                {
                    dRemote = NetMainPrefab.DoLocalAppend(dRemote1, netInstance.idMain, this.GetLocalAppendTransform(netInstance.idMain));
                    flag    = true;
                }
            }
            netInstance.zzz___onprecreate();
            this.StandardInitialization(flag, dRemote, netInstance, networkView, ref info);
            netInstance.zzz___onpostcreate();
        }
        finally
        {
            NetMainPrefab._currentNetInstance = netInstance1;
        }
        return(networkView);
    }