Inheritance: MonoBehaviour
コード例 #1
0
    void Start()
    {
        attachingCreature = false;
        mainHead          = GameObject.Find("Pool").GetComponent <ScalePool>().mainHead;
        secondaryHead     = false;

        score     = GameObject.Find("Score").GetComponent <ScoreCounter> ();
        tempscore = 1;

        StartCoroutine(goToPlayer());

        //Подгрузка данных для ограничения движения змеи
        float width  = Camera.main.pixelWidth;
        float height = Camera.main.pixelHeight;

        screenSize    = Camera.main.ScreenToWorldPoint(new Vector2(width, height));
        pointOnCircle = randomPiontOnCircle();
        direction     = new Vector3(pointOnCircle.x, pointOnCircle.y, 0f);

        if (firstStart)
        {
            transform.position = new Vector3(Random.Range(-screenSize.x, screenSize.x), screenSize.y + 2);
            startPoint         = new Vector3(Random.Range(-screenSize.x, screenSize.x), Random.Range(-screenSize.y, screenSize.y), 0);
        }
        player = GameObject.Find("Player");
    }
コード例 #2
0
    //INISIALISASI VARIABEL OBJEK LEMPAR BESERTA KOMPONENNYA KETIKA PROGRAM BARU DIJALANKAN
    void Start()
    {
        slingFx = GameObject.Find("SlingSound").GetComponent <AudioSource>();
        srJawab = GetComponent <SpriteRenderer>();
        //sjJawab.frequency = 3f;
        scoring                = GameObject.Find("Score").GetComponent <ScoreCounter>();
        diagram                = GameObject.Find("Samping").GetComponent <Transform>();
        cldJawab.isTrigger     = true;
        rbJawab.freezeRotation = true;
        cam              = GameObject.FindWithTag("MainCamera").GetComponent <Camera>();
        thrown           = false;
        tandaTanya       = new GameObject[5];
        jawaban          = new GameObject[5];
        sistemUtama      = GameObject.Find("ScriptUtama");
        sistemScript     = sistemUtama.GetComponent <Global>();
        rbJawab.bodyType = RigidbodyType2D.Static;
        //LERP
        //startMarker = GetComponent<Transform>();
        endMarker     = sling.transform;
        startTime     = Time.time;
        journeyLength = Vector3.Distance(startMarker.position, endMarker.position);
        speed         = 0.1f;
        tfJawab       = this.GetComponent <Transform>();

        /*
         * soal = 0; //soal pertama dimulai dengan angka 0
         * jawaban[0] = GameObject.Find("jawaban1");
         * jawaban[1] = GameObject.Find("jawaban2");
         * tandaTanya[0] = GameObject.Find("tandaTanya1");
         * tandaTanya[1] = GameObject.Find("tandaTanya2");
         */
    }
コード例 #3
0
    void OnDestroy()
    {
        GameObject   go = GameObject.Find("Score");
        ScoreCounter sc = (ScoreCounter)go.GetComponent(typeof(ScoreCounter));

        sc.ResetScore();
    }
コード例 #4
0
    void Start()
    {
        messagecontrols = FindObjectOfType <MessageController>();
        rigidBody       = GetComponent <Rigidbody2D>();
        playerAnimation = GetComponent <Animator>();
        afterflightCC   = FindObjectOfType <AfterFlightCollisionController>();
        navscripts      = FindObjectOfType <NavScripts>();
        audiomanager    = AudioManager.instance;
        scorecount      = FindObjectOfType <ScoreCounter>();
        respawnpoint    = FindObjectOfType <RespawnPointControls>();
        loadscene       = FindObjectOfType <LoadScene>();
        scorecounter    = FindObjectOfType <ScoreCounter>();
        helpcontrol     = FindObjectOfType <HelpController>();
        if (isReloaded)
        {
            //Debug.Log(shouldShowHelp);
            //Debug.Log(respawnpoint.GetRespawnPoint());
            this.transform.position = respawnpoint.GetRespawnPoint();

            //if (shouldShowHelp)
            //{
            /// StartCoroutine(MessageShow());
            // shouldShowHelp = false;
            //}
            isReloaded = false;
        }
        levelNav = FindObjectOfType <LevelNavControl>();
    }
