Example #1
0
        public GameObject onDataInit(string pid, string oid, FireNode fn, RemoteData v)
        {
            string mePid = PidGeter.getPid();

            if (string.IsNullOrEmpty(mePid))
            {
                throw new NullReferenceException("me Pid is null");
            }
            if (string.Equals(pid, mePid))
            {
                LocalPrefabBundle lob = prefabs.Find(p => { return(string.Equals(p.tag, v.tag)); });
                LocalObject       lo  = lob.prefab.gameObject.scene == null?Instantiate(lob.prefab) : lob.prefab;

                return(center.localRepo.create(lo).gameObject);
            }
            else
            {
                RemotePlayerRepo rpr;
                if (CommRemoteRepo.COMM_PID.Equals(pid))
                {
                    rpr = center.getCommRemoteRepo();
                }
                else if (center.remoteRepos.ContainsKey(pid))
                {
                    rpr = center.remoteRepos[pid];
                }
                else
                {
                    rpr = center.addRemoteRepo(pid);
                }
                rpr.createNewObject(v);
                return(rpr.get(oid).gameObject);
            }
        }
Example #2
0
        public GameObject onDataInit(string pid, string oid, FireNode fn, RemoteData v)
        {
            PrefabBundle pb = getPrefabBundle(v.tag);
            GameObject   go = pb.prefab.scene == null?Instantiate(pb.prefab) : pb.prefab;

            return(go);
        }
 void initAtFire(ObjMap.InitBundle ib)
 {
     node = ib.node;
     setData(ib.data);
     node.addValueChangedListener(_onValueChnaged);
     node.changePostFunc = (onNotifyChangePost);
     node.onRemoveAction = onRemoveAction;
 }
 public void init(string p, string o)
 {
     if (node != null)
     {
         return;
     }
     pid  = p;
     oid  = o;
     node = FirebaseManager.getRepo().get(pid, oid);
     node.addValueChangedListener(onValueChanged);
     node.changePostFunc = (onNotifyChangePost);
 }
 public InitBundle(FireNode node, RemoteData data)
 {
     this.node = node;
     this.data = data;
 }