private void Awake() { _difficultyData = Data.Instance.DifficultyData; _canvas = GameObject.FindGameObjectWithTag("MainCanvas").GetComponent <Canvas>(); _gameMenu = _canvas.GetComponentInChildren <GameMenuBehaviour>(); //GameObject.FindGameObjectWithTag("MainCanvas"). _hpManager = _canvas.GetComponentInChildren <HPManagerBehavior>(); var progressBarBehaviour = CustomResources.Load <ProgressBar> (AssetsPathGameObject.GameObjects[GameObjectType.ProgressBar]); _progressBar = Instantiate(progressBarBehaviour, _gameMenu.transform); }
private void Awake() { _controllers = new Controllers(); Initialization(); ScreenInterface.GetInstance().Execute(ScreenType.GameMenu); _mainCanvas = GameObject.FindGameObjectWithTag("MainCanvas").GetComponent <Canvas>(); _gameMenu = _mainCanvas.GetComponentInChildren <GameMenuBehaviour>(); _helpButton = _gameMenu.GameMenuHelpButton; _tutorialHand = _mainCanvas.GetComponentInChildren <TutorialHandBehaviour>(); CardDealerController = (CardDealerController)_controllers._initializations[0]; DifficultyController = (DifficultyController)_controllers._initializations[1]; CameraAnimationController = GetComponentInChildren <CameraAnimationController>(); }
public AsyncState Execute(GameObject prefab, int maxHP) { var asyncChain = Planner.Chain(); asyncChain.AddEmpty(); this.maxHP = maxHP; if (_hpCounts.Count == maxHP) { return(asyncChain); } _gameMenu = GameObject.FindGameObjectWithTag("MainCanvas").GetComponentInChildren <GameMenuBehaviour>(); gameObject.SetActive(true); for (int i = 0; i < maxHP; i++) { var hpObject = Instantiate(prefab, _gameMenu.transform); hpObject.transform.localPosition = new Vector3(_offsetX + i * _imageSpacing, _offsetY, _offsetZ); hpObject.name = _HPobjectName + (i + _indexNumber); _hpCounts.Add(hpObject); } return(asyncChain); }