本文整理汇总了C#中UserInput类的典型用法代码示例。如果您正苦于以下问题:C# UserInput类的具体用法?C# UserInput怎么用?C# UserInput使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UserInput类属于命名空间,在下文中一共展示了UserInput类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleInput
private void HandleInput(UserInput button, InputState state)
{
if (button == UserInput.A && state == InputState.Ingame)
{
m_Jump = true;
}
}
示例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;
}
}
}
示例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 + "\"");
}
}
示例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;
}
示例5: SendInput
public void SendInput(UserInput input)
{
if(isLocalPlayer)
{
CmdSendInputToServer(input);
}
}
示例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");
}
示例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 });
}
示例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();
}
}
示例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);
}
示例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);
}
示例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;
}
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
}