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

C# PlayerAction类代码示例

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

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



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

示例1: OnExecuteAction

	public void OnExecuteAction ( object[] args )
	{
		if ( MyAction.Name == "Punch" )
		{
			SoundManager.Instance.PlayExecutePunchSound ();
		}
		else if ( MyAction.Name == "Slash" )
		{
			SoundManager.Instance.PlaySlashSound ();
		}
		else if ( MyAction.Name == "Super Slash" )
		{
			SoundManager.Instance.PlaySlash2Sound ();
		}
		else if ( MyAction.Name == "Hyper Slash" )
		{
			SoundManager.Instance.PlaySlash3Sound ();
		}

		ownerPlayer = args[0] as Player;
		MyAction = args[1] as PlayerAction;
		targetPlayer = args[2] as Player;

		this.transform.parent = ownerPlayer.SlashHotzone.transform;
		this.transform.localPosition = new Vector3 ();
		this.transform.localRotation = Quaternion.identity;
		this.transform.localScale = new Vector3 ( 1, 1, 1 );

		OnDoDamaged ( targetPlayer );
	}
开发者ID:FredericNagler1986,项目名称:GGJShamanSmash,代码行数:30,代码来源:SlashEffect.cs


示例2: AdvanceHead

        public override Node AdvanceHead(PlayerAction action)
        {
            Assert.That(action == PlayerAction.Raise || action == PlayerAction.Call);

            if (action == PlayerAction.Raise) return RaiseBranch;
            else return CheckBranch;
        }
开发者ID:JordanFisher,项目名称:Texas-Holdem-Nash-Solver,代码行数:7,代码来源:RaiseCheckNode.cs


示例3: GamepadInControlActionSet

	public GamepadInControlActionSet()
	{
		// Joystick
		Left = CreatePlayerAction("MoveLeft");
		Right = CreatePlayerAction("MoveRight");
		Up = CreatePlayerAction("MoveUp");
		Down = CreatePlayerAction("MoveDown");

		Movement = CreateTwoAxisPlayerAction(Left, Right, Down, Up);

		// Actions
		Jump = CreatePlayerAction("Jump");

		Break = CreatePlayerAction("Break");

		Dash = CreatePlayerAction("Dash");

		Accelerate = CreatePlayerAction("Accelerate");

		Desaccelerate = CreatePlayerAction("desaccelerate");


		// Menu
		Command = CreatePlayerAction("Command");
	}
开发者ID:tzamora,项目名称:superteam,代码行数:25,代码来源:GamepadInControlActionSet.cs


示例4: GetBinding

 /// <summary>
 /// Gets the binding that is specific to the player action.
 /// </summary>
 /// <returns>The binding that is caused by the action.</returns>
 public static Binding GetBinding(PlayerAction action)
 {
     // using tryGetValue here to stop an incorrect index (throws an exception)
     Binding binding;
     binds.TryGetValue(action, out binding);
     return binding;
 }
开发者ID:Garfounkel,项目名称:Simple-Unity3D-Keybinder,代码行数:11,代码来源:InputBinder.cs


示例5: PlayerActions

    public PlayerActions()
        : base()
    {
        L_Left = CreatePlayerAction("Left stick left");
        L_Right = CreatePlayerAction("Left stick right");
        L_Up = CreatePlayerAction("Left stick up");
        L_Down = CreatePlayerAction("Left stick down");

        R_Left = CreatePlayerAction("Right stick left");
        R_Right = CreatePlayerAction("Right stick right");
        R_Up = CreatePlayerAction("Right stick up");
        R_Down = CreatePlayerAction("Right stick down");

        Move = CreateTwoAxisPlayerAction(
            L_Left,
            L_Right,
            L_Down,
            L_Up);

        Look = CreateTwoAxisPlayerAction(
            R_Left,
            R_Right,
            R_Down,
            R_Up);

        Fire = CreatePlayerAction("Fire");
        Join = CreatePlayerAction("Join");
    }
