Beispiel #1
0
    public static NetEntityID.Kind Of(GameObject entity, out NetEntityID entID, out UnityEngine.MonoBehaviour view)
    {
        if (!entity)
        {
            entID = NetEntityID.unassigned;
            view  = null;
            return(NetEntityID.Kind.Missing);
        }
        uLink.NetworkView component = entity.GetComponent <uLink.NetworkView>();
        if (component)
        {
            entID = new NetEntityID(component.viewID);
            view  = component;
            return(NetEntityID.Kind.Net);
        }
        NGCView nGCView = entity.GetComponent <NGCView>();

        if (nGCView)
        {
            entID = new NetEntityID(nGCView);
            view  = nGCView;
            return(NetEntityID.Kind.NGC | NetEntityID.Kind.Net);
        }
        entID = NetEntityID.unassigned;
        view  = null;
        return(NetEntityID.Kind.Missing);
    }
Beispiel #2
0
    public static Kind Of(GameObject entity, out NetEntityID entID, out MonoBehaviour view)
    {
        if (entity == null)
        {
            entID = unassigned;
            view  = null;
            return(Kind.Missing);
        }
        NetworkView component = entity.GetComponent <NetworkView>();

        if (component != null)
        {
            entID = new NetEntityID(component.viewID);
            view  = component;
            return(Kind.Net);
        }
        NGCView view3 = entity.GetComponent <NGCView>();

        if (view3 != null)
        {
            entID = new NetEntityID(view3);
            view  = view3;
            return(Kind.NGC);
        }
        entID = unassigned;
        view  = null;
        return(Kind.Missing);
    }
Beispiel #3
0
 private void cl_predestroy(NGCView view)
 {
     if (this._master != null)
     {
         this._master.CullComponent(this);
     }
 }
Beispiel #4
0
 public NetEntityID(NGCView view)
 {
     this = new NetEntityID();
     if (view != null)
     {
         this.v = view.id;
     }
 }
Beispiel #5
0
 private void Awake()
 {
     this.testView = base.GetComponent <NGCView>();
     if (this.tickSound != null)
     {
         base.InvokeRepeating("TickSound", 0f, 1f);
     }
 }
Beispiel #6
0
 private void Awake()
 {
     this.testView = base.GetComponent<NGCView>();
     if (this.tickSound != null)
     {
         base.InvokeRepeating("TickSound", 0f, 1f);
     }
 }
Beispiel #7
0
    protected internal virtual void OnOwnedByMasterStructure(StructureMaster master)
    {
        this._master = master;
        NGCView component = base.GetComponent <NGCView>();

        if (((component != null) && !this.addedDestroyCallback) && (component != null))
        {
            this.addedDestroyCallback = true;
            component.OnPreDestroy   += new NGC.EventCallback(this.cl_predestroy);
        }
    }
Beispiel #8
0
 public static bool ContextOf(NGCView networkView, out Contextual contextual)
 {
     return(GetMB(networkView, out contextual));
 }
Beispiel #9
0
 private void NGC_OnInstantiate(NGCView view)
 {
     this.myID     = NetEntityID.Get(this);
     this._resTarg = base.GetComponent <ResourceTarget>();
 }
 private void cl_predestroy(NGCView view)
 {
     if (this._master)
     {
         this._master.CullComponent(this);
     }
 }
Beispiel #11
0
 private void NGC_OnInstantiate(NGCView view)
 {
     this.myID     = NetEntityID.Get((UnityEngine.MonoBehaviour) this);
     this._resTarg = base.GetComponent <ResourceTarget>();
 }
Beispiel #12
0
 private void NGC_OnInstantiate(NGCView view)
 {
     this.myID = NetEntityID.Get(this);
     this._resTarg = base.GetComponent<ResourceTarget>();
 }