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()
    {
        
    }
}
相关推荐
一种时光8 小时前
Unity 获取当前播放的动画,判断是否是某个动画
unity·游戏引擎
速冻鱼Kiel10 小时前
Lyra的相机系统
笔记·ue5·游戏引擎·虚幻
不绝19112 小时前
Unity入门 :场景叠加/预制体资源包/脚本资源/生命周期函数/Inspector页面
unity·游戏引擎
在路上看风景12 小时前
20. 资源和脚本的绑定关系
unity
yj爆裂鼓手15 小时前
unity对象池
unity·c#
在路上看风景16 小时前
3.7 SRP Batcher
unity
快乐觉主吖16 小时前
Unity方便修改产品名和包名的小工具
unity·游戏引擎
孟无岐17 小时前
【Laya】HttpRequest 网络请求
网络·typescript·游戏引擎·游戏程序·laya
JIes__1 天前
Unity(二)——MonoBehavior中的重要内容
unity·游戏引擎
孟无岐1 天前
【Laya】LocalStorage 本地存储
typescript·游戏引擎·游戏程序·laya