Inheritance: MonoBehaviour
Ejemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        //查找玩家的实例
        this.player = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerControl>();

        //查找摄像机的实例对象
        this.main_camera = GameObject.FindGameObjectWithTag("MainCamera");

        this.level_control = new LevelControl();
        this.level_control.scene_control  = this;
        this.level_control.player         = this.player;
        this.level_control.OniGroupPrefab = this.OniGroupPrefab;
        this.level_control.Create();


        scoreControl = GetComponent <ScoreControl>();


        //清空游戏的结果
        this.result.oni_defeat_num = 0;
        this.result.eval_count     = new int[(int)EVALUATION.NUM];
        this.result.rank           = 0;
        this.result.score          = 0;
        this.result.score_max      = 0;

        for (int i = 0; i < this.result.eval_count.Length; i++)
        {
            this.result.eval_count[i] = 0;
        }

        //this.GetComponent

        //直接游戏
        this.step = Step.Game;
    }
Ejemplo n.º 2
0
    public void _SelectUpgradeUI()
    {
        int       id = selectedTower.GetTowerID();
        UnitTower upgradeTower;

        upgradeTower = FindUpgrade(id);
        if (upgradeTower != null)
        {
            GameObject obj;
            PoolManager.Unspawn(selectedTower.transform);
            GameManager.ClearIndicator();
            obj = PoolManager.Spawn(upgradeTower.transform, selectedTower.transform.position, Quaternion.identity);
            ScoreControl.CoinDecrease(selectedTower.baseTower.upgradeCost);
            obj.GetComponent <SpriteRenderer>().sortingLayerName = selectedTower.GetComponent <SpriteRenderer>().sortingLayerName;
            AudioManager.PlayTowerBuilding();
            GameManager.ClearUpgradeUI();
            GameManager.ClearDismantleUI();
            selectedTower = null;
        }
        if (upgradeTower == null)
        {
            GameManager.ClearUpgradeUI();
            GameManager.ClearDismantleUI();
            selectedTower = null;
        }
    }
Ejemplo n.º 3
0
    public void UpdateBuilState(GameObject[] buildings)
    {
        float ratio = 0.8f;

        foreach (GameObject building in buildings)
        {
            TowerPool tower;
            tower = PoolManager.poolManager.GetTowerParamFromID(ReadFromExcel.ExtractInt(building.name));
            int cost = tower.towerAttri.cost;

            Transform  can  = building.transform.FindChild("Canvas");
            GameObject tex  = can.FindChild("Text").gameObject;
            Text       text = tex.transform.GetComponent <Text>();
            text.text = "$ " + cost.ToString();
            //tex.GetComponent<Text>().text = "$" + cost.ToString();

            if (ScoreControl.CheckResourceSuffi(cost) == false)
            {
                building.GetComponent <SpriteRenderer>().color = new Color(ratio, ratio, ratio, 1.0f);
                text.color = new Color(ratio, ratio, ratio, 1.0f);
                building.GetComponent <BoxCollider2D>().enabled = false;
            }
            else
            {
                building.GetComponent <BoxCollider2D>().enabled = true;
                text.color = Color.white;
                building.GetComponent <SpriteRenderer>().color = Color.white;
            }
        }
    }
Ejemplo n.º 4
0
    // Use this for initialization
    void Start()
    {
        player = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerControl>();
        player.gameSceneControl = this;

        levelControl = new LevelControl();
        levelControl.gameSceneControl = this;
        levelControl.player           = player;
        levelControl.oniGroupPrefab   = oniGroupPrefab;
        levelControl.Create();

        resultControl = new ResultControl();

        gameUIControl = GameUIControl.Instance;
        scoreControl  = gameUIControl.scoreControl;

        result.oniDefeatNum    = 0;
        result.evaluationCount = new int[(int)Evaluation.Num];
        result.rank            = 0;
        result.score           = 0;
        result.scoreMax        = 0;

        for (int i = 0; i < result.evaluationCount.Length; i++)
        {
            result.evaluationCount[i] = 0;
        }

        fadeControl = FadeControl.Instance;
        fadeControl.Fade(3.0f, new Color(0, 0, 0, 1.0f), new Color(0, 0, 0, 0));

        nextState = State.Start;
    }
