コード例 #1
0
 // Use this for initialization
 void Start()
 {
     scoreControllerRef = GameObject.Find ("scoreP").GetComponent<scoreController> ();
     speed = Random.Range (6f, 10f);
     time =Random.Range(0.2f,0.5f);
     player = GameObject.FindGameObjectWithTag("Player");
 }
コード例 #2
0
	// Use this for initialization
	void Start () {
		theSpawnDoor = GameObject.Find ("winningConditions").GetComponent <spawnDoor> ();

		Time.timeScale = 1;
		thePlayerScore = GameObject.Find("_GM").GetComponent<scoreController> ();
		thePlayerHealth = GameObject.Find("Player").GetComponent <playerHealth> ();
	}
コード例 #3
0
ファイル: startOver.cs プロジェクト: radove/PuppySurge
    public void resumeOrTryAction()
    {
        uiSound();

        GameObject      gameControllerObject = GameObject.FindWithTag("GameController");
        scoreController score = gameControllerObject.GetComponent <scoreController>();

        if (score != null)
        {
            if (score.getScore() == 0)
            {
                showSelectLevel();
                return;
            }
            if (score.getHealth() > 0)
            {
                resumeGame();
            }
            else
            {
                adTryAgain = true;
                showAd();
            }
        }
    }
コード例 #4
0
ファイル: startOver.cs プロジェクト: radove/PuppySurge
    public void loadLevel(int level)
    {
        hideMenu();
        Cursor.visible = false;
        Time.timeScale = 1;

        GameObject gameControllerObject = GameObject.FindWithTag("GameController");

        if (gameControllerObject != null)
        {
            scoreController score = gameControllerObject.GetComponent <scoreController>();
            if (score != null)
            {
                score.updateLevelText(level);
                score.resetStars();
                score.resetScore();
                score.resetHealth();
            }
        }

        SceneManager.LoadScene(0);

        GameObject gameEngine = GameObject.Find("GameEngine");
        gameEngine engine     = gameEngine.GetComponent <gameEngine>();

        engine.startLevel(level, false);
    }
コード例 #5
0
    // Use this for initialization
    void Start()
    {
        sc = GameObject.Find("_GM").GetComponent <scoreController> ();
        //Debug.Log ("win stage = "+sc.winStage1);

        /*PlayerPrefs.DeleteKey ("winStage1");
         * sc.winStage1 = 0;*/
    }
コード例 #6
0
ファイル: bulletCollision.cs プロジェクト: radove/PuppySurge
    // Use this for initialization
    void Start()
    {
        GameObject gameControllerObject = GameObject.FindWithTag("GameController");

        if (gameControllerObject != null)
        {
            score = gameControllerObject.GetComponent <scoreController>();
        }
        if (score == null)
        {
            Debug.Log("Cannot find 'GameController' script");
        }
    }
コード例 #7
0
ファイル: startOver.cs プロジェクト: radove/PuppySurge
    public void tryAgain()
    {
        GameObject gameControllerObject = GameObject.FindWithTag("GameController");

        if (gameControllerObject != null)
        {
            scoreController score = gameControllerObject.GetComponent <scoreController>();
            if (score != null)
            {
                loadLevel(score.getLevel());
            }
        }
    }
コード例 #8
0
    // Use this for initialization
    void Start()
    {
        myRigidbody = GetComponent <Rigidbody2D>();

        myCollider = GetComponent <BoxCollider2D>();

        myCircleCollider = GetComponent <CircleCollider2D>();

        myAnimator = GetComponent <Animator>();

        obstacleCtrl = GameObject.FindObjectOfType <obstacleController>();

        theScoreController = FindObjectOfType <scoreController>();
    }
コード例 #9
0
ファイル: starFall.cs プロジェクト: radove/PuppySurge
    // Use this for initialization
    void Start()
    {
        GameObject gameControllerObject = GameObject.FindWithTag("GameController");

        if (gameControllerObject != null)
        {
            score = gameControllerObject.GetComponent <scoreController>();
        }
        if (score == null)
        {
            Debug.Log("Cannot find 'GameController' script");
        }
        randomPositionXStar = Random.Range(-2500, -2600);
    }
