Tag:unity

  • Unity custom editor interface (inspector interface)

    Time:2021-8-2

    In the process of development, you often need to add some buttons in the component to perform some custom operations. For example, you have a component A with a list < collider >, in which you want to store all collider data in the current scene. Then you will write a method find in component […]

  • Example of alternative implementation of unity screen snowflake

    Time:2021-7-24

    Today is Christmas Eve. For this reason, we have specially made a scene of snowflakes falling. Our snowflake rendering method is different from the popular online use of camera filter. We need to hang the script on the camera, but we hang it on the empty object. The implementation method adopts custom mesh, which can […]

  • Unity3d mobile terminal realizes shake function

    Time:2021-7-15

    The mobile phone shake function is a common requirement in the normal project development, and it can be easily realized by using the gravity sensing of unity. Unity simplifies the development of gravity sensing,   Access the input. Acceleration property to retrieve the value of the acceleration sensor. First, let’s look at the direction of […]

  • Unity UI or 3D scene to realize the shaking effect following the gyroscope of mobile phone

    Time:2021-7-14

    demand When the game displays the 3D scene and its UI. When the player shakes the mobile phone left and right, the UI interface will move left and right. As you move up and down, the 3D scene moves up and down. When the mobile phone stops shaking, if the UI or scene is shifted, […]

  • Unity ugui controls character movement through rocker

    Time:2021-7-12

    This example for you to share the unity ugui through the rocker control role movement of the specific code, for your reference, the specific content is as follows Simple version: control the movement of the box. Advanced version: control the movement of characters Knowledge foreshadowing: First of all, we have to know that in unity’s […]

  • Unity ongui real time display game FPS

    Time:2021-7-9

    What is FPS? FPS (frames per second) [from Baidu Encyclopedia] FPS is the definition in the field of image, which refers to the number of frames transmitted per second. Generally speaking, it refers to the number of animation or video frames. FPS measures the amount of information used to save and display dynamic video. The […]

  • Unit custom pop up function

    Time:2021-6-30

    This example for you to share the unity custom pop-up box specific method, for your reference, the specific content is as follows 1、 The construction of pop-up box The layout is as follows: message is the parent object, and uimessage code is added. The panel is the mask. Message box is the whole prompt box, […]

  • Unity uses camera to achieve telescope effect

    Time:2021-6-22

    In this paper, we share the specific code of unity using camera to achieve telescope effect for your reference. The specific content is as follows It sounds cool. In fact, it’s super simple, which is to control the fieldofview of the camera using UnityEngine; using System.Collections; public class TelesopicView : MonoBehaviour { public float zoomLevel […]

  • Unity shader to achieve more complete lighting effect

    Time:2021-6-14

    This example for you to share the unity shader to achieve lighting effect of the specific code, for your reference, the specific content is as follows design sketch: The shader is attached to the ball. The light needs to turn on shadows in the property panel. // Upgrade NOTE: replaced ‘mul(UNITY_MATRIX_MVP,*)’ with ‘UnityObjectToClipPos(*)’ Shader “Unlit/lightFull” […]

  • Unity shader realizes the effect of turning books

    Time:2021-6-9

    Today, we will achieve a simple effect of turning books. Let’s not say much about it. Let’s first draw an effect picture Here is a random texture, we still call it “turning the board”, ha ha. Implementation process: In fact, it’s quite simple to realize this effect. The general idea is thatLet all the vertices […]

  • Unity shader to achieve blinds effect

    Time:2021-6-7

    In this paper, we share the specific code of unity shader shutter display for your reference, and the specific content is as follows 1. Divide the picture into horizontal n columns, and the code is as follows: Shader “Unlit/BYCShader” { Properties { [PerRendererData] _MainTex (“Sprite Texture”, 2D) = “white” {} _Color (“Tint”, Color) = (1,1,1,1) […]

  • Unity UI drag and drop model selection function

    Time:2021-4-29

    Specify an area, and drag the area with the mouse or finger of the player. The model will be offset and used to select characters and props Define some properties for the model using System.Collections; using System.Collections.Generic; using UnityEngine; public class UIModelUtil : MonoBehaviour { public Animator animator; public int id; public int index; } […]