本文整理汇总了C#中ApplicationLauncherButton类的典型用法代码示例。如果您正苦于以下问题:C# ApplicationLauncherButton类的具体用法?C# ApplicationLauncherButton怎么用?C# ApplicationLauncherButton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ApplicationLauncherButton类属于命名空间,在下文中一共展示了ApplicationLauncherButton类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:Kerbas-ad-astra,项目名称:KSPTips,代码行数:30,代码来源:AppLauncherWrapper.cs
示例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
);
}
}
开发者ID:CYBUTEK,项目名称:Engineer,代码行数:30,代码来源:StockToolbar.cs
示例3: OnDestroy
internal void OnDestroy()
{
if (orbLogButton == null)
return;
ApplicationLauncher.Instance.RemoveModApplication(orbLogButton);
orbLogButton = null;
}
开发者ID:khr15714n,项目名称:USI-LS,代码行数:7,代码来源:LifeSupportMonitor.cs
示例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);
}
}
}
开发者ID:sarbian,项目名称:CrewManifest,代码行数:29,代码来源:CrewManifestModule.cs
示例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");
}
}
}
开发者ID:Gerry1135,项目名称:PadHeap,代码行数:31,代码来源:HeapExtend.cs
示例6: Unregister
public void Unregister()
{
IsRegistered = false;
var launcher = ApplicationLauncher.Instance;
launcher.RemoveModApplication(m_Button);
m_Button = null;
}
开发者ID:linuxgurugamer,项目名称:Historian,代码行数:7,代码来源:LauncherButton.cs
示例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);
}
开发者ID:iamchairs,项目名称:StateFunding,代码行数:7,代码来源:StateFundingApplicationLauncher.cs
示例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);
}
开发者ID:Simoyd,项目名称:KSP-X-Science,代码行数:34,代码来源:AppLauncherButton.cs
示例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;
}
}
开发者ID:vzwick,项目名称:DangIt,代码行数:36,代码来源:GUI.cs
示例10: removeButton
private void removeButton(GameScenes scene)
{
if (stockToolbarButton != null)
{
ApplicationLauncher.Instance.RemoveModApplication(stockToolbarButton);
stockToolbarButton = null;
}
}
开发者ID:Kerbas-ad-astra,项目名称:CapCom,代码行数:8,代码来源:CC_StockToolbar.cs
示例11: OnDestroy
internal void OnDestroy()
{
if (orbLogButton == null)
return;
ApplicationLauncher.Instance.RemoveModApplication(orbLogButton);
orbLogButton = null;
GameEvents.onEditorShipModified.Remove(UpdateGUIInfo);
}
开发者ID:fat-lobyte,项目名称:USI-LS,代码行数:8,代码来源:LifeSupportMonitor_Editor.cs
示例12: onGUIAppLauncherDestroyed
public void onGUIAppLauncherDestroyed()
{
if (appBtn != null)
{
ApplicationLauncher.Instance.RemoveModApplication(appBtn);
appBtn = null;
}
}
开发者ID:Summerfirefly,项目名称:KSP_GPWS,代码行数:8,代码来源:GUIAppLaunchBtn.cs
示例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));
}
开发者ID:meyerweb,项目名称:KramaxAutoPilot,代码行数:8,代码来源:AppLauncher.cs
示例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));
}
开发者ID:Felbourn,项目名称:FilterExtension,代码行数:8,代码来源:Settings.cs
示例15: removeButton
private void removeButton(GameScenes scene)
{
if (SCANappLauncherButton != null)
{
ApplicationLauncher.Instance.RemoveModApplication(SCANappLauncherButton);
SCANappLauncherButton = null;
}
}
开发者ID:DBT85,项目名称:SCANsat,代码行数:8,代码来源:SCANappLauncher.cs
示例16: RemoveAppButton
public void RemoveAppButton()
{
ApplicationLauncher.Instance.RemoveModApplication (MVPButton);
MapViewPlus.MVPButton = null;
#if DEBUG
Debug.Log ("[MVP] Just called to remove button");
#endif
}
开发者ID:rmpalomino,项目名称:mapviewplus,代码行数:8,代码来源:MapViewPlus.cs
示例17: OnDestroy
public static void OnDestroy()
{
if (btnLauncher != null)
{
ApplicationLauncher.Instance.RemoveModApplication(btnLauncher);
btnLauncher = null;
}
}
开发者ID:meyerweb,项目名称:KramaxAutoPilot,代码行数:8,代码来源:AppLauncher.cs
示例18: Awake
void Awake()
{
var texture = new Texture2D(36, 36, TextureFormat.RGBA32, false);
var textureFile = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "PlanLog.png");
print("Loading " + textureFile);
texture.LoadImage(File.ReadAllBytes(textureFile));
this.planLogButton = ApplicationLauncher.Instance.AddModApplication(GuiOn, GuiOff, null, null, null, null,
ApplicationLauncher.AppScenes.ALWAYS, texture);
}
开发者ID:nanathan,项目名称:Kolonization,代码行数:9,代码来源:PlanetaryLogisticsMonitor.cs
示例19: addButton
IEnumerator addButton()
{
while (!ApplicationLauncher.Ready)
yield return null;
stockToolbarButton = ApplicationLauncher.Instance.AddModApplication(toggle, toggle, null, null, null, null, (ApplicationLauncher.AppScenes)63, CapComSkins.toolbarIcon);
GameEvents.onGUIApplicationLauncherUnreadifying.Add(removeButton);
}
开发者ID:Kerbas-ad-astra,项目名称:CapCom,代码行数:9,代码来源:CC_StockToolbar.cs
示例20: OnGUIAppLauncherDestroyed
void OnGUIAppLauncherDestroyed()
{
if (KSIButton != null)
{
BTOff();
ApplicationLauncher.Instance.RemoveModApplication(KSIButton);
KSIButton = null;
}
}
开发者ID:bbucko,项目名称:KSI-Hiring,代码行数:9,代码来源:KSICore.cs
注:本文中的ApplicationLauncherButton类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论