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()
    {
        
    }
}
相关推荐
JIes__4 小时前
Unity(二)——MonoBehavior中的重要内容
unity·游戏引擎
孟无岐10 小时前
【Laya】LocalStorage 本地存储
typescript·游戏引擎·游戏程序·laya
妙为17 小时前
unreal engine5角色把敌人 “挤飞”
游戏引擎·虚幻·ue·unrealengine5
4Forsee17 小时前
【增强现实】快速上手 Vuforia Unity Android AR 应用开发
android·unity·ar
两水先木示17 小时前
【Unity】对指定物体进行描边——模板测试法
unity·游戏引擎·shader·外描边
Miss_SQ18 小时前
实现Unity录音、百度云语音转文字
unity·语音识别
CreasyChan18 小时前
unity 对象池实测可用
unity·c#
weixin_4242946718 小时前
Unity项目的Artifacts文件夹过大怎么解决?
unity·游戏引擎
没事写写笔记1 天前
Unity HDRP14.0.12 Volume 配置参数
unity
红黑色的圣西罗1 天前
手游手动异形屏适配方案,类“明日方舟”
unity