//========================================================================================== // //========================================================================================== void Awake() { _menu = this.transform.parent.GetComponent <MenuScript>(); _canvasGroup = GetComponent <CanvasGroup>(); _audioSource = GetComponent <AudioSource>(); _loadingPanelCanvasGroup = this.transform.Find("PanelLoading").GetComponent <CanvasGroup>(); _lastSessionScoreText = this.transform.Find("LevelPanel/LastSessionScoreText").GetComponent <Text>(); _bestSessionScoreText = this.transform.Find("LevelPanel/BestSessionScoreText").GetComponent <Text>(); _totalScoreText = this.transform.Find("LevelPanel/TotalScoreText").GetComponent <Text>(); _currentLevelText = this.transform.Find("LevelPanel/CurrentLevelText").GetComponent <Text>(); _nextLevelText = this.transform.Find("LevelPanel/NextLevelText").GetComponent <Text>(); _levelSlider = this.transform.Find("LevelPanel/Slider").GetComponent <Slider>(); _challengeCompleted = this.transform.Find("ChallengePanel/UpperLine/ChallengeCompleted").gameObject; _challengeScoreText = this.transform.Find("ChallengePanel/UpperLine/ChallengeScoreText").GetComponent <Text>(); _challengeDescriptionText = this.transform.Find("ChallengePanel/ChallengeDescriptionText").GetComponent <Text>(); _rewardScrollbar = this.transform.Find("RewardPanel/Scroll View/Scrollbar Vertical").GetComponent <Scrollbar>(); _canvasGroup.alpha = 0; _canvasGroup.interactable = false; _canvasGroup.blocksRaycasts = false; }
// Update is called once per frame void Update() { if (!MenuScript.IsOnPause()) { _HandleTwists(); } }
// Use this for initialization void Start() { Instance = this; DontDestroyOnLoad(transform.gameObject); anim = GetComponent <Animator>(); CurrentLevel = 0; levelButtons = MenuStart.Instance.buttons; isUnlocked = new bool[levelButtons.Length]; for (int i = 0; i < isUnlocked.Length; i++) { isUnlocked[i] = false; } isUnlocked[0] = true; selectedMenu = MenuSelect.Main; SetButtons(); GameObject fadeObject = GameObject.Find("BlackFade"); if (fadeObject != null) { //Debug.Log("its not null"); blackFade = fadeObject.GetComponent <Image>(); } }
// Start is called before the first frame update void Start() { Instance = this; link.text = PhoneNetworkManager.manager.m_code; syncPlayers(0); PhoneNetworkManager.manager.onPlayerCountChange += syncPlayers; }
public void Load(int SaveNum, int Level) { if (File.Exists(Application.persistentDataPath + "/LPSASave" + SaveNum + ".Sv")) { BinaryFormatter binary = new BinaryFormatter(); FileStream fstream = File.Open(Application.persistentDataPath + "/LPSASave" + SaveNum + ".Sv", FileMode.Open, FileAccess.Read); DataHolder saveFile = (DataHolder)binary.Deserialize(fstream); if (Level == 0) { MenuScript MainMenu = GameObject.FindGameObjectWithTag("menu").GetComponent <MenuScript>(); MainMenu.highscore = saveFile.Highscore; MainMenu.FarthestFloor = saveFile.FarthestFloor; MainMenu.FarthestRoom = saveFile.farthestRoom; MainMenu.ArmorUpgrade = saveFile.MaxArmorUpgradeLevel; MainMenu.ArmorPickup = saveFile.ArmorPickupUpgradeLevel; MainMenu.Money = saveFile.money; } if (Level == 2) { Dungeon.dungeon.Highscore = saveFile.Highscore; Dungeon.dungeon.MaxFloor = saveFile.FarthestFloor; Dungeon.dungeon.Maxroom = saveFile.farthestRoom; Dungeon.dungeon.player.ArmorUpgradeLevel = saveFile.MaxArmorUpgradeLevel; Dungeon.dungeon.player.ArmorPickupLevel = saveFile.ArmorPickupUpgradeLevel; Dungeon.dungeon.player.money = saveFile.money; } fstream.Close(); } }
void Awake() { DontDestroyOnLoad(gameObject); MenuManager = this; player1Char = 1; player2Char = 1; }
private void Awake() { if (instance == null) { instance = this; } }
static public void SetMenu(string name, Transform planTransform) { MenuScript.DisplayBackground(planTransform); switch (name) { case "Emploi": { ApplyMenu(emplois); break; }; case "Etude": { ApplyMenu(etudes); break; } case "Competences": { ApplyMenu(savoir); break; }; default: { ApplyMenu(info); break; } } }
public ModCore() { curGameTime = Game.GameTime; zoneManagerScript = new ZoneManager(); gangManagerScript = new GangManager(); mindControlScript = new MindControl(); menuScript = new MenuScript(); this.Aborted += OnAbort; this.KeyUp += OnKeyUp; this.Tick += OnTick; Logger.Log("mod started!", 2); bool successfulInit = GangMemberUpdater.Initialize(); while (successfulInit == false) { Yield(); successfulInit = GangMemberUpdater.Initialize(); } successfulInit = GangVehicleUpdater.Initialize(); while (successfulInit == false) { Yield(); successfulInit = GangVehicleUpdater.Initialize(); } }
public static bool Prefix(MenuScript __instance, ref int ___curHostPort, ref bool ___playing) { MonoBehaviour.print("Hosting Game"); try { ___curHostPort = int.Parse(__instance.txtHostPort[0].text); } catch (Exception) { ___curHostPort = 7777; __instance.txtHostPort[0].text = string.Empty; __instance.txtHostPort[1].text = __instance.txtHostPort[0].text; } Network.InitializeServer(GadgetCoreConfig.MaxConnections, ___curHostPort, false); if (GadgetCoreConfig.UseUPnP) { int curHostPort = ___curHostPort; try { __instance.StartCoroutine(GadgetCore.CoreLib.ForwardPort(curHostPort)); } catch (System.IO.FileNotFoundException) { GadgetCore.Log("Gadget Core was unable to perform UPnP Port Forwarding because Gadget Core's zip file has not been unpacked!"); } catch (Exception e) { GadgetCore.Log("The following error occured while attempting to perform UPnP Port Forwarding:" + Environment.NewLine + e.ToString()); } } ___playing = false; return(false); }
internal static void WaterLoop() { if (Water >= 2.0f && hinted) { hinted = false; } if (Water <= 2.0f && !hinted) { hinted = true; GameUI.DisplayHelp(Strings.WaterTooLow); } if (Water <= 1.5f && (Water > 0.5f)) { Game.Player.Character.Health--; } if (Water <= 0.5f) { Game.Player.Character.Health -= 10; } if (Water != 0f) { if (Game.Player.Character.Health >= 100 && !Game.Player.Character.IsRunning && !Game.Player.Character.IsSprinting) { MenuScript.ChangeWaterBarColor(Color.Aquamarine); Water -= 0.01f; } else { MenuScript.ChangeWaterBarColor(Color.OrangeRed); Water -= 0.05f; } } }
private void OnMouseOver() { if (Input.GetMouseButtonDown(0)) { MenuManager menuActive = FindObjectOfType <MenuManager>(); MenuScript Briefing = FindObjectOfType <MenuScript>(); if (menuActive.menuActive == false && Briefing.BriefingActive == false) { if (this.name == "PauseButton") { Time.timeScale = 0f; GetComponentInChildren <SpriteRenderer>().color = Color.yellow; play.GetComponentInChildren <SpriteRenderer>().color = Color.white; speed2x.GetComponentInChildren <SpriteRenderer>().color = Color.white; } else if (this.name == "PlayButton") { Time.timeScale = 1f; GetComponentInChildren <SpriteRenderer>().color = Color.yellow; pause.GetComponentInChildren <SpriteRenderer>().color = Color.white; speed2x.GetComponentInChildren <SpriteRenderer>().color = Color.white; } else if (this.name == "Speed2xButton") { Time.timeScale = 2f; GetComponentInChildren <SpriteRenderer>().color = Color.yellow; pause.GetComponentInChildren <SpriteRenderer>().color = Color.white; play.GetComponentInChildren <SpriteRenderer>().color = Color.white; } } //Debug.Log(this.name); } }
public static bool Prefix(MenuScript __instance) { if (GadgetNetwork.connectTime < 0) { GadgetNetwork.connectTime = Time.realtimeSinceStartup; } if (!GadgetNetwork.MatrixReady && GadgetNetwork.GetTimeSinceConnect() < GadgetNetwork.MatrixTimeout) { if (InstanceTracker.GameScript.gameObject.GetComponent <RPCHooks>() == null) { InstanceTracker.GameScript.gameObject.AddComponent <RPCHooks>(); } RPCHooks.InitiateGadgetNetwork(); __instance.StartCoroutine(WaitAndTryAgain(__instance)); return(false); } else { if (!GadgetNetwork.MatrixReady) { GadgetNetwork.InitializeVanillaIDMatrix(); } return(true); } }
void Awake() { stars = GetComponentsInChildren <Image>(); ms = Camera.main.GetComponent <MenuScript>(); bttns = ms.levelChanger.GetComponentsInChildren <Button>(); }
// Update is called once per frame void Update() { if (!MenuScript.IsOnPause()) { _HandlePinches(); } }
//on awake we intialise the player settings which is the default values and also set up the singleton void Awake() { //audioClass = new AudioClass(); //audioClass.InitialiseAudioClass(); gameObject.AddComponent <AudioClass>(); playerdata = new PlayerData(); for (int i = 0; i < playerSetting.Length; i++) { playerSetting[i] = new PlayerKeys(); playerSetting[i].IntialiseValues(); } GameObject gm = GameObject.Find("GameManager"); if (gm != null) { DontDestroyOnLoad(gm.gameObject); _instance = gm.GetComponent <MenuScript>(); } backToMenu = false; IntialiseAndSetScene(); LoadPlayerData(); //Set the max level by the player data maxLevel = playerdata.getCurrentLevel(); whichPlayerKey = 0; hoveringOver = eventSystem.GetComponent <EventSystem>().currentSelectedGameObject; }
// Use this for initialization void Start() { timeCount = 0.0f; spawnNum = MenuScript.LoadDifficult(); PlayerToChase = GameObject.FindWithTag("Player").transform; }
/* init stuff */ void Awake() { DontDestroyOnLoad(transform.gameObject); GameObject mainCamera = GameObject.Find ("Main Camera"); GameObject riftCamera = GameObject.FindGameObjectWithTag("OVRCamera"); player = GameObject.FindGameObjectWithTag ("Player"); menu = GetComponent<MenuScript> (); savePositionBetweenScenes = new Vector3 (0, 6.5f, 10); if(OVRDevice.IsSensorPresent()) { mainCamera.SetActive(false); //player.GetComponent<MouseLook>().enabled = false; riftCamera.SetActive(true); ovr_present = true; Debug.Log ("Rift found!"); } else { mainCamera.SetActive(true); riftCamera.SetActive(false); Debug.Log ("Rift not found!"); } Screen.lockCursor = true; mainLevelLoc = new Vector3 (0, 2, 10); }
void Start() { saveFilePath = Application.persistentDataPath + "/save0.xml"; Debug.Log("Save file: " + saveFilePath); mainBoard = GameObject.Find("Main Board"); mbs = GameObject.Find("Main Board").GetComponent <MainBoardScript>(); menu = GetComponent <MenuScript>(); exitButtonText = GameObject.Find("ExitButtonText"); gameResult = GameObject.Find("GameResult"); gameResultText = GameObject.Find("GameResultText").GetComponent <Text>(); audioPlayer = GameObject.Find("Audio Player").GetComponent <AudioSource>(); audioSource = GetComponent <AudioSource>(); gameResult.SetActive(false); if (boxClicked == null) { boxClicked = new BoxClickedEvent(); } boxClicked.AddListener(OnBoxClicked); if (boxUpdated == null) { boxUpdated = new BoxUpdatedEvent(); } difficulty = GameDifficulty.Medium; stats = new Statistics(); serializer = new XmlSerializer(typeof(SaveData)); LoadGame(); }
// Use this for initialization void Start () { _instance = this; if (!Chartboost.isInitialized ()) { #if UNITY_ANDROID CBExternal.initWithAppId("57d2875204b01621d2318a7a","1ab323b489b22d7446a7e0b8dbf306b52c903ed1"); #endif } Chartboost.cacheInterstitial(CBLocation.Default); transform.FindChild("single_btn").GetComponent<Button>().onClick.AddListener(OpenSingleWindow); transform.FindChild("multiplayer_btn").GetComponent<Button>().onClick.AddListener(OpenMultiplayerWindow); transform.FindChild("shop_btn").GetComponent<Button>().onClick.AddListener(OpenShopWindow); transform.FindChild("ratings_btn").GetComponent<Button>().onClick.AddListener(OpenRatingsWindow); transform.FindChild("options_btn").GetComponent<Button>().onClick.AddListener(OpenOptionsWindow); //transform.FindChild("exit_btn").GetComponent<Button>().onClick.AddListener(OpenQuitWindow); transform.FindChild("login_btn").GetComponent<Button>().onClick.AddListener(OpenLoginWindow); //transform.FindChild("logout_btn").GetComponent<Button>().onClick.AddListener(OpenLogoutWindow); //hello_txt transform.FindChild ("hello_txt").GetComponent<Button>().onClick.AddListener(OpenLogoutWindow); transform.FindChild ("Dialog_yes_no").FindChild("No_btn").GetComponent<Button> ().onClick.AddListener (QuitWindowNo); transform.FindChild ("Dialog_yes_no").FindChild("Yes_btn").GetComponent<Button> ().onClick.AddListener (QuitWindowYes); transform.FindChild ("social_btn").GetComponent<Button> ().onClick.AddListener (OpenLikeWindow); transform.FindChild ("wheel_btm").GetComponent<Button> ().onClick.AddListener (OpenWheelWindow); transform.FindChild ("Fade_img").gameObject.SetActive (true); animationEnded = false; transform.FindChild ("Fade_img").GetComponent<Animation>().Play(); }
internal static void Loop() { if (Hungry >= 2.0f && hinted) { hinted = false; } if (Hungry <= 2.0f && !hinted) { hinted = true; GameUI.DisplayHelp(Strings.Hungry); } if (Hungry <= 1.5f && (Hungry > 0.5f)) { Game.Player.Character.Health -= 1; } if (Hungry <= 0.5f) { Game.Player.Character.Health -= 10; } if (Hungry != 0f) { if (Game.Player.Character.Health >= 100 && !Game.Player.Character.IsSprinting) { MenuScript.ChangeHungryBarColor(Color.White); Hungry -= 0.01f; } else { MenuScript.ChangeHungryBarColor(Color.Red); Hungry -= 0.05f; } } }
void Start() { audioPlate = GetComponent<AudioSource>(); maxDistance = 0.05f; menu = MenuScript.Instance; Invoke ("ReleaseAudio", 5); }
private void HexClicked() { MenuManager menuActive = FindObjectOfType <MenuManager>(); MenuScript Briefing = FindObjectOfType <MenuScript>(); if (Input.GetMouseButtonDown(0) && ActiveHex && menuActive.menuActive == false && Briefing.BriefingActive == false) { //Debug.Log(this.name + " was left clicked."); if (FullHoney == true && !CurrentlyGatheringHoney) { CurrentlyGatheringHoney = true; WaitToGatherHoney(); } else if (status >= 1) { //TODO: set bee to work on this hex } else if (status == 0 && !Currentlybuilt) { BuildNewHex(); } } else if (Input.GetMouseButtonDown(1) && ActiveHex) { Debug.Log(this.name + " was right clicked."); status -= 1; } }
//그냥 결과 void Awake() { if (inst == null) { inst = this; } }
// Update is called once per frame void Update() { if (!MenuScript.IsOnPause()) { _HandleSwipes(); } }
protected virtual void Update() { if (!_ms) { _ms = FindObjectOfType <MenuScript>(); } }
//========================================================================================== // //========================================================================================== void Awake() { _menu = this.transform.parent.GetComponent <MenuScript>(); _canvasGroup = GetComponent <CanvasGroup>(); //_stage2Button = this.transform.Find("PanelNiveaux/ScrollViewStages/Viewport/Content/ButtonLevel2").GetComponent<Button>(); //_stage3Button = this.transform.Find("PanelNiveaux/ScrollViewStages/Viewport/Content/ButtonLevel3").GetComponent<Button>(); //_char1Outline = this.transform.Find("PanelPersos/ScrollViewCharacters/Viewport/Content/ButtonPoulpe").GetComponent<Outline>(); //_char2Outline = this.transform.Find("PanelPersos/ScrollViewCharacters/Viewport/Content/ButtonChat").GetComponent<Outline>(); //_char2Button = _char2Outline.GetComponent<Button>(); //_char3Outline = this.transform.Find("PanelPersos/ScrollViewCharacters/Viewport/Content/ButtonPerso3").GetComponent<Outline>(); //_char3Button = _char3Outline.GetComponent<Button>(); foreach (ButtonListElement element in _characterButtons) { _characterButtonOutlines.Add(element.button.GetComponent <Outline>()); } _loadingPanelCanvasGroup = this.transform.Find("PanelLoading").GetComponent <CanvasGroup>(); //_stage2Button.interactable = false; //_stage3Button.interactable = false; //_char2Button.interactable = false; //_char3Button.interactable = false; //_char1Outline.enabled = false; //_char2Outline.enabled = false; //_char3Outline.enabled = false; _canvasGroup.alpha = 0; _canvasGroup.interactable = false; _canvasGroup.blocksRaycasts = false; }
void Start() { _playerController = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerController>(); _activePlayerList = GameObject.FindGameObjectsWithTag("Player"); currentActivePlayer = _activePlayerList[_currentCharacterAge]; _menuScript = GetComponent <MenuScript>(); }
// USE THIS METHOD to access this object. (as in, MenuScript.instance().whatever()) public static MenuScript instance() { if (instance_ == null) { instance_ = GameObject.FindObjectOfType <MenuScript>(); } return(instance_); }
private void Start() { previous_txt = transform.GetChild(0).GetComponent <Text>().text; ms = GameObject.Find("CombatSimulator").GetComponent <MenuScript>(); huds = new GameObject[5] { ms.firstMenu, ms.secondMenu, ms.thirdMenu, ms.fourthMenu, ms.fifthMenu }; }
public void startGame() { MenuScript newGame = new MenuScript(); MenuScript.levelID = 0; Log.totalScore = 0; newGame.OnButton(); }
//===================================================================================== // //===================================================================================== void Awake() { _menu = this.transform.parent.GetComponent <MenuScript>(); _canvasGroup = GetComponent <CanvasGroup>(); _canvasGroup.alpha = 0; _canvasGroup.interactable = false; _canvasGroup.blocksRaycasts = false; }
// Update is called once per frame void Update() { if (MS == null) { MS = GameObject.Find("MenuScript").GetComponent <MenuScript>(); Debug.Log("Found"); } }
// Use this for initialization void Start () { _instance = this; transform.FindChild("sh_btn").GetComponent<Button>().onClick.AddListener(FightAsShip); transform.FindChild("su_btn").GetComponent<Button>().onClick.AddListener(FightAsSubmarine); transform.FindChild("nb_btn").GetComponent<Button>().onClick.AddListener(AutoFight); ch = transform.FindChild("ch"); ch.GetComponent<Button>().onClick.AddListener(ToggleCh); }
void Start() { soul = GameObject.Find ("MenuManager").GetComponent<MenuScript> (); if (Network.isServer) { string servernum = Network.player.ToString (); soul.scoreKeeper=this; networkView.RPC ("UpdateTeamList", RPCMode.AllBuffered, servernum); } }
public void Start() { Instance = this; mScript = GameObject.Find("Main Camera").GetComponent<MenuController>(); screenWidth = Screen.width; screenHeight = Screen.height; groupWidth = 200f; groupHeight = 230f; setWidth = (screenWidth - groupWidth); setHeight = (screenHeight - groupHeight); activeModes = false; activeOptions = false; }
void Awake() { Instance = this; menuObject = GameObject.Find("MainMenu"); mScript = menuObject.GetComponent<MenuScript>(); gameMObject = GameObject.Find("GameModes"); gmScript = gameMObject.GetComponent<GameModeScript>(); optionsObject = GameObject.Find("Options"); oScript = optionsObject.GetComponent<OptionsScript>(); menuActive = true; optionsActive = false; modesActive = false; }
// Use this for initialization void Start() { manager = GameObject.Find("CanvasManager").GetComponent<MenuScript>(); oldSelection = MenuSelection.NULL; currentSelection = MenuSelection.LEVELSELECT; rotations = new Quaternion[5]; bg = GameObject.Find("bg"); rotations[0] = Quaternion.Euler(0, 0, -110.0f); rotations[1] = Quaternion.Euler(0, 0, -157.0f); rotations[2] = Quaternion.Euler(0, 0, -247.0f); rotations[3] = Quaternion.Euler(0, 0, 380.0f); rotations[4] = Quaternion.Euler(0, 0, -20.0f); bg.transform.localRotation = rotations[0]; targetRotation = rotations[0]; }
// Use this for initialization public void Start() { DontDestroyOnLoad(this); loginMenu = loginMenu.GetComponent<Canvas> (); loginFailedMenu = loginFailedMenu.GetComponent<Canvas> (); loginSuccessMenu = loginSuccessMenu.GetComponent<Canvas> (); loginNewUserMenu = loginNewUserMenu.GetComponent<Canvas> (); loginNewUserFailedMenu = loginNewUserFailedMenu.GetComponent<Canvas>(); loggedInMenu = loggedInMenu.GetComponent<Canvas>(); lobbyMenu = lobbyMenu.GetComponent<Canvas>(); sessionFailedMenu = sessionFailedMenu.GetComponent<Canvas>(); menuGUI = GameObject.FindGameObjectWithTag("Menus"); menu = menuGUI.GetComponent<MenuScript>(); lobbyName = lobbyName.GetComponent<InputField>(); currentUsername = currentUsername.GetComponent<Text> (); currentUsername.text = ""; username = username.GetComponent<InputField> (); password = password.GetComponent<InputField> (); networking = GameObject.FindGameObjectWithTag("Networking"); clientManager = networking.GetComponent<ClientScript> (); connectionStarted = false; if (!clientManager.getLoggedIn()) { loginMenu.enabled = true; loginFailedMenu.enabled = false; loginSuccessMenu.enabled = false; loginNewUserMenu.enabled = false; loginNewUserFailedMenu.enabled = false; loggedInMenu.enabled = false; sessionFailedMenu.enabled = false; lobbyMenu.enabled = false; } else { loginMenu.enabled = false; loginFailedMenu.enabled = false; loginSuccessMenu.enabled = false; loginNewUserMenu.enabled = false; loginNewUserFailedMenu.enabled = false; loggedInMenu.enabled = true; lobbyMenu.enabled = false; sessionFailedMenu.enabled = false; currentUsername.text = clientManager.getUsername(); } }
void Start() { journal = GameObject.Find("Journal"); journal.SetActive(active); notificationText.enabled = false; menuScript = MenuScript.Instance; }
// Use this for initialization void Start() { manager = GameObject.Find ("CanvasManager").GetComponent<MenuScript> (); }
// Update is called once per frame void Update() { if(drawMenu) current = current.GetNextMenu(); }
public void SetPrevious(MenuScript prev) { previous = prev; }
void Awake() { instance = this; InCreateMode = false; DontDestroyOnLoad(this); GameObject.Find("Instructions").GetComponent<UnityEngine.UI.Button>().Select(); //Doesn't activate always on the dancepad? CreateButtons(); MoveButtons(); }
// Use this for initialization void Start () { instance = this; }
public void Disable() { EnableMenuBackgroundCamera(false); current = null; }
public void Enable(MenuScript nextMenu) { if(nextMenu) current = nextMenu; drawMenu = true; }
public void Register(MenuScript menu, int id) { this.menu = menu; this.id = id; }
public void SetCurrent(MenuScript menu) { current = menu; }
// Use this for initialization void Start() { current = GetComponent<MainMenuScript>(); guiBackgroundCam = transform.Find("GUICamera").gameObject; guiBackgroundCam.SetActive(true); }
// Use this for initialization void Start() { thisMenu=GameObject.Find ("MenuManager").GetComponent<MenuScript>(); alignment = 0; if (Network.isServer) { Network.Instantiate (boxUp, new Vector3 (0, 0, 0), transform.rotation, 0); //thisMenu.scoreKeeper=boxUp.GetComponent<PlayerManager>(); // GameObject.Instantiate(boxUp,new Vector3 (0, 0, 0), transform.rotation, 0); } if(Network.isServer) { //team1=0; //team2=0; //Transform tempShip = Network.Instantiate(spaceship, transform.position, transform.rotation, 0) as Transform; //Network.Instantiate(spaceship, transform.position, transform.rotation, 0); //Camera.main.transform.parent = tempShip.transform; name=GetName (); print (name+" has connected."); //thisManager.AddPlayer(this); //tempShip.GetComponent<SpaceCode>().sendName(GetName ()); if(thisMenu.tutorial) Network.Instantiate(teacher,new Vector3(0,0,0),transform.rotation,0); if(!thisMenu.tutorial){ Network.Instantiate(planet, new Vector3(1000, 0, 0), transform.rotation, 0); Network.Instantiate(flag1, new Vector3(0, 0, 10), transform.rotation, 0); // } // } //managerOfPlayers=GameObject.Find ("PlayerBox(Clone)").GetComponent<PlayerManager> (); }
void Start() { // Link the MenuScript script = Camera.main.GetComponent<MenuScript>(); // Grab the renderer from the object this script is attached to target = gameObject.GetComponentInChildren<Renderer>(); // Locate the animations animations = Resources.LoadAll("Animations", typeof(AnimationClip)); SetAnimator(); }
void Awake() { singleton = this; }
void Start() { menu = MenuScript.Instance; chat = GameObject.Find("Chat").GetComponent<Canvas>(); text = chat.GetComponentInChildren<Text>(); dialogImage = chat.GetComponentInChildren<Image>(); journalScript = GetComponent<JournalScript>(); smallInput = GameManagerScript.SB.GetComponent<PlayerInputScript>(); bigInput = GameManagerScript.BB.GetComponent<PlayerInputScript>(); chat.enabled = false; }
// Use this for initialization void Start() { //DontDestroyOnLoad(this); //DontDestroyOnLoad(lobbyMenu); lobbyMenu = lobbyMenu.GetComponent<Canvas>(); lobbyMenu.enabled = false; networking = GameObject.FindGameObjectWithTag("Networking"); clientManager = networking.GetComponent<ClientScript>(); loginMenu = GameObject.FindGameObjectWithTag("Login Menu"); loginInfo = loginMenu.GetComponent<LoginScript>(); menuGUI = GameObject.FindGameObjectWithTag("Menus"); menu = menuGUI.GetComponent<MenuScript>(); username1 = username1.GetComponent<Text>(); username2 = username2.GetComponent<Text>(); username3 = username3.GetComponent<Text>(); username4 = username4.GetComponent<Text>(); username1.text = "EMPTY"; username2.text = "EMPTY"; username3.text = "EMPTY"; username4.text = "EMPTY"; ready1 = ready1.GetComponent<Text>(); ready2 = ready2.GetComponent<Text>(); ready3 = ready3.GetComponent<Text>(); ready4 = ready4.GetComponent<Text>(); ready1.text = "NOT READY"; ready2.text = "NOT READY"; ready3.text = "NOT READY"; ready4.text = "NOT READY"; //ready1.color = Color.red; //ready2.color = Color.red; //ready3.color = Color.red; //ready4.color = Color.red; isReady = false; // For the chatbox chatlog = chatlog.GetComponent<Text>(); chatlog.text = ""; chatbox = chatbox.GetComponent<Canvas>(); chatmessage.GetComponent<InputField>(); }
// Use this for initialization void Start() { manager = GameObject.Find("CanvasManager").GetComponent<MenuScript>(); hoveredOverLevel = LevelSelection.LEVEL1; hoveredOverDifficulty = DifficultySelection.EASY; currentSelectedLevel = LevelSelection.NULL; currentSelectedDifficulty = DifficultySelection.NULL; levelPanelPositions = new Vector3[6]; levelPanelPositions[0] = new Vector3(-270, 250, 0); levelPanelPositions[1] = new Vector3(270, 250, 0); levelPanelPositions[2] = new Vector3(-430, 0, 0); levelPanelPositions[3] = new Vector3(430, 0, 0); levelPanelPositions[4] = new Vector3(-270, -250, 0); levelPanelPositions[5] = new Vector3(270, -250, 0); LevelBackLight = GameObject.Find ("LevelBackLight"); }
void CleanUpGame(MenuScript nextMenu) { gameIsActive = false; if(networkManager.isServer) //if we are the server, we need to tell all clients to delete some stuff, and remove RPCs { networkManager.ClearAllRPCs(); networkManager.NetworkDestroyObjectsWithTag("Player"); networkManager.NetworkDestroyObjectsWithTag("ArenaObject"); Network.Destroy(scoreKeeper.gameObject); } else if(!networkManager.connected) //if we are no longer connected to anyone, we need to delete some stuff on our own { GameObject[] players = GameObject.FindGameObjectsWithTag("Player"); foreach(GameObject p in players) GameObject.Destroy(p); GameObject[] objects = GameObject.FindGameObjectsWithTag("ArenaObject"); foreach(GameObject o in objects) GameObject.Destroy(o); GameObject.Destroy(scoreKeeper.gameObject); } platformManager.ClearArena(); spawnManager.ClearSpawnPoints(); menuManager.SetCurrent(nextMenu); menuManager.EnableMenuBackgroundCamera(true); }