예제 #1
0
 public void ConnectToServer()
 {
     startMenu.SetActive(false);
     usernameField.interactable = false;
     Client.instance.ConnectToServer();
     Scene_Manager.Load(Scene_Manager.Scene.First);
 }
예제 #2
0
 // Use this for initialization
 void Start()
 {
     isBreakable = (this.tag == "Breakable");
     if (isBreakable) { breakableCount++; }
     timesHit = 0;
     sm = GameObject.FindObjectOfType<Scene_Manager>();
 }
예제 #3
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag is "Rocket")
     {
         Scene_Manager.Load(Scene_Manager.Scene.Planet);
     }
 }
예제 #4
0
 public override void Awake()
 {
     base.Awake();
     _currentButton = FirstSelected;
     _audioSource   = GetComponent <AudioSource>();
     _sceneManager  = FindObjectOfType <Scene_Manager>();
     _eventSystem   = FindObjectOfType <EventSystem>();
 }
예제 #5
0
    void Start()
    {
        character = this.transform.parent.gameObject;

        GameObject ui = GameObject.FindGameObjectWithTag("UI");

        pauseMenu = ui.GetComponent <Scene_Manager>();
    }
예제 #6
0
    void OnTriggerEnter2D(Collider2D collider)
    {
        if (GameObject.FindObjectOfType<Brick>())
            Brick.breakableCount = 0;

        sm = GameObject.FindObjectOfType<Scene_Manager>();

        sm.LoadScene("Lose");
    }
예제 #7
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(this.gameObject);
     }
 }
예제 #8
0
 void Awake()
 {
     if (Scene_Manager.Manager != null)
     {
         Destroy(gameObject);
     }
     else
     {
         Manager = GetComponent <Scene_Manager>();
         DontDestroyOnLoad(gameObject);
     }
 }
예제 #9
0
 private void Awake()
 {
     if (_instance != null && _instance != this)
     {
         Destroy(this.gameObject);
     }
     else
     {
         _instance = this;
     }
     DontDestroyOnLoad(this.gameObject);
 }
예제 #10
0
 private void Awake()
 {
     if (_Instance == null)
     {
         _Instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
 /*************************************************************************************************
  *  Function:   void Awake()
  *  Description: Runs at initialization of script.
  *              If player fade disabled, disables scene fade by default so that scene can't
  *              fade in without a player and instead scene will start without any fading (Not
  *              fixing this situation would result in scene fading in without visible player
  *              and with player controls disabled so user couldn't do anything). If scene fade
  *              enabled, initializes fader Image to black and full screen, else disables fader.
  ************************************************************************************************/
 void Awake()
 {
     scene_manager                        = GetComponent <Scene_Manager> ();
     player                               = Instantiate(player_prefab, start.position, Quaternion.Euler(0, 0, get_start_rotation())) as GameObject;
     player.transform.position            = get_start_position();
     player_renderer                      = player.GetComponent <SpriteRenderer> ();
     player_controller                    = player.GetComponent <Player> ();
     player_controller.start_facing_right = start_facing_right;
     player_controller.set_spawn(player.transform, get_start_gravity_direction());
     main_cam_script = Camera.main.GetComponent <Camera_Behaviour>();
     main_cam_script.set_target(player.transform);
 }
예제 #12
0
    private void Awake()
    {
        Scene_Manager _instance = FindObjectOfType <Scene_Manager>().GetComponent <Scene_Manager>();

        if (instance != null || _instance != this)
        {
            Destroy(this.gameObject);
            foreach (GameObject obj in dontDestroy)
            {
                Destroy(obj);
            }
        }
        else
        {
            DontDestroyOnLoad(this.gameObject);
            foreach (GameObject obj in dontDestroy)
            {
                DontDestroyOnLoad(obj);
            }
        }
        instance = this;
    }
예제 #13
0
    static void update_names(UnityEditor.MenuCommand command)
    {
        Scene_Manager context = (Scene_Manager)command.context;

        context.scene_names = read_names();
    }
예제 #14
0
 // Use this for initialization
 void Start()
 {
     _touch = GetComponent<TouchSystem>();
     _scene_manager = GetComponent<Scene_Manager>();
 }
예제 #15
0
 private void Awake()
 {
     instance = this;
     scene    = GetComponent <Scene_Manager>();
     ui       = GetComponent <Ui_Manager>();
 }
예제 #16
0
 // Use this for initialization
 void Start()
 {
     sceneManager = FindObjectOfType <Scene_Manager>();
     rend         = GetComponent <Renderer>();
 }
예제 #17
0
    public override void OnInspectorGUI()
    {
        // Grab the script.
        Scene_Manager myTarget = target as Scene_Manager;

        // Set the indentLevel to 0 as default (no indent).
        EditorGUI.indentLevel = 0;
        // Update
        serializedObject.Update();

        // General Label.
        EditorGUILayout.LabelField("Background Music", EditorStyles.boldLabel);
        // Increase the indent.
        EditorGUI.indentLevel++;
        // Set the layout.
        EditorGUILayout.PropertyField(serializedObject.FindProperty("music"));
        // Decrease the Indent of the lines.
        EditorGUI.indentLevel--;


        // General Label.
        EditorGUILayout.LabelField("Player", EditorStyles.boldLabel);
        // Increase the indent.
        EditorGUI.indentLevel++;
        // Begin ToggleGroup if there is a player.
        myTarget.isPlayer = EditorGUILayout.BeginToggleGroup(new GUIContent("Is Player", "Should there be a player spawned in this scene?"), myTarget.isPlayer);
        // Increase the Indent.
        EditorGUI.indentLevel++;
        // Set the layout.
        EditorGUILayout.PropertyField(serializedObject.FindProperty("player"));
        // Decrease the Indent of the lines.
        EditorGUI.indentLevel--;


        // General Label.
        EditorGUILayout.LabelField("Spawn Locations", EditorStyles.boldLabel);
        // Increase the indent.
        EditorGUI.indentLevel++;
        // Set the layout.
        EditorGUILayout.PropertyField(serializedObject.FindProperty("sceneSpawnLocations"), true);
        // Decrease the Indent of the lines.
        EditorGUI.indentLevel--;
        // Decrease the Indent of the lines.
        EditorGUI.indentLevel--;
        // End the ToggleGroup.
        EditorGUILayout.EndToggleGroup();

        // General Label.
        EditorGUILayout.LabelField("UI", EditorStyles.boldLabel);
        // Increase the indent.
        EditorGUI.indentLevel++;
        // Begin ToggleGroup if there is a player.
        myTarget.showUI = EditorGUILayout.BeginToggleGroup(new GUIContent("Show UI", "Do you want to show the UI in this scene?"), myTarget.showUI);
        // Decrease the Indent of the lines.
        EditorGUI.indentLevel--;
        // End the ToggleGroup.
        EditorGUILayout.EndToggleGroup();

        // apply
        serializedObject.ApplyModifiedProperties();
    }
예제 #18
0
 private void Awake()
 {
     Instance = this;
 }
예제 #19
0
 //i have never seen this format before but its awesome i love it and im going to use it all the time for Awake
 private void Awake() => S = this;
예제 #20
0
파일: Main.cs 프로젝트: duckdog/TVShoping
 // Use this for initialization
 void Start()
 {
     _touch         = GetComponent <TouchSystem>();
     _scene_manager = GetComponent <Scene_Manager>();
 }
예제 #21
0
 public void Return_to_Menu()
 {
     Scene_Manager.God_Scene();
 }