Unity Array技巧之快速构建0011,000111形式数组

 时间:2024-11-01 07:24:22

Unity Array技巧之快速构建0011,000111形式数组。本节介绍使用技巧快速构建0011,000111形式的数组,具体如下图

工具/原料

Unity

一、知识要点

1、Mathf.FloorToInt:1)功能简述public 衡痕贤伎static intFloorToInt(floatf);Returns t茑霁酌绡he largest integer smaller to or equal tof.2)使用举例using UnityEngine;using System.Collections;public class ExampleClass : MonoBehaviour { void Example() { Debug.Log(Mathf.FloorToInt(10.0F)); Debug.Log(Mathf.FloorToInt(10.2F)); Debug.Log(Mathf.FloorToInt(10.7F)); Debug.Log(Mathf.FloorToInt(-10.0F)); Debug.Log(Mathf.FloorToInt(-10.2F)); Debug.Log(Mathf.FloorToInt(-10.7F)); }}

二、Array技巧之快速构建0011,000111形式数组

1、打开Unity,新建一个空工程,具体如下图

Unity Array技巧之快速构建0011,000111形式数组Unity Array技巧之快速构建0011,000111形式数组Unity Array技巧之快速构建0011,000111形式数组

6、运行场景,分别按下“A”、“S”和“D”,在控制台Console打印的结果与预期一致,具体如下图

Unity Array技巧之快速构建0011,000111形式数组
  • PS怎样制作描边浮雕美术字
  • pr如何实现三点式的替换操作?
  • Animate如何制作简单的控制小球运动(AS3)
  • AE所有图形快速变回矩形操作方法
  • pr旋转转场怎么做
  • 热门搜索
    云南旅游景点图片 从化旅游网 旅游团网 米胖旅游网 黄龙溪古镇旅游攻略 中国生态旅游 香港长洲岛旅游攻略 广东旅游网 盘锦旅游景点大全 旅游业会计