public ActionResult Create(FormCollection collection) { try { var player = new PlayerM { Name = collection["Name"], LastN = collection["Last Name"], Position = collection["Position"], Income = int.Parse(collection["Income"]), Club = collection["Club"], }; if (player.Save()) { return(RedirectToAction("Index")); } else { return(View(player)); } } catch { return(View()); } }
public void UpdateHUD() { sc_playerM = obj_player.GetComponent <PlayerM>(); //------------------------------Stres Bar--------------------------------------------------------------------- stressBar.fillAmount = sc_playerM.life / sc_playerM.maxStress; //------------------------------DreamCatcher--------------------------------------------------------------------- if (sc_playerM.hasWeapon) { dreamCatcher.GetComponent <Image>().sprite = dreamCatcherSprite[0]; } else { dreamCatcher.GetComponent <Image>().sprite = dreamCatcherSprite[1]; } //------------------------------DreamCatcher bar--------------------------------------------------------------------- if (sc_playerM.hasWeapon) { dreamCatcherBar.GetComponent <Image>().enabled = true; dreamCatcherBar.fillAmount = sc_playerM.useLimit / 20; } else { dreamCatcherBar.GetComponent <Image>().enabled = false; } //-------------------------Hint text------------------------------------------------------------------------------ if (sc_playerM.closeToPuzzle && !sc_playerM.solvingPuzzle) { hintText.text = "E TO INTERACT"; } else if (sc_playerC.obj_Box != null && !Input.GetKey(KeyCode.E)) { hintText.text = "HOLD E TO INTERACT"; } else { hintText.text = ""; } }
void Start() { sc_playerM = GameObject.Find("Player").GetComponent <PlayerM>(); }
// Start is called before the first frame update void Awake() { sc_playerC = GetComponent <PlayerC>(); sc_playerM = GetComponent <PlayerM>(); sc_movement = GetComponent <Movement>(); }
// Start is called before the first frame update void Start() { sc_humanoidM = GetComponent <HumanoidM>(); sc_playerM = GetComponent <PlayerM>(); }