コード例 #5
0
    public void initPos(PongPlayerController playerController, ScoreCounter _scoreCounter)
    {
        isBouncing   = false;
        scoreCounter = _scoreCounter;
        rb           = GetComponent <Rigidbody2D>();

        Vector3 pos = playerController.transform.position;

        sr = GetComponent <SpriteRenderer>();
        float radius = sr.bounds.extents.x + playerController.GetComponent <SpriteRenderer>().bounds.extents.x;

        if (playerController.isPlayerRight)
        {
            pos.x -= radius;
            dir    = new Vector3(-1, 0, 0);
        }
        else
        {
            pos.x += radius;
            dir    = new Vector3(1, 0, 0);
        }

        transform.position = pos;
        Debug.Log("set parent to player paddle");
        transform.SetParent(playerController.transform);
    }
コード例 #6
0
ファイル: JumpedOn.cs プロジェクト: MuMuGui/Inkblot
 void Start()
 {
     turnedGood = 0;
     touched    = transform.parent.GetComponent <EnemyScript>();
     activate   = GameObject.FindWithTag("score").GetComponent <ScoreCounter>();
     splat      = GetComponent <AudioSource>();
 }
コード例 #7
0
    private void OnTriggerEnter(Collider other)
    {
        var ship = other.GetComponent <SpaceShip>();

        if (ship != null)
        {
            if (ship.GetOwner() != ownerName)
            {
                var hp     = ship.GetHP();
                var result = ship.Damage(GameParams.GetProjectileInfo(type).damage);
                if (result <= 0)
                {
                    ScoreCounter.AddScore(ownerName, 100);
                }
                else
                {
                    ScoreCounter.AddScore(ownerName, hp - result);
                }
                Destruct();
            }
        }
        else
        {
            if (other.name.Contains("Planet"))
            {
                Destruct();
            }
            if (other.name.Contains("Asteroid"))
            {
                other.GetComponent <Asteroid>().Destruct();
                Destruct();
            }
        }
    }
コード例 #8
0
 void Start()
 {
     // When the ScoreCounter starts up, it should set the global singleton to itself...
     ScoreCounter.singleton = this;
     // ...and show a "0" on screen
     ResetScore();
 }
コード例 #9
0
        static void Main(string[] args)
        {
            int[] kast   = { 1, 2, 3, 6, 6 };
            int   status = ScoreCounter.ScoreSingleSum(6, kast);

            Console.WriteLine(status);
        }
コード例 #10
0
    public void Update()
    {
        if (renderer.isVisible)
        {
            return;
        }

        var screenPos = Camera.main.WorldToScreenPoint(transform.position);

        if (screenPos.x > 0.9f * Screen.width)
        {
            ScoreCounter.Increase(ScoreCounter.Direction.Right);
        }
        else if (screenPos.x < 0.1f * Screen.width)
        {
            ScoreCounter.Increase(ScoreCounter.Direction.Left);
        }
        else if (screenPos.y > 0.9f * Screen.height)
        {
            ScoreCounter.Increase(ScoreCounter.Direction.Top);
        }
        else if (screenPos.y < 0.1f * Screen.height)
        {
            ScoreCounter.Increase(ScoreCounter.Direction.Bottom);
        }

        Destroy(gameObject);
    }
コード例 #11
0
 // Start is called before the first frame update
 void Start()
 {
     UIPannel.gameObject.SetActive(false);
     isPaused       = false;
     scoreCounter   = GameObject.Find("GameController").GetComponent <ScoreCounter>();
     gameController = GameObject.Find("GameController").GetComponent <GameController>();
 }
コード例 #12
0
    // Use this for initialization
    void Start()
    {
        adManager = FindObjectOfType <AdManager>();

        GetScore();
        Debug.Log("playCount: " + playCount);
        Time.timeScale = 0;
        if (playCount > 3)
        {
            int randomChance = Random.Range(0, 2);
            Debug.Log(randomChance);
            if (randomChance == 1)
            {
                adManager.ShowStandardVideoAd();
                playCount = 0;
            }
        }
        Time.timeScale = 1;

        flappy           = GameObject.Find("Flappy");
        flappyController = flappy.GetComponent <FlappyController>();
        flappyRB         = flappy.GetComponent <Rigidbody2D>();
        startCanvas      = GameObject.Find("StartCanvas");
        gameOverCanvas   = GameObject.Find("GameOverCanvas");
        gameOverCanvas.SetActive(false);
        obstacleSpawner = GameObject.Find("ObstacleSpawner");
        os = obstacleSpawner.GetComponent <ObstacleSpawner>();
        sc = gameOverCanvas.GetComponent <ScoreCounter>();

        score = 0;
        UpdateScore();
    }
