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()
    {
        
    }
}
相关推荐
feiduoge4 小时前
教程 36 - 方向光照
windows·游戏引擎·图形渲染
怣疯knight5 小时前
Cocos creator判断节点是否能用的方法
unity·cocos2d
tealcwu5 小时前
Google Play的Keystore不可用时的解决方法
unity
呼呼突突6 小时前
Unity使用TouchSocket的RPC
unity·rpc·游戏引擎
qq_4286396118 小时前
虚幻基础:安装插件
游戏引擎·虚幻
qq 1808095120 小时前
从零构建一个多目标多传感器融合跟踪器
unity
平行云21 小时前
实时云渲染支持在网页上运行UE5开发的3A大作Lyra项目
unity·云原生·ue5·webgl·虚拟现实·实时云渲染·像素流送
AA陈超21 小时前
虚幻引擎5 GAS开发俯视角RPG游戏 P07-18.生成火球术
c++·游戏·ue5·游戏引擎·虚幻
鹏飞于天21 小时前
Shader compiler initialization error: Failed to read D3DCompiler DLL file
unity
wonder135791 天前
UGUI重建流程和优化
unity·游戏开发·ugui