如果像下面这样写: using UnityEngine;using System.Collections;using UnityEditor;using System.Collections.Generic;using UnityEngine.Assertions.Must;[CustomEditor(typeof(xxxControl))]public class xxxControlEditor : Editor{ SerializedProperty m_a; void OnE
建议33: 不要覆写静态方法 我们知道在Java中可以通过覆写(Override)来增强或减弱父类的方法和行为,但覆写是针对非静态方法(也叫做实例方法,只有生成实例才能调用的方法)的,不能针对静态方法(static修饰的方法,也叫做类方法),为什么呢?我们先看一个例子,代码如下: public class Client { public static void main(String[] args) { Base base = new Sub(); //调用非静态方法 base.doAnythi
建议49: 推荐覆写toString方法 为什么要覆写toString方法,这个问题很简单,因为Java提供的默认toString方法不友好,打印出来看不懂,不覆写不行,看这样一段代码: public class Client { public static void main(String[] args) { System.out.println(new Person("张三")); } } class Person { private String name; public Per
今天小伙伴问我如何自己写一段代码检测 单击 双击 和 拖放.于是就写了这段代码O(∩_∩)O~ 代码如下: using UnityEngine; using System.Collections; public class Test2 : MonoBehaviour { public float oneTime; //检测双击的有效时间 private int downCount; //判断是单击还是双击 private bool currentCheck; //当前正在检测 private b
原文:http://norvig.com/spell-correct.html 翻译:http://blog.youxu.info/spell-correct.html 怎样写一个拼写检查器 Peter Norvig 翻译: Eric You XU 上个星期, 我的两个朋友 Dean 和 Bill 分别告诉我说他们对 Google 的快速高质量的拼写检查工具感到惊奇. 比如说在搜索的时候键入 [speling], 在不到 0.1 秒的时间内, Google 会返回: 你要找的是不是 [spell