Ejemplo n.º 5
0
    public GameObject _Select(GameObject icon)
    {
        int id = ReadFromExcel.ExtractInt(icon.name);

        foreach (UnitTower tower in towers)
        {
            if (ReadFromExcel.ExtractInt(tower.name) == id)
            {
                //Vector3 pos = new Vector3 (0, 0, 0);
                GameObject obj;
                obj = PoolManager.Spawn(tower.gameObject, selectedFlag.transform.position, Quaternion.identity);
                ScoreControl.CoinDecrease(tower.baseTower.cost);
                obj.GetComponent <SpriteRenderer>().sortingLayerName = selectedFlag.GetComponent <SpriteRenderer>().sortingLayerName;
                //GameManager.ShowIndicator(obj.GetComponent<UnitTower>());
                //GameManager.ClearBaseBuildings();
                //buildManager.ClearBuildPoint();
                AudioManager.PlayTowerBuilding();
                PoolManager.Unspawn(selectedFlag);
                selectedFlag = null;
                break;
            }
        }

        //PoolManager.Spawn(
        selectedIcon = icon;

        return(selectedIcon);
    }
Ejemplo n.º 6
0
    // -------------------------------------------------------------------------------- //

    void    Start()
    {
        this.scene_control = GetComponent <SceneControl>();
        this.score_control = GetComponent <ScoreControl>();

        this.score_control.setNumForce(this.scene_control.result.oni_defeat_num);
    }
 public void LightMoveBeginCompleted()
 {
     ScoreControl.mThrough++;
     GamePlay.instance.LabelThrough.text = ScoreControl.mThrough.ToString();
     ScoreControl.saveGame();
     GameObject.Destroy(this.gameObject);
 }
Ejemplo n.º 8
0
    public void enigmaUpdate()
    {
        print("enigmaUpdate...");
        string description = dataGO.GetComponent <Enigme_Data>().enigmaDescription;

        descriptionGO.GetComponent <UnityEngine.UI.Text>().text = description;
        print("description " + description);
        string title = dataGO.GetComponent <Enigme_Data>().enigmaTitle;

        enigmaTitleGO.GetComponent <UnityEngine.UI.Text>().text = title;
        print("title " + title);
        string type = dataGO.GetComponent <Enigme_Data>().enigmaType.ToString();

        enigmaTypeGO.GetComponent <UnityEngine.UI.Text>().text = type;

        string diff = dataGO.GetComponent <Enigme_Data>().enigmaDifficulty.ToString();

        enigmaDifficultyGO.GetComponent <UnityEngine.UI.Text>().text = diff;

        int enigmaId = dataGO.GetComponent <Enigme_Data>().enigmaId;

        ScoreControl.updateId(enigmaId);

        int enigmaMaxAttempts = dataGO.GetComponent <Enigme_Data>().enigmaMaxAttempts;

        ScoreControl.updateMaxAttempts(enigmaMaxAttempts);
        resetTimer();
    }
Ejemplo n.º 9
0
    public static void ConsumeCube(CubeData cube)
    {
        Vector2 _pos;

        if (cube.color == instance.lastCube.color)
        {
            instance.multiplier++;
            _pos = Camera.main.WorldToScreenPoint(cube.objTrans.position);
            MultiplierControl.ShowMultiplier(cube.color, instance.multiplier, _pos);
            AudioControl.PlayFX("multiplier");
        }
        else
        {
            instance.multiplier = 1;
        }
        instance.lastCube = cube;

        instance.points += cube.points * instance.multiplier;
        instance.StartCoroutine(instance.destroyCube(cube));
        ScoreControl.Set(instance.points);
        if ((state == PLAYING) && (SpawnManager.RemainCubes() == 0))
        {
            state = SUCCESS;
            TitleControl.Animate("GOOD JOB!", TitleControl.SUCCESS_ANIM);
            instance.nextUpdate = Time.time + 2;
        }
    }
 public void DiamondMoveBeginCompleted()
 {
     SoundEngine.getInstance().PlayOneShot(SoundEngine.getInstance()._soundDiamond);
     ScoreControl.Coin += 50;
     GameObject.Destroy(this.gameObject);
     ScoreControl.saveCoin();
     GamePlay.instance.LabelCoin.text = ScoreControl.Coin.ToString();
 }
 //public HUDScript hudCanvas;
 // Start is called before the first frame update
 void Start()
 {
     hs        = GameObject.Find("obvious").GetComponent <HUDScript>();
     rigidBody = this.GetComponent <Rigidbody2D>();
     rigidBody.gravityScale = 1.0f;
     GetComponent <AudioSource>().playOnAwake = false;
     sc = score.GetComponent <ScoreControl>();
 }
