物体A: public class A:{ B b; void FixedUpdate(){ if(input.GetKeyDow(Keycode.I)) { collider.enable=false; b.lockA=true; } } } 物体B: public class B:{ bool a=false; bool lockA=false; OntriggerExit(){ if(!lockA)debug.log("007");//如果lockA为false,那么打印007
http://www.cnblogs.com/naruto469/p/3608459.html public class Print { 2 3 public Print(String s){ 4 System.out.print(s + " "); 5 } 6 } 1 public class Test1 { 2 3 public static Print obj1 = new Print("1"); 4 5 public Print obj2 = new Pri
本文讨论Java中(静态)变量.(静态)代码块的执行顺序 首先创建3个类: 1.Foo类,用于打印变量 public class Foo { public Foo(String word) { System.out.println(word); } } 2.Parent类 public class Parent { static Foo FOO = new Foo("Parent's static parameter"); Foo foo = new Foo("Parent'