Esempio n. 1
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Alpha1))
     {
         RedScore.GetComponent <TeamScore>().AddScore();
         Debug.Log("赤スコア1追加");
     }
     if (Input.GetKeyDown(KeyCode.Alpha2))
     {
         GreenScore.GetComponent <TeamScore>().AddScore();
         Debug.Log("緑スコア1追加");
     }
     if (Input.GetKeyDown(KeyCode.Alpha3))
     {
         BlueScore.GetComponent <TeamScore>().AddScore();
         Debug.Log("青スコア1追加");
     }
     if (Input.GetKeyDown(KeyCode.Alpha4))
     {
         YellowScore.GetComponent <TeamScore>().AddScore();
         Debug.Log("黄スコア1追加");
     }
     if (Input.GetKeyDown(KeyCode.Alpha5))
     {
         YellowScore.GetComponent <TeamScore>().SubScore();
         Debug.Log("黄スコア1減少");
     }
     if (Input.GetKeyDown(KeyCode.Alpha6))
     {
         Yellow_SetScore = 0;
         YellowScore.GetComponent <TeamScore>().SetScore(Yellow_SetScore);
         Debug.Log("黄スコアをセット");
     }
 }
Esempio n. 2
0
    //--------------------------------------- END CHANGE LEVEL ---------------------------------------
    public void setManager()
    {
        if ((level == 0 || level == 1) && gameObject) {
            DestroyImmediate(gameObject);
        }
        canChangeLevel = true;
        jellyFish = GameObject.FindWithTag ("Player");
        rScore = (GameObject.FindGameObjectWithTag ("RedScore")).GetComponent<RedScore> ()as RedScore;
        bScore = (GameObject.FindGameObjectWithTag ("BlueScore")).GetComponent<BlueScore> ()as BlueScore;
        yScore = (GameObject.FindGameObjectWithTag ("YellowScore")).GetComponent<YellowScore> ()as YellowScore;
        lightVisible = jellyFish.GetComponentsInChildren<Light> (false) as Light[];
        lightRange = lightVisible[0].range;

        jellyfishLight = jellyFish.GetComponentInChildren<lightPulse> () as lightPulse;
        jellyfishColorManager = jellyFish.GetComponent<ColorManager> () as ColorManager;
        jellyfishLight.updateJellyfishLightColor (currentLightColor);
        jellyfishColorManager.updateColorJellyfish (currentColor);
        mainCamera = Camera.main;
        lightImpulse = false;
        barrier = false;
        flash = false;
        lightImpulseCamera = false;
        oldSizeCamera = mainCamera.orthographicSize;
        anImpulse = (GameObject.FindGameObjectWithTag ("impulse")).GetComponent<Animator> () as Animator;
        anWarning = (GameObject.FindGameObjectWithTag ("warning")).GetComponent<Animator>() as Animator;
        anBarrier = (GameObject.FindGameObjectWithTag ("barrier")).GetComponent<Animator> () as Animator;
        anFlash = (GameObject.FindGameObjectWithTag ("flash")).GetComponent<Animator> () as Animator;
        anRedTimer = (GameObject.FindGameObjectWithTag ("redTimer")).GetComponent<Animator> () as Animator;
        anBlueTimer = (GameObject.FindGameObjectWithTag ("blueTimer")).GetComponent<Animator> () as Animator;
        anYellowTimer = (GameObject.FindGameObjectWithTag ("yellowTimer")).GetComponent<Animator> () as Animator;
        anLoading = (GameObject.Find ("Loading")).GetComponent<Animator>() as Animator;
        barrierCollider = (GameObject.FindGameObjectWithTag ("barrier")).GetComponent<CircleCollider2D> () as CircleCollider2D;

        tutorialText = GameObject.Find ("TutorialText").GetComponent<Text> () as Text;
        anTutorial = GameObject.Find ("TutorialText").GetComponent<Animator> () as Animator;

        gameOver = (GameObject.Find ("Controller")).GetComponent<GameOverMenu> () as GameOverMenu;

        barrierAudio = GameObject.FindGameObjectWithTag ("barrier").GetComponent<AudioSource> () as AudioSource;
        impulseAudio = GameObject.FindGameObjectWithTag ("impulse").GetComponent<AudioSource> () as AudioSource;
        flashAudio = GameObject.FindGameObjectWithTag ("flash").GetComponent<AudioSource> () as AudioSource;

        if (unlockBarrier) {
            anBlueTimer.SetTrigger("barrierUnlocked");
        }
        if (unlockFlash) {
            anYellowTimer.SetTrigger("flashUnlocked");
        }
        if (unlockImpulse) {
            anRedTimer.SetTrigger("impulseUnlocked");
        }

        tryBlue = 0;
        tryRed = 0;
        tryYellow = 0;
        if (level != 1)
            anLoading.SetTrigger ("stopLoading");

        if (level == 2) {
            StartCoroutine(initTutorial());
        }
    }