public static List <DialogDeploy> GetDrawList(int paragraphId) { var list = new List <DialogDeploy>(); var t = TableUtility.GetTable <DialogDeploy>(); foreach (var d in t) { if (d.paragraphId == paragraphId) { list.Add(d); } } list.Sort((a, b) => { if (a.paragraphId < b.paragraphId) { return(-1); } if (a.paragraphId > b.paragraphId) { return(1); } return(0); }); return(list); }
static Sound() { _audioVolume = 1f; _musicVolume = 1f; _environmentVolume = 1f; _uiVolume = 1f; GlobalMusicVolume = 1f; GlobalAudioVolume = 1f; _soundTableT = TableUtility.GetTable <SoundDeploy>(); }
public static BossDialogDeplpy GetBossDialog(int playerId, int bossId, bool beforeBoss) { var t = TableUtility.GetTable <BossDialogDeplpy>(); foreach (var d in t) { if (d.playerId == playerId && d.bossId == bossId && beforeBoss == d.beforeBoss) { return(d); } } return(null); }
private IEnumerator LoadBullets() { var soringLayerId = UiManager.GetCanvasByLayer(UiLayer.Tips).sortingLayerID; var tab = TableUtility.GetTable <BulletDeploy>(); foreach (var deploy in tab) { if (deploy.id < 1000) { continue; } //ui prefab var bulletObj = ResourceMgr.Instantiate(_component.BulletPrefab); var txtId = bulletObj.GetComponentInChildren <UiText>(); txtId.text = deploy.id.ToString(); bulletObj.transform.SetParent(_component.Grid, false); //createBullet Bullet bullet = null; BulletFactory.CreateBullet(deploy.id, bulletObj.transform, Layers.Ui, b => { bullet = b; }); yield return(new WaitUntil(() => bullet != null)); var localScale = bullet.Renderer.transform.localScale; var ratio = localScale.x * 100; if (ratio > 100) { ratio = 96f / localScale.x; } bullet.Renderer.sortingLayerID = soringLayerId; bullet.transform.localScale = Vector3.one * ratio; bullet.Renderer.transform.SetLayer(Layers.Ui); bullet.transform.SetParent(bulletObj.transform, false); //显示collider var col = new GameObject("collider"); col.transform.SetParent(bullet.transform, false); col.AddComponent <MeshFilter>().sharedMesh = GameSystem.DefaultRes.QuadMesh; col.layer = Layers.Ui; var material = new Material(GameSystem.DefaultRes.CommonShader); material.SetColor("_TintColor", Color.red); material.SetFloat("_AlphaScale", deploy.alpha); var collider = bullet.CollisionInfo; if (!collider.IsBox) { material.mainTexture = GameSystem.DefaultRes.CircleTexture; col.transform.localScale = Vector3.one * collider.Radius * 2; } else { material.mainTexture = GameSystem.DefaultRes.BoxTexture; col.transform.localScale = new Vector3(collider.BoxWidth, collider.BoxHeight, 1); col.transform.localPosition = collider.Center; } var mr = col.AddComponent <MeshRenderer>(); mr.sharedMaterial = material; mr.sortingLayerID = soringLayerId; mr.sortingOrder = bullet.Renderer.sortingOrder + 1; col.SetActiveSafe(_showPoint); _pointList.Add(col); } }
static BulletFactory() { CachePool = new Dictionary<int, Holder>(); BulletTab = TableUtility.GetTable<BulletDeploy>(); }
static TextureEffectFactroy() { CachePool = new Dictionary <int, Holder>(); EffectTab = TableUtility.GetTable <TextureEffectDeploy>(); }