public GameObject CreateShellHole(int id) { ShellConfig cfg = Config.ShellCfg[id - 1]; GameObject obj = CreatePrefab(cfg.prefab); return(obj); }
private ShellManager SetupManagedShell() { EnvironmentHelper.IsAppRunningAsShell = NativeMethods.GetShellWindow() == IntPtr.Zero; _logger = new ManagedShellLogger(); ShellConfig config = ShellManager.DefaultShellConfig; config.PinnedNotifyIcons = Settings.Instance.PinnedNotifyIcons; return(new ShellManager(config)); }
public void ReleaseShell(ShellBase shell) { ShellConfig cfg = Config.ShellCfg[shell.ID - 1]; if (shell.Hole != null) { ReleasePrefab(cfg.hole, shell.Hole); } shell.OnDetach(); shell.OnUninit(); ReleasePrefab(cfg.prefab, shell.gameObject); }
internal Dictionary <string, object> GetUpdateDicts(ShellConfig shellConfig) { var dict = new Dictionary <string, object>(); if (!object.Equals(MaxReqSize, shellConfig.MaxReqSize)) { dict.Add($"{ShellConfig.PrefixName}maxReqSize", MaxReqSize); } if (!object.Equals(Port, shellConfig.Port)) { dict.Add($"{ShellConfig.PrefixName}port", Port); } return(dict); }
private ShellManager ConfigureShellManager() { ShellConfig config = new ShellConfig() { EnableTasksService = true, AutoStartTasksService = false, TaskIconSize = (IconSize)Settings.Instance.TaskbarIconSize, EnableTrayService = Settings.Instance.EnableSysTray, AutoStartTrayService = false, PinnedNotifyIcons = Settings.Instance.PinnedNotifyIcons }; return(new ShellManager(config)); }
// 子弹发射 public virtual void Shoot(float speed, float range, int damage, bool back) { State = EnShellState.Flying; // 子弹脱离武器 transform.parent = GameMgr.It.ObjRoot; m_Dir = transform.position - Owner.Owner.transform.position; m_Dir = m_Dir.normalized; ShellConfig cfg = Config.ShellCfg[ID - 1]; m_Speed = cfg.speed + speed; m_Range = cfg.range + range; m_BeginPos = transform.position; m_Damage = damage; // 开始飞行,启动碰撞检测 m_Check = true; }
public ShellBase CreateShell(int weaponid, Transform parent) { WeaponConfig weapon = Config.WeaponCfg[weaponid - 1]; ShellConfig cfg = Config.ShellCfg[weapon.shell - 1]; GameObject obj = CreatePrefab(cfg.prefab); ShellBase shell = obj.GetComponent <ShellBase>(); shell.gameObject.SetActive(true); shell.transform.parent = parent; shell.transform.localPosition = Vector3.zero; shell.transform.localRotation = Quaternion.identity; shell.ID = cfg.id; shell.WeaponID = weaponid; shell.name = "shell_" + cfg.id; shell.OnInit(); return(shell); }