Node.NodeState Reload() { Gun.Assembly.GunAssemblyState state = gun.CheckGun(); if (state == Gun.Assembly.GunAssemblyState.MAGAZINE_EMPTY) { Debug.Log(name + " Start Reload"); gun.ReloadGun(); return(Node.NodeState.RUNNING); } else if (state == Gun.Assembly.GunAssemblyState.RELOADING) { Debug.Log(name + " Reloading"); return(Node.NodeState.RUNNING); } else if (state == Gun.Assembly.GunAssemblyState.OK) { Debug.Log(name + " Reload => SUCCESS"); return(Node.NodeState.SUCCESS); } else { Debug.Log(name + " Reload => FAILED with " + state); return(Node.NodeState.FAILED); } }
bool ShouldReload() { Gun.Assembly.GunAssemblyState state = gun.CheckGun(); if (state == Gun.Assembly.GunAssemblyState.MAGAZINE_EMPTY) { return(true); } else { return(false); } }
bool IsMagazineNotEmpty() { Gun.Assembly.GunAssemblyState state = gun.CheckGun(); if (state == Gun.Assembly.GunAssemblyState.MAGAZINE_EMPTY) { //Debug.Log(name + " Magazine empty"); _isFiring = false; gun.StopFire(); return(false); } else { //Debug.Log(name + " Magazine not empty"); return(true); } }