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()
    {
        
    }
}
相关推荐
元气少女小圆丶4 小时前
SenseGlove Nova 2+Unity开发笔记1
笔记·学习·unity
mxwin5 小时前
Unity URP下新技术MSSPT 取代SSR和光线追踪
unity·游戏引擎·shader
LF男男8 小时前
IBuilder.cs 接口
unity
心之所向,自强不息9 小时前
# Unity MCP + Codex CLI 完整教程(Windows)
windows·unity·游戏引擎
KillJUMP10 小时前
GODOT SHADER关键函数
游戏引擎·godot
Oiiouui13 小时前
Godot(4.x): Python处理转换Excel为注入Json
游戏引擎·godot
追光者♂15 小时前
【测评系列3】CSDN AI数字营销实测体验官:测试 开源项目——Superpowers 游戏引擎从零开发实战指南
人工智能·深度学习·机器学习·typescript·开源·游戏引擎·superpowers
小拉达不是臭老鼠16 小时前
Unity数据持久化_Json
学习·unity
heimeiyingwang16 小时前
【架构实战】订单系统架构设计:电商核心系统的演进
unity·架构·系统架构
元气少女小圆丶16 小时前
SenseGlove Nova 2+Unity开发笔记3
笔记·unity·游戏引擎