Ejemplo n.º 12
0
 void Awake()
 {
     controller        = GetComponent <PlayerController>();
     score             = GetComponent <ScoreControl>();
     platform          = Resources.Load("Platform") as GameObject;
     platformContainer = Resources.Load("PlatformArea") as GameObject;
     gameController    = GameObject.FindGameObjectWithTag("Game");
 }
 public void WithScoreOf(int score, Vector3 positionOfItem)
 {
     theScore = FindObjectOfType <ScoreControl>();
     theScore.AddScore(score);
     MyScore = score;
     tester  = true;
     Score.transform.position = positionOfItem;
 }
 public override void enter()
 {
     gameOverImg.gameObject.SetActive(true);
     gameObject.GetComponent <AudioSource> ().clip = over;
     gameObject.GetComponent <AudioSource> ().Play();
     scoreControl = ScoreControl.Instance;
     Invoke("destroyGamePanel", 4.0f);
 }
Ejemplo n.º 15
0
    // ================================================================ //
    // MonoBehaviour에서 상속.
    void Start()
    {
        this.player = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerControl>();

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

        this.next_step = STEP.PLAY;
    }
Ejemplo n.º 16
0
 private void Awake()
 {
     obstacleQueueControl = GetComponent<ObstacleQueueControl>();
     scoreControl = GetComponent<ScoreControl>();
     timeControl = GetComponent<TimeControl>();
     treeTapControl = GetComponent<TreeTapControl>();
     loseText = GameObject.Find ("LoseText").GetComponent<GUIText>();
     highScore = GameObject.Find ("HighScoreText").GetComponent<GUIText>();
 }
Ejemplo n.º 17
0
    // ================================================================ //
    // MonoBehaviour에서 상속.

    void    Start()
    {
        this.player = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerControl>();

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

        this.next_step = STEP.PLAY;
    }
Ejemplo n.º 18
0
 private void Awake()
 {
     obstacleControl = GetComponent<ObstacleQueueControl>();
     scoreControl = GetComponent<ScoreControl>();
     timeControl = GetComponent<TimeControl>();
     flowControl = GetComponent<FlowControl>();
     deerLeft = GameObject.Find("DeerLeft");
     deerRight = GameObject.Find("DeerRight");
 }
Ejemplo n.º 19
0
    void Start()
    {
        health       = size == 1 ? settings.asteroidSmallHealth : size == 2 ? settings.asteroidMediumHealth : settings.asteroidLargeHealth;
        damagePerHit = settings.damagerPerHit;
        GameObject gameController = GameObject.FindGameObjectWithTag("GameController");

        tilingCtrl = gameController.GetComponent <ScreenTilingCtrl> ();
        scoreCtrl  = gameController.GetComponent <ScoreControl> ();
        rb         = GetComponent <Rigidbody2D> ();
    }
Ejemplo n.º 20
0
    void Start()
    {
        distanceToTravel = -40f;

        targetPosition = new Vector3(transform.position.x, 0, transform.position.z + distanceToTravel);

        explosion = GetComponent <ParticleSystem>();
        //Locating the gameObject holding the ScoreManager script in the scene
        scoreScript = GameObject.Find("GameManager").GetComponent <ScoreControl>();
    }