コード例 #13
0
    protected void OnMouseDown()
    {
        if (ST_PuzzleDisplay.CanMove && !ST_PuzzleDisplay.Instance.Complete)
        {
            ST_PuzzleDisplay.CanMove = false;

            var gridLocation = GridLocation;
            var movePosition = this.transform.parent.GetComponent <ST_PuzzleDisplay>().GetTargetLocation(this.GetComponent <ST_PuzzleTile>());

            if (movePosition == TargetPosition)
            {
                ST_PuzzleDisplay.CanCount = false;
            }

            if (ST_PuzzleDisplay.CanCount)
            {
                ST_PuzzleDisplay.Moves.Add(new STPuzzleMove((int)gridLocation.x, (int)gridLocation.y));
                ST_PuzzleDisplay.PuzzleMoves++;
                ScoreCounter.AddScore();
                ST_PuzzleDisplay.Instance.AudioSource.PlayOneShot(ST_PuzzleDisplay.Instance.OnMoveSound);
            }

            ST_PuzzleDisplay.CanCount = true;

            // get the puzzle display and return the new target location from this tile.
            LaunchPositionCoroutine(movePosition);
        }
    }
コード例 #14
0
    public GUIStyle guistyle;             // 폰트 스타일.

    void Start()
    {
        resultCanvas.SetActive(false); // 결과창 꺼놓음
        // BlockRoot 스크립트를 가져온다.
        this.block_root = this.gameObject.GetComponent <BlockRoot>();

        this.block_root.create(); // create() 메서드에서 초기 설정

        // BlockRoot 스크립트의 initialSetUp()을 호출한다.
        this.block_root.initialSetUp();

        // ScoreCounter 가져오기

        this.score_counter = this.gameObject.GetComponent <ScoreCounter>();

        //this.heart_counter = this.gameObject.GetComponent<ScoreCounter>();
        //this.diamond_counter= this.gameObject.GetComponent<ScoreCounter>();
        //this.spade_counter = this.gameObject.GetComponent<ScoreCounter>();
        //this.clober_counter = this.gameObject.GetComponent<ScoreCounter>();

        this.next_step         = STEP.PLAY; // 다음 상태를 '플레이 중'으로.
        this.guistyle.fontSize = 24;        // 폰트 크기를 24로.

        totalScore.text = "0";
    }
コード例 #15
0
 /// <summary>
 /// Gather and Set Necessary Components, GameObjects, Values, and States
 /// </summary>
 private void InitializePlayer()
 {
     // Components
     playerBody           = GetComponent <SpriteRenderer>();
     myRigidBody          = GetComponent <Rigidbody2D>();
     anim                 = GetComponent <Animator>();
     playerGroundCollider = GetComponent <CapsuleCollider2D>();
     playerRend           = GetComponent <Renderer>();
     playerColor          = playerBody.color;
     // Game Object References
     spawnPoint         = GameObject.Find("SpawnPoint");
     spawnPointLocation = spawnPoint.transform;
     lifeCounter        = FindObjectOfType <LifeCounter>();
     scoreCounter       = FindObjectOfType <ScoreCounter>();
     HealthMeter        = GameObject.Find("PlayerHealthMeter");
     HealthAnim         = HealthMeter.GetComponent <Animator>();
     whatIsGround       = LayerMask.GetMask("Ground");
     groundCheck        = gameObject.transform.GetChild(0); //Retrieves the transform component from the child named GroundCheck
     attackPoint        = gameObject.transform.GetChild(1); //Retrieves the transform component from the child named AttackPoint
     // Values
     PlayerHealth = fullHealth;
     // States
     attackPoint.gameObject.SetActive(false);
     allowMoveInput   = true;
     beingKnockedback = false;
     isDamagable      = true;
 }
コード例 #16
0
 private void OnValidate()
 {
     if (_scoreCounter == null)
     {
         _scoreCounter = FindObjectOfType <ScoreCounter>();
     }
 }
コード例 #17
0
    // Use this for initialization
    void Start()
    {
        scoreCounter = GameObject.Find("ScoreCounter");
        finalscore   = scoreCounter.GetComponent <ScoreCounter>();

        this.Great   = GameObject.Find("GreatResult");
        this.Good    = GameObject.Find("GoodResult");
        this.Bad     = GameObject.Find("BadResult");
        this.Miss    = GameObject.Find("MissResult");
        this.Score   = GameObject.Find("ScoreResult");
        this.Percent = GameObject.Find("percent");

        great = finalscore.great;
        good  = finalscore.good;
        bad   = finalscore.bad;
        miss  = finalscore.totalnotes - (great + good + bad);

        score = great * 100 + good * 50 + bad * 10;

        percent = score / finalscore.totalnotes;

        a = 0;
        b = 0;
        c = 0;
        d = 0;
        e = 0;
        f = 0f;
    }
