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()
    {
        
    }
}
相关推荐
Magnum Lehar30 分钟前
vscode游戏引擎的build-clean配置
ide·vscode·游戏引擎
Magnum Lehar34 分钟前
vscode游戏引擎的build-all全局配置
ide·vscode·游戏引擎
龚子亦1 小时前
【Shader学习】完整光照效果
unity·技术美术·shader
weixin_531638945 小时前
Rokid AR交互开发工具对比
unity·游戏引擎·xr
Magnum Lehar16 小时前
wpf3d游戏引擎ControlTemplate.xaml.cs文件实现
游戏引擎·wpf
留待舞人归16 小时前
【Unity3D优化】优化多语言字体包大小
游戏·unity·游戏引擎·unity3d·优化
wsdchong之小马过河16 小时前
2025虚幻引擎一般用什么模型格式
游戏引擎·虚幻
Magnum Lehar1 天前
wpf游戏引擎前端的Transform.cs实现
前端·游戏引擎·wpf
Magnum Lehar1 天前
wpf3d游戏引擎前端ControlTemplate实现
前端·游戏引擎·wpf
9765033351 天前
iOS 审核 cocos 4.3a【苹果机审的“分层阈值”设计】
flutter·游戏·unity·ios