技术栈

unity输出打印小数点位数设置

天人合一peng2023-09-09 10:32
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()
    {
        
    }
}
上一篇:[NLP]LLM--使用LLama2进行离线推理
下一篇:网络分层:构建信息交流的桥梁
相关推荐
ellis1970
2 小时前
Unity中ScriptableObject用法整理
unity
玉梅小洋
6 小时前
Unity Muse 完整使用文档:Sprite+Texture专项
unity·ai·游戏引擎
能源革命
8 小时前
Three.js、Unity、Cesium对比分析
开发语言·javascript·unity
timathy33
1 天前
Unity Addressable 实现Build时自定义剔除资源组
unity·游戏引擎
一种时光
2 天前
Unity 获取当前播放的动画,判断是否是某个动画
unity·游戏引擎
速冻鱼Kiel
2 天前
Lyra的相机系统
笔记·ue5·游戏引擎·虚幻
不绝191
2 天前
Unity入门 :场景叠加/预制体资源包/脚本资源/生命周期函数/Inspector页面
unity·游戏引擎
在路上看风景
2 天前
20. 资源和脚本的绑定关系
unity
yj爆裂鼓手
2 天前
unity对象池
unity·c#
在路上看风景
2 天前
3.7 SRP Batcher
unity
热门推荐
01GitHub 镜像站点02OpenCode 入门教程:介绍 · 安装 · 配置第三方 API (如 Claude)03Claude Code Skills 实用使用手册04Open Code教程(四)| 高级配置与集成05UV安装并设置国内源06Linux下V2Ray安装配置指南07在VSCode配置Java开发环境的保姆级教程(适配各类AI编程IDE)08Antigravity AI编程工具添加和使用Skill完整教程09AI 规范驱动开发“三剑客”深度对比:Spec-Kit、Kiro 与 OpenSpec 实战指南10Labelme从安装到标注:零基础完整指南