コード例 #18
0
 public void Awake()
 {
     _isLeftPlayer = gameObject.name == "LeftPlayer";
     _ball         = GameObject.Find("Ball");
     animator      = GetComponent <Animator>();
     scoreCounter  = GameObject.Find("LevelController").GetComponent <ScoreCounter>();
 }
コード例 #19
0
 public void Start()
 {
     wordManager   = FindObjectOfType <WordManager>();
     healthManager = FindObjectOfType <HealthManager>();
     gameManager   = FindObjectOfType <GameManager>();
     scoreCounter  = FindObjectOfType <ScoreCounter>();
 }
コード例 #20
0
ファイル: GameManager.cs プロジェクト: JoeMatulka/Slam-Royale
    public void StartNewGame()
    {
        CleanUpScene();

        if (GameDataManager.Instance.HighScore == 0)
        {
            m_gamePaused = true;
            howToPlayScreen.Show(false);
        }
        else
        {
            gameHUD.Show();
        }

        scoreCounter = GameObject.Find("Score").GetComponent <ScoreCounter>();
        scoreCounter.ResetScore();

        GameObject playerGO = Instantiate(ResourceManager.Instance.Player,
                                          PLAYER_SPAWN_POS,
                                          Actor.FACE_LEFT) as GameObject;

        player = playerGO.GetComponent <Player>();
        Camera.main.GetComponent <GameCamera>().Target = player.transform;

        InvokeRepeating("SpawnEnemy", 3f, 5f);

        SoundManager.Instance.BellRing(AudioSource);
    }
コード例 #21
0
ファイル: LoseScript.cs プロジェクト: R1msky/Unity-Game
 void Start()
 {
     Debug.Log(count);
     _score  = GameObject.Find("ScoreCounter").GetComponent <ScoreCounter> ();
     _record = GameObject.Find("SceneController").GetComponent <SaveRecord> ();
     canvas.SetActive(false);
 }
コード例 #22
0
ファイル: checker.cs プロジェクト: MagFer/Tetriculus
	// Use this for initialization
	void Start () {
		figure='ñ';
		respawnBucle = 0;
		this.timeGrow = 0;
		initialScale = this.transform.localScale;
		// inicialize livesObject
		livesObject = GameObject.Find ("HearthController");
		scriptLives = livesObject.GetComponent<HearthController> ();
		// inicialize scoreObject
		scoreObject = GameObject.Find ("UIText");
		scriptScore = scoreObject.GetComponent<ScoreCounter>();
		correctChecket = 0;
		// initialize marcador3D
		marcador3D = GameObject.Find ("marcador3D");
		marcador3D_Script = marcador3D.GetComponent<marcador3D>(); 
		marcador3D_Script.enabled = false;
		marcador3D_mesh = marcador3D.GetComponent<MeshRenderer>(); 
		
		// Obrim el port del Arduino
		codeObject.Open();
		// Fixem una tasa de refresc per comprobar la entrada
		codeObject.ReadTimeout = 1;

		//Instantiate (cylinder, cylinder.transform.position, Quaternion.identity);
	}
コード例 #23
0
ファイル: MeloenPowerup.cs プロジェクト: Li-Yeun/Pacman
    private void RpcCollision()
    {
        ScoreCounter fruitscore = FindObjectOfType <ScoreCounter>();

        fruitscore.FruitPoints();
        gameObject.GetComponent <SphereCollider>().enabled = false;
        foreach (MeshRenderer meshrender in gameObject.GetComponentsInChildren <MeshRenderer>())
        {
            meshrender.enabled = false;
        }
        foreach (Movement movement in FindObjectsOfType <Movement>())
        {
            movement.reversecontrols = true;
            StartCoroutine(Resett(movement));
        }
        if (FindObjectsOfType <melonTimer>().Length == 1)
        {
            melonTimer timerAnimation = FindObjectOfType <melonTimer>();
            timerAnimation.MelonTimer();
        }
        PlayerOnline[] Players = FindObjectsOfType <PlayerOnline>();
        foreach (PlayerOnline player in Players)
        {
            player.AddToGridList((int)gameObject.transform.localPosition.x, (int)gameObject.transform.localPosition.z);
        }
    }
