unity输出打印小数点位数设置

cs 复制代码
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Run : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        Debug.Log("hello unity");
        print(this.gameObject.transform.position.x); //默认小数位数

        print(this.transform.position.x.ToString("F4"));//修改为5位小数

        print(this.transform.position.ToString("F3"));

    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
相关推荐
心前阳光9 分钟前
Unity之2021.3.45f2c1发布安卓程序遇到的问题
android·unity·游戏引擎
纪纯1 小时前
PicoVR Unity Integration SDK 3.4 常用交互API
unity·游戏引擎·vr·pico
龙智DevSecOps解决方案2 小时前
3A 游戏优化技术栈:如何打通引擎级分析工具与 DevOps 持续集成管线?
unity·性能优化·游戏开发·技术美术·perforce·unrealengine
葛兰岱尔3 小时前
从 SolidWorks 到 Three.js,从 Inventor 到 Unity——制造业CAD模型“几何-语义一体化“转换,不再是天方夜谭!
开发语言·javascript·unity
鼎艺创新科技5 小时前
三维电子沙盘中OSGB倾斜摄影数据的加载与渲染
游戏引擎·cocos2d
玉夏6 小时前
【Shader基础】UV 与纹理采样 Part1
unity·着色器·uv
kyle~6 小时前
Godot开源游戏引擎
开源·游戏引擎·godot
zdr尽职尽责6 小时前
Unity录像功能
学习·ui·unity·游戏引擎
真鬼1236 小时前
【Unity Cursor】AI规矩
unity·游戏引擎
mxwin7 小时前
Unity Shader 深入理解 LinearEyeDepth 与 DepthTexture
unity·游戏引擎