Tag:unity

  • Unity realizes virtual rocker

    Time:2021-1-5

    This example for you to share the unity of virtual rocker specific code, for your reference, the specific content is as follows Set some properties on the panel, such as the drag distance of the rocker, whether it is always visible, and whether it limits the position of the virtual rocker (I limit the virtual […]

  • Unity realizes virtual rocker effect

    Time:2021-1-1

    This example for you to share the unity virtual rocker effect of the specific code, for your reference, the specific content is as follows First add both images From left to right are back and front Put the front in the center of the backAdd script to front using System.Collections; using System.Collections.Generic; using UnityEngine; using […]

  • Unity realizes simple virtual rocker

    Time:2020-12-29

    Recently, we have been using ugui to make virtual rocker. The common practice on the Internet is to use the following code, but there are some precautions,The first point is that canvas’s render mode must be screen space overlay. The second point is that X and y of the anchor where the script is mounted […]

  • Virtual joystick control by unity

    Time:2020-12-22

    In this paper, we share the specific code of unity to realize virtual rocker control for your reference. The specific content is as follows using UnityEngine; using UnityEngine.UI; public class TouchJoystick : MonoBehaviour { Public GameObject go; // the target object that needs to be controlled through the virtual rocker Public float movespeed = 3; […]

  • Realization method of unity virtual rocker

    Time:2020-12-21

    In this paper, we share the specific code of unity virtual rocker for your reference. The specific content is as follows Set the anchor points for the background image of the rocker as follows: Set the anchor of the rocker as the center of the background image. And bind the rocker with the following script: […]

  • Unity uses scrollrect to make a rocker

    Time:2020-12-19

    In this paper, we share the specific code of unity using scrollrect to make rocker for your reference. The specific content is as follows 1、 Preface In game development, rocker function is very common, unity ugui providesScrollRectComponent, which is very suitable for making rocker. The effect is as follows: 2、 Implementation 1. Making UI As […]

  • Unity realizes UI gradient effect

    Time:2020-12-18

    In this paper, we share the specific code of unity to achieve UI gradient effect for your reference. The specific content is as follows In the backpack system, in the prompt panel to achieve more cool point, decided to use the gradient effect to prompt the grade The gradient effect is achieved by changing the […]

  • Unity realizes UI fade out effect

    Time:2020-12-17

    In this paper, we share the specific code of unity to achieve the effect of UI fade out for your reference. The specific content is as follows 1. Add component on UI object: Canvas group; 2. Adding scripts on objects: UI_ Fadeinfadeout script; Script information: (blocks raycasts = true can interact; blocks raycasts = false […]

  • Unity realizes page turning button function

    Time:2020-12-14

    In this paper, we share the specific code of unity to realize the page turning button function for your reference. The specific content is as follows design sketch: UI child parent relationship: Code also has added comments, do not understand can private letter me. The object pool is used in the script. I didn’t upload […]

  • Unity realizes the effect of guide page

    Time:2020-12-13

    The specific examples of unity are as follows design sketch: 1. Create a canvas, set rendermode = screenspace overlay, uiscalemode = scalewithscreensize, ReferenceResolution(x=1080,y=1920) 2. Create a rawimage named (parentgoimg) and set as follows 3. Create several rawimages under parentgoimg, give the images you want to show, and set the following settings 4. Add the following […]

  • Unity realizes QQ screenshot function

    Time:2020-12-12

    This example for you to share unity QQ screenshot function specific code, for your reference, the specific content is as follows effect: The code is as follows: using System.Collections; using System.Collections.Generic; using System.Text.RegularExpressions; using UnityEngine; using NPinyin; using System.IO; public class NewBehaviourScript : MonoBehaviour { //Where the screen shot ends private Vector3 e_pos; //Draw or […]

  • Unity to achieve full screen shots and QQ screenshots

    Time:2020-12-10

    In this paper, we share the full screen screenshot of unity and QQ of unity for your reference. The specific contents are as follows Full screen capture: to achieve this, click the left mouse button to achieve the screenshot, and save the intercepted image to the streamingassets folder under the local assets directory. The code […]