Exemplo n.º 1
0
        private void Start()
        {
            fadeControl = FadeScript.Instance;

#if UNITY_2017_2_OR_NEWER
            if (!XRDevice.isPresent ||
#if UNITY_WSA
                !HolographicSettings.IsDisplayOpaque ||
#endif
                fadeControl == null)
#else
            if (VRDevice.isPresent || fadeControl == null)
#endif
            {
                if (fadeControl == null)
                {
                    Debug.LogError("The MixedRealityTeleport script on " + name + " requires a FadeScript object.");
                }

                Destroy(this);
                return;
            }

            if (teleportMarker != null)
            {
                teleportMarker = Instantiate(teleportMarker);
                teleportMarker.SetActive(false);

                animationController = teleportMarker.GetComponentInChildren <Animator>();
                if (animationController != null)
                {
                    animationController.StopPlayback();
                }
            }
        }
Exemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     if (this.GetComponent <AudioSource>() != null)
     {
         audio = this.GetComponent <AudioSource>();
     }
     scene = this.GetComponent <SceneManagement>();
     fade  = GameObject.Find("FadePanel").GetComponent <FadeScript>();
     if (SceneManager.GetActiveScene().name == "SelectScene")
     {
         menu  = GameObject.Find("SelectSceneObj").GetComponent <MenuEvent>();
         enter = GameObject.Find("SelectSceneObj").GetComponent <CancelScript>();
         //select = GameObject.Find("P1Image").GetComponent<CharacterSelect>();
         //select2 = GameObject.Find("P2Image").GetComponent<CharacterSelect>();
     }
     if (SceneManager.GetActiveScene().name == "PlayMenuScene")
     {
         datare = GameObject.Find("GameSystem").GetComponent <DataRetention>();
     }
     if (SceneManager.GetActiveScene().name == "PlayScene" || SceneManager.GetActiveScene().name == "PlayMenuScene")
     {
         sys = GameObject.Find("GameSystem").GetComponent <PlayMenuSystem>();
     }
     if (SceneManager.GetActiveScene().name == "PlayMenuScene")
     {
         sys = GameObject.Find("PlayMenuSystemObj").GetComponent <PlayMenuSystem>();
     }
     //Debug.Log("sys:" + sys);
     //Debug.Log("datare:" + datare);
     sceneFlagMenu = false;
 }
Exemplo n.º 3
0
        private void Start()
        {
            fadeControl = FadeScript.Instance;

            if (!XRDevice.isPresent || fadeControl == null)
            {
                if (fadeControl == null)
                {
                    Debug.LogError("The MixedRealityTeleport script on " + name + " requires a FadeScript object.");
                }

                Destroy(this);
                return;
            }

            if (TeleportMarker != null)
            {
                teleportMarker = Instantiate(TeleportMarker);
                teleportMarker.SetActive(false);

                animationController = teleportMarker.GetComponentInChildren <Animator>();
                if (animationController != null)
                {
                    animationController.StopPlayback();
                }
            }
        }
 public void SwitchToMM()
 {
     if (FadeScript.Fading)
     {
         return;
     }
     StartCoroutine(FadeScript.FadeOut(GameObject.Find("transition").GetComponent <Image>(), "MainMenu"));
 }
	void Start () {

		fadeScript = GetComponent<FadeScript>();

		if(GetComponent<LineRenderer>()!=null)
			GetComponent<LineRenderer>().enabled = false;

	}
Exemplo n.º 6
0
 void Start()
 {
     panel    = GameObject.Find("Panel");
     isDamage = false;
     isDead   = false;
     fade     = panel.GetComponent <FadeScript>();
     life     = lifeMax;
 }
 public void SwitchScene()
 {
     if (FadeScript.Fading)
     {
         return;
     }
     StartCoroutine(FadeScript.FadeOut(GameObject.Find("transition").GetComponent <Image>(), "Credits"));
 }
Exemplo n.º 8
0
 // Use this for initialization
 void Start()
 {
     fader = GameObject.FindObjectOfType <FadeScript>();
     if (objectToShow != null)
     {
         objectToShow.renderer.enabled = false;
     }
 }
