Esempio n. 1
0
 // Use this for initialization
 void Awake()
 {
     myBody      = GetComponent <Rigidbody>();
     playerAnim  = GetComponent <PlayerAnimation>();
     bgScroller  = GameObject.Find(Tags.BACKGROUND_OBJ).GetComponent <BGScroller>();
     playerShoot = GetComponent <PlayerHealthDamageShoot>();
 }
Esempio n. 2
0
 void Awake()
 {
     MakeInstance();
     bgScroller     = GameObject.Find(Tags.BACKGROUND_TAG).GetComponent <BGScroller>();
     playerMovement = GameObject.Find(Tags.PLAYER_TAG).GetComponent <PlayerMovement>();
     pausePanel.SetActive(false);
 }
Esempio n. 3
0
 void Awake()
 {
     myBody     = GetComponent <Rigidbody>();
     playerAnim = GetComponent <PlayerAnimation>();
     bgScroller = GameObject.Find(Tags.BG).GetComponent <BGScroller>();
     jumpBtn    = GameObject.Find(Tags.JUMP_BTN).GetComponent <Button>();
     jumpBtn.onClick.AddListener(() => playerJump());
 }
 void Awake()
 {
     mybody      = GetComponent <Rigidbody>();
     playerAnim  = GetComponent <PlayerAnimation>();
     bgScroller  = GameObject.Find(Tags.BACKGROUND_GAME_OBJ).GetComponent <BGScroller>();
     playershoot = GetComponent <PlayerHealthDamage>();
     jumpBtn     = GameObject.Find(Tags.JUMP_BTN_OBJ).GetComponent <Button>();
     jumpBtn.onClick.AddListener(() => Jump());
 }
Esempio n. 5
0
    void Awake()
    {
        myBody      = GetComponent <Rigidbody> ();
        playerAnim  = GetComponent <PlayerAnnimation> ();
        bgScroller  = GameObject.Find(Tags.Backgrund_GameObjTag).GetComponent <BGScroller> ();
        playerShoot = GetComponent <PlayerHealthDamageShoot>();

        jumpBtn = GameObject.Find(Tags.Jump_Button_Obj).GetComponent <Button>();
        jumpBtn.onClick.AddListener(() => Jump());
    }
 // Use this for initialization
 void Awake()
 {
     MakeInstance();
     scoreText  = GameObject.Find(Tags.SCORE_TEXT_OBJ).GetComponent <Text>();
     HealthText = GameObject.Find(Tags.HEALTH_TEXT_OBJ).GetComponent <Text>();
     levelText  = GameObject.Find(Tags.LEVEL_TEXT_OBJ).GetComponent <Text>();
     bgScroller = GameObject.Find(Tags.BACKGROUND_GAME_OBJ).GetComponent <BGScroller>();
     pausePanel = GameObject.Find(Tags.PAUSE_PANEL_OBJ);
     pausePanel.SetActive(false);
 }
 void Awake()
 {
     makeInstace();
     scoreTxt   = GameObject.Find(Tags.SCORE_TEXT).GetComponent <Text>();
     levelTxt   = GameObject.Find(Tags.LEVEL_TEXT).GetComponent <Text>();
     healthTxt  = GameObject.Find(Tags.HEALTH_TEXT).GetComponent <Text>();
     bgScroller = GameObject.Find(Tags.BG).GetComponent <BGScroller>();
     pausePanel = GameObject.Find(Tags.PAUSE_PANEL);
     pausePanel.SetActive(false);
 }
Esempio n. 8
0
    void Awake()
    {
        myAnim         = GetComponent <Animator>();
        myRigidbody    = GetComponent <Rigidbody2D>();
        bgScroller     = GameObject.Find("Background").GetComponent <BGScroller>();
        groundScroller = GameObject.Find("Ground").GetComponent <GroundScroller>();
        boxSpawner     = GameObject.Find("BoxSpawner").GetComponent <BoxSpawner>();

        Physics2D.IgnoreCollision(boxCollider, polygonCollider, true);
    }
