示例#1
0
        /// <summary>Called by Unity on start of the application and does a setup the PhotonView.</summary>
        protected internal void Awake()
        {
            if (this.ViewID != 0)
            {
                // registration might be too late when some script (on this GO) searches this view BUT GetPhotonView() can search ALL in that case
                PhotonNetwork.RegisterPhotonView(this);
                this.instantiationDataField = PhotonNetwork.FetchInstantiationData(this.InstantiationId);
                this.ownerId = this.ViewID / PhotonNetwork.MAX_VIEW_IDS;
            }

            this.didAwake = true;
        }