开发者ID:Morac,项目名称:CarThing3,代码行数:28,代码来源:PlayerActions.cs


示例6: PokerAction

 public PokerAction(PlayerMobile actor, PlayerAction action, PokerGameState state, int amountbet)
 {
     PlayerSerial = actor.Serial;
     Type = (int) action;
     State = (int) state;
     Amount = amountbet;
 }
开发者ID:AdamUOF,项目名称:UOFTexasHoldem,代码行数:7,代码来源:PokerAction.cs


示例7: AddKeybind

 /// <summary>
 /// Adds the specified keybind to the specified action.
 /// </summary>
 public static void AddKeybind(PlayerAction action, Binding bind)
 {
     if (binds.ContainsKey(action))
         binds[action] = bind;
     else
         binds.Add(action, bind);
 }
开发者ID:Garfounkel,项目名称:Simple-Unity3D-Keybinder,代码行数:10,代码来源:InputBinder.cs


示例8: PlayerActions

    public PlayerActions()
    {
        this.Skills = new PlayerAction[4];

        this.Shoot = this.CreatePlayerAction( "Shoot" );
        for (int i = 0; i < 4; i++)
        {
            this.Skills[i] = this.CreatePlayerAction( "Skill" + i );
        }

        this.YesOrOk = this.CreatePlayerAction( "Yes" );
        this.NoOrBack = this.CreatePlayerAction ( "No" );

        this.ILeft = this.CreatePlayerAction( "ILeft");
        this.IRight = this.CreatePlayerAction( "IRight");
        this.IUp = this.CreatePlayerAction( "IUp");
        this.IDown = this.CreatePlayerAction( "IDown");

        this.moveUp = this.CreatePlayerAction( "MoveUp" );
        this.moveDown = this.CreatePlayerAction( "MoveDown" );
        this.moveLeft = this.CreatePlayerAction( "MoveLeft" );
        this.moveRight = this.CreatePlayerAction( "MoveRight" );

        this.aimUp = this.CreatePlayerAction( "AimUp" );
        this.aimDown = this.CreatePlayerAction( "AimDown" );
        this.aimRight = this.CreatePlayerAction ( "AimRight" );
        this.aimLeft = this.CreatePlayerAction ( "AimLeft" );

        this.Movement = this.CreateTwoAxisPlayerAction(this.moveLeft, this.moveRight, this.moveDown, this.moveUp);
        this.Aim = this.CreateTwoAxisPlayerAction(this.aimLeft, this.aimRight, this.aimDown, this.aimUp);
    }
开发者ID:Zammy,项目名称:ProjectRevolver,代码行数:31,代码来源:PlayerActions.cs


示例9: InternalThreat

 protected InternalThreat(ThreatType type, ThreatDifficulty difficulty, int health, int speed, int timeAppears, StationLocation currentStation, PlayerAction actionType, ISittingDuck sittingDuck)
     : base(type, difficulty, health, speed, timeAppears, sittingDuck)
 {
     CurrentStation = currentStation;
     sittingDuck.StationByLocation[currentStation].Threats.Add(this);
     ActionType = actionType;
 }
开发者ID:knexer,项目名称:space-alert-resolver,代码行数:7,代码来源:InternalThreat.cs


示例10: HandlePlayerTimings

    /** Checks whether the player was on beat or not **/
    protected void HandlePlayerTimings(PlayerAction playerAction)
    {
        // Only handles timings once per FixedUpdate
        if (timingsHandled)
        {
            return;
        }
        timingsHandled = true;

        TimingsManager.TimingResult result;
        List<int> triggers;
        bool debugWorthShowing = true;
        if (playerAction != PlayerAction.NONE)
        {
            result = timingsManager.checkAttempt(musicAudioSource.time, out triggers);
        }
        else
        {
            // User didn't make an attempt and had missed the timing window
            result = timingsManager.checkForMiss(musicAudioSource.time, out triggers);

            if (result == TimingsManager.TimingResult.NO_BEAT)
            {
                debugWorthShowing = false;
            }
        }

        if (showDebugTimingResults && debugWorthShowing)
        {
            Debug.Log("BaseChoreographer " + Time.time + ": " + result.ToString());
        }

        PlayerTimingResult(result, triggers, playerAction);
    }
