只允许竖屏: Portrait √ Portrait Upside Down √ Landscape Right × Landscape Left × 只允许横屏: Portrait × Portrait Upside Down × Landscape Right √ Landscape Left √ 代码动态设置屏幕旋转: private void set
我们在做弹窗 或者显示label string的时候经常会用到字体变色 变大 等特殊处理, swift中提供一个函数 NSMutableAttributedString 使用方法简介 var main_string = "Hello World" //定义字符串 var string_to_color = "World" //操作字符串 var range = (main_string as NSString).rangeOfString(string_to_col
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEditor; public class ExportAssetBundles : MonoBehaviour { //在Unity编辑器中添加菜单 [MenuItem("Assets/Build AssetBundle From Selection")] static void ExportResource
本文旨在于简要分析Unity中的两种存档机制,即:PlayerPrefs数据持久化方法及Serialization数据序列化方法 较比与源项目,我另加了JSON方法.XML方法等及一些Unity设置,更便于读者在使用中理解Unity的存档机制.核心脚本为Game.cs 源项目地址:How to Save and Load a Game in Unity - raywenderlich 个人项目地址:BattleSave - SouthBegonia 一.PlayerPrefs 数据持久化方法 存
在unity中写编辑器扩展工具,如在编辑器中加个菜单,点击这个菜单项时执行打包功能. 类如下,其中的静态变量,如果每次进来不清空,则LIST会越来越大,打包函数执行完后系统不会帮我们清空 #if UNITY_EDITOR using System; using System.Collections; using System.Collections.Generic; using System.IO; using UnityEditor; using UnityEngine; using LitJ