Inheritance: MonoBehaviour
    IEnumerator OnTriggerEnter2D(Collider2D other)
    {
        score = GameObject.Find("Score").GetComponent<ScoreController>();

        if (other.tag == "Rock")
        {

            yield return new WaitForSeconds(hellaWait);
            if(tag == "Player")
            {
                objectPos = transform.FindChild("turtle_shell").transform.position;
                score.Add();
            }
            else
            {
                objectPos = transform.position;
                score.Subtract();
            }
            objectScale = transform.localScale;

            Destroy (gameObject);

            Quaternion randomRotation = Quaternion.Euler(0f, 0f, Random.Range(0f, 360f));

            // Instantiate the explosion where the rock is with the random rotation. also scale according to turtle scale
            explosion.transform.localScale = new Vector3(objectScale.x*expSizeFactor, objectScale.y*expSizeFactor, 1f);
            Instantiate(explosion, objectPos, randomRotation);

        }
    }
    void Start()
    {
        // cannot attach a reference in the scene to a prefab and automatically
        // apply that to all prefabs; therefore we to have use the find method instead
        scoreController = (ScoreController) FindObjectOfType(typeof(ScoreController));
        scoreIncreased = false;
        originalColor = GetComponentsInParent<Renderer>()[1].material.color;
        shellPosition = transform.parent.transform.position;
        col = transform.GetComponent<SphereCollider>();
        scale = transform.localScale.x;

        // Choose a random texture to render
        selectedTexture = Random.Range (0, textures.Length);
        transform.parent.GetComponent<Renderer>().material.SetTexture("_MainTex", textures[selectedTexture]);

        // Assign shell score only if the rope overlaps with the shell
        shellTexture = GetComponentsInParent<Renderer>()[1].material.GetTexture("_MainTex");
        Debug.Log(shellTexture.ToString());

        if (shellTexture.ToString () == "Beige_Shell (UnityEngine.Texture2D)") {
            Debug.Log ("Value of Beige_Shell");
            valueOfShell = 10;
        } else if (shellTexture.ToString () == "Yellow_Shell (UnityEngine.Texture2D)") {
            Debug.Log ("Value of Yellow_Shell");
            valueOfShell = 20;
        } else if (shellTexture.ToString () == "Red_Shell (UnityEngine.Texture2D)") {
            Debug.Log ("Value of Red_Shell");
            valueOfShell = 30;

        }
    }
Exemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     sc = GameObject.FindGameObjectWithTag("GameController").GetComponent<ScoreController>();
     rof = .5f;
     rb = GetComponent<Rigidbody>();
     throwPoint = GameObject.FindGameObjectWithTag("MainCamera");
 }
Exemplo n.º 4
0
	void Start () 
    {                
        gmc = GameObject.FindGameObjectWithTag("GameController").GetComponent<Spawner>();
        print(gmc.sprites[gmc.num]);
		/*anim = GameObject.FindGameObjectsWithTag("animation");
		anim.SetActive(false);*/
		skeletonAnimation = GameObject.FindGameObjectWithTag("animation").GetComponent<SkeletonAnimation>();
		skeletonAnimation.enabled = true;
		gmv = GameObject.FindGameObjectWithTag("GameOver");
		cnt = GameObject.FindGameObjectWithTag("animation");
		//gmv.SetActive(false);
		gameOv =GameObject.FindGameObjectWithTag("GameOver").GetComponent<SkeletonAnimation>();
		if(this.gameObject.GetComponent<TapCounter>().enabled){
			skeletonAnimation.state.SetAnimation(0, "tap_amount_in", false);
			skeletonAnimation.state.AddAnimation(0, "tap_amount_loop", true, 0.3f);
		}
		gmv.SetActive(false);
		cnt.SetActive(true);

		/*gmv = GameObject.FindGameObjectWithTag("GameOver");
		cnt = GameObject.FindGameObjectWithTag("animation");
		gmv.SetActive(false);*/
        AudioSource[] sources = GetComponents<AudioSource>();
        tap = sources[0];
        bad = sources[1];
        good = sources[2];

		spw = GameObject.FindGameObjectWithTag("GameController").GetComponent<Spawner>();
		sc = GameObject.FindGameObjectWithTag("Score").GetComponent<ScoreController>();
		scoreCounter.text = "";

	}
Exemplo n.º 5
0
    /// <summary>
    /// Default player initialisation code.
    /// </summary>
    public void Start()
    {
        CameraFollow camFollow = Camera.mainCamera.GetComponent("CameraFollow") as CameraFollow;
        camFollow.target = this.transform;

        GameObject scoreEnt = GameObject.FindGameObjectWithTag("Score");
        _scoreController = scoreEnt.GetComponent("ScoreController") as ScoreController;
    }
	// Use this for initialization
	void Start ()
	{

		platStartPoint = platCreator.position;
		playerStartPoint = player.transform.position;

		scoreCon = FindObjectOfType<ScoreController> ();
	}