Exemplo n.º 9
0
 void Start()
 {
     fadeScript = GetComponent <FadeScript>();
     if (gameObject.tag == "RedLine")
     {
         GetComponent <LineRenderer>().enabled = false;
     }
 }
    // Use this for initialization
    void Start()
    {
        missionPanel = this.gameObject;
        missionText  = GetComponentInChildren <Text>();
        textLocation = missionText.gameObject.GetComponent <RectTransform>();
        missionPanel.gameObject.SetActive(false);

        fadeScript = this.gameObject.GetComponent <FadeScript>();
    }
 void Awake()
 {
     cloudMaterial    = GetComponentInChildren <MeshRenderer>().material;
     fadeControl      = FadeScript.Instance;
     networkDiscovery = NetworkDiscoveryWithAnchors.Instance;
     anchorManager    = UNetAnchorManager.Instance;
     levelState       = LevelControl.Instance;
     allPlayers.Add(this);
 }
Exemplo n.º 12
0
    // Use this for initialization
    void Start()
    {
        Image img  = this.GetComponent <Image>();
        var   temp = img.color;

        temp.a    = 1.0f;
        img.color = temp;
        StartCoroutine(FadeScript.FadeIn(img));
    }
Exemplo n.º 13
0
    void Start()
    {
        fadeScript = GetComponent <FadeScript>();

        if (GetComponent <LineRenderer>() != null)
        {
            GetComponent <LineRenderer>().enabled = false;
        }
    }
Exemplo n.º 14
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }

        _fadeAnim = GetComponent <Animator>();
    }
Exemplo n.º 15
0
 void Start()
 {
     fade = fadeScreen.GetComponent <FadeScript>();
     for (int i = 1; i < 5; i++)
     {
         splashScreen[i].SetActive(false);
     }
     movementScript = player.GetComponent <Movement>();
 }
Exemplo n.º 16
0
    private void Awake()
    {
        m_FadeScript = FindObjectOfType <FadeScript>();

        m_Option1.onClick.AddListener(OnClickOption1);
        m_Option2.onClick.AddListener(OnClickOption2);
        m_Option3.onClick.AddListener(OnClickOption3);

        m_SellButton.onClick.AddListener(OnClickSell);
    }
Exemplo n.º 17
0
    void Start()
    {
        GameObject parent = GameObject.Find("Stage");

        spawn   = parent.transform.Find("PlayerSpawnPoint").gameObject;
        panel   = GameObject.Find("Panel");
        fade    = panel.GetComponent <FadeScript>();
        pDamage = GetComponent <PlayerDamage>();
        isDeth  = false;
    }
Exemplo n.º 18
0
    //!  The script instance is being loaded (before the game starts).
    /*! Makes the fade*/
    void Awake()
    {
        instance = this;

        FadeScript[] duplicate = FindObjectsOfType(typeof(FadeScript)) as FadeScript[];

        // if more than 1 is returned - there are two on scene, so delete this one
        if (duplicate.Length > 1)
        {
            Destroy(gameObject);
        }
    }
 // Use this for initialization
 void Start()
 {
     regulated        = StaticDecisionsMade.chooseToRegulateUber;
     _regulated       = regulated;
     source1          = advisor1.GetComponent <AudioSource>();
     source2          = advisor2.GetComponent <AudioSource>();
     advisor1Animator = advisor1.GetComponent <AdvisorAnimationController>();
     advisor2Animator = advisor2.GetComponent <AdvisorAnimationController>();
     initializeAudioClips();
     fader            = player.GetComponentInChildren <FadeScript>();
     radioAudioSource = radio.GetComponent <AudioSource> ();
 }
Exemplo n.º 20
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(this.gameObject);
     }
     else
     {
         Destroy(this.gameObject);
     }
 }
Exemplo n.º 21
0
 void Start()
 {
     fadeControl         = FadeScript.Instance;
     warper              = MixedRealityTeleport.Instance;
     animationController = GetComponentInChildren <Animator>();
     animationController.StopPlayback();
     animationController.speed = 0;
     gazeManager = GazeManager.Instance;
     ActiveMarker.SetActive(false);
     layerMask = 1 << (LayerMask.NameToLayer("Ignore Raycast"));
     layerMask = ~layerMask;
     Debug.Log(LayerMask.NameToLayer("Ignore Raycast"));
 }