Esempio n. 9
0
    void Awake()
    {
        myBody                  = GetComponent <Rigidbody>();
        playerAnimation         = GetComponent <PlayerAnimation>();
        playerHealthDamageShoot = GetComponent <PlayerHealthDamageShoot>();
        smokePosition.SetActive(false);
        bgScroller = GameObject.FindGameObjectWithTag(Tags.BACKGROUND_TAG).GetComponent <BGScroller>();

        jumpButton.onClick.AddListener(() => Jump());
    }
Esempio n. 10
0
 void checkSingleton()
 {
     if (null == instance)
     {
         instance = this;
     }
     else //if (this != instance)
     {
         Destroy(this);
     }
 }
 private void Awake()
 {
     if (instance != null)
     {
         Destroy(this.gameObject);
     }
     else
     {
         instance = this;
     }
 }
    void Awake()
    {
        MakeInstance();
        scoreText  = GameObject.Find(Tags.Score_Text_Obj).GetComponent <Text>();
        healthText = GameObject.Find(Tags.Health_Text_Obj).GetComponent <Text>();
        levelText  = GameObject.Find(Tags.Level_Text_Obj).GetComponent <Text>();

        bgscroller = GameObject.Find(Tags.Backgrund_GameObjTag).GetComponent <BGScroller>();

        pausePanel = GameObject.Find(Tags.Pause_Panel_Obj);
        pausePanel.SetActive(false);
    }
    void Start()
    {
        gameOver          = false;
        restart           = false;
        restartText.text  = "";
        gameOverText.text = "";
        scoreValue        = 0;
        UpdateScore();
        StartCoroutine(SpawnWaves());
        audioSource = GetComponent <AudioSource>();

        //for finding the BGScroller script and object
        GameObject BGScrollerObject = GameObject.FindWithTag("BGScroller");

        if (BGScrollerObject != null)
        {
            BGScroller = BGScrollerObject.GetComponent <BGScroller>();
        }

        if (BGScroller == null)
        {
            Debug.Log("Cannot find 'BGScroller' script");
        }

        //for finding the particleSpeed script and object
        GameObject particleSpeedObject = GameObject.FindWithTag("particleSpeed");

        if (particleSpeedObject != null)
        {
            particleSpeed = particleSpeedObject.GetComponent <particleSpeed>();
        }

        if (particleSpeed == null)
        {
            //for communicating that it cannot be found
            Debug.Log("Cannot find 'particleSpeed' script");
        }

        //for finding teh particleSpeedDistance script and object
        GameObject particleSpeedDistanceObject = GameObject.FindWithTag("particleSpeedDistance");

        if (particleSpeedDistanceObject != null)
        {
            particleSpeedDistance = particleSpeedDistanceObject.GetComponent <particleSpeedDistance>();
        }

        if (particleSpeedDistance == null)
        {
            //for communicating that it cannot be found
            Debug.Log("Cannot find 'particleSpeedDistance' script");
        }
    }
Esempio n. 14
0
 void Start()
 {
     gameOver          = false;
     restart           = false;
     restartText.text  = "";
     gameOverText.text = "";
     winText.text      = "";
     scroller          = background.GetComponent <BGScroller>();
     audioSource       = GetComponent <AudioSource>();
     score             = 0;
     UpdateScore();
     StartCoroutine(SpawnWaves());
 }
Esempio n. 15
0
    void Start()
    {
        yetAnotherScript = otherGameObject.GetComponent <BGScroller>();

        gameOver          = false;
        gameWin           = false;
        restart           = false;
        restartText.text  = "";
        gameOverText.text = "";
        score             = 0;
        UpdateScore();
        StartCoroutine(SpawnWaves());
    }