コード例 #10
0
    public void makeDead()
    {
        Instantiate(deathFX, transform.position, transform.rotation);
        Destroy(gameObject);
        AudioSource.PlayClipAtPoint(playerDeathSound, transform.position);
        damageScreen.color = damagedColour;
        pauseBtn.SetActive(false);
        scoreController thePlayerScore = GameObject.Find("_GM").GetComponent <scoreController> ();

        txtScoreDeath.text = thePlayerScore.Score.ToString();
        Animator gameOverAnimator = playerDeathUI.GetComponent <Animator> ();

        gameOverAnimator.SetTrigger("gameOver");
        //theGameManager.restartTheGame ();
    }
コード例 #11
0
    // Use this for initialization
    void Start()
    {
        GameObject gameControllerObject = GameObject.FindWithTag("GameController");

        if (gameControllerObject != null)
        {
            score = gameControllerObject.GetComponent <scoreController>();
        }
        if (score == null)
        {
            Debug.Log("Cannot find 'GameController' script");
        }
        StartCoroutine("AutoBulletProcess");
        player = GameObject.FindGameObjectWithTag("Player");
    }
コード例 #12
0
 // Use this for initialization
 void Start()
 {
     //GetComponent<Rigidbody2D>().velocity = movement;
     GameObject gameControllerObject = GameObject.FindWithTag ("GameController");
     if (gameControllerObject != null)
     {
         score = gameControllerObject.GetComponent <scoreController>();
     }
     if (score == null)
     {
         Debug.Log ("Cannot find 'GameController' script");
     }
     GameObject player = GameObject.FindGameObjectWithTag ("Player");
     playerLocation = player.transform.position;
     //GetComponent<Rigidbody2D>().AddForce ((player.transform.position - transform.position).normalized * Time.smoothDeltaTime * 350);
 }
コード例 #13
0
ファイル: orbFall.cs プロジェクト: radove/PuppySurge
    // Use this for initialization
    void Start()
    {
        GameObject gameControllerObject = GameObject.FindWithTag("GameController");

        if (gameControllerObject != null)
        {
            score = gameControllerObject.GetComponent <scoreController>();
        }
        if (score == null)
        {
            Debug.Log("Cannot find 'GameController' script");
        }
        float randomPositionXStar = Random.Range(-2500, -2600);
        float randomPositionYStar = this.gameObject.transform.position.y;

        destination = new Vector2(randomPositionXStar, randomPositionYStar);
    }
コード例 #14
0
ファイル: alienBoss.cs プロジェクト: radove/PuppySurge
    // Use this for initialization
    void Start()
    {
        //InvokeRepeating ("launchBullet", 1f, 1f);
        GameObject gameControllerObject = GameObject.FindWithTag("GameController");

        if (gameControllerObject != null)
        {
            score = gameControllerObject.GetComponent <scoreController>();
        }
        if (score == null)
        {
            Debug.Log("Cannot find 'GameController' script");
        }

        randomPositionYStar = Random.Range(-300, 300);
        randomPositionXStar = Random.Range(-500, 1200);
    }
コード例 #15
0
    // Use this for initialization
    void Start()
    {
        GameObject gameControllerObject = GameObject.FindWithTag("GameController");

        if (gameControllerObject != null)
        {
            score = gameControllerObject.GetComponent <scoreController>();
        }
        if (score == null)
        {
            Debug.Log("Cannot find 'GameController' script");
        }

        GameObject menuControls = GameObject.Find("menuControls");

        menu = menuControls.GetComponent <startOver>();
        menu.startScreen();
    }