Exemplo n.º 22
0
 void Start()
 {
     animator = GetComponent <Animator>();
     fadeIn   = GetComponent <FadeScript>();
     if (fadeIn != null)
     {
         fadeIn.StartFadeIn();
     }
     nextActionTime = Time.time;
     initialSpeed   = speed;
     ResetDirection();
     randomMovementDuration = GetRandomMovementDuration(speed);
 }
Exemplo n.º 23
0
 void Start()
 {
     // image = GetComponent<Image>();
     // image.gameObject.SetActive(false);
     talkText.text = "여기는 통신병, 임무 수행을 원활하게 진행하기 위해서 방침을 알려주겠다";
     timer         = 0.0f;
     waitingTime   = 2;
     enemyControl  = Enemy.gameObject.GetComponent <EnemyControl>();
     Enemy.SetActive(false);
     enemyButtonCreator = Enemy.gameObject.GetComponent <EnemyButtonCreator>();
     fade = Black.gameObject.GetComponent <FadeScript>();
     // enemyControl.isPause = false;
     Debug.Log("enemyControl's variable isPause is " + enemyControl.isPause);
 }
Exemplo n.º 24
0
    // Start is called before the first frame update
    void Start()
    {
        // InputManager取得
        GameObject inputObj = GameObject.Find("InputManager");

        mInput = inputObj.GetComponent <InputManager>();

        // FadeScript取得
        GameObject fadeObj = GameObject.Find("FadeManager");

        mFade = fadeObj.GetComponent <FadeScript>();

        nextScene = false;
    }
Exemplo n.º 25
0
    // Start is called before the first frame update
    void Start()
    {
        if (candyBox == null)
        {
            candyBox = GameObject.FindGameObjectWithTag("Candy Box");
        }

        animator = GetComponent <Animator>();

        newCandyPos = Camera.main.ScreenToWorldPoint(candyBox.transform.position);
        newCandyPos = new Vector3(candyBox.transform.position.x, candyBox.transform.position.y, 0);

        startTime = Time.time;
        fade      = GetComponentInChildren <FadeScript>();
    }
        private void Start()
        {
            gazeManager = GazeManager.Instance;
            fadeControl = FadeScript.Instance;
            SpeedScale  = 0.6f;

            teleportMarker = Instantiate(TeleportMarker);
            teleportMarker.SetActive(false);

            animationController = teleportMarker.GetComponentInChildren <Animator>();
            if (animationController != null)
            {
                animationController.StopPlayback();
            }
        }
Exemplo n.º 27
0
    // Start is called before the first frame update
    void Start()
    {
        countDownObj  = GameObject.Find("CountDown");
        countDownAnim = countDownObj.GetComponent <Animator>();
        countDownObj.SetActive(false);


        // フェードマネージャを取得
        fadeManager = GameObject.Find("FadeManager");
        fade        = fadeManager.GetComponent <FadeScript>();

        timeManager = GameObject.Find("TimeManager");
        timeManager.SetActive(false);

        enable = false;
    }
Exemplo n.º 28
0
    public IEnumerator RollCredits()
    {
        EventManager.TriggerEvent("FinishGame");
        FadeScript fade = FindObjectOfType <FadeScript>();

        if (fade != null)
        {
            fade.Fade();
        }
        yield return(new WaitForSeconds(1.6f));

        dialoguePanelController.PopUp = false;
        yield return(new WaitForSeconds(1.5f));

        sceneHandler.LoadScene("09_Credits");
    }