Exemplo n.º 7
0
 void Start()
 {
     controller = GetComponent<ScoreController>();
     scale = scaleInPercent / 100.0f;
     yPositionModifier = yPositionInPercent / 100.0f;
     xPositionModifier = xPositionInPercent / 100.0f;
     fontSize = (int)(11.0f * scale) / 1024 * Screen.width;
 }
Exemplo n.º 8
0
    // Use this for initialization
    private void Start()
    {
        scoreMaster = FindObjectOfType<ScoreController>();
        scoreMaster.Award(scoreValue);

        this.guiText.text = scoreValue.ToString();

        accumulatedTime = 0;
    }
Exemplo n.º 9
0
 private void GetScoreController()
 {
     try {
         scoreController = (ScoreController) GameObject.Find("ScoreController").GetComponent("ScoreController");
     } catch (Exception e) {
         Debug.Log("Couldn't retrieve the score controller object!");
         Debug.Log(e.StackTrace);
     }
 }
Exemplo n.º 10
0
        /// <summary>
        /// Start this instance.
        /// </summary>
        void Start()
        {
            guiReplay = GameObject.FindGameObjectWithTag ("GUI").GetComponent<GuiReplay>();
            scoreController = Gameplay.World.WorldSpawnManager.Instance.GetComponent<ScoreController>();
            player = GameObject.FindGameObjectWithTag ("Player");

            vehicleSound = player.GetComponent<VehicleSound> ();
            vehicleController = player.GetComponent<VehicleController>();
        }
Exemplo n.º 11
0
    // Use this for initialization
    void Start()
    {
        charController = (CharController)character.GetComponent(typeof(CharController));
        scoreController = (ScoreController)camera.GetComponent(typeof(ScoreController));
        uiController = (UIController)camera.GetComponent(typeof(UIController));

        objectPosition = GetComponent<Transform>().position;
        moveChar = false;
    }
Exemplo n.º 12
0
	// Use this for initialization
	void Start () {
        if (playerObject == null)
        {
            playerObject = GameObject.Find("Player");
        }
        moveCharacter = gameObject.GetComponent<MoveCharacter>();
        gameObject.GetComponent<Health>().OnDeath += onDeath;
        scoreController = GameObject.Find("ScoreController").GetComponent<ScoreController>();
	}
Exemplo n.º 13
0
	// Use this for initialization
	void Awake () {
		if (_instance == null)
		{
			_instance = this;
		}
		else
		{
			Debug.LogWarning("Several ScoreControllers in scene!");
		}
	}
Exemplo n.º 14
0
 // resets everything and starts a new game
 public void NewGame()
 {
     ClearAll();
     scoreController = new ScoreController();
     board = new int[ROWS][];
     occupied = new List<Cell>();
     available = new List<Cell>();
     merged = new List<Cell>();
     InitializeBoard();
     InitializeGame();
 }
Exemplo n.º 15
0
    // Use this for initialization
    void Start()
    {
        this.Ball = this.GetComponentInChildren<BallController> ();

        var paddles = this.GetComponentsInChildren<PaddleController> ();
        this.Player = paddles.Single (p => p.Character == Character.Player);
        this.Opponent = paddles.Single (p => p.Character == Character.Opponent);

        var scores = this.GetComponentsInChildren<ScoreController> ();
        this.playerScore = scores.Single (s => s.Character == Character.Player);
        this.opponentScore = scores.Single (s => s.Character == Character.Opponent);
    }
Exemplo n.º 16
0
 void Awake()
 {
     area = GetComponent<BoxCollider2D>();
     playerT = GetComponentInParent<Transform>();
     playerBC = GetComponentInParent<BoxCollider2D>();
     this.transform.position = playerT.transform.position + (playerT.transform.right * (playerBC.size.x/2 + area.size.y/2));
     attacking = false;
     euphoriaController = GetComponentInParent<EuphoriaController>();
     scoreController = GetComponentInParent<ScoreController>();
     slashController = GetComponentInChildren<SwordSlashController>();
     attackCounter = 0f;
     attackSwing = 0.5f;
 }
 // Use this for initialization
 void Awake()
 {
     timeController = GameObject.FindWithTag("TimeController");
     GameObject scoreController = GameObject.FindWithTag("ScoreController"); //create reference for Player gameobject, and assign the variable via FindWithTag at start
     if (scoreController != null) // if the playerObject gameObject-reference is not null - assigning the reference via FindWithTag at first frame -
     {
         scScript = scoreController.GetComponent<ScoreController>();// - set the PlayerController-reference (called playerControllerScript) to the <script component> of the Player gameobject (via the gameObject-reference) to have access the instance of the PlayerController script
     }
     if (scoreController == null) //for exception handling - to have the console debug the absense of a player controller script in order for this entire code, the code in the GameController to work
     {
         Debug.Log("Cannot find ScoreController script for final score referencing to GameOver - finalAcquired Label");
     }
 }
