本文整理汇总了C#中UIMouseEventParameter类的典型用法代码示例。如果您正苦于以下问题:C# UIMouseEventParameter类的具体用法?C# UIMouseEventParameter怎么用?C# UIMouseEventParameter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UIMouseEventParameter类属于命名空间,在下文中一共展示了UIMouseEventParameter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckBoxChanged
public void CheckBoxChanged(UIComponent c, UIMouseEventParameter p)
{
UICheckBox cb = c as UICheckBox;
bAutosaveEnabled = cb.isChecked;
timer = autoSaveInterval * 60;
updateLabel(bAutosaveEnabled, autoSaveInterval);
}
示例2: ButtonClick
private void ButtonClick(UIComponent uiComponent, UIMouseEventParameter eventParam) {
if (!_uiShown) {
Show();
} else {
Close();
}
}
示例3: ButtonWhatsNew_eventClicked
private void ButtonWhatsNew_eventClicked(UIComponent component, UIMouseEventParameter eventParam)
{
if(whatsNewPanel != null)
{
whatsNewPanel.Show();
whatsNewPanel.BringToFront();
}
}
示例4: clickSwitchTraffic
private void clickSwitchTraffic(UIComponent component, UIMouseEventParameter eventParam) {
if (TrafficLightTool.getToolMode() != ToolMode.SwitchTrafficLight) {
_buttonSwitchTraffic.focusedBgSprite = "ButtonMenuFocused";
TrafficLightTool.SetToolMode(ToolMode.SwitchTrafficLight);
} else {
_buttonSwitchTraffic.focusedBgSprite = "ButtonMenu";
TrafficLightTool.SetToolMode(ToolMode.None);
}
}
开发者ID:akira-ishizaki,项目名称:Cities-Skylines-Traffic-Manager-President-Edition,代码行数:9,代码来源:UITrafficManager.cs
示例5: OnClick
protected void OnClick(UIComponent comp, UIMouseEventParameter p)
{
p.Use();
UIButton uIButton = comp as UIButton;
if (uIButton != null && uIButton.parent == this.m_strip)
{
}
}
示例6: BottomLabel_eventClicked
private void BottomLabel_eventClicked(UIComponent component, UIMouseEventParameter eventParam)
{
if (RoadNamerManager.Instance().HaveMod())
{
bool blah = RoadNamerManager.Instance().populateObjects();
DebugOutputPanel.AddMessage(ColossalFramework.Plugins.PluginManager.MessageType.Message, string.Format("stuff. {0}",blah ));
}
//Steam.ActivateGameOverlayToWebPage("https://www.reddit.com/r/Cimtographer");
}
示例7: ButtonGenerate_eventClicked
private void ButtonGenerate_eventClicked(UIComponent component, UIMouseEventParameter eventParam)
{
try
{
OSMExportNew osmExporter = new OSMExportNew();
osmExporter.Export();
buttonGenerate.text = "Generate OSM map";
}
catch
{
buttonGenerate.text = "Export failed!";
}
}
示例8: uiButton_eventClick
private void uiButton_eventClick(UIComponent component, UIMouseEventParameter eventParam)
{
if (!this.buildingWindow.isVisible)
{
this.buildingWindow.isVisible = true;
this.buildingWindow.BringToFront();
this.buildingWindow.Show();
}
else
{
this.buildingWindow.isVisible = false;
this.buildingWindow.Hide();
}
}
示例9: OnClick
public new void OnClick(UIComponent comp, UIMouseEventParameter p)
{
UIButton uiButton = p.source as UIButton;
int byIndex = this.GetByIndex((UIComponent)uiButton);
if (byIndex == -1)
return;
this.SelectByIndex(byIndex);
Texture2D texture2D = uiButton.objectUserData as Texture2D;
var brushesContainer =
(UIScrollablePanel)typeof(BrushOptionPanel).GetField("m_BrushesContainer", BindingFlags.NonPublic | BindingFlags.Instance)
.GetValue(this);
if (!((UnityEngine.Object)uiButton.parent == (UnityEngine.Object)brushesContainer) || !((UnityEngine.Object)texture2D != (UnityEngine.Object)null))
return;
TerrainTool tool1 = ToolsModifierControl.GetTool<TerrainTool>();
if ((UnityEngine.Object)tool1 != (UnityEngine.Object)null)
tool1.m_brush = texture2D;
TreeTool tool2 = ToolsModifierControl.GetTool<TreeTool>();
if ((UnityEngine.Object)tool2 != (UnityEngine.Object)null)
tool2.m_brush = texture2D;
ResourceTool tool3 = ToolsModifierControl.GetTool<ResourceTool>();
if ((UnityEngine.Object)tool3 != (UnityEngine.Object)null)
tool3.m_brush = texture2D;
PropTool tool4 = ToolsModifierControl.GetTool<PropTool>();
if ((UnityEngine.Object)tool4 == (UnityEngine.Object)null)
{
tool4.m_brush = texture2D;
}
//begin mod
try
{
Plugins.SetBrush(texture2D);
}
catch (Exception e)
{
UnityEngine.Debug.LogException(e);
}
//end mod
}
示例10: ClickToggleDespawn
private static void ClickToggleDespawn(UIComponent component, UIMouseEventParameter eventParam)
{
LoadingExtension.Instance.DespawnEnabled = !LoadingExtension.Instance.DespawnEnabled;
if (!LoadingExtension.PathfinderIncompatibility)
{
_buttonToggleDespawn.text = LoadingExtension.Instance.DespawnEnabled
? "Disable despawning"
: "Enable despawning";
}
}
示例11: ClickLaneRestrictions
protected virtual void ClickLaneRestrictions(UIComponent component, UIMouseEventParameter eventParam)
{
if (_uiState != UIState.LaneRestrictions)
{
_uiState = UIState.LaneRestrictions;
_buttonLaneRestrictions.focusedBgSprite = "ButtonMenuFocused";
TrafficLightTool.SetToolMode(ToolMode.LaneRestrictions);
}
else
{
_uiState = UIState.None;
_buttonLaneRestrictions.focusedBgSprite = "ButtonMenu";
TrafficLightTool.SetToolMode(ToolMode.None);
}
}
示例12: MouseMoved
void MouseMoved(UIComponent component, UIMouseEventParameter eventParam)
{
Vector2 pos;
component.GetHitPosition(eventParam.ray, out pos);
Vector2 center = new Vector2(30, 30);
float angle = Vector2.Angle(new Vector3(0, 30), pos - center);
if (pos.x > center.x)
angle = 360.0f - angle;
float time = (angle * 12.0f) / 180.0f;
//Debug.Log("Mouse moved on zoom button");
//Debug.Log("Angle =" + angle);
//Debug.Log("Time = " + time);
//Debug.Log("Button: " + eventParam.buttons);
if (eventParam.buttons == UIMouseButton.Right)
sunControl.TimeOfDay = time;
}
示例13: NameRoadButton_eventClicked
private void NameRoadButton_eventClicked(UIComponent component, UIMouseEventParameter eventParam)
{
SetRoadData();
}
示例14: TabButton_eventClicked
private void TabButton_eventClicked(UIComponent component, UIMouseEventParameter eventParam)
{
ToolController toolController = ToolsModifierControl.toolController;
if (toolController != null)
{
if (toolController.GetComponent<RoadSelectTool>() == null)
{
ToolsModifierControl.toolController.gameObject.AddComponent<RoadSelectTool>();
//I stole this from Traffic++ for now, until I can figure some things out. Quick fix!
FieldInfo toolControllerField = typeof(ToolController).GetField("m_tools", BindingFlags.Instance | BindingFlags.NonPublic);
if (toolControllerField != null)
toolControllerField.SetValue(toolController, toolController.GetComponents<ToolBase>());
FieldInfo toolModifierDictionary = typeof(ToolsModifierControl).GetField("m_Tools", BindingFlags.Static | BindingFlags.NonPublic);
if (toolModifierDictionary != null)
toolModifierDictionary.SetValue(null, null); // to force a refresh
}
RoadSelectTool roadSelectTool = ToolsModifierControl.SetTool<RoadSelectTool>();
if (roadSelectTool == null)
{
LoggerUtilities.Log("Tool failed to initialise!");
}
else
{
roadSelectTool.m_roadNamePanel = m_roadNamePanel;
}
}
}
示例15: OnButtonClick
private void OnButtonClick (UIComponent uiComponent,
UIMouseEventParameter mouseEventParam)
{
// Get the global TreeManager singleton.
if (!Singleton<TreeManager>.exists) {
Util.Log("TreeManager doesn't exist for some reason.");
return;
}
var tm = Singleton<TreeManager>.instance;
Util.Log("TreeManager count: " + tm.m_treeCount.ToString());
/*
So here's how trees in Cities: Skylines are stored.
First, take a look at these three bare-bones "documentation" pages:
- https://github.com/cities-skylines/Assembly-CSharp/wiki/TreeManager
- https://github.com/cities-skylines/Assembly-CSharp/wiki/TreeInstance
- https://github.com/cities-skylines/Assembly-CSharp/wiki/Array32%601
TreeManager - or rather Singleton<TreeManager>.instance - keeps an Array32
of TreeInstance objects (m_trees). Each tree is referred to by its index
number in this Array32, with 0 meaning it doesn't exist. Unfortunately,
Array32 is a sparse array that doesn't let us iterate over its items.
Fortunately, looping over each possible index and checking the x/z coords
against 0 does find all the trees with little to no problem.
TreeManager also stores a 540x540 grid of tree indices (m_treeGrid), and
each TreeInstance seems to hold an index to the "next" tree in its grid
position (m_nextGridTree), but this isn't really useful for what I'm doing.
*/
var trees = tm.m_trees;
var treeEntries = new TreeEntry[tm.m_treeCount];
var toRemove = new uint[tm.m_treeCount];
uint treeEntryCount = 0;
uint toRemoveCount = 0;
for (uint i=1; i < trees.m_size; i++) {
short x = trees.m_buffer[i].m_posX;
short z = trees.m_buffer[i].m_posZ;
if (x != 0 || z != 0) {
// Search through treeEntries for an entry with the same
// x and z values.
bool treeEntryMatched = false;
for (uint j=0; j < treeEntryCount; j++) {
if (treeEntries[j].x == x && treeEntries[j].z == z) {
treeEntryMatched = true;
break;
}
}
// If the tree does overlap with one we've already found,
// queue it up for removal. If not, add it to treeEntries.
if (treeEntryMatched) {
toRemove[toRemoveCount] = i;
toRemoveCount++;
} else {
treeEntries[treeEntryCount].id = i;
treeEntries[treeEntryCount].x = x;
treeEntries[treeEntryCount].z = z;
treeEntryCount++;
}
}
}
Util.Log(treeEntryCount.ToString() + " single trees found.");
Util.Log(toRemoveCount.ToString() + " duplicate trees found.");
if (toRemoveCount > 0) {
var oldCount = tm.m_treeCount;
for (uint i=0; i < toRemoveCount; i++) {
tm.ReleaseTree(toRemove[i]);
}
var newCount = tm.m_treeCount;
if (oldCount == newCount) {
Util.Log("Failed to remove the duplicate trees.");
} else {
if (newCount == treeEntryCount) {
Util.Log(toRemoveCount.ToString() +
" trees removed successfully.");
} else {
Util.Log("Something went wrong.");
Util.Log("oldCount = " + oldCount.ToString());
Util.Log("newCount = " + newCount.ToString());
}
}
}
}