void Awake() { gameObject.GetComponent <M4uContextRoot>().Context = this; unitNamePanel = InGameSkillWindowQuest2.setupPrefab <UnitNamePanel>("Prefab/UnitNamePanel/UnitNamePanel", windowPanelRoot); unitAilmentPanel = InGameSkillWindowQuest2.setupPrefab <UnitAilmentPanel>("Prefab/InGame/InGameUI/Menu/UnitAilmentPanel", windowPanelRoot); CloseText = GameTextUtil.GetText("common_button6"); }
/*==========================================================================*/ /* func */ /*==========================================================================*/ //---------------------------------------------------------------------------- /*! * @brief Unity固有処理:初期化処理 ※初回のUpdateを呼び出す直前に呼出し */ //---------------------------------------------------------------------------- protected override void Start() { base.Start(); //---------------------------------------- // ユニットモデル m_ReferObject[OBJECT_CHARA_MESH] = UnityUtil.GetChildNode(gameObject, "CharaMesh"); // ウィンドウルート m_ReferObject[OBJECT_WINDOW_ROOT] = UnityUtil.GetChildNode(gameObject, "WindowBaseRoot"); //カットインルート m_ReferObject[OBJECT_CUTIN_PARENT] = UnityUtil.GetChildNode(gameObject, "CutinParent"); // エフェクト表示位置の高さ m_EffectPosY = 0.0f; //------------------------- // 階層をレイアウト切り替え管理クラスに登録 // 最初のレイアウトは非表示にしておく //------------------------- m_LayoutWindow = gameObject.AddComponent <LayoutSwitchManager>(); m_LayoutWindow.SetLayoutMax(LAYER_WINDOW_MAX); m_LayoutWindow.SetLayoutSwitch(LAYER_WINDOW_EMPTY, UnityUtil.GetChildNode(gameObject, "LayerWindowEmpty"), false, null, typeof(MainMenuDialogSeqWait)); m_LayoutWindow.SetLayoutSwitch(LAYER_WINDOW_BLACK, UnityUtil.GetChildNode(gameObject, "LayerWindowBlack"), false, null, typeof(MainMenuDialogSeqWait)); m_LayoutWindow.AddSwitchRequest(LAYER_WINDOW_EMPTY, true); //------------------------- // 階層をレイアウト切り替え管理クラスに登録 // 最初のレイアウトは非表示にしておく //------------------------- m_LayoutCategory = gameObject.AddComponent <LayoutSwitchManager>(); m_LayoutCategory.SetLayoutMax(LAYER_CATEGORY_MAX); m_LayoutCategory.SetLayoutSwitch(LAYER_CATEGORY_EMPTY, UnityUtil.GetChildNode(gameObject, "LayerCateEmpty"), false, null, typeof(MainMenuDialogSeqWait)); m_LayoutCategory.SetLayoutSwitch(LAYER_CATEGORY_LINK, UnityUtil.GetChildNode(gameObject, "LayerCateLink"), false, null, typeof(MainMenuDialogSeqWait)); m_LayoutCategory.SetLayoutSwitch(LAYER_CATEGORY_MATERIAL, UnityUtil.GetChildNode(gameObject, "LayerCateMaterial"), false, null, typeof(MainMenuDialogSeqWait)); m_LayoutCategory.AddSwitchRequest(LAYER_CATEGORY_EMPTY, true); GameObject cObjectLinkOn = UnityUtil.GetChildNode(gameObject, "LayerLogoLinkOn"); m_AnimationShotLogo[LAYER_LOGO_LINKON] = cObjectLinkOn.GetComponent <AnimationClipShot>(); Vector3 vLogoRootPos = new Vector3(0.0f, m_EffectPosY, 0.0f); GameObject cObjLogoRoot = UnityUtil.GetChildNode(gameObject, "LayerLogoRoot"); cObjLogoRoot.transform.position = vLogoRootPos; m_UnitNamePanel = m_CanvasObj.GetComponentInChildren <UnitNamePanel>(); m_UnitResultButton = m_CanvasObj.GetComponentInChildren <UnitResultButton>(); m_UnitResultButton.Button1Text = "別のユニットをリンク"; m_UnitResultButton.IsActiveButton1 = false; m_UnitResultButton.DidSelectButton1 = SwitchUnitSelect; m_UnitResultButton.IsActiveButton2 = false; //---------------------------------------- // パッチ処理を行わないようにする //---------------------------------------- MainMenuManager.Instance.m_ResumePatchUpdateRequest = false; }
public void CloseUnitInfo() { if (!(currentHudState == HUDState.unitSelected)) { return; } unitPanelSelected.DeSelect(); unitPanelSelected = null; currentHudState = HUDState.nothingSelected; StartCoroutine("CloseAnim_unitInfo"); StopCoroutine("OpenAnim_unitInfo"); }
public void OpenUnitInfo(UnitNamePanel UNP) { if (interactable) { if (!(currentHudState == HUDState.nothingSelected || currentHudState == HUDState.unitSelected)) { return; } if (unitPanelSelected != null) { unitPanelSelected.DeSelect(); } unitPanelSelected = UNP; UpdateUnitDisplayedInfo(); StartCoroutine("OpenAnim_unitInfo"); StopCoroutine("CloseAnim_unitInfo"); } }
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; }
//public ButtonView SkillButton = null; private void Start() { if (CharaDetail != null) { CharaDetail.SetCharaTexture(Context.charaMaster, Context.charaTexture, true); } if (Context.IsViewNamePanel && NameRoot != null) { UnitNamePanel panel = setupPrefab <UnitNamePanel>("Prefab/UnitNamePanel/UnitNamePanel", NameRoot); if (panel != null) { panel.setup(Context.charaMaster); panel.IconSelect = MainMenuUtil.GetElementCircleSprite(Context.charaMaster.element); } } if (TouchArea != null) { TouchArea.DidPointerEnter = OnMaterialPointerEnter; TouchArea.DidPointerExit = OnMaterialPointerExit; } }
/*==========================================================================*/ /* func */ /*==========================================================================*/ //---------------------------------------------------------------------------- /*! * @brief Unity固有処理:初期化処理 ※初回のUpdateを呼び出す直前に呼出し */ //---------------------------------------------------------------------------- protected override void Start() { base.Start(); //---------------------------------------- // ユニットモデル m_ReferObject[OBJECT_CHARA_MESH_ROOT] = UnityUtil.GetChildNode(gameObject, "CharaMeshRoot", "CharaMesh"); m_ReferObject[OBJECT_CHARA_MESH_BEFORE] = UnityUtil.GetChildNode(m_ReferObject[OBJECT_CHARA_MESH_ROOT], "CharaMeshBefore"); m_ReferObject[OBJECT_CHARA_MESH_AFTER] = UnityUtil.GetChildNode(m_ReferObject[OBJECT_CHARA_MESH_ROOT], "CharaMeshAfter"); // ウィンドウルート m_ReferObject[OBJECT_WINDOW_ROOT] = UnityUtil.GetChildNode(gameObject, "WindowBaseRoot"); // カットインルートオブジェクト m_ReferObject[OBJECT_CUTIN_PARENT] = UnityUtil.GetChildNode(gameObject, "CutinParent"); // エフェクト表示位置の高さ //m_EffectPosY = UnityUtil.GetChildNode( gameObject, "CharaBackGround" ).transform.position.y; m_EffectPosY = 0.0f; //------------------------- // 階層をレイアウト切り替え管理クラスに登録 // 最初のレイアウトは非表示にしておく //------------------------- m_LayoutWindow = gameObject.AddComponent <LayoutSwitchManager>(); m_LayoutWindow.SetLayoutMax(LAYER_WINDOW_MAX); m_LayoutWindow.SetLayoutSwitch(LAYER_WINDOW_EMPTY, UnityUtil.GetChildNode(gameObject, "LayerWindowEmpty"), false, null, typeof(MainMenuDialogSeqWait)); m_LayoutWindow.SetLayoutSwitch(LAYER_WINDOW_BLACK, UnityUtil.GetChildNode(gameObject, "LayerWindowBlack"), false, null, typeof(MainMenuDialogSeqWait)); m_LayoutWindow.AddSwitchRequest(LAYER_WINDOW_EMPTY, true); //------------------------- // 階層をレイアウト切り替え管理クラスに登録 // 最初のレイアウトは非表示にしておく //------------------------- m_LayoutCategory = gameObject.AddComponent <LayoutSwitchManager>(); m_LayoutCategory.SetLayoutMax(LAYER_CATEGORY_MAX); m_LayoutCategory.SetLayoutSwitch(LAYER_CATEGORY_EMPTY, UnityUtil.GetChildNode(gameObject, "LayerCateEmpty"), false, null, typeof(MainMenuDialogSeqWait)); m_LayoutCategory.SetLayoutSwitch(LAYER_CATEGORY_FRIEND, UnityUtil.GetChildNode(gameObject, "LayerCateFriend"), false, null, typeof(MainMenuDialogSeqWait)); m_LayoutCategory.SetLayoutSwitch(LAYER_CATEGORY_MATERIAL, UnityUtil.GetChildNode(gameObject, "LayerCateMaterial"), false, null, typeof(MainMenuDialogSeqWait)); m_LayoutCategory.AddSwitchRequest(LAYER_CATEGORY_EMPTY, true); //------------------------- // 階層をレイアウト切り替え管理クラスに登録 // 最初のレイアウトは非表示にしておく //------------------------- m_LayoutEvolve = gameObject.AddComponent <LayoutSwitchManager>(); m_LayoutEvolve.SetLayoutMax(LAYER_EVOLVE_MAX); m_LayoutEvolve.SetLayoutSwitch(LAYER_EVOLVE_EMPTY, UnityUtil.GetChildNode(gameObject, "LayerEvolveEmpty"), false, null, typeof(MainMenuDialogSeqWait)); m_LayoutEvolve.SetLayoutSwitch(LAYER_EVOLVE_ACTIVE, UnityUtil.GetChildNode(gameObject, "LayerEvolve"), false, null, typeof(MainMenuDialogSeqWait)); m_LayoutEvolve.AddSwitchRequest(LAYER_EVOLVE_EMPTY, true); //------------------------- // ユニットアニメーションのコンポーネント取得 //------------------------- if (m_ReferObject[OBJECT_CHARA_MESH_ROOT] != null) { m_CharaMeshAnim = m_ReferObject[OBJECT_CHARA_MESH_ROOT].GetComponent <AnimationClipResultEvol>(); } Vector3 vLogoRootPos = new Vector3(0.0f, m_EffectPosY, 0.0f); GameObject cObjLogoRoot = UnityUtil.GetChildNode(gameObject, "LayerLogoRoot"); cObjLogoRoot.transform.position = vLogoRootPos; m_UnitNamePanel = m_CanvasObj.GetComponentInChildren <UnitNamePanel>(); m_UnitResultButton = m_CanvasObj.GetComponentInChildren <UnitResultButton>(); m_UnitResultButton.Button1Text = "このユニットを強化する"; m_UnitResultButton.IsActiveButton1 = false; m_UnitResultButton.DidSelectButton1 = SwitchBuildup; m_UnitResultButton.Button2Text = "別のユニットを進化"; m_UnitResultButton.IsActiveButton2 = false; m_UnitResultButton.DidSelectButton2 = SwitchUnitSelect; //---------------------------------------- // パッチ処理を行わないようにする. //---------------------------------------- MainMenuManager.Instance.m_ResumePatchUpdateRequest = false; }
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); }