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()
    {
        
    }
}
相关推荐
程序员JerrySUN17 小时前
Jetson边缘嵌入式实战课程第五讲:Jetson Secure Boot - 安全启动
android·linux·服务器·人工智能·安全·unity·游戏引擎
Zik----17 小时前
Unity 虚拟美术馆漫游系统
unity·vr·虚拟现实
十贺20 小时前
【Unity开发字典】序列化基类
unity·c#·tcp
玄米乌龙茶1231 天前
LLM成长笔记(十三):系统设计与项目实战
笔记·unity·游戏引擎
_Evan_Yao2 天前
游戏和编程两不误:用Unity做一个简单小游戏
后端·游戏·unity·游戏引擎
2601_956002812 天前
钢铁雄心4/Hearts of Iron IV2026官方正版最新版pc免费下载(看到请立即转存 资源随时失效)手机版通用
大数据·游戏·游戏引擎·动画·游戏策划
冰凌糕2 天前
Unity3D Shader 渲染状态详解
unity
郝学胜-神的一滴2 天前
[简化版 GAMES 101] 计算机图形学 10:反走样与深度缓冲核心解析
c++·unity·godot·图形渲染·three.js·unreal engine·opengl
技术探讨者3 天前
极境导表工具 —— 让配置数据成为游戏开发的效率引擎
unity·编辑器·ai编程·游戏策划
游乐码3 天前
Unity基础(六)小案例
游戏·unity·游戏引擎