Esempio n. 16
0
    void Start()
    {
        gameOver          = false;
        restart           = false;
        restartText.text  = "";
        gameOverText.text = "";
        winText.text      = "";
        score             = 0;
        UpdateScore();
        StartCoroutine(SpawnWaves());

        musicSource        = GetComponent <AudioSource>();
        musicSource.clip   = musicClipOne;
        musicSource.volume = 0.5f;
        musicSource.Play();

        //find BGScroller
        GameObject bgScrollerObject = GameObject.FindWithTag("BGScroller");

        if (bgScrollerObject != null)
        {
            bgScroller = bgScrollerObject.GetComponent <BGScroller>();
        }
        if (bgScroller == null)
        {
            Debug.Log("Cannot find 'BGScroller' script");
        }
        //find SFScroller
        GameObject sfScrollerObject = GameObject.FindWithTag("SFScroller");

        if (sfScrollerObject != null)
        {
            sfScroller = sfScrollerObject.GetComponent <SFScroller>();
        }
        if (sfScroller == null)
        {
            Debug.Log("Cannot find 'SFScroller' script");
        }
        //find SFScrollerDistant
        GameObject sfScrollerDistantObject = GameObject.FindWithTag("SFScrollerDistant");

        if (sfScrollerDistantObject != null)
        {
            sfScrollerDistant = sfScrollerDistantObject.GetComponent <SFScrollerDistant>();
        }
        if (sfScrollerDistant == null)
        {
            Debug.Log("Cannot find 'SFScrollerDistant' script");
        }
    }
Esempio n. 17
0
 void Start()
 {
     gameOver          = false;
     restart           = false;
     hardModeEnabled   = false;
     restartText.text  = "";
     gameOverText.text = "";
     score             = 0;
     UpdateScore();
     StartCoroutine(SpawnWaves());
     audio          = GetComponent <AudioSource>();
     particleSystem = GameObject.Find("ParticleController").GetComponent <ParticleController>();
     bgScript       = GameObject.Find("Background").GetComponent <BGScroller>();
 }
 void Start()
 {
     _AudioSource1.Play();
     gameOver          = false;
     restart           = false;
     restartText.text  = "";
     menuText.text     = "";
     escapeText.text   = "";
     gameOverText.text = "";
     points            = 0;
     UpdatePoints();
     StartCoroutine(SpawnWaves());
     refScript1 = GetComponent <BGScroller>();
     refScript2 = GetComponent <BGScroller2>();
 }
Esempio n. 19
0
        UIPresenter(
            ThrowButtonView tButtonViewIn,
            BombButtonView bButtonViewIn,
            PlayerLife pLifeIn,
            HouseLife hLifeIn,
            BossLife bLifeIn,
            SpeedInfo sInfoIn,
            HeightInfo hInfoIn,
            Combo comboIn,
            PlayTime timeIn,
            Score scoreIn,
            Money moneyIn,
            LoadingView loadingViewIn,
            GameController gameControllerIn,
            Player playerIn,
            House houseIn,
            EnemyGenerator enemyGeneratorIn,
            BGScroller bgScrollerIn,
            BulletGenerator bulletGeneratorIn
            )
        {
            // それぞれ代入
            tButtonView = tButtonViewIn;
            bButtonView = bButtonViewIn;
            pLife       = pLifeIn;
            hLife       = hLifeIn;
            bLife       = bLifeIn;
            sInfo       = sInfoIn;
            hInfo       = hInfoIn;
            combo       = comboIn;
            time        = timeIn;
            score       = scoreIn;
            money       = moneyIn;
            loadingView = loadingViewIn;

            gameController  = gameControllerIn;
            player          = playerIn;
            house           = houseIn;
            enemyGenerator  = enemyGeneratorIn;
            bgScroller      = bgScrollerIn;
            bulletGenerator = bulletGeneratorIn;

            // 各種情報の監視と表示更新はここでは行わない

            // 読み込み待ちの監視登録
            CheckLoadData();
        }
    void Start()
    {
        gameOver          = false;
        restart           = false;
        restartText.text  = "";
        gameOverText.text = "";
        winText.text      = "";
        score             = 0;
        UpdateScore();
        StartCoroutine(SpawnWaves());
        musicSource.clip = musicClipOne;
        musicSource.Play();

        scroller = background.GetComponent <BGScroller>();
        psClose  = starfieldclose.GetComponent <ParticleSystem>();
        psFar    = starfielddistant.GetComponent <ParticleSystem>();
    }
 void Start()
 {
     gameOver          = false;
     restart           = false;
     hardMode          = false;
     restartText.text  = "";
     gameOverText.text = "";
     devText.text      = "";
     hardModeText.text = "H for Hard Mode: DISABLED";
     Score             = 0;
     UpdateScore();
     StartCoroutine(SpawnWaves());
     BGScroller  = background.GetComponent <BGScroller>();
     ps1         = starfield1.GetComponent <ParticleSystem>();
     ps2         = starfield2.GetComponent <ParticleSystem>();
     audioSource = GetComponent <AudioSource>();
 }
