void Awake() { gameObject.GetComponent <M4uContextRoot>().Context = this; unitNamePanel = setupPrefab <UnitNamePanel>("Prefab/UnitNamePanel/UnitNamePanel", windowPanelRoot); unitParamPanel = setupPrefab <UnitParamPanel>("Prefab/UnitParamPanel/UnitParamPanel", windowPanelRoot); Destroy(unitParamPanel.gameObject.GetComponent <ContentSizeFitter>()); Destroy(unitParamPanel.gameObject.GetComponent <LayoutElement>()); unitAilmentPanel = setupPrefab <UnitAilmentPanel>("Prefab/InGame/InGameUI/Menu/UnitAilmentPanel", windowPanelRoot); unitSkillPanel = setupPrefabAddLayoutElement <UnitSkillPanel>("Prefab/UnitSkillPanel/UnitSkillPanel", windowPanelRoot, 600, 520, 0, 0); unitLinkPanel = setupPrefabAddLayoutElement <UnitLinkPanel>("Prefab/UnitLinkPanel/UnitLinkPanel", windowPanelRoot, 600, 520, 0, 0); heroDetailPanel = setupPrefab <HeroDetailPanel>("Prefab/InGame/InGameUI/Menu/HeroDetailPanel", windowPanelRoot); skillWindowTag = setupPrefab <InGameSkillWindowTag>("Prefab/InGame/InGameUI/Menu/InGameSkillWindowTag", windowPanelRoot); skillWindowParty = setupPrefab <InGameSkillWindowParty>("Prefab/InGame/InGameUI/Menu/InGameSkillWindowParty", windowPanelRoot); CloseText = GameTextUtil.GetText("common_button6"); skillWindowTag.m_StatusClickAction = OnStatus; skillWindowTag.m_LinkClickAction = OnLink; skillWindowTag.m_SkillClickAction = OnSkill; skillWindowTag.Tab_active = true; }
private void Awake() { IsViewDialog = false; GetComponent <M4uContextRoot>().Context = this; if (SceneObjReferMainMenu.HasInstance) { m_UnitLinkPanel = UnityUtil.SetupPrefab <UnitLinkPanel>(SceneObjReferMainMenu.Instance.m_UnitLinkPanel, PanelRoot); } else { m_UnitLinkPanel = UnityUtil.SetupPrefab <UnitLinkPanel>("Prefab/UnitLinkPanel/UnitLinkPanel", PanelRoot); } Window.SetPositionAjustStatusBar(new Vector2(0, -17), new Vector2(-40, -446)); m_UnitLinkPanel.SetPosition(new Vector2(0, -2), new Vector2(-20, -60), true); //m_UnitLinkPanel.transform.Find("Viewport/Content").localScale = new Vector3(0.75f, 0.75f, 1.0f); }
private void Awake() { AndroidBackKeyManager.Instance.DisableBackKey(); GetComponent <M4uContextRoot>().Context = this; GameObject rootObject = WindowRoot.gameObject; if (SceneObjReferMainMenu.HasInstance) { m_UnitNamePanel = UnityUtil.SetupPrefab <UnitNamePanel>(SceneObjReferMainMenu.Instance.m_UnitNamePanel, MainCanvas); m_UnitParamPanel = UnityUtil.SetupPrefab <UnitParamPanel>(SceneObjReferMainMenu.Instance.m_UnitParamPanel, rootObject); m_UnitStoryPanel = UnityUtil.SetupPrefab <UnitStoryPanel>(SceneObjReferMainMenu.Instance.m_UnitStoryPanel, m_UnitParamPanel.gameObject); m_UnitSkillPanel = UnityUtil.SetupPrefab <UnitSkillPanel>(SceneObjReferMainMenu.Instance.m_UnitSkillPanel, rootObject); m_UnitLinkPanel = UnityUtil.SetupPrefab <UnitLinkPanel>(SceneObjReferMainMenu.Instance.m_UnitLinkPanel, rootObject); m_UnitEvolvePanel = UnityUtil.SetupPrefab <UnitEvolveList>(SceneObjReferMainMenu.Instance.m_UnitEvolveListPanel, rootObject); m_UnitDetailPanel = UnityUtil.SetupPrefab <UnitDetailPanel>(SceneObjReferMainMenu.Instance.m_UnitDetailPanel, rootObject); } else { m_UnitNamePanel = UnityUtil.SetupPrefab <UnitNamePanel>("Prefab/UnitNamePanel/UnitNamePanel", MainCanvas); m_UnitParamPanel = UnityUtil.SetupPrefab <UnitParamPanel>("Prefab/UnitParamPanel/UnitParamPanel", rootObject); m_UnitStoryPanel = UnityUtil.SetupPrefab <UnitStoryPanel>("Prefab/UnitStoryPanel/UnitStoryPanel", m_UnitParamPanel.gameObject); m_UnitSkillPanel = UnityUtil.SetupPrefab <UnitSkillPanel>("Prefab/UnitSkillPanel/UnitSkillPanel", rootObject); m_UnitLinkPanel = UnityUtil.SetupPrefab <UnitLinkPanel>("Prefab/UnitLinkPanel/UnitLinkPanel", rootObject); m_UnitEvolvePanel = UnityUtil.SetupPrefab <UnitEvolveList>("Prefab/UnitEvolveList/UnitEvolveList", rootObject); m_UnitDetailPanel = UnityUtil.SetupPrefab <UnitDetailPanel>("Prefab/UnitDetailPanel/UnitDetailPanel", rootObject); } // LayoutElement element = m_UnitStoryPanel.gameObject.AddComponent <LayoutElement>(); element.ignoreLayout = true; m_MainCanvas = MainCanvas.GetComponent <Canvas>(); IsViewInfo = true; ToggleList = new List <UnitDetailToggleContext>(); ToggleList.Add(new UnitDetailToggleContext(ToggleType.Status, new Vector2(-128, -8), "status", OnSelectToggle, 1)); ToggleList.Add(new UnitDetailToggleContext(ToggleType.Skill, new Vector2(0, -17), "skill", OnSelectToggle, 10)); ToggleList.Add(new UnitDetailToggleContext(ToggleType.Link, new Vector2(128, -8), "link", OnSelectToggle, 1)); ToggleList.Add(new UnitDetailToggleContext(ToggleType.Evolve, new Vector2(256, 13), "evol", OnSelectToggle, -20)); m_UnitDetailPanel.selectTogglr = OnSelectToggle; m_UnitDetailPanel.selectSkill = OnSelectMainUnitSkillButton; m_UnitDetailPanel.selectLoupe = OnSelectCharaScreen; m_UnitDetailPanel.selectLink = OnSelectLinkButton; m_UnitDetailPanel.selectFavorite = OnSelectFavorite; m_UnitDetailPanel.IsViewFavorite = false; FavoriteLabel = "お気に入り"; IllustratorName = ""; ReturnImage = ResourceManager.Instance.Load("back2"); if (SafeAreaControl.HasInstance) { Transform canvasTransform = gameObject.transform.Find("Canvas"); Transform transform = canvasTransform.Find("ReturnButton"); SafeAreaControl.Instance.addLocalYPos(transform); } m_MainCanvas.enabled = false; //UnityUtil.SetObjectLayer( gameObject, LayerMask.NameToLayer("DRAW_CLIP")); AndroidBackKeyManager.Instance.StackPush(gameObject, OnSelectReturn); }