• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# PlayMakerFSM类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中PlayMakerFSM的典型用法代码示例。如果您正苦于以下问题:C# PlayMakerFSM类的具体用法?C# PlayMakerFSM怎么用?C# PlayMakerFSM使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PlayMakerFSM类属于命名空间,在下文中一共展示了PlayMakerFSM类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Awake

 void Awake()
 {
     instance = this;
     fsm = this.GetComponent<PlayMakerFSM>();
     score_counter = this.GetComponent<ScoreCounter>();
     previousSectionName = Music.CurrentSection.name;
 }
开发者ID:gunzee2,项目名称:RhythmWars,代码行数:7,代码来源:GameManager.cs


示例2: Start

    // Use this for initialization
    void Start()
    {
        foreach (PlayMakerFSM fsm in PlayMakerFSM.FsmList)
        {
            if (fsm.name == "PetRunFSM")
            {
                PetRunFSM = fsm;
                break;
            }
        }

        //Placeholder for getting the current pet interface
        currentPet = GameObject.Find("Pet").GetComponent(typeof(IPet)) as IPet;

        //Initializes the list of available pet states
        if (PetRunFSM != null)
        {
            GameObject petStates = GameObject.Find("PetStates");
            Object[] oStates = petStates.GetComponents(typeof(PetState));

            foreach (object o in oStates)
            {
                states.Add(o as PetState);
                (o as PetState).SetMyPet(currentPet); //Sets up all the states to refer to the correct IPet script
            }
        }
    }
开发者ID:harjup,项目名称:VirtualPetDungeonRun,代码行数:28,代码来源:PetStateManager.cs


示例3: SendEvent

		public bool SendEvent(PlayMakerFSM fromFsm,PlayMakerEventTarget eventTarget)
		{
			if (fromFsm==null)
			{
				if (FsmEventSender==null)
				{
					FsmEventSender = new GameObject("PlayMaker Send Event Proxy").AddComponent<PlayMakerFSM>();
					FsmEventSender.FsmName = "Send Event Proxy";
					FsmEventSender.FsmDescription = "This Fsm was created at runtime, because a script is willing to send a PlayMaker event but has not specified the Fsm Sender";
				}
				fromFsm = FsmEventSender;
			}

		//	Debug.Log("Sending event <"+eventName+"> from fsm:"+fromFsm.FsmName+" "+eventTarget.eventTarget+" "+eventTarget.gameObject+" "+eventTarget.fsmComponent);

			if (eventTarget.eventTarget == ProxyEventTarget.BroadCastAll)
			{
				PlayMakerFSM.BroadcastEvent(eventName);
			}else if (eventTarget.eventTarget == ProxyEventTarget.Owner || eventTarget.eventTarget == ProxyEventTarget.GameObject)
			{
				PlayMakerUtils.SendEventToGameObject(fromFsm,eventTarget.gameObject,eventName,eventTarget.includeChildren);
			}else if (eventTarget.eventTarget == ProxyEventTarget.FsmComponent)
			{
				eventTarget.fsmComponent.SendEvent(eventName);
			}

			return true;
		}
开发者ID:scumbly,项目名称:Organ-Grinder,代码行数:28,代码来源:PlayMakerEvent.cs


示例4: DoEnableFSM

 private void DoEnableFSM()
 {
     GameObject gameObject = (this.gameObject.OwnerOption != OwnerDefaultOption.UseOwner) ? this.gameObject.GameObject.Value : base.Owner;
     if (gameObject == null)
     {
         return;
     }
     if (!string.IsNullOrEmpty(this.fsmName.Value))
     {
         PlayMakerFSM[] components = gameObject.GetComponents<PlayMakerFSM>();
         PlayMakerFSM[] array = components;
         for (int i = 0; i < array.Length; i++)
         {
             PlayMakerFSM playMakerFSM = array[i];
             if (playMakerFSM.FsmName == this.fsmName.Value)
             {
                 this.fsmComponent = playMakerFSM;
                 break;
             }
         }
     }
     else
     {
         this.fsmComponent = gameObject.GetComponent<PlayMakerFSM>();
     }
     if (this.fsmComponent == null)
     {
         this.LogError("Missing FsmComponent!");
         return;
     }
     this.fsmComponent.enabled = this.enable.Value;
 }
开发者ID:GameDiffs,项目名称:TheForest,代码行数:32,代码来源:EnableFSM.cs


