public void ConnectToServer() { startMenu.SetActive(false); usernameField.interactable = false; Client.instance.ConnectToServer(); Scene_Manager.Load(Scene_Manager.Scene.First); }
// Use this for initialization void Start() { isBreakable = (this.tag == "Breakable"); if (isBreakable) { breakableCount++; } timesHit = 0; sm = GameObject.FindObjectOfType<Scene_Manager>(); }
private void OnTriggerEnter2D(Collider2D other) { if (other.tag is "Rocket") { Scene_Manager.Load(Scene_Manager.Scene.Planet); } }
public override void Awake() { base.Awake(); _currentButton = FirstSelected; _audioSource = GetComponent <AudioSource>(); _sceneManager = FindObjectOfType <Scene_Manager>(); _eventSystem = FindObjectOfType <EventSystem>(); }
void Start() { character = this.transform.parent.gameObject; GameObject ui = GameObject.FindGameObjectWithTag("UI"); pauseMenu = ui.GetComponent <Scene_Manager>(); }
void OnTriggerEnter2D(Collider2D collider) { if (GameObject.FindObjectOfType<Brick>()) Brick.breakableCount = 0; sm = GameObject.FindObjectOfType<Scene_Manager>(); sm.LoadScene("Lose"); }
private void Awake() { if (instance == null) { instance = this; } else { Destroy(this.gameObject); } }
void Awake() { if (Scene_Manager.Manager != null) { Destroy(gameObject); } else { Manager = GetComponent <Scene_Manager>(); DontDestroyOnLoad(gameObject); } }
private void Awake() { if (_instance != null && _instance != this) { Destroy(this.gameObject); } else { _instance = this; } DontDestroyOnLoad(this.gameObject); }
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); }
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; }
static void update_names(UnityEditor.MenuCommand command) { Scene_Manager context = (Scene_Manager)command.context; context.scene_names = read_names(); }
// Use this for initialization void Start() { _touch = GetComponent<TouchSystem>(); _scene_manager = GetComponent<Scene_Manager>(); }
private void Awake() { instance = this; scene = GetComponent <Scene_Manager>(); ui = GetComponent <Ui_Manager>(); }
// Use this for initialization void Start() { sceneManager = FindObjectOfType <Scene_Manager>(); rend = GetComponent <Renderer>(); }
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(); }
private void Awake() { Instance = this; }
//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;
// Use this for initialization void Start() { _touch = GetComponent <TouchSystem>(); _scene_manager = GetComponent <Scene_Manager>(); }
public void Return_to_Menu() { Scene_Manager.God_Scene(); }