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()
    {
        
    }
}
相关推荐
晓13138 小时前
【Cocos Creator 2.x】篇——第二章 入门
javascript·游戏引擎
nnsix11 小时前
Unity 贴图压缩格式 笔记
笔记·unity·贴图
ysn1111120 小时前
搭建状态同步框架的实践心得
unity·架构
一线灵1 天前
Axmol:小众引擎的硬核逆袭
游戏引擎
weixin_441940011 天前
【Unity教程】使用vuforia创建简单的AR实例
unity·游戏引擎·ar
郝学胜-神的一滴1 天前
[简化版 GAMES 101] 计算机图形学 12:可见性与 Z‑Buffer 深度缓存
unity·godot·图形渲染·three.js·opengl·unreal
归真仙人1 天前
【UE】LineTraceByProfile
ue5·游戏引擎·ue4·unreal engine
游乐码2 天前
Unity基础(十一 )资源同步加载
unity·游戏引擎
LONGZETECH2 天前
汽车仿真教学软件技术实现深度解析:从三维建模到学情数据闭环
c语言·3d·unity·架构·汽车
游乐码2 天前
unity基础(九)协程原理
unity·游戏引擎