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 小时前
unity发布web嵌入到前端页面的接受参数
前端·unity·webgl
HH‘HH1 小时前
Unity 打包程序设置及注意事项全攻略
unity·游戏引擎
fqbqrr5 小时前
2607d,parin游戏引擎
游戏引擎·d
qq_170264755 小时前
unity里 Burst的用法
unity·游戏引擎
HH‘HH9 小时前
Unity 相机与光照调整:从基础到进阶的实战指南
unity
HH‘HH1 天前
Unity引擎界面各个功能面板详细介绍
unity·游戏引擎
℡枫叶℡1 天前
Unity 2D资产命名常用缩写
unity·资产命名缩写
丁小未1 天前
Unity AssetBundle商业化项目资源方案
unity·游戏引擎·assetbundle·unity框架
unityのkiven1 天前
通过 Unity 实现杀戮尖塔2式卡牌系统与机制
unity·游戏引擎
郝学胜-神的一滴1 天前
中级OpenGL教程 020:巧用数组与循环实现多点点光源渲染,告别冗余代码重构方案
c++·unity·游戏引擎·godot·图形渲染·unreal