public void Init() { _gameplayManager = GameClient.Get <IGameplayManager>(); _tutorialManager = GameClient.Get <ITutorialManager>(); _actionsQueueController = _gameplayManager.GetController <ActionsQueueController>(); _abilitiesController = _gameplayManager.GetController <AbilitiesController>(); _vfxController = _gameplayManager.GetController <VfxController>(); FillStrongersAndWeakers(); }
public void Init() { _activeAbilities = new List <ActiveAbility>(); _gameplayManager = GameClient.Get <IGameplayManager>(); _tutorialManager = GameClient.Get <ITutorialManager>(); _cardsController = _gameplayManager.GetController <CardsController>(); _playerController = _gameplayManager.GetController <PlayerController>(); _battlegroundController = _gameplayManager.GetController <BattlegroundController>(); _actionsQueueController = _gameplayManager.GetController <ActionsQueueController>(); }
public void Init() { _loadObjectsManager = GameClient.Get <ILoadObjectsManager>(); _gameplayManager = GameClient.Get <IGameplayManager>(); _tutorialManager = GameClient.Get <ITutorialManager>(); _uiManager = GameClient.Get <IUIManager>(); _timerManager = GameClient.Get <ITimerManager>(); _soundManager = GameClient.Get <ISoundManager>(); _vfxController = _gameplayManager.GetController <VfxController>(); _battleController = _gameplayManager.GetController <BattleController>(); _actionsQueueController = _gameplayManager.GetController <ActionsQueueController>(); _cardsController = _gameplayManager.GetController <CardsController>(); _gameplayManager.GameEnded += GameplayManagerGameEnded; }
public void Init() { _gameplayManager = GameClient.Get <IGameplayManager>(); _timerManager = GameClient.Get <ITimerManager>(); _battlegroundController = _gameplayManager.GetController <BattlegroundController>(); }
private async void NextStepCommonEndActions() { _currentTutorialStepIndex++; CurrentTutorialDataStep = _tutorialSteps[_currentTutorialStepIndex]; UpdateTutorialVisual(); _soundManager.StopPlaying(Enumerators.SoundType.TUTORIAL); if (CurrentTutorialDataStep.HasDelayToPlaySound) { GameClient.Get <ITimerManager>().AddTimer( x => { _soundManager.PlaySound(Enumerators.SoundType.TUTORIAL, CurrentTutorialDataStep.SoundName, Constants.TutorialSoundVolume, false); }, null, CurrentTutorialDataStep.DelayToPlaySound); } else { _soundManager.PlaySound(Enumerators.SoundType.TUTORIAL, CurrentTutorialDataStep.SoundName, Constants.TutorialSoundVolume, false); } if (CurrentTutorialDataStep.IsLaunchAIBrain) { await _gameplayManager.GetController <AIController>().LaunchAIBrain(); } }
public BoardCard(GameObject selfObject) { LoadObjectsManager = GameClient.Get <ILoadObjectsManager>(); SoundManager = GameClient.Get <ISoundManager>(); DataManager = GameClient.Get <IDataManager>(); GameplayManager = GameClient.Get <IGameplayManager>(); TimerManager = GameClient.Get <ITimerManager>(); CardsController = GameplayManager.GetController <CardsController>(); AbilitiesController = GameplayManager.GetController <AbilitiesController>(); BattlegroundController = GameplayManager.GetController <BattlegroundController>(); GameObject = selfObject; ElementSlotsOfCards = new List <ElementSlotOfCards>(); CardAnimator = GameObject.GetComponent <Animator>(); CardAnimator.enabled = false; GlowSprite = Transform.Find("Glow").GetComponent <SpriteRenderer>(); PictureSprite = Transform.Find("Picture").GetComponent <SpriteRenderer>(); BackgroundSprite = Transform.Find("Frame").GetComponent <SpriteRenderer>(); CostText = Transform.Find("GooText").GetComponent <TextMeshPro>(); NameText = Transform.Find("TitleText").GetComponent <TextMeshPro>(); BodyText = Transform.Find("BodyText").GetComponent <TextMeshPro>(); AmountText = Transform.Find("Amount/Text").GetComponent <TextMeshPro>(); RemoveCardParticle = Transform.Find("RemoveCardParticle").GetComponent <ParticleSystem>(); DistibuteCardObject = Transform.Find("DistributeCardObject").gameObject; ParentOfEditingGroupUI = Transform.Find("DeckEditingGroupUI"); AnimationEventTriggering = GameObject.GetComponent <AnimationEventTriggering>(); BehaviourHandler = GameObject.GetComponent <OnBehaviourHandler>(); AnimationEventTriggering.AnimationEventTriggered += OnAnimationEvent; CardsController.UpdateCardsStatusEvent += UpdateCardsStatusEventHandler; BehaviourHandler.MouseDownTriggered += MouseDownTriggeredHandler; BehaviourHandler.MouseUpTriggered += MouseUpTriggeredHandler; BehaviourHandler.Destroying += DestroyingHandler; }
public void Init() { _timerManager = GameClient.Get <ITimerManager>(); _soundManager = GameClient.Get <ISoundManager>(); _loadObjectsManager = GameClient.Get <ILoadObjectsManager>(); _gameplayManager = GameClient.Get <IGameplayManager>(); _particlesController = _gameplayManager.GetController <ParticlesController>(); }
public BoardSkill(GameObject obj, Player player, HeroSkill skillInfo, bool isPrimary) { SelfObject = obj; Skill = skillInfo; Owner = player; IsPrimary = isPrimary; _initialCooldown = skillInfo.InitialCooldown; _cooldown = skillInfo.Cooldown; _loadObjectsManager = GameClient.Get <ILoadObjectsManager>(); _gameplayManager = GameClient.Get <IGameplayManager>(); _tutorialManager = GameClient.Get <ITutorialManager>(); _playerController = _gameplayManager.GetController <PlayerController>(); _skillsController = _gameplayManager.GetController <SkillsController>(); _boardArrowController = _gameplayManager.GetController <BoardArrowController>(); _glowObjectSprite = SelfObject.transform.Find("Glow").GetComponent <SpriteRenderer>(); _glowObjectSprite.gameObject.SetActive(false); _cooldownText = SelfObject.transform.Find("SpellCost/SpellCostText").GetComponent <TextMeshPro>(); string name = isPrimary ? "1stShutters" : "2ndtShutters"; _shutterAnimator = SelfObject.transform.parent.transform .Find("OverlordArea/RegularModel/CZB_3D_Overlord_death_regular_LOD0/" + name).GetComponent <Animator>(); _shutterAnimator.enabled = false; _shutterAnimator.StopPlayback(); Owner.TurnStarted += TurnStartedHandler; Owner.TurnEnded += TurnEndedHandler; _behaviourHandler = SelfObject.GetComponent <OnBehaviourHandler>(); { _pointerEventSolver = new PointerEventSolver(); _pointerEventSolver.DragStarted += PointerSolverDragStartedHandler; _pointerEventSolver.Clicked += PointerEventSolverClickedHandler; _pointerEventSolver.Ended += PointerEventSolverEndedHandler; } _cooldownText.text = _cooldown.ToString(); _fightTargetingArrowPrefab = _loadObjectsManager.GetObjectByPath <GameObject>("Prefabs/Gameplay/Arrow/AttackArrowVFX_Object"); }
public HandBoardCard(GameObject selfObject, BoardCard boardCard) { GameObject = selfObject; CardView = boardCard; _gameplayManager = GameClient.Get <IGameplayManager>(); _soundManager = GameClient.Get <ISoundManager>(); _tutorialManager = GameClient.Get <ITutorialManager>(); _playerController = _gameplayManager.GetController <PlayerController>(); _cardsController = _gameplayManager.GetController <CardsController>(); _behaviourHandler = GameObject.GetComponent <OnBehaviourHandler>(); _behaviourHandler.MouseUpTriggered += MouseUp; _behaviourHandler.Updating += UpdatingHandler; }
public void Init() { _gameplayManager = GameClient.Get <IGameplayManager>(); _dataManager = GameClient.Get <IDataManager>(); _tutorialManager = GameClient.Get <ITutorialManager>(); _timerManager = GameClient.Get <ITimerManager>(); _cardsController = _gameplayManager.GetController <CardsController>(); _battlegroundController = _gameplayManager.GetController <BattlegroundController>(); _boardArrowController = _gameplayManager.GetController <BoardArrowController>(); _gameplayManager.GameStarted += GameStartedHandler; _gameplayManager.GameEnded += GameEndedHandler; _pointerEventSolver = new PointerEventSolver(); _pointerEventSolver.DragStarted += PointerSolverDragStartedHandler; _pointerEventSolver.Clicked += PointerEventSolverClickedHandler; _pointerEventSolver.Ended += PointerEventSolverEndedHandler; }
public void Init() { _gameplayManager = GameClient.Get <IGameplayManager>(); _dataManager = GameClient.Get <IDataManager>(); _tutorialManager = GameClient.Get <ITutorialManager>(); _loadObjectsManager = GameClient.Get <ILoadObjectsManager>(); _abilitiesController = _gameplayManager.GetController <AbilitiesController>(); _battlegroundController = _gameplayManager.GetController <BattlegroundController>(); _cardsController = _gameplayManager.GetController <CardsController>(); _actionsQueueController = _gameplayManager.GetController <ActionsQueueController>(); _skillsController = _gameplayManager.GetController <SkillsController>(); _gameplayManager.GameEnded += GameEndedHandler; _gameplayManager.GameStarted += GameStartedHandler; _normalUnitCardInHand = new List <WorkingCard>(); _normalSpellCardInHand = new List <WorkingCard>(); }
private void SetupOverlordsAsSpecific(SpecificBattlegroundInfo specificBattlegroundInfo) { _gameplayManager.OpponentPlayer.Health = specificBattlegroundInfo.OpponentInfo.Health; _gameplayManager.OpponentPlayer.GooOnCurrentTurn = specificBattlegroundInfo.OpponentInfo.MaximumGoo; _gameplayManager.OpponentPlayer.Goo = specificBattlegroundInfo.OpponentInfo.CurrentGoo; _gameplayManager.GetController <AIController>().SetAiType(specificBattlegroundInfo.OpponentInfo.AiType); _gameplayManager.CurrentPlayer.Health = specificBattlegroundInfo.PlayerInfo.Health; _gameplayManager.CurrentPlayer.GooOnCurrentTurn = specificBattlegroundInfo.PlayerInfo.MaximumGoo; _gameplayManager.CurrentPlayer.Goo = specificBattlegroundInfo.PlayerInfo.CurrentGoo; }
public void Init() { _gameplayManager = GameClient.Get <IGameplayManager>(); _timerManager = GameClient.Get <ITimerManager>(); _soundManager = GameClient.Get <ISoundManager>(); _dataManager = GameClient.Get <IDataManager>(); _tutorialManager = GameClient.Get <ITutorialManager>(); _uiManager = GameClient.Get <IUIManager>(); _playerManager = GameClient.Get <IPlayerManager>(); _playerController = _gameplayManager.GetController <PlayerController>(); _cardsController = _gameplayManager.GetController <CardsController>(); _aiController = _gameplayManager.GetController <AIController>(); _cardsInDestroy = new List <BoardUnit>(); _gameplayManager.GameEnded += GameEndedHandler; _gameplayManager.GameInitialized += OnGameInitializedHandler; }
public void Init() { _gameplayManager = GameClient.Get <IGameplayManager>(); _timerManager = GameClient.Get <ITimerManager>(); _loadObjectsManager = GameClient.Get <ILoadObjectsManager>(); _dataManager = GameClient.Get <IDataManager>(); _soundManager = GameClient.Get <ISoundManager>(); _tutorialManager = GameClient.Get <ITutorialManager>(); _uiManager = GameClient.Get <IUIManager>(); _battlegroundController = _gameplayManager.GetController <BattlegroundController>(); _vfxController = _gameplayManager.GetController <VfxController>(); _abilitiesController = _gameplayManager.GetController <AbilitiesController>(); _actionsQueueController = _gameplayManager.GetController <ActionsQueueController>(); _animationsController = _gameplayManager.GetController <AnimationsController>(); _ranksController = _gameplayManager.GetController <RanksController>(); CreatureCardViewPrefab = _loadObjectsManager.GetObjectByPath <GameObject>("Prefabs/Gameplay/Cards/CreatureCard"); SpellCardViewPrefab = _loadObjectsManager.GetObjectByPath <GameObject>("Prefabs/Gameplay/Cards/SpellCard"); OpponentCardPrefab = _loadObjectsManager.GetObjectByPath <GameObject>("Prefabs/Gameplay/Cards/OpponentCard"); _gameplayManager.GameStarted += GameStartedHandler; _gameplayManager.GameEnded += GameEndedHandler; _indexOfCard = -1; }
public AbilityBase(Enumerators.CardKind cardKind, AbilityData ability) { LoadObjectsManager = GameClient.Get <ILoadObjectsManager>(); GameplayManager = GameClient.Get <IGameplayManager>(); DataManager = GameClient.Get <IDataManager>(); TimerManager = GameClient.Get <ITimerManager>(); SoundManager = GameClient.Get <ISoundManager>(); AbilitiesController = GameplayManager.GetController <AbilitiesController>(); ParticlesController = GameplayManager.GetController <ParticlesController>(); BattleController = GameplayManager.GetController <BattleController>(); ActionsQueueController = GameplayManager.GetController <ActionsQueueController>(); BattlegroundController = GameplayManager.GetController <BattlegroundController>(); CardsController = GameplayManager.GetController <CardsController>(); AbilityData = ability; CardKind = cardKind; AbilityActivityType = ability.AbilityActivityType; AbilityCallType = ability.AbilityCallType; AbilityTargetTypes = ability.AbilityTargetTypes; AbilityEffectType = ability.AbilityEffectType; _playerAvatar = GameplayManager.CurrentPlayer; _opponenentAvatar = GameplayManager.OpponentPlayer; PermanentInputEndEvent += InputEndedHandler; ParticleIds = new List <ulong>(); }
public ReportViewBase(GameObject prefab, Transform parent, GameActionReport gameAction) { LoadObjectsManager = GameClient.Get <ILoadObjectsManager>(); GameplayManager = GameClient.Get <IGameplayManager>(); ActionsQueueController = GameplayManager.GetController <ActionsQueueController>(); CardsController = GameplayManager.GetController <CardsController>(); GameAction = gameAction; SelfObject = Object.Instantiate(prefab, parent, false); SelfObject.transform.SetSiblingIndex(0); PreviewImage = SelfObject.transform.Find("Image").GetComponent <Image>(); OnBehaviourHandler behaviour = SelfObject.GetComponent <OnBehaviourHandler>(); behaviour.PointerEntered += PointerEnteredHandler; behaviour.PointerExited += PointerExitedHandler; PlayerAvatarPreviewPrefab = LoadObjectsManager.GetObjectByPath <GameObject>("Prefabs/Gameplay/PlayerAvatarPreview"); AttackingHealthPrefab = LoadObjectsManager.GetObjectByPath <GameObject>("Prefabs/Gameplay/AttackingHealth"); CreatePreviewPanel(); }
protected void Init() { GameplayManager = GameClient.Get <IGameplayManager>(); TutorialManager = GameClient.Get <ITutorialManager>(); BoardArrowController = GameplayManager.GetController <BoardArrowController>(); InputController = GameplayManager.GetController <InputController>(); _selfObject = gameObject; TargetObjectsGroup = _selfObject.transform.Find("Group_TargetObjects").gameObject; RootObjectsGroup = _selfObject.transform.Find("Arrow/Group_RootObjects").gameObject; ArrowObject = _selfObject.transform.Find("Arrow").gameObject; TargetColliderObject = _selfObject.transform.Find("Target_Collider").gameObject; if (_isInverse) { _selfObject.transform.localScale = new Vector3(-1, 1, 1); } InputController.PlayerSelectingEvent += PlayerSelectingEventHandler; InputController.UnitSelectingEvent += UnitSelectingEventHandler; InputController.NoObjectsSelectedEvent += NoObjectsSelectedEventHandler; }
private void ApplyInfoAboutHeroes(Hero player, Hero opponent) { _playerOverlordNameText.text = player.Name.ToUpper(); _opponentOverlordNameText.text = opponent.Name.ToUpper(); _playerOverlordPicture.sprite = _loadObjectsManager.GetObjectByPath <Sprite>("Images/Heroes/hero_" + player.Element.ToLower()); _opponentOverlordPicture.sprite = _loadObjectsManager.GetObjectByPath <Sprite>("Images/Heroes/hero_" + opponent.Element.ToLower()); _playerOverlordPicture.SetNativeSize(); _opponentOverlordPicture.SetNativeSize(); DoAnimationOfWhoseTurn(); _timerManager.AddTimer( x => { _selfAnimator.SetTrigger("Exit"); _timerManager.AddTimer( y => { _uiManager.HidePopup <PlayerOrderPopup>(); _gameplayManager.GetController <PlayerController>().SetHand(); _gameplayManager.GetController <CardsController>().StartCardDistribution(); }, null, 1.2f); }, null, 6f); }
public void Init() { _uiManager = GameClient.Get <IUIManager>(); _soundManager = GameClient.Get <ISoundManager>(); _loadObjectsManager = GameClient.Get <ILoadObjectsManager>(); _dataManager = GameClient.Get <IDataManager>(); _gameplayManager = GameClient.Get <IGameplayManager>(); _battlegroundController = _gameplayManager.GetController <BattlegroundController>(); // card vs player _targettingArrowPrefab = GameClient.Get <ILoadObjectsManager>().GetObjectByPath <GameObject>("Prefabs/Gameplay/Arrow/AttackArrowVFX_Object"); _tutorials = JsonConvert.DeserializeObject <TutorialContentData>(_loadObjectsManager .GetObjectByPath <TextAsset>("Data/tutorial_data").text).TutorialDatas; }
public ReportPanelItem(GameObject gameObject) { ILoadObjectsManager loadObjectsManager = GameClient.Get <ILoadObjectsManager>(); IGameplayManager gameplayManager = GameClient.Get <IGameplayManager>(); _actionsQueueController = gameplayManager.GetController <ActionsQueueController>(); _allReports = new List <ReportViewBase>(); _selfPanel = gameObject.transform.Find("Viewport/CardGraveyard").gameObject; _reportGroup = _selfPanel.GetComponent <VerticalLayoutGroup>(); _playedCardPrefab = loadObjectsManager.GetObjectByPath <GameObject>("Prefabs/UI/Elements/GraveyardCardPreview"); _actionsQueueController.GotNewActionReportEvent += GotNewActionReportEventHandler; _reportGroup.padding.top = 0; }
public BoardUnit(Transform parent) { _gameplayManager = GameClient.Get <IGameplayManager>(); _loadObjectsManager = GameClient.Get <ILoadObjectsManager>(); _soundManager = GameClient.Get <ISoundManager>(); _tutorialManager = GameClient.Get <ITutorialManager>(); _timerManager = GameClient.Get <ITimerManager>(); _battlegroundController = _gameplayManager.GetController <BattlegroundController>(); _playerController = _gameplayManager.GetController <PlayerController>(); _animationsController = _gameplayManager.GetController <AnimationsController>(); _battleController = _gameplayManager.GetController <BattleController>(); _actionsQueueController = _gameplayManager.GetController <ActionsQueueController>(); _vfxController = _gameplayManager.GetController <VfxController>(); _ranksController = _gameplayManager.GetController <RanksController>(); _abilitiesController = _gameplayManager.GetController <AbilitiesController>(); _cardsController = _gameplayManager.GetController <CardsController>(); _inputController = _gameplayManager.GetController <InputController>(); _boardArrowController = _gameplayManager.GetController <BoardArrowController>(); GameObject = Object.Instantiate(_loadObjectsManager.GetObjectByPath <GameObject>("Prefabs/Gameplay/BoardCreature")); GameObject.transform.SetParent(parent, false); _fightTargetingArrowPrefab = _loadObjectsManager.GetObjectByPath <GameObject>("Prefabs/Gameplay/Arrow/AttackArrowVFX_Object"); _pictureSprite = GameObject.transform.Find("CreaturePicture").GetComponent <SpriteRenderer>(); _frozenSprite = GameObject.transform.Find("Other/Frozen").GetComponent <SpriteRenderer>(); _glowSprite = GameObject.transform.Find("Other/Glow").GetComponent <SpriteRenderer>(); _shieldSprite = GameObject.transform.Find("Other/Shield").gameObject; _glowSelectedObjectSprite = GameObject.transform.Find("Other/GlowSelectedObject").gameObject; _attackText = GameObject.transform.Find("Other/AttackAndDefence/AttackText").GetComponent <TextMeshPro>(); _healthText = GameObject.transform.Find("Other/AttackAndDefence/DefenceText").GetComponent <TextMeshPro>(); _sleepingParticles = GameObject.transform.Find("Other/SleepingParticles").GetComponent <ParticleSystem>(); _unitContentObject = GameObject.transform.Find("Other").gameObject; _unitContentObject.SetActive(false); _inputController.UnitSelectedEvent += UnitSelectedEventHandler; _inputController.UnitDeselectedEvent += UnitDeselectedEventHandler; BuffsOnUnit = new List <Enumerators.BuffType>(); AttackedBoardObjectsThisTurn = new List <object>(); _glowSprite.gameObject.SetActive(true); _glowSprite.enabled = false; IsCreatedThisTurn = true; UnitStatus = Enumerators.UnitStatusType.NONE; IsAllAbilitiesResolvedAtStart = true; _gameplayManager.CanDoDragActions = false; }
public Player(GameObject playerObject, bool isOpponent) { PlayerObject = playerObject; IsLocalPlayer = !isOpponent; _dataManager = GameClient.Get <IDataManager>(); _gameplayManager = GameClient.Get <IGameplayManager>(); _soundManager = GameClient.Get <ISoundManager>(); _cardsController = _gameplayManager.GetController <CardsController>(); _battlegroundController = _gameplayManager.GetController <BattlegroundController>(); _skillsController = _gameplayManager.GetController <SkillsController>(); _animationsController = _gameplayManager.GetController <AnimationsController>(); CardsInDeck = new List <WorkingCard>(); CardsInGraveyard = new List <WorkingCard>(); CardsInHand = new List <WorkingCard>(); CardsOnBoard = new List <WorkingCard>(); BoardCards = new List <BoardUnit>(); CardsPreparingToHand = new List <BoardCard>(); int heroId; if (!isOpponent) { if (!_gameplayManager.IsTutorial) { heroId = _dataManager.CachedDecksData.Decks.First(d => d.Id == _gameplayManager.PlayerDeckId) .HeroId; } else { heroId = Constants.TutorialPlayerHeroId; } } else { heroId = _dataManager.CachedOpponentDecksData.Decks.First(d => d.Id == _gameplayManager.OpponentDeckId) .HeroId; } SelfHero = _dataManager.CachedHeroesData.HeroesParsed[heroId]; _health = Constants.DefaultPlayerHp; InitialHp = _health; BuffedHp = 0; _goo = Constants.DefaultPlayerGoo; _avatarObject = playerObject.transform.Find("Avatar/Hero_Object").gameObject; _overlordRegularObject = playerObject.transform.Find("OverlordArea/RegularModel").gameObject; _overlordDeathObject = playerObject.transform.Find("OverlordArea/OverlordDeath").gameObject; _avatarHeroHighlight = playerObject.transform.Find("Avatar/HeroHighlight").gameObject; _avatarSelectedHighlight = playerObject.transform.Find("Avatar/SelectedHighlight").gameObject; _avatarAnimator = playerObject.transform.Find("Avatar/Hero_Object").GetComponent <Animator>(); _deathAnimator = _overlordDeathObject.GetComponent <Animator>(); _gooBarFadeTool = playerObject.transform.Find("Avatar/Hero_Object").GetComponent <FadeTool>(); _freezedHighlightObject = playerObject.transform.Find("Avatar/FreezedHighlight").gameObject; _avatarAnimator.enabled = false; _deathAnimator.enabled = false; _deathAnimator.StopPlayback(); PlayerHpChanged += PlayerHpChangedHandler; DamageByNoMoreCardsInDeck = 0; }
public void StartGame() { if (_battlegroundController == null) { _battlegroundController = _gameplayManager.GetController <BattlegroundController>(); _battlegroundController.PlayerGraveyardUpdated += PlayerGraveyardUpdatedHandler; _battlegroundController.OpponentGraveyardUpdated += OpponentGraveyardUpdatedHandler; } _gameplayManager.PlayerDeckId = CurrentDeckId; OpponentDeck randomOpponentDeck = _dataManager.CachedOpponentDecksData.Decks[ Random.Range(0, _dataManager.CachedOpponentDecksData.Decks.Count)]; _gameplayManager.OpponentDeckId = randomOpponentDeck.Id; //Debug.Log(_tutorialManager.CurrentTutorial.SpecificBattlegroundInfo); //Debug.Log(_tutorialManager.CurrentTutorial.SpecificBattlegroundInfo.OpponentInfo); //Debug.Log(_tutorialManager.CurrentTutorial.SpecificBattlegroundInfo.OpponentInfo.HeroId); int heroId = 0; //Constants.TutorialPlayerHeroId; // TUTORIAL int opponentHeroId = 0; if (!_gameplayManager.IsTutorial) { heroId = _dataManager.CachedDecksData.Decks.First(o => o.Id == CurrentDeckId).HeroId; opponentHeroId = randomOpponentDeck.HeroId; } else { heroId = _tutorialManager.CurrentTutorial.SpecificBattlegroundInfo.PlayerInfo.HeroId; opponentHeroId = _tutorialManager.CurrentTutorial.SpecificBattlegroundInfo.OpponentInfo.HeroId; } Hero currentPlayerHero = _dataManager.CachedHeroesData.HeroesParsed[heroId]; Hero currentOpponentHero = _dataManager.CachedHeroesData.HeroesParsed[opponentHeroId]; _playerDeckStatusTexture = GameObject.Find("Player/Deck_Illustration/Deck").GetComponent <SpriteRenderer>(); _opponentDeckStatusTexture = GameObject.Find("Opponent/Deck_Illustration/Deck").GetComponent <SpriteRenderer>(); _playerGraveyardStatusTexture = GameObject.Find("Player/Graveyard_Illustration/Graveyard") .GetComponent <SpriteRenderer>(); _opponentGraveyardStatusTexture = GameObject.Find("Opponent/Graveyard_Illustration/Graveyard") .GetComponent <SpriteRenderer>(); _playerHealthText = GameObject.Find("Player/Avatar/LivesCircle/DefenceText").GetComponent <TextMeshPro>(); _opponentHealthText = GameObject.Find("Opponent/Avatar/LivesCircle/DefenceText").GetComponent <TextMeshPro>(); _playerManaBar = new PlayerManaBarItem(GameObject.Find("PlayerManaBar"), "GooOverflowPlayer", new Vector3(-3.55f, 0, -6.07f)); _opponentManaBar = new PlayerManaBarItem(GameObject.Find("OpponentManaBar"), "GooOverflowOpponent", new Vector3(9.77f, 0, 4.75f)); // improve find to get it from OBJECTS ON BOARD!! _playerNameText = GameObject.Find("Player/NameBoard/NameText").GetComponent <TextMeshPro>(); _opponentNameText = GameObject.Find("Opponent/NameBoard/NameText").GetComponent <TextMeshPro>(); _playerCardDeckCountText = GameObject.Find("Player/CardDeckText").GetComponent <TextMeshPro>(); _opponentCardDeckCountText = GameObject.Find("Opponent/CardDeckText").GetComponent <TextMeshPro>(); _endTurnButton = GameObject.Find("EndTurnButton"); PlayerPrimarySkillHandler = GameObject.Find("Player").transform.Find("Object_SpellPrimary").GetComponent <OnBehaviourHandler>(); PlayerSecondarySkillHandler = GameObject.Find("Player").transform.Find("Object_SpellSecondary").GetComponent <OnBehaviourHandler>(); OpponentPrimarySkillHandler = GameObject.Find("Opponent").transform.Find("Object_SpellPrimary").GetComponent <OnBehaviourHandler>(); OpponentSecondarySkillHandler = GameObject.Find("Opponent").transform.Find("Object_SpellSecondary").GetComponent <OnBehaviourHandler>(); if (currentPlayerHero != null) { SetHeroInfo(currentPlayerHero, "Player", PlayerPrimarySkillHandler.gameObject, PlayerSecondarySkillHandler.gameObject); string playerNameText = currentPlayerHero.FullName; if (_backendDataControlMediator.LoadUserDataModel()) { playerNameText = _backendDataControlMediator.UserDataModel.UserId; } _playerNameText.text = playerNameText; } if (currentOpponentHero != null) { SetHeroInfo(currentOpponentHero, "Opponent", OpponentPrimarySkillHandler.gameObject, OpponentSecondarySkillHandler.gameObject); _opponentNameText.text = currentOpponentHero.FullName; } _isPlayerInited = true; }