开发者ID:Jaween,项目名称:rhythm-vr,代码行数:35,代码来源:BaseChoreographer.cs


示例11: MonkActions

	public MonkActions(InputDevice device)
	{
		spawn0 = CreatePlayerAction ("Spawn0");
		spawn1 = CreatePlayerAction ("Spawn1");
		spawn2 = CreatePlayerAction ("Spawn2");
		spawn3 = CreatePlayerAction ("Spawn3");
		fireTurret = CreatePlayerAction ("FireTurret");
		moveUnitLeft = CreatePlayerAction ("MoveUnitLeft");
		moveUnitRight = CreatePlayerAction ("MoveUnitRight");
		moveHorizontal = CreateOneAxisPlayerAction (moveUnitLeft, moveUnitRight);

		moveUnitUp = CreatePlayerAction ("MoveUnitUp");
		moveUnitDown = CreatePlayerAction ("MoveUnitDown");
		moveVertical = CreateOneAxisPlayerAction (moveUnitDown,moveUnitUp);

		Device = device;

		spawn0.AddDefaultBinding (InputControlType.Action1);
		spawn1.AddDefaultBinding (InputControlType.Action2);
		spawn2.AddDefaultBinding (InputControlType.Action3);
		spawn3.AddDefaultBinding (InputControlType.Action4);
		fireTurret.AddDefaultBinding (InputControlType.RightTrigger);

		moveUnitLeft.AddDefaultBinding (InputControlType.LeftStickLeft);
		moveUnitRight.AddDefaultBinding (InputControlType.LeftStickRight);
		moveUnitUp.AddDefaultBinding (InputControlType.LeftStickUp);
		moveUnitDown.AddDefaultBinding (InputControlType.LeftStickDown);

	}
开发者ID:mirrorfishmedia,项目名称:GGJ2016,代码行数:29,代码来源:MonkActions.cs


示例12: PlayAction

	public bool PlayAction ( Player owner, PlayerAction action, Vector2 point0, Vector2 point1 )
	{
        if (action.Name == "Punch")
        {
            SoundManager.Instance.PlayExecutePunchSound();
        }
        else if (action.Name == "Slash")
        {
            SoundManager.Instance.PlaySlashSound();
        }
        else if (action.Name == "Super Slash")
        {
            SoundManager.Instance.PlaySlash2Sound();
        }
        else if (action.Name == "Hyper Slash")
        {
            SoundManager.Instance.PlaySlash3Sound();
        }

		var targets = Physics2D.OverlapAreaAll ( point0, point1, punchLayer.value );
		bool flag = false;
		foreach ( var target in targets )
		{
			var player = target.GetComponentInParent<Player> ();
			if ( player != null && player != owner )
			{
				flag |= ExecuteAction ( owner, action, player );
			}
		}
		if ( !flag )
		{
			ExecuteAction ( owner, action, null );
		}
		return flag;
	}
开发者ID:FredericNagler1986,项目名称:GGJShamanSmash,代码行数:35,代码来源:PlayerActionManager.cs


示例13: AdvanceHead

        public override Node AdvanceHead(PlayerAction action)
        {
            Assert.That(action == PlayerAction.Call || action == PlayerAction.Fold);

            if (action == PlayerAction.Call) return CallBranch;
            else return null;
        }
开发者ID:JordanFisher,项目名称:Texas-Holdem-Nash-Solver,代码行数:7,代码来源:CallFoldNode.cs


