void Awake() { _uiManager = GetComponent <UIManager_script>(); _gameController = GetComponent <GameController_script>(); _levelScores = new List <int>(); //_uiManager.UpdateScoreUI(0); }
// Use this for initialization void Start() { playerBody = GetComponent<Rigidbody2D>(); cooldown = Time.time + 1; GameObject controller = GameObject.Find("GameController"); controllerScript = controller.GetComponent<GameController_script>(); }
void Start() { _scoreMananger = GameManger.GetComponent <ScoreMananger_script>(); _gameController = GameManger.GetComponent <GameController_script>(); _dropPoint = transform.GetChild(1); _drops = new List <GameObject>(); }
public void Config(int id, string s, Color[] c, GameController_script gc, bool hideCard = false) { _startingTransform = transform.parent; _startPos = this.transform.localPosition; _valueText = this.transform.GetChild(0).GetComponentInChildren <TextMeshProUGUI>(); _backgroundImage = this.transform.GetChild(0).GetChild(0).GetComponent <Image>(); _abilityButton = GetComponentInChildren <Button>(); _abilityButtonText = _abilityButton.GetComponentInChildren <TextMeshProUGUI>(); _cardBackImage = this.transform.GetChild(2).GetComponent <Image>(); _cardBackImage.gameObject.SetActive(hideCard); _gameController = gc; if (_gameController.GameStage == 1) { _totalValueTracker = this.transform.GetChild(0).GetComponentInParent <TotalValueTracker_script>(); if (_totalValueTracker != null) { _discardPile = _totalValueTracker.DiscardPile; } } InfoString = s; PlayerID = id; SetValuesAndAbility(s); _cardColors = new List <Color>(c); SetValueText(); CheckAbilities(s); }
void Start() { target = GameObject.FindGameObjectWithTag("Player").transform; GameObject controller = GameObject.Find("GameController"); controllerScript = controller.GetComponent <GameController_script>(); }
void Start() { _gameController = GetComponent <GameController_script>(); m_Raycaster = FindObjectOfType <GraphicRaycaster>(); //finds the graphic raycaster m_EventSystem = FindObjectOfType <EventSystem>(); //finds the eventsystem MouseHolder.gameObject.SetActive(true); }
public void PlaceCard(Transform t, bool b = true, bool s = true) { this.transform.position = t.position; this.transform.SetParent(t); this.transform.localScale = new Vector3(1, 1, 1); //to fix scaling bug if (_gameController == null) { _gameController = FindObjectOfType <GameController_script>(); } //Debug.Log("GC - " +_gameController.transform.name); if (_gameController.GameStage == 0) //placing card during deck building { return; } _playerCard = b; if (_totalValueTracker == null) { _totalValueTracker = this.transform.GetComponentInParent <TotalValueTracker_script>(); _discardPile = _totalValueTracker.DiscardPile; } if (s) { Invoke(Ability, 0f); Placed = true; } }
void Start () { target = GameObject.FindGameObjectWithTag("Player").transform; GameObject controller = GameObject.Find("GameController"); controllerScript = controller.GetComponent<GameController_script>(); }
void Start() { _dropper = GetComponent <Dropper_script>(); _scoreMananger = _dropper.GameManger.GetComponent <ScoreMananger_script>(); _col = GetComponent <BoxCollider2D>(); _spriteRenderers = GetComponentsInChildren <SpriteRenderer>(); _gameController = _scoreMananger.GetComponent <GameController_script>(); }
void Start() { _gameController = GetComponent <GameController_script>(); _leftBoard = _gameController.LeftBoard; _rigthBoard = _gameController.RightBoard; _leftMainCardBoard = _leftBoard.transform.GetChild(0); _rigthMainCardBoard = _rigthBoard.transform.GetChild(0); }
// Use this for initialization void Start() { playerBody = GetComponent <Rigidbody2D>(); cooldown = Time.time + 1; GameObject controller = GameObject.Find("GameController"); controllerScript = controller.GetComponent <GameController_script>(); }
void Start() { _uiManager = GetComponent <UIManager_script>(); _scoreManager = GetComponent <ScoreManager_script>(); _gameController = GetComponent <GameController_script>(); _effectMananger = GetComponent <EffectMananger_script>(); _uiManager.SetUpButtons(Objects); _placedObjects = new List <GameObject>(); }
void Start() { _countDownText = GameUI.transform.GetChild(0).GetComponent <TextMeshProUGUI>(); _roundOverGrid = RoundOverScreen.transform.GetChild(3).gameObject; _roundOverTitle = RoundOverScreen.transform.GetChild(1).GetComponent <TextMeshProUGUI>(); _roundOverCashText = RoundOverScreen.transform.GetChild(2).GetComponent <TextMeshProUGUI>(); _storeManagerScript = GetComponent <StoreManager_script>(); _gameController = GetComponent <GameController_script>(); }
void Start () { lvl = SceneManager.GetActiveScene().buildIndex; GameObject controller = GameObject.Find("GameController"); controllerScript = controller.GetComponent<GameController_script>(); if(SceneManager.GetActiveScene().buildIndex >= 5) { controllerScript.Invoke("BugPenalty", 0.5f); } }
void Start() { lvl = SceneManager.GetActiveScene().buildIndex; GameObject controller = GameObject.Find("GameController"); controllerScript = controller.GetComponent <GameController_script>(); if (SceneManager.GetActiveScene().buildIndex >= 5) { controllerScript.Invoke("BugPenalty", 0.5f); } }
public void ConfigDefaultCard(string s, int a, GameController_script gc) { SetLinks(); _cardAbilityInfo = gc.GetComponent <CardAbilityInfoManager_script>(); CardInfo = s; _ability = _cardAbilityInfo.GetAbilityInfo(CardInfo); _infoText.text = _ability; //SetValuesAndAbility(s); //CheckAbilities(); _cardHolder = _defaultCard.transform.parent; CreatNewCard(a); }
public void ConfigAI(AISelecter_script.AIStatesClass aiStates) //when choosing AI { AIStates = new AISelecter_script.AIStatesClass(); AIStates = aiStates; _aiDeck = AIBoard.GetComponent <PlayerDeckMananger_script>(); _gameController = AIBoard.GameController; _globalDeck = _gameController.GetComponent <GlobalDeckManager_script>(); _buttonHolder = AIBoard.transform.GetChild(3).gameObject; AIBoard.PlayerName = AIStates.AIName; _aiDeck.SetPlayerDeck(AIStates.DeckValues, true); _buttonHolder.SetActive(false); }
// Use this for initialization void Awake() { if (StaticRef == null) // if theres is not allerdaye a static ref makes this the static ref { DontDestroyOnLoad(gameObject); StaticRef = this; } else if (StaticRef != this) // is the allready is a ref , destory this { Destroy(this); } currentState = State.setup; currentScenario = scenario.None; //remeber you set it to none here. if at some point you don't why the printed stuff keeps say none mainMenu = canvas.GetComponentInChildren <CanvasGroup>(); }
void Start() { _endGameText = EndGameScreen.transform.GetChild(2).GetComponent <TextMeshProUGUI>(); _endGameTitleText = EndGameScreen.transform.GetChild(1).GetComponent <TextMeshProUGUI>(); _roundEndButton = EndGameScreen.transform.GetChild(4).GetChild(0).GetComponent <Button>(); _roundEndButtonText = _roundEndButton.GetComponentInChildren <TextMeshProUGUI>(); _cardSeletionButton = EndGameScreen.transform.GetChild(4).GetChild(1).GetComponent <Button>(); _gameController = GetComponent <GameController_script>(); _playerIndicatorBackground = new Image[2]; _playerIndicatorBackground[0] = PlayerIndicator[0].transform.parent.GetComponent <Image>(); _playerIndicatorBackground[1] = PlayerIndicator[1].transform.parent.GetComponent <Image>(); _endGameLeftPlayerText = EndGameScreen.transform.GetChild(3).GetChild(0).GetComponentsInChildren <TextMeshProUGUI>(); _endGameRightPlayerText = EndGameScreen.transform.GetChild(3).GetChild(1).GetComponentsInChildren <TextMeshProUGUI>(); _leftBoard = _gameController.LeftBoard; _rightBoard = _gameController.RightBoard; _leftPlayerName = PlayerIndicator[0].transform.parent.parent.GetChild(4).GetComponent <TextMeshProUGUI>(); _leftPlayerImages = PlayerIndicator[0].transform.parent.parent.GetChild(5).GetComponentsInChildren <Image>(); _preGamePlayerImages = PreGamePlayerGraphics.GetComponentsInChildren <Image>(); _rightPlayerName = PlayerIndicator[1].transform.parent.parent.GetChild(4).GetComponent <TextMeshProUGUI>(); _rightPlayerImage = PlayerIndicator[1].transform.parent.parent.GetChild(5).GetComponent <Image>(); _playerInfoBarName = PlayerInfoBar.transform.GetChild(1).GetComponent <TextMeshProUGUI>(); _playerInfoBarCredits = PlayerInfoBar.transform.GetChild(2).GetComponent <TextMeshProUGUI>(); _bettingInputfield = BetScreen.transform.GetChild(1).GetComponent <TMP_InputField>(); ResetUI(); GameBoardScreen.SetActive(false); CardSelectionScreen.SetActive(false); BetScreen.SetActive(false); StartScreen.SetActive(true); VersionText.text = "Work in progress v. " + Application.version; }
void Awake() { _objectPlacerMananger = GetComponent <ObjectPlacerMananger_script>(); _objectPreviewer = _objectPlacerMananger.ObjectPreviewer; _removalToolButton = ObjectUI.transform.GetChild(1).GetChild(4).GetComponent <Button>(); _removalToolButtonImage = _removalToolButton.GetComponent <Image>(); _startButton = ObjectUI.transform.GetChild(1).GetChild(5).GetComponent <Button>(); _gameControllerScript = GetComponent <GameController_script>(); _gameoverTitleText = GameOverScreen.transform.GetChild(1).GetComponent <TextMeshProUGUI>(); _gameoverText = GameOverScreen.transform.GetChild(2).GetComponent <TextMeshProUGUI>(); _scoreManager = GetComponent <ScoreManager_script>(); _placementScoreText = ObjectUI.transform.GetChild(2).GetComponent <TextMeshProUGUI>(); _levelScoreText = GameOverScreen.transform.GetChild(3).GetComponentsInChildren <TextMeshProUGUI>(); _levelScoreTotalText = GameOverScreen.transform.GetChild(5).GetComponent <TextMeshProUGUI>(); _effectMananger = GetComponent <EffectMananger_script>(); GameOverScreen.SetActive(false); _musicToggle = StartScreen.transform.GetChild(1).GetChild(2).GetChild(0).GetComponent <Toggle>(); _sfxToggle = StartScreen.transform.GetChild(1).GetChild(2).GetChild(1).GetComponent <Toggle>(); _highScoreScreenText = StartScreen.transform.GetChild(2).GetChild(1).GetComponentsInChildren <TextMeshProUGUI>(); _highScoreScreenTotalText = StartScreen.transform.GetChild(2).GetChild(2).GetComponent <TextMeshProUGUI>(); StartScreen.SetActive(true); SetHighScoreScreenText(); }
void Awake() { _aiMananger = AiSelecter.GetComponent <AIMananger_script>(); _gameController = _aiMananger.AIBoard.GameController; _uiManager = _gameController.GetComponent <UIManager_script>(); _aiHolder = transform.GetChild(1); _aiImage = new List <Image>(); _aiImage.Add(_aiHolder.GetChild(0).GetChild(0).GetComponent <Image>()); _aiImage.Add(_aiHolder.GetChild(1).GetChild(0).GetComponent <Image>()); _aiImage.Add(_aiHolder.GetChild(2).GetChild(0).GetComponent <Image>()); _aiText = new List <TextMeshProUGUI>(); _aiText.Add(_aiHolder.GetChild(0).GetChild(1).GetComponent <TextMeshProUGUI>()); _aiText.Add(_aiHolder.GetChild(1).GetChild(1).GetComponent <TextMeshProUGUI>()); _aiText.Add(_aiHolder.GetChild(2).GetChild(1).GetComponent <TextMeshProUGUI>()); _uiManager.OpponentSelction.SetActive(false); _generateSelectionCards = _uiManager.CardSelectionScreen.GetComponent <GenerateSelectionCards_script>(); }
// Use this for initialization void Awake() { if(StaticRef == null) // if theres is not allerdaye a static ref makes this the static ref { DontDestroyOnLoad(gameObject); StaticRef = this; } else if(StaticRef != this) // is the allready is a ref , destory this { Destroy(this); } currentState = State.setup; currentScenario = scenario.None; //remeber you set it to none here. if at some point you don't why the printed stuff keeps say none mainMenu = canvas.GetComponentInChildren<CanvasGroup>(); }
void Start() { _aiMananger = GetComponent <AIMananger_script>(); _gameController = _aiMananger.AIBoard.GameController; }
void Start() { _dropper = GetComponent <Dropper_script>(); _gameController = _dropper.GameManger.GetComponent <GameController_script>(); }
public void Config(GameController_script gc) { _gameController = gc; }