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()
    {
        
    }
}
相关推荐
学术小李6 小时前
用虚幻引擎(UE)打开Obj模型
游戏引擎·虚幻
张不无-Unity7 小时前
Unity的四种灯光Directional、Point、Spot 和 Area
unity·游戏引擎
淡海水1 天前
02-02-原理篇-Scriban模板引擎原理深度解析
unity·excel·游戏开发·luban
ttod_qzstudio3 天前
系统架构设计师论文逐句拆解(三):ATAM 架构评估,怎样把“方案比较”写成质量属性权衡
unity·架构·系统架构·软考
小贺儿开发3 天前
Unity 轻量级外部素材加载器(热更新)
科技·学习·unity·程序员·工具·热更新·ugui
淡海水6 天前
01-03-认知篇-基础-Excel配置工作流痛点深度分析
unity·架构·excel·游戏开发·luban
谙弆悕博士6 天前
生物启发式集群(Swarm)工程实现:五条规则、一群蚂蚁和四十个粒子
人工智能·gpt·游戏引擎·cocos2d·蚁群算法·多智能体·boids
Frankie_stand7 天前
无人机售后故障处理全流程:从受理、SLA 时限到责任划分与改进闭环
游戏引擎·无人机·cocos2d
zdr尽职尽责15 天前
UnityCli 兼容2022版本
ui·unity·ai·c#·游戏引擎
ellis197017 天前
Claude Code[二] 上下文相关的机制
unity·ai编程