Наследование: 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;

        }
    }
Пример #3
0
 // Use this for initialization
 void Start()
 {
     sc = GameObject.FindGameObjectWithTag("GameController").GetComponent<ScoreController>();
     rof = .5f;
     rb = GetComponent<Rigidbody>();
     throwPoint = GameObject.FindGameObjectWithTag("MainCamera");
 }
Пример #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 = "";

	}
Пример #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> ();
	}
Пример #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;
 }
Пример #8
0
    // Use this for initialization
    private void Start()
    {
        scoreMaster = FindObjectOfType<ScoreController>();
        scoreMaster.Award(scoreValue);

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

        accumulatedTime = 0;
    }
Пример #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);
     }
 }
        /// <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>();
        }
Пример #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;
    }
Пример #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>();
	}
Пример #13
0
	// Use this for initialization
	void Awake () {
		if (_instance == null)
		{
			_instance = this;
		}
		else
		{
			Debug.LogWarning("Several ScoreControllers in scene!");
		}
	}
Пример #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();
 }
Пример #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);
    }
Пример #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");
     }
 }
Пример #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");
	}
Пример #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> ();
 }
Пример #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;
    }
Пример #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
            };
        }
Пример #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);
         }
     }
 }
Пример #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);
 }
Пример #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");
    }
Пример #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();
        }
Пример #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();
        }
Пример #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);
            }
        }
Пример #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);
        }
    }
Пример #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);
            }
        }
Пример #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;
        }
Пример #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;
     }
 }
Пример #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;
     }
 }
Пример #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();
        }
Пример #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]);
    }
Пример #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);
                }
            }
        }
Пример #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();
                }
            }
        }
    }
Пример #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();
         }
     }
 }
Пример #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);
 }
Пример #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);
    }
Пример #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);
    }
Пример #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());
        }
Пример #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> ();
    }
Пример #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();
    }
Пример #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");
     }
 }
Пример #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();
    }
Пример #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);
    }
Пример #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;
    }
Пример #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;
    }
Пример #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);
	}
Пример #55
0
 // Use this for initialization
 void Start()
 {
     score = GameObject.Find("Score").GetComponent<ScoreController>();
 }
Пример #56
0
 // Use this for initialization
 void Start()
 {
     scoreController = GameObject.Find("MyCanvas").GetComponent<ScoreController>();
 }
Пример #57
0
 void Start()
 {
     dbManager = GameObject.Find ("DatabaseManager").GetComponent<ScoreController> ();
 }
Пример #58
0
 void OnDestroy()
 {
     GameObject temp = GameObject.FindWithTag ("GameController");
     if (temp != null) target = temp.GetComponent<ScoreController>();
     if (target != null) target.AddScore (score);
 }
Пример #59
0
 public ScoreController()
 {
     Instance = this;
 }
Пример #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;
 }