Exemplo n.º 18
0
	void Start()
	{ 
		instance = this;
		
		leftDoor = GameObject.Find ("LeftDoor");
		rightDoor = GameObject.Find ("RightDoor");
		leftExitLight = GameObject.Find ("winLightLeft");
		rightExitLight = GameObject.Find ("winLightRight");
		candleLights = GameObject.FindGameObjectsWithTag ("CandleLightTag");
		score = LevelFinishedController.instance.getNumberOfKeys ();
		numberOfPlayers = LevelFinishedController.instance.getControllers ().Count;
		fusionLight = GameObject.Find ("lightHousePointLight");
	}
Exemplo n.º 19
0
    void Start()
    {
        redFlag = GameObject.FindWithTag("RedFlag");
        blueFlag = GameObject.FindWithTag("BlueFlag");

        gameController = GameObject.FindWithTag("GameController").GetComponent<GameController>();
        scoreController = GameObject.FindWithTag("ScoreController").GetComponent<ScoreController>();
        levelController = GameObject.FindWithTag("LevelController").GetComponent<LevelController>();

        var targetMarkers = GameObject.FindWithTag("TargetMarkers");
        skillshotController = targetMarkers.transform.Find("SkillshotMarker").GetComponent<SkillshotMarkerController>();
        var moveMarker = GameObject.FindWithTag("MoveMarker");
        moveMarkerController = moveMarker.GetComponent<MoveMarkerController>();
    }
 void Start()
 {
     sc = scoreObj.GetComponent<ScoreController> ();
     vc = volumeControlObj.GetComponent<VolumeControl> ();
     foreach (Transform child in this.transform) {
         if (child.name == blockadeName){
             blockade = child.gameObject;
         }else if(child.name == unlockName){
             unlock = child.gameObject;
         }
     }
     ub = unlock.GetComponent<UnlockBehaviour> ();
     blb = blockade.GetComponent<BlockadeBehaviour> ();
 }
Exemplo n.º 21
0
    void Start()
    {
        rightSpawner = GameObject.FindGameObjectWithTag("RightSpawner").GetComponent<Spawner>();
        leftSpawner = GameObject.FindGameObjectWithTag("LeftSpawner").GetComponent<Spawner>();
        obstacleSpawnRate = 1.5f;
        nextObstacleSpawnTime = 3.0f;
        scoreController = new ScoreController();
        scoreController.ShowScore();
		obstacleMoveSpeed = 0.6f;
		foregroundMoveSpeed = 0.2f;
		middlegroundMoveSpeed = 1.0f;
		backgroundMoveSpeed = 0.08f;
		this.startTime = DateTime.Now;
    }
Exemplo n.º 22
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "gameplay" layout resource
            SetContentView(Resource.Layout.gameplay);

            // Get our button from the layout resource,
            // and attach an event to it
            scoreField = FindViewById<EditText>(Resource.Id.scoreText);

            Button button_score1 = FindViewById<Button>(Resource.Id.button_score1);
            button_score1.Click += delegate { addScore(1); };

            Button button_score10 = FindViewById<Button>(Resource.Id.button_score10);
            button_score10.Click += delegate { addScore(10); };

            Button button_score100 = FindViewById<Button>(Resource.Id.button_score100);
            button_score100.Click += delegate { addScore(100); };

            Button button_game_over = FindViewById<Button>(Resource.Id.button_game_over);
            button_game_over.Click += delegate {
                // read score from text field
                double scoreResult;
                try {
                    scoreResult = double.Parse(scoreField.Text);
                } catch(Exception) {
                    scoreResult = 0;
                }

                // this is where you should input your game's score
                Score score = new Score((Java.Lang.Double)scoreResult, null);

                // set up an observer for our request
                SubmitScoreRequestControllerObserver observer = new SubmitScoreRequestControllerObserver(this);

                // with the observer, we can create a ScoreController to submit the score
                ScoreController scoreController = new ScoreController(observer);

                // show a progress dialog while we are submitting
                ShowDialog(DIALOG_PROGRESS);

                // this is the call that submits the score
                scoreController.SubmitScore(score);
                // please note that the above method will return immediately and reports to
                // the RequestControllerObserver when it's done/failed
            };
        }
