public void Setup(SkillInfo skillInfo, GameObject senderObj, bool canReplace) { this.Inject(); this.skillInfo = skillInfo; this.senderObj = senderObj; abilityTitle.text = skillInfo.Id; itemView.Setup(contentFactory.GetSpriteById(skillInfo.Id)); replaceButton.interactable = canReplace; }
private void SetupMainAbilities() { ClearAbilities(curMainAbilities); abilityMainIcon.Setup(contentFactory.GetSpriteById(userData.GetCurrentCharacter().skill_set.main_skill)); var appConfig = MainContainer.Container.Resolve <AppConfig>(); var availableSkills = appConfig.Skills.Where(s => s.IsEnabled && s.Type == SkillType.Main).ToList(); //TODO: just for test userData.SetSkillConfig(appConfig); foreach (var skill in availableSkills) { AbilityDraggingItem newItem = contentFactory.CreateDraggingAbility(skill, mainAbilityRoot); newItem.SetOneListener(this); curMainAbilities.Add(newItem.gameObject); } }
public override void OnStartState(IStateMachine stateMachine, params object[] args) { base.OnStartState(stateMachine, args); this.Inject(); stateLocker.SetActive(false); _socket = GameObject.FindObjectOfType <SocketIOComponent>(); _socket.On(LobbyEvents.SERVER_UPDATE, OnServerUpdate); _socket.On(LobbyEvents.GAME_UPDATE, OnGameUpdate); _socket.On(LobbyEvents.GAME_STARTED, OnGameStarted); mainAbilityIcon.Setup(contentFactory.GetSpriteById(userData.GetCurrentCharacter().skill_set.main_skill)); var activeSkills = userData.GetCurrentCharacter().skill_set.active_skills; for (int i = 0; i < activeAbilityIcons.Length && i < activeSkills.Length; i++) { activeAbilityIcons[i].Setup(contentFactory.GetSpriteById(activeSkills[i])); } }