Ejemplo n.º 1
0
 public void InitializeDebugPlane()
 {
     if (EnvironmentSettings.DEBUG && sceneData.parcels != null && sceneDebugPlane == null)
     {
         sceneDebugPlane = new SceneDebugPlane(sceneData, gameObject.transform);
     }
 }
Ejemplo n.º 2
0
 public void RemoveDebugPlane()
 {
     if (sceneDebugPlane != null)
     {
         sceneDebugPlane.Dispose();
         sceneDebugPlane = null;
     }
 }
Ejemplo n.º 3
0
        public void Cleanup(bool immediate)
        {
            if (isReleased)
            {
                return;
            }

            if (sceneDebugPlane != null)
            {
                sceneDebugPlane.Dispose();
                sceneDebugPlane = null;
            }

            DisposeAllSceneComponents();

            if (DCLCharacterController.i)
            {
                DCLCharacterController.i.characterPosition.OnPrecisionAdjust -= OnPrecisionAdjust;
            }

            if (immediate) //!CommonScriptableObjects.rendererState.Get())
            {
                RemoveAllEntitiesImmediate();
            }
            else
            {
                if (entities.Count > 0)
                {
                    this.gameObject.transform.position = EnvironmentSettings.MORDOR;
                    this.gameObject.SetActive(false);

                    RemoveAllEntities();
                }
                else
                {
                    Destroy(this.gameObject);
                }
            }

            isReleased = true;
        }