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()
    {
        
    }
}
相关推荐
淡海水7 小时前
【节点】[Houndstooth节点]原理解析与实际应用
unity·游戏引擎·shadergraph·图形·houndstooth
微:xsooop1 天前
iOS上架被拒4.3(a) 10次到过审历程
flutter·unity·ios·uniapp
DoomGT1 天前
Physics Simulation - Hit Event的触发机制
ue5·游戏引擎·虚幻·虚幻引擎·unreal engine
jtymyxmz1 天前
《Unity Shader》14.1 卡通风格的渲染
unity·游戏引擎
天人合一peng1 天前
unity获得和修改button的text(TMP)
java·前端·unity
dzj20212 天前
Unity中使用LLMUnity遇到的问题(三)——如何配置和使用知识库
unity·llmunity·知识库大模型
Clank的游戏栈2 天前
Unity自动化美术资源校验工具(模型/材质规范检测)技术详解
unity·自动化·材质
Sator12 天前
Unity烘焙光打包后光照丢失问题
unity·光照贴图
Howrun7772 天前
虚幻引擎_核心框架
游戏引擎·虚幻
GLDbalala2 天前
Unity 实现一个简单的构建机
unity·游戏引擎