Exemplo n.º 23
0
    void Awake()
    {
        streak = 0;
        _previousTrigger = 0;
        _playerState = PlayerState.Inactive;
        _inputController = InputController.Instance;
        _rhythmController = RhythmController.Instance;
        _worldController = WorldController.Instance;
        _soundManager = SoundManager.Instance;
        _config = Config.Instance;
        _scoreController = ScoreController.Instance;
        _menuController = MenuController.Instance;
        _titleController = TitleController.Instance;
        
		feedbackAnim = GameObject.Find ("Feedbacks/Feedback" + index).GetComponent<Animator>();
    }
        static void Postfix(SaberAfterCutSwingRatingCounter saberAfterCutSwingRatingCounter, FlyingScoreEffect __instance, ref Color ____color, NoteCutInfo noteCutInfo)
        {
            void judge(SaberAfterCutSwingRatingCounter counter)
            {
                ScoreController.RawScoreWithoutMultiplier(noteCutInfo, counter, out int before_plus_acc, out int after, out int accuracy);
                int total = before_plus_acc + after;

                Config.judge(__instance, noteCutInfo, counter, total, before_plus_acc - accuracy, after, accuracy);

                // If the counter is finished, remove our event from it
                counter.didFinishEvent -= judge;
            }

            // Apply judgments a total of twice - once when the effect is created, once when it finishes.
            judge(saberAfterCutSwingRatingCounter);
            saberAfterCutSwingRatingCounter.didFinishEvent += judge;
        }
 //called when the scene is exited ?
 void OnDestroy()
 {
     if (saveCheckbox.enabled)
     {
         try {
             if (ScoreController.currentName == null || ScoreController.currentName == "")
             {
                 ScoreController.currentName = ((Text)characterName.placeholder).text;
             }
             ScoreController.saveCurrentScore();
             print("GameOverController: saved score!");
         } catch (Exception e) {
             print("Error saving score (GameOverController)");
             print(e.StackTrace);
         }
     }
 }
Exemplo n.º 26
0
 protected override void CheckOtherCollider(Collider other)
 {
     if (other.GetComponent <HomeSpot>())
     {
         rigbd.velocity = Vector3.zero;
         StartCoroutine(ResetPosition());
         if (!other.GetComponent <HomeSpot>().filled)
         {
             other.GetComponent <HomeSpot>().FillSpot(true);
             ScoreController.IncreaseScore(ScoreType.Home);
             ScoreController.IncreaseScore(ScoreType.Time);
             CheckBonus(other);
             levelController.CheckSpots();
         }
     }
     base.CheckOtherCollider(other);
 }
Exemplo n.º 27
0
    // Use this for initialization
    void Start()
    {
        BulletInterval = 0;
        //敵のインターバル
        enemyInterval = 0;
        //ハイスコア更新
        ScoreController = GameObject.Find("ARCamera").GetComponent <ScoreController>();
        //スライダーコンポーネントを取得
        slider = GameObject.Find("Slider").GetComponent <Slider> ();
        //スライダーの最大値をplayerLifeに合わせる
        //slider.maxValue = playerLife;

        GamePlay = GameObject.Find("GamePlay");
        Player   = GameObject.Find("Player");
        Enemies  = GameObject.Find("Enemies");
        Effects  = GameObject.Find("Effects");
    }
Exemplo n.º 28
0
        public IEnumerator ResetPosition()
        {
            rigbd.velocity = Vector3.zero;
            while (isMoving)
            {
                yield return(new WaitForEndOfFrame());
            }
            transform.position = startPosition;
            gameController.ResetTimer();
            DestroyLadyFrog();
            isMoving = true;
            yield return(new WaitForSeconds(moveDelay));

            isMoving = false;
            hitted   = false;
            ScoreController.ResetScoreLines();
        }
Exemplo n.º 29
0
        public IEnumerator WaitForComponentCreation()
        {
            var coordinator = Resources.FindObjectsOfTypeAll <RoomCoordinator>().FirstOrDefault();
            var match       = coordinator?.Match;

            destinationPlayers = ((bool)(coordinator?.TournamentMode) && !Plugin.UseFloatingScoreboard) ?
                                 new Guid[] { match.Leader.Id } :
            match.Players.Select(x => x.Id).Union(new Guid[] { match.Leader.Id }).ToArray();     //We don't wanna be doing this every frame
                                                                                                 //new string[] { "x_x" }; //Note to future moon, this will cause the server to receive the forwarding packet and forward it to no one. Since it's received, though, the scoreboard will get it if connected

            yield return(new WaitUntil(() => Resources.FindObjectsOfTypeAll <ScoreController>().Any()));

            yield return(new WaitUntil(() => Resources.FindObjectsOfTypeAll <AudioTimeSyncController>().Any()));

            _scoreController         = Resources.FindObjectsOfTypeAll <ScoreController>().First();
            _audioTimeSyncController = Resources.FindObjectsOfTypeAll <AudioTimeSyncController>().First();
        }
Exemplo n.º 30
0
        private static void CalculatePercentage()
        {
            //Get Max Score for song
            int songMaxScore = ScoreController.MaxScoreForNumberOfNotes(noteCount);

            float roundMultiple = 100 * (float)Math.Pow(10, progressCounterDecimalPrecision);

            pbPercent = (float)Math.Floor(localHighScore / (float)songMaxScore * roundMultiple) / roundMultiple;

            //If the ScoreCounter has already been created, we'll have to set the Personal Best from out here
            var scoreCounter = Resources.FindObjectsOfTypeAll <ScoreCounter>().FirstOrDefault();

            if (scoreCounter != null)
            {
                scoreCounter.SetPersonalBest(pbPercent);
            }
        }
