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()
    {
        
    }
}
相关推荐
雪下的新火1 天前
Blender-一个简单的水
游戏引擎·blender·特效制作·笔记分享
黄思搏1 天前
Unity坐标转换指南 - 3D与屏幕UI坐标互转
ui·3d·unity
weixin_424294672 天前
在 Unity 游戏开发中,为视频选择 VP8 还是 H.264
unity·游戏引擎
一步一个foot-print2 天前
【Unity】Light Probe 替代点光源给环境动态物体加光照
unity·游戏引擎
@LYZY2 天前
Unity 中隐藏文件规则
unity·游戏引擎·游戏程序·vr
霜绛2 天前
C#知识补充(二)——命名空间、泛型、委托和事件
开发语言·学习·unity·c#
Sator13 天前
使用Unity ASE插件设置数值不会生效的问题
unity·游戏引擎
AA陈超3 天前
虚幻引擎5 GAS开发俯视角RPG游戏 P07-08 点击移动
c++·游戏·ue5·游戏引擎·虚幻
程序猿追3 天前
轻量级云原生体验:在OpenEuler 25.09上快速部署单节点K3s
人工智能·科技·机器学习·unity·游戏引擎
B0URNE3 天前
【Unity基础详解】(7)Unity核心:动画系统
unity·游戏引擎