private void Start() { scoreSystem = GameObject.FindGameObjectWithTag("ScoreHandler").GetComponent<ScoreSystem>(); // for (int i = 0; i < scoreSystem.playerText.Length; i++) // { // if (scoreSystem.playerText[i] == null) // { // scoreSystem.playerText[i] = playerScoreBoard[0]; // break; // } // } for (int i = 0; i < scoreSystem.scoreSystem.Length; i++) { if (scoreSystem.scoreSystem[i].player == null) { //scoreSystem.scoreSystem[i].playerName = "Player " + (i + 1).ToString(); scoreSystem.scoreSystem[i].playerName = "Player " + (i + 1).ToString(); scoreSystem.scoreSystem[i].player = gameObject; playerNumber = i; scoreSystem.scoreSystem[i].playerTxt = playerScoreBoard; initializeScoreBoard(); playerName.text = "Player: " + (playerNumber + 1); break; } } }
void Awake() { EventController.SubscribeToAllEvents(this); if (Application.loadedLevelName != "CarSelect") ScoreSys = GameObject.Find("Screen_GameGUI").GetComponent<ScoreSystem>(); }
private void Start() { scoreSystem = GameObject.Find("ScoreSystem").GetComponent<ScoreSystem>(); player = GameObject.Find("Player").GetComponent<PlayerController>(); StartCoroutine("WaveManager"); gameOver = false; _asteroidsPerWave = asteroidsPerWave; }
void Awake() { Debug.Log("ScoreSystem awake"); instance = this; Match3Tile.OnAnyTileDestroyed += OnAnyTileDestroyed; Reset(); }
// Use this for initialization void Awake() // for object persistence throught the all scene { if (control == null) { DontDestroyOnLoad(gameObject); control = this; } else if (control != this) { Destroy(gameObject); } currentHighScore = InputData.highscore; }
void Start() { if (CreationFunc != null) CreationFunc(); //Debug.Log("Starting to do shit"); gameUI = GameObject.Find("Game UI"); gameSystem = GameObject.Find("Game System"); ingameObject = GameObject.Find("InGame Object"); playerScript = GameObject.Find("Player").GetComponent<PlayerScript>(); gameEndSystem = GameObject.Find("GameEndSystem").GetComponent<GameEndSystem>(); levelSystem = GameObject.Find("LevelInit").GetComponent<LevelSystem>(); uiManager = GameObject.Find("UIManager").GetComponent<UIManager>(); checkPointSystem = GameObject.Find("CheckPointSystem").GetComponent<CheckPointSystem>(); controls = GameObject.Find("Controls").GetComponent<Controls>(); scoreSystem = GameObject.Find("ScoreSystem").GetComponent<ScoreSystem>(); gameInfo = GameObject.Find("GameInfo").GetComponent<GameInfo>(); sceneManager = GameObject.Find("SceneManager").GetComponent<SceneManager>(); if (gameUI.name != null) Debug.Log(gameUI.name + " is up"); if (playerScript.name != null) Debug.Log(playerScript.name + " is up"); if(playerScript.name!=null) Debug.Log(playerScript.name + " is up"); if(gameEndSystem.name!=null) Debug.Log(gameEndSystem.name + " is up"); if (levelSystem && levelSystem.name != null) Debug.Log(levelSystem.name + " is up"); if (checkPointSystem && checkPointSystem.name != null) Debug.Log(checkPointSystem.name + " is up"); uiManager._initUI(); levelSystem._initLevel(); playerScript._createCar(gameInfo.chosen_VehProfile); // playerScript }
void Awake() { if(_instance == null){ if (inventory == null) { inventory = new Inventory(); } if (scoreSystem == null) { scoreSystem = gameObject.AddComponent<ScoreSystem>(); } if (voices_pedestrian == null) { voices_pedestrian = GetComponentInChildren<VoicePedestrian>(); } _instance = this; DontDestroyOnLoad(this); score = 0; } else{ if(this != _instance) Destroy(this.gameObject); } }
public void LoseScore() { ScoreSystem.LoseScore(value); }
private void Die() { ScoreSystem.ResetScore(); SceneManager.LoadScene(SceneManager.GetActiveScene().name); }
public void AddSCore() { ScoreSystem.GiveScore(score); }
public string GetScoreString() { return(ScoreSystem.FormatScore(score)); }
private void Start() { scoreSystem = FindObjectOfType <ScoreSystem>(); }
// Use this for initialization void Start() { GetComponent <Text>().text = ScoreSystem.GetScore(m_scoreName) + ""; }
// Use this for initialization void Start() { ScoreSystem = GameObject.Find("GameLogic").GetComponent <ScoreSystem>(); game = GameObject.Find("GameLogic").GetComponent <egGame> (); }
// Use this for initialization void Start() { scoresystem = GameObject.FindGameObjectWithTag("ScoreManager").GetComponent <ScoreSystem>(); }
void Awake() => _instance = this;
void Awake() { Instance = this; }
public void DoPress(PressType press) { /* * if (_isCalledInThisFrame) * { * _isCalledInThisFrame = false; * return; * } */ if (_goalId < 0) { return; } //Debug.Log("Pressed: " + press); if (NextGoalPress() == press) { _currentPresses.Add(press); if (_currentPresses.Count == 1) { //AudioMngr.success.pitch = 1f; AudioMngr.ChangeSuccessPitch(1f); AudioMngr.SuccessPlay(); if (OneImg.sprite == ShortSprite) { OneImg.sprite = SuccessShortSprite; } else { OneImg.sprite = SuccessLongSprite; } } else if (_currentPresses.Count == 2) { //AudioMngr.success.pitch = 1.2f; AudioMngr.ChangeSuccessPitch(1.15f); AudioMngr.SuccessPlay(); if (TwoImg.sprite == ShortSprite) { TwoImg.sprite = SuccessShortSprite; } else { TwoImg.sprite = SuccessLongSprite; } } else if (_currentPresses.Count == 3) { //AudioMngr.success.pitch = 1.4f; AudioMngr.ChangeSuccessPitch(1.4f); AudioMngr.SuccessPlay(); if (ThreeImg.sprite == ShortSprite) { ThreeImg.sprite = SuccessShortSprite; } else { ThreeImg.sprite = SuccessLongSprite; } } if (_currentPresses.Count != _currentGoal.Count) { return; } PoseSucceeded(); } else { PoseFailed(); ScoreSystem.comboCount = 0; ScoreSystem.comboTimeReset(); } }
// Use this for initialization public void assighnVars(ScoreSystem scr, int pnts) { scoreScript = scr; pointsWorth = pnts; }
// Use this for initialization void Start() { sm = FindObjectOfType <ScoreSystem>(); }
void Start() { player = FindObjectOfType <PlayerController>(); scoreSystem = FindObjectOfType <ScoreSystem>(); scoreText.text = "Wynik: " + scoreSystem.score; }
void Start() { //Playerオブジェクトを検索し、参照を代入 player = GameObject.FindGameObjectWithTag("Player").transform; Score = GameObject.Find("ScoreSystem").GetComponent<ScoreSystem>(); //スコアシステムを代入 }
// Use this for initialization void Start() { scoreSystem = FindObjectOfType <ScoreSystem>(); //find the system for the score }
// Use this for initialization void Start() { Player = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMOD>(); score = GameObject.FindGameObjectWithTag("Manager").GetComponent <ScoreSystem>(); }
public void Start() { score = GameObject.Find("ScoreSystem").GetComponent <ScoreSystem>(); }
void OnEnable() { ScoreSystem.GetInstance().NewScore += UpdateText; UpdateText(ScoreSystem.GetInstance().GetCurrentScore()); }
// Update is called once per frame void Update() { int score = ScoreSystem.getScore(); if (score != m_oldScore) { if (score - m_oldScore > 0) // only add positive change to combo { if (m_cooldowntick > 0.0f || (!comboSnd && m_comboCount == 0 && score - m_oldScore > 1)) { if (m_soundCount < m_scoreSound.Length - 1) { m_soundCount++; } m_comboCount += score - m_oldScore; } if (!comboSnd) { m_audioSource.Stop(); m_audioSource.PlayOneShot(m_scoreSound[m_soundCount]); } comboSnd = false; m_cooldowntick = m_cooldownticklim; } string scorestr = score.ToString(); m_scoreText.text = scorestr; if (m_comboCount > 0) { m_comboTextGem.text = "Gem +" + m_comboCount; m_comboTextGem.enabled = true; m_comboGem.enabled = true; } else { m_comboTextGem.enabled = false; m_comboGem.enabled = false; } for (int i = 0; i < m_scoreFx.Length; i++) { int fxidx = (m_currentScoreFx + i) % m_scoreFx.Length; if (!m_scoreFx[fxidx].isRunning()) { m_scoreFx[fxidx].run(score - m_oldScore); m_currentScoreFx++; if (m_currentScoreFx >= m_scoreFx.Length) { m_currentScoreFx = 0; } break; } } } int ballCombo = m_player.getBallCombo(); if (m_oldBallCombo != ballCombo) { m_oldBallCombo = ballCombo; if (ballCombo > 0) { m_comboTextBall.text = "Hit +" + ballCombo; m_comboTextBall.enabled = true; m_comboBall.enabled = true; } else { m_comboTextBall.enabled = false; m_comboBall.enabled = false; } } if (m_cooldowntick > 0.0f) { m_cooldowntick -= Time.deltaTime; } else { if (m_comboCount > 0) { m_scoreText.text = score.ToString(); ScoreSystem.add(m_comboCount); score = ScoreSystem.getScore(); m_audioSource.PlayOneShot(m_comboSound); for (int i = 0; i < m_scoreFx.Length; i++) { int fxidx = (m_currentScoreFx + i) % m_scoreFx.Length; if (!m_scoreFx[fxidx].isRunning()) { m_scoreFx[fxidx].run(m_comboCount, m_leftTopEdge3d.position); m_currentScoreFx++; if (m_currentScoreFx >= m_scoreFx.Length) { m_currentScoreFx = 0; } break; } } m_comboTextGem.enabled = false; m_comboGem.enabled = false; m_comboCount = 0; comboSnd = true; } m_soundCount = 0; m_cooldowntick = 0.0f; } float t = m_cooldowntick / m_cooldownticklim; m_scoreText.rectTransform.localScale = m_txtSzDefault * (1.0f + Mathf.PingPong(0.4f * t * m_cooldowntick * m_cooldowntick, 0.25f)); m_scoreText.color = Color.Lerp(m_inactiveCol, m_activeCol, t); m_oldScore = score; }
// Use this for initialization void Start () { displayHiScore = FindObjectOfType<ScoreSystem>(); ScoreSystem.checker = true; }
void Start() { m_rigidbody2D = GetComponent <Rigidbody2D>(); m_scoreSystem = FindObjectOfType <ScoreSystem>(); }
void Start() { ss = GameObject.Find("Player").GetComponent <ScoreSystem>(); }
public void Check() { ScoreSystem.GetInstance().CheckIfNewHighscore(); }
public void Awake() { instRef = this; }
public void ScoreComplete() { Instance.ToggleCanvas("ScoreComplete"); ScoreSystem.scoreComplete.Invoke(); StartCoroutine(ScoreSystem.StopEvaluateScore()); }
public void GainScore() { ScoreSystem.GainScore(value); }
// Start is called before the first frame update void Start() { sco = GameObject.Find("GameManager").GetComponent <ScoreSystem>(); }
void Start() { scoreScript = timerScript.GetComponent<ScoreSystem>(); dimRenderer.color = new Color(1f, 1f, 1f, 0f); dimRenderer.gameObject.SetActive(true); levelComplete.SetActive(false); audio = GetComponent<AudioSource>(); }
// Use this for initialization void Start() { player = findPlayer();//in case we grab the feet first lastPatternBaseEnd = new Vector3(player.transform.position.x, player.GetComponent<Collider2D>().bounds.min.y, 0); gameScreen = new Rect(player.transform.position.x - Settings.gameBackScreenX, player.transform.position.y - Settings.gameScreenY / 2, Settings.gameScreenX, Settings.gameScreenY); lastPatternPlatEnd = new Vector3(); if(levelSeed.Equals(0)) levelSeed = (int)((0.5f - Random.value) * int.MaxValue); Debug.Log(levelSeed); levelRandom = new System.Random(levelSeed); platformHeight = -1; platformLength = 0; platformEnding = false; baseLength = 0; genstate = GenState.ground; patterns = new PatternStyle[PatternStyleGO.Length]; for(int gi = 0; gi<PatternStyleGO.Length; gi++) { PatternStyle ps = PatternStyleGO[gi].GetComponent<PatternStyle>(); patterns[gi] = ps; Debug.Log(ps.ping()); } levelGenerateInitial(5); timer = 0; scoreSys = new ScoreSystem(); guiScoreText.text = "0"; }
private void Awake() { instance = this; UpdateScoreUI(); }
public void UpdateCompanions(int[] indexes) { if (indexes.Length > 1) { chooseLabelLandscape.GetComponent <UILabel>().text = Language.Get("LEVEL_CHOOSE_COMPANION"); chooseLabelPortrait.GetComponent <UILabel>().text = Language.Get("LEVEL_CHOOSE_COMPANION"); } else { chooseLabelLandscape.GetComponent <UILabel>().text = Language.Get("LEVEL_COMPANION"); chooseLabelPortrait.GetComponent <UILabel>().text = Language.Get("LEVEL_COMPANION"); } CharacterSpecialAnimations.characterIndex = -1; for (int i = 0; i < 4; ++i) { companionsLandscape[i].gameObject.SetActive(i < indexes.Length); companionsPortrait[i].gameObject.SetActive(i < indexes.Length); companionsLandscape[i].selected = i == 0; companionsPortrait[i].selected = i == 0; companionsLandscape[i].transform.localPosition = positionsLandscape[i] + (positionsLandscape[1] - positionsLandscape[0]) * (4 - indexes.Length) * 0.5f; companionsPortrait[i].transform.localPosition = positionsPortrait[i] + (positionsPortrait[1] - positionsPortrait[0]) * (4 - indexes.Length) * 0.5f; if (i < indexes.Length) { companionsLandscape[i].UpdateCompanion(indexes[i]); companionsPortrait[i].UpdateCompanion(indexes[i]); } } tokensLabelLandscape.UpdateStatus(); tokensLabelPortrait.UpdateStatus(); GameObject levelPrefab = Resources.Load("Game/Levels/Level" + Match3BoardRenderer.levelIdx) as GameObject; if (levelPrefab != null) { Match3BoardRenderer levelData = levelPrefab.GetComponent <Match3BoardRenderer>(); if (levelData != null) { string key = "Level" + Match3BoardRenderer.levelIdx + "Star1"; if (TweaksSystem.Instance.intValues.ContainsKey(key)) { targetLabelLandscape.text = Language.Get("LEVEL_TARGET") + " " + ScoreSystem.FormatScore(TweaksSystem.Instance.intValues[key]); } else { targetLabelLandscape.text = Language.Get("LEVEL_TARGET") + " " + ScoreSystem.FormatScore((levelData.winConditions as WinScore).targetScore); } targetLabelPortrait.text = targetLabelLandscape.text; //objectiveLabelLandscape.text = Language.Get("LEVEL_OBJECTIVE") + "\n" + levelData.winConditions.GetObjectiveString(); objectiveLabelLandscape.text = levelData.winConditions.GetShortObjectiveString(levelData.loseConditions); objectiveLabelPortrait.text = objectiveLabelLandscape.text; foreach (LevelDestroyTargets target in destroyTargets) { target.UpdateValues(levelData.winConditions); } Vector3 newPos = targetLabelPortrait.transform.localPosition; if (levelData.winConditions.GetType() != typeof(WinDestroyTiles) && levelData.winConditions.GetType() != typeof(WinDestroyTilesDrop)) { newPos.y = 112f; } else { newPos.y = 86f; } targetLabelPortrait.transform.localPosition = newPos; targetLabelLandscape.transform.localPosition = targetLabelPortrait.transform.localPosition; } // levelPrefab = null; // Resources.UnloadUnusedAssets(); } }
// Use this for initialization void Start() { _blockManager = FindObjectOfType (typeof(BlockManager)) as BlockManager; score = GetComponent<ScoreSystem>(); _gameMatrix = new List<GridLayer>(); for (int i = 0; i < _height; i++) { _gameMatrix.Add(new GridLayer()); } }
public void GiveScore() { ScoreSystem.AddScore(pointsGiven); }
private void Start() { star = GameObject.Find("ScoreSystem"); score = star.GetComponent <ScoreSystem>(); }
void Start() { gameController = this.GetComponent<GameController>(); gameController.EndGame += EndGame; score = GetComponent<ScoreSystem>(); }
// Use this for initialization void Start() { sFood = GameObject.Find("Game Manager").GetComponent<SpawnFood>(); scoreSYS = GameObject.Find("Game Manager").GetComponent<ScoreSystem>(); }
private void Start() { scoreSystem = GameObject.Find("ScoreSystem").GetComponent<ScoreSystem>(); }