示例5: Awake

    // get the Playmaker Photon proxy fsm.
    void Awake()
    {
        Debug.Log("Player awake");

        // get the photon proxy for Photon Fsm Proxy to send event.
        GameObject go = GameObject.Find("PlayMaker Photon Proxy");

        if (go == null )
        {
            Debug.LogError("Working with photon network require that you add a 'PlayMaker Photon Proxy' component to the gameObject. You can do so from the menu 'PlayMaker Photon/components/Add photon proxy to scene'");
            return;
        }

        // get the proxy to set the debug flag.
         	PlayMakerPhotonProxy _proxy = go.GetComponent<PlayMakerPhotonProxy>();
        if (_proxy!=null)
        {
            debug = _proxy.debug;
        }

        // get the Fsm for reference when sending events.
        fsmProxy = go.GetComponent<PlayMakerFSM>();
        if (fsmProxy==null)
        {
            return;
        }

        _proxy.SanitizeGameObject(this.gameObject);
    }
开发者ID:BrightlineInteractive,项目名称:Pinball,代码行数:30,代码来源:PlayMakerPhotonGameObjectProxy.cs


示例6: DoesTargetImplementsEvent

        public static bool DoesTargetImplementsEvent(PlayMakerFSM fsm, string fsmEvent)
        {
            if (fsm==null)
            {
                return false;
            }

            foreach(FsmTransition _transition in fsm.FsmGlobalTransitions)
            {
                if (_transition.EventName.Equals(fsmEvent))
                {
                    return true;
                }
            }

            foreach(FsmState _state in fsm.FsmStates)
            {

                foreach(FsmTransition _transition in _state.Transitions)
                {

                    if (_transition.EventName.Equals(fsmEvent))
                    {
                        return true;
                    }
                }
            }

            return false;
        }
开发者ID:Daloupe,项目名称:Syzygy_Git,代码行数:30,代码来源:PlayMakerInspectorUtils_Events.cs


示例7: SendEventToGameObject

	public static void SendEventToGameObject(PlayMakerFSM fromFsm,GameObject target,string fsmEvent,bool includeChildren,FsmEventData eventData)
	{
		if (eventData!=null)
		{
			HutongGames.PlayMaker.Fsm.EventData = eventData;
		}
		
		if (fromFsm == null)
		{
			return;
		}
		
		FsmEventTarget _eventTarget = new FsmEventTarget();
		_eventTarget.excludeSelf = false;
		FsmOwnerDefault owner = new FsmOwnerDefault();
		owner.OwnerOption = OwnerDefaultOption.SpecifyGameObject;
		owner.GameObject = new FsmGameObject();
		owner.GameObject.Value = target;
		_eventTarget.gameObject = owner;
		_eventTarget.target = FsmEventTarget.EventTarget.GameObject;	
		
		_eventTarget.sendToChildren = includeChildren;
		
		fromFsm.Fsm.Event(_eventTarget,fsmEvent);
		
		
	}
开发者ID:scumbly,项目名称:Organ-Grinder,代码行数:27,代码来源:PlayMakerUtils_Events.cs


示例8: Start

    void Start()
    {
        FSM = GetComponent<PlayMakerFSM>();

        if( FSM )
            FSMAgent.RegisterFSM( FSM );
    }
开发者ID:nolanfilter,项目名称:MPHorror,代码行数:7,代码来源:FSMController.cs


示例9: Start

	public override void Start()
	{
		base.Start();

		unitFSM = VisObject.GetComponent<PlayMakerFSM> ();
		if (unitFSM == null)
			Debug.LogError ("Missing FSM");
	}
开发者ID:kafedorov89,项目名称:ElectroLab3D_TechShowroom,代码行数:8,代码来源:VisFSM.cs


示例10: Start

 // Use this for initialization
 void Start()
 {
     direction = GameMain.Instance.direction;
     attacking = false;
     weapon.active = false;
     controller = GetComponent<CharacterController>();
     playerFSM = this.GetComponent<PlayMakerFSM>();
 }
开发者ID:nxp040,项目名称:Cat_Game,代码行数:9,代码来源:Player.cs


示例11: Awake

 public virtual void Awake()
 {
     fsm = GetComponent<PlayMakerFSM>();
     if (screen != null)
     {
         screenAnimator = screen.GetComponent<Animator>();
     }
 }
开发者ID:mroslander,项目名称:BoomBalls,代码行数:8,代码来源:ControllerBase.cs