Exemplo n.º 29
0
 private void Init(){
     this.fadeScript = GameObject.Find("FadePanel").GetComponent<FadeScript>();
     this.player = GameObject.Find("Player").GetComponent<PlayerScript>();
     this.enemy = GameObject.Find("Enemy").GetComponent<EnemyScript>();
     this.startWaitTime = Constants.StartWaitTime;
     this.PlayerShotWaitTime = Constants.ShotWaitTime;
     this.EnemyShotWaitTime = Constants.ShotWaitTime;
     this.mPlayerHP = Constants.MaxLife;
     this.mPlayerShieldHP = Constants.ShieldPoint;
     this.mEnemyHP = Constants.MaxLife;
     this.mEnemyShieldHP = Constants.ShieldPoint;
     this.mPlayerGuardTime = Constants.GuardTime;
     this.mEnemyGuardTime = Constants.GuardTime;
     this.PlayerBallReload();
     this.EnemyBallReload();
 }
Exemplo n.º 30
0
 // Use this for initialization
 void Start()
 {
     time     = 0;
     winTime  = 0;
     baseTime = 0;
     gameSet  = true;
     flag     = true;
     pause    = playerObj1.GetComponent <PlayerController>();
     hp1      = playerObj1.GetComponent <HPDirectorScript>();
     hp2      = playerObj2.GetComponent <HPDirectorScript>();
     timer    = timerObj.GetComponent <TimerScript>();
     getGame  = gameDirecter.GetComponent <GetGameScript>();
     directer = gameDirecter.GetComponent <GameDirector>();
     fade     = fadePanel.GetComponent <FadeScript>();
     winChar  = 0;
     test     = 60.0f;
 }
Exemplo n.º 31
0
	void Start () {
		//if(i!=13 || i!=15)

		//i=0;
		player = (GameObject)GameObject.Find("PlayerQ");
		c=0;
		ccount = true;
		appOnce = true;
		currentChildren = 0;
		fadeScript = GetComponent<FadeScript>();
		//if(gameObject.tag == "RedLine")
//		meas1 = false;
//		meas2 = true;
		if(GetComponent<LineRenderer>()!=null)
			GetComponent<LineRenderer>().enabled = false;

	}
Exemplo n.º 32
0
    void Start()
    {
#if LINE_REND
        // This is for debugging the gaze ray.
        lineRend = gameObject.AddComponent <LineRenderer>();
        lineRend.positionCount = 2;
        Vector3[] points = new Vector3[] { Vector3.zero, Vector3.one };
        lineRend.SetPositions(points);
#endif

        fadeScript = FadeScript.Instance;
        warper     = MixedRealityTeleport.Instance;
        startScale = transform.localScale;
        SetGoalLights();
        SafetyColliders.SetActive(false);
        Debug.LogFormat("{0} {1}", gameObject.name, this.netId);
    }
    // Use this for initialization
    void Start()
    {
        fs = fade.GetComponent <FadeScript>();
        fs.SetFadingIn(true, 0.0f, "");

        continueButton.SetActive(false);
        loader = new DataLoader();
        SaveFormat save = loader.GetSave();

        if (save != null)
        {
            if (save.day != 0 || save.level != 0)
            {
                continueButton.SetActive(true);
            }
        }
    }
Exemplo n.º 34
0
 IEnumerator Start(){
     fadeScript = GameObject.Find("FadePanel").GetComponent<FadeScript>();
     go = GameObject.Find("GameObject");
     AsyncOperation async = Application.LoadLevelAdditiveAsync("Main");
     async.allowSceneActivation = false;
     do{
         timer -= Time.deltaTime;
         if (timer <= 0){
             async.allowSceneActivation = true;
             go.SetActive(false);
         }
         Debug.Log("progress: " + async.progress + "isDone: " + async.isDone);
         yield return new WaitForEndOfFrame();
     }
     while (async.isDone == false);
     
     
     Debug.Log("Loading complete");
     Debug.Log("final progress: " + async.progress + "isDone: " + async.isDone);
 }
Exemplo n.º 35
0
 void Start()
 {
     CamS = GameObject.Find("Camera").GetComponent<FadeScript>();
 }
Exemplo n.º 36
0
	void Start () {
        fadeScript = GameObject.Find("FadePanel").GetComponent<FadeScript>();
	}
