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()
    {
        
    }
}
相关推荐
冰凌糕12 小时前
Unity3D Shader 法线与基础光照
unity
新手unity自用笔记16 小时前
unity网络基础_1
网络·unity·游戏引擎
谢斯1 天前
[vscode] 使用unity打开vscode的取消.csproj的显示
ide·vscode·unity
魔术师Dix1 天前
StartGame:Unity TDD 外部工程指南
学习·游戏·unity·c#·测试驱动开发
hsw8157739432 天前
第10章 软件架构的演化和维护 — 系统架构设计师
unity·系统架构·游戏引擎
tealcwu2 天前
【尝鲜】Unity 6.7alpha版本测试
unity·游戏引擎
懒狗跑ai的程序员Brain3 天前
如何利用粒子系统在unity制作一个烟花(粒子系统学习向)
学习·unity·游戏引擎