コード例 #16
0
ファイル: orcController.cs プロジェクト: radove/PuppySurge
    void Start()
    {
        GameObject puppyShip = GameObject.Find("puppyShip");
        GameObject craftShip = GameObject.Find("craftShip");

        puppyShip.SetActive(false);
        craftShip.SetActive(true);

        starCenter = GameObject.FindWithTag("starCenter");

        Cursor.visible = false;
        //Screen.lockCursor = true;
        GameObject gameControllerObject = GameObject.FindWithTag("GameController");

        if (gameControllerObject != null)
        {
            score = gameControllerObject.GetComponent <scoreController>();
        }
        if (score == null)
        {
            Debug.Log("Cannot find 'GameController' script");
        }

        GameObject menu = GameObject.FindGameObjectWithTag("menu");

        menuCanvas         = menu.GetComponent <Canvas>();
        menuCanvas.enabled = false;

        foreach (Transform child in transform)
        {
            Debug.Log(child.gameObject.name);
            if (child.gameObject.name.Equals("bombDropLocation"))
            {
                bombDropLocation = child.gameObject.transform;
            }
        }



        StartCoroutine(AutoBulletProcess());
        StartCoroutine(AutoSpecialBulletProcess());
        oneFourth = Screen.width / 4;
        oneHalf   = Screen.width / 2;
    }
コード例 #17
0
ファイル: bossSmall.cs プロジェクト: radove/PuppySurge
    // Use this for initialization
    void Start()
    {
        GameObject gameControllerObject = GameObject.FindWithTag("GameController");

        if (gameControllerObject != null)
        {
            score = gameControllerObject.GetComponent <scoreController>();
        }
        if (score == null)
        {
            Debug.Log("Cannot find 'GameController' script");
        }
        randomPositionYStar = Random.Range(-1600, 2000);
        randomPositionXStar = Random.Range(-2500, -2600);
        GameObject bossGameObject = GameObject.FindWithTag("bossBubble");

        if (bossGameObject != null)
        {
            this.transform.parent = bossGameObject.transform;
        }
        player = GameObject.FindGameObjectWithTag("Player");
    }
コード例 #18
0
ファイル: startOver.cs プロジェクト: radove/PuppySurge
    public void resumeOrTryText()
    {
        GameObject      gameControllerObject = GameObject.FindWithTag("GameController");
        scoreController score = gameControllerObject.GetComponent <scoreController>();

        GameObject resumeTextGameObject = GameObject.FindWithTag("resumeOrTryAgain");
        Text       textObj = resumeTextGameObject.GetComponent <Text>();

        if (score != null)
        {
            if (score.getHealth() > 0)
            {
                textObj.text = "RESUME";
            }
            else
            {
                textObj.text = "TRY AGAIN";
            }
            if (score.getScore() == 0)
            {
                textObj.text = "NEW GAME";
            }
        }
    }
コード例 #19
0
    //public static string inGameName;

    void start()
    {
        theScoreController = FindObjectOfType <scoreController>();
    }
コード例 #20
0
 // Use this for initialization
 void Start()
 {
     GameObject scoreControllerObject = GameObject.FindGameObjectWithTag("score");
             Initalize ();
      scoreController = scoreControllerObject.GetComponent<scoreController>();
             //startPos = gameObject.transform.position;
 }
コード例 #21
0
    void addScore()
    {
        scoreController thePlayerScore = GameObject.Find("_GM").GetComponent <scoreController> ();

        thePlayerScore.addScore(enemyScore);
    }
コード例 #22
0
ファイル: scoreText.cs プロジェクト: reibeatall/HungryAmmals
 // Use this for initialization
 void Start()
 {
     score = GetComponent<Text>();
     GameObject scoreControllerObject = GameObject.FindGameObjectWithTag("score");
     scoreController = scoreControllerObject.GetComponent<scoreController>();
 }
コード例 #23
0
 void Start()
 {
     txt = GetComponent<TextMesh> ();
     scriptRef = GameObject.Find ("scoreP").GetComponent<scoreController> ();
 }
コード例 #24
0
 // Use this for initialization
 void Start()
 {
     score = GameObject.FindGameObjectWithTag ("score").GetComponent<scoreController>();
     contadores = Camera.main.GetComponent<Contadores> ();
     waves = GameObject.Find ("SpawnBoss").GetComponent<spawnBoss> ();
     DamageReducion = false;
     maxHitPoints = hitPoints;
     anim = GameObject.FindGameObjectWithTag("Face").GetComponent<Animator>();
     damageSFX.volume = PlayerPrefs.GetFloat("SFXVolume");
 }
コード例 #25
0
 void start()
 {
     theScoreController          = FindObjectOfType <scoreController>();
     theScoreController.scoreInc = true;
 }