当前位置: 首页>>代码示例>>C#>>正文


C# UIMouseEventParameter类代码示例

本文整理汇总了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);
 }
开发者ID:iUltimateLP,项目名称:skylines-autosave-countdown,代码行数:7,代码来源:Main.cs

示例2: ButtonClick

		private void ButtonClick(UIComponent uiComponent, UIMouseEventParameter eventParam) {
			if (!_uiShown) {
				Show();
			} else {
				Close();
			}
		}
开发者ID:akira-ishizaki,项目名称:Cities-Skylines-Traffic-Manager-President-Edition,代码行数:7,代码来源:UIBase.cs

示例3: ButtonWhatsNew_eventClicked

 private void ButtonWhatsNew_eventClicked(UIComponent component, UIMouseEventParameter eventParam)
 {
     if(whatsNewPanel != null)
     {
         whatsNewPanel.Show();
         whatsNewPanel.BringToFront();
     }
 }
开发者ID:GRANTSWIM4,项目名称:Cimtographer,代码行数:8,代码来源:ExportPanel.cs

示例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)
            {

            }
        }
开发者ID:Rovanion,项目名称:csl-traffic,代码行数:9,代码来源:RoadCustomizerGroupPanel.cs

示例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");
        }
开发者ID:tony56a,项目名称:Cimtographer,代码行数:12,代码来源:ExportPanel.cs

示例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!";
            }
        }
开发者ID:tony56a,项目名称:Cimtographer,代码行数:14,代码来源:ExportPanel.cs

示例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();
     }
 }
开发者ID:GlitchedMan,项目名称:Cities-Skylines-Mapper,代码行数:14,代码来源:MapperLoading.cs

示例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
 }
开发者ID:earalov,项目名称:Skylines-NaturalResourcesBrush,代码行数:38,代码来源:BrushOptionPanelDetour.cs

示例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";
            }
        }
开发者ID:oczkers,项目名称:Skylines-Traffic-Manager,代码行数:11,代码来源:UITrafficManager.cs

示例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);
            }
        }
开发者ID:oczkers,项目名称:Skylines-Traffic-Manager,代码行数:19,代码来源:UITrafficManager.cs

示例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;
        }
开发者ID:dmantione,项目名称:TimeWarp,代码行数:22,代码来源:ModMain.cs

示例13: NameRoadButton_eventClicked

 private void NameRoadButton_eventClicked(UIComponent component, UIMouseEventParameter eventParam)
 {
     SetRoadData();
 }
开发者ID:GRANTSWIM4,项目名称:RoadNamer,代码行数:4,代码来源:RoadNamePanel.cs

示例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;
                }
            }
        }
开发者ID:tony56a,项目名称:RoadNamer,代码行数:31,代码来源:RoadNamerLoading.cs

示例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());
                    }
                }
            }
        }
开发者ID:WickedA,项目名称:skylines-tree-deduplicator,代码行数:85,代码来源:Main.cs


注:本文中的UIMouseEventParameter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。