public VitalsControllerTest() : base( new DbContextOptionsBuilder <DatabaseContext>() .UseSqlite("Filename=Test.db") .Options) { controller = new VitalsController (new DatabaseContext(ContextOptions), new VitalDataHandler()); }
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>(); }
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); } }
// 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>(); }
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 }
private void Start() { mVitalsController = GetComponent <VitalsController>(); mPlayerController = GetComponent <PlayerController>(); }