private void Awake() { instance = this; innerBar.type = Image.Type.Filled; innerBar.fillMethod = Image.FillMethod.Horizontal; gameObject.SetActive(false); }
/// <summary> /// Gets the specified <see cref="SharpCraft.BossBar"/>'s visibility value /// </summary> /// <param name="bossBar">the <see cref="SharpCraft.BossBar"/> to get from</param> public void GetVisible(BossBar bossBar) { ForFunction.AddCommand(new BossBarGetValueCommand(bossBar, ID.BossBarValue.visible)); }
/// <summary> /// Gets the specified <see cref="SharpCraft.BossBar"/>'s max value /// </summary> /// <param name="bossBar">the <see cref="SharpCraft.BossBar"/> to get from</param> public void GetMax(BossBar bossBar) { ForFunction.AddCommand(new BossBarGetValueCommand(bossBar, ID.BossBarValue.max)); }
/// <summary> /// Makes the selected players see the specified <see cref="SharpCraft.BossBar"/> /// </summary> /// <param name="bossBar">the <see cref="SharpCraft.BossBar"/> to show</param> /// <param name="players">the <see cref="BaseSelector"/> to use</param> public void SetPlayers(BossBar bossBar, BaseSelector players) { ForFunction.AddCommand(new BossBarChangePlayersCommand(bossBar, players)); }
/// <summary> /// Changes the color of the specified <see cref="SharpCraft.BossBar"/> /// </summary> /// <param name="bossBar">the <see cref="SharpCraft.BossBar"/> to change</param> /// <param name="color">the new color</param> public void SetColor(BossBar bossBar, ID.BossBarColor color) { ForFunction.AddCommand(new BossBarChangeColorCommand(bossBar, color)); }
/// <summary> /// Changes the style of the specified <see cref="SharpCraft.BossBar"/> /// </summary> /// <param name="bossBar">the <see cref="SharpCraft.BossBar"/> to change</param> /// <param name="style">the new style of the <see cref="SharpCraft.BossBar"/></param> public void SetStyle(BossBar bossBar, ID.BossBarStyle style) { ForFunction.AddCommand(new BossBarChangeStyleCommand(bossBar, style)); }
/// <summary> /// Changes if the specified <see cref="SharpCraft.BossBar"/> is visible /// </summary> /// <param name="bossBar">the <see cref="SharpCraft.BossBar"/> to change</param> /// <param name="visible">If it should be visible or not</param> public void SetVisible(BossBar bossBar, bool visible) { ForFunction.AddCommand(new BossBarChangeVisibilityCommand(bossBar, visible)); }
private void InvokeBossBar(BossBar packet) { packetListener.OnBossBar(packet); }
/// <summary> /// Sets the maximum value the specified <see cref="SharpCraft.BossBar"/> can display /// </summary> /// <param name="bossBar">the <see cref="SharpCraft.BossBar"/> to change</param> /// <param name="setTo">the new max value</param> public void SetMax(BossBar bossBar, int setTo) { ForFunction.AddCommand(new BossBarChangeMaxValueCommand(bossBar, setTo)); }
/// <summary> /// Removes the specified <see cref="SharpCraft.BossBar"/> from the world /// </summary> /// <param name="removeThis">the <see cref="SharpCraft.BossBar"/> to remove</param> public void Remove(BossBar removeThis) { ForFunction.AddCommand(new BossBarRemoveCommand(removeThis)); }
/// <summary> /// Intializes a new <see cref="BossBarGetValueCommand"/> /// </summary> /// <param name="bossBar">The boss bar to the value from</param> /// <param name="getValue">The value to get from the boss bar</param> public BossBarGetValueCommand(BossBar bossBar, ID.BossBarValue getValue) { BossBar = bossBar; GetValue = getValue; }
/// <summary> /// Intializes a new <see cref="BossBarAddCommand"/> /// </summary> /// <param name="bossBar">The boss bar to add</param> /// <param name="name">The shown name of the boss bar</param> public BossBarAddCommand(BossBar bossBar, BaseJsonText name) { BossBar = bossBar; Name = name; }
private void Awake() { instance = this; }
public void OnBossBar(BossBar packet) { }
public void OnDestroy() { instance = null; }
/// <summary> /// Changes the specified <see cref="SharpCraft.BossBar"/>'s display name /// </summary> /// <param name="bossBar">the <see cref="SharpCraft.BossBar"/> to change</param> /// <param name="newName">the new display name for the bar</param> public void SetName(BossBar bossBar, BaseJsonText newName) { ForFunction.AddCommand(new BossBarChangeNameCommand(bossBar, newName)); }
/// <summary> /// Intializes a new <see cref="ExecuteStoreBossbar"/> command /// </summary> /// <param name="bossbar">The <see cref="BossBar"/> to store the result in</param> /// <param name="storeAsValue">True if it should store it as the bossbar's value. False if it should store it as it's max value</param> /// <param name="storeResult">True if it should store the result. False if it should store success</param> public ExecuteStoreBossbar(BossBar bossbar, bool storeAsValue, bool storeResult = true) : base(storeResult) { Bossbar = bossbar; StoreAsValue = storeAsValue; }