protected void InitBaseSys() { Singleton <CTimerManager> .CreateInstance(); Singleton <CResourceManager> .CreateInstance(); Singleton <ResourceLoader> .GetInstance(); Singleton <CGameObjectPool> .CreateInstance(); Singleton <CSoundManager> .CreateInstance(); Singleton <CUIEventManager> .CreateInstance(); Singleton <CUIManager> .CreateInstance(); MonoSingleton <CVersionUpdateSystem> .GetInstance(); Singleton <CCheatSystem> .CreateInstance(); Singleton <GameStateCtrl> .CreateInstance(); OutlineFilter.EnableSurfaceShaderOutline(false); DynamicShadow.InitDefaultGlobalVariables(); }
public static void EnableDynamicShow(GameObject go, bool enable) { if ((go != null) && (!enable || GameSettings.IsHighQuality)) { DynamicShadow[] componentsInChildren = go.GetComponentsInChildren <DynamicShadow>(); if ((componentsInChildren != null) && (componentsInChildren.Length != 0)) { for (int i = 0; i < componentsInChildren.Length; i++) { DynamicShadow item = componentsInChildren[i]; if (enable) { item.InitShadow(); if (!shadowList.Contains(item)) { shadowList.Add(item); } } else { item.CloseShadow(); shadowList.Remove(item); } } if (enable) { Shader.EnableKeyword("_SGAME_HEROSHOW_SHADOW_ON"); } else if (shadowList.Count == 0) { Shader.DisableKeyword("_SGAME_HEROSHOW_SHADOW_ON"); } } } }
public static void DisableAllDynamicShadows() { for (int i = 0; i < shadowList.Count; i++) { DynamicShadow shadow = shadowList[i]; if (shadow != null) { shadow.CloseShadow(); } } shadowList.Clear(); Shader.DisableKeyword("_SGAME_HEROSHOW_SHADOW_ON"); }
public static void DisableAllDynamicShadows() { for (int i = 0; i < DynamicShadow.shadowList.Count; i++) { DynamicShadow dynamicShadow = DynamicShadow.shadowList[i]; if (dynamicShadow) { dynamicShadow.CloseShadow(); } } DynamicShadow.shadowList.Clear(); Shader.DisableKeyword("_SGAME_HEROSHOW_SHADOW_ON"); }
private void OnShowGiveFriendSkin(uint heroId, uint skinId, uint price) { ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(heroId, skinId); if (heroSkin == null) { return; } CUIFormScript cUIFormScript = Singleton <CUIManager> .GetInstance().OpenForm(string.Format("{0}{1}", "UGUI/Form/System/", "Mall/Form_GiveHeroSkin_3D.prefab"), false, true); Text component = cUIFormScript.transform.Find("Panel/skinNameText").GetComponent <Text>(); component.set_text(heroSkin.szSkinName); GameObject gameObject = cUIFormScript.transform.Find("Panel/Panel_Prop/List_Prop").gameObject; CSkinInfo.GetHeroSkinProp(heroId, skinId, ref CHeroInfoSystem2.s_propArr, ref CHeroInfoSystem2.s_propPctArr, ref CHeroInfoSystem2.s_propImgArr); CUICommonSystem.SetListProp(gameObject, ref CHeroInfoSystem2.s_propArr, ref CHeroInfoSystem2.s_propPctArr); Text component2 = cUIFormScript.transform.Find("Panel/pricePanel/priceText").GetComponent <Text>(); component2.set_text(price.ToString()); CUIEventScript component3 = cUIFormScript.transform.Find("Panel/BtnGroup/buyButton").gameObject.GetComponent <CUIEventScript>(); stUIEventParams eventParams = default(stUIEventParams); eventParams.heroSkinParam.heroId = heroId; eventParams.heroSkinParam.skinId = skinId; eventParams.heroSkinParam.isCanCharge = true; eventParams.commonUInt64Param1 = this._curFriendUid; eventParams.commonBool = this._curFriendIsSns; eventParams.commonUInt32Param1 = this._curWorldId; component3.SetUIEvent(enUIEventType.Click, enUIEventID.HeroSkin_OpenBuyHeroSkinForFriend, eventParams); CUI3DImageScript component4 = cUIFormScript.transform.Find("Panel/3DImage").gameObject.GetComponent <CUI3DImageScript>(); ObjNameData heroPrefabPath = CUICommonSystem.GetHeroPrefabPath(heroId, (int)skinId, true); GameObject gameObject2 = component4.AddGameObject(heroPrefabPath.ObjectName, false, false); if (gameObject2 != null) { if (heroPrefabPath.ActorInfo != null) { gameObject2.transform.localScale = new Vector3(heroPrefabPath.ActorInfo.LobbyScale, heroPrefabPath.ActorInfo.LobbyScale, heroPrefabPath.ActorInfo.LobbyScale); } DynamicShadow.EnableDynamicShow(component4.gameObject, true); CHeroAnimaSystem instance = Singleton <CHeroAnimaSystem> .GetInstance(); instance.Set3DModel(gameObject2); instance.InitAnimatList(); instance.InitAnimatSoundList(heroId, skinId); instance.OnModePlayAnima("Come"); } }
private void onCloseSettle(CUIEvent uiEvent) { DynamicShadow.DisableAllDynamicShadows(); uint dwConfValue = GameDataMgr.globalInfoDatabin.GetDataByKey((uint)0x36).dwConfValue; SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext(); DebugHelper.Assert(curLvelContext != null, "Battle Level Context is NULL!!"); if ((dwConfValue != 0) && (curLvelContext.iLevelID != AdvanceGuideLevelID)) { Singleton <CUIManager> .instance.OpenForm("UGUI/Form/System/Newbie/Form_Intro_3V3.prefab", false, true); } else { this.CloseSettle(); } }
public static void EnableDynamicShow(GameObject go, bool enable) { if (go == null) { return; } if (enable && !GameSettings.IsHighQuality) { return; } DynamicShadow[] componentsInChildren = go.GetComponentsInChildren <DynamicShadow>(); if (componentsInChildren == null || componentsInChildren.Length == 0) { return; } for (int i = 0; i < componentsInChildren.Length; i++) { DynamicShadow dynamicShadow = componentsInChildren[i]; if (enable) { dynamicShadow.InitShadow(); if (!DynamicShadow.shadowList.Contains(dynamicShadow)) { DynamicShadow.shadowList.Add(dynamicShadow); } } else { dynamicShadow.CloseShadow(); DynamicShadow.shadowList.Remove(dynamicShadow); } } if (enable) { Shader.EnableKeyword("_SGAME_HEROSHOW_SHADOW_ON"); } else if (DynamicShadow.shadowList.Count == 0) { Shader.DisableKeyword("_SGAME_HEROSHOW_SHADOW_ON"); } }