예제 #1
0
 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());
     }
 }
예제 #2
0
    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 = "";
        }
    }
예제 #3
0
 void Start()
 {
     sc_playerM = GameObject.Find("Player").GetComponent <PlayerM>();
 }
예제 #4
0
 // Start is called before the first frame update
 void Awake()
 {
     sc_playerC  = GetComponent <PlayerC>();
     sc_playerM  = GetComponent <PlayerM>();
     sc_movement = GetComponent <Movement>();
 }
예제 #5
0
 // Start is called before the first frame update
 void Start()
 {
     sc_humanoidM = GetComponent <HumanoidM>();
     sc_playerM   = GetComponent <PlayerM>();
 }