void Start() { GetComponent <Button>().onClick.AddListener(Parse); _player = FindObjectOfType <GameState>().Player; _inventoryService = _player.InventoryService; _locationService = _player.LocationService; }
// Use this for initialization void Start() { _locationService = FindObjectOfType <GameState>().Player.LocationService; _dropdown = gameObject.GetComponent <Dropdown>(); _locations = _locationService.GetOpenedLocations(); var optionDatas = new List <Dropdown.OptionData>(); for (int i = 0; i < _locations.Count; i++) { optionDatas.Add(new Dropdown.OptionData(_locations[i].ToString())); } _dropdown.options = optionDatas; _dropdown.value = _locations.IndexOf(_locationService.GetCurrentLocation()); _dropdown.onValueChanged.AddListener(delegate { ValueChanged(); }); }
// Use this for initialization void Start() { MonsterHealthBar = GameObject.Find("MonsterStatus").GetComponentInChildren <SimpleHealthBar>(); var gameState = GameObject.Find("GameState").GetComponent <GameState>(); _player = gameState.Player; _skillService = _player.SkillService; _effectService = _player.EffectService; _resourceManager = FindObjectOfType <ResourceManager>(); _locationService = _player.LocationService; _canvasTransform = GameObject.Find("Canvas").transform; _defaultSkillCooldownBar = DefaultSkillSlot.GetComponentInChildren <SimpleHealthBar>(); _activeSkillCooldownBars = ActiveSkillSlots.Select(s => s.GetComponentInChildren <SimpleHealthBar>()).ToArray(); EventsSubscribe(); _player.Respawn(); _skillService.StartBattle(); NewMonster(); }