Exemplo n.º 37
0
	void Start (){
        fadeScript = GameObject.Find("FadePanel").GetComponent<FadeScript>();
        timer = Constants.EndWaitTime;
	}
    void Update()
    {
        if (Application.loadedLevel != 7) {
            switch (MainLevel.Level) {
            case 1:
                if (TempoS.TotalTime >= 10) {
                    TempoS.TimeCounter.color = new Color32 (255, 0, 0, 255);
                }
                if (TempoS.TotalTime == 15) {
                    PlayerPrefs.SetInt ("Limite", 15);
                    FadeS.FadeIn = true;
                    FadeS.FadeOut = false;
                    FadeS.scene = "Lost";
                }
                break;
            case 2:
                if (TempoS.TotalTime >= 15) {
                    TempoS.TimeCounter.color = new Color32 (255, 0, 0, 255);
                }
                if (TempoS.TotalTime == 20) {
                    PlayerPrefs.SetInt ("Limite", 20);
                    FadeS.FadeIn = true;
                    FadeS.FadeOut = false;
                    FadeS.scene = "Lost";
                }
                break;
            case 3:
                if (TempoS.TotalTime >= 20) {
                    TempoS.TimeCounter.color = new Color32 (255, 0, 0, 255);
                }
                if (TempoS.TotalTime == 25) {
                    PlayerPrefs.SetInt ("Limite", 25);
                    FadeS.FadeIn = true;
                    FadeS.FadeOut = false;
                    FadeS.scene = "Lost";
                }
                break;
            case 4:
                if (TempoS.TotalTime >= 25) {
                    TempoS.TimeCounter.color = new Color32 (255, 0, 0, 255);
                }
                if (TempoS.TotalTime == 30) {
                    PlayerPrefs.SetInt ("Limite", 30);
                    FadeS.FadeIn = true;
                    FadeS.FadeOut = false;
                    FadeS.scene = "Lost";
                }
                break;
            case 5:
                if (TempoS.TotalTime >= 30) {
                    TempoS.TimeCounter.color = new Color32 (255, 0, 0, 255);
                }
                if (TempoS.TotalTime == 35) {
                    PlayerPrefs.SetInt ("Limite", 35);
                    FadeS.FadeIn = true;
                    FadeS.FadeOut = false;
                    FadeS.scene = "Lost";
                }
                break;
            }
        }
        if(FadeS == null)
        {
            FadeS = GameObject.Find("Camera").GetComponent<FadeScript>();
        }
        if(counter > 2f)
        {
            if(FacesToBig[i].renderer.material.mainTexture == FacesToMini[i].renderer.material.mainTexture)
            {
                if(i < 53)
                {
                    i++;
                }
                else
                {
                    counterToWin += Time.deltaTime;
                    for (int l = 0; l < 54; l++)
                    {
                        if (FacesToBig[l].renderer.material.mainTexture == FacesToMini[l].renderer.material.mainTexture)
                        {
                            j++;
                            if(j == 53 && l == 53)
                            {
                                ToWin = 0;
                                i = 0;
                                j = 0;
                            }
                            else if(counterToWin > 0.5f)
                            {
                                ToWin += 1;
                                i = 0;
                                j = 0;
                            }
                        }
                    }
                }
            }
        }
        else
        {
            counter += Time.deltaTime;
        }
        if(ToWin >= 1)
        {
            PlayerPrefs.SetInt("LastTime", TempoS.TotalTime);
            MainLevel.CanPlay = false;
            if(Application.loadedLevel != 7)
            {
                switch(MainLevel.Level)
                {
                    case 1:

                        if (TempoS.TotalTime <= (5*MainLevel.Level))
                        {
                            Star = 3;
                        }
                        else if (TempoS.TotalTime > (5 * MainLevel.Level) && TempoS.TotalTime <= (5 * MainLevel.Level * 2))
                        {
                            Star = 2;
                        }
                        else
                        {
                            Star = 1;
                        }
                    break;
                    case 2:
                        if (TempoS.TotalTime <= (5 * MainLevel.Level))
                        {
                            Star = 3;
                        }
                        else if (TempoS.TotalTime > (5 * MainLevel.Level) && TempoS.TotalTime <= (5 * MainLevel.Level * 1.5f))
                        {
                            Star = 2;
                        }
                        else
                        {
                            Star = 1;
                        }
                    break;
                    case 3:
                        if (TempoS.TotalTime <= (5 * MainLevel.Level))
                        {
                            Star = 3;
                        }
                        else if (TempoS.TotalTime > (5 * MainLevel.Level) && TempoS.TotalTime <= (5 * MainLevel.Level * 1.5f))
                        {
                            Star = 2;
                        }
                        else
                        {
                            Star = 1;
                        }
                    break;
                    case 4:
                        if (TempoS.TotalTime <= (5 * MainLevel.Level))
                        {
                            Star = 3;
                        }
                        else if (TempoS.TotalTime > (5 * MainLevel.Level) && TempoS.TotalTime <= (5 * MainLevel.Level * 1.5f))
                        {
                            Star = 2;
                        }
                        else
                        {
                            Star = 1;
                        }
                    break;
                    case 5:
                        if (TempoS.TotalTime <= (5 * MainLevel.Level))
                        {
                            Star = 3;
                        }
                        else if (TempoS.TotalTime > (5 * MainLevel.Level) && TempoS.TotalTime <= (5 * MainLevel.Level * 1.5f))
                        {
                            Star = 2;
                        }
                        else
                        {
                            Star = 1;
                        }
                    break;
                }
            }
            if (PlayerPrefs.GetInt("Points" + (MainLevel.Level - 1)) < Star && Application.loadedLevel != 7)
            {
                PlayerPrefs.SetInt("Points" + (MainLevel.Level -1), Star);
            }
            PlayerPrefs.SetInt("LastStar", Star);

            PlayerPrefs.SetInt("Level",MainLevel.Level+1);
            if(PlayerPrefs.GetInt("Level") > PlayerPrefs.GetInt("LevelMax") && Application.loadedLevel != 7)
            {
                PlayerPrefs.SetInt("LevelMax", PlayerPrefs.GetInt("Level"));
            }
            FadeS.FadeIn = true;
            FadeS.FadeOut = false;
            if(Application.loadedLevel != 7)
            {
                FadeS.scene = "Victory";
            }
            else
            {
                PlayerPrefs.SetInt("Level", 1);
                PlayerPrefs.SetInt("LevelMax", 1);
                for (int l = 0; l < 6; l++ )
                {
                    PlayerPrefs.SetInt("Points"+l, 0);
                }
                FadeS.scene = "SelectStage";
            }
            ToWin = 0;
            i = 0;
            j = 0;
            counterToWin = 0;
        }
    }