コード例 #24
0
        private void StartCheckingForMove(MatchingTile tile, MatchingTile tile2)
        {
            var tiles = Grid.GetValidTilesGroup(tile);

            tiles.AddRange(Grid.GetValidTilesGroup(tile2));
            if (tiles.Count < MinimumAmountOfGroupedTiles)
            {
                return;
            }

            _audioSource.PlayOneShot(OnMoveSounds[UnityEngine.Random.Range(0, OnMoveSounds.Length)]);
            Grid.PerformMove(tiles, OnExplosionParticles);

            OnMoveParticles.transform.position = new Vector3(tile.transform.position.x, tile.transform.position.y, tile.transform.position.z - 1f);
            OnMoveParticles.Play();

            var score = CalculateScore(tiles.Count);

            ScorePopupText.text           = "+" + score;
            ScorePopup.transform.position = Camera.main.WorldToScreenPoint(tile.transform.position);
            ScorePopup.EnableFor(0.5f);
            OnScoreParticles.transform.position = new Vector3(tile.transform.position.x, tile.transform.position.y, tile.transform.position.z - 1f);
            OnScoreParticles.Play();
            ScoreCounter.AddScore(score);
        }
コード例 #25
0
ファイル: GameManager.cs プロジェクト: Alek2750/Assignment-5
    // Start is called before the first frame update
    void Start()
    {
        platformStartPoint = platformGenerator.position;
        playerStartPoint   = thePlayer.transform.position;

        theScoreCounter = FindObjectOfType <ScoreCounter>();
    }
コード例 #26
0
ファイル: GameManager.cs プロジェクト: gunzee2/RhythmWars
 void Awake()
 {
     instance = this;
     fsm = this.GetComponent<PlayMakerFSM>();
     score_counter = this.GetComponent<ScoreCounter>();
     previousSectionName = Music.CurrentSection.name;
 }
コード例 #27
0
    void Awake()
    {
        var score = PlayerPrefs.GetInt(_level + "_score");
        //var sprite = GetComponent<UISprite>();
        var btn = GetComponent <UIButton>();


        switch (ScoreCounter.GetCountStars((int)score))
        {
        case 1:
            btn.normalSprite = "04_level_1_star";
            //sprite.spriteName = "04_level_1_star";
            break;

        case 2:
            btn.normalSprite = "05_level_2_star";
            //sprite.spriteName = "05_level_2_star";
            break;

        case 3:
            btn.normalSprite = "06_level_3_star";
            //sprite.spriteName = "06_level_3_star";
            break;
        }
    }
コード例 #28
0
ファイル: ActionHandle.cs プロジェクト: SotongCoding/Apertela
    public void EndGame()
    {
        ScoreCounter score = FindObjectOfType <ScoreCounter> ();
        GPData       data  = FindObjectOfType <GPData> ();

        Debug.LogWarning(score.curScore);
    }
コード例 #29
0
    void Start()
    {
        durationOfCollectedParticleSystem = collectedParticleSystem.GetComponent <ParticleSystem>().main.duration;

        //this
        scoreCount = GameObject.FindGameObjectWithTag("Score").GetComponent <ScoreCounter>();
    }
コード例 #30
0
    public void Start()
    {
        Instance = this;

        score = 0;
        InvokeRepeating("ScoreUpdate", 4.0f, 0.5f);
    }
コード例 #31
0
 // Start is called before the first frame update
 void Start()
 {
     ball = GameObject.Find("Ball");
     InitializeLoop();
     InitializeCylinder();
     scoreCounter = GameObject.Find("GameController").GetComponent <ScoreCounter>();
 }
コード例 #32
0
    // Check collisions &if was hit by ball get the color of the ball
    //check if the color has touched the object before
    //if no give points to player and channge the color of object
    //if yes do nothing


    void OnCollisionEnter2D(Collision2D col)
    {
        thisColor = objectSpriteRenderer.color;
        if (col.gameObject.tag == "Ball")
        {
            ballColor = col.gameObject.GetComponent <SpriteRenderer>().color;

            if (!colorsThatHitTheObject.Contains(ballColor))
            {
                finalColor = ballColor;
                startColor = thisColor;

                colorsThatHitTheObject.Add(ballColor);
                LevelScore.score += pointsGainedByCollisionOnThisObject + hitsInARow;
                ScoreCounter.UpdateBounceCount();
                startTime = 0;
                StartCoroutine("ChangeColor");
                hitsInARow += 1;
            }
            else
            {
                hitsInARow = 0;
            }
        }
    }
コード例 #33
0
 void Awake() { // making a singleton, for convinience and assurance of no object-collisions
     if (instance != null && instance != this) {
         Destroy(this.gameObject);
         return;
     }
     instance = this;
     DontDestroyOnLoad(this.gameObject);
 }
