前言 unity扩展方法的使用 一、为什么要扩展方法 当我们需要重复使用untiy没有的函数方法时,反复的编写代码比较麻烦,这时可以使用扩展方法来一次编写,多次使用 二、使用方法 1.编写方法 首先创建一个脚本,创建一个静态的类: using System.Collections; using System.Collections.Generic; using UnityEngine; public static class GetInt //需要是一个静态的类 {