Ejemplo n.º 21
0
 void OnMouseOver()
 {
     if (bonusType == BonusType.em_Essence)
     {
         ScoreControl.EssenceIncrease(increaseAmount);
     }
     //this.transform.parent.gameObject.SetActive (false);
     Destroy(this.transform.parent.gameObject);
     //Destroy(this.gameObject);
     PoolManager.Unspawn(this.transform.parent.gameObject);
 }
Ejemplo n.º 22
0
    public UnityEngine.Sprite[] uiSprite_Grade;         // 用于显示总体评价的文字(优/良/可/不可)

    // ================================================================ //

    void    Awake()
    {
        this.scene_control = SceneControl.get();
        this.score_control = GetComponent <ScoreControl>();

        this.score_control.setNumForce(this.scene_control.result.oni_defeat_num);

        this.rankSmallDefeat.uiSpriteRank = this.uiSprite_GradeSmall;
        this.rankSmallEval.uiSpriteRank   = this.uiSprite_GradeSmall;
        this.rankTotal.uiSpriteRank       = this.uiSprite_Grade;
    }
Ejemplo n.º 23
0
    void Awake()
    {
        gameSceneControl = GameSceneControl.Instance;
        scoreControl     = GetComponent <ScoreControl>();

        scoreControl.SetScoreForce(gameSceneControl.result.oniDefeatNum);

        defeatRank.rankSprites     = gradeSmallSprites;
        evaluationRank.rankSprites = gradeSmallSprites;
        totalRank.rankSprites      = gradeSprites;
    }
Ejemplo n.º 24
0
 void Start()
 {
     instance = this;
     time     = 60;
     points   = 0;
     TimerControl.Set((int)time);
     ScoreControl.Set(points);
     state      = STANDBY;
     nextUpdate = Time.time + 3;
     FaderControl.FadeOut(2);
 }
Ejemplo n.º 25
0
    // Use this for initialization
    void Start()
    {
        //GameObject canvasObj = GameObject.FindWithTag("Canvas");
        GameObject gamePanelObj   = GameObject.FindWithTag("Game");
        GameObject lifeControlObj = GameObject.FindWithTag("LifeControl");

        lifeNumControl = lifeControlObj.GetComponent <LifeNumControl> ();
        scoreControl   = lifeControlObj.GetComponent <ScoreControl> ();
        //canvas = canvasObj.GetComponent<Canvas> ();
        gameRule = gamePanelObj.GetComponent <GameRule> ();
        sound    = gamePanelObj.GetComponent <AudioSource> ();
    }
Ejemplo n.º 26
0
 void OnBecameInvisible()
 {
     //have some problems
     if (this != null)
     {
         if (this.HpAttribute.m_curHp < this.visitorAttri.angryLimit && targetPoint == null)
         {
             ScoreControl.AngryIncrease(1);
         }
         thisObj.SetActive(false);
     }
 }
Ejemplo n.º 27
0
    // ================================================================ //
    // MonoBehaviour에서 상속.

    void    Start()
    {
        this.next_step     = STEP.RUN;
        this.current_speed = SPEED_MIN;

        this.score_control = ScoreControl.getInstance();
        this.coin_creator  = CoinCreator.getInstance();

        this.anim_player = this.transform.GetComponentInChildren <Animation>();                 //motion.

        this.sound_control = GameObject.Find("SoundRoot").GetComponent <SoundControl>();
    }
Ejemplo n.º 28
0
    public float distanceBetweenAnts = 1.5f; // defined distance between each ant in the party

    /* Purpose: called once at object instantiation, for initializing fields
     * NOTE: any public values that are modified in the Unity editor will get that value overwritten
     * if reassigned with this method
     *
     * Last Date Modified: February 11, 2017 by NP
     */
    void Start()
    {
        scoreKeeper = GameObject.Find("Level Manager").GetComponent <ScoreControl> ();
        ground      = GameObject.Find("Ground").GetComponent <Transform>().gameObject;
        for (int i = 0; i < transform.childCount; i++)
        {
            ant.Add(transform.GetChild(i).gameObject);              // populate ant List with all children objects within Player GameObject
        }
        initializeIgnoreColliders();
        initializeAnts();
        positionAnts();          // position each ant in straight line with appropriate margins, according to their ordering and position from point
    }