コード例 #34
0
ファイル: GameRoot.cs プロジェクト: gunzee2/JumpGame
    // Use this for initialization
    void Start()
    {
        this.player = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerController>();
        this.score_counter = this.gameObject.GetComponent<ScoreCounter>();

        // ターゲットフレームレートを60fpsに.
        Application.targetFrameRate = 60;
    }
コード例 #35
0
ファイル: GOD.cs プロジェクト: mwebi/AxonClone
 // Use this for initialization
 void Start()
 {
     NodeGenerationScript = NodeGeneratorObject.GetComponent<NodeGeneration>();
     RangeCircleScript = RangeCircleObject.GetComponent<RangeCircle>();
     PlayerScript = PlayerObject.GetComponent<Player>();
     ScoreCounterScript = ScoreCounterObject.GetComponent<ScoreCounter>();
     RestartButtonScript = RestartButtonObject.GetComponent<RestartButton>();
     NeuronLineScript = NeuronLineObject.GetComponent<NeuronLine>();
 }
コード例 #36
0
ファイル: SceneControl.cs プロジェクト: kjhsch0326/006757
    void Start()
    {
        // BlockRoot스크립트 가져오기.
        this.block_root = this.gameObject.GetComponent<BlockRoot>();
        // BlockRoot스크립트의 initialSetUp()을 호출한다.
        this.block_root.initialSetUp();

        // ScoreCounter 가져오기
        this.score_counter = this.gameObject.GetComponent<ScoreCounter>();
        this.next_step = STEP.PLAY; // 다음 상태를 '플레이 중'으로.
        this.guistyle.fontSize = 24; // 폰트  크기를 24로.
    }
コード例 #37
0
ファイル: SceneControl.cs プロジェクト: smalab/JumpGame
    void Start()
    {
        // BlockRootスクリプトを取得.
        this.block_root = this.gameObject.GetComponent<BlockRoot>();
        // BlockRootスクリプトのinitialSetUp()を呼び出す.
        this.block_root.initialSetUp();

        // ScoreCounterを取得.
        this.score_counter = this.gameObject.GetComponent<ScoreCounter>();
        this.next_step = STEP.PLAY; // 次の状態を「プレイ中」に.
        this.guistyle.fontSize = 24; // フォントのサイズを24に.
    }
コード例 #38
0
ファイル: Player.cs プロジェクト: M4ch/TestProj
 public Player(ContentManager Content, Color color, Vector2 startPosition, Keys keyLeft, Keys keyRight, Vector2 ScorePosition)
 {
     this.Color = color;
     ActualPosition = startPosition;
     Positions.Add(ActualPosition);
     PlayerTexture = Content.Load<Texture2D>("kolecko8");
     PlayerTextureOrigin = new Vector2(PlayerTexture.Width / 2, PlayerTexture.Height / 2);
     LightTexture = Content.Load<Texture2D>("Light");
     LightTextureOrigin = new Vector2(LightTexture.Width / 2, LightTexture.Height / 2);
     KeyLeft = keyLeft;
     KeyRight = keyRight;
     Score = new ScoreCounter(Content, ScorePosition);
 }
コード例 #39
0
		private void Awake()
        {
			beat = FindObjectOfType<BeatMatcher> ();
            m_GroundCheck = transform.Find("GroundCheck");
            m_CeilingCheck = transform.Find("CeilingCheck");
            m_Anim = GetComponent<Animator>();
            m_Rigidbody2D = GetComponent<Rigidbody2D>();
			rayMask |= 1 << LayerMask.NameToLayer ("Destructible");
			rayMask |= 1 << LayerMask.NameToLayer ("Unpassable");
			platformMask |= 1 << LayerMask.NameToLayer ("Platform");
			beat = FindObjectOfType<BeatMatcher> ();
			inputBuffer = new Queue<Direction> ();
			musicSystem = GetComponent<CharacterMusicSystem> ();
			scoreCounter = FindObjectOfType<ScoreCounter> ();
			teleportParticle = Resources.Load<GameObject> ("ParticleEffects/TeleportParticle");
			dashParticle = Resources.Load<GameObject>("ParticleEffects/DashParticle");
			ringParticle = Resources.Load<GameObject> ("ParticleEffects/RingParticle");
		}
コード例 #40
0
    // Use this for initialization
    void Start()
    {
        scoreCounter = FindObjectOfType<ScoreCounter>();
        if(scoreCounter != null)
        {
            score.text = scoreCounter.score.ToString();
        }

        replay.onClick.AddListener(delegate
        {
            Destroy(scoreCounter);
            Application.LoadLevel("MainScreen");
        });

        exit.onClick.AddListener(delegate
        {
            Application.Quit();
        });
    }
