void Eating(int eat, GameObject target) { var vEat = new Eating(); vEat.eat = eat; vEat.i = this.gameObject; target.SendMessage("EatMe", vEat); }
void Start() { aSource = GetComponent<AudioSource>(); player = GameObject.Find("Player").transform; eating = player.GetComponent<Eating>(); agent = GetComponent<NavMeshAgent>(); randomDirection = Random.insideUnitSphere * walkRadius; randomDirection += transform.position; NavMeshHit hit; NavMesh.SamplePosition(randomDirection, out hit, walkRadius, 1); finalPosition = hit.position; agent.SetDestination(finalPosition); }
public LocalObject(LocalShape localShape, string _uniqueName = "", Inventory _inventory = null) { uniqueName = _uniqueName; shape = new ShapeComponent(localShape, this); if (localShape.type == LocalType.Get("Destructible") || localShape.type == LocalType.Get("Container")) { hp = new HPComponent(this); } else if (localShape.type == LocalType.Get("Creature")) { hp = new HPComponent(this); movement = new Movement(this); defence = new Defence(this); attack = new Attack(this); abilities = new Abilities(this); fatigue = new Fatigue(this); eating = new Eating(this); } if (_inventory != null) { inventory = new Inventory(6, 1, "", false, null, this); _inventory.CopyTo(inventory); } }
public LocalObject(string _uniqueName, Race _race, CharacterClass _cclass, Background _background, Origin _origin, int experience) { uniqueName = _uniqueName; race = _race; cclass = _cclass; background = _background; origin = _origin; xp = new Experience(experience, this); skills = new Skills(this); inventory = new Inventory(6, 1, "", true, null, this); hp = new HPComponent(this); movement = new Movement(this); defence = new Defence(this); attack = new Attack(this); abilities = new Abilities(this); fatigue = new Fatigue(this); eating = new Eating(this); }
public EatingController(User user) { this.user = user ?? throw new ArgumentNullException("Пользователь не может быть пустым", nameof(user)); Foods = GetAllFoods(); Eating = GetEating(); }
public void PlayEatingDeActiveAudio() { Eating.Stop(); }
public void PlayEatingActiveAudio() { Eating.Play(); }
/// <summary> /// Create a new EatingController. /// </summary> /// <param name="user"></param> public EatingController(User user) { this.user = user ?? throw new ArgumentNullException("Name of the user can't be empty", nameof(user)); Foods = GetAllFoods(); Eating = GetEating(); }
public EatingController(User user) { this.user = user ?? throw new ArgumentNullException("User can not be null.", nameof(user)); Foods = GetAllFoods(); Eating = GetEating(); }
public EatingController(User user) { Foods = GetAllFoods(); Eating = GetEating(); }
public EatingController(User us) { user = us ?? throw new ArgumentNullException("Поле не может быть пустым", nameof(us)); Foods = GetAllFoods(); Eating = GetEating(); }
public EatingController(User user) { this.user = user ?? throw new ArgumentNullException("Необходимо указать пользователя", nameof(user)); Foods = GetAllFoods(); Eating = GetEating(); }
/// <summary> /// Создание нового контроллера приема пищи. /// </summary> /// <param name="user">Пользователь.</param> public EatingController(User user) { this.user = user ?? throw new ArgumentNullException($"Имя пользователя должно быть заполнено{nameof(user)}"); Foods = GetAllFoods(); Eating = GetEating(); }