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()
    {
        
    }
}
相关推荐
新的瑞拉公主5 小时前
Unity游戏发布微信小游戏:从构建到提审
unity·webgl·微信小游戏·开放数据域
狂人开飞机1 天前
14、游戏手感与视觉打磨
游戏·游戏引擎·godot
狂人开飞机1 天前
15、音频系统
游戏引擎·godot
狂人开飞机1 天前
16、粒子线条与视觉特效
游戏引擎·godot
心前阳光2 天前
Unity发布PC软件图标不能改变
unity·游戏引擎
an86950012 天前
unity如何在visual studio中打断点debug
unity·游戏引擎·visual studio
xcLeigh2 天前
Unity基础:使用Transform控制物体移动——Translate与position详解
unity·游戏引擎
FairGuard手游加固2 天前
Unity小游戏加密:global-metadata.dat与AssetBundle保护
游戏·unity·游戏引擎
狂人开飞机2 天前
11、UI系统
游戏引擎·godot
真鬼1232 天前
【Unity AI】Untiy链接cursor与MCP
unity·游戏引擎