コード例 #41
0
ファイル: Game.cs プロジェクト: exdev/band-of-warriors
 protected virtual void Init()
 {
     theSpawner = GetComponent<Spawner>();
     iapCtrl = GetComponent<IAPCtrl>();
     theScoreCounter = GetComponent<ScoreCounter>();
     theLevelManager = GameObject.FindWithTag("levelManager").GetComponent<LevelManager>();
     theItemCarrier = GameObject.FindWithTag("itemCarrier").GetComponent<ItemCarrier>();
     initPlayerHP = maxPlayerHP;
     if (!Application.isEditor) {
         CmBillingAndroid.Instance.InitializeApp();
     }
 }
コード例 #42
0
ファイル: Score.cs プロジェクト: bonbombs/ATermGameJam2015
 // Use this for initialization
 void Start()
 {
     scoreCount = FindObjectOfType<ScoreCounter>();
 }
コード例 #43
0
ファイル: BlockRoot.cs プロジェクト: kjhsch0326/006757
 void Start()
 {
     this.main_camera = GameObject.FindGameObjectWithTag("MainCamera");
     this.score_counter = this.gameObject.GetComponent<ScoreCounter>();
 }
コード例 #44
0
ファイル: TitleScript.cs プロジェクト: gunzee2/JumpGame
 // Use this for initialization
 void Start()
 {
     this.score_counter = this.gameObject.GetComponent<ScoreCounter>();
 }
コード例 #45
0
    //int toolbarint = 0;
    //string[] toolbarstrings = new string[]{"Toolbar 1", "Toolbar 2","Toolbar 3", "Toolbar 4"};
    void Awake()
    {
        networkScript = GameObject.Find("NetworkCode").GetComponent<NetworkGame>();

        playersScores = new List<PlayerScore>();

        //scoreTitle.material.color = Color.yellow;
        if(scoreTitle != null)
        scoreTextStyle.font = scoreTitle;

        scoreTextStyle.alignment = TextAnchor.MiddleCenter;
        scoreTextStyle.normal.textColor = Color.yellow;
        scoreTextStyle.fontSize = 30;

        screenX = Screen.width * 0.5f - scoreMenuHeight * 0.5f;
        screenY = Screen.height * 0.5f - scoreMenuWidth * 0.5f;

        Script = this;
    }
コード例 #46
0
ファイル: SceneControl.cs プロジェクト: smalab/JumpGame
    // ================================================================ //
    // MonoBehaviour からの継承.
    void Start()
    {
        this.block_root = this.gameObject.GetComponent<BlockRoot>();
        this.block_root.create();
        this.block_root.initialSetUp();

        this.score_counter = this.gameObject.GetComponent<ScoreCounter>();

        this.next_step = STEP.PLAY;

        this.score_disp = GameObject.FindGameObjectWithTag("Score Disp").GetComponent<ScoreDisp>();

        this.sound_control = GameObject.Find("SoundRoot").GetComponent<SoundControl>();

        this.rocket_motion = GameObject.Find("rocket_model").gameObject.GetComponentInChildren<Animation>();		//motion
    }
コード例 #47
0
    /* -------------------------------------------------------------------------------------------------------- */
    /*
     * UNITY STUFF
     */
    /* -------------------------------------------------------------------------------------------------------- */
    void Awake()
    {
        Script = this;

        scoreScript = GameObject.Find("GameCode").GetComponent<ScoreCounter>();

        networkScript = GameObject.Find("NetworkCode").GetComponent<NetworkGame>();

        levelTimer = (2 + networkScript.levelTimeNetworkGame) * 60;
        //levelTimer = 5.0f;

        menuTime = Time.time;
    }
コード例 #48
0
ファイル: BlockRoot.cs プロジェクト: kjhsch0326/006757
    // ================================================================ //
    // MonoBehaviour에서 상속.
    void Awake()
    {
        this.main_camera   = GameObject.FindGameObjectWithTag("MainCamera");
        this.score_counter = this.gameObject.GetComponent<ScoreCounter>();

        this.arrow = GameObject.Instantiate(this.arrowPrefab) as GameObject;

        this.hideArrow();

        this.sound_control = GameObject.Find("SoundRoot").GetComponent<SoundControl>();

        this.effect_control = this.gameObject.GetComponent<VanishEffectControl>();
        this.leave_block_root = this.gameObject.GetComponent<LeaveBlockRoot>();
    }
