}// OnPhotonInstantiate

        /// <summary>
        /// Sends the photon instantiation fsm event to ALL Fsm of the instantiated gameObject AND its children.
        /// </summary>
        void sendPhotonInstantiationFsmEvent()
        {
            if (debug)
            {
                Debug.Log("sending PHOTON INSTANTIATE event to " + this.gameObject.name);
            }
            // set the target to be this gameObject.
            FsmOwnerDefault goTarget = new FsmOwnerDefault();

            goTarget.GameObject       = new FsmGameObject();
            goTarget.GameObject.Value = this.gameObject;
            goTarget.OwnerOption      = OwnerDefaultOption.SpecifyGameObject;

            // send the event to this gameObject and all its children
            FsmEventTarget eventTarget = new FsmEventTarget();

            eventTarget.excludeSelf    = false;
            eventTarget.target         = FsmEventTarget.EventTarget.GameObject;
            eventTarget.gameObject     = goTarget;
            eventTarget.sendToChildren = true;

            // create the event.
            FsmEvent fsmEvent = new FsmEvent("PHOTON / PHOTON INSTANTIATE");

            PlayMakerUtils.SendEventToTarget(null, eventTarget, fsmEvent.Name, null);
        }// sendPhotonInstantiationFsmEvent
예제 #2
0
    void FirePlayMakerEvent(FsmEventData eventData)
    {
//		if (eventData!=null)
//		{
//			HutongGames.PlayMaker.Fsm.EventData = eventData;
//		}

        fsmEventTarget.excludeSelf = false;         // not available in this context, only when even ti sfired from an Fsm.

        fsmEventTarget.sendToChildren = fsmEventSetup.sendtoChildren;

//		if (PlayMakerUGuiSceneProxy.fsm == null)
//		{
//			Debug.LogError("Missing 'PlayMaker UGui' prefab in scene");
//			return;
//		}

        //Fsm _fsm =    PlayMakerUGuiSceneProxy.fsm.Fsm;

        if (debug)
        {
            Debug.Log("Fire event: " + GetEventString());
        }

        //_fsm.Event(fsmEventTarget,GetEventString());

        PlayMakerUtils.SendEventToTarget(PlayMakerUGuiSceneProxy.fsm, fsmEventTarget, GetEventString(), eventData);
    }
    void FirePlayMakerEvent(FsmEventData eventData)
    {
        fsmEventTarget.excludeSelf = false;         // not available in this context, only when even ti sfired from an Fsm.

        fsmEventTarget.sendToChildren = fsmEventSetup.sendtoChildren;

        if (debug)
        {
            Debug.Log("Fire event: " + GetEventString());
        }

        PlayMakerUtils.SendEventToTarget(null, fsmEventTarget, GetEventString(), eventData);
    }
예제 #4
0
        }// OnPhotonInstantiate

        /// <summary>
        /// Sends the photon instantiation fsm event to ALL Fsm of the instantiated gameObject AND its children.
        /// </summary>
        void sendPhotonInstantiationFsmEvent()
        {
            string _fsmEvent = PlayMakerPunLUT.CallbacksEvents[PunCallbacks.OnPhotonInstantiate];

            if (debug)
            {
                Debug.Log("sending " + _fsmEvent + " event to " + this.gameObject.name);
            }

            // set the target to be this gameObject.
            FsmOwnerDefault goTarget = new FsmOwnerDefault();

            goTarget.GameObject       = new FsmGameObject();
            goTarget.GameObject.Value = this.gameObject;
            goTarget.OwnerOption      = OwnerDefaultOption.SpecifyGameObject;

            // send the event to this gameObject and all its children
            FsmEventTarget eventTarget = new FsmEventTarget();

            eventTarget.excludeSelf    = false;
            eventTarget.target         = FsmEventTarget.EventTarget.GameObject;
            eventTarget.gameObject     = goTarget;
            eventTarget.sendToChildren = true;


            // create the event.
            FsmEvent fsmEvent = new FsmEvent(_fsmEvent);

            string _data = "<color=darkblue>" + "ActorNumber" + "</color>=<color=<darkblue>" + _lastCallbackInfo.Sender.ActorNumber + "</color> ";

            _data += "<color=darkblue>" + "NickName" + "</color>=<color=<darkblue>" + _lastCallbackInfo.Sender.NickName + "</color> ";


            Debug.Log("PlayMakerPhotonGameObjectProxy Received Callback <color=fuchsia>" + PunCallbacks.OnPhotonInstantiate + "</color> " +
                      "Broadcasting global Event <color=fuchsia>" + fsmEvent.Name + "</color>\n" +
                      _data
                      , this);

            FsmEventData _d = new FsmEventData();

            _d.StringData = _lastCallbackInfo.Sender.NickName;
            _d.IntData    = _lastCallbackInfo.Sender.ActorNumber;
            PlayMakerUtils.SendEventToTarget(null, eventTarget, fsmEvent.Name, _d);
        }// sendPhotonInstantiationFsmEvent