本文整理汇总了C#中InputHandler类的典型用法代码示例。如果您正苦于以下问题:C# InputHandler类的具体用法?C# InputHandler怎么用?C# InputHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InputHandler类属于命名空间,在下文中一共展示了InputHandler类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Awake
void Awake()
{
if (this.inputHandler == null) {
this.inputHandler = this.transform.parent.GetComponent<InputHandler>();
}
this.rigidBody = this.GetComponent<Rigidbody2D>();
}
开发者ID:BrunoRomes,项目名称:UnityTests,代码行数:7,代码来源:CharController.cs
示例2: UpdateState
public override void UpdateState(GameTime time, InputHandler input)
{
if (KeyIsPushed(Keys.Escape))
{
this.EndState();
}
if (KeyIsPushed(Keys.Enter))
{
//activate selected ability
examinedItem.Abilities[abilityNames[selectedIndex]].ItemAction(player);
this.EndState();
}
if (KeyIsPushed(KeyBindings.UP))
{
selectedIndex = (selectedIndex > 0 ? selectedIndex - 1 : abilityNames.Count - 1);
}
if (KeyIsPushed(KeyBindings.DOWN))
{
if (selectedIndex + 1 < abilityNames.Count)
{
selectedIndex++;
}
else
{
selectedIndex = 0;
}
}
}
开发者ID:kjchiu,项目名称:zomgame-2,代码行数:28,代码来源:ItemDetailsState.cs
示例3: Awake
void Awake ()
{
if (Instance){
Destroy(gameObject);
} else {
DontDestroyOnLoad(gameObject);
Instance = this;
}
//Check PlayerPrefs to see if the three main things are saved. If not, set them to default levels.
if(PlayerPrefs.HasKey("Score")){
score = PlayerPrefs.GetFloat("Score");
} else{
score = 0;
}
if(PlayerPrefs.HasKey("CurrentUnlockedLevel")){
currentUnlockedLevel = PlayerPrefs.GetInt("CurrentUnlockedLevel");
} else{
currentUnlockedLevel = 10;
}
if(PlayerPrefs.HasKey("CurrentLevel")){
currentLevel = PlayerPrefs.GetInt("CurrentLevel");
} else {
currentLevel = 0;
}
if(PlayerPrefs.HasKey("Vibrations")){
vibrations = PlayerPrefs.GetInt("Vibrations");
} else {
vibrations = 1;
}
ih = (InputHandler)gameObject.GetComponent(typeof(InputHandler));
}
开发者ID:mpappas86,项目名称:MamaDuck,代码行数:31,代码来源:GameControllerScript.cs
示例4: Start
// Use this for initialization
void Start()
{
stats = player.GetComponent<PlayerStats> ();
lastPos = GetComponent<Transform>().position;
playerInputManager = GameObject.FindGameObjectWithTag("Player").GetComponent<InputHandler>();
}
开发者ID:mprofGamesDev-Dreams,项目名称:dreams,代码行数:8,代码来源:CheckpointManager.cs
示例5: GetTopInteracting
public override DragDropElement GetTopInteracting(InputHandler handler)
{
if (varLink != null)
return varLink.GetElement();
return this;
//throw new NotImplementedException();
}
开发者ID:TheCreatorJames,项目名称:TajTetrisGame,代码行数:7,代码来源:NumberVariableHolder.cs
示例6: GetInteracting
public override DragDropElement GetInteracting(InputHandler handler)
{
if (varLink != null)
return varLink.GetElement().GetInteracting(handler);
else
return this;
}
开发者ID:TheCreatorJames,项目名称:TajTetrisGame,代码行数:7,代码来源:DragDropVariablePlaceholder.cs
示例7: GetInnerMostDragDrop
public DragDropElement GetInnerMostDragDrop(InputHandler handler)
{
if (varLink != null && varLink.GetElement().GetTopInteracting(handler) is DragDropVariablePlaceholder)
return ((DragDropVariablePlaceholder)varLink.GetElement().GetTopInteracting(handler)).GetInnerMostDragDrop(handler);
else
return this;
}
开发者ID:TheCreatorJames,项目名称:TajTetrisGame,代码行数:7,代码来源:DragDropVariablePlaceholder.cs
示例8: RemoteClass
private int sameButtonPushedCount = 0; // tracks the number of times the same button was pushed in a row
#endregion Fields
#region Methods
/// <summary>
/// Starts this instance.
/// </summary>
void IPlugin.Start()
{
//File.AppendAllText(@"c:\AverRmHv.txt", "Start Llamado\n\r");
try
{
rc = new RemoteClass();
rc.Initialize();
rc.OnRemoteData += RecibeDatos;
//string mediaportalpath = AppDomain.CurrentDomain.ApplicationIdentity.FullName;
string mediaportalpath = System.Reflection.Assembly.GetEntryAssembly().FullName;
rc.SwitchBeginAP(mediaportalpath);
Log.Info("AverRMHV Plugin: Started by " + mediaportalpath);
//File.AppendAllText(@"c:\AverRmHv.txt", "Inicialización Correcta. Path = " + mediaportalpath);
}
catch (Exception e)
{
//File.AppendAllText(@"c:\AverRmHv.txt", "Error en Start\n\r");
Log.Error("AverRMHV Plugin: AverRemote.exe not responding");
Log.Error("AverRMHV Plugin: Exception: "+e);
}
inputhandler = new InputHandler(mappingfile);
if (inputhandler == null || !inputhandler.IsLoaded)
{
//File.AppendAllText(@"c:\AverRmHv.txt", "AverRMHV Plugin: File " + mappingfile + " not loaded.\n\r");
Log.Error("AverRMHV Plugin: File " + mappingfile + " not loaded.");
}
lastTimeActionPerformed = DateTime.Now;
lastTimeButtonPushed = DateTime.Now;
Log.Info("AverRMHV Plugin: Started.");
}
开发者ID:mtuton,项目名称:AverRMHV,代码行数:42,代码来源:Class1.cs
示例9: BackupManager
public BackupManager(MultiBoard multiBoard, InputHandler input, HaCreatorStateManager hcsm, HaCreator.ThirdParty.TabPages.PageCollection tabs)
{
this.input = input;
this.multiBoard = multiBoard;
this.hcsm = hcsm;
this.tabs = tabs;
}
开发者ID:kokose1234,项目名称:HaSuite,代码行数:7,代码来源:BackupManager.cs
示例10: Awake
private void Awake()
{
m_collider2D = GetComponent<Collider2D>();
// E-man - Begin
motherShipExplosion = GameObject.Find("MotherShipExplosion");
if (motherShipExplosion)
{
motherShipExplosion.SetActive(false);
}
else
{
Debug.Log("DopHatch::Awake(), Hey buddy! Can't find your explosion guy!");
}
// E-man - End
m_objectState = GetComponent<ObjectState>();
Handler = GameObject.Find("Input Handler");
Ihandler = Handler.GetComponent<InputHandler>();
GameObject go = GameObject.Find("Pod");
m_podRigidbody = go.GetComponent<Rigidbody2D>();
// E-man
as_explosion = GetComponent<AudioSource>();
if(!fire)
{
Debug.Log("DopHatch::Awake(), Hey buddy! Can't seem to find your fire fwiend!");
}
}
开发者ID:Clink92,项目名称:PushTheButtonX,代码行数:33,代码来源:DropHatch.cs
示例11: Game1
public Game1()
{
graphics = new GraphicsDeviceManager(this);
graphics.PreferredBackBufferWidth = 1366;
graphics.PreferredBackBufferHeight = 768;
Content.RootDirectory = "Content";
sb = new SpriteBatch(GraphicsDevice);
input = new InputHandler(this);
this.Components.Add(input);
celAnimationManager = new CelAnimationManager(this);
this.Components.Add(celAnimationManager);
GameManager = new GameStateManager(this);
PlayingState = new PlayingState(this);
PausedState = new PausedState(this);
TitleState = new TitleIntroState(this);
StartMenuState = new StartMenuState(this);
EndState = new EndState(this);
GameManager.ChangeState(TitleState.Value);
//GameManager.ChangeState(PlayingState.Value);
}
开发者ID:guorenxu,项目名称:FoodSpace,代码行数:29,代码来源:Game1.cs
示例12: StandardMelee
public StandardMelee(InputHandler handler)
{
_mousePosition = new Vector2f(500, 500);
CurrentStatus = StatusState.WaitingForPlayers;
uiState = UIStateTypes.Normal;
currentHotkey = null;
currentHotkeySheet = null;
standardHotkeys = Settings.GetSheet("standard_game_mode_controls");
InputHandler = handler;
myId = 0;
map = new TileMap();
allowMinimapCameraMove = true;
selectedUnits = null;
controlGroups = new Dictionary<Keyboard.Key, List<EntityBase>>();
for (int i = 27; i <= 35; i++)
{
controlGroups.Add((Keyboard.Key) i, new List<EntityBase>());
}
controlBoxP1 = new Vector2f(0, 0);
controlBoxP2 = new Vector2f(0, 0);
selectedAttackMove = false;
releaseSelect = false;
CameraPosition = new Vector2f(0, 0);
miniMap = new MiniMap(map, Fog, entities);
//Load Sprites
bottomHUDGUI = new Sprite(ExternalResources.GTexture("Resources/Sprites/HUD/BottomGUI.png"));
alertHUDAlert = new Sprite(ExternalResources.GTexture("Resources/Sprites/HUD/Alert_Alert.png"));
alertHUDUnitCreated = new Sprite(ExternalResources.GTexture("Resources/Sprites/HUD/Alert_UnitCreated.png"));
alertHUDBuildingCreated =
new Sprite(ExternalResources.GTexture("Resources/Sprites/HUD/Alert_BuildingFinished.png"));
avatarWorker = new Sprite(ExternalResources.GTexture("Resources/Sprites/HUD/HUD_AVATAR_WORKER.png"));
hudBoxUnit = new Sprite(ExternalResources.GTexture("Resources/Sprites/HUD/HUD_BOX_Unit.png"));
hudBoxBuilding = new Sprite(ExternalResources.GTexture("Resources/Sprites/HUD/HUD_BOX_Building.png"));
hudControlBox = new Sprite(ExternalResources.GTexture("Resources/Sprites/HUD/ControlGroupBox.png"));
hudControlBox.Origin = new Vector2f(hudControlBox.TextureRect.Width/2, 0);
viewBounds = new Sprite(ExternalResources.GTexture("Resources/Sprites/Hud/ViewBounds.png"));
//Load Sounds
moveSound = new Sound(ExternalResources.GSoundBuffer("Resources/Audio/MoveCommand/0.wav"));
attackMoveSound = new Sound(ExternalResources.GSoundBuffer("Resources/Audio/AttackCommand/0.wav"));
backgroundMusic = new Music("Resources/Audio/Music/In Game/mario.wav");
backgroundMusic.Loop = true;
backgroundMusic.Volume = Settings.MUSICVOLUME;
backgroundMusic.Play();
}
开发者ID:Austech,项目名称:HGlueSim,代码行数:59,代码来源:StandardMelee.cs
示例13: Start
// Up, Down, Left, Right = 0, 1, 2, 3
public virtual void Start ()
{
rb = this.gameObject.GetComponent<Rigidbody> ();
// TileMoving objects should never have physics push them in the y direction, nor should it rotate them.
rb.constraints = RigidbodyConstraints.FreezePositionY | RigidbodyConstraints.FreezeRotation;
GameObject gc = GameObject.FindGameObjectWithTag ("GameController");
ih = (InputHandler)gc.GetComponent(typeof(InputHandler));
}
开发者ID:mpappas86,项目名称:MamaDuck,代码行数:10,代码来源:BaseTileMover.cs
示例14: Update
public void Update(InputHandler handler)
{
foreach(LevelObject obj in objects)
{
obj.SetEditing(false);
obj.Update(handler);
}
}
开发者ID:TheCreatorJames,项目名称:TajTetrisGame,代码行数:8,代码来源:WorldRenderer.cs
示例15: GetInteracting
public override DragDropElement GetInteracting(InputHandler handler)
{
if(handler.CheckMouseIn(holder))
{
return holder.GetInteracting(handler);
}
return this;
}
开发者ID:TheCreatorJames,项目名称:TajTetrisGame,代码行数:8,代码来源:GetVariableDragDrop.cs
示例16: Awake
protected void Awake()
{
controller = this.GetComponent<Prime31.CharacterController2D>();
myPhotonView = this.GetComponent<PhotonView>();
playerInput = this.GetComponent<InputHandler>();
myCollider = this.GetComponent<BoxCollider2D>();
moveState = moveStates.firstJump;
}
开发者ID:jeffreychooper,项目名称:TulipStory,代码行数:8,代码来源:KnightMovement.cs
示例17: Start
void Start()
{
// We set the controller and input handler for this object, as well as calculating the gravity and jump velocity.
controller = GetComponent<Controller2D>();
inputHandler = GetComponent<InputHandler>();
gravity = -(2 * jumpHeight) / Mathf.Pow(timeToJumpApex, 2);
jumpVelocity = Mathf.Abs(gravity) * timeToJumpApex;
}
开发者ID:z2oh,项目名称:cgc-fall-2015,代码行数:8,代码来源:Player.cs
示例18: Awake
protected override void Awake()
{
base.Awake();
m_pod = GetComponent<DropPod>();
Handler = GameObject.Find("Input Handler");
Ihandler = Handler.GetComponent<InputHandler>();
}
开发者ID:Clink92,项目名称:PushTheButtonX,代码行数:8,代码来源:PodState.cs
示例19: Start
void Start()
{
currentPos = transform.position;
currentPos.x = (float)Random.Range (-2, 2);
currentPos.y = (float)Random.Range (-2, 2);
transform.position = currentPos;
boardManager = GameObject.FindGameObjectWithTag ("InputHandler").GetComponent<InputHandler> ();
}
开发者ID:jegan27,项目名称:Orbit,代码行数:9,代码来源:CameraMovement.cs
示例20: Awake
void Awake () {
paused = false;
screen = GameObject.Find("GUIManager/Pause Screen/Layout");
screen.SetActive(false);
gui = GameObject.Find("GUIManager/Velocity_Element");
Handler = GameObject.Find("Input Handler");
Ihandler = Handler.GetComponent<InputHandler>();
levelManager = transform.root.GetComponent<LevelManager>();
}
开发者ID:Clink92,项目名称:PushTheButtonX,代码行数:9,代码来源:PauseMenu.cs
注:本文中的InputHandler类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论