public void UpdateViewCollision(bool viewCollision)
 {
     foreach (VisualSetLOD l in visualSet)
     {
         if (l.obj != null)
         {
             GameObject gao = l.obj.Gao;
             if (gao != null)
             {
                 gao.SetActive(!viewCollision);
             }
         }
     }
     if (collideMesh != null)
     {
         collideMesh.SetVisualsActive(viewCollision);
     }
 }
Example #2
0
        public void UpdateViewCollision(bool viewCollision)
        {
            if (gao == null)
            {
                return;
            }
            foreach (VisualSetLOD l in visualSet)
            {
                if (l.obj != null)
                {
                    GameObject gao = l.obj.Gao;
                    if (gao != null)
                    {
                        gao.SetActive(!viewCollision);
                    }
                }
            }

            bool spoHasNoCollisionFlag = superObject?.flags.HasFlag(SuperObjectFlags.Flags.NoCollision) ?? false;
            var  parentSector          = superObject?.ParentSector;
            bool isInVirtualSector     = parentSector != null && (parentSector.data as Sector)?.isSectorVirtual > 0;

            collideMesh?.SetVisualsActive(viewCollision && ((!spoHasNoCollisionFlag && !isInVirtualSector) || UnitySettings.ShowCollisionDataForNoCollisionObjects));
        }