private void Awake() { if (instance == null) { instance = this; } }
// Use this for initialization void Start() { Instantiate(Resources.Load<GameObject>(fieldMapPath)).transform.SetParent(transform); GameObject lPanel = Instantiate(Resources.Load<GameObject>(levelPanelPath)); lPanel.transform.SetParent(transform); _mapFields = GetComponentsInChildren<MapField>(); _levelPanel = lPanel.GetComponentInChildren<LevelPanel>(); _levelPanel.SetLevelController(_levelController); mapArrowObj = Instantiate(Resources.Load<GameObject>(mapArrowPath)); mapArrowObj.transform.SetParent(transform); SetArrowRot(); //mapfieldから各メッシュをエミッションでちかちかさせる int i = 0; int cLevel = transform.root.gameObject.GetComponent<AppliController>().GetCurrentScene().GetComponent<GameScene>().gameController.nodeController.currentLevel; foreach(var mf in _mapFields) { if (i == cLevel) mapArrowObj.transform.position = mf.gameObject.transform.position + new Vector3(0.0f, 1.2f, 0.0f); mf.mapNum = i; mf.SetColor(true); i++; } }
void Start() { uISingleton = UISingleton.Instance; // Find All UI Objects levelPanel = uISingleton.GetComponentInChildren <LevelPanel>(); UpdateUI(); }
private void LevelPanel_LevelEditorExitSelected(int x, int y) { _levelPanel.LevelEditorExitSelected -= LevelPanel_LevelEditorExitSelected; _levelPanel = null; ExitX.Text = x.ToString("X"); ExitY.Text = y.ToString("X"); GlobalPanels.EditLevel(_levelInfo); }
public void Play(LevelPanel levelPanel) { GameDataManager.instance.sceneParam = new MainGameParam() { levelSData = levelPanel.levelSData }; sceneTransition.FadeIn(playTargetSceneAR); OnPlay.Invoke(this); }
private void Awake() { Instance = this; rt = GetComponent <RectTransform>(); shownPos = rt.anchoredPosition; hiddenPos = shownPos + new Vector2(hiddenX, 0); }
private void Awake() { if (levelPanel) { Destroy(gameObject); } else { levelPanel = this; } }
private void Button_Click_1(object sender, RoutedEventArgs e) { if (LevelList.SelectedItem != null) { if (LevelList.SelectedItem is LevelInfo) { _levelPanel = GlobalPanels.EditLevel((LevelInfo)LevelList.SelectedItem); _levelPanel.LevelEditorExitSelected += LevelPanel_LevelEditorExitSelected; } } }
static public void SetLevelPanel(int panelIndex, int levelIndex) { LevelPanel selectedPanel = Instance.encodeSeedCanvas.GetComponentsInChildren <LevelPanel>()[panelIndex]; selectedPanel.GetComponentsInChildren <Image>(true)[2].gameObject.SetActive(true); selectedPanel.GetComponentsInChildren <TextMeshProUGUI>(true)[0].gameObject.SetActive(true); selectedPanel.GetComponentsInChildren <TextMeshProUGUI>(true)[1].gameObject.SetActive(true); selectedPanel.GetComponentsInChildren <TextMeshProUGUI>()[1].text = LevelSetManager.AllLevels[levelIndex].name; selectedPanel.GetComponentsInChildren <Image>()[2].sprite = LevelSetManager.AllLevels[levelIndex].preview; }
void Awake() { if (instance == null) { instance = this; levelButtons = new List <LevelButton> (); } else if (instance != this) { Destroy(gameObject); } }
private void SetupLevels() { var levels = DataManager.FetchLevels(); for (int i = 0; i < levels.Count; i++) { LevelPanel levelPanel = Instantiate(levelPrefab, gridLayout.transform); levelPanel.SetLevel(levels[i]); levelPanel.OnTapped += OnLevelPanelTapped; panels.Add(levelPanel); } }
static public void HideLevelPanel(int panelIndex) { if (panelIndex >= 6) { return; } LevelPanel selectedPanel = Instance.encodeSeedCanvas.GetComponentsInChildren <LevelPanel>()[panelIndex]; selectedPanel.GetComponentsInChildren <Image>(true)[2].gameObject.SetActive(false); selectedPanel.GetComponentsInChildren <TextMeshProUGUI>(true)[0].gameObject.SetActive(false); selectedPanel.GetComponentsInChildren <TextMeshProUGUI>(true)[1].gameObject.SetActive(false); }
void Awake() { if (m_LeaderboardPanel == null) { m_LeaderboardPanel = FindObjectOfType <LeaderboardPanel>(); } if (m_ConfirmLogoutPanel == null) { m_ConfirmLogoutPanel = FindObjectOfType <ConfirmLogoutPanel>(); } // show login panels if (m_LoginSignupPanels == null) { m_LoginSignupPanels = FindObjectOfType <LoginSignUpPanels>(); } if (m_LoginSignupPanels) { m_LoginSignupPanels.gameObject.SetActive(true); } if (m_InfoPanel == null) { m_InfoPanel = FindObjectOfType <InfoPanel>(); } if (m_MainMenuPanel == null) { m_MainMenuPanel = FindObjectOfType <MainMenuPanel>(); } if (m_FadePanel == null) { m_FadePanel = FindObjectOfType <FadePanel>(); } if (m_LevelPanel == null) { m_LevelPanel = FindObjectOfType <LevelPanel>(); } if (m_ShopCanvas == null) { m_ShopCanvas = FindObjectOfType <ShopCanvas>(); } if (m_BoostLoading == null) { m_BoostLoading = FindObjectOfType <BoostLoading>(); } if (m_ScorePanel == null) { m_ScorePanel = FindObjectOfType <ScoreMenuPanel>(); } }
private void ContentWorkspaceContentOpened(object sender, ContentPresenterEventArgs e) { TabPage page = new TabPage(e.Content.Name) { Tag = e.Content.Uid }; tabControlEx1.TabPages.Add(page); LevelPanel lpanel = new LevelPanel(); lpanel.BindController(e.Content as LevelPresenter); lpanel.Dock = DockStyle.Fill; page.Controls.Add(lpanel); }
void SetLevelsPanel(PlayerInfo playerInfo) { Vector3 position = new Vector3(0f, basePanelPosition, 0f); foreach (LevelInfo levelInfo in playerInfo.LevelList) { GameObject newObj = Instantiate(levelPanelPrefab, position, Quaternion.identity); LevelPanel newLevelPanel = newObj.GetComponent <LevelPanel>(); newLevelPanel.levelInfo = levelInfo; newLevelPanel.SetDisplay(); newObj.transform.SetParent(scrollRectObject.transform); newObj.transform.localPosition = position; position.y -= panelDistance; levelPanelList.Add(newObj); } }
private void ContentWorkspaceReset(object sender, EventArgs e) { tabControlEx1.TabPages.Clear(); foreach (LevelPresenter lp in _editor.ContentWorkspace.OpenContents) { TabPage page = new TabPage(lp.Level.Name) { Tag = lp.Level.Uid }; tabControlEx1.TabPages.Add(page); LevelPanel lpanel = new LevelPanel(); lpanel.BindController(lp); lpanel.Dock = DockStyle.Fill; page.Controls.Add(lpanel); } }
public LevelPanel OpenLevelEditor(LevelInfo levelInfo) { var existingTab = OpenedTabs.Where(t => t.DataContext == levelInfo).FirstOrDefault(); if (existingTab != null) { TabsOpen.SelectedItem = SelectedTabItem = existingTab; return((LevelPanel)existingTab.Content); } TabItem tabItem = new TabItem(); LevelPanel levelPanel = new LevelPanel(_graphicsService, _palettesService, _textService, _tileService, _gameObjectService, _levelService, _clipBoardService, levelInfo); tabItem.Header = levelInfo.Name; tabItem.Content = levelPanel; tabItem.DataContext = levelInfo; TabsOpen.Items.Add(tabItem); OpenedTabs.Add(tabItem); TabsOpen.Visibility = Visibility.Visible; TabsOpen.SelectedItem = SelectedTabItem = tabItem; return(levelPanel); }
private void LevelPanel_LevelEditorExitSelected(int x, int y) { _levelPanel.LevelEditorExitSelected -= LevelPanel_LevelEditorExitSelected; _levelPanel = null; }
public static void SetPanel(LevelPanel panel) { levelPanel = panel; }
private void Awake() { levelManager = FindObjectOfType <LevelManager>(); levelPanel = FindObjectOfType <LevelPanel>(); }
void Start() { numberOfCoins.text = PlayerPrefs.GetInt("Coins", 0).ToString(); score.text = PlayerPrefs.GetInt("Score", 0).ToString(); LP = LevelPanel.instance; }