Exemplo n.º 1
0
 public VitalsControllerTest()
     : base(
         new DbContextOptionsBuilder <DatabaseContext>()
         .UseSqlite("Filename=Test.db")
         .Options)
 {
     controller = new VitalsController
                      (new DatabaseContext(ContextOptions), new VitalDataHandler());
 }
Exemplo n.º 2
0
 private void Start()
 {
     mItemDatabase     = GameObject.FindGameObjectWithTag("Item Database").GetComponent <ItemDatabase>();
     mMouseLook        = Camera.main.GetComponent <CameraSmooth>();
     mVitalsController = GetComponent <VitalsController>();
     mInventory        = GetComponent <Inventory>();
     mInventory.SetPlayer(this);
     collider.material.dynamicFriction = 0f;
     collider.material.staticFriction  = 0f;
     WeaponInventory = new List <Item>();
 }
Exemplo n.º 3
0
    private void Start()
    {
        mPlayer           = GameObject.FindGameObjectWithTag("Player");
        mPlayerController = mPlayer.GetComponent <PlayerController>();
        mVitalsController = mPlayer.GetComponent <VitalsController>();
        mIsAlive          = true;
        mAgent            = GetComponent <NavMeshAgent>();

        if (!IsStaticZombie && mDestructibleController != null)
        {
            mAgent.SetDestination(mDestructibleController.AttackPosition.position);
        }
    }
Exemplo n.º 4
0
    // Use this for initialization
    private void Start()
    {
        mouseLook        = Camera.main.GetComponent <CameraSmooth>();
        vitalsController = GetComponent <VitalsController>();

        maxSlots = slotsX * slotsY; //finds the current maximum slots

        //Adds null items to both the slots and inventory list, until filled

        for (int i = 0; i < (slotsX * slotsY); i++)
        {
            slots.Add(new Item());
            inventory.Add(new Item());
        }

        //initialize database

        database = GameObject.FindGameObjectWithTag("Item Database").GetComponent <ItemDatabase>();
    }
Exemplo n.º 5
0
    public int thirstyGain;      // How much Thirsty?

    // This is called when pressed in the inventory
    public override void Use()
    {
        VitalsController vitals = GameObject.FindGameObjectWithTag("Player").GetComponent <VitalsController>();

        if (healthGain > 0)
        {
            vitals.Increase(healthGain, "health");
        }

        if (hungerGain > 0)
        {
            vitals.Increase(hungerGain, "hunger");
        }

        if (thirstyGain > 0)
        {
            vitals.Increase(thirstyGain, "thirst");
        }

        Debug.Log(name + " consumed!");

        RemoveFromInventory();          // Remove the item after use
    }
Exemplo n.º 6
0
 private void Start()
 {
     mVitalsController = GetComponent <VitalsController>();
     mPlayerController = GetComponent <PlayerController>();
 }