// Use this for initialization void Start() { weaponlistcreate(); weaponlist.TryGetValue("Punch", out currentweapon); AnimationControllerScript.weaponselect(currentweapon); maxhealth = 500; health = maxhealth; ammototal = 150; playerspeed = 5f; }
//only has movement at this point private void reload() { AnimationControllerScript.Reload(); Weapon tempholder; weaponlist.TryGetValue(currentweapon.Name, out tempholder); float dif = (tempholder.Ammo - currentweapon.Ammo); currentweapon.Ammo = tempholder.Ammo; ammototal -= dif; //Ui needs to change }
public void newweapon(string newWeaponName) { if (currentweapon.Name == "Punch") { weaponlist.TryGetValue(newWeaponName, out currentweapon); AnimationControllerScript.Weaponselect(currentweapon); } else { //ui message saying e to pick up if (Input.GetKey(KeyCode.F)) { weaponlist.TryGetValue(newWeaponName, out currentweapon); AnimationControllerScript.Weaponselect(currentweapon); } } }
private void Awake() { agent = this.GetComponent <NavMeshAgent>(); currentCooldownLeft = cooldownBetweenRecalculations; animController = GetComponent <AnimationControllerScript>(); }
protected override void Awake() { base.Awake(); agent = this.GetComponent <NavMeshAgent>(); animController = this.GetComponent <AnimationControllerScript>(); }
private void Awake() { waitForSecond = new WaitForSeconds(0.1f); animController = GetComponent <AnimationControllerScript>(); }