コード例 #49
0
ファイル: TestCaseScoreCounter.cs プロジェクト: yheno/osu
        public override void Reset()
        {
            base.Reset();

            int numerator = 0, denominator = 0;

            bool maniaHold = false;

            ScoreCounter score = new ScoreCounter(7)
            {
                Origin = Anchor.TopRight,
                Anchor = Anchor.TopRight,
                TextSize = 40,
                Count = 0,
                Margin = new MarginPadding(20),
            };
            Add(score);

            ComboCounter standardCombo = new OsuComboCounter
            {
                Origin = Anchor.BottomLeft,
                Anchor = Anchor.BottomLeft,
                Margin = new MarginPadding(10),
                Count = 0,
                TextSize = 40,
            };
            Add(standardCombo);

            CatchComboCounter catchCombo = new CatchComboCounter
            {
                Origin = Anchor.Centre,
                Anchor = Anchor.Centre,
                Count = 0,
                TextSize = 40,
            };
            Add(catchCombo);

            ComboCounter taikoCombo = new TaikoComboCounter
            {
                Origin = Anchor.BottomCentre,
                Anchor = Anchor.Centre,
                Position = new Vector2(0, -160),
                Count = 0,
                TextSize = 40,
            };
            Add(taikoCombo);

            ManiaComboCounter maniaCombo = new ManiaComboCounter
            {
                Origin = Anchor.Centre,
                Anchor = Anchor.Centre,
                Position = new Vector2(0, -80),
                Count = 0,
                TextSize = 40,
            };
            Add(maniaCombo);

            PercentageCounter accuracyCombo = new PercentageCounter
            {
                Origin = Anchor.TopRight,
                Anchor = Anchor.TopRight,
                Position = new Vector2(-20, 60),
            };
            Add(accuracyCombo);

            StarCounter stars = new StarCounter
            {
                Origin = Anchor.BottomLeft,
                Anchor = Anchor.BottomLeft,
                Position = new Vector2(20, -160),
                Count = 5,
            };
            Add(stars);

            SpriteText starsLabel = new SpriteText
            {
                Origin = Anchor.BottomLeft,
                Anchor = Anchor.BottomLeft,
                Position = new Vector2(20, -190),
                Text = stars.Count.ToString("0.00"),
            };
            Add(starsLabel);

            AddButton(@"Reset all", delegate
            {
                score.Count = 0;
                standardCombo.Count = 0;
                taikoCombo.Count = 0;
                maniaCombo.Count = 0;
                catchCombo.Count = 0;
                numerator = denominator = 0;
                accuracyCombo.SetFraction(0, 0);
                stars.Count = 0;
                starsLabel.Text = stars.Count.ToString("0.00");
            });

            AddButton(@"Hit! :D", delegate
            {
                score.Count += 300 + (ulong)(300.0 * (standardCombo.Count > 0 ? standardCombo.Count - 1 : 0) / 25.0);
                standardCombo.Count++;
                taikoCombo.Count++;
                maniaCombo.Count++;
                catchCombo.CatchFruit(new Color4(
                    Math.Max(0.5f, RNG.NextSingle()),
                    Math.Max(0.5f, RNG.NextSingle()),
                    Math.Max(0.5f, RNG.NextSingle()),
                    1)
                );
                numerator++; denominator++;
                accuracyCombo.SetFraction(numerator, denominator);
            });

            AddButton(@"miss...", delegate
            {
                standardCombo.Roll();
                taikoCombo.Roll();
                maniaCombo.Roll();
                catchCombo.Roll();
                denominator++;
                accuracyCombo.SetFraction(numerator, denominator);
            });

            AddButton(@"mania hold", delegate
            {
                if (!maniaHold)
                    maniaCombo.HoldStart();
                else
                    maniaCombo.HoldEnd();
                maniaHold = !maniaHold;
            });

            AddButton(@"Alter stars", delegate
            {
                stars.Count = RNG.NextSingle() * (stars.MaxStars + 1);
                starsLabel.Text = stars.Count.ToString("0.00");
            });

            AddButton(@"Stop counters", delegate
            {
                score.StopRolling();
                standardCombo.StopRolling();
                catchCombo.StopRolling();
                taikoCombo.StopRolling();
                maniaCombo.StopRolling();
                accuracyCombo.StopRolling();
                stars.StopAnimation();
            });
        }
コード例 #50
0
ファイル: ScoreCounter.cs プロジェクト: Krowoc/LudumDare33
 public static ScoreCounter instance()
 {
     if (ScoreCounter._instance == null)
         ScoreCounter._instance = new ScoreCounter ();
     return _instance;
 }
コード例 #51
0
	void Start(){
		gameOverText.enabled = false; //disable GameOver text on start
		scoreCounter = scoreText.GetComponent<ScoreCounter>();

	}