示例12: Start

    void Start()
    {
        _fsm = this.GetComponent<PlayMakerFSM>();

        if (_fsm==null)
        {
            Debug.LogError("No Fsm found",this);
        }
    }
开发者ID:ETGgames,项目名称:PlayMakerCustomActions_U4,代码行数:9,代码来源:playMakerShurikenProxy.cs


示例13: OnGUI_DrawNGuiEventImplementation

	public void OnGUI_DrawNGuiEventImplementation(PlayMakerFSM fsm)
	{
		NGuiEventsToPlaymakerFsmEvents _target = (NGuiEventsToPlaymakerFsmEvents)this.target;
		
		
		bool _noImplementation = true;
		
		foreach (NGuiPlayMakerDelegates _value in Enum.GetValues(typeof(NGuiPlayMakerDelegates)))
		{
			string _fsmEvent = NGuiPlayMakerProxy.GetFsmEventEnumValue(_value);
			
			int _counter = _target.getUsage(_value);
		//	if (Application.isPlaying)
		//	{
				//_fsmEvent  += " "+_target.getUsage(_value);
		//	}
			
			string _feedback = "Not implemented";
			Color _color = Color.white;
			
			if (_target.DoesTargetImplementsEvent(fsm,_fsmEvent))
			{
				_noImplementation = false;
				_feedback = "";
				_color = Color.green;
			}else{ 
				
				if (_target.DoesTargetMissEventImplementation(fsm,_fsmEvent))
				{
					_color = PlayMakerPhotonEditorUtility.lightOrange;
					_feedback = "Not used";
				}
			
				
			}
			if (_counter>0)
			{
				_feedback += " "+_counter.ToString();		
			}
			GUI.color = _color;
			GUILayout.BeginHorizontal("","box",GUILayout.ExpandWidth(true));
				GUI.color = Color.white;
				
				EditorGUILayout.LabelField(_fsmEvent,_feedback);

			GUILayout.EndHorizontal();
			
		}
		
			
			if (_noImplementation)
			{
				EditorGUI.indentLevel = -2;
				EditorGUILayout.HelpBox("The Fsm Target does not implement any NGUI Events. Edit your Fsm to add Global Transitions or State Transitions from 'Custom Events/NGUI'",MessageType.Error);
			}
	}
开发者ID:JulyMars,项目名称:frozen_free_fall,代码行数:56,代码来源:NGuiEventsToPlaymakerFsmEventsInspector.cs


示例14: DoAddToFsmInt

        void DoAddToFsmInt()
        {
            GameObject go = Fsm.GetOwnerDefaultTarget(gameObject);
            if (go == null) return;

            // only get the fsm component if go has changed

            if (go != goLastFrame)
            {
                goLastFrame = go;
                fsm = ActionHelpers.GetGameObjectFsm(go, fsmName.Value);
            }

            if (fsm == null) return;

            FsmInt fsmInt = fsm.FsmVariables.GetFsmInt(variableName.Value);

            if (fsmInt == null) return;

            fsmInt.Value += add.Value;

            if (storeResult != null){
                storeResult.Value = fsmInt.Value;
            }
        }
开发者ID:jeanfabre,项目名称:PlayMakerCustomActions_U4,代码行数:25,代码来源:AddToFsmInt.cs


示例15: DoGetFsmVector2

 private void DoGetFsmVector2()
 {
     if (this.storeValue == null)
     {
         return;
     }
     GameObject ownerDefaultTarget = base.Fsm.GetOwnerDefaultTarget(this.gameObject);
     if (ownerDefaultTarget == null)
     {
         return;
     }
     if (ownerDefaultTarget != this.goLastFrame)
     {
         this.goLastFrame = ownerDefaultTarget;
         this.fsm = ActionHelpers.GetGameObjectFsm(ownerDefaultTarget, this.fsmName.Value);
     }
     if (this.fsm == null)
     {
         return;
     }
     FsmVector2 fsmVector = this.fsm.FsmVariables.GetFsmVector2(this.variableName.Value);
     if (fsmVector == null)
     {
         return;
     }
     this.storeValue.Value = fsmVector.Value;
 }
开发者ID:GameDiffs,项目名称:TheForest,代码行数:27,代码来源:GetFsmVector2.cs