示例14: playerDid

 public void playerDid(PlayerAction pa)
 {
     handlePlayerDid(pa);
     updateState();
     if (Vector3.Distance(transform.position, playeractions.transform.position) < cosyProximity && !sceneFinished)
     {
         switch (state)
         {
             case DateState.HAPPY:
                 print("WE WIN!");
                 playeractions.Win();
                 sceneFinished = true;
                 StartCoroutine(WaitAndProgress(3));
                 break;
             case DateState.NORMAL:
                 Debug.Log("NOOOP");
                 transform.Translate(jumpAwayDistance, 0, 0);
                 break;
             case DateState.UNHAPPY:
                 print("WE LOSE!");
                 playeractions.Lose();
                 transform.Translate(0, 1000, 0);
                 break;
         }
     }
 }
开发者ID:decentninja,项目名称:Bird-Mating-Dancy,代码行数:26,代码来源:AbstractDate.cs


示例15: PlayerActions

 public PlayerActions()
 {
     Left = CreatePlayerAction( "Move Left" );
     Right = CreatePlayerAction( "Move Right" );
     Jump = CreatePlayerAction( "Jump" );
     Shift = CreatePlayerAction ("Kinetic Shift");
     Move = CreateOneAxisPlayerAction (Left, Right);
 }
开发者ID:GilesExcell,项目名称:KineticShift,代码行数:8,代码来源:PlayerActions.cs


示例16: GetGameLogWriterForIteration

        public static IndentedTextWriter GetGameLogWriterForIteration(PlayerAction[] playerActions, int gameCount)
        {
            string fileName = GetFileNameForType(playerActions, gameCount, "GameLog");

            if (fileName == null)
                return null;
            return new IndentedTextWriter(new System.IO.StreamWriter(fileName));
        }
开发者ID:NathanTeeuwen,项目名称:Dominulator,代码行数:8,代码来源:TestWrapper.cs


示例17: ControlsActionSet

 public ControlsActionSet()
 {
     Down = CreatePlayerAction ("Move Down");
     Left = CreatePlayerAction ("Move Left");
     Right = CreatePlayerAction ("Move Right");
     Up = CreatePlayerAction ("Move Up");
     Tap = CreatePlayerAction ("Tap");
 }
开发者ID:rocky1138,项目名称:FocusOnFun,代码行数:8,代码来源:ControlsActionSet.cs


示例18: GetAccelerationFactor

        public static float GetAccelerationFactor(PlayerAction action, CarBehaviour carObj)
        {
            if (action == PlayerAction.SpeedUp)
            {
                return carObj.Speed < 0 ? 10 : 5;
            }

            return action == PlayerAction.SpeedDown ? (carObj.Speed < 0 ? 10 : 50) : 0;
        }
开发者ID:KvanNes,项目名称:Contextproject-Group5,代码行数:9,代码来源:Action.cs


示例19: handlePlayerDid

	public override void handlePlayerDid(PlayerAction pa) {
		switch(pa) {
			case PlayerAction.BACKOFF:
			case PlayerAction.MOVE_FORWARD:
				happyness -= loosingOnMove;
				happyness = Mathf.Max(0, happyness);
				break;
		}
	}
开发者ID:decentninja,项目名称:Bird-Mating-Dancy,代码行数:9,代码来源:Shy.cs


示例20: GetAccelerationIncrease

        public static float GetAccelerationIncrease(PlayerAction action)
        {
            if (action == PlayerAction.SpeedUp)
            {
                return GameData.ACCELERATION_INCREASE;
            }

            return action == PlayerAction.SpeedDown ? GameData.ACCELERATION_DECREASE : 0;
        }
开发者ID:KvanNes,项目名称:Contextproject-Group5,代码行数:9,代码来源:Action.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# PlayerCharacter类代码示例发布时间:2022-05-24
下一篇:
C# Player类代码示例发布时间: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