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()
    {
        
    }
}
相关推荐
feiduoge9 小时前
教程 44 - 相机系统
windows·游戏引擎·图形渲染
lrh302513 小时前
Custom SRP - 16 Render Scale
3d·unity·srp·render pipeline·render scale
feiduoge16 小时前
教程 43 - 渲染目标和可配置渲染通道
windows·游戏引擎·图形渲染
ellis197021 小时前
Unity出安卓包知识点汇总
android·unity
DoomGT21 小时前
Audio - UE5中的音效播放重启问题
游戏·ue5·游戏引擎·虚幻·虚幻引擎
一线灵1 天前
Axmol 开发环境快速搭建指南 (新)
游戏引擎
一线灵1 天前
跨平台游戏引擎 Axmol-2.11.0 发布
游戏引擎
Robot侠1 天前
ROS1从入门到精通 2:ROS1核心概念详解(节点、话题、服务一网打尽)
unity·游戏引擎·ros·机器人操作系统
世洋Blog2 天前
装饰器模式实践:告别臃肿的继承链,优雅解耦初始化状态管理
unity·设计模式·c#·装饰器模式
feiduoge2 天前
教程 41 - 增强纹理映射(采样器)
windows·游戏引擎·图形渲染