示例#1
0
        }// Awake

        #region Photon Messages

        /// <summary>
        /// compose this message to dispatch the associated global Fsm Event.
        /// TOFIX: The problem is, It's called before Fsm are instanciated, so I had to implement a slight delay...
        /// </summary>
        public void OnPhotonInstantiate(PhotonMessageInfo info)
        {
            _lastCallbackInfo = info;

            if (debug)
            {
                if (!info.Equals(new PhotonMessageInfo()))
                {
                    if (info.Sender != null)
                    {
                        Debug.Log("PlayMaker Photon proxy:OnPhotonInstantiate " + info.Sender.NickName);
                    }
                    else
                    {
                        Debug.Log("PlayMaker Photon proxy:OnPhotonInstantiate with no sender info");
                    }
                }
                else
                {
                    Debug.Log("PlayMaker Photon proxy:OnPhotonInstantiate with no PhotonMessageInfo");
                }
            }

            // TOFIX: if we found a better solution, I am all up for it... How stable this can be if framerate is low for example?
            Invoke("sendPhotonInstantiationFsmEvent", 0.1f);
        }// OnPhotonInstantiate
    }    // Awake

    #region Photon Messages

    /// <summary>
    /// compose this message to dispatch the associated global Fsm Event.
    /// TOFIX: The problem is, It's called before Fsm are instanciated, so I had to implement a slight delay...
    /// </summary>
    void OnPhotonInstantiate(PhotonMessageInfo info)
    {
        if (debug)
        {
            if (!info.Equals(new PhotonMessageInfo()))
            {
                if (info.sender != null)
                {
                    Debug.Log("PLayMaker Photon proxy:OnPhotonInstantiate " + info.sender.NickName);
                }
                else
                {
                    Debug.Log("PLayMaker Photon proxy:OnPhotonInstantiate with no sender info");
                }
            }
            else
            {
                Debug.Log("PLayMaker Photon proxy:OnPhotonInstantiate with no PhotonMessageInfo");
            }
        }


        if (fsmProxy == null)
        {
            Debug.LogWarning("FsmProxy is null");
            return;
        }

        // TOFIX: if we found a better solution, I am all up for it... How stable this can be if framerate is low for example?
        Invoke("sendPhotonInstantiationFsmEvent", 0.1f);
    }    // OnPhotonInstantiate