// Use this for initialization protected virtual void Start() { IsActiveMenu = IsStaringMenu; for (int i = 0; i < ReadInputFrom.Length; i++) { m_ReadInputFrom = m_ReadInputFrom | (int)ReadInputFrom[i]; } if(m_Camera == null) { m_Camera = Camera.main.GetComponent<MenuCamera>(); if (m_Camera == null) { #if DEBUG || UNITY_EDITOR Debug.LogError("NO CAMERA FOUND"); #endif } } if (m_CurrentButtonSelection != null) { m_CurrentButtonSelection.ButtonState = ButtonV2.ButtonStates.Highlightled; } ButtonV2[] childButtons = gameObject.GetComponentsInChildren<ButtonV2>(); for (int i = 0; i < childButtons.Length; i++) { childButtons[i].ParentMenu = this; } start(); }
private void Start() { if (SystemInfo.supportsAccelerometer) { tiltControlButton.GetComponent <Image>().color = (SaveManager.Instance.state.usingAccelerometer) ? tiltControlEnabled : tiltControlDisabled; } else { tiltControlButton.gameObject.SetActive(false); } menuCam = FindObjectOfType <MenuCamera>(); SetCameraTo(Manager.Instance.menuFocus); UpdateGoldText(); fadeGroup = FindObjectOfType <CanvasGroup>(); fadeGroup.alpha = 1; InitShop(); InitLevel(); OnColorSelect(SaveManager.Instance.state.activeColor); SetColor(SaveManager.Instance.state.activeColor); OnTrailSelect(SaveManager.Instance.state.activeTrail); SetTrail(SaveManager.Instance.state.activeTrail); colorPanel.GetChild(SaveManager.Instance.state.activeColor).GetComponent <RectTransform>().localScale = Vector3.one * 1.125f; trailPanel.GetChild(SaveManager.Instance.state.activeTrail).GetComponent <RectTransform>().localScale = Vector3.one * 1.125f; }
private void Start() { if (SystemInfo.supportsAccelerometer) { // Is it currently enabled tiltControlButton.GetComponent <Image>().color = (SaveManager.Instance.state.usingAccelerometer) ? tiltControlEnabled: tiltControlDisabled; } else { tiltControlButton.gameObject.SetActive(false); } // Find the only MenuCamera and assign it menuCamera = FindObjectOfType <MenuCamera>(); SetCameraTo(Manager.Instance.menuFocus); // Tell our gold text how much he should displaying UpdateGoldText(); // Grab the only CanvasGroup in the scene fadeGroup = FindObjectOfType <CanvasGroup>(); // Start with a white screen fadeGroup.alpha = 1; // Add button on-click events to shop button InitShop(); // Add button on-click events to levels InitLevel(); }
public MainMenu(MenuCamera parent, SFManager sfmgr, SFMovieCreationParams cp) : base(sfmgr, cp) { this.parent = parent; SFMgr = sfmgr; this.SetFocus(false); }
public void BackPressed() { MenuCamera menuCamera = GameObject.FindObjectOfType <MenuCamera>(); menuCamera.SetPrivateField("desiredPos", new Vector3(1f, 4.6f, 5.5f) + menuCamera.GetPrivateField <Vector3>("startPos")); menuCamera.SetPrivateField("desiredRot", Quaternion.Euler(0f, 90f, 0f)); ChangeUIState(false); }
public void Start() { if (Instance != null) { Destroy(this); } else { Instance = this; } }
//public Transform trailPreviewObject; //public RenderTexture trailPreviewTexture; private void Start() { // Temporary gold SaveManager.Instance.state.gold = 999; //Check if we have accelerometer if (SystemInfo.supportsAccelerometer) { // Is it currently enabled? tiltControlButton.GetComponent <Image> ().color = (SaveManager.Instance.state.usingAccelerometer) ? tiltControlEnabled : tiltControlDisabled; } else { tiltControlButton.gameObject.SetActive(false); } //Find the only MenuCamera and assign it menuCam = FindObjectOfType <MenuCamera>(); //Position our camera on the focused menu SetCameraTo(Manager.Instance.menuFocus); //Tell our gold text how much he should be displayng UpdateGoldText(); //Grab the only canvasGroup in the scene fadeGroup = FindObjectOfType <CanvasGroup> (); //Start with a white screen fadeGroup.alpha = 1; //Add button on-click events to shop buttons InitShop(); //Add button on-click to levels InitLevel(); //Set the player's preferences (color and trail) OnColorSelect(SaveManager.Instance.state.activeColor); SetColor(SaveManager.Instance.state.activeColor); OnTrailSelect(SaveManager.Instance.state.activeTrail); SetTrail(SaveManager.Instance.state.activeTrail); //Make the buttons bigger for the selected items colorPanel.GetChild(SaveManager.Instance.state.activeColor).GetComponent <RectTransform>().localScale = Vector3.one * 1.125f; trailPanel.GetChild(SaveManager.Instance.state.activeTrail).GetComponent <RectTransform>().localScale = Vector3.one * 1.125f; //Create the trail preview lastPreviewObject = GameObject.Instantiate(Manager.Instance.playerTrails[SaveManager.Instance.state.activeTrail]) as GameObject; //lastPreviewObject.transform.SetParent (trailPreviewObject); lastPreviewObject.transform.localPosition = Vector3.zero; }
void Awake() { // Does the camera already exist in the scene? if so, make this one go away if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } DontDestroyOnLoad(this.gameObject); }
public static void RefreshPlayerView() { CursorController.HideAttackCursors(); CursorController.HideConfirmAttackCursors(); CursorController.ShowMoveCells(); CursorController.RefreshAlarmCursors(); SetState(State.PickAction); Menu.Refresh(); ActionInformation.Hide(); DeathInformation.Refresh(); MenuCamera.Refresh(); }
private void Start() { //check if we have an accelerator, if (SystemInfo.supportsAccelerometer) { //is currentsly enabled tiltControlButton.GetComponent <Image>().color = (SaveManager.Instance.state.usingAccelerometer) ? tiltControlEnabled : tiltControlDisabled; } else { tiltControlButton.gameObject.SetActive(false); } menuCam = FindObjectOfType <MenuCamera>(); //position camera to focused menu SetCameraTo(Manager.Instance.menuFocus); //tell how much gold text to be displayed UpdateGoldText(); fadeGroup = FindObjectOfType <CanvasGroup>(); //start loading with a white screen fadeGroup.alpha = 1; InitShop(); InitLevel(); //set player preferences for ocolor and trial OnColorSelect(SaveManager.Instance.state.activeColor); SetColor(SaveManager.Instance.state.activeColor); OnTrailSelect(SaveManager.Instance.state.activeTrail); SetTrail(SaveManager.Instance.state.activeTrail); //make the buttons bigger for selected items colorPanel.GetChild(SaveManager.Instance.state.activeColor).GetComponent <RectTransform>().localScale = Vector3.one * 1.125f; trailPanel.GetChild(SaveManager.Instance.state.activeTrail).GetComponent <RectTransform>().localScale = Vector3.one * 1.125f; //create the trail preview lastPriviewObject = GameObject.Instantiate(Manager.Instance.playerTrails[SaveManager.Instance.state.activeTrail]) as GameObject; lastPriviewObject.transform.SetParent(trailPreviewObject); lastPriviewObject.transform.localPosition = Vector3.zero; }
// Start is called before the first frame update void Start() { //check if we have a accelorometer if (SystemInfo.supportsAccelerometer) { // it is currently enabled tiltControlButton.GetComponent <Image>().color = SaveManager.Instance.state.usingAccelerometer ? tiltControlEnabled : tiltControlDisabled; } else { tiltControlButton.gameObject.SetActive(false); } // Find the only menucamera and assign it menuCamera = FindObjectOfType <MenuCamera>(); //position our camera on the focused menu SetCameraTo(Manager.Instance.menuFocus); //tell our gold text how much to display UpdateGoldText(); fadeGroup = FindObjectOfType <CanvasGroup>(); fadeGroup.alpha = 1; // Add button on click events to the shop buttons;; InitShop(); // Add buttons on click event to levels; IninLevel(); //set player preferences for both the color and the trial OnColorSelect(SaveManager.Instance.state.activeColor); SetColor(SaveManager.Instance.state.activeColor); OnTrialSelect(SaveManager.Instance.state.activeTrial); SetTrial(SaveManager.Instance.state.activeTrial); // Make the buttons bigger for selected item colorPanel.GetChild(SaveManager.Instance.state.activeColor).GetComponent <RectTransform>().localScale = Vector3.one * 1.125f; trialPanel.GetChild(SaveManager.Instance.state.activeTrial).GetComponent <RectTransform>().localScale = Vector3.one * 1.125f; // create the trial preview lastPreviewObject = GameObject.Instantiate(Manager.Instance.playerTrial[SaveManager.Instance.state.activeTrial]) as GameObject; lastPreviewObject.transform.SetParent(trialPreviewObjet); lastPreviewObject.transform.localPosition = Vector3.zero; }
private void Start() { //Find the only MenuCamera and assign it menuCam = FindObjectOfType <MenuCamera>(); //$$ Temporary SaveManager.Instance.state.gold = 999; //Position our camera on the focused menu SetCameraTo(Manager.Instance.menuFocus); //Tell our gold text how much we currently have UpdateGoldText(); //Grab only CanvasGroup in the scene fadeGroup = FindObjectOfType <CanvasGroup>(); Debug.Log("fadegroup"); //Start with solid screen fadeGroup.alpha = 1; //Add button on-click events to shop buttons InitializeShop(); //Add button on-click events to levels InitializeLevel(); //Set player's preferences for both bat and trail OnBatSelect(SaveManager.Instance.state.activeBat); SetBat(SaveManager.Instance.state.activeBat); OnTrailSelect(SaveManager.Instance.state.activeTrail); SetTrail(SaveManager.Instance.state.activeTrail); //Make buttons bigger for selected item batPanel.GetChild(SaveManager.Instance.state.activeBat).GetComponent <RectTransform>().localScale = Vector3.one * 1.125f; trailPanel.GetChild(SaveManager.Instance.state.activeTrail).GetComponent <RectTransform>().localScale = Vector3.one * 1.125f; //Create the trail preview lastPreviewObject = GameObject.Instantiate(Manager.Instance.ballTrails[SaveManager.Instance.state.activeTrail]) as GameObject; lastPreviewObject.transform.SetParent(trailPreviewObject); lastPreviewObject.transform.localPosition = Vector3.zero; }
void Awake() { instance = this; pointsLenght = points.Length; pathsLength = paths.Length; transition = new Curve(new Vector3(0f, 0f, 0f), new Vector3(2f, 0f, 0f), new Vector3(3f, 1f, 0f), new Vector3(5f, 1f, 0f), 100); MenuCameraPosition start = getPointFromName(startPoint); if(start != null) { cam.transform.position = start.transform.position; cam.transform.rotation = start.transform.rotation; } else { Debug.LogError("startPoint does not exist!"); } }
// Start is called before the first frame update void Start() { //fadeGroup = FindObjectOfType<CanvasGroup>(); //fadeGroup.alpha = 1; menuCam = FindObjectOfType <MenuCamera>(); //SaveManager.Instance.state.gold = 0; //SetCameraTo(Manager.Instance.menuFocus); UpdateGoldText(); InitShop(); OnColorSelect(SaveManager.Instance.state.activeColor); SetColor(SaveManager.Instance.state.activeColor); colorPanel.GetChild(SaveManager.Instance.state.activeColor).GetComponent <RectTransform>().localScale = Vector3.one * 1.125f; }
// Use this for initialization protected override void start() { #if DEBUG || UNITY_EDITOR if (NextMenu == null) { Debug.LogError(gameObject.name + " " + "NO MENU SET"); } #endif if (m_Camera == null) { m_Camera = Camera.main.GetComponent<MenuCamera>(); } if (m_Camera == null) { #if DEBUG || UNITY_EDITOR Debug.LogError("NO CAMERA FOUND"); #endif } }
// Use this for initialization protected override void start() { #if DEBUG || UNITY_EDITOR if (NextMenu == null) { Debug.LogError(gameObject.name + " " + "NO MENU SET"); } #endif if (m_Camera == null) { m_Camera = Camera.main.GetComponent <MenuCamera>(); } if (m_Camera == null) { #if DEBUG || UNITY_EDITOR Debug.LogError("NO CAMERA FOUND"); #endif } }
private void Awake() { mc = this; showShipManagement += zoomIn; }
//GameObject Stuff void Update() { if(gui == null) { gui = GameObject.Find("GUI").GetComponent<MenuCamera>(); } switch(currentState) { case (int)NetworkState.idle: if(menuGUI == null){ menuGUI = gui.AddMovie("MainMenu.swf"); } break; case (int)NetworkState.matching: MatchMake(); break; case (int)NetworkState.loading0: LoadNetworkObjects(); break; case (int)NetworkState.loading1: case (int)NetworkState.loading2: if(!localLoaded) { PairNetworkObjects(); } break; case (int)NetworkState.loading3: //Delete Stuff From GameStart. GameObject.Destroy(GameObject.Find("MainCamera")); menuGUI.Destroy(); currentState++; break; case (int)NetworkState.prepare0: if(Network.isServer) { readyGUI = gui.AddMovie("InstructionsGameDesigner.swf"); hudGUI = gui.AddMovie("In_GameHUD.swf"); } else { readyGUI = gui.AddMovie("InstructionsRobot.swf"); } currentState++; break; case (int)NetworkState.ready0: if(GameObject.Find(player.name+"(Clone)").GetComponent<MenuCamera>() != null) { readyGUI.ReadyChecked(); } currentState++; break; case (int)NetworkState.ready1: readyGUI.Destroy(); currentState++; break; case (int)NetworkState.playing: if(playerSpline == null) { playerSpline = GameObject.Find(player.name+"(Clone)").GetComponent<SplineAnimator>(); } if(Network.isClient) { playerSpline.paused = false; } if(playerSpline.passedTime>=1) { hudGUI.Destroy(); gui.AddMovie("Robot_WinAndLooseScreens.swf"); } break; } }
// Use this for initialization protected virtual void Start() { IsActiveMenu = IsStaringMenu; for (int i = 0; i < ReadInputFrom.Length; i++) { m_ReadInputFrom = m_ReadInputFrom | (int)ReadInputFrom[i]; } if(m_Camera == null) { m_Camera = Camera.main.GetComponent<MenuCamera>(); if (m_Camera == null) { #if DEBUG || UNITY_EDITOR Debug.LogError("NO CAMERA FOUND"); #endif } } if (m_CurrentButtonSelection != null) { m_CurrentButtonSelection.ButtonState = ButtonV2.ButtonStates.Highlightled; } ButtonV2[] childButtons = gameObject.GetComponentsInChildren<ButtonV2>(); for (int i = 0; i < childButtons.Length; i++) { childButtons[i].ParentMenu = this; } start(); }
void Awake() { instance = this; }
void Awake() { instance = this; }