Ejemplo n.º 1
0
        // Token: 0x06002B9F RID: 11167 RVA: 0x001044D0 File Offset: 0x001026D0
        private static void InitBounds(GameObject gameObject)
        {
            Transform transform = gameObject.transform;

            MultiplayerBuilder.CacheBounds(transform, gameObject, MultiplayerBuilder.bounds, false);
            MultiplayerBuilder._aaBounds.center  = Vector3.zero;
            MultiplayerBuilder._aaBounds.extents = Vector3.zero;
            int count = MultiplayerBuilder.bounds.Count;

            if (count > 0)
            {
                Vector3 vector = new Vector3(3.40282347E+38f, 3.40282347E+38f, 3.40282347E+38f);
                Vector3 a      = new Vector3(-3.40282347E+38f, -3.40282347E+38f, -3.40282347E+38f);
                for (int i = 0; i < count; i++)
                {
                    OrientedBounds orientedBounds      = MultiplayerBuilder.bounds[i];
                    Matrix4x4      boundsToLocalMatrix = OrientedBounds.TransformMatrix(orientedBounds.position, orientedBounds.rotation);
                    OrientedBounds.MinMaxBounds(boundsToLocalMatrix, Vector3.zero, orientedBounds.extents, ref vector, ref a);
                }
                MultiplayerBuilder._aaBounds.extents = (a - vector) * 0.5f;
                MultiplayerBuilder._aaBounds.center  = vector + MultiplayerBuilder.aaBounds.extents;
            }
        }