Ejemplo n.º 29
0
 public void BoomButtonPress()
 {
     //here
     if (ScoreControl.mBoom > 0 && GamePlay.currentState == GamePlay.STATE_PLAY && LevelManager.currentBubbleWaiting != null)
     {
         SoundEngine.getInstance().PlayOneShot(SoundEngine.getInstance()._soundBone);
         //LevelManager.currentBubble.collider2D.isTrigger = true;
         LevelManager.currentBubbleWaiting.GetComponent <Bubble>().setValue(BubbleType.BUBBLE_TYPE_SHOOT_BOOM_CICLE);
         ScoreControl.mBoom--;
         ScoreControl.saveGame();
         GamePlay.instance.setCountTextEffect();
     }
 }
Ejemplo n.º 30
0
    void Start()
    {
        GameObject scoreControlObject = GameObject.FindWithTag("Score");

        if (scoreControlObject != null)
        {
            scoreControl = scoreControlObject.GetComponent <ScoreControl>();
        }
        if (scoreControl == null)
        {
            Debug.Log("Cannot find 'GameController' script");
        }
    }
Ejemplo n.º 31
0
 /// <summary>
 /// Instancira se prazan Player objekat i dodeljuju reference za sve komponente
 /// </summary>
 void Awake()
 {
     player    = new Player();
     localDB   = GameObject.Find("LocalDBControler").GetComponent <LocalDBControler>();
     firebase  = GameObject.Find("FirebaseControler").GetComponent <FirebaseControler>();
     ui        = GameObject.Find("UIControler").GetComponent <UIControler>();
     fb        = GameObject.Find("FacebookControler").GetComponent <FacebookControler>();
     ads       = GameObject.Find("AdsControler").GetComponent <AdsControler>();
     purchaser = GameObject.Find("Purchaser").GetComponent <Purchaser>();
     social    = GameObject.Find("SocialControler").GetComponent <SocialControl>();
     score     = GameObject.Find("ScoreControler").GetComponent <ScoreControl>();
     gift      = GameObject.Find("RewardControler").GetComponent <RewardControl>();
 }
Ejemplo n.º 32
0
    public void _ShowUpgrade(UnitTower tower)
    {
        Vector3 pos;

        if (upgradeUI != null)
        {
            int        upprice = tower.baseTower.upgradeCost;
            Transform  can     = upgradeUI.gameObject.transform.FindChild("Canvas");
            GameObject tex     = can.FindChild("Text").gameObject;
            Text       text    = tex.transform.GetComponent <Text>();
            text.text = "$" + upprice.ToString();
            pos       = tower.thisT.position;
            float height = upgradeUI.GetComponent <BoxCollider2D>().size.y *upgradeUI.transform.localScale.y;

            if (pos.y + tower.GetComponent <BoxCollider2D>().size.y + height / 2 + 0.05f < maxY)
            {
                upgradeUI.transform.position = new Vector3(pos.x, pos.y + tower.GetComponent <BoxCollider2D>().size.y + height / 2 + 0.05f, pos.z);
            }
            else
            {
                float width  = upgradeUI.GetComponent <BoxCollider2D>().size.x *upgradeUI.transform.localScale.x;
                float width2 = tower.GetComponent <BoxCollider2D>().size.x;
                upgradeUI.transform.position = new Vector3(pos.x - width2 / 2 - width / 2 - 0.05f, pos.y, pos.z);
            }
            upgradeUI.GetComponent <Renderer>().enabled = true;
            if (ScoreControl.CheckResourceSuffi(upprice) == true && BuildManager.FindUpgrade(ReadFromExcel.ExtractInt(tower.name)))
            {
                upgradeUI.GetComponent <SpriteRenderer>().color = Color.white;
                text.color = Color.white;
                upgradeUI.GetComponent <BoxCollider2D>().enabled = true;
                Transform child;
                if ((child = upgradeUI.transform.FindChild("mouseOver")) != null)
                {
                    child.GetComponent <Renderer>().enabled = true;
                }
            }
            else
            {
                upgradeUI.GetComponent <SpriteRenderer>().color = new Color(0.8f, 0.8f, 0.8f, 1.0f);
                text.color = new Color(0.8f, 0.8f, 0.8f, 1.0f);
                upgradeUI.GetComponent <BoxCollider2D>().enabled = false;
                Transform child;
                if ((child = upgradeUI.transform.FindChild("mouseOver")) != null)
                {
                    child.GetComponent <Renderer>().enabled = false;
                }
            }
        }
    }