Exemplo n.º 39
0
 void Start()
 {
     //Start Music
     ///
     horizontalpos1 = -300;
     horizontalpos2 = -300;
     horizontalpos3 = -300;
     optionspos = 960;
     optionsopen = false;
     OpenMenu();
     quality = 5;
     QualitySettings.SetQualityLevel(5);
     fade = GameObject.Find("MainCube").GetComponent<FadeScript>();
     startgame = false;
 }
Exemplo n.º 40
0
	void Start () {
		fadeScript = GetComponent<FadeScript>();
		if(gameObject.tag == "RedLine")
			GetComponent<LineRenderer>().enabled = false;
		
	}
Exemplo n.º 41
0
    // Use this for initialization
    void Start()
    {
        fade = GameObject.Find("Fade").GetComponent<FadeScript>();
        fade.FadeIn();

        descriptionCloseButton = GameObject.Find("DescriptionCloseButton");
        difficultyLabel = GameObject.Find("DifficultyLabel").GetComponent<exSpriteFont>();

        difficultyLabel.text = NotesData.DIFFICULTY_LEVEL;

        musicSrc = (AudioSource)this.gameObject.GetComponent<AudioSource>();
        musicSrc.Play();

        for (int i = 0; i < ModeLauncherScript.modesDone.Length; i++) {
            string name = string.Format("Checkbox_{0}", i + 1);
            exSprite sprite = GameObject.Find(name).GetComponent<exSprite>();
            sprite.renderer.enabled = ModeLauncherScript.modesDone[i];
        }
        if (ModeLauncherScript.descriptionViewed) {
            CloseDescription();
        }
    }