Exemplo n.º 1
0
        void Start()
        {
            // Create
            RESULT result = RESULT.OK;

            result = RuntimeManager.LowlevelSystem.createReverb3D(out reverb);

            if (result != RESULT.OK)
            {
                UnityEngine.Debug.LogWarning("FMOD Extensions: Could not create 3D Reverb. " + result);
                return;
            }

            // Get the reverb's properties (preset and position)
            properties = ExtensionsUtils.ExtensionReverbToFMODReverb(preset);
            reverb.setProperties(ref properties);
            VECTOR pos = RuntimeUtils.ToFMODVector(transform.position);

            // Set position, min and max distances
            result = reverb.set3DAttributes(ref pos, minDistance, maxDistance);

            if (result != RESULT.OK)
            {
                UnityEngine.Debug.LogError("FMOD Extensions: Could not set 3D attributes to the 3D reverb " + result, this);
                return;
            }

            UnityEngine.Debug.Log("FMOD Extensions: Created 3D Reverb");
        }
Exemplo n.º 2
0
        public void SanitizeLogLine(ref string line)
        {
            var    lineSegments = ExtensionsUtils.GetSegmentsFromCSV(line, _headerMetadata.Delimiter);
            string clientIp     = lineSegments[_headerValueIndex];

            lineSegments[_headerValueIndex] = Obfuscator.ObfuscateIp(clientIp);

            line = string.Join(new string(_headerMetadata.Delimiter, 1), lineSegments);
        }
Exemplo n.º 3
0
        public override OutputLogLine TransformRawLogLine(string line)
        {
            if (string.IsNullOrWhiteSpace(line) ||
                string.IsNullOrEmpty(line) ||
                line.Trim().StartsWith("c-ip", ignoreCase: true, culture: CultureInfo.InvariantCulture))
            {
                // Ignore empty lines or the header
                return(null);
            }

            // Skip malformed lines.
            var segments = ExtensionsUtils.GetSegmentsFromCSV(line);

            if (segments.Length < ExpectedFields)
            {
                _logger.LogError(
                    "Skipping malformed raw log line with {Segments} segments and content {Content}.",
                    segments.Length,
                    line);
                return(null);
            }

            const string notAvailableString = "na";
            const string notAvailableInt    = "0";

            string   timestamp  = segments[(int)ChinaLogHeaderFields.timestamp];
            DateTime dt         = DateTime.Parse(timestamp, CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.AdjustToUniversal);
            string   timeStamp2 = ToUnixTimeStamp(dt);

            // Global status code format: cache status + "/" + HTTP status code
            // China status code format: HTTP status code
            var scstatus = segments[(int)ChinaLogHeaderFields.hitmiss] + "/" + segments[(int)ChinaLogHeaderFields.scstatus];

            return(new OutputLogLine(timestamp: timeStamp2,
                                     timetaken: notAvailableInt,
                                     cip: segments[(int)ChinaLogHeaderFields.cip],
                                     filesize: notAvailableInt,
                                     sip: segments[(int)ChinaLogHeaderFields.sip],
                                     sport: notAvailableInt,
                                     scstatus: scstatus,
                                     scbytes: segments[(int)ChinaLogHeaderFields.scbytes],
                                     csmethod: segments[(int)ChinaLogHeaderFields.csmethod],
                                     csuristem: segments[(int)ChinaLogHeaderFields.csuristem],
                                     rsduration: segments[(int)ChinaLogHeaderFields.rsduration],
                                     rsbytes: notAvailableInt,
                                     creferrer: segments[(int)ChinaLogHeaderFields.creferer],
                                     cuseragent: segments[(int)ChinaLogHeaderFields.cuseragent],
                                     customerid: notAvailableString,
                                     xeccustom1: notAvailableString
                                     ));
        }
Exemplo n.º 4
0
        /// <summary>
        /// Debug our positions if the polygon is a rectangle or square
        /// </summary>
        /// <param name="geometryPosition">Geometry position.</param>
        public void DrawCube(Vector3 geometryPosition)
        {
            if (isRectangle)
            {
                if (vertices.Length != 4)
                {
                    vertices = new Vertex[4];
                }

                // 0 = Top Left, 1 = Top Right, 2= Bottom Right, 3 = Bottom Left

                // Move all positions to origin
                Vector3 topLeft     = geometryPosition;
                Vector3 topRight    = geometryPosition;
                Vector3 bottomRight = geometryPosition;
                Vector3 bottomLeft  = geometryPosition;

                // Set each vertex depending on width and height
                topLeft.x -= width;
                topLeft.y += height;

                topRight.x += width;
                topRight.y += height;

                bottomRight.x += width;
                bottomRight.y -= height;

                bottomLeft.x -= width;
                bottomLeft.y -= height;

                // Allow vertices to move with rotation
                topLeft     = ExtensionsUtils.RotateAroundPivot(topLeft, geometryPosition, rotation);
                topRight    = ExtensionsUtils.RotateAroundPivot(topRight, geometryPosition, rotation);
                bottomRight = ExtensionsUtils.RotateAroundPivot(bottomRight, geometryPosition, rotation);
                bottomLeft  = ExtensionsUtils.RotateAroundPivot(bottomLeft, geometryPosition, rotation);

                // Set the new positions we just worked out to be the one on the polygon
                vertices[0].position = topLeft;
                vertices[1].position = topRight;
                vertices[2].position = bottomRight;
                vertices[3].position = bottomLeft;
            }
        }
Exemplo n.º 5
0
 void Start()
 {
     geometry = ExtensionsManager.CreateGeometryObject(polygons.Length, ExtensionsUtils.GetTotalVerticesInPolygons(polygons));
     ExtensionsManager.AddPolygon(geometry, polygons);
 }