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()
    {
        
    }
}
相关推荐
2501_9151063216 分钟前
Windows 上开发 Unity iOS,使用 KXBuild 进行真机调试、性能采样与打包 ipa
windows·vscode·unity·ios·个人开发·swift·敏捷流程
FFFFujige22 分钟前
【Unity】一个的Dots用Ruhanka踩坑记录
unity·游戏引擎
wgslucky5 小时前
Godot UI管理与使用
游戏引擎·godot
Oiiouui16 小时前
Godot-GridGame架构屏幕UI层
架构·游戏引擎·godot
凯基迪科技20 小时前
Unity游戏加密锁逆向方案、选型与攻防分析
游戏·unity·游戏引擎
阿松爱学习1 天前
【Unity开发】局部区域截图功能实现
unity·c#
淡海水1 天前
08-02-优化-LINQ与函数式编程的GC代价
unity·c#·.netcore·linq·gc
警醒与鞭策2 天前
Codex桌面版与Claude桌面版使用设置
android·unity·ai·性能优化
xcLeigh2 天前
Unity基础:Destroy与DestroyImmediate——正确销毁游戏物体的方式
游戏·unity·游戏引擎·教程
lllhhh_远方2 天前
unity中URP场景阴影锯齿严重解决方案
unity·游戏引擎