Exemplo n.º 31
0
    public void SetMusicData(int difficulty, string id)
    {
        try
        {
            MusicDataLoader.MusicProperty data = GetComponent <MusicDataLoader>().getMusicProperty(id);
            if (data.level[difficulty] == -1)
            {
                return;
            }

            //Frame
            RawImage Frame = GetComponent <RawImage>();
            Frame.texture = FrameTexture[difficulty];

            //Title
            MusicTitleUI.text = data.music;

            //Credits
            CreditsUI.text = data.credits;

            //Artwork
            byte[]    bytes   = File.ReadAllBytes("Music/" + id + "/image.png");
            Texture2D texture = new Texture2D(500, 500);
            texture.LoadImage(bytes);
            ArtworkUI.texture = texture;

            //BPM
            BPMUI.text = "BPM " + GetComponent <MusicDataLoader>().getNotesData(difficulty, id).BPM.ToString();

            //Level
            LevelUI.text = data.level[difficulty].ToString();

            //Score & Combo
            ScoreController.Score temp = ScoreController.LoadScore(DataHolder.UserID, difficulty, id);
            ComboUI.text = "COMBO " + temp.MaxCombo.ToString();
            ScoreUI.text = temp.MaxScore.ToString();

            //Time
            string path = "Music/" + id + "/music.wav";
            StartCoroutine(SetAudioTime(path));
        }
        catch (Exception e)
        {
            Debug.LogError(e.Message);
        }
    }
Exemplo n.º 32
0
        protected override void OnCollect(GameObject other)
        {
            if (DoNothing)
            {
                return;
            }

            if (_scoreController == null)
            {
                _scoreController = _bootstrap.GetController(ControllerTypes.Score) as ScoreController;
            }

            if (_scoreController)
            {
                _scoreController.AddScore(Score, 0, type);
            }
        }
Exemplo n.º 33
0
        private void Start()
        {
            _steamVrPlayer.WeaponsSlot.enabled = (SceneType == SceneType.Game);
            if (SceneType == SceneType.Game)
            {
                ScoreController.StartForLevel(LevelIndex);
                Player.Instance.HealthBar.SetupForGame();
            }
            else
            {
                Player.Instance.HealthBar.Disable();
            }

            _steamVrPlayer.transform.position = StartPlayerPosition.position;
            _steamVrPlayer.transform.rotation = StartPlayerPosition.rotation;
            Time.timeScale = 1f;
        }
Exemplo n.º 34
0
 // Use this for initialization
 void Start()
 {
     //get scorer
     boardController = GetComponent <ScoreController>();
     //get all your spells
     //initiate Wizards
     GetPlayers();
     //
     //give spells to wizards
     foreach (PlayerController player in players)
     {
         //add 5 random spells
         AddSpells(player);
         //send reference of self
         player.myDad = this;
     }
 }
Exemplo n.º 35
0
 // Update is called once per frame
 void Update()
 {
     if (NumOfLitDoors() >= m_lights.Count && !m_doorHasSlided)
     {
         ScoreController.GetInstance().AddDoorScore(m_colorSet);
         if (m_colorSet == ColorSet.PURPLE)
         {
             PlayPurpleDoorUnlockAnim();
         }
         else
         {
             SlideOrangeDoor();
         }
         m_doorHasSlided = true;
         //m_doorIsDestroyed = true;
     }
 }
Exemplo n.º 36
0
        public SnakeApplication()
        {
            InitializeComponent();
            //Application.Idle += HandleApplicationIdle;
            var board = CreateBoard();
            var snake = SnakeCreator.CreateSnake(board);

            this.inputController     = new InputController();
            this.snakeController     = new SnakeController(board, snake);
            this.collisionDetector   = new SnakeFoodCollisionController(board, snake);
            this.snakeFoodController = new SnakeFoodController(board);
            this.scoreController     = new ScoreController(new Score());

            InitializeRenderers();
            InitializeObservers();
            InitializeTimer();
        }
Exemplo n.º 37
0
    // Use this for initialization
    void Start()
    {
        cutSource = Camera.main.transform.Find("Cut Source").GetComponent <AudioSource>();
        GameObject gameControllerObject = GameObject.Find("ScoreControllers");

        if (gameControllerObject != null)
        {
            scoreController = gameControllerObject.GetComponent <ScoreController>();
        }
        if (scoreController == null)
        {
            Debug.Log("Cannot find 'ScoreController' script");
        }
        int random = Random.Range(0, clips.Length);

        GetComponent <AudioSource>().PlayOneShot(clips[random]);
    }