Esempio n. 22
0
    void Start()
    {
        hardModeText.text = "Press 'B' to start Hard Mode";

        hardModeEnabled = false;

        mover = asteroid1.GetComponent <Mover>();

        mover1 = asteroid2.GetComponent <Mover>();

        mover2 = asteroid3.GetComponent <Mover>();

        bgScroller = background.GetComponent <BGScroller>();

        psClose = starFieldClose.GetComponent <ParticleSystem>();

        psFar = starFieldDistant.GetComponent <ParticleSystem>();

        mainMusic = GetComponent <AudioSource>();

        gameOver = false;

        restart = false;

        restartText.text = "";

        gameOverText.text = "";

        score = 0;

        mover.speed = -2.5f;

        mover1.speed = -2.5f;

        mover2.speed = -2.5f;

        UpdateScore();

        StartCoroutine(SpawnWaves());
    }
Esempio n. 23
0
    public IEnumerator ReduceSpeedGradually()
    {
        float starttime = Time.time;
        float duration  = 5;
        //float endtime = Time.time + duration;

        GameObject floor         = GameObject.FindGameObjectWithTag("Floor");
        BGScroller floorscroller = floor.GetComponent <BGScroller>();
        float      speed         = floorscroller.scrollSpeed;

        while (true)
        {
            float percentage = (Time.time - starttime) / duration;
            if (percentage > 1)
            {
                break;
            }
            float currentSpeed = Mathf.Lerp(speed, 0, percentage);
            floorscroller.scrollSpeed = currentSpeed;
            yield return(null);
        }
    }
    void Start()
    {
        GameObject gameControllerObject = GameObject.FindWithTag("GameController");

        if (gameControllerObject != null)
        {
            gameController = gameControllerObject.GetComponent <GameController>();
        }

        if (gameController == null)
        {
            Debug.Log("Cannot find 'GameController' script");
        }

        GameObject bgScrollerObject = GameObject.FindWithTag("BGScroller");

        if (bgScrollerObject != null)
        {
            bgScroller = bgScrollerObject.GetComponent <BGScroller>();
        }

        if (bgScroller == null)
        {
            Debug.Log("Cannot find 'BGScroller' script");
        }

        GameObject particleObject = GameObject.FindWithTag("particles");

        if (particleObject != null)
        {
            ps = particleObject.GetComponent <ParticleSpeed>();
        }

        if (ps == null)
        {
            Debug.Log("Cannot find 'Particle Speed' script");
        }
    }
Esempio n. 25
0
 void Start()
 {
     gameOver = false;
     restart = false;
     gameOverText.text = "";
     restartText.text = "";
     winText.text = "";
     hardModeText.text = "";
     score = 0;
     UpdateScore();
     StartCoroutine (SpawnWaves());
     GameObject backgroundObject = GameObject.FindWithTag("Background");
     {
         if (backgroundObject != null)
         {
             background = backgroundObject.GetComponent<BGScroller>();
         }
         if (backgroundObject == null)
         {
             Debug.Log("Cannot find 'BGScroller' Script");
         }
     }
 }