Наследование: MonoBehaviour
Пример #1
0
 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;
         }
     }
 }
Пример #2
0
    void Awake()
    {
        EventController.SubscribeToAllEvents(this);

        if (Application.loadedLevelName != "CarSelect")
            ScoreSys = GameObject.Find("Screen_GameGUI").GetComponent<ScoreSystem>();
    }
Пример #3
0
    private void Start()
    {
        scoreSystem = GameObject.Find("ScoreSystem").GetComponent<ScoreSystem>();
        player = GameObject.Find("Player").GetComponent<PlayerController>();
        StartCoroutine("WaveManager");
        gameOver = false;

        _asteroidsPerWave = asteroidsPerWave;
    }
Пример #4
0
	void Awake() 
	{
		Debug.Log("ScoreSystem awake");
		instance = this;
		
		Match3Tile.OnAnyTileDestroyed += OnAnyTileDestroyed;
		
		Reset();
	}
Пример #5
0
 // 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;
 }
Пример #6
0
    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);
     }
 }
Пример #8
0
 public void LoseScore()
 {
     ScoreSystem.LoseScore(value);
 }
Пример #9
0
 private void Die()
 {
     ScoreSystem.ResetScore();
     SceneManager.LoadScene(SceneManager.GetActiveScene().name);
 }
Пример #10
0
 public void AddSCore()
 {
     ScoreSystem.GiveScore(score);
 }
Пример #11
0
 public string GetScoreString()
 {
     return(ScoreSystem.FormatScore(score));
 }
Пример #12
0
 private void Start()
 {
     scoreSystem = FindObjectOfType <ScoreSystem>();
 }
Пример #13
0
 // Use this for initialization
 void Start()
 {
     GetComponent <Text>().text = ScoreSystem.GetScore(m_scoreName) + "";
 }
Пример #14
0
 // Use this for initialization
 void Start()
 {
     ScoreSystem = GameObject.Find("GameLogic").GetComponent <ScoreSystem>();
     game        = GameObject.Find("GameLogic").GetComponent <egGame> ();
 }
Пример #15
0
 // Use this for initialization
 void Start()
 {
     scoresystem = GameObject.FindGameObjectWithTag("ScoreManager").GetComponent <ScoreSystem>();
 }
Пример #16
0
 void Awake() => _instance = this;
Пример #17
0
 void Awake()
 {
     Instance = this;
 }
Пример #18
0
        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();
            }
        }
Пример #19
0
 // Use this for initialization
 public void assighnVars(ScoreSystem scr, int pnts)
 {
     scoreScript = scr;
     pointsWorth = pnts;
 }
Пример #20
0
 // Use this for initialization
 void Start()
 {
     sm = FindObjectOfType <ScoreSystem>();
 }
Пример #21
0
 void Start()
 {
     player         = FindObjectOfType <PlayerController>();
     scoreSystem    = FindObjectOfType <ScoreSystem>();
     scoreText.text = "Wynik: " + scoreSystem.score;
 }
Пример #22
0
 void Start()
 {
     //Playerオブジェクトを検索し、参照を代入
             player = GameObject.FindGameObjectWithTag("Player").transform;
             Score = GameObject.Find("ScoreSystem").GetComponent<ScoreSystem>(); //スコアシステムを代入
 }
Пример #23
0
 // 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>();
 }
Пример #25
0
 public void Start()
 {
     score = GameObject.Find("ScoreSystem").GetComponent <ScoreSystem>();
 }
Пример #26
0
 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;
    }
Пример #28
0
    // Use this for initialization
    void Start () {

        displayHiScore = FindObjectOfType<ScoreSystem>();
        ScoreSystem.checker = true;

    }
Пример #29
0
 void Start()
 {
     m_rigidbody2D = GetComponent <Rigidbody2D>();
     m_scoreSystem = FindObjectOfType <ScoreSystem>();
 }
Пример #30
0
 void Start()
 {
     ss = GameObject.Find("Player").GetComponent <ScoreSystem>();
 }
Пример #31
0
 public void Check()
 {
     ScoreSystem.GetInstance().CheckIfNewHighscore();
 }
Пример #32
0
 public void Awake()
 {
     instRef = this;
 }
Пример #33
0
 public void ScoreComplete()
 {
     Instance.ToggleCanvas("ScoreComplete");
     ScoreSystem.scoreComplete.Invoke();
     StartCoroutine(ScoreSystem.StopEvaluateScore());
 }
Пример #34
0
 public void GainScore()
 {
     ScoreSystem.GainScore(value);
 }
Пример #35
0
 // Start is called before the first frame update
 void Start()
 {
     sco = GameObject.Find("GameManager").GetComponent <ScoreSystem>();
 }
Пример #36
0
 void Start()
 {
     scoreScript = timerScript.GetComponent<ScoreSystem>();
     dimRenderer.color = new Color(1f, 1f, 1f, 0f);
     dimRenderer.gameObject.SetActive(true);
     levelComplete.SetActive(false);
     audio = GetComponent<AudioSource>();
 }
Пример #37
0
    // 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";
    }
Пример #38
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();
        }
    }
Пример #40
0
    // 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>();
 }
Пример #43
0
    void Start()
    {
        gameController = this.GetComponent<GameController>();
        gameController.EndGame += EndGame;

        score = GetComponent<ScoreSystem>();
    }
Пример #44
0
    // Use this for initialization
    void Start()
    {
        sFood = GameObject.Find("Game Manager").GetComponent<SpawnFood>();

        scoreSYS = GameObject.Find("Game Manager").GetComponent<ScoreSystem>();
    }
Пример #45
0
 private void Start()
 {
     scoreSystem = GameObject.Find("ScoreSystem").GetComponent<ScoreSystem>();
 }