Exemplo n.º 38
0
    /// <summary>
    /// ダメージ適応処理
    /// </summary>
    public override void ApplyDamage(int damage)
    {
        // ダメージ適応
        hp -= damage;

        // hpチェック
        if (hp <= 0)
        {
            // 0以下の場合

            // 音楽の停止
            audioManager.StopSound();

            // 破壊SEの再生
            audioManager.PlaySE(audioManager.DestroySE.name);

            // スコア加算
            ScoreController.AddScore(EnemyData.Score);

            // 撃破数を加算
            ResultPanelController.TempEnemyKillCount++;

            // プレイヤーレベル加算
            PlayerListsController.LevelUp();

            // ボスの位置にパーティクルシステムを配置
            DestroyDirection.transform.position = transform.position;

            // パーティクルシステムを再生
            DestroyDirection.Play();

            // 表示
            EndMessagePanel.SetActive(true);

            // 破棄する
            Destroy(gameObject);
        }
        else
        {
            // 1以上の場合

            // ダメージSEを再生
            audioManager.PlaySE(audioManager.DamageSE.name);
        }
    }
        public void UpdateScore(int score)
        {
            if (_objectRatingRecorder != null)
            {
                List <BeatmapObjectExecutionRating> _ratings = ReflectionUtil.GetPrivateField <List <BeatmapObjectExecutionRating> >(_objectRatingRecorder, "_beatmapObjectExecutionRatings");
                if (_ratings != null)
                {
                    int notes = 0;
                    foreach (BeatmapObjectExecutionRating rating in _ratings)
                    {
                        if (rating.beatmapObjectRatingType == BeatmapObjectExecutionRating.BeatmapObjectExecutionRatingType.Note)
                        {
                            notes++;
                        }
                    }
                    _maxPossibleScore = ScoreController.MaxScoreForNumberOfNotes(notes);
                }
            }

            if (_scoreMesh != null)
            {
                if (_maxPossibleScore == 0)
                {
                    _scoreMesh.text = "100.0%";
                    _RankText.text  = "SSS";
                }
                else
                {
                    float ratio = score / (float)_maxPossibleScore;
                    //Force percent to round down to decimal precision
                    ratio = (float)Math.Floor(ratio * roundMultiple) / roundMultiple;
                    if (Plugin.pbPercent != 0 && Plugin.pbPercent > ratio)
                    {
                        _scoreMesh.color = Color.red;
                    }
                    else if (Plugin.pbPercent != 0 && Plugin.pbPercent < ratio)
                    {
                        _scoreMesh.color = Color.white;
                    }

                    _scoreMesh.text = (Mathf.Clamp(ratio, 0.0f, 1.0f) * 100.0f).ToString("F" + Plugin.progressCounterDecimalPrecision) + "%";
                    _RankText.text  = GetRank(score, ratio);
                }
            }
        }
Exemplo n.º 40
0
    private void GameOver()
    {
        Time.timeScale = 0.0f;
        GameOverPanel.SetActive(true);

        if (isSinglePlayer)
        {
            // If current score is a high score, update and say "New High Score"
            if (!hasUpdatedScore)
            {
                if (ScoreController.isHighScore())
                {
                    hasUpdatedScore = true;
                    ScoreController.updateHighScore();
                }
            }
        }
    }
Exemplo n.º 41
0
 void Initialize()
 {
     Time.timeScale = 1;
     sc             = FindObjectOfType <ScoreController>();
     Canvas[] canvases = FindObjectsOfType <Canvas>();
     foreach (Canvas canvas in canvases)
     {
         if (canvas.gameObject.name == "JoystickCanvas")
         {
             Debug.Log("CANVASFINDED");
             joystick = canvas;
             joystick.gameObject.SetActive(false);
             joystick.gameObject.SetActive(true);
             //RectTransform joystickRect = joystick.GetComponent<RectTransform>();
             //joystickRect.SetAsLastSibling();
         }
     }
 }
Exemplo n.º 42
0
 protected void Awake()
 {
     this.GameBoardObjects       = GameObject.FindObjectsOfType <AttackableModule>();
     this.NumberOfAttacksPerTurn = Options.Attacks;
     this.NumberOfOracles        = Options.Oracles;
     this.oracles          = new List <Oracle>();
     this.AttackerUIObject = GameObject.FindGameObjectWithTag("Attacker").GetComponent <AttackerUI>();
     this.DefenderUIObject = GameObject.FindGameObjectWithTag("Defender").GetComponent <DefenderUI>();
     this.ScoreController  = GameObject.FindGameObjectWithTag("ScoreController").GetComponent <ScoreController>();
     TurnText.gameObject.SetActive(true);
     ScreenCover.gameObject.SetActive(false);
     ScreenCover.fillCenter = true;
     AttackerUIObject.SetRoundText("Round: " + Round + "/" + RoundLimit);
     DefenderUIObject.SetRoundText("Round: " + Round + "/" + RoundLimit);
     this.WaterLeavingSystemOnLastTurnChange = new List <WaterObject>();
     AttackerUICover.gameObject.SetActive(false);
     DefenderUICover.gameObject.SetActive(false);
 }
Exemplo n.º 43
0
    void Start()
    {
        //Activa el cursor
        Cursor.visible = true;

        //Obtiene los componentes necesarios (vidas y puntuación del Player y texto donde se muestra)
        text            = GetComponent <TextMeshProUGUI>();
        livesObject     = GameObject.Find("Lives");
        scoreObject     = GameObject.Find("Score");
        scoreController = (ScoreController)scoreObject.GetComponent("ScoreController");

        //Cambia el valor de la puntuación
        text.text = "Tiempo total: " + scoreController.score;

        //Borra los elementos mostrados en pantalla heredados por DontDestroyOnLoad() de la escena anterior
        Destroy(scoreObject);
        Destroy(livesObject);
    }
