本文整理汇总了C#中UserInput类的典型用法代码示例。如果您正苦于以下问题:C# UserInput类的具体用法?C# UserInput怎么用?C# UserInput使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UserInput类属于命名空间,在下文中一共展示了UserInput类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: HandleInput
private void HandleInput(UserInput button, InputState state)
{
if (button == UserInput.A && state == InputState.Ingame)
{
m_Jump = true;
}
}
开发者ID:Schadek,项目名称:Skelevator,代码行数:7,代码来源:ThirdPersonUserControl.cs
示例2: HandleInput
protected override void HandleInput(UserInput button, InputState state)
{
//First we need to define if we are inside the ingame screen
if (state == InputState.Ingame)
{
//If the pressed button equals Start we open the menu screen and disable ingame input
if (button == UserInput.Start)
{
StopAllCoroutines();
StartCoroutine(OpenPauseMenu());
}
}
//If we are not then maybe we are inside the menus screen?
else if (state == InputState.PauseMenu)
{
switch (button)
{
case UserInput.Start:
StopAllCoroutines();
StartCoroutine(ClosePauseMenu());
break;
case UserInput.Up:
Up();
break;
case UserInput.Down:
Down();
break;
case UserInput.A:
selectedButton.Invoke();
break;
}
}
}
开发者ID:Schadek,项目名称:Skelevator,代码行数:33,代码来源:MainMenu.cs
示例3: Run
public void Run(UserInput CurrentInput)
{
if(CurrentInput.Args.Length < 2) {
CurrentInput.User.WriteLine(".name <new name>");
return;
}
//TODO: password
User userObj = Server.FindClientByName(CurrentInput.Args[1]);
if (userObj != null && userObj != CurrentInput.User) {//user already logged in
userObj.WriteLine("Logging in from Another Location");
//remove the user object of the newest logged in
//but overwrite with the newest data
//if (userObj.Logon > CurrentInput.User.Logon) {
//input user logged on first
//TODO: always copy over connections but sign the logon data from the oldest...
CurrentInput.User.JoinUser(userObj);
//}
userObj.Room.Users.Remove(userObj);
Server.ClientList.Remove(userObj);
}
if(CurrentInput.User.Login(CurrentInput.Args[1]) == User.LoginResult.ValidLogin) {
CurrentInput.User.WriteLine("You are now logged in as \"" + CurrentInput.User.Name + "\"");
} else if(CurrentInput.User.Login(CurrentInput.Args[1]) == User.LoginResult.OpenUserName) {
//TODO: save user after name change
CurrentInput.User.Name = CurrentInput.Args[1];
CurrentInput.User.WriteLine("Your name has been changed to \"" + CurrentInput.User.Name + "\"");
}
}
开发者ID:blindsight,项目名称:Talker,代码行数:33,代码来源:User.cs
示例4: Post
// POST: api/User
public string Post(UserInput model)
{
string guid = Jobcenter.ResurceKit.RecurceKit.GenereteString(32);
while (db.Companies.Any(c => c.GUID == guid))
{
guid = Jobcenter.ResurceKit.RecurceKit.GenereteString(32);
}
Company CompanyToBeCreated = new Company();
CompanyToBeCreated.CompanySize_FK = model.numberOfEmployees;
CompanyToBeCreated.CompanyType_FK = model.workType;
CompanyToBeCreated.CreatedDate = DateTime.Now;
CompanyToBeCreated.EMail = model.email;
CompanyToBeCreated.FirstName = model.firstName;
CompanyToBeCreated.LastName = model.lastName;
CompanyToBeCreated.Name = model.companyName;
CompanyToBeCreated.P_Number = model.pno;
CompanyToBeCreated.Telephone = model.phone;
CompanyToBeCreated.Cvr = model.cvr;
CompanyToBeCreated.GUID = guid;
db.Companies.Add(CompanyToBeCreated);
db.SaveChanges();
return CompanyToBeCreated.GUID;
}
开发者ID:LokeSonne,项目名称:Jobcenter_old,代码行数:26,代码来源:UserController.cs
示例5: SendInput
public void SendInput(UserInput input)
{
if(isLocalPlayer)
{
CmdSendInputToServer(input);
}
}
开发者ID:steveimc,项目名称:Rawr,代码行数:7,代码来源:PlayerSyncInput.cs
示例6: Start
// Use this for initialization
void Start()
{
showingPauseMenu = false;
pauseMenu.SetActive(false);
p1Input = playerOne.GetComponent<UserInput>();
p2Input = playerTwo.GetComponent<UserInput>();
soundList = GameObject.FindGameObjectsWithTag("Pausable Sound");
}
开发者ID:directusgames,项目名称:OddPong,代码行数:9,代码来源:GameInput.cs
示例7: Post
public ActionResult Post(UserInput SendInfo)
{
User newUser = new User();
newUser.Email = SendInfo.Email;
newUser.SetPassword(SendInfo.Password);
RavenSession.Store(newUser);
return Json(new { success = true });
}
开发者ID:aloneini,项目名称:RaccoonBlog,代码行数:9,代码来源:CreateNewUserController.cs
示例8: btnSave_Click
protected void btnSave_Click(object sender, EventArgs e)
{
Label lblId = modalDialog.FindControl("lblId") as Label;
TextBox txtFullName = modalDialog.FindControl("txtFullName") as TextBox;
TextBox txtEmail = modalDialog.FindControl("txtEmail") as TextBox;
TextBox txtComment = modalDialog.FindControl("txtComment") as TextBox;
TextBox txtPhone = modalDialog.FindControl("txtPhone") as TextBox;
DropDownList ddlRoleType = modalDialog.FindControl("ddlRoleType") as DropDownList;
DropDownList ddlRegion = modalDialog.FindControl("ddlRegion") as DropDownList;
DropDownList ddlArea = modalDialog.FindControl("ddlArea") as DropDownList;
DropDownList ddlCategory = modalDialog.FindControl("ddlCategory") as DropDownList;
DropDownList ddlSchool = modalDialog.FindControl("ddlSchool") as DropDownList;
Label labCustomError = modalDialog.FindControl("labCustomError") as Label;
UserInput input = new UserInput();
input.Id = Convert.ToInt32(lblId.Text);
input.FullName = txtFullName.Text;
input.EMail = txtEmail.Text;
input.Comment = txtComment.Text;
input.Phone = txtPhone.Text;
input.Role = (RoleType)Convert.ToInt32(ddlRoleType.SelectedValue);
if (input.Role == RoleType.RegionAdministrator)
{
Region region = RegionService.GetRegion(ddlRegion.SelectedValue);
input.Area = RegionService.GetArea(region, ddlArea.SelectedValue);
}
if (input.Role == RoleType.AreaJudge | input.Role == RoleType.RegionJudge)
{
input.Area = RegionService.GetArea(ddlArea.SelectedValue);
input.Category = CategoryService.GetCategory(input.Area.Region, ddlCategory.SelectedValue);
}
else if (input.Role == RoleType.Coordinator | input.Role == RoleType.Principal | input.Role == RoleType.Nominee)
{
input.School = RegionService.GetSchool(ddlSchool.SelectedValue);
if (input.Role == RoleType.Nominee)
{
input.Category = CategoryService.GetCategory(input.Area.Region, ddlCategory.SelectedValue);
}
}
MembershipCreateStatus status = UserService.AddNewUser(input);
if (status == MembershipCreateStatus.DuplicateEmail)
{
labCustomError.Text = "The email address is a duplicate, please enter a different email address";
labCustomError.Visible = true;
}
else
{
User user = UserService.GetUser(input.EMail);
if (input.Id <= 0)
{
UserService.SendUserEmail(user, "Sterling Scholar Registration Request", System.Web.HttpContext.Current.Server.MapPath("~/") + "/assets/NewUserTemplate.html");
}
modalDialog.HideModal();
}
}
开发者ID:rjustesen,项目名称:Sterling,代码行数:57,代码来源:Default.aspx.cs
示例9: Run
public void Run(UserInput CurrentInput)
{
if(CurrentInput.Args.Length < 2) {
CurrentInput.User.WriteLine("Usage: emote <text>\n");
return;
}
string output = CurrentInput.User.Name + "" + CurrentInput.Message;
CurrentInput.User.Room.Review.Add(new UserCommuncationBuffer(DateTime.UtcNow, output, CurrentInput.User));
CurrentInput.User.Room.Write(output);
}
开发者ID:blindsight,项目名称:Talker,代码行数:11,代码来源:Speech.cs
示例10: Run
public void Run(UserInput currentInput)
{
string output = "\n";
foreach(KeyValuePair<string, string> colorCode in Server.ColorCodes) {
//TODO: an escape code to show the color code
output += String.Format("{1} VIDEO TEST ~RS\n" ,colorCode.Key, colorCode.Value);
}
currentInput.User.WriteLine(output);
}
开发者ID:blindsight,项目名称:Talker,代码行数:11,代码来源:System.cs
示例11: Start
// Use this for initialization
void Start()
{
userInput = GetComponent<UserInput>();
boostStrength = boostStrength * Physics.gravity.magnitude;
moveStrength = moveStrength * Physics.gravity.magnitude;
maxEnergy = boostStrength * maxBoosts;
if (isDebug) {
energy = 500f;
rigidbody.useGravity = false;
}else{
energy = boostStrength * startBoosts;
}
}
开发者ID:Zerahan,项目名称:Potato,代码行数:14,代码来源:Boost.cs
示例12: Run
public void Run(UserInput CurrentInput)
{
//This assumes that the user has already changed rooms when the look is performed
string output = String.Format("\nRoom: {0}\n\n{1}\n\n", CurrentInput.User.Room.Name, CurrentInput.User.Room.Desc);
if(String.IsNullOrEmpty(CurrentInput.User.Room.Topic)) {
output += "No topic has been set yet.";
} else {
output += String.Format("Current topic: {0}", CurrentInput.User.Room.Topic);
}
CurrentInput.User.WriteLine(output);
}
开发者ID:blindsight,项目名称:Talker,代码行数:13,代码来源:Room.cs
示例13: GetUserInput
public static UserInput GetUserInput()
{
if( s_manager == null ) {
UserInput ui = Component.FindObjectOfType(typeof(UserInput)) as UserInput;
if(ui) {
s_manager = ui;
} else {
GameObject go = new GameObject("UserInput");
ui = go.AddComponent<UserInput>() as UserInput;
s_manager = ui;
}
}
return s_manager;
}
开发者ID:choirdesign,项目名称:onelinerrogue-src,代码行数:14,代码来源:UserInput.cs
示例14: UIButton
public UIButton(Vector2 position, ContentManager content, Button button, bool bDisableOnPause, int index)
{
this.position = position;
this.input = UserInput.GetUserInput();
this.buttonType = button;
this.slot = index;
m_bPaused = false;
SageGame.OnPause += Game_OnPause;
SageGame.OnUnpause += Game_OnUnpause;
LoadContent(content);
//the offsets make up for drop-shaddow on most buttons
mouseSelectionArea = new Rectangle((int)position.X + 11, (int)position.Y, currentTexture.Width - 11, currentTexture.Height - 12);
}
开发者ID:jlfulmer,项目名称:SageScrolls,代码行数:14,代码来源:UIButton.cs
示例15: ResetIdealPosition
private void ResetIdealPosition(UserInput button, InputState state)
{
if (button == UserInput.L1 && state == InputState.Ingame)
{
Vector3 flatVector = transform.position;
flatVector.y = rotationPivot.position.y;
float magnitude = Vector3.Distance(flatVector, rotationPivot.position);
flatVector = -rotationPivot.forward.normalized;
flatVector *= magnitude;
flatVector.y = transform.position.y - rotationPivot.position.y;
transform.position = rotationPivot.position + flatVector;
}
}
开发者ID:Schadek,项目名称:Skelevator,代码行数:15,代码来源:IdealPosition.cs
示例16: Start
void Start () {
players = FindObjectsOfType(typeof(Player)) as Player[];
//ideally this would be from a player selection menu
//but that is beyond what is needed for this demo
foreach(Player player in players) {
if(player.isHuman) humanPlayer = player;
}
hud = transform.root.GetComponent<HUD>();
if(hud) hud.SetHumanPlayer(humanPlayer);
userInput = transform.root.GetComponent<UserInput>();
if(userInput) userInput.enabled = false;
soundManager = FindObjectOfType(typeof(SoundManager)) as SoundManager;
turnManager = transform.root.GetComponent<TurnManager>();
if(turnManager) turnManager.SetPlayers(players);
}
开发者ID:Viure,项目名称:unity-mobile-demo,代码行数:15,代码来源:GameManager.cs
示例17: ApplyInput
void ApplyInput(UserInput input)
{
switch(input)
{
case UserInput.Jump:
heroAnimator.Jump();
break;
case UserInput.Dash:
heroAnimator.Dash();
break;
case UserInput.Crouch:
heroAnimator.Crouch(-10.0f);
break;
case UserInput.CrouchStop:
heroAnimator.Crouch(10.0f);
break;
case UserInput.Attack1:
heroAnimator.Attack(0);
break;
case UserInput.Attack2:
heroAnimator.Attack(1);
break;
case UserInput.Attack3:
heroAnimator.Attack(2);
break;
/*
* case UserInput.ToggleSword:
heroStatus.ToggleSwordFromNetwork();
break;
*/
case UserInput.ToggleSwordON:
heroStatus.ToggleSwordFromNetwork(true);
break;
case UserInput.ToggleSwordOFF:
heroStatus.ToggleSwordFromNetwork(false);
break;
case UserInput.WallJump:
Debug.Log("wall jump");
break;
default:
Debug.LogWarning("Input not recognized");
break;
}
}
开发者ID:steveimc,项目名称:Rawr,代码行数:44,代码来源:PlayerSyncInput.cs
示例18: HandleInput
//For each individual menu there is another override HandleInput function
protected virtual void HandleInput(UserInput button, InputState state)
{
//Although this is obsolete, we check for the title screen input state
if (state == InputState.Title)
{
switch (button)
{
case UserInput.Up:
Up();
break;
case UserInput.Down:
Down();
break;
case UserInput.A:
selectedButton.Invoke();
break;
}
}
}
开发者ID:Schadek,项目名称:Skelevator,代码行数:20,代码来源:BaseMenu.cs
示例19: LogInAs
public static void LogInAs(string username, string password )
{
string currentUser = "";
try
{
currentUser = WebBrowser.CurrentBrowser.Actions.InvokeScript("currentUser");
}
catch (ExecuteCommandException)
{ }
if (!string.Equals(currentUser, username, StringComparison.InvariantCultureIgnoreCase))
{
WebBrowser.CleanUp();
var nav = new Navigation();
nav.GivenIAmOnSomePage("sign in");
var input = new UserInput();
input.GivenIHaveEnteredSomeTestInSomeField(username, "username");
input.GivenIHaveEnteredSomeTestInSomeField(password, "password");
input.WhenIPressSomeButton("sign in");
WebBrowser.CurrentBrowser.WaitForElement(10000, "class=~navbar"); //Give it 5seconds to find header
}
}
开发者ID:shayaneumar,项目名称:gabbar,代码行数:22,代码来源:SessionManagement.cs
示例20: Show_Options
public string[] Show_Options(ItemHandler itemH, int ID, Rectangle rect, UserInput user)
{
int Item_Type = itemH.Get_Type(ID); //Find and store the item type of the passed in item ID
Menu = rect; //Initialize the menu to the passed in rectangle
if(Item_Type == 1) //If the type is 1
{
return Gear_Item_Uses; //Return the item uses string array
}
else if (Item_Type == 2) //If the type is 2
{
return Consumables_Item_Uses; //Return the consumable item uses string array
}
else if (Item_Type == 3) //If the type is 3
{
return Quest_Item_Uses; //Return the quest item uses string array
}
else //For error handling purposes return quest item uses if it has an 'invalid' item type
{
return Quest_Item_Uses; //Return the quest item uses string array
}
}
开发者ID:Josh-Owen,项目名称:Roleplaying-Game-Systems,代码行数:22,代码来源:RightClickItem_Menu.cs
注:本文中的UserInput类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论