Ejemplo n.º 33
0
    /*------------------------------------
    *  GetScore(private版)
    *
    *  summary:各スコアを取得
    *  param  :なし(void)
    *  return :なし(void)
    *  ------------------------------------*/
    void GetScore()
    {
        /* 赤スコア */
        ScoreControl sc = GameObject.FindGameObjectWithTag("RedScore").GetComponent <ScoreControl>();

        m_score[(int)COLOR.RED] = sc.GetScore();

        /* 緑スコア */
        sc = GameObject.FindGameObjectWithTag("GreenScore").GetComponent <ScoreControl>();
        m_score[(int)COLOR.GREEN] = sc.GetScore();

        /* 青スコア */
        sc = GameObject.FindGameObjectWithTag("BlueScore").GetComponent <ScoreControl>();
        m_score[(int)COLOR.BLUE] = sc.GetScore();
    }
Ejemplo n.º 34
0
	void Awake()
	{
		if ( control == null )
		{
			DontDestroyOnLoad(gameObject);
			control = this;

			// this is due to JIT compilation required for the binary formatter, which
			// is NOT allowed on iOS.
			Environment.SetEnvironmentVariable("MONO_REFLECTION_SERIALIZER", "yes");

			// slurp
			control.Load();
		}
		else if ( control == this )
		{
			Destroy(gameObject);
		}
	}
Ejemplo n.º 35
0
	public void InitEvents ()
	{
		fc = FlowControl.Instance;
		lc = LevelControl.Instance;
		sc = ScoreControl.Instance;
		uic = UIControl.Instance;
		dc = DataControl.Instance;
		shootC = GameObject.Find ("Player").GetComponent<ShootingController> ();

		lc.BallsChanged += OnBallsChanged;
		lc.LevelChanged += OnLevelChanged;
		lc.TargetsChanged += OnTargetsChanged;
		sc.ScoreChanged += OnScoreChanged;
		shootC.InitPowerSlider += OnInitPowerSlider;
		shootC.UpdatePowerSlider += OnUpdatePowerSlider;

		string levelKind = dc.GetLevel (fc.Level).Kind;
		if (levelKind.Equals ("T"))
			GameObject.Find ("Player").GetComponent<MoveOnTrails> ().TrailsEndReached += OnTrailsEndReached;
	}
Ejemplo n.º 36
0
    // Use this for initialization
    void Start()
    {
        renderers = GetComponentsInChildren<Renderer>();
        audioMngr = GameObject.FindObjectOfType<AudioManager> ();

        scoreControl = GameObject.FindGameObjectWithTag("UI").GetComponent<ScoreControl>();

        if (type == Type.Coin)
        {

                renderers[1].material.SetColor("_Color", Color.yellow);

        }
        else if (type == Type.PickUp)
        {

                renderers[1].material.SetColor("_Color", Color.blue);

        }
    }
Ejemplo n.º 37
0
	public void Proceed ()
	{
		if (Status == STATUS.PLAYING) {
			EventControl.Instance.InitEvents ();

			lc = LevelControl.Instance;
			lc.Level = level;

			Level lev = DataControl.Instance.GetLevel (level);
			lc.BallsInitial = lev.Balls; 
			lc.Targets = lev.Targets;

			sc = ScoreControl.Instance;
			sc.Score = 0;

			Cursor.visible = false;
		} else {
			Cursor.visible = true;
		}
	}
