本文整理汇总了C#中ApplicationLauncherButton类的典型用法代码示例。如果您正苦于以下问题:C# ApplicationLauncherButton类的具体用法?C# ApplicationLauncherButton怎么用?C# ApplicationLauncherButton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ApplicationLauncherButton类属于命名空间,在下文中一共展示了ApplicationLauncherButton类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitAppLauncherButton
internal ApplicationLauncherButton InitAppLauncherButton()
{
btnAppLauncher = null;
try
{
btnAppLauncher = ApplicationLauncher.Instance.AddModApplication(
onAppLaunchToggleOn, onAppLaunchToggleOff,
onAppLaunchHoverOn, onAppLaunchHoverOff,
null, null,
ApplicationLauncher.AppScenes.ALWAYS,
texButton);
//AppLauncherButtonMutuallyExclusive(settings.AppLauncherMutuallyExclusive);
//btnAppLauncher = ApplicationLauncher.Instance.AddApplication(
// onAppLaunchToggleOn, onAppLaunchToggleOff,
// onAppLaunchHoverOn, onAppLaunchHoverOff,
// null, null,
// (Texture)Resources.texAppLaunchIcon);
//btnAppLauncher.VisibleInScenes = ApplicationLauncher.AppScenes.FLIGHT;
}
catch (Exception ex)
{
MonoBehaviourExtended.LogFormatted("AppLauncher: Failed to set up App Launcher Button\r\n{0}", ex.Message);
btnAppLauncher = null;
}
return btnAppLauncher;
}
示例2: CreateButtons
private void CreateButtons()
{
if (this.buildButton == null && (HighLogic.LoadedScene == GameScenes.EDITOR || HighLogic.LoadedScene == GameScenes.SPH))
{
this.buildButton = ApplicationLauncher.Instance.AddModApplication(
this.BuildOn,
this.BuildOff,
null,
null,
null,
null,
ApplicationLauncher.AppScenes.ALWAYS,
texture
);
}
if (this.flightButton == null && HighLogic.LoadedScene == GameScenes.FLIGHT)
{
this.flightButton = ApplicationLauncher.Instance.AddModApplication(
this.FlightOn,
this.FlightOff,
null,
null,
null,
null,
ApplicationLauncher.AppScenes.ALWAYS,
texture
);
}
}
示例3: OnDestroy
internal void OnDestroy()
{
if (orbLogButton == null)
return;
ApplicationLauncher.Instance.RemoveModApplication(orbLogButton);
orbLogButton = null;
}
示例4: Awake
public void Awake()
{
if (HighLogic.LoadedScene == GameScenes.FLIGHT)
{
DontDestroyOnLoad(this);
Settings.Load();
InvokeRepeating("RunSave", interval, interval);
if (ToolbarManager.ToolbarAvailable)
{
button = ToolbarManager.Instance.add("CrewManifest", "CrewManifest");
button.TexturePath = "CrewManifest/Icons/IconOff_24";
button.ToolTip = "Crew Manifest";
button.Visibility = new GameScenesVisibility(GameScenes.FLIGHT);
button.OnClick += onButtonClick;
}
//if (appButton == null && Settings.AppLauncher)
if (appButton == null)
{
appButton = ApplicationLauncher.Instance.AddModApplication(
onButtonClick, onButtonClick,
null, null,
null, null,
ApplicationLauncher.AppScenes.ALWAYS,
offTexture);
}
}
}
示例5: Update
public void Update()
{
if (buttonAppLaunch == null)
{
if (ApplicationLauncher.Ready)
{
if (texAppLaunch == null)
{
texAppLaunch = new Texture2D(38, 38, TextureFormat.RGBA32, false);
texAppLaunch.LoadImage(System.IO.File.ReadAllBytes(System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "applaunch.png")));
}
buttonAppLaunch = ApplicationLauncher.Instance.AddModApplication(
ExtendHeap,
ExtendHeap,
null,
null,
null,
null,
ApplicationLauncher.AppScenes.ALWAYS,
texAppLaunch
);
buttonAppLaunch.SetFalse(false);
}
else
{
Trace("ApplicationLauncher is not ready in Update");
}
}
}
示例6: Unregister
public void Unregister()
{
IsRegistered = false;
var launcher = ApplicationLauncher.Instance;
launcher.RemoveModApplication(m_Button);
m_Button = null;
}
示例7: StateFundingApplicationLauncher
public StateFundingApplicationLauncher()
{
View = new StateFundingHubView ();
Texture2D Image = new Texture2D (2, 2);
Image.LoadImage (File.ReadAllBytes ("GameData/StateFunding/assets/cashmoney.png"));
Button = ApplicationLauncher.Instance.AddModApplication (onTrue, onFalse, onHover, onHoverOut, onEnable, onDisable, ApplicationLauncher.AppScenes.SPACECENTER, Image);
}
示例8: Add
/// <summary>
/// Adds the button to the KSP toolbar.
/// </summary>
public void Add()
{
// _logger.Trace("Add");
if (_button != null) {
_logger.Debug("Button already added");
return;
}
var texture = new Texture2D(38, 38, TextureFormat.ARGB32, false);
var iconStream = Assembly.GetExecutingAssembly ().GetManifestResourceStream ("ScienceChecklist.icons.icon.png").ReadToEnd ();
texture.LoadImage(iconStream);
texture.Apply();
// _logger.Info("Adding button");
_button = ApplicationLauncher.Instance.AddModApplication(
OnToggleOn,
OnToggleOff,
null,
null,
null,
null,
ApplicationLauncher.AppScenes.SPACECENTER |
ApplicationLauncher.AppScenes.FLIGHT |
ApplicationLauncher.AppScenes.MAPVIEW |
ApplicationLauncher.AppScenes.VAB |
ApplicationLauncher.AppScenes.SPH |
ApplicationLauncher.AppScenes.TRACKSTATION,
texture);
}
示例9: AddAppButton
/// <summary>
/// Coroutine that creates the button in the toolbar. Will wait for the runtime AND the launcher to be ready
/// before creating the button.
/// </summary>
IEnumerator AddAppButton()
{
while (!ApplicationLauncher.Ready || !this.IsReady)
yield return null;
try
{
if (HighLogic.LoadedScene == GameScenes.SPACECENTER)
{
// Load the icon for the button
Texture btnTex = GameDatabase.Instance.GetTexture("DangIt/Textures/appBtn", false);
if (btnTex == null)
throw new Exception("The button texture wasn't loaded!");
appBtn = ApplicationLauncher.Instance.AddModApplication(
onAppBtnToggleOn,
onAppBtnToggleOff,
dummyVoid, // ignore callbacks for more elaborate events
dummyVoid,
dummyVoid,
dummyVoid,
ApplicationLauncher.AppScenes.ALWAYS,
btnTex);
}
}
catch (Exception e)
{
this.Log("Error! " + e.Message);
throw e;
}
}
示例10: removeButton
private void removeButton(GameScenes scene)
{
if (stockToolbarButton != null)
{
ApplicationLauncher.Instance.RemoveModApplication(stockToolbarButton);
stockToolbarButton = null;
}
}
示例11: OnDestroy
internal void OnDestroy()
{
if (orbLogButton == null)
return;
ApplicationLauncher.Instance.RemoveModApplication(orbLogButton);
orbLogButton = null;
GameEvents.onEditorShipModified.Remove(UpdateGUIInfo);
}
示例12: onGUIAppLauncherDestroyed
public void onGUIAppLauncherDestroyed()
{
if (appBtn != null)
{
ApplicationLauncher.Instance.RemoveModApplication(appBtn);
appBtn = null;
}
}
示例13: Start
public static void Start()
{
if (btnLauncher == null)
btnLauncher =
ApplicationLauncher.Instance.AddModApplication(OnToggleTrue, OnToggleFalse, null, null, null, null,
ApplicationLauncher.AppScenes.FLIGHT,
GameDatabase.Instance.GetTexture("KramaxAutoPilot/Icon/AppLauncherIcon", false));
}
示例14: Start
public void Start()
{
showWindow = false;
if (btnLauncher == null)
btnLauncher = ApplicationLauncher.Instance.AddModApplication(() => showWindow = !showWindow, () => showWindow = !showWindow,
null, null, null, null, ApplicationLauncher.AppScenes.SPACECENTER,
GameDatabase.Instance.GetTexture("000_FilterExtensions/Icons/FilterCreator", false));
}
示例15: removeButton
private void removeButton(GameScenes scene)
{
if (SCANappLauncherButton != null)
{
ApplicationLauncher.Instance.RemoveModApplication(SCANappLauncherButton);
SCANappLauncherButton = null;
}
}