Example #1
0
 /// <summary>
 /// 反注册
 /// </summary>
 protected virtual void OnDisable()
 {
     if (EnvironmentSystem.Get())
     {
         EnvironmentSystem.Get().Unregister(this);
     }
 }
Example #2
0
 private void Update()
 {
     if (activeEnv == null)
     {
         var env = EnvironmentSystem.GetOrAlloc().defaultEnvironment;
         SetEnvironment(env);
     }
 }
Example #3
0
        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);
        }
Example #4
0
 /// <summary>
 /// 注册
 /// </summary>
 protected virtual void OnEnable()
 {
     EnvironmentSystem.GetOrAlloc().Register(this);
 }