Ejemplo n.º 38
0
 // ================================================================ //
 // MonoBehaviour からの継承.
 void Start()
 {
     this.score_control  = this.gameObject.GetComponent<ScoreControl>();
 }
Ejemplo n.º 39
0
 void Awake()
 {
     playerRigidbody = GetComponent<Rigidbody2D>();
     scoreControl = GameObject.Find("ScoreControl").GetComponent<ScoreControl>();
 }
Ejemplo n.º 40
0
 private void Awake()
 {
     Instance = this;
 }
Ejemplo n.º 41
0
    // ゲームオーバー時に、今回のスコアーをセットする.
    public void setLastScore(ScoreControl.Score last_score)
    {
        this.last_socre = last_score;

        // ハイスコア―更新チェック.
        this.high_score.score = Mathf.Max(this.high_score.score, this.last_socre.score);
        this.high_score.coins = Mathf.Max(this.high_score.coins, this.last_socre.coins);
    }
Ejemplo n.º 42
0
    // -------------------------------------------------------------------------------- //
    void Start()
    {
        // プレイヤーのインスタンスを探しておく.
        this.player = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerControl>();

        this.player.scene_control = this;

        // スコアのインスタンスを探しておく.
        this.score_control = GetComponent<ScoreControl>();

        // カメラのインスタンスを探しておく.
        this.main_camera = GameObject.FindGameObjectWithTag("MainCamera");

        this.level_control = new LevelControl();
        this.level_control.scene_control = this;
        this.level_control.player = this.player;
        this.level_control.OniGroupPrefab = this.OniGroupPrefab;
        this.level_control.create();

        this.result_control = new ResultControl();

        // GUI 制御のスクリプト(コンポーネント).
        this.gui_control = this.GetComponent<GUIControl>();

        // フェードコントロールの追加
        fader = gameObject.AddComponent<FadeControl>();

        // ゲームの結果をクリアーしておく.
        this.result.oni_defeat_num = 0;
        this.result.eval_count = new int[(int)EVALUATION.NUM];
        this.result.rank = 0;
        this.result.score = 0;
        this.result.score_max = 0;

        for(int i = 0;i < this.result.eval_count.Length;i++) {

            this.result.eval_count[i] = 0;
        }

        // フェードインで開始
        this.fader.fade( 3.0f, new Color( 0.0f, 0.0f, 0.0f, 1.0f ), new Color( 0.0f, 0.0f, 0.0f, 0.0f ) );

        this.step = STEP.START;
    }
Ejemplo n.º 43
0
    // ================================================================ //
    // MonoBehaviour에서 상속.
    void Start()
    {
        this.next_step     = STEP.RUN;
        this.current_speed = SPEED_MIN;

        this.score_control = ScoreControl.getInstance();
        this.coin_creator  = CoinCreator.getInstance();

        this.anim_player = this.transform.GetComponentInChildren<Animation>();		//motion.

        this.sound_control = GameObject.Find("SoundRoot").GetComponent<SoundControl>();
    }
Ejemplo n.º 44
0
    // -------------------------------------------------------------------------------- //
    void Start()
    {
        this.scene_control = GetComponent<SceneControl>();
        this.score_control = GetComponent<ScoreControl>();

        this.score_control.setNumForce( this.scene_control.result.oni_defeat_num );
    }
Ejemplo n.º 45
0
    // 게임 오버 시에 이번 점수를 설정한다.
    public void setLastScore(ScoreControl.Score last_score)
    {
        this.last_socre = last_score;

        // 최고 점수 - 갱신 체크.
        this.high_score.score = Mathf.Max(this.high_score.score, this.last_socre.score);
        this.high_score.coins = Mathf.Max(this.high_score.coins, this.last_socre.coins);
    }
Ejemplo n.º 46
0
	void Awake ()
	{
		//Make this active and only instance
		instance = this;
		score = 0;
	}