Exemplo n.º 44
0
    void Start()
    {
        star1 = GameObject.Find("Star1").GetComponent <UISprite>();
        star2 = GameObject.Find("Star2").GetComponent <UISprite>();
        star3 = GameObject.Find("Star3").GetComponent <UISprite>();
        GameObject temp = GameObject.Find("ScoreController");

        if (temp == null)
        {
            Debug.Log("Unable to find ScoreController GameObject.");
            this.gameObject.SetActive(false);
        }
        scoreController = temp.GetComponent <ScoreController>();
        setStars();
        setText();
        increaseSP();
        Destroy(temp);
    }
Exemplo n.º 45
0
        public async Task ScoreIndexTest()
        {
            var mock = new Mock <IScoreService>();

            mock.Setup(repo => repo.GetAll()).Returns(GetScoreIndexModels());
            var controller = new ScoreController(mock.Object);

            // Act
            var result = await controller.Index();

            var testResult = await GetScoreIndexModels();

            // Assert
            var viewResult = Assert.IsType <ActionResult <List <ScoreIndexModel> > >(result);
            var model      = Assert.IsAssignableFrom <IEnumerable <ScoreIndexModel> >(viewResult.Value);

            Assert.Equal(testResult.Count, model.Count());
        }
Exemplo n.º 46
0
    // Use this for initialization
    void Start()
    {
        sprites = new ArrayList();
        sprites.Add(sprite1);
        sprites.Add(sprite2);
        sprites.Add(sprite3);
        sprites.Add(sprite4);
        sprites.Add(sprite5);
        sprites.Add(sprite6);
        sprites.Add(sprite7);
        sprites.Add(sprite8);
        sprites.Add(sprite9);
        sprites.Add(sprite10);

        scoreController = GameObject.Find("score").GetComponent <ScoreController> ();
        timerController = GameObject.Find("timer").GetComponent <TimerController> ();
        readyEvent      = GameObject.Find("ready_event").GetComponent <ReadyEvent> ();
    }
Exemplo n.º 47
0
    public void saveHighScore()    //new for menu 2
    {
        LevelStore ls = new LevelStore();

        for (int x = 0; x < levels.Length; x++)
        {
            if (levels [x].levelName == curLevel)
            {
                ls = levels [x];
            }
        }

        ScoreController sc = GameObject.FindGameObjectWithTag("GameController").GetComponent <ScoreController> ();

        Debug.Log("Saving high score " + sc.getScore() + " For level " + curLevel);
        ls.save(sc.getScore());
        checkForLevelUnlocked();
    }
Exemplo n.º 48
0
 override public void tap()
 {
     Destroy(gameObject);
     if (perfect)
     {
         ScoreController.getInstance().addPerfectScore();
         Debug.Log("Perfect");
     }
     else if (good)
     {
         ScoreController.getInstance().addGoodScore();
         Debug.Log("Good");
     }
     else
     {
         Debug.Log("Bad");
     }
 }
Exemplo n.º 49
0
    // Use this for initialization
    void Start()
    {
        colorList = new List <Material>();
        colorList.Add(blue);
        colorList.Add(green);
        colorList.Add(yellow);
        colorList.Add(red);

        GameObject scoreContainer = GameObject.Find("Score");

        scoreController = scoreContainer.GetComponent <ScoreController> ();

        GameObject drContainer = GameObject.Find("DR Container");

        drController = drContainer.GetComponent <DRController> ();

        SetInterval();
    }
Exemplo n.º 50
0
    //Will load back to menu screen and grab all data from the current scene before transitioning if not tutorial
    public void LoadMenu(MenuState state)
    {
        float wait = 6f;

        if (isGame)
        {
            currentLevel += 1;
            ScoreController score = FindObjectOfType <ScoreController>();
            LivesController lives = FindObjectOfType <LivesController>();
            currentScore = score.GetScore();
            currentLives = lives.GetLives();
            wait         = 3f;
        }
        isGame      = false;
        sceneLoader = FindObjectOfType <SceneLoader>();
        currentMenu = state;
        sceneLoader.LoadMenu(wait);
    }
Exemplo n.º 51
0
    void Start()
    {
        if (Application.loadedLevelName.Contains("7"))
        {
            spawns = GameObject.FindGameObjectWithTag("Spawner").GetComponent <GiantbugFrtSpawns> ();
        }
        else
        {
            spawns = GameObject.FindGameObjectWithTag("Spawner").GetComponent <FruitSpawns> ();
        }
        poolingSystem = PoolingSystem.Instance;

        dragged    = false;
        burpy      = GameObject.FindGameObjectWithTag("Burpy").GetComponent <Burpy> ();
        controller = GameObject.FindGameObjectWithTag("GameController").GetComponent <ScoreController>();
        prtclpos   = new Vector3(0.0f, 4.0f, 0.0f);
        camPos     = GameObject.Find("Main Camera").transform.position;
    }
