/// <summary> /// 反注册 /// </summary> protected virtual void OnDisable() { if (EnvironmentSystem.Get()) { EnvironmentSystem.Get().Unregister(this); } }
private void Update() { if (activeEnv == null) { var env = EnvironmentSystem.GetOrAlloc().defaultEnvironment; SetEnvironment(env); } }
public bool GetEnvironment(out Environment env) { env = null; var envSys = EnvironmentSystem.Get(); if (envSys != null && envSys.GetEnvironment(transform.position, transform.forward, out env)) { return(true); } return(false); }
/// <summary> /// 注册 /// </summary> protected virtual void OnEnable() { EnvironmentSystem.GetOrAlloc().Register(this); }