Category:C#

  • GIS vector slicing algorithm (Reprint)

    Time:2020-11-25

    Transferred from: https://www.giserdqy.com/database/postgresql/25838/ For large-scale vector data, due to the large number of types and wide range of data, loading and rendering will cause the platform to be stuck. Therefore, the quadtree index slicing of vector data can efficiently load the current region vector and improve the efficiency. The common vector data is ShapeFile, which […]

  • Unity realizes mouse following (itween)

    Time:2020-11-25

    In this paper, we share the specific code of unity to achieve mouse following for your reference. The specific content is as follows Demand:When the mouse is placed on the cube and then moved away, the cube will follow the mouse. Implementation process: First, create a new plane (white) and cube (black) in the scene. […]

  • . net cross platform framework Avalonia UI: fill the hole and point north (2): run on Linux

    Time:2020-11-24

    Review of the previous chapter: Avalonia UI, a cross platform framework of. Net: filling the hole and pointing to the North (1): familiar with UI operation This article will describe some considerations including but not limited to Avalonia and all windows to Linux cross platform development:   1、 Path problem 1. In normal WPF (and […]

  • Unity realizes mouse point 2D to 3D for rotation

    Time:2020-11-24

    In this paper, we share the specific code of unity to turn 2D mouse to 3D for your reference. The specific content is as follows The code is as follows: using UnityEngine; public class GunFollowMouse : MonoBehaviour { public RectTransform UGUICanvas; public Camera mainCamera; //Slow motion rate of camera rotation private float rotateSpeed = 5; […]

  • The intermediary model of design pattern

    Time:2020-11-23

    Mediator model Intro Mediator pattern, a mediation object is used to encapsulate a series of object interactions.Mediators make the objects do not need to explicitly refer to each other, so that they are loosely coupled and can change their interactions independently. The mediation pattern defines a single (mediation) object to encapsulate the interaction between a […]

  • Unity encapsulates the delay call timer

    Time:2020-11-23

    This paper shares the specific code of unity encapsulation delay call timer for your reference, the specific content is as follows Encapsulates a delay call timer class using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Events; public class WaitTimeManager { private static TaskBehaviour m_Task; static WaitTimeManager() { GameObject go = new GameObject(“#WaitTimeManager#”); GameObject.DontDestroyOnLoad(go); m_Task = go.AddComponent<TaskBehaviour> […]

  • Create your own nuget

    Time:2020-11-22

    Powerful function, learn to create your own nuget In the project, DLL files written by others are used, and the official nuget is quoted Here you will learn to build your own nuget, use your own nuget, you can store your own DLL, where to use it   Step 1: create your own empty web […]

  • Unity scrollrect realizes page turning by page number

    Time:2020-11-22

    In this paper, we share the specific code of unity to achieve page turning effect by page number for your reference. The specific content is as follows Used to do backpack shop page by page function, first on the effect map Among them, dragnum means that if it is 3, the sliding distance exceeds 30% […]

  • Strategy pattern of design pattern

    Time:2020-11-21

    Strategy Intro Strategy: it defines the algorithm family and encapsulates them separately, so that they can be replaced with each other. This mode makes the changes of algorithm not affect the algorithm usedContext。 Policy pattern is a method to define a series of algorithms. From the concept, all these algorithms are the same work, but […]

  • The method of generating gray and white image from pictures by unity

    Time:2020-11-21

    In this paper, we share the specific code of unity to generate gray and white image for your reference. The specific content is as follows effect Original picture The gray and white map is generated Production method Put the end of the article TextureUtils.cs Project scriptAssets / EditorIn the table of contents Then select an […]

  • There are new extension methods under enumerable. Let’s have a look

    Time:2020-11-20

    1: Background 1. Tell a story Some time ago, we upgraded a project of the company from 4.5 to framework 4.8. During coding, we found that there are three extension methods in enumerable:Append, Prepend, ToHashSetFriends who have played jQuery can see the use of these three methods at a glance. This article will talk about […]

  • Unity method of converting pictures into fonts

    Time:2020-11-20

    In this paper, we share the specific code of unity using pictures to generate fonts for your reference. The specific contents are as follows In development, you may need to convert images into fonts. Bmfont plug-in import image Then generate. FNT and. PNG files (file format can be changed in the settings)Import these two files […]