Exemplo n.º 52
0
        public MainWindow()
        {
            InitializeComponent();
            ScoreController.LoadScoreBoard();
            AudioPlayer.Load("on_dead", AppDomain.CurrentDomain.BaseDirectory + "Music/on_dead.wav", false);
            AudioPlayer.Load("background", AppDomain.CurrentDomain.BaseDirectory + "Music/temp_back.wav", true);
            AudioPlayer.Load("on_coin_collide", AppDomain.CurrentDomain.BaseDirectory + "Music/coin.wav", false);
            AudioPlayer.Load("enemy_getbackhere", AppDomain.CurrentDomain.BaseDirectory + "Music/enemy_getbackhere.wav", false);
            AudioPlayer.Load("sucktion", AppDomain.CurrentDomain.BaseDirectory + "Music/SUCTION.wav", false);
            AudioPlayer.Load("boom", AppDomain.CurrentDomain.BaseDirectory + "Music/boom.wav", false);

            AudioPlayer.Soundtrack.First(o => o.Key == "background").Value.player.Volume = 1.2;
            AudioPlayer.Play("background");
            gm = new GameMaker(this, 800, 600);
            gm.InitializeGame(PrepareMenus());
            Camera.OnFall           += Player_Fell;
            PhysicalObject.Collided += ObjectInteraction;
        }
    void Awake()
    {
        // Pseudo-singleton
        if (Instance == null)
        {
            DontDestroyOnLoad(gameObject);
            Instance = this;
        }
        else if (Instance != this)
        {
            Destroy(gameObject);
        }

        //Instantiate(Resources.Load("RandomSeeder"));

        activeScene = SceneManager.GetActiveScene();
        SceneManager.activeSceneChanged += UpdateActiveScene;
    }
Exemplo n.º 54
0
	void Start ()
    {
        var gameControllerObj = GameObject.FindWithTag("GameController");
        if (gameControllerObj == null)
        {
            Application.LoadLevel(0);
            return;
        }
        gameController = gameControllerObj.GetComponent<GameController>();
        scoreController = GameObject.FindWithTag("ScoreController").GetComponent<ScoreController>();

        heroes = new Dictionary<string, GameObject>();
        creepSpawnPoints = GameObject.FindGameObjectsWithTag("CreepSpawner");

        var minimap = GameObject.FindWithTag("Minimap").GetComponent<MinimapController>();
        minimap.Track(redFlag.transform, MinimapIconType.RedFlag);
        minimap.Track(blueFlag.transform, MinimapIconType.BlueFlag);
	}
Exemplo n.º 55
0
 // Use this for initialization
 void Start()
 {
     score = GameObject.Find("Score").GetComponent<ScoreController>();
 }
Exemplo n.º 56
0
 // Use this for initialization
 void Start()
 {
     scoreController = GameObject.Find("MyCanvas").GetComponent<ScoreController>();
 }
Exemplo n.º 57
0
 void Start()
 {
     dbManager = GameObject.Find ("DatabaseManager").GetComponent<ScoreController> ();
 }
Exemplo n.º 58
0
 void OnDestroy()
 {
     GameObject temp = GameObject.FindWithTag ("GameController");
     if (temp != null) target = temp.GetComponent<ScoreController>();
     if (target != null) target.AddScore (score);
 }
Exemplo n.º 59
0
 public ScoreController()
 {
     Instance = this;
 }
Exemplo n.º 60
0
 //||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 //                             _CORE PROCESSES_
 // START
 // Use this for initialization
 void Start()
 {
     Application.targetFrameRate = 60;
     //currentSong = Overseer.selectedSong;
     currentSong = TestSong.getTestSong();
     Overseer.songScore = 0;
     Debug.Log (currentSong.SongName);
     Debug.Log(currentSong.LoopList[0].SongName);
     currentLoop = currentSong.LoopList[0];
     loopRepetition = 1;
     timer = new TimingManager(currentLoop.BeatsPerMinute);
     graphics = GameObject.FindObjectOfType<GraphicsManager>();
     levels = GameObject.FindObjectOfType<LevelManager>();
     inputManager = GameObject.FindObjectOfType<InputManager>();
     sounds = GameObject.FindObjectOfType<SoundManager>();
     score = FindObjectOfType<ScoreController>();
     beatNo = timer.currentBeat();
     // Find the first edge.
     currentEdge = currentLoop.EdgeList[0];
     currentNode = currentEdge.FromNode;
     endNode = currentLoop.NodeList[currentLoop.NodeList.Count - 1];
     if (currentNode.StartNode){
         startNode = currentNode;
         //Debug.Log("All loaded, we're good to go! - " + ((double)(Time.time - TimingManager.StartTime)).ToString());
         //Debug.Log(currentNode.NodeName + " " + CurrentNode.NodeType.ToString());
     }
     playerEdge = currentEdge;
     playerNode = currentNode;
     graphics.beginGraphicsProcess();
     loaded = true;
 }