示例16: DoReadBool

    void DoReadBool()
    {
        if (go == null)
            return;

        // only get the fsm component if go has changed
        if (go != goLastFrame)
        {
            goLastFrame = go;
            fsm = ActionHelpers.GetGameObjectFsm(go, fsmName.Value);
        }

        if (fsm == null)
            return;

        FsmBool fsmBool = fsm.FsmVariables.GetFsmBool(variableName.Value);

        if (fsmBool == null)
            return;

        // store in variable if defined
        if(storeValue != null)
            storeValue.Value = fsmBool.Value;

        // send event if not null
        if(IsFalse != null && fsmBool.Value == false)
            Fsm.Event(IsFalse);
        else if(IsTrue != null && fsmBool.Value == true)
            Fsm.Event(IsTrue);
    }
开发者ID:exdev,项目名称:band-of-warriors,代码行数:30,代码来源:ReadBool.cs


示例17: DoFsmStateSwitch

        void DoFsmStateSwitch()
        {
            var go = gameObject.Value;
            if (go == null)
            {
                return;
            }

            if (go != previousGo)
            {
                fsm = ActionHelpers.GetGameObjectFsm(go, fsmName.Value);
                previousGo = go;
            }

            if (fsm == null)
            {
                return;
            }

            var activeStateName = fsm.ActiveStateName;

            for (var i = 0; i < compareTo.Length; i++)
            {
                if (activeStateName == compareTo[i].Value)
                {
                    Fsm.Event(sendEvent[i]);
                    return;
                }
            }
        }
开发者ID:RosalieChang,项目名称:hello,代码行数:30,代码来源:FsmStateSwitch.cs


示例18: DoGetFsmState

        void DoGetFsmState()
        {
            if (fsm == null)
            {
                if (fsmComponent != null)
                {
                    fsm = fsmComponent;
                }
                else
                {
                    var go = Fsm.GetOwnerDefaultTarget(gameObject);
                    if (go != null)
                    {
                        fsm = ActionHelpers.GetGameObjectFsm(go, fsmName.Value);
                    }
                }

                if (fsm == null)
                {
                    storeResult.Value = "";
                    return;
                }
            }

            storeResult.Value = fsm.ActiveStateName;
        }
开发者ID:hughrogers,项目名称:RPGQuest,代码行数:26,代码来源:GetFsmState.cs


示例19: DoSetFsmBool

 private void DoSetFsmBool()
 {
     if (this.setValue == null)
     {
         return;
     }
     GameObject ownerDefaultTarget = base.Fsm.GetOwnerDefaultTarget(this.gameObject);
     if (ownerDefaultTarget == null)
     {
         return;
     }
     if (ownerDefaultTarget != this.goLastFrame)
     {
         this.goLastFrame = ownerDefaultTarget;
         this.fsm = ActionHelpers.GetGameObjectFsm(ownerDefaultTarget, this.fsmName.Value);
     }
     if (this.fsm == null)
     {
         this.LogWarning("Could not find FSM: " + this.fsmName.Value);
         return;
     }
     FsmMaterial fsmMaterial = this.fsm.FsmVariables.GetFsmMaterial(this.variableName.Value);
     if (fsmMaterial != null)
     {
         fsmMaterial.Value = this.setValue.Value;
     }
     else
     {
         this.LogWarning("Could not find variable: " + this.variableName.Value);
     }
 }
开发者ID:GameDiffs,项目名称:TheForest,代码行数:31,代码来源:SetFsmMaterial.cs


示例20: InitFsmVars

        void InitFsmVars()
        {
            var go = Fsm.GetOwnerDefaultTarget(gameObject);
            if (go == null)
            {
                return;
            }

            if (go != cachedGO)
            {
                sourceVariables = new INamedVariable[getVariables.Length];
                targetVariables = new NamedVariable[getVariables.Length];

                for (var i = 0; i < getVariables.Length; i++)
                {
                    var variableName = getVariables[i].variableName;
                    sourceFsm = ActionHelpers.GetGameObjectFsm(go, fsmName.Value);
                    sourceVariables[i] = sourceFsm.FsmVariables.GetVariable(variableName);
                    targetVariables[i] = Fsm.Variables.GetVariable(variableName);
                    getVariables[i].Type = FsmUtility.GetVariableType(targetVariables[i]);

                    if (!string.IsNullOrEmpty(variableName) && sourceVariables[i] == null)
                    {
                        LogWarning("Missing Variable: " + variableName);
                    }

                    cachedGO = go;
                }
            }
        }
开发者ID:OmegaDEVAU,项目名称:Simulator,代码行数:30,代码来源:GetFsmVariables.cs



注:本文中的PlayMakerFSM类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# PlayMode类代码示例发布时间:2022-05-24
下一篇:
C# PlayListType类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap