コード例 #1
0
 /// <summary>
 /// Sets the play button to say start and activates it.
 /// </summary>
 void Start()
 {
     gameData = GameObject.Find("Game Data").GetComponent <GameData>();
     gameData.ResetLiftTracker();
     shakingBar = GameObject.Find("MenuBarbell");
     sceneTransitionController = GameObject.Find("Transition").GetComponent <SceneTransitionController>();
 }
コード例 #2
0
 /// <summary>
 /// Called before the first frame.
 /// </summary>
 void Start()
 {
     sceneTransitionController = GameObject.Find("Transition").GetComponent <SceneTransitionController>();
     gameData     = GameObject.Find("Game Data").GetComponent <GameData>();
     gameOverText = GameObject.Find("Game Over Text").GetComponent <Text>();
     InitializeGameOverScreen();
 }
コード例 #3
0
 private void Start()
 {
     rb              = snowBoard.GetComponent <Rigidbody2D>();
     music           = FindObjectOfType <MusicController>();
     sceneController = FindObjectOfType <SceneTransitionController>();
     scoreText       = FindObjectOfType <ScoreText>();
 }
コード例 #4
0
 void Start()
 {
     difficulty = GameObject.Find("DifficultyDropdown").GetComponent <Dropdown>();
     sceneTransitionController = GameObject.Find("Transition").GetComponent <SceneTransitionController>();
     popup = GameObject.Find("Popup");
     data  = GameObject.Find("Game Data").GetComponent <GameData>();
     popup.SetActive(false);
     InitializeDropdowns();
 }
コード例 #5
0
 /* Implementation */
 private void Awake()
 {
     if (singleton != null && singleton != this)
     {
         Destroy(gameObject);
         return;
     }
     else
     {
         singleton = this;
         DontDestroyOnLoad(gameObject);
     }
 }
コード例 #6
0
ファイル: Timer.cs プロジェクト: sydneylin12/StickingPoint
    /// <summary>
    /// Initialize all the GameObjects and resources for the Timer superclass.
    /// </summary>
    protected void InitializeTimer()
    {
        gameData                  = GameObject.Find("Game Data").GetComponent <GameData>();
        slider                    = GameObject.Find("Slider").GetComponent <Slider>();
        sliderFill                = GameObject.Find("Slider Fill").GetComponent <Image>();
        gameplayController        = GameObject.Find("Gameplay Controller").GetComponent <GameplayController>();
        speechController          = GameObject.Find("Speech Controller").GetComponent <SpeechController>();
        startButtonController     = GameObject.Find("Start Button Controller").GetComponent <StartButtonController>();
        sceneTransitionController = GameObject.Find("Transition").GetComponent <SceneTransitionController>();
        playerAnimationController = GameObject.Find("Player Animation Controller").GetComponent <PlayerAnimationController>();
        countdownController       = GameObject.Find("Countdown Controller").GetComponent <CountdownController>();

        // Set the total time and bounded time
        timeMax = gameData.GetTimeTotal();
        bound   = gameData.GetBound() * timeMax;
    }
コード例 #7
0
    //Handles loading new level
    void LoadNewLevel(bool newGame)
    {
        //Stops the timer
        timeRunning(true);
        SceneTransitionController sceneController = GameObject.Find("SceneTransitions").GetComponent <SceneTransitionController>();

        //If the game is playing arcade mode
        if (KeyDirectory.Mode.Game.Get() == KeyDirectory.Mode.Game.ARCADE)
        {
            //if a new game is set
            if (newGame)
            {
                //Move to mid game
                sceneController.slideTrans("ArcadeMidGame");
            }
            else
            {
                //Else move to lose screen
                sceneController.slideTrans("ArcadeLoseScreen");
            }
        }
        else
        //If the game is playing story mode
        {
            if (KeyDirectory.Mode.Story.Get() == KeyDirectory.Mode.Story.EASY)
            {
                //If the player has enough wins
                if (KeyDirectory.Games.Score.doesPlayerHaveEnoughWins())
                {
                    //Take the player to the end game
                    sceneController.slideTrans("Test-EasyGame");
                }
                else
                {
                    //else take the player to the midgame
                    sceneController.slideTrans("EasyMode-PauseGame");
                }
            }
        }
    }
コード例 #8
0
    void Awake()
    {
        if (!inEditor)
        {
            blackCanvasGroup.alpha = 1f;
            whiteCanvasGroup.alpha = 0f;
        }
        else
        {
            blackCanvasGroup.alpha = 0f;
            whiteCanvasGroup.alpha = 0f;
        }

        if (_instance == null)
        {
            _instance = this;
        }
        else
        {
            Debug.Log("DoctorEvents can only be set once");
        }
    }
コード例 #9
0
ファイル: GameController.cs プロジェクト: imouto1994/jetrider
    public void Update()
    {
        if (Input.GetKeyDown(KeyCode.Escape) || Input.GetButtonDown("Cancel"))
        {
            if (instructionsScreen.activeSelf)
            {
                CloseInstructions();
            }
            else if (highScoreScreen.activeSelf)
            {
                CloseHighScore();
            }
            else
            {
                TogglePause();
            }
        }

        if ((Input.GetKeyDown(KeyCode.KeypadEnter) || Input.GetKeyDown(KeyCode.Return) || Input.GetButtonDown("Fly")) && gameOverScreen.activeSelf)
        {
            SceneTransitionController transitionScript = GetComponent <SceneTransitionController>();
            transitionScript.RestartGame();
        }
    }
コード例 #10
0
 /// <summary>
 /// Called before the first frame.
 /// </summary>
 void Start()
 {
     sceneTransitionController = GameObject.Find("Transition").GetComponent <SceneTransitionController>();
 }
コード例 #11
0
    void Awake()
    {
        //DontDestroyOnLoad(this);
        //m_MyButton.onClick.AddListener(SceneTransition);
        m_Scene = SceneManager.GetActiveScene();
        if (m_Scene.name == "Scene2")
        {
            //m_MyButton.GetComponentInChildren<Text>().text = "Load Next Scene";
        }

        //Otherwise change the Text to "Load Previous Scene"
        else
        {
            GameObject sceneTransitionObject          = GameObject.Find("SceneTransition");
            SceneTransitionController sceneTransition = sceneTransitionObject.GetComponent <SceneTransitionController>();
            // m_MyButton.GetComponentInChildren<Text>().text = "Load Previous Scene";
            play_button.onClick.AddListener(PlaySimulation);
            backButton.onClick.AddListener(BackToFirstScene);
            resetPosCam.onClick.AddListener(ResetPositionCamera);
            Destroy(sceneTransition.gameObject);
            //use video selected in first scene
            textVideoList             = "NewDataSet/" + sceneTransition.videoName;
            sceneTransition.videoName = "";
            TextAsset videoTextAsset2 = Resources.Load <TextAsset>(textVideoList);

            //Debug.Log(videoTextAsset2.ToString());
            video_path = videoTextAsset2.ToString();
            //DATA_CN-01
            //string[] lines = System.IO.File.ReadAllLines(video_path);
            string[] lines = videoTextAsset2.text.Split('\n');
            frames_videos = new string[lines.Length];

            for (int i = 1; i < lines.Length; i++)
            {
                // Debug.Log(lines[i]);
                if (lines[i] != null && lines[i] != "")
                {
                    string[]      entries = lines[i].Split(';');
                    List <string> test    = new List <string>();
                    countries_videos.Add(entries[0]);
                    videos_names.Add(entries[1]);
                    //Debug.Log(videos_frames[i].ToString());
                    videos_frames.Add(entries[2]);
                    agents_id_videos.Add(entries[3]);
                    pos_x_videos.Add(entries[4]);
                    pos_y_videos.Add(entries[5]);
                    pos_x_perspective.Add(entries[6]);
                    pos_y_perspective.Add(entries[7]);
                    activated_agents_videos.Add(entries[8]);
                    agents_velocities_videos.Add(entries[9]);
                    agents_directions_videos.Add(entries[10]);
                    dist_from_others_videos.Add(entries[11]);
                    areas_around_videos.Add(entries[12]);
                    collectivities_videos.Add(entries[13]);
                    disturbances_videos.Add(entries[14]);
                    isolations_videos.Add(entries[15]);
                    socializations_videos.Add(entries[16]);
                    px_to_m_factors_videos.Add(entries[17]);
                    emotions_anger_videos.Add(entries[18]);
                    emotions_fear_videos.Add(entries[19]);
                    emotions_happiness_videos.Add(entries[20]);
                    emotions_sadness_videos.Add(entries[21]);
                    hofstede_pdi_videos.Add(entries[22]);
                    hofstede_idv_videos.Add(entries[23]);
                    hofstede_mas_videos.Add(entries[24]);
                    hofstede_lto_videos.Add(entries[25]);
                    hofstede_ind_videos.Add(entries[26]);
                    o_agents_videos.Add(entries[27]);
                    c_agents_videos.Add(entries[28]);
                    e_agents_videos.Add(entries[29]);
                    a_agents_videos.Add(entries[30]);
                    n_agents_videos.Add(entries[31]);
                }
            }

            for (int i = 0; i < agents_id_videos.Count; i++)
            {
                //Debug.Log(!agents_id.Contains(agents_id_videos.ElementAt(i)));
                if (!agents_id.Contains(agents_id_videos.ElementAt(i)))
                {
                    agents_id.Add(agents_id_videos.ElementAt(i));
                }
            }


            foreach (string posx in pos_x_videos)
            {
                if (float.Parse(posx) / float.Parse(px_to_m_factors_videos.ElementAt(0)) > max_x)
                {
                    max_x = float.Parse(posx) / float.Parse(px_to_m_factors_videos.ElementAt(0));
                }
            }

            foreach (string posy in pos_y_videos)
            {
                if (float.Parse(posy) / float.Parse(px_to_m_factors_videos.ElementAt(0)) > max_y)
                {
                    max_y = float.Parse(posy) / float.Parse(px_to_m_factors_videos.ElementAt(0));
                }
            }
            foreach (string maxframe in videos_frames)
            {
                if (int.Parse(maxframe) > max)
                {
                    max = int.Parse(maxframe);
                }
            }

            foreach (string agent_new in agents_id)
            {
                agent = new Agent(agent_new, hofstede_pdi_videos.ElementAt(0), hofstede_idv_videos.ElementAt(0), hofstede_mas_videos.ElementAt(0), hofstede_lto_videos.ElementAt(0), hofstede_ind_videos.ElementAt(0));

                for (int i = 0; i < agents_id_videos.Count; i++)
                {
                    //Debug.Log(!agents_id.Contains(agents_id_videos.ElementAt(i)));
                    if (agent_new.Equals(agents_id_videos.ElementAt(i)) && activated_agents_videos.ElementAt(i).Equals("yes"))
                    {
                        agent.activate_list.Add(activated_agents_videos.ElementAt(i));
                        agent.agent_directions.Add(agents_directions_videos.ElementAt(i));
                        agent.agent_velocities.Add(agents_velocities_videos.ElementAt(i));
                        agent.a_agent_list.Add(a_agents_videos.ElementAt(i));
                        agent.c_agent_list.Add(c_agents_videos.ElementAt(i));
                        agent.dist_from_others_videos.Add(dist_from_others_videos.ElementAt(i));
                        agent.e_agent_list.Add(e_agents_videos.ElementAt(i));
                        agent.frames.Add(videos_frames.ElementAt(i));
                        agent.n_agent_list.Add(n_agents_videos.ElementAt(i));
                        agent.o_agent_list.Add(o_agents_videos.ElementAt(i));
                        agent.movements.Add(new Vector3(float.Parse(pos_x_videos.ElementAt(i)) / float.Parse(px_to_m_factors_videos.ElementAt(0)), 0, max_y - float.Parse(pos_y_videos.ElementAt(i)) / float.Parse(px_to_m_factors_videos.ElementAt(0))));
                        agent.movements_perspective.Add(new Vector3(float.Parse(pos_x_perspective.ElementAt(i)) / float.Parse(px_to_m_factors_videos.ElementAt(0)), 0, float.Parse(pos_y_perspective.ElementAt(i)) / float.Parse(px_to_m_factors_videos.ElementAt(0))));
                        agent.areas_around.Add(areas_around_videos.ElementAt(i));
                        agent.collectivities.Add(collectivities_videos.ElementAt(i));
                        agent.disturbances.Add(disturbances_videos.ElementAt(i));
                        agent.isolations.Add(isolations_videos.ElementAt(i));
                        agent.socializations.Add(socializations_videos.ElementAt(i));
                        agent.px_to_m_factors.Add(px_to_m_factors_videos.ElementAt(i));
                        agent.emotions_anger.Add(emotions_anger_videos.ElementAt(i));
                        agent.emotions_fear.Add(emotions_fear_videos.ElementAt(i));
                        agent.emotions_happiness.Add(emotions_happiness_videos.ElementAt(i));
                        agent.emotions_sadness.Add(emotions_sadness_videos.ElementAt(i));
                    }
                }
                agents.Add(agent);
            }

            GameObject plane        = GameObject.CreatePrimitive(PrimitiveType.Plane);
            Vector3    maxmin_scale = new Vector3((max_x / 10) + 10, 0, (max_y / 10) + 10);

            plane.transform.localScale     = maxmin_scale;
            mini_camera.transform.position = new Vector3(max_x / 2, mini_camera.transform.position.y, max_y / 2);
            plane.transform.position       = new Vector3(max_x / 2, plane.transform.position.y, max_y / 2);
            var      teste    = Resources.Load("Google_Earth_Snapshot");
            Material material = Material.Instantiate(Resources.Load <Material>("Material"));
            plane.transform.GetComponent <Renderer>().material = material;
        }
    }
コード例 #12
0
 public void TutorialButton()
 {
     SceneTransitionController.LoadScene("Tutorial");
     Cursor.visible = true;
     Invoke("ResumeButton", 0);
 }
コード例 #13
0
 public void MenueButton()
 {
     SceneTransitionController.LoadScene("MainMenue");
     Invoke("ResumeButton", 0);
 }
コード例 #14
0
 public void RestartButton()
 {
     SceneTransitionController.LoadScene(SceneManager.GetActiveScene().name);
     Invoke("ResumeButton", 0);
 }
コード例 #15
0
 public void StartButton()
 {
     SceneTransitionController.LoadScene("Game");
 }
コード例 #16
0
 void _OnClick()
 {
     SceneTransitionController.RequestSceneTransition(destination_scene_name, 2.0f, _SceneTransitionCallback, fade_shape, easing_curve);
     WarpEffect.SpawnDistortionRing(Input.mousePosition.x, Input.mousePosition.y, 5f, 30, 100, 0.5f);
 }