diff --git a/.github/workflows/API.yml b/.github/workflows/API.yml deleted file mode 100644 index b25d4c7810..0000000000 --- a/.github/workflows/API.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: API - -on: - workflow_dispatch: {} - push: - branches: [ master, dev ] - pull_request: - branches: [ master, dev ] - -jobs: - buildApiSolution: - name: Build API - runs-on: ubuntu-latest - steps: - - name: Checkout Repository & Submodules - uses: actions/checkout@v2 - with: - submodules: recursive - - name: Install Protoc - uses: arduino/setup-protoc@v2 - with: - version: "23.3" - - name: Generate Protobuf Files - run: | - cd protocols/ - bash ./proto_compile.sh - cd .. - - name: Setup .NET Core - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 7.0.x - - name: Install API Dependencies - run: dotnet restore api/api.sln - - name: Build API Solution - run: dotnet build api/api.sln --configuration Release --no-restore - - name: Test API Solution - run: dotnet test api/api.sln --no-restore --verbosity normal - -# - name: Install Module Dependencies -# run: dotnet restore modules/modules.sln -# - name: Build Module Solution -# run: dotnet build modules/modules.sln --configuration Release --no-restore -# - name: Test Module Solution -# run: dotnet test modules/modules.sln --no-restore --verbosity normal diff --git a/.github/workflows/BlackFormat.yml b/.github/workflows/BlackFormat.yml index 2f258aab79..151d49269e 100644 --- a/.github/workflows/BlackFormat.yml +++ b/.github/workflows/BlackFormat.yml @@ -1,4 +1,4 @@ -name: Format Validation (Black) +name: Fusion - Black Format Validation on: workflow_dispatch: {} diff --git a/.github/workflows/ClangFormat.yml b/.github/workflows/ClangFormat.yml deleted file mode 100644 index e1a612599f..0000000000 --- a/.github/workflows/ClangFormat.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Format Validation (Clang) - -on: - workflow_dispatch: {} - push: - branches: [ master, dev ] - pull_request: - branches: [ master, dev ] - -jobs: - runFormatValidationScript: - name: Run Clang Format Validation Script - runs-on: ubuntu-latest - steps: - - name: Get Clang Format 16 - run: | - sudo wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc - sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" - sudo apt-get update - sudo apt-get install -y clang-format-16 - - name: Checkout Code - uses: actions/checkout@v2 - - name: Python Setup - uses: actions/setup-python@v2 - with: - python-version: '3.9' - - name: Run Script - run: python3 scripts/format/format_validation.py - id: format-validation - continue-on-error: true - - name: Check Success - run: | - if [ ${{ steps.format-validation.outcome }} == "success" ]; then - echo "Format Validation Passed" - else - echo "Format Validation Failed" - exit 1 - fi diff --git a/.github/workflows/Engine.yml b/.github/workflows/Engine.yml deleted file mode 100644 index cf43ef76ec..0000000000 --- a/.github/workflows/Engine.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: Engine - -on: - workflow_dispatch: {} - push: { branches: [master] } - -jobs: - buildForSomePlatforms: - name: Build for ${{ matrix.targetPlatform }} on version ${{ matrix.unityVersion }} - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - projectPath: - - engine/ - unityVersion: - - 2022.3.2f1 - targetPlatform: - - StandaloneWindows64 - - StandaloneLinux64 - - StandaloneOSX - steps: - - name: Checkout Repository & Submodules - uses: actions/checkout@v2 - with: - submodules: recursive - - uses: actions/cache@v1.1.0 - with: - path: ${{ matrix.projectPath }}/Library - key: Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform }} - restore-keys: | - Library-${{ matrix.projectPath }}- - Library- - - name: Install Protoc - uses: arduino/setup-protoc@v2 - with: - version: "23.3" - - name: Setup .NET Core - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 7.0.x - - name: Setup Dependencies - run: | - bash ./init.sh - bash ./init.sh - - name: Build Unity - uses: game-ci/unity-builder@v2 - env: - UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} - UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} - UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }} - with: - targetPlatform: ${{ matrix.targetPlatform }} - projectPath: ${{ matrix.projectPath }} - allowDirtyBuild: true - - uses: actions/upload-artifact@v1 - with: - name: Synthesis-${{ matrix.targetPlatform }} - path: build diff --git a/.github/workflows/FissionESLintFormat.yml b/.github/workflows/FissionESLintFormat.yml index 85e76190be..43a165119f 100644 --- a/.github/workflows/FissionESLintFormat.yml +++ b/.github/workflows/FissionESLintFormat.yml @@ -1,4 +1,4 @@ -name: Fission - ES Lint Format +name: Fission - ES Lint Format Validation on: workflow_dispatch: {} diff --git a/README.md b/README.md index 87d5c0cc62..6859991690 100644 --- a/README.md +++ b/README.md @@ -1,111 +1,72 @@ -![Synthesis: An Autodesk Technology](/engine/Assets/Resources/Branding/Synthesis/Synthesis-An-Autodesk-Technology-2023-lockup-Blk-OL-No-Year-stacked.png#gh-light-mode-only) -![Synthesis: An Autodesk Technology](/engine/Assets/Resources/Branding/Synthesis/Synthesis-An-Autodesk-Technology-2023-lockup-Wht-OL-No-Year-stacked.png#gh-dark-mode-only) +![Synthesis: An Autodesk Technology](/fission/res/branding/Synthesis-An-Autodesk-Technology-2023-lockup-Blk-OL-No-Year-stacked.svg#gh-light-mode-only) +![Synthesis: An Autodesk Technology](/fission/res/branding/Synthesis-An-Autodesk-Technology-2023-lockup-Wht-OL-No-Year-stacked.svg#gh-dark-mode-only)
-[![Engine](https://github.com/Autodesk/synthesis/actions/workflows/Engine.yml/badge.svg?branch=master)](https://github.com/Autodesk/synthesis/actions/workflows/Engine.yml) -[![API](https://github.com/Autodesk/synthesis/actions/workflows/API.yml/badge.svg?branch=master)](https://github.com/Autodesk/synthesis/actions/workflows/API.yml) -[![Clang Format](https://github.com/Autodesk/synthesis/actions/workflows/ClangFormat.yml/badge.svg?branch=master)](https://github.com/Autodesk/synthesis/actions/workflows/ClangFormat.yml) -[![Black Format](https://github.com/Autodesk/synthesis/actions/workflows/BlackFormat.yml/badge.svg?branch=master)](https://github.com/Autodesk/synthesis/actions/workflows/BlackFormat.yml) +[![Fission - Unit Test](https://github.com/Autodesk/synthesis/actions/workflows/FissionUnitTest.yml/badge.svg?branch=master)](https://github.com/Autodesk/synthesis/actions/workflows/FissionUnitTest.yml) +[![Fission - Packaging](https://github.com/Autodesk/synthesis/actions/workflows/FissionPackage.yml/badge.svg?branch=master)](https://github.com/Autodesk/synthesis/actions/workflows/FissionPackage.yml) +[![Fission - Lint/Format](https://github.com/Autodesk/synthesis/actions/workflows/FissionESLintFormat.yml/badge.svg?branch=master)](https://github.com/Autodesk/synthesis/actions/workflows/FissionESLintFormat.yml) +[![Fusion - Format](https://github.com/Autodesk/synthesis/actions/workflows/BlackFormat.yml/badge.svg?branch=master)](https://github.com/Autodesk/synthesis/actions/workflows/BlackFormat.yml) -Synthesis is a robotics simulator designed by and for FIRST robotics students to help teams design, strategize, test and practice. Teams have the ability to import their own robots and fields using our [Fusion 360 Exporter](/exporter/) or use the pre-packaged ones that come included with every release of Synthesis. +Synthesis is a robotics simulator designed by and for [FIRST®](https://www.firstinspires.org/) robotics students to help teams design, strategize, test and practice. Teams have the ability to import their own robots and fields using our [Fusion Exporter](/exporter/) or use the pre-made ones available within Synthesis. For more information on the product itself or the team, visit [http://synthesis.autodesk.com](http://synthesis.autodesk.com/). ## Goals -Synthesis is built with a direct focus on the FIRST community. Every single one of our developers is a FIRST student. We've also made the project completely open source in order to better involve the community. This way contributors can help make Synthesis better or modify Synthesis to better suit their team’s needs. +Synthesis is built with a direct focus on the FIRST® community. Every single one of our developers is a FIRST® student. We've also made the project completely open source in order to better involve the community. This way contributors can help make Synthesis better or modify Synthesis to better suit their team’s needs. Here are some of our primary goals for Synthesis: -- **Ease of Use**: It's important for us that Synthesis is out of the box ready for teams to use. We want to make sure that teams can get up and running with Synthesis as quickly as possible. To that end, every release of Synthesis comes pre-packaged with a variety of robots and fields; in addition to the ability to export and import your own. +- **Ease of Use**: It's important for us that Synthesis is out of the box ready for teams to use. We want to make sure that teams can get up and running with Synthesis as quickly as possible. To that end, Synthesis comes ready with a variety of robots and fields; in addition to the ability to export and import your own. - **Testing Robot Designs**: Synthesis is designed to be a tool for teams to quickly test their robot designs in a semi-realistic environment. Are you a builder who wants to use some crazy virtual four-bar linkage and your team says it's a waste of time? Well now you can prove them wrong by testing it in Synthesis! -- **Exploring the Field Environment**: Every year on kickoff, for both FTC and FRC FIRST competitions, Synthesis has a new release with the brand new field for that year included. This allows teams to explore the field through a 3D model, drive a robot around, and begin to strategize for the upcoming season's game. +- **Exploring the Field Environment**: Every year on kickoff, for both FTC and FRC FIRST® competitions, Synthesis has the newest field available immediately. This allows teams to explore the field through a 3D model, drive a robot around, and begin to strategize for the upcoming season's game. - **Driver Practice & Strategy**: Not getting enough driver practice or don't have a full field available to you? Synthesis has you covered with the ability to drive your robot around with a gamepad from a first-person view at the driver station; allowing you to get a feel for potential control scheme layouts and any line-of-sight challenges that may arise. This also allows the drive team and the programmers to communicate about what control layouts work best for each driver. ## Getting Started If you are a FIRST robotics student who just wants to use Synthesis, you *don't* need this repo. Simply **install the latest release of Synthesis from [synthesis.autodesk.com/download](https://synthesis.autodesk.com/download.html)**. +> [!IMPORTANT] +> Moving to [synthesis.autodesk.com] + If you're a developer who wants to contribute to Synthesis, you're in the right place. Synthesis is comprised of 3 main components that can be developed separately. These components include: -- [Synthesis API](/api/) -- [Simulation Engine](/engine/) -- [Fusion Robot Exporter (Fusion 360 Plugin)](/exporter/) +- [Fission (Core Web App)](/fission/README.md) +- [Fusion Exporter (Fusion exporter to Mirabuf file format)](/exporter/SynthesisFusionAddin/README.md) +- [Installers](/installer/) -Each of this components can be manually compiled separately, but this is not recommended. Instead, we recommend using the *init* scripts provided (`init.bat` & `init.sh`) to build and link each component together (excluding the Fusion Robot Exporter). +Follow the above links to the respective READMEs on how to build and run each component. ### Compatibility Notes -As Fusion 360 is not supported on linux the linux installer does not come with the Fusion 360 Addin for exporting robots and fields. - -Also note that the linux installer is tailored for Debian based distributions. Synthesis can be installed and ran on other distros but the installer is not guaranteed for your operating system. - -### Dependencies +As Fusion is not supported on linux, the linux installer does not come with the Fusion Addin for exporting robots and fields. -Synthesis Version `6.0.0` has the following dependencies: - -- [.NET Standard 2.0](https://learn.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-1-0) -- [.NET 7.0](https://dotnet.microsoft.com/en-us/download/dotnet/7.0) -- [Protobuf 23.3](https://github.com/protocolbuffers/protobuf/releases/tag/v23.3) -- Unity Version 2022.3.2f1 (d74737c6db50) - -These dependencies need to be satisfied before attempting to build Synthesis with unity. You can either install these dependencies manually or use the *resolve dependencies* scripts (`scripts/win/resolve_deps.bat` & `scripts/osx/resolve_deps.sh`) to install some of them for you. +## Contributing -To automatically install .NET and Protobuf run the following script depending on your operating system: -- Windows: `scripts/win/resolve_deps.bat` -- MacOS & Linux: `scripts/osx/resolve_deps.sh` +This project welcomes community suggestions and contributions. Synthesis is nearly 100% open source and relies on the FIRST® community to help make it better. The [Synthesis Contribution Guide](/CONTRIBUTING.md) suggests ways in which you can get involved through development and non-development avenues. -Dependency Notes: +Before you contribute to this repository, please first discuss the change you wish to make via a GitHub issue, email us ([frc@autodesk.com](mailto:frc@autodesk.com)), or reach out through our [community discord](https://www.discord.gg/hHcF9AVgZA). This way we can ensure that there is no overlap between outside contributors and internal development work. -- The windows script requires admin privileges to install .NET and Protobuf to the system PATH. For this reason it is not included by default in `init.bat` unlike how `init.sh` includes `resolve_deps.sh`. -- Unity must be installed manually through the Unity Hub app which can be downloaded from [https://unity.com/download](https://unity.com/download). +When ready to contribute, fork the synthesis repository, make your changes, and submit a pull request. Be sure to fill out the template accordingly to make reviewing your work as smooth as possible. Feel free to check out our [contributing guidelines](/CONTRIBUTING.md) to learn more. -### How To Build Synthesis Using An `init` Script And Unity +## Code Formatting And Style -Before attempting to build Synthesis, ensure you have all dependencies installed. +All code is under a configured formatting utility. See each component for more details. -1. Open a command prompt. -2. Change directories to a location where you'd like to clone the Synthesis repository. -3. Clone the Synthesis repository using `git clone https://github.com/Autodesk/synthesis --recurse-submodules`. -4. Change directories into the root of the Synthesis repository and run the `init` script for your operating system. - - Windows: `init.bat` - - MacOS & Linux: `init.sh` -5. Open `synthesis/engine` in Unity. -6. From there, you can run the simulation engine inside the Unity editor by opening `MainScene` from the `Assets/Scenes` directory or build it as a standalone application. - - To build Synthesis as a standalone application, go to `File -> Build Settings` and select your target platform. Then, click `Build` and select a location to save the built application. +## Other Components -## Contributing +### Mirabuf -This project welcomes community suggestions and contributions. Synthesis is 100% open source and relies on the FIRST community to help make it better. The [Synthesis Contribution Guide](/CONTRIBUTING.md) suggests ways in which you can get involved through development and non-development avenues. +Mirabuf is a file format we use to store physical data from Fusion to load into the Synthesis simulator (Fission). This is a separate project that is a submodule of Synthesis. [See Mirabuf](https://github.com/HiceS/mirabuf/) -Before you contribute to this repository, please first discuss the change you wish to make via a GitHub issue, email us ([frc@autodesk.com](mailto:frc@autodesk.com)), or reach out through our [community discord](https://www.discord.gg/hHcF9AVgZA). This way we can ensure that there is no overlap between outside contributors and internal development work. +### Tutorials -When ready to contribute, just submit a pull request and be sure to fill out the template accordingly so that we can verify them and eventually merge. Feel free to check out our [contributing guidelines](/CONTRIBUTING.md) to learn more. +Our source code for the tutorials featured on our [Tutorials Page](https://synthesis.autodesk.com/tutorials.html). -## Code Formatting And Style +### Protocols -Synthesis uses [clang-format](https://clang.llvm.org/docs/ClangFormat.html) and [black](https://black.readthedocs.io/en/stable/) to format all of our `C++`, `C#` and `Python` code. Additionally we have GitHub workflows that verify these formatting standards for each and every pull request. For more information about how to run these formatters yourself, check out the [formatting tools](/scripts/format/) we use. - -## Components - -Here is a brief overview of each of the components found in this repository. For more information about each component, their dependencies and their individual build processes, check out their respective *READMEs*. - -- [Synthesis API](/api/) - - Components used to extend Synthesis' functionality while remaining Unity agnostic. -- [Code Emulation](/emulation/) - - Synthesis tool designed to help users test their FRC robot code in a simulated environment. - - Code emulation is an advanced feature that is still under development, functionality and support is limited. -- [Core Engine](/engine/) - - The core of Synthesis, the Unity project that contains the simulation engine. -- [Fusion Exporter](/exporter/SynthesisFusionAddin/) - - The Fusion 360 plugin that allows users to export their robots and fields into Synthesis. -- [Installer](/installer/) - - Tools used to build the Synthesis installer for Windows, MacOS and Linux featured on our [Download Page](https://synthesis.autodesk.com/download.html). -- [Mirabuf](https://github.com/HiceS/mirabuf/) - - A custom 3D file format developed by [@HiceS](https://github.com/HiceS) that our Fusion 360 exporter uses. -- [Tutorials](/tutorials/) - - Our source code for the tutorials featured on our [Tutorials Page](https://synthesis.autodesk.com/tutorials.html). +Additional protobuf files that we use in addition to Mirabuf. [See Protocols](/protocols/README.md) ## Tutorials diff --git a/VersionManager.json b/VersionManager.json deleted file mode 100644 index 836ad8ee36..0000000000 --- a/VersionManager.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "Version": "6.1.0", - "URL": "https://synthesis.autodesk.com/download.html" -} diff --git a/api/.gitignore b/api/.gitignore deleted file mode 100644 index 9e90125662..0000000000 --- a/api/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -*/bin -*/obj - -.vscode/ -api.sln.DotSettings.user - -Api/Proto diff --git a/api/Aardvark/Aardvark.csproj b/api/Aardvark/Aardvark.csproj deleted file mode 100644 index 2096e2aa94..0000000000 --- a/api/Aardvark/Aardvark.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard2.0 - - - - - - - diff --git a/api/Aardvark/IO/BXDA/BXDAMesh.cs b/api/Aardvark/IO/BXDA/BXDAMesh.cs deleted file mode 100644 index d5831de6bb..0000000000 --- a/api/Aardvark/IO/BXDA/BXDAMesh.cs +++ /dev/null @@ -1,210 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; - -/// -/// Represents a 3D object composed of one or more and physical properties of the object. -/// -public partial class BXDAMesh : BinaryRWObject -{ - /// - /// Represents the revision id/version of the BXDA format (increment this when a new revision is released). - /// - const uint BXDA_CURRENT_VERSION = 0; - - /// - /// The GUID for identifying the BXDAMesh. - /// - public Guid GUID - { - get; - private set; - } - - /// - /// The physical properties of this object. - /// - public PhysicalProperties physics - { - get; - private set; - } - - /// - /// This object's sub meshes. - /// - public List meshes - { - get; - private set; - } - - /// - /// This object's collision meshes. - /// - public List colliders - { - get; - private set; - } - - /// - /// Creates an empty BXDA Mesh. - /// - public BXDAMesh() - : this(Guid.NewGuid()) - { - } - - /// - /// Creates an empty BXDA Mesh. - /// - public BXDAMesh(Guid guid) - { - GUID = guid; - physics = new PhysicalProperties(); - meshes = new List(); - colliders = new List(); - } - - /// - /// Writes all mesh data with the given BinaryWriter. - /// - /// - public void WriteBinaryData(BinaryWriter writer) - { - writer.Write(BXDA_CURRENT_VERSION); - - writer.Write(GUID.ToString()); - - WriteMeshList(writer, meshes); - WriteMeshList(writer, colliders); - physics.WriteBinaryData(writer); - } - - /// - /// Reads with the given BinaryReader to generate mesh data. - /// - /// - public void ReadBinaryData(BinaryReader reader) - { - // Gets the version to determine how to read the file. - uint version = reader.ReadUInt32(); - - switch (version) - { - case 0: - ReadData_v0(reader); - break; - } - } - - /// - /// Writes all the sub meshes in the given list to the given stream. - /// - /// Output stream - /// Mesh list - private static void WriteMeshList(BinaryWriter writer, List meshes) - { - writer.Write(meshes.Count); - foreach (BXDASubMesh mesh in meshes) - { - mesh.WriteData(writer); - } - } - - /// - /// Represents an indexed triangle mesh with normals and optional colors and texture coordinates. - /// - public partial class BXDASubMesh - { - /// - /// Vertex positions. Three values (X, Y, Z) per vertex. - /// - public double[] verts; - - /// - /// Vertex normals. Three values (X, Y, Z) composing one unit vector per vertex. - /// - public double[] norms; - - /// - /// A list of indexed surfaces that make up the mesh - /// - public List surfaces = new List(); - - public void WriteData(BinaryWriter writer) - { - int vertCount = verts.Length / 3; - byte meshFlags = (byte)((norms != null ? 1 : 0)); - - writer.Write(meshFlags); - writer.WriteArray(verts, 0, vertCount * 3); - if (norms != null) - { - writer.WriteArray(norms, 0, vertCount * 3); - } - - writer.Write(surfaces.Count); - foreach (BXDASurface surface in surfaces) - { - surface.WriteData(writer); - } - } - - public void ReadData(BinaryReader reader) - { - - } - } - - /// - /// Index data representing a face with color, transparency, translucency, and specular - /// - public partial class BXDASurface - { - public bool hasColor = false; - /// - /// The color of the material packed as an unsigned integer - /// - public uint color = 0xFFFFFFFF; - - /// - /// The transparency of the material. [0-1] - /// - public float transparency; - - /// - /// The translucency of the material. [0-1] - /// - public float translucency; - - /// - /// The specular intensity of the material. [0-1] - /// - public float specular = 0; - - /// - /// The zero based index buffer for this specific surface of the mesh. - /// - public int[] indicies; - - public void WriteData(BinaryWriter writer) - { - int facetCount = indicies.Length / 3; - - writer.Write(hasColor); - if (hasColor) - { - writer.Write(color); - } - writer.Write(transparency); - writer.Write(translucency); - writer.Write(specular); - - writer.WriteArray(indicies, 0, facetCount * 3); - } - - } - -} \ No newline at end of file diff --git a/api/Aardvark/IO/BXDA/BXDAReader_v0.cs b/api/Aardvark/IO/BXDA/BXDAReader_v0.cs deleted file mode 100644 index ebb43b3cde..0000000000 --- a/api/Aardvark/IO/BXDA/BXDAReader_v0.cs +++ /dev/null @@ -1,96 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; - -/// -/// Represents a 3D object composed of one or more and physical properties of the object. -/// -public partial class BXDAMesh : BinaryRWObject -{ - /// - /// Reads with the given BinaryReader to generate mesh data of v0. - /// - /// - private void ReadData_v0(BinaryReader reader) - { - // Re-reads version just in case. - GUID = new Guid(reader.ReadString()); - - meshes.Clear(); - colliders.Clear(); - ReadMeshList_v0(reader, meshes); - ReadMeshList_v0(reader, colliders); - - physics.ReadBinaryData(reader); - } - - /// - /// Reads a list of meshes from the given stream, adding them to the list passed into this function. - /// - /// Input stream - /// List to output to - private static void ReadMeshList_v0(BinaryReader reader, List meshes) - { - int meshCount = reader.ReadInt32(); - for (int id = 0; id < meshCount; id++) - { - BXDASubMesh mesh = new BXDASubMesh(); - mesh.ReadData_v0(reader); - meshes.Add(mesh); - } - } - - /// - /// Represents an indexed triangle mesh with normals and optional colors and texture coordinates. - /// - public partial class BXDASubMesh - { - /// - /// Reads BXDASubMesh data of v0. - /// - /// - public void ReadData_v0(BinaryReader reader) - { - byte meshFlags = reader.ReadByte(); - norms = (meshFlags & 1) == 1 ? new double[1 * 3] : null; - verts = reader.ReadArray(); - if (norms != null) - { - norms = reader.ReadArray(); - } - - int surfaceCount = reader.ReadInt32(); - for (int i = 0; i < surfaceCount; i++) - { - BXDASurface nextSurface = new BXDASurface(); - nextSurface.ReadData_v0(reader); - surfaces.Add(nextSurface); - } - } - } - - /// - /// Index data representing a face with color, transparency, translucency, and specular - /// - public partial class BXDASurface - { - /// - /// Reads BXDASurface data of v0. - /// - /// - public void ReadData_v0(BinaryReader reader) - { - hasColor = reader.ReadBoolean(); - - if (hasColor) - { - color = reader.ReadUInt32(); - } - transparency = reader.ReadSingle(); - translucency = reader.ReadSingle(); - specular = reader.ReadSingle(); - - indicies = reader.ReadArray(); - } - } -} \ No newline at end of file diff --git a/api/Aardvark/IO/BXDF/BXDFProperties.cs b/api/Aardvark/IO/BXDF/BXDFProperties.cs deleted file mode 100644 index 0b0f8d1a3e..0000000000 --- a/api/Aardvark/IO/BXDF/BXDFProperties.cs +++ /dev/null @@ -1,267 +0,0 @@ -using System.Collections.Generic; -using System.Xml; - -public partial class BXDFProperties -{ - /// - /// Represents the current version of the BXDF file. - /// - public const string BXDF_CURRENT_VERSION = "2.2.0"; - - /// - /// Represents the default name of any element. - /// - public const string BXDF_DEFAULT_NAME = "UNDEFINED"; - - /// - /// Reads the given BXDF file from the given path with the latest version possible. - /// - /// - /// - public static FieldDefinition ReadProperties(string path) - { - string result; - return ReadProperties(path, out result); - } - - /// - /// Reads the given BXDF file from the given path with the latest version possible. - /// - /// - /// - public static FieldDefinition ReadProperties(string path, out string result) - { - XmlReader reader = XmlReader.Create(path); - - // Find the BXDF element. - if (reader.ReadToFollowing("BXDF")) - { - string version = reader["Version"]; - - // Determine the version of the file. - switch (version.Substring(0, version.LastIndexOf('.'))) - { - case "2.2": - return ReadProperties_2_2(path, out result); - default: // If version is unknown. - // Attempt to read with the most recent version (but without validation). - return ReadProperties_2_2(path, out result, false); - } - } - else - { - // Could not find element, so return null. - result = "Could not find BXDF element."; - return null; - } - } - - /// - /// Writes out the properties file in XML format for the node with the base provided to - /// the path provided. - /// - /// - /// - public static void WriteProperties(string path, FieldDefinition fieldDefinition) - { - if (System.IO.File.Exists(path)) System.IO.File.Delete(path); - XmlWriterSettings settings = new XmlWriterSettings(); - settings.Indent = true; - - XmlWriter writer = XmlWriter.Create(path, settings); - - // Begins the document. - writer.WriteStartDocument(); - - /// Writes the root element and its GUID. - writer.WriteStartElement("BXDF"); - writer.WriteAttributeString("Version", BXDF_CURRENT_VERSION); - writer.WriteAttributeString("GUID", fieldDefinition.GUID.ToString()); - - Dictionary propertySets = fieldDefinition.GetPropertySets(); - - // Writes the data for each PropertySet. - foreach (PropertySet propertySet in propertySets.Values) - { - // Starts the element. - writer.WriteStartElement("PropertySet"); - - // Writes the ID attribute for the PropertySet. - writer.WriteAttributeString("ID", propertySet.PropertySetID); - - // Writes the collider property for the PropertySet. - WriteCollider(writer, propertySet.Collider); - - // Writes the friction property for the PropertySet. - writer.WriteElementString("Friction", propertySet.Friction.ToString()); - - // Writes the mass property for the PropertySet. - writer.WriteElementString("Mass", propertySet.Mass.ToString("F4")); - - // Ends the element. - writer.WriteEndElement(); - } - - // Writes the node group. - WriteFieldNodeGroup(writer, fieldDefinition.NodeGroup); - - // Ends the document. - writer.WriteEndDocument(); - - // Close the writer. - writer.Close(); - } - - /// - /// Writes the BXDVector3 to an XML file with the given XmlWriter. - /// - /// - /// - private static void WriteBXDVector3(XmlWriter writer, BXDVector3 vec, string id) - { - writer.WriteStartElement("BXDVector3"); - - writer.WriteAttributeString("ID", id); - - writer.WriteElementString("X", vec.x.ToString("F4")); - writer.WriteElementString("Y", vec.y.ToString("F4")); - writer.WriteElementString("Z", vec.z.ToString("F4")); - - writer.WriteEndElement(); - } - - /// - /// Writes the BXDQuaternion to an XML file with the given XmlWriter. - /// - /// - /// - /// - private static void WriteBXDQuaternion(XmlWriter writer, BXDQuaternion quat, string id) - { - writer.WriteStartElement("BXDQuaternion"); - - writer.WriteAttributeString("ID", id); - - writer.WriteElementString("X", quat.X.ToString("F4")); - writer.WriteElementString("Y", quat.Y.ToString("F4")); - writer.WriteElementString("Z", quat.Z.ToString("F4")); - writer.WriteElementString("W", quat.W.ToString("F4")); - - writer.WriteEndElement(); - } - - /// - /// Write the BoxCollider to an XML file with the given XmlWriter. - /// - /// - /// - private static void WriteBoxCollider(XmlWriter writer, PropertySet.BoxCollider boxCollider) - { - writer.WriteStartElement("BoxCollider"); - - WriteBXDVector3(writer, boxCollider.Scale, "Scale"); - - writer.WriteEndElement(); - } - - /// - /// Write the SphereCollider to an XML file with the given XmlWriter. - /// - /// - /// - private static void WriteSphereCollider(XmlWriter writer, PropertySet.SphereCollider sphereCollider) - { - writer.WriteStartElement("SphereCollider"); - - writer.WriteElementString("Scale", sphereCollider.Scale.ToString("F4")); - - writer.WriteEndElement(); - } - - /// - /// Write the MeshCollider to an XML file with the given XmlWriter. - /// - /// - /// - private static void WriteMeshCollider(XmlWriter writer, PropertySet.MeshCollider meshCollider) - { - writer.WriteStartElement("MeshCollider"); - - writer.WriteElementString("Convex", meshCollider.Convex.ToString().ToLower()); - - writer.WriteEndElement(); - } - - /// - /// Writes the given PropertySet's collider to an XML file with the given XmlWriter. - /// - /// - /// - private static void WriteCollider(XmlWriter writer, PropertySet.PropertySetCollider propertySetCollider) - { - switch (propertySetCollider.CollisionType) - { - case PropertySet.PropertySetCollider.PropertySetCollisionType.BOX: - WriteBoxCollider(writer, (PropertySet.BoxCollider)propertySetCollider); - break; - case PropertySet.PropertySetCollider.PropertySetCollisionType.SPHERE: - WriteSphereCollider(writer, (PropertySet.SphereCollider)propertySetCollider); - break; - case PropertySet.PropertySetCollider.PropertySetCollisionType.MESH: - WriteMeshCollider(writer, (PropertySet.MeshCollider)propertySetCollider); - break; - } - } - - /// - /// Writes all the data included in a FieldNodeGroup. - /// - /// - /// - private static void WriteFieldNodeGroup(XmlWriter writer, FieldNodeGroup fieldNodeGroup) - { - // Starts the assembly element. - writer.WriteStartElement("NodeGroup"); - - // Writes the NodeGroupID property. - writer.WriteAttributeString("ID", fieldNodeGroup.NodeGroupID); - - foreach (FieldNode node in fieldNodeGroup.EnumerateFieldNodes()) - { - // Starts the element. - writer.WriteStartElement("Node"); - - // Writes the NodeID attribute. - writer.WriteAttributeString("ID", node.NodeID); - - // Writes the Position property as a BXDVector3. - WriteBXDVector3(writer, node.Position, "Position"); - - // Write the EulerRotation property as a BXDQuaternion. - WriteBXDQuaternion(writer, node.Rotation, "Rotation"); - - // Writes the MeshID element. - writer.WriteElementString("SubMeshID", node.SubMeshID.ToString()); - - // Writes the CollisionMeshID element if a collider has been assigned. - if (node.CollisionMeshID != -1) - writer.WriteElementString("CollisionMeshID", node.CollisionMeshID.ToString()); - - // Writes the PropertySetID element if a PropertySet has been assigned. - if (node.PropertySetID != BXDF_DEFAULT_NAME) - writer.WriteElementString("PropertySetID", node.PropertySetID); - - // Ends the element. - writer.WriteEndElement(); - } - - foreach (FieldNodeGroup nodeGroup in fieldNodeGroup.EnumerateFieldNodeGroups()) - { - // Reiterates as the current FieldNodeGroup. - WriteFieldNodeGroup(writer, nodeGroup); - } - - // Ends the assembly element. - writer.WriteEndElement(); - } -} diff --git a/api/Aardvark/IO/BXDF/BXDFReader_2_2.cs b/api/Aardvark/IO/BXDF/BXDFReader_2_2.cs deleted file mode 100644 index f408782547..0000000000 --- a/api/Aardvark/IO/BXDF/BXDFReader_2_2.cs +++ /dev/null @@ -1,482 +0,0 @@ -using System; -using System.IO; -using System.Xml; -using System.Xml.Schema; - -public partial class BXDFProperties -{ - #region XSD Markup - - /// - /// The XSD markup to ensure valid document reading. - /// - private const string BXDF_XSD_2_2 = - @" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "; - - #endregion - - /// - /// Reads the properties contained in the XML BXDF file specified and returns - /// the corresponding FieldDefinition. - /// - /// - /// - /// - private static FieldDefinition ReadProperties_2_2(string path, out string result, bool useValidation = true) - { - // The FieldDefinition to be returned. - FieldDefinition fieldDefinition = null; - - XmlReaderSettings settings = new XmlReaderSettings(); - - if (useValidation) - { - settings.Schemas.Add(XmlSchema.Read(new StringReader(BXDF_XSD_2_2), null)); - settings.ValidationType = ValidationType.Schema; - } - else - { - settings.ValidationType = ValidationType.None; - } - - XmlReader reader = XmlReader.Create(path, settings); - - try - { - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "BXDF": - // Assign a value to fieldDefinition with the given GUID attribute. - fieldDefinition = FieldDefinition.Factory(new Guid(reader["GUID"])); - break; - case "PropertySet": - // Reads the current element as a PropertySet. - ReadPropertySet_2_2(reader.ReadSubtree(), fieldDefinition); - break; - case "NodeGroup": - // Reads the root FieldNodeGroup. - ReadFieldNodeGroup_2_2(reader.ReadSubtree(), fieldDefinition.NodeGroup); - break; - } - } - - result = "Success."; - - return fieldDefinition; - } - catch (Exception e)// A variety of exceptions can take place if the file is invalid, but we will always want to return null. - { - result = e.Message; - - // If the file is invalid, return null. - return null; - } - finally - { - // Closes the reader. - reader.Close(); - } - } - - /// - /// Reads a BXDVector3 with the given XmlReader and returns the reading. - /// - /// - /// - private static BXDVector3 ReadBXDVector3_2_2(XmlReader reader) - { - BXDVector3 vec = new BXDVector3(); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "X": - // Assign the x value. - vec.x = float.Parse(reader.ReadElementContentAsString()); - break; - case "Y": - // Assign the y value. - vec.y = float.Parse(reader.ReadElementContentAsString()); - break; - case "Z": - // Assign the z value. - vec.z = float.Parse(reader.ReadElementContentAsString()); - break; - } - } - - return vec; - } - - /// - /// Reads a BXDQuaternion with the given XmlReader and returns the reading. - /// - /// - /// - private static BXDQuaternion ReadBXDQuaternion_2_2(XmlReader reader) - { - BXDQuaternion quat = new BXDQuaternion(); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "X": - // Assign the X value. - quat.X = float.Parse(reader.ReadElementContentAsString()); - break; - case "Y": - // Assign the Y value. - quat.Y = float.Parse(reader.ReadElementContentAsString()); - break; - case "Z": - // Assign the Z value. - quat.Z = float.Parse(reader.ReadElementContentAsString()); - break; - case "W": - // Assign the W value. - quat.W = float.Parse(reader.ReadElementContentAsString()); - break; - } - } - - return quat; - } - - /// - /// Reads a BoxCollider with the given XmlReader. - /// - /// - /// - private static PropertySet.BoxCollider ReadBoxCollider_2_2(XmlReader reader) - { - // Create the BoxCollider. - PropertySet.BoxCollider boxCollider = null; - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "BXDVector3": - // Reads the scale properties and initializes the BoxCollider. - boxCollider = new PropertySet.BoxCollider(ReadBXDVector3_2_2(reader.ReadSubtree())); - break; - } - } - - return boxCollider; - } - - /// - /// Reads a SphereCollider with the given XmlReader. - /// - /// - /// - private static PropertySet.SphereCollider ReadSphereCollider_2_2(XmlReader reader) - { - // Create the SphereCollider. - PropertySet.SphereCollider sphereCollider = null; - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "Scale": - // Reads the scale property and initializes the SphereCollider. - sphereCollider = new PropertySet.SphereCollider(float.Parse(reader.ReadElementContentAsString())); - break; - } - } - - return sphereCollider; - } - - /// - /// Reads a MeshCollider with the given XmlReader. - /// - /// - /// - private static PropertySet.MeshCollider ReadMeshCollider_2_2(XmlReader reader) - { - // Create the MeshCollider. - PropertySet.MeshCollider meshCollider = null; - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "Convex": - // Reads the convex property and initializes the MeshCollider. - meshCollider = new PropertySet.MeshCollider(reader.ReadElementContentAsBoolean()); - break; - } - } - - return meshCollider; - } - - /// - /// Reads the subtree of a PropertySet element. - /// - /// - /// - private static void ReadPropertySet_2_2(XmlReader reader, FieldDefinition fieldDefinition) - { - // Creates a new PropertySet. - PropertySet propertySet = new PropertySet(); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "PropertySet": - // Assigns the ID attribute value to the PropertySetID property. - propertySet.PropertySetID = reader["ID"]; - break; - case "BoxCollider": - // Assigns the BoxCollider read by the XmlReader to the PropertySet's Collider property. - propertySet.Collider = ReadBoxCollider_2_2(reader.ReadSubtree()); - break; - case "SphereCollider": - // Assigns the SphereCollider read by the XmlReader to the PropertySet's Collider property. - propertySet.Collider = ReadSphereCollider_2_2(reader.ReadSubtree()); - break; - case "MeshCollider": - // Assigns the MeshCollider read by the XmlReader to the PropertySet's Collider property. - propertySet.Collider = ReadMeshCollider_2_2(reader.ReadSubtree()); - break; - case "Friction": - // Assings the Friction attribute value to the Friction property. - propertySet.Friction = reader.ReadElementContentAsInt(); - break; - case "Mass": - // Assings the Mass attribute value to the Mass property. - propertySet.Mass = float.Parse(reader.ReadElementContentAsString()); - break; - } - } - - // Adds the PropertySet to the fieldDefinition. - fieldDefinition.AddPropertySet(propertySet); - } - - /// - /// Reads the subtree of a FieldNode and returns the result. - /// - /// - /// - private static FieldNode ReadFieldNode_2_2(XmlReader reader) - { - FieldNode node = null; - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "Node": - node = new FieldNode(reader["ID"]); - break; - case "BXDVector3": - // Read the BXDVector3 as the node's position. - node.Position = ReadBXDVector3_2_2(reader.ReadSubtree()); - break; - case "BXDQuaternion": - // Read the BXDVector3 as the node's rotation. - node.Rotation = ReadBXDQuaternion_2_2(reader.ReadSubtree()); - break; - case "SubMeshID": - // Assign the MeshID attribute value to the SubMeshID property. - node.SubMeshID = reader.ReadElementContentAsInt(); - break; - case "CollisionMeshID": - // Assign the CollisionMeshID attribute value to the CollisionMeshID property. - node.CollisionMeshID = reader.ReadElementContentAsInt(); - break; - case "PropertySetID": - // Assign the PropertySetID attribute value to the PropertySetID property. - node.PropertySetID = reader.ReadElementContentAsString(); - break; - } - } - - return node; - } - - /// - /// Iterates through each child FieldNodeGroup and adds all FieldNodes to the given FieldNodeGroup. - /// - /// - /// - private static void ReadFieldNodeGroup_2_2(XmlReader reader, FieldNodeGroup fieldNodeGroup) - { - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "Node": - // Add the FieldNode to fieldNodeGroup. - fieldNodeGroup.AddNode(ReadFieldNode_2_2(reader.ReadSubtree())); - break; - case "NodeGroup": - // If an ID has not been assigned to the current FieldNodeGroup. - if (fieldNodeGroup.NodeGroupID.Equals(BXDFProperties.BXDF_DEFAULT_NAME)) - { - // Assign the ID attribute value to the NodeGroupID property. - fieldNodeGroup.NodeGroupID = reader["ID"]; - } - else - { - // Creates a new FieldNodeGroup. - FieldNodeGroup childNodeGroup = new FieldNodeGroup(BXDFProperties.BXDF_DEFAULT_NAME); - - // Re-iterate as the childNodeGroup. - ReadFieldNodeGroup_2_2(reader.ReadSubtree(), childNodeGroup); - - // Add the processed FieldNodeGroup to fieldNodeGroup. - fieldNodeGroup.AddNodeGroup(childNodeGroup); - } - break; - } - } - } -} diff --git a/api/Aardvark/IO/BXDIO.cs b/api/Aardvark/IO/BXDIO.cs deleted file mode 100644 index 928c8251ba..0000000000 --- a/api/Aardvark/IO/BXDIO.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System; - -/// -/// Utility functions for file I/O -/// -public class BXDIO -{ - public const byte MAJOR_VERSION = 0; // Bump on stable releases - public const byte MINOR_VERSION = 3; // Bump on beta releases - public const byte REVISION_VERSION = 3; // Bump on major IO changes. - public const byte REVISION_PORTION = 1; // Bump on IO changes in a meta chunk. - - public const string ASSEMBLY_VERSION = "0.3.3.1"; // I'm so sorry that this isn't dynamic :'( - - public delegate void ProgressReporter(long progress, long total); - - /// - /// The version of the file format this file can read and write. - /// - public const uint FORMAT_VERSION = (MAJOR_VERSION << 24) | (MINOR_VERSION << 16) | (REVISION_VERSION << 8) | REVISION_PORTION; - - /// - /// Converts the given version ID number to decimal notation. - /// - /// Version ID - /// Decimal notation of the version ID - public static string VersionToString(uint version) - { - return ((version >> 24) & 0xFF) + "." + ((version >> 16) & 0xFF) + "." + ((version >> 8) & 0xFF) + "." + ((version >> 0) & 0xFF); - } - - /// - /// Talks about compatibility. - /// - /// The version to compare with - public static void CheckReadVersion(uint version) - { - if ((version & 0xFF000000) == (FORMAT_VERSION & 0xFF000000)) - { - if ((version & 0xFFFF0000) != (FORMAT_VERSION & 0xFFFF0000)) - { - Console.Write("Trying to read version " + VersionToString(version) + " using API version " + VersionToString(FORMAT_VERSION) + ". Continue? (y/N) "); - } - return; - } - throw new FormatException("Trying to read version " + VersionToString(version) + " using API version " + VersionToString(FORMAT_VERSION)); - } - - // Prevents creation of an instance of this class - private BXDIO() - { - } -} diff --git a/api/Aardvark/IO/BXDJ/BXDJReader_2_0.cs b/api/Aardvark/IO/BXDJ/BXDJReader_2_0.cs deleted file mode 100644 index 7a6e7fb0f9..0000000000 --- a/api/Aardvark/IO/BXDJ/BXDJReader_2_0.cs +++ /dev/null @@ -1,908 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Xml; -using System.Xml.Schema; - -/// -/// Utility functions for reading/writing BXDJ files -/// -public partial class BXDJSkeleton -{ - #region XSD Markup - - /// - /// The XSD markup to ensure valid document reading. - /// - private const string BXDJ_XSD_2_0 = - @" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "; - - #endregion - - /// - /// Reads the skeleton contained in the XML BXDJ file specified and - /// returns the corresponding RigidNode_Base. - /// - /// - /// - private static RigidNode_Base ReadSkeleton_2_0(string path, bool useValidation = true) - { - RigidNode_Base root = null; - List nodes = new List(); - - XmlReaderSettings settings = new XmlReaderSettings(); - - if (useValidation) - { - settings.Schemas.Add(XmlSchema.Read(new StringReader(BXDJ_XSD_2_0), null)); - settings.ValidationType = ValidationType.Schema; - } - else - { - settings.ValidationType = ValidationType.None; - } - - XmlReader reader = XmlReader.Create(path, settings); - - try - { - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "Node": - // Reads the current element as a node. - ReadNode_2_0(reader.ReadSubtree(), nodes, ref root); - break; - } - } - } - catch (Exception)// A variety of exceptions can take place if the file is invalid, but we will always want to return null. - { - // If the file is invalid, return null. - return null; - } - finally - { - // Closes the reader. - reader.Close(); - } - - return nodes[0]; - } - - /// - /// Reads a RigidNode_Base with the given reader, list of nodes, and root node reference. - /// - /// - /// - /// - private static void ReadNode_2_0(XmlReader reader, List nodes, ref RigidNode_Base root) - { - int parentID = -1; - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "Node": - // Adds a new node to the list of RigidNode_Bases. - nodes.Add(RigidNode_Base.NODE_FACTORY(new Guid(reader["GUID"]))); - break; - case "ParentID": - // Stores this ID for later use. - parentID = reader.ReadElementContentAsInt(); - - if (parentID == -1) // If this is the root... - root = nodes[nodes.Count - 1]; - break; - case "ModelFileName": - // Assigns the ModelFileName property to the ModelFileName element value. - nodes[nodes.Count - 1].ModelFileName = reader.ReadElementContentAsString(); - break; - case "ModelID": - // Assigns the ModelFullID property to the ModelID element value. - nodes[nodes.Count - 1].ModelFullID = reader.ReadElementContentAsString(); - break; - case "BallJoint": - // Reads the current element as a BallJoint. - nodes[parentID].AddChild(ReadBallJoint_2_0(reader.ReadSubtree()), nodes[nodes.Count - 1]); - break; - case "CylindricalJoint": - // Reads the current element as a CylindricalJoint. - nodes[parentID].AddChild(ReadCylindricalJoint_2_0(reader.ReadSubtree()), nodes[nodes.Count - 1]); - break; - case "LinearJoint": - // Reads the current element as a LinearJoint. - nodes[parentID].AddChild(ReadLinearJoint_2_0(reader.ReadSubtree()), nodes[nodes.Count - 1]); - break; - case "PlanarJoint": - // Reads the current element as a PlanarJoint. - nodes[parentID].AddChild(ReadPlanarJoint_2_0(reader.ReadSubtree()), nodes[nodes.Count - 1]); - break; - case "RotationalJoint": - // Reads the current elemenet as a RotationalJoint. - nodes[parentID].AddChild(ReadRotationalJoint_2_0(reader.ReadSubtree()), nodes[nodes.Count - 1]); - break; - case "JointDriver": - // Add a joint driver to the skeletal joint of the current node. - nodes[nodes.Count - 1].GetSkeletalJoint().cDriver = ReadJointDriver_2_0(reader.ReadSubtree()); - break; - case "RobotSensor": - nodes[nodes.Count - 1].GetSkeletalJoint().attachedSensors.Add(ReadRobotSensor_2_0(reader.ReadSubtree())); - break; - } - } - } - - /// - /// Reads a BallJoint_Base from the given XmlReader. - /// - /// - /// - private static BallJoint_Base ReadBallJoint_2_0(XmlReader reader) - { - // Create a new BallJoint_Base. - BallJoint_Base ballJoint = (BallJoint_Base)SkeletalJoint_Base.JOINT_FACTORY(SkeletalJointType.BALL); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "BXDVector3": - // Read the BXDVector3 as the basePoint. - ballJoint.basePoint = ReadBXDVector3_2_0(reader.ReadSubtree()); - break; - } - } - - return ballJoint; - } - - /// - /// Reads a CylindricalJoint_Base from the given XmlReader. - /// - /// - /// - private static CylindricalJoint_Base ReadCylindricalJoint_2_0(XmlReader reader) - { - // Create a new CylindricalJoint_Base. - CylindricalJoint_Base cylindricalJoint = (CylindricalJoint_Base)SkeletalJoint_Base.JOINT_FACTORY(SkeletalJointType.CYLINDRICAL); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "BXDVector3": - switch (reader["VectorID"]) - { - case "BasePoint": - // Assign the BXDVector3 to the basePoint. - cylindricalJoint.basePoint = ReadBXDVector3_2_0(reader.ReadSubtree()); - break; - case "Axis": - // Assign the BXDVector3 to the axis. - cylindricalJoint.axis = ReadBXDVector3_2_0(reader.ReadSubtree()); - break; - } - break; - case "AngularLowLimit": - // Assign a value to the angularLimitLow. - cylindricalJoint.hasAngularLimit = true; - cylindricalJoint.angularLimitLow = float.Parse(reader.ReadElementContentAsString()); - break; - case "AngularHighLimit": - // Assign a value to the angularLimitHigh. - cylindricalJoint.angularLimitHigh = float.Parse(reader.ReadElementContentAsString()); - break; - case "LinearStartLimit": - // Assign a value to the linearLimitStart. - cylindricalJoint.hasLinearStartLimit = true; - cylindricalJoint.linearLimitStart = float.Parse(reader.ReadElementContentAsString()); - break; - case "LinearEndLimit": - // Assign a value to the linearLimitEnd. - cylindricalJoint.hasLinearEndLimit = true; - cylindricalJoint.linearLimitEnd = float.Parse(reader.ReadElementContentAsString()); - break; - case "CurrentLinearPosition": - // Assign a value to the currentLinearPosition. - cylindricalJoint.currentLinearPosition = float.Parse(reader.ReadElementContentAsString()); - break; - case "CurrentAngularPosition": - // Assign a value to the currentAngularPosition. - cylindricalJoint.currentAngularPosition = float.Parse(reader.ReadElementContentAsString()); - break; - } - } - - return cylindricalJoint; - } - - /// - /// Reads a LinearJoint_Base from the given XmlReader. - /// - /// - /// - private static LinearJoint_Base ReadLinearJoint_2_0(XmlReader reader) - { - // Create a new LinearJoint_Base. - LinearJoint_Base linearJoint = (LinearJoint_Base)SkeletalJoint_Base.JOINT_FACTORY(SkeletalJointType.LINEAR); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "BXDVector3": - switch (reader["VectorID"]) - { - case "BasePoint": - // Assign the BXDVector3 to the basePoint. - linearJoint.basePoint = ReadBXDVector3_2_0(reader.ReadSubtree()); - break; - case "Axis": - // Assign the BXDVector3 to the axis. - linearJoint.axis = ReadBXDVector3_2_0(reader.ReadSubtree()); - break; - } - break; - case "LinearLowLimit": - // Assign a value to the linearLimitLow. - linearJoint.hasLowerLimit = true; - linearJoint.linearLimitLow = float.Parse(reader.ReadElementContentAsString()); - break; - case "LinearUpperLimit": - // Assign a value to the linearLimitHigh. - linearJoint.hasUpperLimit = true; - linearJoint.linearLimitHigh = float.Parse(reader.ReadElementContentAsString()); - break; - case "CurrentLinearPosition": - // Assign a value to the currentLinearPosition. - linearJoint.currentLinearPosition = float.Parse(reader.ReadElementContentAsString()); - break; - } - } - - return linearJoint; - } - - /// - /// Reads a PlanarJoint_Base from the given XmlReader. - /// - /// - /// - private static PlanarJoint_Base ReadPlanarJoint_2_0(XmlReader reader) - { - // Create a new PlanarJoint_Base. - PlanarJoint_Base planarJoint = (PlanarJoint_Base)SkeletalJoint_Base.JOINT_FACTORY(SkeletalJointType.PLANAR); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "BXDVector3": - switch (reader["VectorID"]) - { - case "Normal": - // Assign the BXDVector3 to the normal. - planarJoint.normal = ReadBXDVector3_2_0(reader.ReadSubtree()); - break; - case "BasePoint": - // Assign the BXDVector3 to the basePoint.s - planarJoint.basePoint = ReadBXDVector3_2_0(reader.ReadSubtree()); - break; - } - break; - } - } - - return planarJoint; - } - - /// - /// Reads a RotationalJoint_Base from the given XmlReader. - /// - /// - /// - private static RotationalJoint_Base ReadRotationalJoint_2_0(XmlReader reader) - { - // Create a new RotationalJoint_Base. - RotationalJoint_Base rotationalJoint = (RotationalJoint_Base)SkeletalJoint_Base.JOINT_FACTORY(SkeletalJointType.ROTATIONAL); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "BXDVector3": - switch (reader["VectorID"]) - { - case "BasePoint": - // Read the BXDVector3 as the basePoint. - rotationalJoint.basePoint = ReadBXDVector3_2_0(reader.ReadSubtree()); - break; - case "Axis": - // Read the BXDVector3 as the axis. - rotationalJoint.axis = ReadBXDVector3_2_0(reader.ReadSubtree()); - break; - } - break; - case "AngularLowLimit": - // Assign the current element value to angularLimitLow. - rotationalJoint.hasAngularLimit = true; - rotationalJoint.angularLimitLow = float.Parse(reader.ReadElementContentAsString()); - break; - case "AngularHighLimit": - // Assign the current element value to angularLimitHigh. - rotationalJoint.angularLimitHigh = float.Parse(reader.ReadElementContentAsString()); - break; - case "CurrentAngularPosition": - // Assign the current element value to currentAngularPosition. - rotationalJoint.currentAngularPosition = float.Parse(reader.ReadElementContentAsString()); - break; - } - } - - return rotationalJoint; - } - - /// - /// Reads a BXDVector3 with the given XmlReader and returns the reading. - /// - /// - /// - private static BXDVector3 ReadBXDVector3_2_0(XmlReader reader) - { - BXDVector3 vec = new BXDVector3(); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "X": - // Assign the x value. - vec.x = float.Parse(reader.ReadElementContentAsString()); - break; - case "Y": - // Assign the y value. - vec.y = float.Parse(reader.ReadElementContentAsString()); - break; - case "Z": - // Assign the z value. - vec.z = float.Parse(reader.ReadElementContentAsString()); - break; - } - } - - return vec; - } - - /// - /// Reads a JointDriver from the given XmlReader. - /// - /// - /// - private static JointDriver ReadJointDriver_2_0(XmlReader reader) - { - JointDriver driver = null; - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "DriveType": - // Initialize the driver. - driver = new JointDriver((JointDriverType)Enum.Parse(typeof(JointDriverType), reader.ReadElementContentAsString())); - break; - case "PortA":// mismatched naming to maintain backwards compatibility - // Assign a value to portA. - driver.port1 = reader.ReadElementContentAsInt(); - break; - case "PortB": - // Assign a value to port2. - driver.port2 = reader.ReadElementContentAsInt(); - break; - case "LowerLimit": - // Assign a value to the lowerLimit. - driver.lowerLimit = float.Parse(reader.ReadElementContentAsString()); - break; - case "UpperLimit": - // Assign a value to the upperLimit. - driver.upperLimit = float.Parse(reader.ReadElementContentAsString()); - break; - case "SignalType": - // Assign a value to isCan. - driver.isCan = reader.ReadElementContentAsString().Equals("CAN") ? true : false; - break; - case "ElevatorDriverMeta": - // Add an ElevatorDriverMeta. - driver.AddInfo(ReadElevatorDriverMeta_2_0(reader.ReadSubtree())); - break; - case "PneumaticDriverMeta": - // Add a PneumaticsDriverMeta. - driver.AddInfo(ReadPneumaticDriverMeta_2_0(reader.ReadSubtree())); - break; - case "WheelDriverMeta": - // Add a WheelDriverMeta. - driver.AddInfo(ReadWheelDriverMeta_2_0(reader.ReadSubtree())); - break; - } - } - - return driver; - } - - /// - /// Reads an ElevatorDriverMeta from the given XmlReader. - /// - /// - /// - private static ElevatorDriverMeta ReadElevatorDriverMeta_2_0(XmlReader reader) - { - // Create a new ElevatorDriveMeta. - ElevatorDriverMeta elevatorDriverMeta = new ElevatorDriverMeta(); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "ElevatorType": - // Assign the type to the current element value. - elevatorDriverMeta.type = (ElevatorType)Enum.Parse(typeof(ElevatorType), reader.ReadElementContentAsString()); - break; - } - } - - return elevatorDriverMeta; - } - - /// - /// Reads a PneumaticDriverMeta from the given XmlReader. - /// - /// - /// - private static PneumaticDriverMeta ReadPneumaticDriverMeta_2_0(XmlReader reader) - { - // Create a new pneumaticDriverMeta. - PneumaticDriverMeta pneumaticDriverMeta = new PneumaticDriverMeta(); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "WidthMM": - // Assign the current element value to widthMM. - pneumaticDriverMeta.widthMM = reader.ReadElementContentAsInt(); - break; - case "PressurePSI": - // Assign the current element value to pressurePSI. - pneumaticDriverMeta.pressurePSI = float.Parse(reader.ReadElementContentAsString()); - break; - } - } - - return pneumaticDriverMeta; - } - - /// - /// Reads a WheelDriverMeta from the given XmlReader. - /// - /// - /// - private static WheelDriverMeta ReadWheelDriverMeta_2_0(XmlReader reader) - { - // Create new WheelDriveMeta. - WheelDriverMeta wheelDriverMeta = new WheelDriverMeta(); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "WheelType": - // Assign a value to the type. - wheelDriverMeta.type = (WheelType)Enum.Parse(typeof(WheelType), reader.ReadElementContentAsString()); - break; - case "WheelRadius": - // Assign a value to the radius. - wheelDriverMeta.radius = float.Parse(reader.ReadElementContentAsString()); - break; - case "WheelWidth": - // Assign a value to the width. - wheelDriverMeta.width = float.Parse(reader.ReadElementContentAsString()); - break; - case "BXDVector3": - // Assign a value to the center. - wheelDriverMeta.center = ReadBXDVector3_2_0(reader.ReadSubtree()); - break; - case "ForwardAsympSlip": - // Assign a value to the forwardAsympSlip. - wheelDriverMeta.forwardAsympSlip = float.Parse(reader.ReadElementContentAsString()); - break; - case "ForwardAsympValue": - // Assign a value to the forwardAsympValue. - wheelDriverMeta.forwardAsympValue = float.Parse(reader.ReadElementContentAsString()); - break; - case "ForwardExtremeSlip": - // Assign a value to the forwardExtremeSlip. - wheelDriverMeta.forwardExtremeSlip = float.Parse(reader.ReadElementContentAsString()); - break; - case "ForwardExtremeValue": - // Assign a value to the forwardExtremeValue. - wheelDriverMeta.forwardExtremeValue = float.Parse(reader.ReadElementContentAsString()); - break; - case "SideAsympSlip": - // Assign a value to the sideAsympSlip. - wheelDriverMeta.sideAsympSlip = float.Parse(reader.ReadElementContentAsString()); - break; - case "SideAsympValue": - // Assign a value to the sideAsympValue. - wheelDriverMeta.sideAsympValue = float.Parse(reader.ReadElementContentAsString()); - break; - case "SideExtremeSlip": - // Assign a value to the sideExtremeSlip. - wheelDriverMeta.sideExtremeSlip = float.Parse(reader.ReadElementContentAsString()); - break; - case "SideExtremeValue": - // Assign a value to the sideExtremeValue. - wheelDriverMeta.sideExtremeValue = float.Parse(reader.ReadElementContentAsString()); - break; - case "IsDriveWheel": - // Assign a value to isDriveWheel. - wheelDriverMeta.isDriveWheel = reader.ReadElementContentAsBoolean(); - break; - } - } - - return wheelDriverMeta; - } - - /// - /// Read a RobotSensor from the given XmlReader. - /// - /// - /// - private static RobotSensor ReadRobotSensor_2_0(XmlReader reader) - { - RobotSensor robotSensor = null; - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "SensorType": - // Initialize the RobotSensor. - robotSensor = new RobotSensor((RobotSensorType)Enum.Parse(typeof(RobotSensorType), reader.ReadElementContentAsString())); - break; - case "SensorModule": - // Assign a value to the module. - short m = (short)reader.ReadElementContentAsInt(); - break; - case "SensorPort": - // Assign a value to the port. - short p = (short)reader.ReadElementContentAsInt(); - break; - case "Polynomial": - // Create a polynomial and assign it to the equation. - Polynomial r = ReadPolynomial_2_0(reader.ReadSubtree()); - break; - case "UseSecondarySource": - // Assign a value to useSecondarySource. - reader.ReadElementContentAsBoolean(); - break; - } - } - - return robotSensor; - } - - /// - /// Reads a Polynomial from the given XmlReader. - /// - /// - /// - private static Polynomial ReadPolynomial_2_0(XmlReader reader) - { - // Initialize a list of floats. - List coeff = new List(); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "Coefficient": - // Add a new coefficient to the list of floats. - coeff.Add(float.Parse(reader.ReadElementContentAsString())); - break; - } - } - - // Convert the list of floats to a Polynomial. - return new Polynomial(coeff.ToArray()); - } -} diff --git a/api/Aardvark/IO/BXDJ/BXDJReader_3_0.cs b/api/Aardvark/IO/BXDJ/BXDJReader_3_0.cs deleted file mode 100644 index 8f3697343b..0000000000 --- a/api/Aardvark/IO/BXDJ/BXDJReader_3_0.cs +++ /dev/null @@ -1,900 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Xml; -using System.Xml.Schema; - -/// -/// Utility functions for reading/writing BXDJ files -/// -public partial class BXDJSkeleton -{ - #region XSD Markup - - /// - /// The XSD markup to ensure valid document reading. - /// - private const string BXDJ_XSD_3_0 = - @" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "; - - #endregion - - /// - /// Reads the skeleton contained in the XML BXDJ file specified and - /// returns the corresponding RigidNode_Base. - /// - /// - /// - private static RigidNode_Base ReadSkeleton_3_0(string path, bool useValidation = true) - { - RigidNode_Base root = null; - List nodes = new List(); - - XmlReaderSettings settings = new XmlReaderSettings(); - - if (useValidation) - { - settings.Schemas.Add(XmlSchema.Read(new StringReader(BXDJ_XSD_3_0), null)); - settings.ValidationType = ValidationType.Schema; - } - else - { - settings.ValidationType = ValidationType.None; - } - - XmlReader reader = XmlReader.Create(path, settings); - - try - { - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "Node": - // Reads the current element as a node. - ReadNode_3_0(reader.ReadSubtree(), nodes, ref root); - break; - } - } - } - catch (Exception)// A variety of exceptions can take place if the file is invalid, but we will always want to return null. - { - // If the file is invalid, return null. - return null; - } - finally - { - // Closes the reader. - reader.Close(); - } - - return nodes[0]; - } - - /// - /// Reads a RigidNode_Base with the given reader, list of nodes, and root node reference. - /// - /// - /// - /// - private static void ReadNode_3_0(XmlReader reader, List nodes, ref RigidNode_Base root) - { - int parentID = -1; - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "Node": - // Adds a new node to the list of RigidNode_Bases. - nodes.Add(RigidNode_Base.NODE_FACTORY(new Guid(reader["GUID"]))); - break; - case "ParentID": - // Stores this ID for later use. - parentID = reader.ReadElementContentAsInt(); - - if (parentID == -1) // If this is the root... - root = nodes[nodes.Count - 1]; - break; - case "ModelFileName": - // Assigns the ModelFileName property to the ModelFileName element value. - nodes[nodes.Count - 1].ModelFileName = reader.ReadElementContentAsString(); - break; - case "ModelID": - // Assigns the ModelFullID property to the ModelID element value. - nodes[nodes.Count - 1].ModelFullID = reader.ReadElementContentAsString(); - break; - case "BallJoint": - // Reads the current element as a BallJoint. - nodes[parentID].AddChild(ReadBallJoint_3_0(reader.ReadSubtree()), nodes[nodes.Count - 1]); - break; - case "CylindricalJoint": - // Reads the current element as a CylindricalJoint. - nodes[parentID].AddChild(ReadCylindricalJoint_3_0(reader.ReadSubtree()), nodes[nodes.Count - 1]); - break; - case "LinearJoint": - // Reads the current element as a LinearJoint. - nodes[parentID].AddChild(ReadLinearJoint_3_0(reader.ReadSubtree()), nodes[nodes.Count - 1]); - break; - case "PlanarJoint": - // Reads the current element as a PlanarJoint. - nodes[parentID].AddChild(ReadPlanarJoint_3_0(reader.ReadSubtree()), nodes[nodes.Count - 1]); - break; - case "RotationalJoint": - // Reads the current elemenet as a RotationalJoint. - nodes[parentID].AddChild(ReadRotationalJoint_3_0(reader.ReadSubtree()), nodes[nodes.Count - 1]); - break; - case "JointDriver": - // Add a joint driver to the skeletal joint of the current node. - nodes[nodes.Count - 1].GetSkeletalJoint().cDriver = ReadJointDriver_3_0(reader.ReadSubtree()); - break; - case "RobotSensor": - nodes[nodes.Count - 1].GetSkeletalJoint().attachedSensors.Add(ReadRobotSensor_3_0(reader.ReadSubtree())); - break; - } - } - } - - /// - /// Reads a BallJoint_Base from the given XmlReader. - /// - /// - /// - private static BallJoint_Base ReadBallJoint_3_0(XmlReader reader) - { - // Create a new BallJoint_Base. - BallJoint_Base ballJoint = (BallJoint_Base)SkeletalJoint_Base.JOINT_FACTORY(SkeletalJointType.BALL); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "BXDVector3": - // Read the BXDVector3 as the basePoint. - ballJoint.basePoint = ReadBXDVector3_3_0(reader.ReadSubtree()); - break; - } - } - - return ballJoint; - } - - /// - /// Reads a CylindricalJoint_Base from the given XmlReader. - /// - /// - /// - private static CylindricalJoint_Base ReadCylindricalJoint_3_0(XmlReader reader) - { - // Create a new CylindricalJoint_Base. - CylindricalJoint_Base cylindricalJoint = (CylindricalJoint_Base)SkeletalJoint_Base.JOINT_FACTORY(SkeletalJointType.CYLINDRICAL); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "BXDVector3": - switch (reader["VectorID"]) - { - case "BasePoint": - // Assign the BXDVector3 to the basePoint. - cylindricalJoint.basePoint = ReadBXDVector3_3_0(reader.ReadSubtree()); - break; - case "Axis": - // Assign the BXDVector3 to the axis. - cylindricalJoint.axis = ReadBXDVector3_3_0(reader.ReadSubtree()); - break; - } - break; - case "AngularLowLimit": - // Assign a value to the angularLimitLow. - cylindricalJoint.hasAngularLimit = true; - cylindricalJoint.angularLimitLow = float.Parse(reader.ReadElementContentAsString()); - break; - case "AngularHighLimit": - // Assign a value to the angularLimitHigh. - cylindricalJoint.angularLimitHigh = float.Parse(reader.ReadElementContentAsString()); - break; - case "LinearStartLimit": - // Assign a value to the linearLimitStart. - cylindricalJoint.hasLinearStartLimit = true; - cylindricalJoint.linearLimitStart = float.Parse(reader.ReadElementContentAsString()); - break; - case "LinearEndLimit": - // Assign a value to the linearLimitEnd. - cylindricalJoint.hasLinearEndLimit = true; - cylindricalJoint.linearLimitEnd = float.Parse(reader.ReadElementContentAsString()); - break; - case "CurrentLinearPosition": - // Assign a value to the currentLinearPosition. - cylindricalJoint.currentLinearPosition = float.Parse(reader.ReadElementContentAsString()); - break; - case "CurrentAngularPosition": - // Assign a value to the currentAngularPosition. - cylindricalJoint.currentAngularPosition = float.Parse(reader.ReadElementContentAsString()); - break; - } - } - - return cylindricalJoint; - } - - /// - /// Reads a LinearJoint_Base from the given XmlReader. - /// - /// - /// - private static LinearJoint_Base ReadLinearJoint_3_0(XmlReader reader) - { - // Create a new LinearJoint_Base. - LinearJoint_Base linearJoint = (LinearJoint_Base)SkeletalJoint_Base.JOINT_FACTORY(SkeletalJointType.LINEAR); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "BXDVector3": - switch (reader["VectorID"]) - { - case "BasePoint": - // Assign the BXDVector3 to the basePoint. - linearJoint.basePoint = ReadBXDVector3_3_0(reader.ReadSubtree()); - break; - case "Axis": - // Assign the BXDVector3 to the axis. - linearJoint.axis = ReadBXDVector3_3_0(reader.ReadSubtree()); - break; - } - break; - case "LinearLowLimit": - // Assign a value to the linearLimitLow. - linearJoint.hasLowerLimit = true; - linearJoint.linearLimitLow = float.Parse(reader.ReadElementContentAsString()); - break; - case "LinearUpperLimit": - // Assign a value to the linearLimitHigh. - linearJoint.hasUpperLimit = true; - linearJoint.linearLimitHigh = float.Parse(reader.ReadElementContentAsString()); - break; - case "CurrentLinearPosition": - // Assign a value to the currentLinearPosition. - linearJoint.currentLinearPosition = float.Parse(reader.ReadElementContentAsString()); - break; - } - } - - return linearJoint; - } - - /// - /// Reads a PlanarJoint_Base from the given XmlReader. - /// - /// - /// - private static PlanarJoint_Base ReadPlanarJoint_3_0(XmlReader reader) - { - // Create a new PlanarJoint_Base. - PlanarJoint_Base planarJoint = (PlanarJoint_Base)SkeletalJoint_Base.JOINT_FACTORY(SkeletalJointType.PLANAR); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "BXDVector3": - switch (reader["VectorID"]) - { - case "Normal": - // Assign the BXDVector3 to the normal. - planarJoint.normal = ReadBXDVector3_3_0(reader.ReadSubtree()); - break; - case "BasePoint": - // Assign the BXDVector3 to the basePoint.s - planarJoint.basePoint = ReadBXDVector3_3_0(reader.ReadSubtree()); - break; - } - break; - } - } - - return planarJoint; - } - - /// - /// Reads a RotationalJoint_Base from the given XmlReader. - /// - /// - /// - private static RotationalJoint_Base ReadRotationalJoint_3_0(XmlReader reader) - { - // Create a new RotationalJoint_Base. - RotationalJoint_Base rotationalJoint = (RotationalJoint_Base)SkeletalJoint_Base.JOINT_FACTORY(SkeletalJointType.ROTATIONAL); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "BXDVector3": - switch (reader["VectorID"]) - { - case "BasePoint": - // Read the BXDVector3 as the basePoint. - rotationalJoint.basePoint = ReadBXDVector3_3_0(reader.ReadSubtree()); - break; - case "Axis": - // Read the BXDVector3 as the axis. - rotationalJoint.axis = ReadBXDVector3_3_0(reader.ReadSubtree()); - break; - } - break; - case "AngularLowLimit": - // Assign the current element value to angularLimitLow. - rotationalJoint.hasAngularLimit = true; - rotationalJoint.angularLimitLow = float.Parse(reader.ReadElementContentAsString()); - break; - case "AngularHighLimit": - // Assign the current element value to angularLimitHigh. - rotationalJoint.angularLimitHigh = float.Parse(reader.ReadElementContentAsString()); - break; - case "CurrentAngularPosition": - // Assign the current element value to currentAngularPosition. - rotationalJoint.currentAngularPosition = float.Parse(reader.ReadElementContentAsString()); - break; - } - } - - return rotationalJoint; - } - - /// - /// Reads a BXDVector3 with the given XmlReader and returns the reading. - /// - /// - /// - private static BXDVector3 ReadBXDVector3_3_0(XmlReader reader) - { - BXDVector3 vec = new BXDVector3(); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "X": - // Assign the x value. - vec.x = float.Parse(reader.ReadElementContentAsString()); - break; - case "Y": - // Assign the y value. - vec.y = float.Parse(reader.ReadElementContentAsString()); - break; - case "Z": - // Assign the z value. - vec.z = float.Parse(reader.ReadElementContentAsString()); - break; - } - } - - return vec; - } - - /// - /// Reads a JointDriver from the given XmlReader. - /// - /// - /// - private static JointDriver ReadJointDriver_3_0(XmlReader reader) - { - JointDriver driver = null; - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "DriveType": - // Initialize the driver. - driver = new JointDriver((JointDriverType)Enum.Parse(typeof(JointDriverType), reader.ReadElementContentAsString())); - break; - case "PortA":// mismatched naming so we can keep backwards compatibility - // Assign a value to portA. - driver.port1 = reader.ReadElementContentAsInt(); - break; - case "PortB": - // Assign a value to port2. - driver.port2 = reader.ReadElementContentAsInt(); - break; - - case "InputGear": - // Assign a value to InputGear - driver.InputGear = reader.ReadElementContentAsDouble(); - break; - - case "OutputGear": - // Assign a value to OutputGear - driver.OutputGear = reader.ReadElementContentAsDouble(); - break; - - case "LowerLimit": - // Assign a value to the lowerLimit. - driver.lowerLimit = float.Parse(reader.ReadElementContentAsString()); - break; - case "UpperLimit": - // Assign a value to the upperLimit. - driver.upperLimit = float.Parse(reader.ReadElementContentAsString()); - break; - case "SignalType": - // Assign a value to isCan. - driver.isCan = reader.ReadElementContentAsString().Equals("CAN") ? true : false; - break; - case "ElevatorDriverMeta": - // Add an ElevatorDriverMeta. - driver.AddInfo(ReadElevatorDriverMeta_3_0(reader.ReadSubtree())); - break; - case "PneumaticDriverMeta": - // Add a PneumaticsDriverMeta. - driver.AddInfo(ReadPneumaticDriverMeta_3_0(reader.ReadSubtree())); - break; - case "WheelDriverMeta": - // Add a WheelDriverMeta. - driver.AddInfo(ReadWheelDriverMeta_3_0(reader.ReadSubtree())); - break; - } - } - - return driver; - } - - /// - /// Reads an ElevatorDriverMeta from the given XmlReader. - /// - /// - /// - private static ElevatorDriverMeta ReadElevatorDriverMeta_3_0(XmlReader reader) - { - // Create a new ElevatorDriveMeta. - ElevatorDriverMeta elevatorDriverMeta = new ElevatorDriverMeta(); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "ElevatorType": - // Assign the type to the current element value. - elevatorDriverMeta.type = (ElevatorType)Enum.Parse(typeof(ElevatorType), reader.ReadElementContentAsString()); - break; - } - } - - return elevatorDriverMeta; - } - - /// - /// Reads a PneumaticDriverMeta from the given XmlReader. - /// - /// - /// - private static PneumaticDriverMeta ReadPneumaticDriverMeta_3_0(XmlReader reader) - { - // Create a new pneumaticDriverMeta. - PneumaticDriverMeta pneumaticDriverMeta = new PneumaticDriverMeta(); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "WidthMM": - // Assign the current element value to widthMM. - pneumaticDriverMeta.widthMM = reader.ReadElementContentAsInt(); - break; - case "PressurePSI": - // Assign the current element value to pressurePSI. - pneumaticDriverMeta.pressurePSI = float.Parse(reader.ReadElementContentAsString()); - break; - } - } - - return pneumaticDriverMeta; - } - - /// - /// Reads a WheelDriverMeta from the given XmlReader. - /// - /// - /// - private static WheelDriverMeta ReadWheelDriverMeta_3_0(XmlReader reader) - { - // Create new WheelDriveMeta. - WheelDriverMeta wheelDriverMeta = new WheelDriverMeta(); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "WheelType": - // Assign a value to the type. - wheelDriverMeta.type = (WheelType)Enum.Parse(typeof(WheelType), reader.ReadElementContentAsString()); - break; - case "WheelRadius": - // Assign a value to the radius. - wheelDriverMeta.radius = float.Parse(reader.ReadElementContentAsString()); - break; - case "WheelWidth": - // Assign a value to the width. - wheelDriverMeta.width = float.Parse(reader.ReadElementContentAsString()); - break; - case "BXDVector3": - // Assign a value to the center. - wheelDriverMeta.center = ReadBXDVector3_3_0(reader.ReadSubtree()); - break; - case "ForwardAsympSlip": - // Assign a value to the forwardAsympSlip. - wheelDriverMeta.forwardAsympSlip = float.Parse(reader.ReadElementContentAsString()); - break; - case "ForwardAsympValue": - // Assign a value to the forwardAsympValue. - wheelDriverMeta.forwardAsympValue = float.Parse(reader.ReadElementContentAsString()); - break; - case "ForwardExtremeSlip": - // Assign a value to the forwardExtremeSlip. - wheelDriverMeta.forwardExtremeSlip = float.Parse(reader.ReadElementContentAsString()); - break; - case "ForwardExtremeValue": - // Assign a value to the forwardExtremeValue. - wheelDriverMeta.forwardExtremeValue = float.Parse(reader.ReadElementContentAsString()); - break; - case "SideAsympSlip": - // Assign a value to the sideAsympSlip. - wheelDriverMeta.sideAsympSlip = float.Parse(reader.ReadElementContentAsString()); - break; - case "SideAsympValue": - // Assign a value to the sideAsympValue. - wheelDriverMeta.sideAsympValue = float.Parse(reader.ReadElementContentAsString()); - break; - case "SideExtremeSlip": - // Assign a value to the sideExtremeSlip. - wheelDriverMeta.sideExtremeSlip = float.Parse(reader.ReadElementContentAsString()); - break; - case "SideExtremeValue": - // Assign a value to the sideExtremeValue. - wheelDriverMeta.sideExtremeValue = float.Parse(reader.ReadElementContentAsString()); - break; - case "IsDriveWheel": - // Assign a value to isDriveWheel. - wheelDriverMeta.isDriveWheel = reader.ReadElementContentAsBoolean(); - break; - } - } - - return wheelDriverMeta; - } - - /// - /// Read a RobotSensor from the given XmlReader. - /// - /// - /// - private static RobotSensor ReadRobotSensor_3_0(XmlReader reader) - { - RobotSensor robotSensor = null; - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "SensorType": - // Initialize the RobotSensor. - robotSensor = new RobotSensor((RobotSensorType)Enum.Parse(typeof(RobotSensorType), reader.ReadElementContentAsString())); - break; - case "SensorModule": - // Assign a value to the module. - short m = (short)reader.ReadElementContentAsInt(); - break; - case "SensorPort": - // Assign a value to the port. - short s = (short)reader.ReadElementContentAsInt(); - break; - case "Polynomial": - // Create a polynomial and assign it to the equation. - Polynomial e = ReadPolynomial_3_0(reader.ReadSubtree()); - break; - case "UseSecondarySource": - // Assign a value to useSecondarySource. - reader.ReadElementContentAsBoolean(); - break; - } - } - - return robotSensor; - } - - /// - /// Reads a Polynomial from the given XmlReader. - /// - /// - /// - private static Polynomial ReadPolynomial_3_0(XmlReader reader) - { - // Initialize a list of floats. - List coeff = new List(); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "Coefficient": - // Add a new coefficient to the list of floats. - coeff.Add(float.Parse(reader.ReadElementContentAsString())); - break; - } - } - - // Convert the list of floats to a Polynomial. - return new Polynomial(coeff.ToArray()); - } -} \ No newline at end of file diff --git a/api/Aardvark/IO/BXDJ/BXDJReader_4_0.cs b/api/Aardvark/IO/BXDJ/BXDJReader_4_0.cs deleted file mode 100644 index 6a9fd35cdc..0000000000 --- a/api/Aardvark/IO/BXDJ/BXDJReader_4_0.cs +++ /dev/null @@ -1,926 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Xml; -using System.Xml.Schema; - -/// -/// Utility functions for reading/writing BXDJ files in the engine -/// -public partial class BXDJSkeleton -{ - #region BXDJ Schema - - /// - /// The XSD markup to ensure valid document reading. - /// This is the schema that the engine reads against when reading back the BXDJ - /// - private const string BXDJ_XSD_4_0 = - @" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "; - - #endregion - - /// - /// Reads the skeleton contained in the XML BXDJ file specified and - /// returns the corresponding RigidNode_Base. - /// - /// - /// - private static RigidNode_Base ReadSkeleton_4_0(string path, bool useValidation = true) - { - RigidNode_Base root = null; - List nodes = new List(); - - XmlReaderSettings settings = new XmlReaderSettings(); - - if (useValidation)// if the schema should be validated, then run the BXDJ against the schema to make sure all the value are there, oftentimes robot instace invalid issues are found here - { - settings.Schemas.Add(XmlSchema.Read(new StringReader(BXDJ_XSD_4_0), null)); - settings.ValidationType = ValidationType.Schema; - } - else - { - settings.ValidationType = ValidationType.None; - } - - XmlReader reader = XmlReader.Create(path, settings); - - try - { - foreach (string name in IOUtilities.AllElements(reader))// iterates over all the top level data - { - switch (name)// handles reading the different XML tags - { - case "DriveTrainType": - // Reads the current element as a drive train type. - root.driveTrainType = (RigidNode_Base.DriveTrainType)Enum.Parse(typeof(RigidNode_Base.DriveTrainType), reader.ReadElementContentAsString()); - break; - case "Node": - // Reads the current element as a node. - ReadNode_4_0(reader.ReadSubtree(), nodes, ref root); - break; - } - } - } - catch (Exception)// A variety of exceptions can take place if the file is invalid, but we will always want to return null. - { - // If the file is invalid, return null. - return null; - } - finally - { - // Closes the reader. - reader.Close(); - } - - return nodes[0];// returns the base node of the skeleton - } - - /// - /// Reads a RigidNode_Base with the given reader, list of nodes, and root node reference. - /// - /// - /// - /// - private static void ReadNode_4_0(XmlReader reader, List nodes, ref RigidNode_Base root) - { - int parentID = -1; - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "Node": - // Adds a new node to the list of RigidNode_Bases. - nodes.Add(RigidNode_Base.NODE_FACTORY(new Guid(reader["GUID"]))); - break; - case "ParentID": - // Stores this ID for later use. - parentID = reader.ReadElementContentAsInt(); - - if (parentID == -1) // If this is the root... - root = nodes[nodes.Count - 1]; - break; - case "ModelFileName": - // Assigns the ModelFileName property to the ModelFileName element value. - nodes[nodes.Count - 1].ModelFileName = reader.ReadElementContentAsString(); - break; - case "ModelID": - // Assigns the ModelFullID property to the ModelID element value. - nodes[nodes.Count - 1].ModelFullID = reader.ReadElementContentAsString(); - break; - case "BallJoint": - // Reads the current element as a BallJoint. - nodes[parentID].AddChild(ReadBallJoint_4_0(reader.ReadSubtree()), nodes[nodes.Count - 1]); - break; - case "CylindricalJoint": - // Reads the current element as a CylindricalJoint. - nodes[parentID].AddChild(ReadCylindricalJoint_4_0(reader.ReadSubtree()), nodes[nodes.Count - 1]); - break; - case "LinearJoint": - // Reads the current element as a LinearJoint. - nodes[parentID].AddChild(ReadLinearJoint_4_0(reader.ReadSubtree()), nodes[nodes.Count - 1]); - break; - case "PlanarJoint": - // Reads the current element as a PlanarJoint. - nodes[parentID].AddChild(ReadPlanarJoint_4_0(reader.ReadSubtree()), nodes[nodes.Count - 1]); - break; - case "RotationalJoint": - // Reads the current elemenet as a RotationalJoint. - nodes[parentID].AddChild(ReadRotationalJoint_4_0(reader.ReadSubtree()), nodes[nodes.Count - 1]); - break; - case "JointDriver": - // Add a joint driver to the skeletal joint of the current node. - nodes[nodes.Count - 1].GetSkeletalJoint().cDriver = ReadJointDriver_4_0(reader.ReadSubtree()); - break; - case "RobotSensor": - // Add a sensor to the skeletal joint of the current node. - nodes[nodes.Count - 1].GetSkeletalJoint().attachedSensors.Add(ReadRobotSensor_4_0(reader.ReadSubtree())); - break; - } - } - } - - /// - /// Reads a BallJoint_Base from the given XmlReader. - /// - /// - /// - private static BallJoint_Base ReadBallJoint_4_0(XmlReader reader) - { - // Create a new BallJoint_Base. - BallJoint_Base ballJoint = (BallJoint_Base)SkeletalJoint_Base.JOINT_FACTORY(SkeletalJointType.BALL); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "BXDVector3": - // Read the BXDVector3 as the basePoint. - ballJoint.basePoint = ReadBXDVector4_0(reader.ReadSubtree()); - break; - } - } - - return ballJoint; - } - - /// - /// Reads a CylindricalJoint_Base from the given XmlReader. - /// - /// - /// - private static CylindricalJoint_Base ReadCylindricalJoint_4_0(XmlReader reader) - { - // Create a new CylindricalJoint_Base. - CylindricalJoint_Base cylindricalJoint = (CylindricalJoint_Base)SkeletalJoint_Base.JOINT_FACTORY(SkeletalJointType.CYLINDRICAL); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "BXDVector3": - switch (reader["VectorID"]) - { - case "BasePoint": - // Assign the BXDVector3 to the basePoint. - cylindricalJoint.basePoint = ReadBXDVector4_0(reader.ReadSubtree()); - break; - case "Axis": - // Assign the BXDVector3 to the axis. - cylindricalJoint.axis = ReadBXDVector4_0(reader.ReadSubtree()); - break; - } - break; - case "AngularLowLimit": - // Assign a value to the angularLimitLow. - cylindricalJoint.hasAngularLimit = true; - cylindricalJoint.angularLimitLow = float.Parse(reader.ReadElementContentAsString()); - break; - case "AngularHighLimit": - // Assign a value to the angularLimitHigh. - cylindricalJoint.angularLimitHigh = float.Parse(reader.ReadElementContentAsString()); - break; - case "LinearStartLimit": - // Assign a value to the linearLimitStart. - cylindricalJoint.hasLinearStartLimit = true; - cylindricalJoint.linearLimitStart = float.Parse(reader.ReadElementContentAsString()); - break; - case "LinearEndLimit": - // Assign a value to the linearLimitEnd. - cylindricalJoint.hasLinearEndLimit = true; - cylindricalJoint.linearLimitEnd = float.Parse(reader.ReadElementContentAsString()); - break; - case "CurrentLinearPosition": - // Assign a value to the currentLinearPosition. - cylindricalJoint.currentLinearPosition = float.Parse(reader.ReadElementContentAsString()); - break; - case "CurrentAngularPosition": - // Assign a value to the currentAngularPosition. - cylindricalJoint.currentAngularPosition = float.Parse(reader.ReadElementContentAsString()); - break; - } - } - - return cylindricalJoint; - } - - /// - /// Reads a LinearJoint_Base from the given XmlReader. - /// - /// - /// - private static LinearJoint_Base ReadLinearJoint_4_0(XmlReader reader) - { - // Create a new LinearJoint_Base. - LinearJoint_Base linearJoint = (LinearJoint_Base)SkeletalJoint_Base.JOINT_FACTORY(SkeletalJointType.LINEAR); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "BXDVector3": - switch (reader["VectorID"]) - { - case "BasePoint": - // Assign the BXDVector3 to the basePoint. - linearJoint.basePoint = ReadBXDVector4_0(reader.ReadSubtree()); - break; - case "Axis": - // Assign the BXDVector3 to the axis. - linearJoint.axis = ReadBXDVector4_0(reader.ReadSubtree()); - break; - } - break; - case "LinearLowLimit": - // Assign a value to the linearLimitLow. - linearJoint.hasLowerLimit = true; - linearJoint.linearLimitLow = float.Parse(reader.ReadElementContentAsString()); - break; - case "LinearUpperLimit": - // Assign a value to the linearLimitHigh. - linearJoint.hasUpperLimit = true; - linearJoint.linearLimitHigh = float.Parse(reader.ReadElementContentAsString()); - break; - case "CurrentLinearPosition": - // Assign a value to the currentLinearPosition. - linearJoint.currentLinearPosition = float.Parse(reader.ReadElementContentAsString()); - break; - } - } - - return linearJoint; - } - - /// - /// Reads a PlanarJoint_Base from the given XmlReader. - /// - /// - /// - private static PlanarJoint_Base ReadPlanarJoint_4_0(XmlReader reader) - { - // Create a new PlanarJoint_Base. - PlanarJoint_Base planarJoint = (PlanarJoint_Base)SkeletalJoint_Base.JOINT_FACTORY(SkeletalJointType.PLANAR); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "BXDVector3": - switch (reader["VectorID"]) - { - case "Normal": - // Assign the BXDVector3 to the normal. - planarJoint.normal = ReadBXDVector4_0(reader.ReadSubtree()); - break; - case "BasePoint": - // Assign the BXDVector3 to the basePoint.s - planarJoint.basePoint = ReadBXDVector4_0(reader.ReadSubtree()); - break; - } - break; - } - } - - return planarJoint; - } - - /// - /// Reads a RotationalJoint_Base from the given XmlReader. - /// - /// - /// - private static RotationalJoint_Base ReadRotationalJoint_4_0(XmlReader reader) - { - // Create a new RotationalJoint_Base. - RotationalJoint_Base rotationalJoint = (RotationalJoint_Base)SkeletalJoint_Base.JOINT_FACTORY(SkeletalJointType.ROTATIONAL); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "BXDVector3": - switch (reader["VectorID"]) - { - case "BasePoint": - // Read the BXDVector3 as the basePoint. - rotationalJoint.basePoint = ReadBXDVector4_0(reader.ReadSubtree()); - break; - case "Axis": - // Read the BXDVector3 as the axis. - rotationalJoint.axis = ReadBXDVector4_0(reader.ReadSubtree()); - break; - } - break; - case "AngularLowLimit": - // Assign the current element value to angularLimitLow. - rotationalJoint.hasAngularLimit = true; - rotationalJoint.angularLimitLow = float.Parse(reader.ReadElementContentAsString()); - break; - case "AngularHighLimit": - // Assign the current element value to angularLimitHigh. - rotationalJoint.angularLimitHigh = float.Parse(reader.ReadElementContentAsString()); - break; - case "CurrentAngularPosition": - // Assign the current element value to currentAngularPosition. - rotationalJoint.currentAngularPosition = float.Parse(reader.ReadElementContentAsString()); - break; - } - } - - return rotationalJoint; - } - - /// - /// Reads a BXDVector3 with the given XmlReader and returns the reading. - /// - /// - /// - private static BXDVector3 ReadBXDVector4_0(XmlReader reader) - { - BXDVector3 vec = new BXDVector3(); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "X": - // Assign the x value. - vec.x = float.Parse(reader.ReadElementContentAsString()); - break; - case "Y": - // Assign the y value. - vec.y = float.Parse(reader.ReadElementContentAsString()); - break; - case "Z": - // Assign the z value. - vec.z = float.Parse(reader.ReadElementContentAsString()); - break; - } - } - - return vec; - } - - /// - /// Reads a JointDriver from the given XmlReader. - /// - /// - /// - private static JointDriver ReadJointDriver_4_0(XmlReader reader) - { - JointDriver driver = null; - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "DriveType": - // Initialize the driver. - driver = new JointDriver((JointDriverType)Enum.Parse(typeof(JointDriverType), reader.ReadElementContentAsString())); - break; - case "Port1": - // Assign a value to port1. - driver.port1 = reader.ReadElementContentAsInt(); - break; - case "Port2": - // Assign a value to port2. - driver.port2 = reader.ReadElementContentAsInt(); - break; - - case "InputGear": - // Assign a value to InputGear - driver.InputGear = reader.ReadElementContentAsDouble(); - break; - - case "OutputGear": - // Assign a value to OutputGear - driver.OutputGear = reader.ReadElementContentAsDouble(); - break; - - case "LowerLimit": - // Assign a value to the lowerLimit. - driver.lowerLimit = float.Parse(reader.ReadElementContentAsString()); - break; - case "UpperLimit": - // Assign a value to the upperLimit. - driver.upperLimit = float.Parse(reader.ReadElementContentAsString()); - break; - case "SignalType": - // Assign a value to isCan. - driver.isCan = reader.ReadElementContentAsString().Equals("CAN") ? true : false; - break; - case "ElevatorDriverMeta": - // Add an ElevatorDriverMeta. - driver.AddInfo(ReadElevatorDriverMeta_4_0(reader.ReadSubtree())); - break; - case "PneumaticDriverMeta": - // Add a PneumaticsDriverMeta. - driver.AddInfo(ReadPneumaticDriverMeta_4_0(reader.ReadSubtree())); - break; - case "WheelDriverMeta": - // Add a WheelDriverMeta. - driver.AddInfo(ReadWheelDriverMeta_4_0(reader.ReadSubtree())); - break; - } - } - - return driver; - } - - /// - /// Reads an ElevatorDriverMeta from the given XmlReader. - /// - /// - /// - private static ElevatorDriverMeta ReadElevatorDriverMeta_4_0(XmlReader reader) - { - // Create a new ElevatorDriveMeta. - ElevatorDriverMeta elevatorDriverMeta = new ElevatorDriverMeta(); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "ElevatorType": - // Assign the type to the current element value. - elevatorDriverMeta.type = (ElevatorType)Enum.Parse(typeof(ElevatorType), reader.ReadElementContentAsString()); - break; - } - } - - return elevatorDriverMeta; - } - - /// - /// Reads a PneumaticDriverMeta from the given XmlReader. - /// - /// - /// - private static PneumaticDriverMeta ReadPneumaticDriverMeta_4_0(XmlReader reader) - { - // Create a new pneumaticDriverMeta. - PneumaticDriverMeta pneumaticDriverMeta = new PneumaticDriverMeta(); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "WidthMM": - // Assign the current element value to widthMM. - pneumaticDriverMeta.widthMM = reader.ReadElementContentAsInt(); - break; - case "PressurePSI": - // Assign the current element value to pressurePSI. - pneumaticDriverMeta.pressurePSI = float.Parse(reader.ReadElementContentAsString()); - break; - } - } - - return pneumaticDriverMeta; - } - - /// - /// Reads a WheelDriverMeta from the given XmlReader. - /// - /// - /// - private static WheelDriverMeta ReadWheelDriverMeta_4_0(XmlReader reader) - { - // Create new WheelDriveMeta. - WheelDriverMeta wheelDriverMeta = new WheelDriverMeta(); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "WheelType": - // Assign a value to the type. - wheelDriverMeta.type = (WheelType)Enum.Parse(typeof(WheelType), reader.ReadElementContentAsString()); - break; - case "WheelRadius": - // Assign a value to the radius. - wheelDriverMeta.radius = float.Parse(reader.ReadElementContentAsString()); - break; - case "WheelWidth": - // Assign a value to the width. - wheelDriverMeta.width = float.Parse(reader.ReadElementContentAsString()); - break; - case "BXDVector3": - // Assign a value to the center. - wheelDriverMeta.center = ReadBXDVector4_0(reader.ReadSubtree()); - break; - case "ForwardAsympSlip": - // Assign a value to the forwardAsympSlip. - wheelDriverMeta.forwardAsympSlip = float.Parse(reader.ReadElementContentAsString()); - break; - case "ForwardAsympValue": - // Assign a value to the forwardAsympValue. - wheelDriverMeta.forwardAsympValue = float.Parse(reader.ReadElementContentAsString()); - break; - case "ForwardExtremeSlip": - // Assign a value to the forwardExtremeSlip. - wheelDriverMeta.forwardExtremeSlip = float.Parse(reader.ReadElementContentAsString()); - break; - case "ForwardExtremeValue": - // Assign a value to the forwardExtremeValue. - wheelDriverMeta.forwardExtremeValue = float.Parse(reader.ReadElementContentAsString()); - break; - case "SideAsympSlip": - // Assign a value to the sideAsympSlip. - wheelDriverMeta.sideAsympSlip = float.Parse(reader.ReadElementContentAsString()); - break; - case "SideAsympValue": - // Assign a value to the sideAsympValue. - wheelDriverMeta.sideAsympValue = float.Parse(reader.ReadElementContentAsString()); - break; - case "SideExtremeSlip": - // Assign a value to the sideExtremeSlip. - wheelDriverMeta.sideExtremeSlip = float.Parse(reader.ReadElementContentAsString()); - break; - case "SideExtremeValue": - // Assign a value to the sideExtremeValue. - wheelDriverMeta.sideExtremeValue = float.Parse(reader.ReadElementContentAsString()); - break; - case "IsDriveWheel": - // Assign a value to isDriveWheel. - wheelDriverMeta.isDriveWheel = reader.ReadElementContentAsBoolean(); - break; - } - } - - return wheelDriverMeta; - } - - /// - /// Read a RobotSensor from the given XmlReader. - /// - /// - /// - private static RobotSensor ReadRobotSensor_4_0(XmlReader reader) - { - RobotSensor robotSensor = null; - //throw (new Exception("Reading thing")); - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "SensorType": - // Initialize the RobotSensor. - robotSensor = new RobotSensor((RobotSensorType)Enum.Parse(typeof(RobotSensorType), reader.ReadElementContentAsString())); - break; - case "SensorPortNumberA": - // Assign a value to the 1st port. - robotSensor.portA = float.Parse(reader.ReadElementContentAsString()); - break; - case "SensorSignalTypeA": - // Assign a value to the 2nd port. - robotSensor.conTypePortA = (SensorConnectionType)Enum.Parse(typeof(SensorConnectionType), reader.ReadElementContentAsString()); - break; - case "SensorPortNumberB": - // Assign a port type to the 1st port - robotSensor.portB = float.Parse(reader.ReadElementContentAsString()); - break; - case "SensorSignalTypeB": - // Assign a port type to the 1st port - robotSensor.conTypePortB = (SensorConnectionType)Enum.Parse(typeof(SensorConnectionType), reader.ReadElementContentAsString()); - break; - case "SensorConversionFactor": - // assings the generic conversion facter, this is a different type/ unit for every robot (CPR in encoders) - robotSensor.conversionFactor = double.Parse(reader.ReadElementContentAsString()); - if(robotSensor.conversionFactor == 0) - { - robotSensor.conversionFactor = 1; - } - break; - } - } - - return robotSensor; - } -} diff --git a/api/Aardvark/IO/BXDJ/BXDJReader_4_1.cs b/api/Aardvark/IO/BXDJ/BXDJReader_4_1.cs deleted file mode 100644 index cf01a5e3cb..0000000000 --- a/api/Aardvark/IO/BXDJ/BXDJReader_4_1.cs +++ /dev/null @@ -1,932 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Xml; -using System.Xml.Schema; - -/// -/// Utility functions for reading/writing BXDJ files in the engine -/// -public partial class BXDJSkeleton -{ - #region BXDJ Schema - - /// - /// The XSD markup to ensure valid document reading. - /// This is the schema that the engine reads against when reading back the BXDJ - /// - private const string BXDJ_XSD_4_1 = - @" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "; - - #endregion - - /// - /// Reads the skeleton contained in the XML BXDJ file specified and - /// returns the corresponding RigidNode_Base. - /// - /// - /// - private static RigidNode_Base ReadSkeleton_4_1(string path, bool useValidation = true) - { - RigidNode_Base root = null; - List nodes = new List(); - - XmlReaderSettings settings = new XmlReaderSettings(); - - if (useValidation)// if the schema should be validated, then run the BXDJ against the schema to make sure all the value are there, oftentimes robot instace invalid issues are found here - { - settings.Schemas.Add(XmlSchema.Read(new StringReader(BXDJ_XSD_4_1), null)); - settings.ValidationType = ValidationType.Schema; - } - else - { - settings.ValidationType = ValidationType.None; - } - - XmlReader reader = XmlReader.Create(path, settings); - - try - { - foreach (string name in IOUtilities.AllElements(reader))// iterates over all the top level data - { - switch (name)// handles reading the different XML tags - { - case "DriveTrainType": - // Reads the current element as a drive train type. - root.driveTrainType = (RigidNode_Base.DriveTrainType)Enum.Parse(typeof(RigidNode_Base.DriveTrainType), reader.ReadElementContentAsString()); - break; - case "Node": - // Reads the current element as a node. - ReadNode_4_1(reader.ReadSubtree(), nodes, ref root); - break; - } - } - } - catch (Exception)// A variety of exceptions can take place if the file is invalid, but we will always want to return null. - { - // If the file is invalid, return null. - return null; - } - finally - { - // Closes the reader. - reader.Close(); - } - - return nodes[0];// returns the base node of the skeleton - } - - /// - /// Reads a RigidNode_Base with the given reader, list of nodes, and root node reference. - /// - /// - /// - /// - private static void ReadNode_4_1(XmlReader reader, List nodes, ref RigidNode_Base root) - { - int parentID = -1; - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "Node": - // Adds a new node to the list of RigidNode_Bases. - nodes.Add(RigidNode_Base.NODE_FACTORY(new Guid(reader["GUID"]))); - break; - case "ParentID": - // Stores this ID for later use. - parentID = reader.ReadElementContentAsInt(); - - if (parentID == -1) // If this is the root... - root = nodes[nodes.Count - 1]; - break; - case "ModelFileName": - // Assigns the ModelFileName property to the ModelFileName element value. - nodes[nodes.Count - 1].ModelFileName = reader.ReadElementContentAsString(); - break; - case "ModelID": - // Assigns the ModelFullID property to the ModelID element value. - nodes[nodes.Count - 1].ModelFullID = reader.ReadElementContentAsString(); - break; - case "BallJoint": - // Reads the current element as a BallJoint. - nodes[parentID].AddChild(ReadBallJoint_4_1(reader.ReadSubtree()), nodes[nodes.Count - 1]); - break; - case "CylindricalJoint": - // Reads the current element as a CylindricalJoint. - nodes[parentID].AddChild(ReadCylindricalJoint_4_1(reader.ReadSubtree()), nodes[nodes.Count - 1]); - break; - case "LinearJoint": - // Reads the current element as a LinearJoint. - nodes[parentID].AddChild(ReadLinearJoint_4_1(reader.ReadSubtree()), nodes[nodes.Count - 1]); - break; - case "PlanarJoint": - // Reads the current element as a PlanarJoint. - nodes[parentID].AddChild(ReadPlanarJoint_4_1(reader.ReadSubtree()), nodes[nodes.Count - 1]); - break; - case "RotationalJoint": - // Reads the current elemenet as a RotationalJoint. - nodes[parentID].AddChild(ReadRotationalJoint_4_1(reader.ReadSubtree()), nodes[nodes.Count - 1]); - break; - case "JointDriver": - // Add a joint driver to the skeletal joint of the current node. - nodes[nodes.Count - 1].GetSkeletalJoint().cDriver = ReadJointDriver_4_1(reader.ReadSubtree()); - break; - case "RobotSensor": - // Add a sensor to the skeletal joint of the current node. - nodes[nodes.Count - 1].GetSkeletalJoint().attachedSensors.Add(ReadRobotSensor_4_1(reader.ReadSubtree())); - break; - } - } - } - - /// - /// Reads a BallJoint_Base from the given XmlReader. - /// - /// - /// - private static BallJoint_Base ReadBallJoint_4_1(XmlReader reader) - { - // Create a new BallJoint_Base. - BallJoint_Base ballJoint = (BallJoint_Base)SkeletalJoint_Base.JOINT_FACTORY(SkeletalJointType.BALL); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "BXDVector3": - // Read the BXDVector3 as the basePoint. - ballJoint.basePoint = ReadBXDVector4_1(reader.ReadSubtree()); - break; - } - } - - return ballJoint; - } - - /// - /// Reads a CylindricalJoint_Base from the given XmlReader. - /// - /// - /// - private static CylindricalJoint_Base ReadCylindricalJoint_4_1(XmlReader reader) - { - // Create a new CylindricalJoint_Base. - CylindricalJoint_Base cylindricalJoint = (CylindricalJoint_Base)SkeletalJoint_Base.JOINT_FACTORY(SkeletalJointType.CYLINDRICAL); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "BXDVector3": - switch (reader["VectorID"]) - { - case "BasePoint": - // Assign the BXDVector3 to the basePoint. - cylindricalJoint.basePoint = ReadBXDVector4_1(reader.ReadSubtree()); - break; - case "Axis": - // Assign the BXDVector3 to the axis. - cylindricalJoint.axis = ReadBXDVector4_1(reader.ReadSubtree()); - break; - } - break; - case "AngularLowLimit": - // Assign a value to the angularLimitLow. - cylindricalJoint.hasAngularLimit = true; - cylindricalJoint.angularLimitLow = float.Parse(reader.ReadElementContentAsString()); - break; - case "AngularHighLimit": - // Assign a value to the angularLimitHigh. - cylindricalJoint.angularLimitHigh = float.Parse(reader.ReadElementContentAsString()); - break; - case "LinearStartLimit": - // Assign a value to the linearLimitStart. - cylindricalJoint.hasLinearStartLimit = true; - cylindricalJoint.linearLimitStart = float.Parse(reader.ReadElementContentAsString()); - break; - case "LinearEndLimit": - // Assign a value to the linearLimitEnd. - cylindricalJoint.hasLinearEndLimit = true; - cylindricalJoint.linearLimitEnd = float.Parse(reader.ReadElementContentAsString()); - break; - case "CurrentLinearPosition": - // Assign a value to the currentLinearPosition. - cylindricalJoint.currentLinearPosition = float.Parse(reader.ReadElementContentAsString()); - break; - case "CurrentAngularPosition": - // Assign a value to the currentAngularPosition. - cylindricalJoint.currentAngularPosition = float.Parse(reader.ReadElementContentAsString()); - break; - } - } - - return cylindricalJoint; - } - - /// - /// Reads a LinearJoint_Base from the given XmlReader. - /// - /// - /// - private static LinearJoint_Base ReadLinearJoint_4_1(XmlReader reader) - { - // Create a new LinearJoint_Base. - LinearJoint_Base linearJoint = (LinearJoint_Base)SkeletalJoint_Base.JOINT_FACTORY(SkeletalJointType.LINEAR); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "BXDVector3": - switch (reader["VectorID"]) - { - case "BasePoint": - // Assign the BXDVector3 to the basePoint. - linearJoint.basePoint = ReadBXDVector4_1(reader.ReadSubtree()); - break; - case "Axis": - // Assign the BXDVector3 to the axis. - linearJoint.axis = ReadBXDVector4_1(reader.ReadSubtree()); - break; - } - break; - case "LinearLowLimit": - // Assign a value to the linearLimitLow. - linearJoint.hasLowerLimit = true; - linearJoint.linearLimitLow = float.Parse(reader.ReadElementContentAsString()); - break; - case "LinearUpperLimit": - // Assign a value to the linearLimitHigh. - linearJoint.hasUpperLimit = true; - linearJoint.linearLimitHigh = float.Parse(reader.ReadElementContentAsString()); - break; - case "CurrentLinearPosition": - // Assign a value to the currentLinearPosition. - linearJoint.currentLinearPosition = float.Parse(reader.ReadElementContentAsString()); - break; - } - } - - return linearJoint; - } - - /// - /// Reads a PlanarJoint_Base from the given XmlReader. - /// - /// - /// - private static PlanarJoint_Base ReadPlanarJoint_4_1(XmlReader reader) - { - // Create a new PlanarJoint_Base. - PlanarJoint_Base planarJoint = (PlanarJoint_Base)SkeletalJoint_Base.JOINT_FACTORY(SkeletalJointType.PLANAR); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "BXDVector3": - switch (reader["VectorID"]) - { - case "Normal": - // Assign the BXDVector3 to the normal. - planarJoint.normal = ReadBXDVector4_1(reader.ReadSubtree()); - break; - case "BasePoint": - // Assign the BXDVector3 to the basePoint.s - planarJoint.basePoint = ReadBXDVector4_1(reader.ReadSubtree()); - break; - } - break; - } - } - - return planarJoint; - } - - /// - /// Reads a RotationalJoint_Base from the given XmlReader. - /// - /// - /// - private static RotationalJoint_Base ReadRotationalJoint_4_1(XmlReader reader) - { - // Create a new RotationalJoint_Base. - RotationalJoint_Base rotationalJoint = (RotationalJoint_Base)SkeletalJoint_Base.JOINT_FACTORY(SkeletalJointType.ROTATIONAL); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "BXDVector3": - switch (reader["VectorID"]) - { - case "BasePoint": - // Read the BXDVector3 as the basePoint. - rotationalJoint.basePoint = ReadBXDVector4_1(reader.ReadSubtree()); - break; - case "Axis": - // Read the BXDVector3 as the axis. - rotationalJoint.axis = ReadBXDVector4_1(reader.ReadSubtree()); - break; - } - break; - case "AngularLowLimit": - // Assign the current element value to angularLimitLow. - rotationalJoint.hasAngularLimit = true; - rotationalJoint.angularLimitLow = float.Parse(reader.ReadElementContentAsString()); - break; - case "AngularHighLimit": - // Assign the current element value to angularLimitHigh. - rotationalJoint.angularLimitHigh = float.Parse(reader.ReadElementContentAsString()); - break; - case "CurrentAngularPosition": - // Assign the current element value to currentAngularPosition. - rotationalJoint.currentAngularPosition = float.Parse(reader.ReadElementContentAsString()); - break; - } - } - - return rotationalJoint; - } - - /// - /// Reads a BXDVector3 with the given XmlReader and returns the reading. - /// - /// - /// - private static BXDVector3 ReadBXDVector4_1(XmlReader reader) - { - BXDVector3 vec = new BXDVector3(); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "X": - // Assign the x value. - vec.x = float.Parse(reader.ReadElementContentAsString()); - break; - case "Y": - // Assign the y value. - vec.y = float.Parse(reader.ReadElementContentAsString()); - break; - case "Z": - // Assign the z value. - vec.z = float.Parse(reader.ReadElementContentAsString()); - break; - } - } - - return vec; - } - - /// - /// Reads a JointDriver from the given XmlReader. - /// - /// - /// - private static JointDriver ReadJointDriver_4_1(XmlReader reader) - { - JointDriver driver = null; - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "DriveType": - // Initialize the driver. - driver = new JointDriver((JointDriverType)Enum.Parse(typeof(JointDriverType), reader.ReadElementContentAsString())); - break; - case "Port1": - // Assign a value to port1. - driver.port1 = reader.ReadElementContentAsInt(); - break; - case "Port2": - // Assign a value to port2. - driver.port2 = reader.ReadElementContentAsInt(); - break; - - case "InputGear": - // Assign a value to InputGear - driver.InputGear = reader.ReadElementContentAsDouble(); - break; - - case "OutputGear": - // Assign a value to OutputGear - driver.OutputGear = reader.ReadElementContentAsDouble(); - break; - - case "LowerLimit": - // Assign a value to the lowerLimit. - driver.lowerLimit = float.Parse(reader.ReadElementContentAsString()); - break; - case "UpperLimit": - // Assign a value to the upperLimit. - driver.upperLimit = float.Parse(reader.ReadElementContentAsString()); - break; - case "HasBrake": - // Assign a value to the upperLimit. - driver.hasBrake = reader.ReadElementContentAsBoolean(); - break; - case "SignalType": - // Assign a value to isCan. - driver.isCan = reader.ReadElementContentAsString().Equals("CAN") ? true : false; - break; - case "ElevatorDriverMeta": - // Add an ElevatorDriverMeta. - driver.AddInfo(ReadElevatorDriverMeta_4_1(reader.ReadSubtree())); - break; - case "PneumaticDriverMeta": - // Add a PneumaticsDriverMeta. - driver.AddInfo(ReadPneumaticDriverMeta_4_1(reader.ReadSubtree())); - break; - case "WheelDriverMeta": - // Add a WheelDriverMeta. - driver.AddInfo(ReadWheelDriverMeta_4_1(reader.ReadSubtree())); - break; - } - } - - return driver; - } - - /// - /// Reads an ElevatorDriverMeta from the given XmlReader. - /// - /// - /// - private static ElevatorDriverMeta ReadElevatorDriverMeta_4_1(XmlReader reader) - { - // Create a new ElevatorDriveMeta. - ElevatorDriverMeta elevatorDriverMeta = new ElevatorDriverMeta(); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "ElevatorType": - // Assign the type to the current element value. - elevatorDriverMeta.type = (ElevatorType)Enum.Parse(typeof(ElevatorType), reader.ReadElementContentAsString()); - break; - } - } - - return elevatorDriverMeta; - } - - /// - /// Reads a PneumaticDriverMeta from the given XmlReader. - /// - /// - /// - private static PneumaticDriverMeta ReadPneumaticDriverMeta_4_1(XmlReader reader) - { - // Create a new pneumaticDriverMeta. - PneumaticDriverMeta pneumaticDriverMeta = new PneumaticDriverMeta(); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "WidthMM": - // Assign the current element value to widthMM. - pneumaticDriverMeta.widthMM = reader.ReadElementContentAsInt(); - break; - case "PressurePSI": - // Assign the current element value to pressurePSI. - pneumaticDriverMeta.pressurePSI = float.Parse(reader.ReadElementContentAsString()); - break; - } - } - - return pneumaticDriverMeta; - } - - /// - /// Reads a WheelDriverMeta from the given XmlReader. - /// - /// - /// - private static WheelDriverMeta ReadWheelDriverMeta_4_1(XmlReader reader) - { - // Create new WheelDriveMeta. - WheelDriverMeta wheelDriverMeta = new WheelDriverMeta(); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "WheelType": - // Assign a value to the type. - wheelDriverMeta.type = (WheelType)Enum.Parse(typeof(WheelType), reader.ReadElementContentAsString()); - break; - case "WheelRadius": - // Assign a value to the radius. - wheelDriverMeta.radius = float.Parse(reader.ReadElementContentAsString()); - break; - case "WheelWidth": - // Assign a value to the width. - wheelDriverMeta.width = float.Parse(reader.ReadElementContentAsString()); - break; - case "BXDVector3": - // Assign a value to the center. - wheelDriverMeta.center = ReadBXDVector4_1(reader.ReadSubtree()); - break; - case "ForwardAsympSlip": - // Assign a value to the forwardAsympSlip. - wheelDriverMeta.forwardAsympSlip = float.Parse(reader.ReadElementContentAsString()); - break; - case "ForwardAsympValue": - // Assign a value to the forwardAsympValue. - wheelDriverMeta.forwardAsympValue = float.Parse(reader.ReadElementContentAsString()); - break; - case "ForwardExtremeSlip": - // Assign a value to the forwardExtremeSlip. - wheelDriverMeta.forwardExtremeSlip = float.Parse(reader.ReadElementContentAsString()); - break; - case "ForwardExtremeValue": - // Assign a value to the forwardExtremeValue. - wheelDriverMeta.forwardExtremeValue = float.Parse(reader.ReadElementContentAsString()); - break; - case "SideAsympSlip": - // Assign a value to the sideAsympSlip. - wheelDriverMeta.sideAsympSlip = float.Parse(reader.ReadElementContentAsString()); - break; - case "SideAsympValue": - // Assign a value to the sideAsympValue. - wheelDriverMeta.sideAsympValue = float.Parse(reader.ReadElementContentAsString()); - break; - case "SideExtremeSlip": - // Assign a value to the sideExtremeSlip. - wheelDriverMeta.sideExtremeSlip = float.Parse(reader.ReadElementContentAsString()); - break; - case "SideExtremeValue": - // Assign a value to the sideExtremeValue. - wheelDriverMeta.sideExtremeValue = float.Parse(reader.ReadElementContentAsString()); - break; - case "IsDriveWheel": - // Assign a value to isDriveWheel. - wheelDriverMeta.isDriveWheel = reader.ReadElementContentAsBoolean(); - break; - } - } - - return wheelDriverMeta; - } - - /// - /// Read a RobotSensor from the given XmlReader. - /// - /// - /// - private static RobotSensor ReadRobotSensor_4_1(XmlReader reader) - { - RobotSensor robotSensor = null; - //throw (new Exception("Reading thing")); - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "SensorType": - // Initialize the RobotSensor. - robotSensor = new RobotSensor((RobotSensorType)Enum.Parse(typeof(RobotSensorType), reader.ReadElementContentAsString())); - break; - case "SensorPortNumberA": - // Assign a value to the 1st port. - robotSensor.portA = float.Parse(reader.ReadElementContentAsString()); - break; - case "SensorSignalTypeA": - // Assign a value to the 2nd port. - robotSensor.conTypePortA = (SensorConnectionType)Enum.Parse(typeof(SensorConnectionType), reader.ReadElementContentAsString()); - break; - case "SensorPortNumberB": - // Assign a port type to the 1st port - robotSensor.portB = float.Parse(reader.ReadElementContentAsString()); - break; - case "SensorSignalTypeB": - // Assign a port type to the 1st port - robotSensor.conTypePortB = (SensorConnectionType)Enum.Parse(typeof(SensorConnectionType), reader.ReadElementContentAsString()); - break; - case "SensorConversionFactor": - // assings the generic conversion facter, this is a different type/ unit for every robot (CPR in encoders) - robotSensor.conversionFactor = double.Parse(reader.ReadElementContentAsString()); - if(robotSensor.conversionFactor == 0) - { - robotSensor.conversionFactor = 1; - } - break; - } - } - - return robotSensor; - } -} diff --git a/api/Aardvark/IO/BXDJ/BXDJReader_4_2.cs b/api/Aardvark/IO/BXDJ/BXDJReader_4_2.cs deleted file mode 100644 index 3bb0b879b9..0000000000 --- a/api/Aardvark/IO/BXDJ/BXDJReader_4_2.cs +++ /dev/null @@ -1,982 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Xml; -using System.Xml.Schema; - -/// -/// Utility functions for reading/writing BXDJ files in the engine -/// -public partial class BXDJSkeleton -{ - #region BXDJ Schema - - /// - /// The XSD markup to ensure valid document reading. - /// This is the schema that the engine reads against when reading back the BXDJ - /// - private const string BXDJ_XSD_4_2 = - @" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "; - - #endregion - - /// - /// Reads the skeleton contained in the XML BXDJ file specified and - /// returns the corresponding RigidNode_Base. - /// - /// - /// - private static RigidNode_Base ReadSkeleton_4_2(string path, bool useValidation = true) - { - RigidNode_Base root = null; - List nodes = new List(); - - XmlReaderSettings settings = new XmlReaderSettings(); - - if (useValidation)// if the schema should be validated, then run the BXDJ against the schema to make sure all the value are there, oftentimes robot instace invalid issues are found here - { - settings.Schemas.Add(XmlSchema.Read(new StringReader(BXDJ_XSD_4_2), null)); - settings.ValidationType = ValidationType.Schema; - } - else - { - settings.ValidationType = ValidationType.None; - } - - XmlReader reader = XmlReader.Create(path, settings); - - try - { - foreach (string name in IOUtilities.AllElements(reader))// iterates over all the top level data - { - switch (name)// handles reading the different XML tags - { - case "DriveTrainType": - // Reads the current element as a drive train type. - root.driveTrainType = (RigidNode_Base.DriveTrainType)Enum.Parse(typeof(RigidNode_Base.DriveTrainType), reader.ReadElementContentAsString()); - break; - case "SoftwareExportedWith": - // Reads the current element as a drive train type. - root.exportedWith = (RigidNode_Base.SoftwareExportedWith)Enum.Parse(typeof(RigidNode_Base.SoftwareExportedWith), reader.ReadElementContentAsString()); - break; - case "Node": - // Reads the current element as a node. - ReadNode_4_2(reader.ReadSubtree(), nodes, ref root); - break; - } - } - } - catch (Exception)// A variety of exceptions can take place if the file is invalid, but we will always want to return null. - { - // If the file is invalid, return null. - return null; - } - finally - { - // Closes the reader. - reader.Close(); - } - - return nodes[0];// returns the base node of the skeleton - } - - /// - /// Reads a RigidNode_Base with the given reader, list of nodes, and root node reference. - /// - /// - /// - /// - private static void ReadNode_4_2(XmlReader reader, List nodes, ref RigidNode_Base root) - { - int parentID = -1; - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "Node": - // Adds a new node to the list of RigidNode_Bases. - nodes.Add(RigidNode_Base.NODE_FACTORY(new Guid(reader["GUID"]))); - break; - case "ParentID": - // Stores this ID for later use. - parentID = reader.ReadElementContentAsInt(); - - if (parentID == -1) // If this is the root... - root = nodes[nodes.Count - 1]; - break; - case "ModelFileName": - // Assigns the ModelFileName property to the ModelFileName element value. - nodes[nodes.Count - 1].ModelFileName = reader.ReadElementContentAsString(); - break; - case "ModelID": - // Assigns the ModelFullID property to the ModelID element value. - nodes[nodes.Count - 1].ModelFullID = reader.ReadElementContentAsString(); - break; - case "BallJoint": - // Reads the current element as a BallJoint. - nodes[parentID].AddChild(ReadBallJoint_4_2(reader.ReadSubtree()), nodes[nodes.Count - 1]); - break; - case "CylindricalJoint": - // Reads the current element as a CylindricalJoint. - nodes[parentID].AddChild(ReadCylindricalJoint_4_2(reader.ReadSubtree()), nodes[nodes.Count - 1]); - break; - case "LinearJoint": - // Reads the current element as a LinearJoint. - nodes[parentID].AddChild(ReadLinearJoint_4_2(reader.ReadSubtree()), nodes[nodes.Count - 1]); - break; - case "PlanarJoint": - // Reads the current element as a PlanarJoint. - nodes[parentID].AddChild(ReadPlanarJoint_4_2(reader.ReadSubtree()), nodes[nodes.Count - 1]); - break; - case "RotationalJoint": - // Reads the current elemenet as a RotationalJoint. - nodes[parentID].AddChild(ReadRotationalJoint_4_2(reader.ReadSubtree()), nodes[nodes.Count - 1]); - break; - case "JointDriver": - // Add a joint driver to the skeletal joint of the current node. - nodes[nodes.Count - 1].GetSkeletalJoint().cDriver = ReadJointDriver_4_2(reader.ReadSubtree()); - break; - case "RobotSensor": - // Add a sensor to the skeletal joint of the current node. - nodes[nodes.Count - 1].GetSkeletalJoint().attachedSensors.Add(ReadRobotSensor_4_2(reader.ReadSubtree())); - break; - } - } - } - - /// - /// Reads a BallJoint_Base from the given XmlReader. - /// - /// - /// - private static BallJoint_Base ReadBallJoint_4_2(XmlReader reader) - { - // Create a new BallJoint_Base. - BallJoint_Base ballJoint = (BallJoint_Base)SkeletalJoint_Base.JOINT_FACTORY(SkeletalJointType.BALL); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "BXDVector3": - // Read the BXDVector3 as the basePoint. - ballJoint.basePoint = ReadBXDVector4_2(reader.ReadSubtree()); - break; - } - } - - return ballJoint; - } - - /// - /// Reads a CylindricalJoint_Base from the given XmlReader. - /// - /// - /// - private static CylindricalJoint_Base ReadCylindricalJoint_4_2(XmlReader reader) - { - // Create a new CylindricalJoint_Base. - CylindricalJoint_Base cylindricalJoint = (CylindricalJoint_Base)SkeletalJoint_Base.JOINT_FACTORY(SkeletalJointType.CYLINDRICAL); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "BXDVector3": - switch (reader["VectorID"]) - { - case "BasePoint": - // Assign the BXDVector3 to the basePoint. - cylindricalJoint.basePoint = ReadBXDVector4_2(reader.ReadSubtree()); - break; - case "Axis": - // Assign the BXDVector3 to the axis. - cylindricalJoint.axis = ReadBXDVector4_2(reader.ReadSubtree()); - break; - } - break; - case "AngularLowLimit": - // Assign a value to the angularLimitLow. - cylindricalJoint.hasAngularLimit = true; - cylindricalJoint.angularLimitLow = float.Parse(reader.ReadElementContentAsString()); - break; - case "AngularHighLimit": - // Assign a value to the angularLimitHigh. - cylindricalJoint.angularLimitHigh = float.Parse(reader.ReadElementContentAsString()); - break; - case "LinearStartLimit": - // Assign a value to the linearLimitStart. - cylindricalJoint.hasLinearStartLimit = true; - cylindricalJoint.linearLimitStart = float.Parse(reader.ReadElementContentAsString()); - break; - case "LinearEndLimit": - // Assign a value to the linearLimitEnd. - cylindricalJoint.hasLinearEndLimit = true; - cylindricalJoint.linearLimitEnd = float.Parse(reader.ReadElementContentAsString()); - break; - case "CurrentLinearPosition": - // Assign a value to the currentLinearPosition. - cylindricalJoint.currentLinearPosition = float.Parse(reader.ReadElementContentAsString()); - break; - case "CurrentAngularPosition": - // Assign a value to the currentAngularPosition. - cylindricalJoint.currentAngularPosition = float.Parse(reader.ReadElementContentAsString()); - break; - } - } - - return cylindricalJoint; - } - - /// - /// Reads a LinearJoint_Base from the given XmlReader. - /// - /// - /// - private static LinearJoint_Base ReadLinearJoint_4_2(XmlReader reader) - { - // Create a new LinearJoint_Base. - LinearJoint_Base linearJoint = (LinearJoint_Base)SkeletalJoint_Base.JOINT_FACTORY(SkeletalJointType.LINEAR); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "BXDVector3": - switch (reader["VectorID"]) - { - case "BasePoint": - // Assign the BXDVector3 to the basePoint. - linearJoint.basePoint = ReadBXDVector4_2(reader.ReadSubtree()); - break; - case "Axis": - // Assign the BXDVector3 to the axis. - linearJoint.axis = ReadBXDVector4_2(reader.ReadSubtree()); - break; - } - break; - case "LinearLowLimit": - // Assign a value to the linearLimitLow. - linearJoint.hasLowerLimit = true; - linearJoint.linearLimitLow = float.Parse(reader.ReadElementContentAsString()); - break; - case "LinearUpperLimit": - // Assign a value to the linearLimitHigh. - linearJoint.hasUpperLimit = true; - linearJoint.linearLimitHigh = float.Parse(reader.ReadElementContentAsString()); - break; - case "CurrentLinearPosition": - // Assign a value to the currentLinearPosition. - linearJoint.currentLinearPosition = float.Parse(reader.ReadElementContentAsString()); - break; - } - } - - return linearJoint; - } - - /// - /// Reads a PlanarJoint_Base from the given XmlReader. - /// - /// - /// - private static PlanarJoint_Base ReadPlanarJoint_4_2(XmlReader reader) - { - // Create a new PlanarJoint_Base. - PlanarJoint_Base planarJoint = (PlanarJoint_Base)SkeletalJoint_Base.JOINT_FACTORY(SkeletalJointType.PLANAR); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "BXDVector3": - switch (reader["VectorID"]) - { - case "Normal": - // Assign the BXDVector3 to the normal. - planarJoint.normal = ReadBXDVector4_2(reader.ReadSubtree()); - break; - case "BasePoint": - // Assign the BXDVector3 to the basePoint.s - planarJoint.basePoint = ReadBXDVector4_2(reader.ReadSubtree()); - break; - } - break; - } - } - - return planarJoint; - } - - /// - /// Reads a RotationalJoint_Base from the given XmlReader. - /// - /// - /// - private static RotationalJoint_Base ReadRotationalJoint_4_2(XmlReader reader) - { - // Create a new RotationalJoint_Base. - RotationalJoint_Base rotationalJoint = (RotationalJoint_Base)SkeletalJoint_Base.JOINT_FACTORY(SkeletalJointType.ROTATIONAL); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "BXDVector3": - switch (reader["VectorID"]) - { - case "BasePoint": - // Read the BXDVector3 as the basePoint. - rotationalJoint.basePoint = ReadBXDVector4_2(reader.ReadSubtree()); - break; - case "Axis": - // Read the BXDVector3 as the axis. - rotationalJoint.axis = ReadBXDVector4_2(reader.ReadSubtree()); - break; - } - break; - case "AngularLowLimit": - // Assign the current element value to angularLimitLow. - rotationalJoint.hasAngularLimit = true; - rotationalJoint.angularLimitLow = float.Parse(reader.ReadElementContentAsString()); - break; - case "AngularHighLimit": - // Assign the current element value to angularLimitHigh. - rotationalJoint.angularLimitHigh = float.Parse(reader.ReadElementContentAsString()); - break; - case "CurrentAngularPosition": - // Assign the current element value to currentAngularPosition. - rotationalJoint.currentAngularPosition = float.Parse(reader.ReadElementContentAsString()); - break; - } - } - - return rotationalJoint; - } - - /// - /// Reads a BXDVector3 with the given XmlReader and returns the reading. - /// - /// - /// - private static BXDVector3 ReadBXDVector4_2(XmlReader reader) - { - BXDVector3 vec = new BXDVector3(); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "X": - // Assign the x value. - vec.x = float.Parse(reader.ReadElementContentAsString()); - break; - case "Y": - // Assign the y value. - vec.y = float.Parse(reader.ReadElementContentAsString()); - break; - case "Z": - // Assign the z value. - vec.z = float.Parse(reader.ReadElementContentAsString()); - break; - } - } - - return vec; - } - - /// - /// Reads a JointDriver from the given XmlReader. - /// - /// - /// - private static JointDriver ReadJointDriver_4_2(XmlReader reader) - { - JointDriver driver = null; - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "DriveType": - // Initialize the driver. - driver = new JointDriver((JointDriverType)Enum.Parse(typeof(JointDriverType), reader.ReadElementContentAsString())); - break; - case "MotorType": - // Initialize the driver. - driver.motor = (MotorType)Enum.Parse(typeof(MotorType), reader.ReadElementContentAsString()); - break; - case "Port1": - // Assign a value to port1. - driver.port1 = reader.ReadElementContentAsInt(); - break; - case "Port2": - // Assign a value to port2. - driver.port2 = reader.ReadElementContentAsInt(); - break; - - case "InputGear": - // Assign a value to InputGear - driver.InputGear = reader.ReadElementContentAsDouble(); - break; - - case "OutputGear": - // Assign a value to OutputGear - driver.OutputGear = reader.ReadElementContentAsDouble(); - break; - - case "LowerLimit": - // Assign a value to the lowerLimit. - driver.lowerLimit = float.Parse(reader.ReadElementContentAsString()); - break; - case "UpperLimit": - // Assign a value to the upperLimit. - driver.upperLimit = float.Parse(reader.ReadElementContentAsString()); - break; - case "HasBrake": - // Assign a value to the upperLimit. - driver.hasBrake = reader.ReadElementContentAsBoolean(); - break; - case "SignalType": - // Assign a value to isCan. - driver.isCan = reader.ReadElementContentAsString().Equals("CAN") ? true : false; - break; - case "ElevatorDriverMeta": - // Add an ElevatorDriverMeta. - driver.AddInfo(ReadElevatorDriverMeta_4_2(reader.ReadSubtree())); - break; - case "PneumaticDriverMeta": - // Add a PneumaticsDriverMeta. - driver.AddInfo(ReadPneumaticDriverMeta_4_2(reader.ReadSubtree())); - break; - case "WheelDriverMeta": - // Add a WheelDriverMeta. - driver.AddInfo(ReadWheelDriverMeta_4_2(reader.ReadSubtree())); - break; - } - } - - return driver; - } - - /// - /// Reads an ElevatorDriverMeta from the given XmlReader. - /// - /// - /// - private static ElevatorDriverMeta ReadElevatorDriverMeta_4_2(XmlReader reader) - { - // Create a new ElevatorDriveMeta. - ElevatorDriverMeta elevatorDriverMeta = new ElevatorDriverMeta(); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "ElevatorType": - // Assign the type to the current element value. - elevatorDriverMeta.type = (ElevatorType)Enum.Parse(typeof(ElevatorType), reader.ReadElementContentAsString()); - break; - } - } - - return elevatorDriverMeta; - } - - /// - /// Reads a PneumaticDriverMeta from the given XmlReader. - /// - /// - /// - private static PneumaticDriverMeta ReadPneumaticDriverMeta_4_2(XmlReader reader) - { - // Create a new pneumaticDriverMeta. - PneumaticDriverMeta pneumaticDriverMeta = new PneumaticDriverMeta(); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "WidthMM": - // Assign the current element value to widthMM. - pneumaticDriverMeta.widthMM = reader.ReadElementContentAsInt(); - break; - case "PressurePSI": - // Assign the current element value to pressurePSI. - pneumaticDriverMeta.pressurePSI = float.Parse(reader.ReadElementContentAsString()); - break; - } - } - - return pneumaticDriverMeta; - } - - /// - /// Reads a WheelDriverMeta from the given XmlReader. - /// - /// - /// - private static WheelDriverMeta ReadWheelDriverMeta_4_2(XmlReader reader) - { - // Create new WheelDriveMeta. - WheelDriverMeta wheelDriverMeta = new WheelDriverMeta(); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "WheelType": - // Assign a value to the type. - wheelDriverMeta.type = (WheelType)Enum.Parse(typeof(WheelType), reader.ReadElementContentAsString()); - break; - case "WheelRadius": - // Assign a value to the radius. - wheelDriverMeta.radius = float.Parse(reader.ReadElementContentAsString()); - break; - case "WheelWidth": - // Assign a value to the width. - wheelDriverMeta.width = float.Parse(reader.ReadElementContentAsString()); - break; - case "BXDVector3": - // Assign a value to the center. - wheelDriverMeta.center = ReadBXDVector4_2(reader.ReadSubtree()); - break; - case "ForwardAsympSlip": - // Assign a value to the forwardAsympSlip. - wheelDriverMeta.forwardAsympSlip = float.Parse(reader.ReadElementContentAsString()); - break; - case "ForwardAsympValue": - // Assign a value to the forwardAsympValue. - wheelDriverMeta.forwardAsympValue = float.Parse(reader.ReadElementContentAsString()); - break; - case "ForwardExtremeSlip": - // Assign a value to the forwardExtremeSlip. - wheelDriverMeta.forwardExtremeSlip = float.Parse(reader.ReadElementContentAsString()); - break; - case "ForwardExtremeValue": - // Assign a value to the forwardExtremeValue. - wheelDriverMeta.forwardExtremeValue = float.Parse(reader.ReadElementContentAsString()); - break; - case "SideAsympSlip": - // Assign a value to the sideAsympSlip. - wheelDriverMeta.sideAsympSlip = float.Parse(reader.ReadElementContentAsString()); - break; - case "SideAsympValue": - // Assign a value to the sideAsympValue. - wheelDriverMeta.sideAsympValue = float.Parse(reader.ReadElementContentAsString()); - break; - case "SideExtremeSlip": - // Assign a value to the sideExtremeSlip. - wheelDriverMeta.sideExtremeSlip = float.Parse(reader.ReadElementContentAsString()); - break; - case "SideExtremeValue": - // Assign a value to the sideExtremeValue. - wheelDriverMeta.sideExtremeValue = float.Parse(reader.ReadElementContentAsString()); - break; - case "IsDriveWheel": - // Assign a value to isDriveWheel. - wheelDriverMeta.isDriveWheel = reader.ReadElementContentAsBoolean(); - break; - } - } - - return wheelDriverMeta; - } - - /// - /// Read a RobotSensor from the given XmlReader. - /// - /// - /// - private static RobotSensor ReadRobotSensor_4_2(XmlReader reader) - { - RobotSensor robotSensor = null; - //throw (new Exception("Reading thing")); - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "SensorType": - // Initialize the RobotSensor. - robotSensor = new RobotSensor((RobotSensorType)Enum.Parse(typeof(RobotSensorType), reader.ReadElementContentAsString())); - break; - case "SensorPortNumberA": - // Assign a value to the 1st port. - robotSensor.portA = float.Parse(reader.ReadElementContentAsString()); - break; - case "SensorSignalTypeA": - // Assign a value to the 2nd port. - robotSensor.conTypePortA = (SensorConnectionType)Enum.Parse(typeof(SensorConnectionType), reader.ReadElementContentAsString()); - break; - case "SensorPortNumberB": - // Assign a port type to the 1st port - robotSensor.portB = float.Parse(reader.ReadElementContentAsString()); - break; - case "SensorSignalTypeB": - // Assign a port type to the 1st port - robotSensor.conTypePortB = (SensorConnectionType)Enum.Parse(typeof(SensorConnectionType), reader.ReadElementContentAsString()); - break; - case "SensorConversionFactor": - // assings the generic conversion facter, this is a different type/ unit for every robot (CPR in encoders) - robotSensor.conversionFactor = double.Parse(reader.ReadElementContentAsString()); - if(robotSensor.conversionFactor == 0) - { - robotSensor.conversionFactor = 1; - } - break; - } - } - - return robotSensor; - } -} diff --git a/api/Aardvark/IO/BXDJ/BXDJReader_5_0.cs b/api/Aardvark/IO/BXDJ/BXDJReader_5_0.cs deleted file mode 100644 index 653b08f140..0000000000 --- a/api/Aardvark/IO/BXDJ/BXDJReader_5_0.cs +++ /dev/null @@ -1,923 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Xml; -using System.Xml.Schema; - -/// -/// Utility functions for reading/writing BXDJ files -/// -public partial class BXDJSkeleton -{ - #region XSD Markup - - /// - /// The XSD markup to ensure valid document reading. - /// - private const string BXDJ_XSD_5_0 = - @" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "; - - #endregion - - /// - /// Reads the skeleton contained in the XML BXDJ file specified and - /// returns the corresponding RigidNode_Base. - /// - /// - /// - private static RigidNode_Base ReadSkeleton_5_0(string path, bool useValidation = true) - { - RigidNode_Base root = null; - List nodes = new List(); - - XmlReaderSettings settings = new XmlReaderSettings(); - - if (useValidation) - { - settings.Schemas.Add(XmlSchema.Read(new StringReader(BXDJ_XSD_5_0), null)); - settings.ValidationType = ValidationType.Schema; - } - else - { - settings.ValidationType = ValidationType.None; - } - - XmlReader reader = XmlReader.Create(path, settings); - - try - { - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "DriveTrainType": - ReadNode_5_0(reader.ReadSubtree(), nodes, ref root); - break; - case "Node": - // Reads the current element as a node. - ReadNode_5_0(reader.ReadSubtree(), nodes, ref root); - break; - } - } - } - catch (Exception)// A variety of exceptions can take place if the file is invalid, but we will always want to return null. - { - // If the file is invalid, return null. - return null; - } - finally - { - // Closes the reader. - reader.Close(); - } - - return nodes[0]; - } - - /// - /// Reads a RigidNode_Base with the given reader, list of nodes, and root node reference. - /// - /// - /// - /// - private static void ReadNode_5_0(XmlReader reader, List nodes, ref RigidNode_Base root) - { - int parentID = -1; - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "Node": - // Adds a new node to the list of RigidNode_Bases. - nodes.Add(RigidNode_Base.NODE_FACTORY(new Guid(reader["GUID"]))); - break; - case "ParentID": - // Stores this ID for later use. - parentID = reader.ReadElementContentAsInt(); - - if (parentID == -1) // If this is the root... - root = nodes[nodes.Count - 1]; - break; - case "DriveTrainTypeNumber": - root.driveTrainType = (RigidNode_Base.DriveTrainType) reader.ReadElementContentAsInt(); - break; - case "ModelFileName": - // Assigns the ModelFileName property to the ModelFileName element value. - nodes[nodes.Count - 1].ModelFileName = reader.ReadElementContentAsString(); - break; - case "ModelID": - // Assigns the ModelFullID property to the ModelID element value. - nodes[nodes.Count - 1].ModelFullID = reader.ReadElementContentAsString(); - break; - case "BallJoint": - // Reads the current element as a BallJoint. - nodes[parentID].AddChild(ReadBallJoint_5_0(reader.ReadSubtree()), nodes[nodes.Count - 1]); - break; - case "CylindricalJoint": - // Reads the current element as a CylindricalJoint. - nodes[parentID].AddChild(ReadCylindricalJoint_5_0(reader.ReadSubtree()), nodes[nodes.Count - 1]); - break; - case "LinearJoint": - // Reads the current element as a LinearJoint. - nodes[parentID].AddChild(ReadLinearJoint_5_0(reader.ReadSubtree()), nodes[nodes.Count - 1]); - break; - case "PlanarJoint": - // Reads the current element as a PlanarJoint. - nodes[parentID].AddChild(ReadPlanarJoint_5_0(reader.ReadSubtree()), nodes[nodes.Count - 1]); - break; - case "RotationalJoint": - // Reads the current elemenet as a RotationalJoint. - nodes[parentID].AddChild(ReadRotationalJoint_5_0(reader.ReadSubtree()), nodes[nodes.Count - 1]); - break; - case "JointDriver": - // Add a joint driver to the skeletal joint of the current node. - nodes[nodes.Count - 1].GetSkeletalJoint().cDriver = ReadJointDriver_5_0(reader.ReadSubtree()); - break; - case "RobotSensor": - nodes[nodes.Count - 1].GetSkeletalJoint().attachedSensors.Add(ReadRobotSensor_5_0(reader.ReadSubtree())); - break; - } - } - } - - /// - /// Reads a BallJoint_Base from the given XmlReader. - /// - /// - /// - private static BallJoint_Base ReadBallJoint_5_0(XmlReader reader) - { - // Create a new BallJoint_Base. - BallJoint_Base ballJoint = (BallJoint_Base)SkeletalJoint_Base.JOINT_FACTORY(SkeletalJointType.BALL); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "BXDVector3": - // Read the BXDVector3 as the basePoint. - ballJoint.basePoint = ReadBXDVector5_0(reader.ReadSubtree()); - break; - } - } - - return ballJoint; - } - - /// - /// Reads a CylindricalJoint_Base from the given XmlReader. - /// - /// - /// - private static CylindricalJoint_Base ReadCylindricalJoint_5_0(XmlReader reader) - { - // Create a new CylindricalJoint_Base. - CylindricalJoint_Base cylindricalJoint = (CylindricalJoint_Base)SkeletalJoint_Base.JOINT_FACTORY(SkeletalJointType.CYLINDRICAL); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "BXDVector3": - switch (reader["VectorID"]) - { - case "BasePoint": - // Assign the BXDVector3 to the basePoint. - cylindricalJoint.basePoint = ReadBXDVector5_0(reader.ReadSubtree()); - break; - case "Axis": - // Assign the BXDVector3 to the axis. - cylindricalJoint.axis = ReadBXDVector5_0(reader.ReadSubtree()); - break; - } - break; - case "AngularLowLimit": - // Assign a value to the angularLimitLow. - cylindricalJoint.hasAngularLimit = true; - cylindricalJoint.angularLimitLow = float.Parse(reader.ReadElementContentAsString()); - break; - case "AngularHighLimit": - // Assign a value to the angularLimitHigh. - cylindricalJoint.angularLimitHigh = float.Parse(reader.ReadElementContentAsString()); - break; - case "LinearStartLimit": - // Assign a value to the linearLimitStart. - cylindricalJoint.hasLinearStartLimit = true; - cylindricalJoint.linearLimitStart = float.Parse(reader.ReadElementContentAsString()); - break; - case "LinearEndLimit": - // Assign a value to the linearLimitEnd. - cylindricalJoint.hasLinearEndLimit = true; - cylindricalJoint.linearLimitEnd = float.Parse(reader.ReadElementContentAsString()); - break; - case "CurrentLinearPosition": - // Assign a value to the currentLinearPosition. - cylindricalJoint.currentLinearPosition = float.Parse(reader.ReadElementContentAsString()); - break; - case "CurrentAngularPosition": - // Assign a value to the currentAngularPosition. - cylindricalJoint.currentAngularPosition = float.Parse(reader.ReadElementContentAsString()); - break; - } - } - - return cylindricalJoint; - } - - /// - /// Reads a LinearJoint_Base from the given XmlReader. - /// - /// - /// - private static LinearJoint_Base ReadLinearJoint_5_0(XmlReader reader) - { - // Create a new LinearJoint_Base. - LinearJoint_Base linearJoint = (LinearJoint_Base)SkeletalJoint_Base.JOINT_FACTORY(SkeletalJointType.LINEAR); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "BXDVector3": - switch (reader["VectorID"]) - { - case "BasePoint": - // Assign the BXDVector3 to the basePoint. - linearJoint.basePoint = ReadBXDVector5_0(reader.ReadSubtree()); - break; - case "Axis": - // Assign the BXDVector3 to the axis. - linearJoint.axis = ReadBXDVector5_0(reader.ReadSubtree()); - break; - } - break; - case "LinearLowLimit": - // Assign a value to the linearLimitLow. - linearJoint.hasLowerLimit = true; - linearJoint.linearLimitLow = float.Parse(reader.ReadElementContentAsString()); - break; - case "LinearUpperLimit": - // Assign a value to the linearLimitHigh. - linearJoint.hasUpperLimit = true; - linearJoint.linearLimitHigh = float.Parse(reader.ReadElementContentAsString()); - break; - case "CurrentLinearPosition": - // Assign a value to the currentLinearPosition. - linearJoint.currentLinearPosition = float.Parse(reader.ReadElementContentAsString()); - break; - } - } - - return linearJoint; - } - - /// - /// Reads a PlanarJoint_Base from the given XmlReader. - /// - /// - /// - private static PlanarJoint_Base ReadPlanarJoint_5_0(XmlReader reader) - { - // Create a new PlanarJoint_Base. - PlanarJoint_Base planarJoint = (PlanarJoint_Base)SkeletalJoint_Base.JOINT_FACTORY(SkeletalJointType.PLANAR); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "BXDVector3": - switch (reader["VectorID"]) - { - case "Normal": - // Assign the BXDVector3 to the normal. - planarJoint.normal = ReadBXDVector5_0(reader.ReadSubtree()); - break; - case "BasePoint": - // Assign the BXDVector3 to the basePoint.s - planarJoint.basePoint = ReadBXDVector5_0(reader.ReadSubtree()); - break; - } - break; - } - } - - return planarJoint; - } - - /// - /// Reads a RotationalJoint_Base from the given XmlReader. - /// - /// - /// - private static RotationalJoint_Base ReadRotationalJoint_5_0(XmlReader reader) - { - // Create a new RotationalJoint_Base. - RotationalJoint_Base rotationalJoint = (RotationalJoint_Base)SkeletalJoint_Base.JOINT_FACTORY(SkeletalJointType.ROTATIONAL); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "BXDVector3": - switch (reader["VectorID"]) - { - case "BasePoint": - // Read the BXDVector3 as the basePoint. - rotationalJoint.basePoint = ReadBXDVector5_0(reader.ReadSubtree()); - break; - case "Axis": - // Read the BXDVector3 as the axis. - rotationalJoint.axis = ReadBXDVector5_0(reader.ReadSubtree()); - break; - } - break; - case "AngularLowLimit": - // Assign the current element value to angularLimitLow. - rotationalJoint.hasAngularLimit = true; - rotationalJoint.angularLimitLow = float.Parse(reader.ReadElementContentAsString()); - break; - case "AngularHighLimit": - // Assign the current element value to angularLimitHigh. - rotationalJoint.angularLimitHigh = float.Parse(reader.ReadElementContentAsString()); - break; - case "CurrentAngularPosition": - // Assign the current element value to currentAngularPosition. - rotationalJoint.currentAngularPosition = float.Parse(reader.ReadElementContentAsString()); - break; - } - } - - return rotationalJoint; - } - - /// - /// Reads a BXDVector3 with the given XmlReader and returns the reading. - /// - /// - /// - private static BXDVector3 ReadBXDVector5_0(XmlReader reader) - { - BXDVector3 vec = new BXDVector3(); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "X": - // Assign the x value. - vec.x = float.Parse(reader.ReadElementContentAsString()); - break; - case "Y": - // Assign the y value. - vec.y = float.Parse(reader.ReadElementContentAsString()); - break; - case "Z": - // Assign the z value. - vec.z = float.Parse(reader.ReadElementContentAsString()); - break; - } - } - - return vec; - } - - /// - /// Reads a JointDriver from the given XmlReader. - /// - /// - /// - private static JointDriver ReadJointDriver_5_0(XmlReader reader) - { - JointDriver driver = null; - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "DriveType": - // Initialize the driver. - driver = new JointDriver((JointDriverType)Enum.Parse(typeof(JointDriverType), reader.ReadElementContentAsString())); - break; - case "port1": - // Assign a value to port1. - driver.port1 = reader.ReadElementContentAsInt(); - break; - case "port2": - // Assign a value to port2. - driver.port2 = reader.ReadElementContentAsInt(); - break; - - case "InputGear": - // Assign a value to InputGear - driver.InputGear = reader.ReadElementContentAsDouble(); - break; - - case "OutputGear": - // Assign a value to OutputGear - driver.OutputGear = reader.ReadElementContentAsDouble(); - break; - - case "LowerLimit": - // Assign a value to the lowerLimit. - driver.lowerLimit = float.Parse(reader.ReadElementContentAsString()); - break; - case "UpperLimit": - // Assign a value to the upperLimit. - driver.upperLimit = float.Parse(reader.ReadElementContentAsString()); - break; - case "SignalType": - // Assign a value to isCan. - driver.isCan = reader.ReadElementContentAsString().Equals("CAN") ? true : false; - break; - case "ElevatorDriverMeta": - // Add an ElevatorDriverMeta. - driver.AddInfo(ReadElevatorDriverMeta_5_0(reader.ReadSubtree())); - break; - case "PneumaticDriverMeta": - // Add a PneumaticsDriverMeta. - driver.AddInfo(ReadPneumaticDriverMeta_5_0(reader.ReadSubtree())); - break; - case "WheelDriverMeta": - // Add a WheelDriverMeta. - driver.AddInfo(ReadWheelDriverMeta_5_0(reader.ReadSubtree())); - break; - } - } - - return driver; - } - - /// - /// Reads an ElevatorDriverMeta from the given XmlReader. - /// - /// - /// - private static ElevatorDriverMeta ReadElevatorDriverMeta_5_0(XmlReader reader) - { - // Create a new ElevatorDriveMeta. - ElevatorDriverMeta elevatorDriverMeta = new ElevatorDriverMeta(); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "ElevatorType": - // Assign the type to the current element value. - elevatorDriverMeta.type = (ElevatorType)Enum.Parse(typeof(ElevatorType), reader.ReadElementContentAsString()); - break; - } - } - - return elevatorDriverMeta; - } - - /// - /// Reads a PneumaticDriverMeta from the given XmlReader. - /// - /// - /// - private static PneumaticDriverMeta ReadPneumaticDriverMeta_5_0(XmlReader reader) - { - // Create a new pneumaticDriverMeta. - PneumaticDriverMeta pneumaticDriverMeta = new PneumaticDriverMeta(); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "WidthMM": - // Assign the current element value to widthMM. - pneumaticDriverMeta.widthMM = reader.ReadElementContentAsInt(); - break; - case "PressurePSI": - // Assign the current element value to pressurePSI. - pneumaticDriverMeta.pressurePSI = float.Parse(reader.ReadElementContentAsString()); - break; - } - } - - return pneumaticDriverMeta; - } - - /// - /// Reads a WheelDriverMeta from the given XmlReader. - /// - /// - /// - private static WheelDriverMeta ReadWheelDriverMeta_5_0(XmlReader reader) - { - // Create new WheelDriveMeta. - WheelDriverMeta wheelDriverMeta = new WheelDriverMeta(); - - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "WheelType": - // Assign a value to the type. - wheelDriverMeta.type = (WheelType)Enum.Parse(typeof(WheelType), reader.ReadElementContentAsString()); - break; - case "WheelRadius": - // Assign a value to the radius. - wheelDriverMeta.radius = float.Parse(reader.ReadElementContentAsString()); - break; - case "WheelWidth": - // Assign a value to the width. - wheelDriverMeta.width = float.Parse(reader.ReadElementContentAsString()); - break; - case "BXDVector3": - // Assign a value to the center. - wheelDriverMeta.center = ReadBXDVector5_0(reader.ReadSubtree()); - break; - case "ForwardAsympSlip": - // Assign a value to the forwardAsympSlip. - wheelDriverMeta.forwardAsympSlip = float.Parse(reader.ReadElementContentAsString()); - break; - case "ForwardAsympValue": - // Assign a value to the forwardAsympValue. - wheelDriverMeta.forwardAsympValue = float.Parse(reader.ReadElementContentAsString()); - break; - case "ForwardExtremeSlip": - // Assign a value to the forwardExtremeSlip. - wheelDriverMeta.forwardExtremeSlip = float.Parse(reader.ReadElementContentAsString()); - break; - case "ForwardExtremeValue": - // Assign a value to the forwardExtremeValue. - wheelDriverMeta.forwardExtremeValue = float.Parse(reader.ReadElementContentAsString()); - break; - case "SideAsympSlip": - // Assign a value to the sideAsympSlip. - wheelDriverMeta.sideAsympSlip = float.Parse(reader.ReadElementContentAsString()); - break; - case "SideAsympValue": - // Assign a value to the sideAsympValue. - wheelDriverMeta.sideAsympValue = float.Parse(reader.ReadElementContentAsString()); - break; - case "SideExtremeSlip": - // Assign a value to the sideExtremeSlip. - wheelDriverMeta.sideExtremeSlip = float.Parse(reader.ReadElementContentAsString()); - break; - case "SideExtremeValue": - // Assign a value to the sideExtremeValue. - wheelDriverMeta.sideExtremeValue = float.Parse(reader.ReadElementContentAsString()); - break; - case "IsDriveWheel": - // Assign a value to isDriveWheel. - wheelDriverMeta.isDriveWheel = reader.ReadElementContentAsBoolean(); - break; - } - } - - return wheelDriverMeta; - } - - /// - /// Read a RobotSensor from the given XmlReader. - /// - /// - /// - private static RobotSensor ReadRobotSensor_5_0(XmlReader reader) - { - RobotSensor robotSensor = null; - //throw (new Exception("Reading thing")); - foreach (string name in IOUtilities.AllElements(reader)) - { - switch (name) - { - case "SensorType": - // Initialize the RobotSensor. - robotSensor = new RobotSensor((RobotSensorType)Enum.Parse(typeof(RobotSensorType), reader.ReadElementContentAsString())); - break; - case "SensorPortNumberA": - // Assign a value to the port. - robotSensor.portA = float.Parse(reader.ReadElementContentAsString()); - break; - case "SensorSignalTypeA": - // Assign a value to the port. - robotSensor.conTypePortA = (SensorConnectionType)Enum.Parse(typeof(SensorConnectionType), reader.ReadElementContentAsString()); - break; - case "SensorPortNumberB": - // Assign a value to the port. - robotSensor.portB = float.Parse(reader.ReadElementContentAsString()); - break; - case "SensorSignalTypeB": - // Assign a value to the port. - robotSensor.conTypePortB = (SensorConnectionType)Enum.Parse(typeof(SensorConnectionType), reader.ReadElementContentAsString()); - break; - case "SensorConversionFactor": - // Assign a value to useSecondarySource. - robotSensor.conversionFactor = double.Parse(reader.ReadElementContentAsString()); - if(robotSensor.conversionFactor == 0) - { - robotSensor.conversionFactor = 1; - } - break; - } - } - - return robotSensor; - } -} \ No newline at end of file diff --git a/api/Aardvark/IO/BXDJ/BXDJSkeleton.cs b/api/Aardvark/IO/BXDJ/BXDJSkeleton.cs deleted file mode 100644 index a8dfa036d3..0000000000 --- a/api/Aardvark/IO/BXDJ/BXDJSkeleton.cs +++ /dev/null @@ -1,562 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Xml; -/// -/// Utility functions for reading/writing BXDJ files -/// - -public static partial class BXDJSkeleton -{ - /// - /// Represents the current version of the BXDA file. - /// - public const string BXDJ_CURRENT_VERSION = "4.2.0"; - - /// - /// Ensures that every node is assigned a model file name by assigning all nodes without a file name a generated name. - /// - /// The base node of the skeleton - /// Overwrite existing - public static void SetupFileNames(RigidNode_Base baseNode) - { - List nodes = new List(); - baseNode.ListAllNodes(nodes); - - for (int i = 0; i < nodes.Count; i++) - { - if (nodes[i].ModelFileName == null) - nodes[i].ModelFileName = ("node_" + i + ".bxda"); - } - } - - /// - /// Writes out the skeleton file for the skeleton with the base provided to the path provided. - /// - /// - /// - public static void WriteSkeleton(string path, RigidNode_Base baseNode) - { - - //EXPERIMENT - - // JSONExport(path, baseNode); - List nodes = new List(); - baseNode.ListAllNodes(nodes); - - // Determine the parent ID for each node in the list. - int[] parentID = new int[nodes.Count]; - - for (int i = 0; i < nodes.Count; i++) - { - if (nodes[i].GetParent() != null) - { - parentID[i] = nodes.IndexOf(nodes[i].GetParent()); - - if (parentID[i] < 0) throw new Exception("Can't resolve parent ID for " + nodes[i].ToString()); - } - else - { - parentID[i] = -1; - } - } - - XmlWriterSettings settings = new XmlWriterSettings(); - settings.Indent = true; - - XmlWriter writer = XmlWriter.Create(path, settings); - - writer.WriteStartDocument(); - - writer.WriteStartElement("BXDJ"); - writer.WriteAttributeString("Version", BXDJ_CURRENT_VERSION); - - for (int i = 0; i < nodes.Count; i++) - { - writer.WriteStartElement("Node"); - - writer.WriteAttributeString("GUID", nodes[i].GUID.ToString()); - - writer.WriteElementString("ParentID", parentID[i].ToString()); - - writer.WriteElementString("ModelFileName", FileUtilities.SanatizeFileName("node_" + i + ".bxda")); - - writer.WriteElementString("ModelID", nodes[i].GetModelID()); - - if (parentID[i] >= 0) - WriteJoint(nodes[i].GetSkeletalJoint(), writer); - - writer.WriteEndElement(); - } - - writer.WriteElementString("DriveTrainType", (baseNode.driveTrainType).ToString()); - - writer.WriteElementString("SoftwareExportedWith", "INVENTOR"); - - writer.Close(); - } - - /// - /// Writes the backing information and ID for this joint with the given XmlWriter. - /// - /// - /// - private static void WriteJoint(SkeletalJoint_Base joint, XmlWriter writer) - { - switch (joint.GetJointType()) - { - case SkeletalJointType.BALL: - WriteBallJoint((BallJoint_Base)joint, writer); - break; - case SkeletalJointType.CYLINDRICAL: - WriteCylindricalJoint((CylindricalJoint_Base)joint, writer); - break; - case SkeletalJointType.LINEAR: - WriteLinearJoint((LinearJoint_Base)joint, writer); - break; - case SkeletalJointType.PLANAR: - WritePlanarJoint((PlanarJoint_Base)joint, writer); - break; - case SkeletalJointType.ROTATIONAL: - WriteRotationalJoint((RotationalJoint_Base)joint, writer); - break; - default: - throw new Exception("Could not determine type of joint"); - } - - if (joint.cDriver != null) - WriteJointDriver(joint.cDriver, writer); - - for (int i = 0; i < joint.attachedSensors.Count; i++) - { - WriteRobotSensor(joint.attachedSensors[i], writer); - } - } - - /// - /// Used for writing the data of a BallJoint_Base. - /// - /// - /// - private static void WriteBallJoint(BallJoint_Base joint, XmlWriter writer) - { - writer.WriteStartElement("BallJoint"); - - WriteBXDVector3(joint.basePoint, writer, "BasePoint"); - - writer.WriteEndElement(); - } - - /// - /// Used for writing the data of a CylindricalJoint_Base. - /// - /// - /// - private static void WriteCylindricalJoint(CylindricalJoint_Base joint, XmlWriter writer) - { - writer.WriteStartElement("CylindricalJoint"); - - joint.EnforceOrder(); - - WriteBXDVector3(joint.basePoint, writer, "BasePoint"); - WriteBXDVector3(joint.axis, writer, "Axis"); - - if (joint.hasAngularLimit) - { - writer.WriteElementString("AngularLowLimit", joint.angularLimitLow.ToString("F4")); - writer.WriteElementString("AngularHighLimit", joint.angularLimitHigh.ToString("F4")); - } - - if (joint.hasLinearStartLimit) - writer.WriteElementString("LinearStartLimit", joint.linearLimitStart.ToString("F4")); - - if (joint.hasLinearEndLimit) - writer.WriteElementString("LinearEndLimit", joint.linearLimitEnd.ToString("F4")); - //writer.WriteElementString("CurrentLinearPosition", joint.currentLinearPosition.ToString("F4")); - //writer.WriteElementString("CurrentAngularPosition", joint.currentAngularPosition.ToString("F4")); - - writer.WriteElementString("CurrentLinearPosition", joint.currentLinearPosition.ToString("F4"));// writes the lowest point of the joint to the file as the positon so the joint starts at the bottom, hopefully prevents any weird issues with the joint limits being messed up do to being relative to the start of the joint - - writer.WriteElementString("CurrentAngularPosition", joint.currentAngularPosition.ToString("F4"));// writes the lowest point of the joint to the file as the positon so the joint starts at the bottom, hopefully prevents any weird issues with the joint limits being messed up do to being relative to the start of the joint - - - writer.WriteEndElement(); - } - - /// - /// Used for writing the data of a LinearJoint_Base. - /// - /// - /// - private static void WriteLinearJoint(LinearJoint_Base joint, XmlWriter writer) - { - writer.WriteStartElement("LinearJoint"); - - joint.EnforceOrder(); - - WriteBXDVector3(joint.basePoint, writer, "BasePoint"); - WriteBXDVector3(joint.axis, writer, "Axis"); - - if (joint.hasLowerLimit) - writer.WriteElementString("LinearLowLimit", joint.linearLimitLow.ToString("F4")); - - if (joint.hasUpperLimit) - writer.WriteElementString("LinearUpperLimit", joint.linearLimitHigh.ToString("F4")); - - // writer.WriteElementString("CurrentLinearPosition", joint.currentLinearPosition.ToString("F4")); - writer.WriteElementString("CurrentLinearPosition", joint.currentLinearPosition.ToString("F4"));// writes the lowest point of the joint to the file as the positon so the joint starts at the bottom, hopefully prevents any weird issues with the joint limits being messed up do to being relative to the start of the joint - - writer.WriteEndElement(); - } - - /// - /// Used for writing the data of a PlanarJoint_Base. - /// - /// - /// - private static void WritePlanarJoint(PlanarJoint_Base joint, XmlWriter writer) - { - writer.WriteStartElement("PlanarJoint"); - - WriteBXDVector3(joint.normal, writer, "Normal"); - WriteBXDVector3(joint.basePoint, writer, "BasePoint"); - - writer.WriteEndElement(); - } - - /// - /// Used for writing the data of a RotationalJoint_Base. - /// - /// - /// - private static void WriteRotationalJoint(RotationalJoint_Base joint, XmlWriter writer) - { - writer.WriteStartElement("RotationalJoint"); - - joint.EnforceOrder(); - - WriteBXDVector3(joint.basePoint, writer, "BasePoint"); - WriteBXDVector3(joint.axis, writer, "Axis"); - - if (joint.hasAngularLimit) - { - writer.WriteElementString("AngularLowLimit", joint.angularLimitLow.ToString("F4")); - writer.WriteElementString("AngularHighLimit", joint.angularLimitHigh.ToString("F4")); - } - - // writer.WriteElementString("CurrentAngularPosition", joint.currentAngularPosition.ToString("F4")); - writer.WriteElementString("CurrentAngularPosition", joint.currentAngularPosition.ToString("F4"));// writes the lowest point of the joint to the file as the positon so the joint starts at the bottom, hopefully prevents any weird issues with the joint limits being messed up do to being relative to the start of the joint - - - writer.WriteEndElement(); - } - - /// - /// Writes the BXDVector3 to an XML file with the given XmlWriter. - /// - /// - /// - private static void WriteBXDVector3(BXDVector3 vec, XmlWriter writer, string id) - { - writer.WriteStartElement("BXDVector3"); - - writer.WriteAttributeString("VectorID", id); - - writer.WriteElementString("X", vec.x.ToString("F4")); - writer.WriteElementString("Y", vec.y.ToString("F4")); - writer.WriteElementString("Z", vec.z.ToString("F4")); - - writer.WriteEndElement(); - } - - /// - /// Used for writing joint driver data. - /// - /// - /// - private static void WriteJointDriver(JointDriver driver, XmlWriter writer) - { - writer.WriteStartElement("JointDriver"); - - writer.WriteElementString("DriveType", driver.GetDriveType().ToString()); - writer.WriteElementString("MotorType", driver.GetMotorType().ToString()); - - writer.WriteElementString("Port1", (driver.port1 + 1).ToString()); // Synthesis engine downshifts port numbers due to old code using 1 and 2 for drive. - writer.WriteElementString("Port2", (driver.port2 + 1).ToString()); // For backwards compatibility, ports will be stored one larger than their actual value. - if (driver.InputGear == 0)// prevents a gearing of 0 from being written to the bxdj - { - driver.InputGear = 1; - } - if (driver.OutputGear == 0)// prevents a gearing of 0 from being written to the bxdj - { - driver.OutputGear = 1; - } - writer.WriteElementString("InputGear", driver.InputGear.ToString());// writes the input gear's string to the XMLWriter - writer.WriteElementString("OutputGear", driver.OutputGear.ToString());// writes the output gear's string to the XMLWriter - writer.WriteElementString("LowerLimit", driver.lowerLimit.ToString("F4")); - writer.WriteElementString("UpperLimit", driver.upperLimit.ToString("F4")); - writer.WriteElementString("SignalType", driver.isCan ? "CAN" : "PWM"); - writer.WriteElementString("HasBrake", driver.hasBrake.ToString().ToLower()); - - foreach (JointDriverMeta meta in driver.MetaInfo.Values) - { - WriteJointDriverMeta(meta, writer); - } - - writer.WriteEndElement(); - } - - /// - /// Used for writing joint driver meta data. - /// - /// - /// - private static void WriteJointDriverMeta(JointDriverMeta meta, XmlWriter writer) - { - switch (meta.GetType().ToString()) - { - case "ElevatorDriverMeta": - WriteElevatorDriverMeta((ElevatorDriverMeta)meta, writer); - break; - case "PneumaticDriverMeta": - WritePneumaticDriverMeta((PneumaticDriverMeta)meta, writer); - break; - case "WheelDriverMeta": - WriteWheelDriverMeta((WheelDriverMeta)meta, writer); - break; - } - } - - /// - /// Used for writing elevator driver meta data. - /// - /// - /// - private static void WriteElevatorDriverMeta(ElevatorDriverMeta meta, XmlWriter writer) - { - writer.WriteStartElement("ElevatorDriverMeta"); - - writer.WriteAttributeString("DriverMetaID", meta.GetID().ToString()); - - writer.WriteElementString("ElevatorType", meta.type.ToString()); - - writer.WriteEndElement(); - } - - /// - /// Used for writing pneumatic driver meta data. - /// - /// - /// - private static void WritePneumaticDriverMeta(PneumaticDriverMeta meta, XmlWriter writer) - { - writer.WriteStartElement("PneumaticDriverMeta"); - - writer.WriteAttributeString("DriverMetaID", meta.GetID().ToString()); - - writer.WriteElementString("WidthMM", (meta.width * 25.4).ToString("F4")); - writer.WriteElementString("PressurePSI", meta.pressurePSI.ToString("F4")); - - writer.WriteEndElement(); - } - - /// - /// Used for writing wheel driver meta data. - /// - /// - /// - private static void WriteWheelDriverMeta(WheelDriverMeta meta, XmlWriter writer) - { - writer.WriteStartElement("WheelDriverMeta"); - - writer.WriteAttributeString("DriverMetaID", meta.GetID().ToString()); - - writer.WriteElementString("WheelType", meta.type.ToString()); - writer.WriteElementString("WheelRadius", meta.radius.ToString("F4")); - writer.WriteElementString("WheelWidth", meta.width.ToString("F4")); - - WriteBXDVector3(meta.center, writer, "WheelCenter"); - - writer.WriteElementString("ForwardAsympSlip", meta.forwardAsympSlip.ToString("F4")); - writer.WriteElementString("ForwardAsympValue", meta.forwardAsympValue.ToString("F4")); - writer.WriteElementString("ForwardExtremeSlip", meta.forwardExtremeSlip.ToString("F4")); - writer.WriteElementString("ForwardExtremeValue", meta.forwardExtremeValue.ToString("F4")); - writer.WriteElementString("SideAsympSlip", meta.sideAsympSlip.ToString("F4")); - writer.WriteElementString("SideAsympValue", meta.sideAsympValue.ToString("F4")); - writer.WriteElementString("SideExtremeSlip", meta.sideExtremeSlip.ToString("F4")); - writer.WriteElementString("SideExtremeValue", meta.sideExtremeValue.ToString("F4")); - writer.WriteElementString("IsDriveWheel", meta.isDriveWheel.ToString().ToLower()); - - writer.WriteEndElement(); - } - - /// - /// Used for writing the data from a RobotSensor. - /// - /// - /// - private static void WriteRobotSensor(RobotSensor sensor, XmlWriter writer) - { - writer.WriteStartElement("RobotSensor"); - - writer.WriteElementString("SensorType", sensor.type.ToString()); - writer.WriteElementString("SensorPortNumberA", sensor.portA.ToString()); - writer.WriteElementString("SensorSignalTypeA", sensor.conTypePortA.ToString()); - writer.WriteElementString("SensorPortNumberB", sensor.portB.ToString()); - writer.WriteElementString("SensorSignalTypeB", sensor.conTypePortB.ToString()); - writer.WriteElementString("SensorConversionFactor", sensor.conversionFactor.ToString()); - - writer.WriteEndElement(); - } - - /// - /// Reads the skeleton contained in the BXDJ XML file specified and returns the root node for that skeleton. - /// - /// - /// - public static RigidNode_Base ReadSkeleton(string path) - { - XmlReader reader = XmlReader.Create(path); - - if (reader.ReadToFollowing("BXDJ")) - { - string version = reader["Version"]; - - switch (version.Substring(0, version.LastIndexOf('.')))// sends each version of the BXDJ to the appropriate reader - { - case "4.2": - return ReadSkeleton_4_2(path); - case "4.1": - return ReadSkeleton_4_1(path); - case "4.0": - return ReadSkeleton_4_0(path); - case "3.0": - return ReadSkeleton_3_0(path); - case "2.0": - return ReadSkeleton_2_0(path); - default: // If version is unknown. - // Attempt to read with the most recent version (but without validation). - // helps a little with forward compatibility - return ReadSkeleton_4_2(path, false); - } - } - else - { - // Could not find element, so return null. - return null; - } - } - - /// - /// Reads the skeleton contained in the BXDJ file specified and returns the root node for that skeleton. - /// - /// The input BXDJ file - /// The root node of the skeleton - public static RigidNode_Base ReadBinarySkeleton(string path) - { - BinaryReader reader = null; - try - { - reader = new BinaryReader(new FileStream(path, FileMode.Open)); //Throws IOException - // Sanity check - uint version = reader.ReadUInt32(); - BXDIO.CheckReadVersion(version); //Throws FormatException - - int nodeCount = reader.ReadInt32(); - if (nodeCount <= 0) throw new Exception("This appears to be an empty skeleton"); - - RigidNode_Base root = null; - RigidNode_Base[] nodes = new RigidNode_Base[nodeCount]; - - for (int i = 0; i < nodeCount; i++) - { - //nodes[i] = RigidNode_Base.NODE_FACTORY(); - - int parent = reader.ReadInt32(); - nodes[i].ModelFileName = (reader.ReadString()); - nodes[i].ModelFullID = (reader.ReadString()); - - if (parent != -1) - { - SkeletalJoint_Base joint = SkeletalJoint_Base.ReadJointFully(reader); - nodes[parent].AddChild(joint, nodes[i]); - - } - else - { - root = nodes[i]; - } - } - - if (root == null) - { - throw new Exception("This skeleton has no known base. \"" + path + "\" is probably corrupted."); - } - - return root; - } - catch (FormatException fe) - { - Console.WriteLine("File version mismatch"); - Console.WriteLine(fe); - return null; - } - catch (IOException ie) - { - Console.WriteLine("Could not open skeleton file"); - Console.WriteLine(ie); - return null; - } - catch (Exception e) - { - Console.WriteLine(e); - return null; - } - finally - { - if (reader != null) reader.Close(); - } - } - - /// - /// Clones joint settings for matching skeletal joints from one skeleton to the other. This does not overwrite existing joint drivers. - /// - /// Source skeleton - /// Destination skeleton - public static void CloneDriversFromTo(RigidNode_Base from, RigidNode_Base to, bool overwrite = false) - { - List tempNodes = new List(); - from.ListAllNodes(tempNodes); - - Dictionary fromNodes = new Dictionary(); - foreach (RigidNode_Base cpy in tempNodes) - { - fromNodes[cpy.GetModelID()] = cpy; - } - - tempNodes.Clear(); - to.ListAllNodes(tempNodes); - foreach (RigidNode_Base copyTo in tempNodes) - { - RigidNode_Base fromNode; - if (fromNodes.TryGetValue(copyTo.GetModelID(), out fromNode)) - { - if (copyTo.GetSkeletalJoint() != null && fromNode.GetSkeletalJoint() != null && copyTo.GetSkeletalJoint().GetJointType() == fromNode.GetSkeletalJoint().GetJointType()) - { - if(copyTo.GetSkeletalJoint().cDriver == null || overwrite) - { - // Swap driver. - copyTo.GetSkeletalJoint().cDriver = fromNode.GetSkeletalJoint().cDriver; - } - - if (copyTo.GetSkeletalJoint().attachedSensors.Count == 0 || overwrite) - { - // Swap sensors. - copyTo.GetSkeletalJoint().attachedSensors = fromNode.GetSkeletalJoint().attachedSensors; - } - } - } - } - } - -} diff --git a/api/Aardvark/IO/BXDJ/BXDJSkeletonJson.cs b/api/Aardvark/IO/BXDJ/BXDJSkeletonJson.cs deleted file mode 100644 index 0f1ad2d344..0000000000 --- a/api/Aardvark/IO/BXDJ/BXDJSkeletonJson.cs +++ /dev/null @@ -1,386 +0,0 @@ -using System; - -using System.Collections.Generic; -using System.IO; -using System.Xml; -using Newtonsoft.Json; -using BXDSim.IO.BXDJ; -using Newtonsoft.Json.Linq; -/// -/// Utility functions for reading/writing BXDJ files -/// - - - -public static partial class BXDJSkeletonJson -{ - /// - /// Represents the current version of the BXDA file. - /// - public const string BXDJ_CURRENT_VERSION = "4.3.0"; - - /// - /// Ensures that every node is assigned a model file name by assigning all nodes without a file name a generated name. - /// - /// The base node of the skeleton - /// Overwrite existing - /// - - - - public static void SetupFileNames(RigidNode_Base baseNode) - { - List nodes = new List(); - baseNode.ListAllNodes(nodes); - - for (int i = 0; i < nodes.Count; i++) - { - if (nodes[i].ModelFileName == null) - nodes[i].ModelFileName = ("node_" + i + ".bxda"); - } - } - - /// - /// Writes out the skeleton file for the skeleton with the base provided to the path provided. - /// - /// - /// - public static void WriteSkeleton(string path, RigidNode_Base baseNode) - { - - //EXPERIMENT - - // JSONExport(path, baseNode); - List nodes = new List(); - baseNode.ListAllNodes(nodes); - - // Determine the parent ID for each node in the list. - int[] parentID = new int[nodes.Count]; - - for (int i = 0; i < nodes.Count; i++) - { - if (nodes[i].GetParent() != null) - { - parentID[i] = nodes.IndexOf(nodes[i].GetParent()); - - if (parentID[i] < 0) throw new Exception("Can't resolve parent ID for " + nodes[i].ToString()); - } - else - { - parentID[i] = -1; - } - } - - - JsonSkeleton jsonSkeleton = new JsonSkeleton(); - jsonSkeleton.Version = BXDJ_CURRENT_VERSION; - - for (int i = 0; i < nodes.Count; i++) - { - JsonSkeletonNode node = new JsonSkeletonNode(); - - node.GUID = nodes[i].GUID.ToString(); - node.ParentID = parentID[i].ToString(); - node.ModelFileName = FileUtilities.SanatizeFileName("node_" + i + ".bxda"); - node.ModelID = nodes[i].GetModelID(); - - - - if (parentID[i] >= 0) - { - node.joint = nodes[i].GetSkeletalJoint(); - - node.joint.typeSave = node.joint.GetJointType(); - - if (node.joint.cDriver != null) - { - node.joint.cDriver.port1 += 1; - node.joint.cDriver.port2 += 1; - } - - - } - - - - //WriteJoint(nodes[i].GetSkeletalJoint(), node); - - jsonSkeleton.Nodes.Add(node); - } - jsonSkeleton.DriveTrainType = baseNode.driveTrainType; - jsonSkeleton.SoftwareExportedWith = "INVENTOR"; - var settings = new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.Auto }; - string toWrite = JsonConvert.SerializeObject(jsonSkeleton, settings); - File.WriteAllText(path, toWrite); - } - - public static RigidNode_Base ReadSkeleton(string path) - { - string jsonData = File.ReadAllText(path); - RigidNode_Base root = null; - JsonConverter[] converters = { new JointConverter(), new DriverMetaConverter() }; - JsonSkeleton skeleton = JsonConvert.DeserializeObject(jsonData, new JsonSerializerSettings() { Converters = converters }); - List nodes = skeleton.Nodes; - - if(nodes.Count < 1) - { - Console.Error.WriteLine("0 Nodes Loaded! Failed import"); - - return null; - } - - foreach(JsonSkeletonNode node in nodes) - { - RigidNode_Base newNode = RigidNode_Base.NODE_FACTORY(new Guid(node.GUID)); - newNode.ModelFileName = node.ModelFileName; - newNode.ModelFullID = node.ModelID; - - - if (node.ParentID == "-1") - { - root = newNode; - root.driveTrainType = skeleton.DriveTrainType; - - } - else - { - - root.AddChild(node.joint, newNode); - } - - - } - - - - return root; - } - public class JointConverter : JsonConverter - { - public override bool CanConvert(Type objectType) - { - return (objectType == typeof(SkeletalJoint_Base)); - } - - public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) - { - if (reader.TokenType == JsonToken.Null) - return null; - - JObject jo = JObject.Load(reader); - - switch (jo["typeSave"].Value()) - { - case "BALL": - - return jo.ToObject (serializer); - - break; - - case "CYLINDRICAL": - return jo.ToObject (serializer); - - break; - - case "LINEAR": - return jo.ToObject (serializer); - - break; - - case "PLANAR": - return jo.ToObject < PlanarJoint_Base > (serializer); - - break; - - case "ROTATIONAL": - return jo.ToObject < RotationalJoint_Base > (serializer); - - break; - - default: - return null; - - } - - - } - - public override bool CanWrite - { - get { return false; } - } - - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) - { - throw new NotImplementedException(); - } - } - - public class DriverMetaConverter : JsonConverter - { - public override bool CanConvert(Type objectType) - { - return (objectType == typeof(JointDriverMeta)); - } - - public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) - { - if (reader.TokenType == JsonToken.Null) - return null; - - JObject jo = JObject.Load(reader); - - switch (jo["$type"].Value()) - { - case "WheelDriverMeta, SimulatorAPI": - - return jo.ToObject(serializer); - - break; - - case "ElevatorDriverMeta, SimulatorAPI": - return jo.ToObject(serializer); - - break; - - case "PneumaticDriverMeta, SimulatorAPI": - return jo.ToObject(serializer); - - break; - - - - default: - return null; - - } - - } - - public override bool CanWrite - { - get { return false; } - } - - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) - { - throw new NotImplementedException(); - } - } - - - - - - /// - /// Reads the skeleton contained in the BXDJ file specified and returns the root node for that skeleton. - /// - /// The input BXDJ file - /// The root node of the skeleton - public static RigidNode_Base ReadBinarySkeleton(string path) - { - BinaryReader reader = null; - try - { - reader = new BinaryReader(new FileStream(path, FileMode.Open)); //Throws IOException - // Sanity check - uint version = reader.ReadUInt32(); - BXDIO.CheckReadVersion(version); //Throws FormatException - - int nodeCount = reader.ReadInt32(); - if (nodeCount <= 0) throw new Exception("This appears to be an empty skeleton"); - - RigidNode_Base root = null; - RigidNode_Base[] nodes = new RigidNode_Base[nodeCount]; - - for (int i = 0; i < nodeCount; i++) - { - //nodes[i] = RigidNode_Base.NODE_FACTORY(); - - int parent = reader.ReadInt32(); - nodes[i].ModelFileName = (reader.ReadString()); - nodes[i].ModelFullID = (reader.ReadString()); - - if (parent != -1) - { - SkeletalJoint_Base joint = SkeletalJoint_Base.ReadJointFully(reader); - nodes[parent].AddChild(joint, nodes[i]); - } - else - { - root = nodes[i]; - } - } - - if (root == null) - { - throw new Exception("This skeleton has no known base. \"" + path + "\" is probably corrupted."); - } - - return root; - } - catch (FormatException fe) - { - Console.WriteLine("File version mismatch"); - Console.WriteLine(fe); - return null; - } - catch (IOException ie) - { - Console.WriteLine("Could not open skeleton file"); - Console.WriteLine(ie); - return null; - } - catch (Exception e) - { - Console.WriteLine(e); - return null; - } - finally - { - if (reader != null) reader.Close(); - } - } - - /// - /// Clones joint settings for matching skeletal joints from one skeleton to the other. This does not overwrite existing joint drivers. - /// - /// Source skeleton - /// Destination skeleton - public static void CloneDriversFromTo(RigidNode_Base from, RigidNode_Base to, bool overwrite = false) - { - List tempNodes = new List(); - from.ListAllNodes(tempNodes); - - Dictionary fromNodes = new Dictionary(); - foreach (RigidNode_Base cpy in tempNodes) - { - fromNodes[cpy.GetModelID()] = cpy; - } - - tempNodes.Clear(); - to.ListAllNodes(tempNodes); - foreach (RigidNode_Base copyTo in tempNodes) - { - RigidNode_Base fromNode; - if (fromNodes.TryGetValue(copyTo.GetModelID(), out fromNode)) - { - if (copyTo.GetSkeletalJoint() != null && fromNode.GetSkeletalJoint() != null && copyTo.GetSkeletalJoint().GetJointType() == fromNode.GetSkeletalJoint().GetJointType()) - { - if(copyTo.GetSkeletalJoint().cDriver == null || overwrite) - { - // Swap driver. - copyTo.GetSkeletalJoint().cDriver = fromNode.GetSkeletalJoint().cDriver; - } - - if (copyTo.GetSkeletalJoint().attachedSensors.Count == 0 || overwrite) - { - // Swap sensors. - copyTo.GetSkeletalJoint().attachedSensors = fromNode.GetSkeletalJoint().attachedSensors; - } - } - } - } - } - -} diff --git a/api/Aardvark/IO/BXDJ/BXDJSkeletonJsonDefinitions.cs b/api/Aardvark/IO/BXDJ/BXDJSkeletonJsonDefinitions.cs deleted file mode 100644 index 5f961e5d93..0000000000 --- a/api/Aardvark/IO/BXDJ/BXDJSkeletonJsonDefinitions.cs +++ /dev/null @@ -1,126 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace BXDSim.IO.BXDJ -{ - public class JsonSkeleton - { - public string Version; - public RigidNode_Base.DriveTrainType DriveTrainType; - public string SoftwareExportedWith; - public List Nodes = new List(); - } - - - public class JsonSkeletonNode - { - public string GUID; - public string ParentID; - public string ModelFileName; - public string ModelID; - - public SkeletalJoint_Base joint; - - } - - - // JSON Redefintions (Not Nessary as most internal classes are "json-friendly") - - /* - public class JsonSkeletonJoint_Base - { - public string type = "BaseJoint"; - public BXDVector3 basePoint; - } - public class JsonSkeletonJoint_Ball : JsonSkeletonJoint_Base - { - // Same as parent - } - - public class JsonSkeletonJoint_Cylindrical : JsonSkeletonJoint_Base - { - public BXDVector3 Axis; - public string AngularLowLimit, AngularHighLimit; - public string LinearStartLimit; - public string LinearEndLimit; - public string CurrentLinearPosition; - public string CurrentAngularPosition; - - } - - public class JsonSkeletonJoint_Linear : JsonSkeletonJoint_Base - { - public BXDVector3 Axis; - public string LinearLowLimit; - public string LinearUpperLimit; - public string CurrentLinearPosition; - } - - public class JsonSkeletonJoint_Planar : JsonSkeletonJoint_Base - { - public BXDVector3 normal; - } - public class JsonSkeletonJoint_Rotational : JsonSkeletonJoint_Base - { - public BXDVector3 Axis; - public string AngularLowLimit, AngularHighLimit; - public string CurrentAngularPosition; - } - - public class JsonSkeletonJointDriver - { - public string DriverType; - public string MotorType; - public string Port1; - public string Port2; - public string InputGear; - public string OutputGear; - public string LowerLimit; - public string UpperLimit; - public string SignalType; - public string HasBreak; - public List Meta = new List(); - } - - public class JsonSkeletonDriverMeta_Base - { - public string DriverMetaID; - } - - public class JsonSkeletonDriverMeta_Elevator : JsonSkeletonDriverMeta_Base - { - public string ElevatorType; - } - public class JsonSkeletonDriverMeta_Pnuematic : JsonSkeletonDriverMeta_Base - { - public double WidthMM; - public double PressurePSI; - - } - public class JsonSkeletonDriverMeta_Wheel : JsonSkeletonDriverMeta_Base - { - public string WheelType; - public string WheelRadius; - public BXDVector3 WheelCenter; - public string ForwardAsympSlip; - public string ForwardAsympValue; - public string ForwardExtremeSlip; - public string ForwardExtremeValue; - public string SideAsympSlip; - public string SideAsympValue; - public bool IsDriveWheel; - } - - public class JsonSkeletonSensor - { - public string SensorType; - public int SensorPortNumberA; - public string SignalTypeA; - public int SensorPortNumberB; - public string SignalTypeB; - public double SensorConversionFactor; - } - */ -} diff --git a/api/Aardvark/IO/BinaryArrayIO.cs b/api/Aardvark/IO/BinaryArrayIO.cs deleted file mode 100644 index 0eb43be449..0000000000 --- a/api/Aardvark/IO/BinaryArrayIO.cs +++ /dev/null @@ -1,103 +0,0 @@ -using System; -using System.IO; -using System.Reflection; - -public static class BinaryArrayIO -{ - - public static void WriteArray(this BinaryWriter writer, T[] arr, int off = 0, int len = -1) - { - if (len == -1) len = arr.Length - off; - - if (typeof(BinaryRWObject).IsAssignableFrom(typeof(T))) - { - writer.Write(len); - for (int i = off; i < off + len; i++) - { - writer.Write((BinaryRWObject) arr[i]); - } - - return; - } - else if (typeof(T).IsPrimitive) - { - int size = Buffer.ByteLength(new T[1]); - byte[] res = new byte[len * size]; - Buffer.BlockCopy(arr, off * size, res, 0, res.Length); - - writer.Write(len); - writer.Write(res); - } - else - { - MethodInfo tMeth = typeof(BinaryWriter).GetMethod("Write", new Type[] { typeof(T) }); - if (tMeth == null) throw new IOException("Unsupported write object."); - - writer.Write(len); - for (int i = off; i < off + len; i++) - { - tMeth.Invoke(writer, new object[] { arr[i] }); - } - } - } - - public static T[] ReadArray(this BinaryReader reader, BinaryRWObjectExtensions.ReadObjectFully readInternal = null) - { - if (typeof(BinaryRWObject).IsAssignableFrom(typeof(T))) - { - if (readInternal == null) - { - // Try to find a constructor... - ConstructorInfo ctr = typeof(T).GetConstructor(new Type[0]); - if (ctr == null) throw new IOException("Can't read array of RWObjects directly!\n"); - - readInternal = (BinaryReader rdr) => - { - BinaryRWObject ro = (BinaryRWObject) ctr.Invoke(new object[0]); - ro.ReadBinaryData(rdr); - return ro; - }; - } - - T[] arr = new T[reader.ReadInt32()]; - for (int i = 0; i < arr.Length; i++) - { - arr[i] = (T) readInternal(reader); - } - - return arr; - } - else if (typeof(T).IsPrimitive) - { - int len = reader.ReadInt32(); - int size = Buffer.ByteLength(new T[1]); - byte[] res = new byte[len * size]; - - int count = reader.Read(res, 0, res.Length); - while (count != res.Length) - { - int read = reader.Read(res, count, res.Length - count); - count += read; - if (read < 0) throw new IOException("Failed to read enough bytes to fill array!\n"); - } - - T[] dest = new T[len]; - Buffer.BlockCopy(res, 0, dest, 0, res.Length); - return dest; - } - else - { - MethodInfo tMeth = typeof(BinaryReader).GetMethod("Read" + typeof(T).Name); - if (tMeth == null) throw new IOException("Unsupported read object."); - - T[] arr = new T[reader.ReadInt32()]; - for (int i = 0; i < arr.Length; i++) - { - arr[i] = (T) tMeth.Invoke(reader, new object[0]); - } - - return arr; - } - } - -} diff --git a/api/Aardvark/IO/BinaryRWObject.cs b/api/Aardvark/IO/BinaryRWObject.cs deleted file mode 100644 index be72344a01..0000000000 --- a/api/Aardvark/IO/BinaryRWObject.cs +++ /dev/null @@ -1,125 +0,0 @@ -using System; -using System.IO; - -/// -/// Interface for objects that can read/write binary data to files -/// -public interface BinaryRWObject -{ - /// - /// Serializes this object to the given stream - /// - /// Output stream - void WriteBinaryData(BinaryWriter writer); - - /// - /// Deserializes this object from the given stream. - /// - /// Input stream - void ReadBinaryData(BinaryReader reader); -} - -/// -/// Extension functions for objects implementing the BinaryRWObject interface -/// -public static class BinaryRWObjectExtensions -{ - - /// - /// Delegate function to read a RWObject from a binary stream - /// - /// Binary stream to read object from - /// The created object - public delegate BinaryRWObject ReadObjectFully(BinaryReader reader); - - /// - /// Writes this object to the given output path. - /// - /// Output path - public static void WriteToFile(this BinaryRWObject obj, String path) - { - if (File.Exists(path)) File.Delete(path); - using(BinaryWriter writer = new BinaryWriter(new FileStream(path, FileMode.OpenOrCreate))) - { - writer.Write(obj); - } - } - - /// - /// Reads this object from the given input path. - /// - /// Input path - public static void ReadFromFile(this BinaryRWObject obj, String path, BXDIO.ProgressReporter progress = null) - { - using (BinaryReader reader = new BinaryReader(new FileStream(path, FileMode.Open))) - { - System.Threading.Thread progressThread = null; - if (progress != null) - { - // Not the most informative, but it is something. - progressThread = new System.Threading.Thread(() => - { - while (true) - { - progress(reader.BaseStream.Position, reader.BaseStream.Length); - System.Threading.Thread.Sleep(10); - } - }); - progressThread.Start(); - } - obj.ReadBinaryData(reader); - if (progressThread != null) - { - progressThread.Abort(); - } - } - } - - /// - /// Serializes the object into this stream - /// - /// Output stream - public static void Write(this BinaryWriter writer, BinaryRWObject obj) - { - obj.WriteBinaryData(writer); - } - - /// - /// Deserializes the object from this stream - /// - /// Input stream - /// Optional delegate to create the object - public static T ReadRWObject(this BinaryReader reader, BinaryRWObjectExtensions.ReadObjectFully readInternal = null) - { - if (readInternal == null) - { - // Try to find a constructor... - System.Reflection.ConstructorInfo ctr = typeof(T).GetConstructor(new Type[0]); - if (ctr == null) - { - throw new IOException("Can't read " + typeof(T).Name + " directly!\n"); - } - else - { - readInternal = (BinaryReader rdr) => - { - BinaryRWObject ro = (BinaryRWObject) ctr.Invoke(new object[0]); - ro.ReadBinaryData(rdr); - return ro; - }; - } - } - return (T) readInternal(reader); - } - - /// - /// Deserializes the object from this stream - /// - /// Input stream - /// Read into - public static T ReadRWInto(this BinaryReader reader, T t) where T : BinaryRWObject - { - t.ReadBinaryData(reader); - return t; - } -} \ No newline at end of file diff --git a/api/Aardvark/IO/IOUtilities.cs b/api/Aardvark/IO/IOUtilities.cs deleted file mode 100644 index 6f0865cb43..0000000000 --- a/api/Aardvark/IO/IOUtilities.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Collections.Generic; -using System.Xml; - -/// -/// Used for simplifying reading and writing operations. -/// -public static class IOUtilities -{ - /// - /// Used for easy access of all elements read by an XmlReader. - /// - /// - /// - public static IEnumerable AllElements(XmlReader reader) - { - while (reader.Read()) - { - if (reader.IsStartElement()) - yield return reader.Name; - } - } -} diff --git a/api/Aardvark/IO/JsonExportGood.txt b/api/Aardvark/IO/JsonExportGood.txt deleted file mode 100644 index cea81d753a..0000000000 --- a/api/Aardvark/IO/JsonExportGood.txt +++ /dev/null @@ -1 +0,0 @@ -{"Version":"4.3.0","DriveTrainType":"NONE","SoftwareExportedWith":"INVENTOR","Nodes":[{"GUID":"00000000-0000-0000-0000-000000000000","ParentID":"-1","ModelFileName":"node_0.bxda","ModelID":null,"joint":null},{"GUID":"00000000-0000-0000-0000-000000000000","ParentID":"0","ModelFileName":"node_1.bxda","ModelID":null,"joint":{"axis":null,"basePoint":null,"currentAngularPosition":0.0,"hasAngularLimit":false,"angularLimitLow":0.0,"angularLimitHigh":0.0,"cDriver":null,"attachedSensors":[]}}]} \ No newline at end of file diff --git a/api/Aardvark/IO/README.md b/api/Aardvark/IO/README.md deleted file mode 100644 index 75e3593609..0000000000 --- a/api/Aardvark/IO/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# SimulatorFileIO/IO -## This contains all the xml/ binary readers and writers and schemas for BXDJs, BXDAs, and BXDFs. - diff --git a/api/Aardvark/Joints/AngularDOF.cs b/api/Aardvark/Joints/AngularDOF.cs deleted file mode 100644 index fd99db46c2..0000000000 --- a/api/Aardvark/Joints/AngularDOF.cs +++ /dev/null @@ -1,39 +0,0 @@ -/// -/// Contains information about a rotational degree of freedom. -/// -public interface AngularDOF -{ - float currentPosition - { - get; - } - float upperLimit - { - get; - set; - } - float lowerLimit - { - get; - set; - } - - BXDVector3 rotationAxis - { - get; - set; - } - BXDVector3 basePoint - { - get; - set; - } -} - -public static class AngularDOFExtensions -{ - public static bool hasAngularLimits(this AngularDOF dof) - { - return !float.IsPositiveInfinity(dof.upperLimit) || !float.IsNegativeInfinity(dof.lowerLimit); - } -} \ No newline at end of file diff --git a/api/Aardvark/Joints/BallJoint_Base.cs b/api/Aardvark/Joints/BallJoint_Base.cs deleted file mode 100644 index 9af835f568..0000000000 --- a/api/Aardvark/Joints/BallJoint_Base.cs +++ /dev/null @@ -1,108 +0,0 @@ -using System; -using System.Collections.Generic; - -public class BallJoint_Base : SkeletalJoint_Base -{ - #region AngularDOF_Impl - private class AngularDOF_Impl : AngularDOF - { - private readonly BallJoint_Base bjb; - private readonly int axis; - public AngularDOF_Impl(BallJoint_Base bjb, int axis) - { - this.bjb = bjb; - this.axis = axis; - } - - public float currentPosition - { - get - { - throw new NotImplementedException(); - } - } - - public float upperLimit - { - get - { - return float.PositiveInfinity; - } - set - { - throw new NotImplementedException(); - } - } - - public float lowerLimit - { - get - { - return float.NegativeInfinity; - } - set - { - throw new NotImplementedException(); - } - } - - public BXDVector3 rotationAxis - { - get - { - throw new NotImplementedException(); - } - set - { - throw new NotImplementedException(); - } - } - - public BXDVector3 basePoint - { - get - { - return bjb.basePoint; - } - set - { - bjb.basePoint = value; - } - } - } - #endregion - - public BXDVector3 basePoint; - - private readonly AngularDOF[] angularDOF; - - public BallJoint_Base() - { - angularDOF = new AngularDOF[] { new AngularDOF_Impl(this, 0), new AngularDOF_Impl(this, 1), new AngularDOF_Impl(this, 2) }; - } - - public override SkeletalJointType GetJointType() - { - return SkeletalJointType.BALL; - } - - protected override void WriteBinaryJointInternal(System.IO.BinaryWriter writer) - { - writer.Write(basePoint); - } - - protected override void ReadBinaryJointInternal(System.IO.BinaryReader reader) - { - basePoint = reader.ReadRWObject(); - } - - public override IEnumerable GetAngularDOF() - { - return angularDOF; - } - - public override IEnumerable GetLinearDOF() - { - return new LinearDOF[0]; - } -} \ No newline at end of file diff --git a/api/Aardvark/Joints/CylindricalJoint_Base.cs b/api/Aardvark/Joints/CylindricalJoint_Base.cs deleted file mode 100644 index 61d1ccca0e..0000000000 --- a/api/Aardvark/Joints/CylindricalJoint_Base.cs +++ /dev/null @@ -1,259 +0,0 @@ -using System.Collections.Generic; - -/// -/// Contains DOF information for a cylindrical joint. (1 angular and 1 linear) -/// -public class CylindricalJoint_Base : SkeletalJoint_Base -{ - #region LinearDOF_Impl - private class LinearDOF_Impl : LinearDOF - { - private readonly CylindricalJoint_Base cjb; - public LinearDOF_Impl(CylindricalJoint_Base cjb) - { - this.cjb = cjb; - } - - public float currentPosition - { - get - { - return cjb.currentLinearPosition; - } - } - - public float upperLimit - { - get - { - cjb.EnforceOrder(); - return cjb.hasLinearEndLimit ? cjb.linearLimitEnd : float.PositiveInfinity; - } - set - { - cjb.linearLimitEnd = value; - cjb.hasLinearEndLimit = !float.IsInfinity(cjb.linearLimitEnd); - } - } - - public float lowerLimit - { - get - { - cjb.EnforceOrder(); - return cjb.hasLinearStartLimit ? cjb.linearLimitStart : float.NegativeInfinity; - } - set - { - cjb.linearLimitStart = value; - cjb.hasLinearStartLimit = !float.IsInfinity(cjb.linearLimitStart); - } - } - - public BXDVector3 translationalAxis - { - get - { - return cjb.axis; - } - set - { - cjb.axis = value; - } - } - - public BXDVector3 basePoint - { - get - { - return cjb.basePoint; - } - set - { - cjb.basePoint = value; - } - } - } - #endregion - #region AngularDOF_Impl - private class AngularDOF_Impl : AngularDOF - { - private readonly CylindricalJoint_Base cjb; - public AngularDOF_Impl(CylindricalJoint_Base cjb) - { - this.cjb = cjb; - } - public float currentPosition - { - get - { - return cjb.currentAngularPosition; - } - } - - public float upperLimit - { - get - { - cjb.EnforceOrder(); - return cjb.hasAngularLimit ? cjb.angularLimitHigh : float.PositiveInfinity; - } - set - { - cjb.angularLimitHigh = value; - cjb.hasAngularLimit = !float.IsInfinity(cjb.angularLimitHigh) && !float.IsInfinity(cjb.angularLimitLow); - } - } - - public float lowerLimit - { - get - { - cjb.EnforceOrder(); - return cjb.hasAngularLimit ? cjb.angularLimitLow : float.NegativeInfinity; - } - set - { - cjb.angularLimitLow = value; - cjb.hasAngularLimit = !float.IsInfinity(cjb.angularLimitHigh) && !float.IsInfinity(cjb.angularLimitLow); - } - } - - public BXDVector3 rotationAxis - { - get - { - return cjb.axis; - } - set - { - cjb.axis = value; - } - } - - public BXDVector3 basePoint - { - get - { - return cjb.basePoint; - } - set - { - cjb.basePoint = value; - } - } - } - #endregion - - public BXDVector3 axis; //The axis of both rotation and movement; - public BXDVector3 basePoint; - - public float currentLinearPosition, currentAngularPosition; - - public bool hasAngularLimit; - public float angularLimitLow; - public float angularLimitHigh; - public bool hasLinearStartLimit; - public bool hasLinearEndLimit; - public float linearLimitStart; - public float linearLimitEnd; - - private readonly LinearDOF[] linearDOF; - private readonly AngularDOF[] angularDOF; - - public CylindricalJoint_Base() - { - linearDOF = new LinearDOF[] { new LinearDOF_Impl(this) }; - angularDOF = new AngularDOF[] { new AngularDOF_Impl(this) }; - } - - public override SkeletalJointType GetJointType() - { - return SkeletalJointType.CYLINDRICAL; - } - - protected override void WriteBinaryJointInternal(System.IO.BinaryWriter writer) - { - EnforceOrder(); - - writer.Write(basePoint); - writer.Write(axis); - - //1 indicates a linear limit. - writer.Write((byte) ((hasAngularLimit ? 1 : 0) | (hasLinearStartLimit ? 2 : 0) | (hasLinearEndLimit ? 4 : 0))); - if (hasAngularLimit) - { - writer.Write(angularLimitLow); - writer.Write(angularLimitHigh); - } - - if (hasLinearStartLimit) - { - writer.Write(linearLimitStart); - } - if (hasLinearEndLimit) - { - writer.Write(linearLimitEnd); - } - - writer.Write(currentLinearPosition); - writer.Write(currentAngularPosition); - } - - protected override void ReadBinaryJointInternal(System.IO.BinaryReader reader) - { - basePoint = reader.ReadRWObject(); - axis = reader.ReadRWObject(); - - byte limits = reader.ReadByte(); - hasAngularLimit = (limits & 1) == 1; - hasLinearStartLimit = (limits & 2) == 2; - hasLinearEndLimit = (limits & 4) == 4; - - if (hasAngularLimit) - { - angularLimitLow = reader.ReadSingle(); - angularLimitHigh = reader.ReadSingle(); - } - - if (hasLinearStartLimit) - { - linearLimitStart = reader.ReadSingle(); - } - if (hasLinearEndLimit) - { - linearLimitEnd = reader.ReadSingle(); - } - - currentLinearPosition = reader.ReadSingle(); - currentAngularPosition = reader.ReadSingle(); - - EnforceOrder(); - } - - public void EnforceOrder() - { - if (hasAngularLimit && angularLimitLow > angularLimitHigh) - { - float temp = angularLimitHigh; - angularLimitHigh = angularLimitLow; - angularLimitLow = temp; - } - if (hasLinearStartLimit && hasLinearEndLimit && linearLimitStart > linearLimitEnd) - { - float temp = linearLimitEnd; - linearLimitEnd = linearLimitStart; - linearLimitStart = temp; - } - } - - public override IEnumerable GetAngularDOF() - { - return angularDOF; - } - - public override IEnumerable GetLinearDOF() - { - return linearDOF; - } -} diff --git a/api/Aardvark/Joints/Driver/ElevatorDriverMeta.cs b/api/Aardvark/Joints/Driver/ElevatorDriverMeta.cs deleted file mode 100644 index a7a041697d..0000000000 --- a/api/Aardvark/Joints/Driver/ElevatorDriverMeta.cs +++ /dev/null @@ -1,27 +0,0 @@ -public enum ElevatorType : byte -{ - NOT_MULTI = 0, //Single stage elevator, constitutes most frc elevator - CASCADING_STAGE_1 = 1, - CASCADING_STAGE_2 = 2, - CONTINUOUS_STAGE_1 = 3, - CONTINUOUS_STAGE_2 = 4 -} -public class ElevatorDriverMeta : JointDriverMeta -{ - public ElevatorType type; - - public ElevatorDriverMeta() - { - } - - protected override void WriteDataInternal(System.IO.BinaryWriter writer) - { - writer.Write((byte)((int)type)); - } - - protected override void ReadDataInternal(System.IO.BinaryReader reader) - { - type = (ElevatorType)reader.ReadByte(); - } - -} \ No newline at end of file diff --git a/api/Aardvark/Joints/Driver/JointDriver.cs b/api/Aardvark/Joints/Driver/JointDriver.cs deleted file mode 100644 index 6e30ebb39b..0000000000 --- a/api/Aardvark/Joints/Driver/JointDriver.cs +++ /dev/null @@ -1,308 +0,0 @@ -using System; -using System.Collections.Generic; -/// -/// Generic class able to represent all types of joint drivers. -/// -public class JointDriver : BinaryRWObject, IComparable -{ - /// - /// The type of this joint driver. - /// - private JointDriverType type; - - /// - /// The motor type of this joint driver. - /// - public MotorType motor { get; set; } - - /// - /// The port(s) that this joint driver uses. - /// - public int port1, port2; - /// - /// The gear ratio that the input gear uses - /// - /// Input gear ratio - public double InputGear { get; set; }// getter/setter for the input gear internal data structure - - /// - /// The gear ratio that the output gear uses - /// - /// Output gear ratio - public double OutputGear { get; set; }// getter/setter for the output gear internal data structure - - /// - /// Whether or not the driver has an attached brake - /// - /// Determines whether or not the joint has a brake - public bool hasBrake { get; set; }// getter/setter for the output gear internal data structure - - //wat - public bool isCan = false; - - /// - /// The motion limits for this driver. For continuous rotation this is likely a force or velocity. - /// For linear or limited movement it is motion limits. - /// - public float lowerLimit, upperLimit; - - /// - /// Metadata information for this joint driver. - /// - public Dictionary MetaInfo - { - get; - private set; - } - - /// - /// Creates as joint driver with no type. This is mainly for IO - /// - public JointDriver() - { - MetaInfo = new Dictionary(); - } - - /// - /// Creates a joint driver with the given type. - /// - /// Driver type - public JointDriver(JointDriverType type) - : this() - { - this.type = type; - } - - /// - /// Adds the given joint driver metadata object to this driver, or replaces the existing metadata of the same type. - /// - /// The metadata - public void AddInfo(JointDriverMeta metaDriver) - { - try - { - MetaInfo.Add(metaDriver.GetType(), metaDriver); - // metaDriver.LoadJSONType(); - } - catch - { - //Always throws SystemNullReferenceException here when you are exporting pneumatic - //Go to JointDrivderMeta.cs Line 15 to patch - MetaInfo[metaDriver.GetType()] = metaDriver; - } - } - - - /// - /// Removes the metadata of the given type stored in this joint driver and returns it, or null if no such metadata exists. - /// - /// The type of the metadata - /// Metadata, or null - public T RemoveInfo() where T : JointDriverMeta - { - JointDriverMeta val; - System.Type type = typeof(T); - if (MetaInfo.TryGetValue(type, out val)) - { - MetaInfo.Remove(type); - return (T) val; - } - return null; - } - - /// - /// Gets the metadata of the given type stored in this joint driver, or null if no such metadata exists. - /// - /// The type of the metadata - /// Metadata, or null - public T GetInfo() where T : JointDriverMeta - { - JointDriverMeta val; - System.Type type = typeof(T); - if (MetaInfo.TryGetValue(type, out val)) - { - return (T) val; - } - return null; - } - - /// - /// Gets the metadata of the given type stored in this joint driver, or null if no such metadata exists. - /// - /// The type to get info for - /// Metadata, or null - public JointDriverMeta GetInfo(System.Type type) - { - JointDriverMeta val; - if (MetaInfo.TryGetValue(type, out val)) - { - return val; - } - return null; - } - - public void CopyMetaInfo(JointDriver toCopy) - { - foreach (KeyValuePair pair in MetaInfo) - { - toCopy.MetaInfo.Add(pair.Key, pair.Value); - } - } - - /// - /// Gets the possible types of joint drivers for the given skeletal joint. - /// - /// Skeletal joint to get allowed types for - /// Joint driver options - public static JointDriverType[] GetAllowedDrivers(SkeletalJoint_Base joint) - { - switch (joint.GetJointType()) - { - case SkeletalJointType.ROTATIONAL: - // Pneumatic and Worm Screw map to angles - return new JointDriverType[] { // These other options work, but aren't yet supported by the engine - JointDriverType.MOTOR, -// JointDriverType.SERVO, -// JointDriverType.BUMPER_PNEUMATIC, -// JointDriverType.RELAY_PNEUMATIC, -// JointDriverType.WORM_SCREW, -// JointDriverType.DUAL_MOTOR - }; - case SkeletalJointType.LINEAR: - return new JointDriverType[] - { - JointDriverType.ELEVATOR, -// JointDriverType.BUMPER_PNEUMATIC, -// JointDriverType.RELAY_PNEUMATIC, -// JointDriverType.WORM_SCREW - }; - case SkeletalJointType.CYLINDRICAL: - return new JointDriverType[] { -// JointDriverType.BUMPER_PNEUMATIC, -// JointDriverType.RELAY_PNEUMATIC, -// JointDriverType.WORM_SCREW, - JointDriverType.MOTOR, -// JointDriverType.SERVO, -// JointDriverType.DUAL_MOTOR - - }; - case SkeletalJointType.PLANAR: - //Not sure of an FRC part with planar motion. Will add later if needed. - return new JointDriverType[] { }; - case SkeletalJointType.BALL: - return new JointDriverType[] { }; - default: - return new JointDriverType[0];// Not implemented - } - } - - /// - /// Sets the port(s) for this driver. - /// - /// First port - /// Option second port - public void SetPort(int port1, int port2 = -1) - { - this.port1 = port1; - this.port2 = port2; - } - - /// - /// Sets the limits for this driver. - /// - /// - /// For all linear motion these represent the linear limits on that motion. - /// For all limited angular motion these represent the angular limits on that motion. - /// For all continuous angular motion these represent the force limits on that motion. - /// - /// Lower limit - /// Upper limit - public void SetLimits(float lower, float upper) - { - lowerLimit = lower; - upperLimit = upper; - } - - public override string ToString() - { - string info = ""; - - // Joint type - string jointType = System.Enum.GetName(typeof(JointDriverType), GetDriveType()).Replace('_', ' ').ToLowerInvariant(); - info += jointType.Substring(0, 1).ToUpper() + jointType.Substring(1); // Capitalize first letter - - // Port information - info += ", Ports: " + type.GetPortType(isCan) + " " + port1 + (type.HasTwoPorts() ? " and " + port2 : ""); - - return info; - } - - /// - /// Gets the type of this joint driver. - /// - /// Driver type - public JointDriverType GetDriveType() - { - return type; - } - - /// - /// Gets the motor of this joint driver. - /// - /// Motor type - public MotorType GetMotorType() - { - return motor; - } - - /// - /// Writes the binary representation of this driver to the stream. - /// - /// Output stream - public void WriteBinaryData(System.IO.BinaryWriter writer) - {//these need to stay in the correct order to read the data properly, and need to stay with the same data type so the byte order stays correct - writer.Write((byte) ((int) GetDriveType())); - writer.Write((short)port1); - writer.Write((short)port2); - writer.Write((double)InputGear);// write the input gear to the Binary writer - writer.Write((double)OutputGear);// write the output gear to the Binary writer - writer.Write(lowerLimit); - writer.Write(upperLimit); - writer.Write(isCan); - writer.Write(MetaInfo.Count); // Extension count - foreach (JointDriverMeta meta in MetaInfo.Values) - { - meta.WriteData(writer); - } - } - - /// - /// Reads the binary representation of this driver from the stream. - /// - /// Input stream - public void ReadBinaryData(System.IO.BinaryReader reader) - { - type = (JointDriverType) ((int) reader.ReadByte()); - port1 = reader.ReadInt16(); - port2 = reader.ReadInt16(); - lowerLimit = reader.ReadSingle(); - upperLimit = reader.ReadSingle(); - isCan = reader.ReadBoolean(); - int extensions = reader.ReadInt32(); - MetaInfo.Clear(); - for (int i = 0; i < extensions; i++) - { - JointDriverMeta meta = JointDriverMeta.ReadDriverMeta(reader); - AddInfo(meta); - } - } - - public int CompareTo(JointDriver driver) - { - if (driver == null) return 1; - - if (ToString() == driver.ToString()) return 0; - else return 1; - } - -} \ No newline at end of file diff --git a/api/Aardvark/Joints/Driver/JointDriverMeta.cs b/api/Aardvark/Joints/Driver/JointDriverMeta.cs deleted file mode 100644 index 8d9b249542..0000000000 --- a/api/Aardvark/Joints/Driver/JointDriverMeta.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using System.IO; - -/// -/// Base class all joint metadata should inherit from. -/// -/// -/// If you inherit make sure to add your type to , -/// and make sure you have a public constructor that takes no arguments. -/// -public abstract class JointDriverMeta -{ - // Constant, but can't be declared so. - public readonly static Type[] JOINT_DRIVER_META_TYPES = new Type[] { typeof(WheelDriverMeta), typeof(PneumaticDriverMeta), typeof(ElevatorDriverMeta) }; - - protected abstract void WriteDataInternal(BinaryWriter writer); - protected abstract void ReadDataInternal(BinaryReader reader); - - public int GetID() - { - // Find my ID - int myID = -1; - for (int i = 0; i < JOINT_DRIVER_META_TYPES.Length; i++) - { - if (JOINT_DRIVER_META_TYPES[i].Equals(GetType())) - { - myID = i; - break; - } - } - System.Diagnostics.Debug.Assert(myID >= 0, "Unknown Driver Meta. Did you register your type?"); - return myID; - } - - public void WriteData(BinaryWriter writer) - { - writer.Write((byte) GetID()); - WriteDataInternal(writer); - } - - public static JointDriverMeta ReadDriverMeta(BinaryReader reader) - { - int type = reader.ReadByte(); - JointDriverMeta meta = (JointDriverMeta) JOINT_DRIVER_META_TYPES[type].GetConstructor(new Type[0]).Invoke(new Object[0]); - meta.ReadDataInternal(reader); - return meta; - } -} diff --git a/api/Aardvark/Joints/Driver/JointDriverType.cs b/api/Aardvark/Joints/Driver/JointDriverType.cs deleted file mode 100644 index 8a12c124d6..0000000000 --- a/api/Aardvark/Joints/Driver/JointDriverType.cs +++ /dev/null @@ -1,188 +0,0 @@ -/// -/// Types of joint drivers. -/// -public enum JointDriverType : byte -{ - MOTOR = 1, - SERVO = 2, - WORM_SCREW = 3, - BUMPER_PNEUMATIC = 4, - RELAY_PNEUMATIC = 5, - DUAL_MOTOR = 6, - ELEVATOR = 7 -} - -/// -/// Types of joint motors -/// -public enum MotorType : byte -{ - GENERIC = 0, - CIM = 1, - MINI_CIM = 2, - BAG_MOTOR = 3, - REDLINE_775_PRO = 4, - ANDYMARK_9015 = 5, - BANEBOTS_775_18v = 6, - BANEBOTS_775_12v = 7, - BANEBOTS_550_12v = 8, - ANDYMARK_775_125 = 9, - SNOW_BLOWER = 10, - NIDEC_BLDC = 11, - THROTTLE_MOTOR = 12, - WINDOW_MOTOR = 13, - NEVEREST = 14, - TETRIX_MOTOR = 15, - MODERN_ROBOTICS_MATRIX = 16, - REV_ROBOTICS_HD_HEX_20_TO_1 = 17, - REV_ROBOTICS_HD_HEX_40_TO_1 = 18, - REV_ROBOTICS_CORE_HEX = 19, - VEX_V5_Smart_Motor_600_RPM = 20, - VEX_V5_Smart_Motor_200_RPM = 21, - VEX_V5_Smart_Motor_100_RPM = 22, - VEX_393_NORMAL_SPEED = 23, - VEX_393_HIGH_SPEED = 24, - VEX_393_TURBO_GEAR_SET = 25 -} - -public static class JointDriverTypeExtensions -{ - /// - /// Checks if the given driver type requires two ports. - /// - /// Driver type - /// True is the given type requires two ports - public static bool HasTwoPorts(this JointDriverType type) - { - return type == JointDriverType.BUMPER_PNEUMATIC || type == JointDriverType.DUAL_MOTOR; - } - - /// - /// Gets the string representation of the port for the given driver type. - /// - /// Driver type - /// Name of port type - public static string GetPortType(this JointDriverType type) - { - switch (type) - { - case JointDriverType.MOTOR: - case JointDriverType.SERVO: - case JointDriverType.DUAL_MOTOR: - case JointDriverType.WORM_SCREW: - case JointDriverType.ELEVATOR: - return "PWM"; - case JointDriverType.BUMPER_PNEUMATIC: - return "Solenoid"; - case JointDriverType.RELAY_PNEUMATIC: - return "Relay"; - default: - return "Unknown"; - } - } - - /// - /// Gets the string representation of the port for the given driver type. - /// - /// Driver type - /// Name of port type - public static string GetPortType(this JointDriverType type, bool isCan) - { - switch (type) - { - case JointDriverType.MOTOR: - case JointDriverType.SERVO: - case JointDriverType.DUAL_MOTOR: - case JointDriverType.WORM_SCREW: - case JointDriverType.ELEVATOR: - return isCan ? "CAN" : "PWM"; - case JointDriverType.BUMPER_PNEUMATIC: - return "Solenoid"; - case JointDriverType.RELAY_PNEUMATIC: - return "Relay"; - default: - return "Unknown"; - } - } - - /// - /// Checks if the given driver type is a motor. - /// - /// Driver type - /// Boolean - public static bool IsMotor(this JointDriverType type) - { - switch (type) - { - case JointDriverType.MOTOR: - case JointDriverType.DUAL_MOTOR: - return true; - default: - return false; - } - } - - public static bool IsElevator(this JointDriverType type) - { - return type == JointDriverType.ELEVATOR; - } - /// - /// Checks if the given driver type is pneumatic. - /// - /// Driver type - /// Boolean - public static bool IsPneumatic(this JointDriverType type) - { - switch (type) - { - case JointDriverType.BUMPER_PNEUMATIC: - case JointDriverType.RELAY_PNEUMATIC: - return true; - default: - return false; - } - } - /// - /// Checks if the given driver type is a worm screw. - /// - /// Driver type - /// Boolean - public static bool IsWormScrew(this JointDriverType type) - { - switch (type) - { - case JointDriverType.WORM_SCREW: - return true; - default: - return false; - } - } - - /// - /// Gets the maximum port number for the given driver type. - /// - /// Driver type - /// Max port number - public static int GetPortMax(this JointDriverType type, bool isCan) - { - - switch (type) - { - case JointDriverType.MOTOR: - - case JointDriverType.DUAL_MOTOR: - case JointDriverType.SERVO: - case JointDriverType.WORM_SCREW: - case JointDriverType.ELEVATOR: - return isCan ? 63 : 19; - case JointDriverType.BUMPER_PNEUMATIC: - return 8; // Bumper - case JointDriverType.RELAY_PNEUMATIC: - return 8; // Relay - default: - return -1; - } - } - - -} \ No newline at end of file diff --git a/api/Aardvark/Joints/Driver/PneumaticDriverMeta.cs b/api/Aardvark/Joints/Driver/PneumaticDriverMeta.cs deleted file mode 100644 index 6fb2f4cf46..0000000000 --- a/api/Aardvark/Joints/Driver/PneumaticDriverMeta.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.IO; - -public enum PneumaticPressure : byte -{ - HIGH = 0, - MEDIUM = 1, - LOW = 2 -} - - -/// -/// Stores the variables concerning a pneumatic cylinder. -/// -public class PneumaticDriverMeta : JointDriverMeta -{ - public float widthMM; - public float pressurePSI; - - #region WHERE IS YOUR _TODD_ NOW - public double width; - - - public PneumaticPressure pressureEnum - { - get - { - if (pressurePSI == 20) - return PneumaticPressure.LOW; - if (pressurePSI == 40) - return PneumaticPressure.MEDIUM; - return PneumaticPressure.HIGH; - } - set - { - switch (value) - { - case PneumaticPressure.MEDIUM: - pressurePSI = 40; - break; - case PneumaticPressure.LOW: - pressurePSI = 20; - break; - default: - case PneumaticPressure.HIGH: - pressurePSI = 60; - break; - } - } - } - #endregion - - - protected override void WriteDataInternal(BinaryWriter writer) - { - writer.Write(widthMM); - writer.Write(pressurePSI); - } - protected override void ReadDataInternal(BinaryReader reader) - { - widthMM = reader.ReadSingle(); - pressurePSI = reader.ReadSingle(); - } -} \ No newline at end of file diff --git a/api/Aardvark/Joints/Driver/WheelDriverMeta.cs b/api/Aardvark/Joints/Driver/WheelDriverMeta.cs deleted file mode 100644 index cbab6754b0..0000000000 --- a/api/Aardvark/Joints/Driver/WheelDriverMeta.cs +++ /dev/null @@ -1,181 +0,0 @@ -using System.IO; - -public enum WheelType : byte -{ - NOT_A_WHEEL = 0, - NORMAL = 1, //As in, not omni or mecanum. - OMNI = 2, - MECANUM = 3 -} - -public enum FrictionLevel : byte -{ - HIGH = 0, - MEDIUM = 1, - LOW = 2 -} - -/// -/// Stores the variables concerning a wheel, such as its position (which may be removed later) and radius. -/// -public class WheelDriverMeta : JointDriverMeta -{ - public float radius; - public WheelType type; - public float width; - public BXDVector3 center; - - public float forwardExtremeSlip; - public float forwardExtremeValue; - public float forwardAsympSlip; - public float forwardAsympValue; - public float sideExtremeSlip; - public float sideExtremeValue; - public float sideAsympSlip; - public float sideAsympValue; - public bool isDriveWheel; - public WheelDriverMeta() - { - center = new BXDVector3(); - - } - - //Writes the position of the wheel to the file. - protected override void WriteDataInternal(BinaryWriter writer) - { - writer.Write((byte) ((int) type)); - writer.Write(radius); - writer.Write(width); - - writer.Write(center); - - writer.Write(forwardAsympSlip); - writer.Write(forwardAsympValue); - writer.Write(forwardExtremeSlip); - writer.Write(forwardExtremeValue); - writer.Write(sideAsympSlip); - writer.Write(sideAsympValue); - writer.Write(sideExtremeSlip); - writer.Write(sideExtremeValue); - writer.Write(isDriveWheel); - } - - //Reads the position of the wheel from the file. - protected override void ReadDataInternal(BinaryReader reader) - { - type = (WheelType) reader.ReadByte(); - radius = reader.ReadSingle(); - width = reader.ReadSingle(); - - center = reader.ReadRWObject(); - - forwardAsympSlip = reader.ReadSingle(); - forwardAsympValue = reader.ReadSingle(); - forwardExtremeSlip = reader.ReadSingle(); - forwardExtremeValue = reader.ReadSingle(); - sideAsympSlip = reader.ReadSingle(); - sideAsympValue = reader.ReadSingle(); - sideExtremeSlip = reader.ReadSingle(); - sideExtremeValue = reader.ReadSingle(); - isDriveWheel = reader.ReadBoolean(); - } - - public void SetFrictionLevel(FrictionLevel level) - { - switch (level) - { - case FrictionLevel.HIGH: - forwardExtremeSlip = 1; //Speed of max static friction force. - forwardExtremeValue = 10; //Force of max static friction force. - forwardAsympSlip = 1.5f; //Speed of leveled off kinetic friction force. - forwardAsympValue = 8; //Force of leveld off kinetic friction force. - - if (type == WheelType.OMNI) //Set to relatively low friction, as omni wheels can move sidways. - { - sideExtremeSlip = 1; //Same as above, but orthogonal to the movement of the wheel. - sideExtremeValue = .01f; - sideAsympSlip = 1.5f; - sideAsympValue = .005f; - } - else - { - sideExtremeSlip = 1; - sideExtremeValue = 10; - sideAsympSlip = 1.5f; - sideAsympValue = 8; - } - break; - case FrictionLevel.MEDIUM: - forwardExtremeSlip = 1f; - forwardExtremeValue = 7; - forwardAsympSlip = 1.5f; - forwardAsympValue = 5; - - if (type == WheelType.OMNI) - { - sideExtremeSlip = 1; - sideExtremeValue = .01f; - sideAsympSlip = 1.5f; - sideAsympValue = .005f; - } - else - { - sideExtremeSlip = 1; - sideExtremeValue = 7; - sideAsympSlip = 1.5f; - sideAsympValue = 5; - } - break; - case FrictionLevel.LOW: - forwardExtremeSlip = 1; - forwardExtremeValue = 5; - forwardAsympSlip = 1.5f; - forwardAsympValue = 3; - - if (type == WheelType.OMNI) - { - sideExtremeSlip = 1; - sideExtremeValue = .01f; - sideAsympSlip = 1.5f; - sideAsympValue = .005f; - } - else - { - sideExtremeSlip = 1; - sideExtremeValue = 5; - sideAsympSlip = 1.5f; - sideAsympValue = 3; - } - break; - } - } - - public FrictionLevel GetFrictionLevel() - { - if (forwardExtremeValue >= 10) - return FrictionLevel.HIGH; - else if (forwardExtremeValue >= 7) - return FrictionLevel.MEDIUM; - else - return FrictionLevel.LOW; - } - - public string GetTypeString() - { - switch (type) - { - case WheelType.OMNI: - return "Omni Wheel"; - case WheelType.MECANUM: - return "Mecanum"; - default: - return "Normal"; - } - } - - public override string ToString() - { - return "WheelMeta[rad=" + radius + "]"; - } - -} \ No newline at end of file diff --git a/api/Aardvark/Joints/LinearDOF.cs b/api/Aardvark/Joints/LinearDOF.cs deleted file mode 100644 index d0e1caf8f8..0000000000 --- a/api/Aardvark/Joints/LinearDOF.cs +++ /dev/null @@ -1,44 +0,0 @@ -/// -/// Contains information about a linear degree of freedom. -/// -public interface LinearDOF -{ - float currentPosition - { - get; - } - float upperLimit - { - get; - set; - } - float lowerLimit - { - get; - set; - } - - BXDVector3 translationalAxis - { - get; - set; - } - BXDVector3 basePoint - { - get; - set; - } -} - -public static class LinearDOFExtensions -{ - public static bool hasUpperLinearLimit(this LinearDOF dof) - { - return !float.IsPositiveInfinity(dof.upperLimit); - } - - public static bool hasLowerLinearLimit(this LinearDOF dof) - { - return !float.IsNegativeInfinity(dof.lowerLimit); - } -} \ No newline at end of file diff --git a/api/Aardvark/Joints/LinearJoint_Base.cs b/api/Aardvark/Joints/LinearJoint_Base.cs deleted file mode 100644 index a82374998e..0000000000 --- a/api/Aardvark/Joints/LinearJoint_Base.cs +++ /dev/null @@ -1,154 +0,0 @@ - -using System.Collections.Generic; -public class LinearJoint_Base : SkeletalJoint_Base -{ - #region LinearDOF_Impl - private class LinearDOF_Impl : LinearDOF - { - private readonly LinearJoint_Base ljb; - public LinearDOF_Impl(LinearJoint_Base ljb) - { - this.ljb = ljb; - } - - public float currentPosition - { - get - { - return ljb.currentLinearPosition; - } - } - - public float upperLimit - { - get - { - ljb.EnforceOrder(); - return ljb.hasUpperLimit ? ljb.linearLimitHigh : float.PositiveInfinity; - } - set - { - ljb.linearLimitHigh = value; - ljb.hasUpperLimit = !float.IsInfinity(ljb.linearLimitHigh); - } - } - - public float lowerLimit - { - get - { - ljb.EnforceOrder(); - return ljb.hasLowerLimit ? ljb.linearLimitLow : float.NegativeInfinity; - } - set - { - ljb.linearLimitLow = value; - ljb.hasLowerLimit = !float.IsInfinity(ljb.linearLimitLow); - } - } - - public BXDVector3 translationalAxis - { - get - { - return ljb.axis; - } - set - { - ljb.axis = value; - } - } - - public BXDVector3 basePoint - { - get - { - return ljb.basePoint; - } - set - { - ljb.basePoint = value; - } - } - } - #endregion - - public BXDVector3 axis; - public BXDVector3 basePoint; - - public float currentLinearPosition; - public bool hasUpperLimit, hasLowerLimit; - public float linearLimitLow, linearLimitHigh; - - private readonly LinearDOF[] linearDOF; - - public LinearJoint_Base() { - linearDOF = new LinearDOF[]{ new LinearDOF_Impl(this) }; - } - - public override SkeletalJointType GetJointType() - { - return SkeletalJointType.LINEAR; - } - - protected override void WriteBinaryJointInternal(System.IO.BinaryWriter writer) - { - EnforceOrder(); - - writer.Write(basePoint); - writer.Write(axis); - - writer.Write((byte) ((hasLowerLimit ? 1 : 0) | (hasUpperLimit ? 2 : 0))); - if (hasLowerLimit) - { - writer.Write(linearLimitLow); - } - if (hasUpperLimit) - { - writer.Write(linearLimitHigh); - } - - writer.Write(currentLinearPosition); - } - - protected override void ReadBinaryJointInternal(System.IO.BinaryReader reader) - { - basePoint = reader.ReadRWObject(); - axis = reader.ReadRWObject(); - - byte limitFlags = reader.ReadByte(); - hasLowerLimit = (limitFlags & 1) == 1; - hasUpperLimit = (limitFlags & 2) == 2; - if (hasLowerLimit) - { - linearLimitLow = reader.ReadSingle(); - } - if (hasUpperLimit) - { - linearLimitHigh = reader.ReadSingle(); - } - currentLinearPosition = reader.ReadSingle(); - - EnforceOrder(); - } - - public void EnforceOrder() - { - if (hasLowerLimit && hasUpperLimit && linearLimitLow > linearLimitHigh) - { - float temp = linearLimitHigh; - linearLimitHigh = linearLimitLow; - linearLimitLow = temp; - } - } - - public override IEnumerable GetAngularDOF() - { - return new AngularDOF[0]; - } - - public override IEnumerable GetLinearDOF() - { - return linearDOF; - } -} \ No newline at end of file diff --git a/api/Aardvark/Joints/PlanarJoint_Base.cs b/api/Aardvark/Joints/PlanarJoint_Base.cs deleted file mode 100644 index 895c45e75c..0000000000 --- a/api/Aardvark/Joints/PlanarJoint_Base.cs +++ /dev/null @@ -1,189 +0,0 @@ -using System.Collections.Generic; -using System; - -/// -/// Contains a joint with two degrees of linear freedom and one degree of rotational freedom. -/// -public class PlanarJoint_Base : SkeletalJoint_Base -{ - private static readonly BXDVector3 PLANAR_JOINT_BASIS = new BXDVector3(1.12824E-7, 0.418275, 0.90832); - - #region AngularDOF_Impl - private class AngularDOF_Impl : AngularDOF - { - private readonly PlanarJoint_Base pjb; - public AngularDOF_Impl(PlanarJoint_Base pjb) - { - this.pjb = pjb; - } - - public float currentPosition - { - get - { - throw new NotImplementedException(); - } - } - - public float upperLimit - { - get - { - return float.PositiveInfinity; - } - set - { - throw new NotImplementedException(); - } - } - - public float lowerLimit - { - get - { - return float.NegativeInfinity; - } - set - { - throw new NotImplementedException(); - } - } - - public BXDVector3 rotationAxis - { - get - { - return pjb.normal; - } - set - { - pjb.normal = value; - } - } - - public BXDVector3 basePoint - { - get - { - return pjb.basePoint; - } - set - { - pjb.basePoint = value; - } - } - } - #endregion - #region LinearDOF_Impl - private class LinearDOF_Impl : LinearDOF - { - private readonly PlanarJoint_Base pjb; - private readonly int axis; - public LinearDOF_Impl(PlanarJoint_Base pjb, int axis) - { - this.pjb = pjb; - this.axis = axis; - } - - public float currentPosition - { - get - { - throw new NotImplementedException(); - } - } - - public float upperLimit - { - get - { - throw new NotImplementedException(); - } - set - { - throw new NotImplementedException(); - } - } - - public float lowerLimit - { - get - { - throw new NotImplementedException(); - } - set - { - throw new NotImplementedException(); - } - } - - public BXDVector3 translationalAxis - { - get - { - BXDVector3 rot = BXDVector3.CrossProduct(PlanarJoint_Base.PLANAR_JOINT_BASIS, pjb.normal); - if (axis == 1) - { - rot = BXDVector3.CrossProduct(rot, pjb.normal); - } - return rot; - } - set - { - throw new NotImplementedException(); - } - } - - public BXDVector3 basePoint - { - get - { - return pjb.basePoint; - } - set - { - pjb.basePoint = value; - } - } - } - #endregion - - public BXDVector3 normal; - public BXDVector3 basePoint; - - private readonly AngularDOF[] angularDOF; - private readonly LinearDOF[] linearDOF; - - public PlanarJoint_Base() - { - angularDOF = new AngularDOF[] { new AngularDOF_Impl(this) }; - linearDOF = new LinearDOF[] { new LinearDOF_Impl(this, 0), new LinearDOF_Impl(this, 1) }; - } - - public override SkeletalJointType GetJointType() - { - return SkeletalJointType.PLANAR; - } - - protected override void WriteBinaryJointInternal(System.IO.BinaryWriter writer) - { - writer.Write(normal); - writer.Write(basePoint); - } - - protected override void ReadBinaryJointInternal(System.IO.BinaryReader reader) - { - normal = reader.ReadRWObject(); - basePoint = reader.ReadRWObject(); - } - - public override IEnumerable GetAngularDOF() - { - return angularDOF; - } - - public override IEnumerable GetLinearDOF() - { - return linearDOF; - } -} diff --git a/api/Aardvark/Joints/RotationalJoint_Base.cs b/api/Aardvark/Joints/RotationalJoint_Base.cs deleted file mode 100644 index 7750b1f144..0000000000 --- a/api/Aardvark/Joints/RotationalJoint_Base.cs +++ /dev/null @@ -1,149 +0,0 @@ - -using System.Collections.Generic; -using Newtonsoft.Json; - - -public class RotationalJoint_Base : SkeletalJoint_Base -{ - #region AngularDOF_Impl - private class AngularDOF_Impl : AngularDOF - { - private readonly RotationalJoint_Base rjb; - public AngularDOF_Impl(RotationalJoint_Base rjb) - { - this.rjb = rjb; - } - public float currentPosition - { - get - { - return rjb.currentAngularPosition; - } - } - - public float upperLimit - { - get - { - rjb.EnforceOrder(); - return rjb.hasAngularLimit ? rjb.angularLimitHigh : float.PositiveInfinity; - } - set - { - rjb.angularLimitHigh = value; - rjb.hasAngularLimit = !float.IsInfinity(rjb.angularLimitLow) && !float.IsInfinity(rjb.angularLimitHigh); - } - } - - public float lowerLimit - { - get - { - rjb.EnforceOrder(); - return rjb.hasAngularLimit ? rjb.angularLimitLow : float.NegativeInfinity; - } - set - { - rjb.angularLimitLow = value; - rjb.hasAngularLimit = !float.IsInfinity(rjb.angularLimitLow) && !float.IsInfinity(rjb.angularLimitHigh); - } - } - - public BXDVector3 rotationAxis - { - get - { - return rjb.axis; - } - set - { - rjb.axis = value; - } - } - - public BXDVector3 basePoint - { - get - { - return rjb.basePoint; - } - set - { - rjb.basePoint = value; - } - } - } - #endregion - - public BXDVector3 axis; - public BXDVector3 basePoint; - - public float currentAngularPosition; - public bool hasAngularLimit; - public float angularLimitLow; - public float angularLimitHigh; - - private readonly AngularDOF[] angularDOF; - - public RotationalJoint_Base() - { - angularDOF = new AngularDOF[] { new AngularDOF_Impl(this) }; - } - - public override SkeletalJointType GetJointType() - { - return SkeletalJointType.ROTATIONAL; - } - - protected override void WriteBinaryJointInternal(System.IO.BinaryWriter writer) - { - EnforceOrder(); - writer.Write(basePoint); - writer.Write(axis); - - writer.Write((byte)((hasAngularLimit ? 1 : 0))); - if (hasAngularLimit) - { - writer.Write(angularLimitLow); - writer.Write(angularLimitHigh); - } - - writer.Write(currentAngularPosition); - } - - protected override void ReadBinaryJointInternal(System.IO.BinaryReader reader) - { - basePoint = reader.ReadRWObject(); - axis = reader.ReadRWObject(); - - hasAngularLimit = (reader.ReadByte() & 1) == 1; - if (hasAngularLimit) - { - angularLimitLow = reader.ReadSingle(); - angularLimitHigh = reader.ReadSingle(); - } - - currentAngularPosition = reader.ReadSingle(); - EnforceOrder(); - } - - public void EnforceOrder() - { - if (hasAngularLimit && angularLimitLow > angularLimitHigh) - { - float temp = angularLimitHigh; - angularLimitHigh = angularLimitLow; - angularLimitLow = temp; - } - } - - public override IEnumerable GetAngularDOF() - { - return angularDOF; - } - - public override IEnumerable GetLinearDOF() - { - return new LinearDOF[0]; - } -} \ No newline at end of file diff --git a/api/Aardvark/Joints/Sensors/RobotSensor.cs b/api/Aardvark/Joints/Sensors/RobotSensor.cs deleted file mode 100644 index 54b8e8ada1..0000000000 --- a/api/Aardvark/Joints/Sensors/RobotSensor.cs +++ /dev/null @@ -1,106 +0,0 @@ -using System.IO; - -public enum RobotSensorType : byte -{ - ENCODER = 0, - LIMIT = 1, - POTENTIOMETER = 2, - LIMIT_HALL = 3, - ACCELEROMETER = 4, - MAGNETOMETER = 5, - GYRO = 6 -} -public enum SensorConnectionType : byte -{ - DIO = 0, - ANALOG = 1, - SPI = 2, - I2C = 3, -} - -public class RobotSensor : BinaryRWObject -{ - public float portA; - public float portB; - public RobotSensorType type; - public SensorConnectionType conTypePortA; - public SensorConnectionType conTypePortB; - public double conversionFactor; - public RobotSensor() - { - } - - public RobotSensor(RobotSensorType type) - { - this.type = type; - - switch (type) - { - case RobotSensorType.ENCODER: - conTypePortA = SensorConnectionType.DIO; - conTypePortB = SensorConnectionType.DIO; - break; - case RobotSensorType.LIMIT: - conTypePortA = SensorConnectionType.DIO; - conTypePortB = SensorConnectionType.DIO; - break; - case RobotSensorType.POTENTIOMETER: - conTypePortA = SensorConnectionType.ANALOG; - conTypePortB = SensorConnectionType.ANALOG; - break; - } - } - - public static RobotSensorType[] GetAllowedSensors(SkeletalJoint_Base joint) - { - switch (joint.GetJointType()) - { - case SkeletalJointType.ROTATIONAL: - return new RobotSensorType[] {RobotSensorType.ENCODER/*, RobotSensorType.POTENTIOMETER, RobotSensorType.LIMIT*/}; - case SkeletalJointType.LINEAR: - return new RobotSensorType[] {RobotSensorType.ENCODER }; - case SkeletalJointType.CYLINDRICAL: - return new RobotSensorType[] {RobotSensorType.ENCODER/*, RobotSensorType.POTENTIOMETER, RobotSensorType.LIMIT*/}; - case SkeletalJointType.PLANAR: - return new RobotSensorType[] { }; - case SkeletalJointType.BALL: - return new RobotSensorType[] { }; - default: - return new RobotSensorType[0];// Not implemented - } - } - - public void WriteBinaryData(BinaryWriter writer) - { - writer.Write((byte) type); - writer.Write(portA); - writer.Write((byte)conTypePortA); - writer.Write(portB); - writer.Write((byte)conTypePortB); - writer.Write(conversionFactor); - } - - public void ReadBinaryData(BinaryReader reader) - { - type = (RobotSensorType) reader.ReadByte(); - portA = reader.ReadInt16(); - portB = reader.ReadInt16(); - conversionFactor = reader.ReadDouble(); - } - - public static RobotSensor ReadSensorFully(BinaryReader reader) - { - RobotSensor sensor = new RobotSensor(RobotSensorType.LIMIT); - sensor.ReadBinaryData(reader); - return sensor; - } - - /// - /// Compares two sensors, returns true if all fields are identical. - /// - /// - public bool Equals(RobotSensor otherSensor) - { - return portA == otherSensor.portA && portB == otherSensor.portB && conversionFactor == otherSensor.conversionFactor; // Other fields are not important for equivalancy - } -} diff --git a/api/Aardvark/Joints/SkeletalJoint_Base.cs b/api/Aardvark/Joints/SkeletalJoint_Base.cs deleted file mode 100644 index 00c146d791..0000000000 --- a/api/Aardvark/Joints/SkeletalJoint_Base.cs +++ /dev/null @@ -1,177 +0,0 @@ -using System; -using System.Collections.Generic; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -/// -/// Possible types of skeletal joints. -/// -/// -[JsonConverter(typeof(StringEnumConverter))] -public enum SkeletalJointType : byte -{ - DEFAULT = 0, - ROTATIONAL = 1, - LINEAR = 2, - PLANAR = 3, - CYLINDRICAL = 4, - BALL = 5 -} - -/// -/// Represents a moving joint between two nodes. -/// -/// - -public abstract class SkeletalJoint_Base -{ - public SkeletalJointType typeSave; - /// - /// Generic delegate for creating skeletal joints from a joint type. - /// - public delegate SkeletalJoint_Base SkeletalJointFactory(SkeletalJointType type); - - /// - /// Factory object used to create skeletal joint objects when reading skeletons from a file. - /// - public static SkeletalJointFactory JOINT_FACTORY = delegate(SkeletalJointType type) - { - switch (type) - { - case SkeletalJointType.ROTATIONAL: - return new RotationalJoint_Base(); - case SkeletalJointType.LINEAR: - return new LinearJoint_Base(); - case SkeletalJointType.CYLINDRICAL: - return new CylindricalJoint_Base(); - case SkeletalJointType.PLANAR: - return new PlanarJoint_Base(); - case SkeletalJointType.BALL: - return new BallJoint_Base(); - default: - return null; - } - }; - - /// - /// The joint driver for this joint. This can be null. - /// - public JointDriver cDriver; - - public double weight = 10; - - /// - /// The sensors that read information from this joint. - /// - public List attachedSensors = new List(); - - /// - /// The type of this joint. - /// - /// The joint type - public abstract SkeletalJointType GetJointType(); - - /// - /// Gets all the angular degrees of freedom for this joint. - /// - /// The angular degrees of freedom - public abstract IEnumerable GetAngularDOF(); - /// - /// Gets all the linear degrees of freedom for this joint. - /// - /// The linear degrees of freedom - public abstract IEnumerable GetLinearDOF(); - - /// - /// Writes the backing information and ID for this joint to the output stream. - /// - /// Output stream - public void WriteBinaryJoint(System.IO.BinaryWriter writer) - { - writer.Write((byte) ((int) GetJointType())); - writer.Write((double)((double)weight)); - WriteBinaryJointInternal(writer); - - writer.Write(cDriver != null); - if (cDriver!=null){ - cDriver.WriteBinaryData(writer); - } - writer.Write(attachedSensors.Count); - for (int i = 0; i < attachedSensors.Count; i++) - { - attachedSensors[i].WriteBinaryData(writer); - } - } - protected abstract void WriteBinaryJointInternal(System.IO.BinaryWriter writer); - - /// - /// Reads the backing information for this joint from the input stream. - /// - /// Input stream - public void ReadBinaryJoint(System.IO.BinaryReader reader) - { - weight = reader.ReadDouble(); - // ID is already read - ReadBinaryJointInternal(reader); - - if (reader.ReadBoolean()) - { - cDriver = new JointDriver(JointDriverType.MOTOR); - cDriver.ReadBinaryData(reader); - } - else - { - cDriver = null; - } - int sensorCount = reader.ReadInt32(); - attachedSensors = new List(sensorCount); - for (int i = 0; i < sensorCount; i++) - { - attachedSensors.Add(RobotSensor.ReadSensorFully(reader)); - } - } - protected abstract void ReadBinaryJointInternal(System.IO.BinaryReader reader); - - /// - /// Identifies the type of a joint, creates an instance, and reads that joint from the given input stream. - /// - /// Input stream - /// The created joint - public static SkeletalJoint_Base ReadJointFully(System.IO.BinaryReader reader) - { - SkeletalJointType type = (SkeletalJointType)((int)reader.ReadByte()); - SkeletalJoint_Base joint = JOINT_FACTORY(type); - joint.ReadBinaryJoint(reader); - return joint; - } - - protected virtual string ToString_Internal() - { - return Enum.GetName(typeof(SkeletalJointType), GetJointType()); - } - - public override string ToString() - { - string info = ToString_Internal(); - if (cDriver != null) - { - info += "\n Driver: " + cDriver.ToString().Replace("\n", "\n "); - } - return info; - } - - public void WriteBinaryData(System.IO.BinaryWriter writer) - { - WriteBinaryJoint(writer); - } - - public void ReadBinaryData(System.IO.BinaryReader reader) - { - throw new NotImplementedException("Don't read a joint directly!"); - } - - public void ClearConfiguration() - { - cDriver = null; - attachedSensors = new List(); - } -} diff --git a/api/Aardvark/Math/BXDBox.cs b/api/Aardvark/Math/BXDBox.cs deleted file mode 100644 index edd99ab6db..0000000000 --- a/api/Aardvark/Math/BXDBox.cs +++ /dev/null @@ -1,43 +0,0 @@ -public class BXDBox : System.IComparable -{ - BXDVector3 minPoint; - BXDVector3 maxPoint; - - public BXDBox(double passMinX, double passMinY, double passMinZ, - double passMaxX, double passMaxY, double passMaxZ) - { - minPoint = new BXDVector3(passMinX, passMinY, passMinZ); - maxPoint = new BXDVector3(passMaxX, passMaxY, passMaxZ); - } - - public BXDBox(BXDVector3 passMinPoint, BXDVector3 passMaxPoint) - { - minPoint = passMinPoint; - maxPoint = passMaxPoint; - } - - public float GetPossibleRadius() - { - return minPoint.Copy().Subtract(maxPoint).Magnitude(); - } - - public int CompareTo(BXDBox other) - { - float thisRadius = GetPossibleRadius(); - float otherRadius = other.GetPossibleRadius(); - - if (thisRadius > otherRadius) - { - return 1; - } - else if (thisRadius < otherRadius) - { - return -1; - } - else - { - return 0; - } - } -} - diff --git a/api/Aardvark/Math/BXDQuaternion.cs b/api/Aardvark/Math/BXDQuaternion.cs deleted file mode 100644 index 500659a0ec..0000000000 --- a/api/Aardvark/Math/BXDQuaternion.cs +++ /dev/null @@ -1,54 +0,0 @@ -public class BXDQuaternion -{ - /// - /// The X value of the BXDQuaternion. - /// - public float X; - - /// - /// The Y value of the BXDQuaternion. - /// - public float Y; - - /// - /// The Z value of the BXDQuaternion. - /// - public float Z; - - /// - /// The W value of the BXDQuaternion. - /// - public float W; - - /// - /// Initializes a new instance of the BXDQuaternion class with an identity value. - /// - public BXDQuaternion() - : this(0f, 0f, 0f, 0f) - { - } - - /// - /// Initializes a new instance of the BXDQuaternion class with the values given. - /// - /// - /// - /// - /// - public BXDQuaternion(float x, float y, float z, float w) - { - X = x; - Y = y; - Z = z; - W = w; - } - - /// - /// Returns a string containing labeled x, y, z, and w values. - /// - /// - public override string ToString() - { - return "(X: " + X + ", Y: " + Y + ", Z: " + Z + ", W: " + W + ")"; - } -} \ No newline at end of file diff --git a/api/Aardvark/Math/BXDVector3.cs b/api/Aardvark/Math/BXDVector3.cs deleted file mode 100644 index 95ca7b68c4..0000000000 --- a/api/Aardvark/Math/BXDVector3.cs +++ /dev/null @@ -1,170 +0,0 @@ -using System; - -public class BXDVector3 : BinaryRWObject -{ - /// - /// If two floating point values have an absolute difference less than this they are considered the same. - /// - private const float EPSILON = 1.0E-6F; - - /// - /// The x, y, and z values for the BXDVector3. - /// - public float x, y, z; - - /// - /// Initializes a new instance of the BXDVector3 class. - /// - public BXDVector3() - { - } - - /// - /// Initializes a new instance of the BXDVector3 class from the given x, y, and z values. - /// - /// - /// - /// - public BXDVector3(double x, double y, double z) - { - this.x = (float) x; - this.y = (float) y; - this.z = (float) z; - } - - /// - /// Initializes a new instance of the BXDVector3 class from the given x, y, and z values. - /// - /// - /// - /// - public BXDVector3(float x, float y, float z) - { - this.x = x; - this.y = y; - this.z = z; - } - - /// - /// Converts the x, y, and z values to a string. - /// - /// - public override String ToString() - { - return "[" + x + "," + y + "," + z + "]"; - } - - /// - /// Multiplies this vector by the given scalar and returns this object (for method chaining) - /// - /// The scalar to multiply by - /// This vector. - public BXDVector3 Multiply(float f) - { - x *= f; - y *= f; - z *= f; - return this; - } - - /// - /// Adds the given vector to this vector and returns this object. (For method chaining) - /// - /// The vector to add - /// This vector. - public BXDVector3 Add(BXDVector3 f) - { - x += f.x; - y += f.y; - z += f.z; - return this; - } - - /// - /// Subtracts the given vector from this vector and returns this object. (For method chaining) - /// - /// The vector to subtract - /// This vector. - public BXDVector3 Subtract(BXDVector3 f) - { - x -= f.x; - y -= f.y; - z -= f.z; - return this; - } - - /// - /// Gets the magnitude of this vector. - /// - /// The magnitude of this vector - public float Magnitude() - { - return (float) Math.Sqrt(x * x + y * y + z * z); - } - - /// - /// Computes the cross product of two vectors. (lhs x rhs) - /// - /// The left hand element - /// The right hand element - /// (lhs x rhs) - public static BXDVector3 CrossProduct(BXDVector3 lhs, BXDVector3 rhs) - { - return new BXDVector3(lhs.y * rhs.z - lhs.z * rhs.y, lhs.z * rhs.x - lhs.x * rhs.z, lhs.x * rhs.y - lhs.y * rhs.x); - } - - /// - /// Computes the dot product of two vectors. - /// - /// One vector - /// Another vector - /// (a · b) - public static float DotProduct(BXDVector3 a, BXDVector3 b) - { - return a.x * b.x + a.y * b.y + a.z * b.z; - } - - public void WriteBinaryData(System.IO.BinaryWriter w) - { - w.Write(x); - w.Write(y); - w.Write(z); - } - - public void ReadBinaryData(System.IO.BinaryReader r) - { - x = r.ReadSingle(); - y = r.ReadSingle(); - z = r.ReadSingle(); - } - - /// - /// Creates an identical copy of this vector. - /// - /// The copy - public BXDVector3 Copy() - { - return new BXDVector3(x, y, z); - } - - public override bool Equals(object obj) - { - if (obj is BXDVector3) - { - BXDVector3 v = (BXDVector3) obj; - return Math.Abs(v.x - x) < EPSILON && Math.Abs(v.y - y) < EPSILON && Math.Abs(v.z - z) < EPSILON; - } - return false; - } - - public override int GetHashCode() - { - int x = (int) (100 * this.x); - int y = (int) (100 * this.y); - int z = (int) (100 * this.z); - const int p1 = 73856093; - const int p2 = 19349663; - const int p3 = 83492791; - return (x * p1) ^ (y * p2) ^ (z * p3); - } -} diff --git a/api/Aardvark/Math/PhysicalProperties.cs b/api/Aardvark/Math/PhysicalProperties.cs deleted file mode 100644 index b88851344b..0000000000 --- a/api/Aardvark/Math/PhysicalProperties.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.IO; - -public class PhysicalProperties : BinaryRWObject -{ - public BXDVector3 centerOfMass = new BXDVector3(); - public float mass; - - public void Add(float addMass, BXDVector3 addCOM) - { - centerOfMass.Multiply(mass); - centerOfMass.Add(addCOM.Copy().Multiply(addMass)); - mass += addMass; - centerOfMass.Multiply(1.0f / mass); - } - - public void WriteBinaryData(BinaryWriter writer) - { - writer.Write(centerOfMass); - writer.Write(mass); - } - - public void ReadBinaryData(BinaryReader reader) - { - centerOfMass = reader.ReadRWObject(); - mass = reader.ReadSingle(); - } -} diff --git a/api/Aardvark/Math/Polynomial.cs b/api/Aardvark/Math/Polynomial.cs deleted file mode 100644 index 3d56290e35..0000000000 --- a/api/Aardvark/Math/Polynomial.cs +++ /dev/null @@ -1,67 +0,0 @@ -using System.Text; - -public class Polynomial : BinaryRWObject -{ - public float[] coeff; - - public Polynomial() - { - coeff = new float[0]; - } - - /// - /// Coefficients are based on array indicies, so the first one is multiplied by 1, the second by x, the third by x^2... - /// - /// Coeffecients for the polynomial - public Polynomial(params float[] coeff) - { - this.coeff = coeff; - } - - public float Evaluate(float x) - { - float result = 0; - float pow = 1; - for (int i = 0; i < coeff.Length; i++) - { - result += coeff[i] * pow; - pow *= x; - } - return result; - } - - public void WriteBinaryData(System.IO.BinaryWriter writer) - { - writer.WriteArray(coeff); - } - - public void ReadBinaryData(System.IO.BinaryReader reader) - { - coeff = reader.ReadArray(); - } - - public override string ToString() - { - StringBuilder result = new StringBuilder(); - for (int i = coeff.Length - 1; i >= 0; i--) - { - if (coeff[i] != 0) - { - if (result.Length > 0) - { - result.Append(" + "); - } - result.Append(coeff[i]); - if (i > 0) - { - result.Append('x'); - if (i > 1) - { - result.Append('^').Append(i); - } - } - } - } - return result.ToString(); - } -} diff --git a/api/Aardvark/ModelTree/FieldDefinition.cs b/api/Aardvark/ModelTree/FieldDefinition.cs deleted file mode 100644 index 1e78bd7faf..0000000000 --- a/api/Aardvark/ModelTree/FieldDefinition.cs +++ /dev/null @@ -1,129 +0,0 @@ -using System; -using System.Collections.Generic; - -public class FieldDefinition -{ - /// - /// Used for creating new instances of a FieldDefinition. - /// - /// - /// - /// - public delegate FieldDefinition FieldDefinitionFactory(Guid guid, string name = BXDFProperties.BXDF_DEFAULT_NAME); - - /// - /// The default delegate for creating new FieldDefinition instances. - /// - public static FieldDefinitionFactory Factory = delegate(Guid guid, string name) - { - return new FieldDefinition(guid, name); - }; - - /// - /// The globally unique identifier. - /// - public Guid GUID - { - get; - private set; - } - - /// - /// The group containing each child node. - /// - public FieldNodeGroup NodeGroup - { - get; - private set; - } - - /// - /// A dictionary containing each PropertySet and a string identifier. - /// - private Dictionary propertySets; - - /// - /// The mesh to be exported. - /// - private BXDAMesh mesh; - - /// - /// Initailizes a new instance of the FieldDefinition class. - /// - /// - protected FieldDefinition(Guid guid, string name) - { - GUID = guid; - NodeGroup = new FieldNodeGroup(name); - propertySets = new Dictionary(); - mesh = new BXDAMesh(GUID); - } - - /// - /// Adds a child PhysicsGroup to physicsGroups. - /// - /// - /// - public void AddPropertySet(PropertySet group) - { - propertySets.Add(group.PropertySetID, group); - } - - /// - /// Returns a Dictionary containing each PhysicsGroup. - /// - /// - public Dictionary GetPropertySets() - { - return propertySets; - } - - /// - /// Used for adding a submesh and creating a sub mesh ID for the given node. - /// - /// - /// - public void AddSubMesh(BXDAMesh.BXDASubMesh subMesh) - { - mesh.meshes.Add(subMesh); - } - - /// - /// Used for adding a collision mesh and creating a collision mesh ID for the given node. - /// - /// - /// - public void AddCollisionMesh(BXDAMesh.BXDASubMesh collisionMesh) - { - mesh.colliders.Add(collisionMesh); - } - - /// - /// Used for getting a submesh from the given ID. - /// - /// - /// - public BXDAMesh.BXDASubMesh GetSubMesh(int id) - { - return mesh.meshes[id]; - } - - /// - /// Used for getting a collision mesh from the given ID. - /// - /// - /// - public BXDAMesh.BXDASubMesh GetCollisionMesh(int id) - { - return mesh.colliders[id]; - } - - /// - /// Returns the mesh to be exported. - /// - /// - public BXDAMesh GetMeshOutput() - { - return mesh; - } -} \ No newline at end of file diff --git a/api/Aardvark/ModelTree/FieldNode.cs b/api/Aardvark/ModelTree/FieldNode.cs deleted file mode 100644 index 360e599147..0000000000 --- a/api/Aardvark/ModelTree/FieldNode.cs +++ /dev/null @@ -1,47 +0,0 @@ -public class FieldNode -{ - /// - /// The string ID for the node. - /// - public string NodeID; - - /// - /// The initial position for the FieldNode. - /// - public BXDVector3 Position; - - /// - /// The initial rotation for the FieldNode. - /// - public BXDQuaternion Rotation; - - /// - /// The sub mesh ID for the FieldNode. - /// - public int SubMeshID; - - /// - /// The collision mesh ID for the FieldNode. - /// - public int CollisionMeshID; - - /// - /// The string ID for the parent PropertySet. - /// - public string PropertySetID; - - /// - /// Constructs a new instance of the FieldNode class. - /// - /// - /// - public FieldNode(string nodeID, string physicsGroupID = BXDFProperties.BXDF_DEFAULT_NAME) - { - NodeID = nodeID; - Position = new BXDVector3(); - Rotation = new BXDQuaternion(); - SubMeshID = -1; - CollisionMeshID = -1; - PropertySetID = physicsGroupID; - } -} diff --git a/api/Aardvark/ModelTree/FieldNodeGroup.cs b/api/Aardvark/ModelTree/FieldNodeGroup.cs deleted file mode 100644 index aa60cbea70..0000000000 --- a/api/Aardvark/ModelTree/FieldNodeGroup.cs +++ /dev/null @@ -1,235 +0,0 @@ -using System.Collections.Generic; -using System.Linq; - -public class FieldNodeGroup -{ - /// - /// The string ID for the FieldNodeGroup. - /// - public string NodeGroupID; - - /// - /// A list containing each child FieldNode. - /// - private Dictionary childNodes; - - /// - /// A list containing each child FieldNodeGroup. - /// - private Dictionary childNodeGroups; - - /// - /// Used for defining how a child will be processed while iterating through a node path. - /// - /// - /// - /// - /// - private delegate FieldNode HandleChildInfo(string childName, string childPath, bool lastChild); - - /// - /// Used for setting or getting a FieldNode from the path supplied. - /// - /// - /// - public FieldNode this[string path] - { - set - { - ProcessNextChild(path, - new HandleChildInfo((string childName, string childPath, bool lastChild) => - { - if (lastChild) - { - FieldNode node = GetNode(childName); - - if (node == null) - AddNode(value); - else - node = value; - } - else - { - FieldNodeGroup nodeGroup = GetNodeGroup(childName); - - if (nodeGroup == null) - nodeGroup = AddNodeGroup(childName); - - nodeGroup[childPath] = value; - } - - return null; - })); - } - - get - { - return ProcessNextChild(path, - new HandleChildInfo((string childName, string childPath, bool lastChild) => - { - if (lastChild) - { - return GetNode(childName); - } - else - { - FieldNodeGroup nodeGroup = GetNodeGroup(childName); - - if (nodeGroup == null) - return null; - - return nodeGroup[childPath]; - } - })); - } - } - - /// - /// Constructs a new instance of the FieldNodeGroup class. - /// - /// - public FieldNodeGroup(string nodeGroupID) - { - NodeGroupID = nodeGroupID; - childNodes = new Dictionary(); - childNodeGroups = new Dictionary(); - } - - /// - /// Adds a new node with the given ID and physicsGroupID to the childNodes Dictionary. - /// - /// - public FieldNode AddNode(string nodeID, string physicsGroupID = BXDFProperties.BXDF_DEFAULT_NAME) - { - if (!childNodes.ContainsKey(nodeID)) - { - FieldNode node = new FieldNode(nodeID, physicsGroupID); - childNodes.Add(nodeID, node); - - return node; - } - - return null; - } - - /// - /// Adds the given FieldNode to the ChildNodes Dictionary. - /// - /// - public void AddNode(FieldNode node) - { - if (!childNodes.ContainsKey(node.NodeID)) - childNodes.Add(node.NodeID, node); - } - - /// - /// Returns the child FieldNode with the given nodeID. - /// - /// - /// The FieldNode. - public FieldNode GetNode(string nodeID) - { - if (childNodes.ContainsKey(nodeID)) - return childNodes[nodeID]; - - return null; - } - - /// - /// Adds a new FieldNodeGroup with the given ID. - /// - /// - public FieldNodeGroup AddNodeGroup(string nodeGroupID) - { - if (!childNodeGroups.ContainsKey(nodeGroupID)) - { - FieldNodeGroup nodeGroup = new FieldNodeGroup(nodeGroupID); - childNodeGroups.Add(nodeGroupID, nodeGroup); - - return nodeGroup; - } - - return null; - } - - /// - /// Adds the given FieldNodeGroup to the childNodeGroups Dictionary. - /// - /// - public void AddNodeGroup(FieldNodeGroup nodeGroup) - { - if (!childNodeGroups.ContainsKey(nodeGroup.NodeGroupID)) - childNodeGroups.Add(nodeGroup.NodeGroupID, nodeGroup); - } - - /// - /// Returns the FieldNodeGroup with the given nodeGroupID. - /// - /// - /// The FieldNodeGroup. - public FieldNodeGroup GetNodeGroup(string nodeGroupID) - { - if (childNodeGroups.ContainsKey(nodeGroupID)) - return childNodeGroups[nodeGroupID]; - - return null; - } - - /// - /// Enumerates through all direct child FieldNodes. - /// - /// - public IEnumerable EnumerateFieldNodes() - { - foreach (KeyValuePair node in childNodes) - { - yield return node.Value; - } - } - - /// - /// Enumerates through all direct child FieldNodeGroups. - /// - /// - public IEnumerable EnumerateFieldNodeGroups() - { - foreach (KeyValuePair nodeGroup in childNodeGroups) - { - yield return nodeGroup.Value; - } - } - - /// - /// Enumerates through each child FieldNode in all child FieldNodeGroups. - /// - /// - public IEnumerable EnumerateAllLeafFieldNodes() - { - foreach (FieldNode node in EnumerateFieldNodes()) - { - yield return node; - } - - foreach (FieldNodeGroup nodeGroup in EnumerateFieldNodeGroups()) - { - foreach (FieldNode node in nodeGroup.EnumerateAllLeafFieldNodes()) - { - yield return node; - } - } - } - - /// - /// Used for processing the next child in a path string. - /// - /// - /// - /// - private FieldNode ProcessNextChild(string path, HandleChildInfo Handle) - { - if (path.Contains('/')) - return Handle(path.Substring(0, path.IndexOf('/')), path.Substring(path.IndexOf('/') + 1), false); - else - return Handle(path, path, true); - } -} \ No newline at end of file diff --git a/api/Aardvark/ModelTree/PropertySet.cs b/api/Aardvark/ModelTree/PropertySet.cs deleted file mode 100644 index 64dfb40593..0000000000 --- a/api/Aardvark/ModelTree/PropertySet.cs +++ /dev/null @@ -1,147 +0,0 @@ -/// -/// Stores physical properties for a node or group of nodes. -/// -public struct PropertySet -{ - /// - /// Stores collider information for a PropertySet. - /// - public abstract class PropertySetCollider - { - /// - /// Used for defining the type of collision for the PropertySetCollider. - /// - public enum PropertySetCollisionType : int - { - /// - /// Used for approximating collision boundaries with a box. - /// - BOX = 0, - - /// - /// Used for approximating collision boundaries with a sphere. - /// - SPHERE = 1, - - /// - /// Used for taking the object's visible mesh and simplifying it for collision. - /// - MESH = 2 - } - - /// - /// Stores the type of collision for the PropertySetCollider - /// - public PropertySetCollisionType CollisionType - { - get; - private set; - } - - /// - /// Initializes a new instance of the PropertySetCollider class. - /// - /// - public PropertySetCollider(PropertySetCollisionType collisionType) - { - CollisionType = collisionType; - } - } - - public class BoxCollider : PropertySetCollider - { - /// - /// The scale of the BoxCollider. - /// - public BXDVector3 Scale - { - get; - private set; - } - - /// - /// Initializes a new instance of the BoxCollider class. - /// - public BoxCollider(BXDVector3 scale) - : base(PropertySetCollider.PropertySetCollisionType.BOX) - { - Scale = scale; - } - } - - public class SphereCollider : PropertySetCollider - { - /// - /// The scale of the SphereCollider. - /// - public float Scale - { - get; - private set; - } - - /// - /// Initializes a new instance of the SphereCollider class. - /// - public SphereCollider(float scale) - : base(PropertySetCollisionType.SPHERE) - { - Scale = scale; - } - } - - public class MeshCollider : PropertySetCollider - { - /// - /// Determines whether or not the MeshCollider is convex. - /// - public bool Convex - { - get; - private set; - } - - /// - /// Initializes a new instance of the MeshCollider class. - /// - public MeshCollider(bool convex) - : base(PropertySetCollisionType.MESH) - { - Convex = convex; - } - } - - /// - /// ID of the PropertySet. - /// - public string PropertySetID; - - /// - /// Collider of the PhysicsGroup. - /// - public PropertySetCollider Collider; - - /// - /// Friction value of the PhysicsGroup. - /// - public int Friction; - - /// - /// Stores the mass of the object. - /// - public float Mass; - - /// - /// Constructs a new PhysicsGroup with the specified values. - /// - /// - /// - /// - public PropertySet(string physicsGroupID, PropertySetCollider collider, int friction, float mass = 0.0f) - { - PropertySetID = physicsGroupID; - Collider = collider; - Friction = friction; - Mass = mass; - } -} \ No newline at end of file diff --git a/api/Aardvark/ModelTree/RigidNode_Base.cs b/api/Aardvark/ModelTree/RigidNode_Base.cs deleted file mode 100644 index 0058f89cfb..0000000000 --- a/api/Aardvark/ModelTree/RigidNode_Base.cs +++ /dev/null @@ -1,194 +0,0 @@ -using System; -using System.Collections.Generic; - - -/// -/// Represents a node inside the hierarchy representing how a robot moves. -/// -public class RigidNode_Base -{ - /// - /// Types of joint drivers. - /// - public enum SoftwareExportedWith : byte - { - INVENTOR = 0, - FUSION_360 = 1 - } - /// - /// The software this model was orginally exported with - /// - public SoftwareExportedWith exportedWith; - /// - /// Generic delegate for creating rigid node instances - /// - public delegate RigidNode_Base RigidNodeFactory(Guid guid); - - /// - /// By setting this to a custom value skeletons that are read using can - /// be composed of a custom rigid node type. - /// - public static RigidNodeFactory NODE_FACTORY = delegate(Guid guid) - { - return new RigidNode_Base(guid); - }; - - /// - /// How far down in the hierarchy this element is. The higher it is the farther from the root node. - /// - protected int level; - - /// - /// The node that represents the parent of this node. If this is null then this is a root node. - /// - private RigidNode_Base parent; - - /// - /// The joint that connects this node to its parent. - /// - private SkeletalJoint_Base parentConnection; - - /// - /// The name of the file holding this node's model. - /// - public string ModelFileName; - - - /// - /// The globally unique identifier. - /// - public Guid GUID - { - get; - private set; - } - - /// - /// Contains the drivetrain type for the model, only implemented at the top node - /// - public enum DriveTrainType - { - NONE = 0, - TANK = 1, - H_DRIVE = 2, - CUSTOM = 3 - } - - public DriveTrainType driveTrainType; - - /// - /// A very verbose identifier that represents the element this node is in the overall structure. - /// - public string ModelFullID; - - /// - /// A mapping between each child node of this node and the joint connection between the two. - /// - public Dictionary Children = new Dictionary(); - - /// - /// Initializes a new instance of the RigidNode_Base class. - /// - /// - public RigidNode_Base(Guid guid) - { - GUID = guid; - } - - /// - /// Adds the given node as a child of this node. - /// - /// The joint connecting this node to the child - /// The child node - public void AddChild(SkeletalJoint_Base joint, RigidNode_Base child) - { - Children.Add(joint, child); - child.parentConnection = joint; - child.parent = this; - child.level = level + 1; - } - - /// - /// Gets the parent node for this node. - /// - /// The parent node, or null if this node is a root node - public RigidNode_Base GetParent() - { - return parent; - } - - /// - /// Gets the skeletal joint connecting this node to its parent. - /// - /// - /// This should always be non-null when the current node isn't a root node. - /// - /// The joint connection, or null if no connection exists. - public SkeletalJoint_Base GetSkeletalJoint() - { - return parentConnection; - } - - /// - /// Gets the actual object visually representing this rigid node if such an item exists. - /// - /// The representation, or null - public virtual object GetModel() - { - return null; - } - - /// - /// Gets a very verbose identifier that represents the element this node is in the overall structure. - /// - /// The model identifier - public virtual string GetModelID() - { - return ModelFullID; - } - - public override string ToString() - { - string result = new string('\t', level) + "Rigid Node" + System.Environment.NewLine; - result += new string('\t', level) + "ID: " + ModelFullID + System.Environment.NewLine; - if (parentConnection != null && parentConnection.cDriver != null) - { - result += new string('\t', level) + "Driver: " + ("\n" + parentConnection.cDriver.ToString()).Replace("\n", "\n" + new string('\t', level + 1)); - } - if (Children.Count > 0) - { - result += new string('\t', level) + "Children: "; - foreach (KeyValuePair pair in Children) - { - result += System.Environment.NewLine + new string('\t', level) + " - " + pair.Key.ToString(); - result += System.Environment.NewLine + pair.Value.ToString(); - result += "\n"; - } - } - return result; - } - - /// - /// Gets a list of all the rigid nodes at or below this item in the tree. - /// - /// The list of nodes - public List ListAllNodes() - { - List list = new List(); - ListAllNodes(list); - return list; - } - - /// - /// Gets a list of all the rigid nodes at or below this item in the tree. - /// - /// The list to write the nodes to - public void ListAllNodes(List list) - { - list.Add(this); - foreach (KeyValuePair pair in Children) - { - pair.Value.ListAllNodes(list); - } - } -} \ No newline at end of file diff --git a/api/Aardvark/README.md b/api/Aardvark/README.md deleted file mode 100644 index e1329c7a77..0000000000 --- a/api/Aardvark/README.md +++ /dev/null @@ -1 +0,0 @@ -For BXDJ information look here: https://github.com/Autodesk/synthesis/wiki/XML-Based-BXDJ-File-Format diff --git a/api/Aardvark/SimulatorFileIO/obj/SimulatorAPI.csproj.nuget.dgspec.json b/api/Aardvark/SimulatorFileIO/obj/SimulatorAPI.csproj.nuget.dgspec.json deleted file mode 100644 index 38cf22222b..0000000000 --- a/api/Aardvark/SimulatorFileIO/obj/SimulatorAPI.csproj.nuget.dgspec.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "format": 1, - "restore": { - "C:\\Users\\hunte\\git\\synthesis\\api\\aardvark\\SimulatorFileIO\\SimulatorAPI.csproj": {} - }, - "projects": { - "C:\\Users\\hunte\\git\\synthesis\\api\\aardvark\\SimulatorFileIO\\SimulatorAPI.csproj": { - "version": "1.0.0", - "restore": { - "projectUniqueName": "C:\\Users\\hunte\\git\\synthesis\\api\\aardvark\\SimulatorFileIO\\SimulatorAPI.csproj", - "projectName": "SimulatorAPI", - "projectPath": "C:\\Users\\hunte\\git\\synthesis\\api\\aardvark\\SimulatorFileIO\\SimulatorAPI.csproj", - "packagesPath": "C:\\Users\\hunte\\.nuget\\packages\\", - "outputPath": "C:\\Users\\hunte\\git\\synthesis\\api\\aardvark\\SimulatorFileIO\\obj\\", - "projectStyle": "PackageReference", - "skipContentFileWrite": true, - "fallbackFolders": [ - "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" - ], - "configFilePaths": [ - "C:\\Users\\hunte\\AppData\\Roaming\\NuGet\\NuGet.Config", - "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config", - "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" - ], - "originalTargetFrameworks": [ - "net45" - ], - "sources": { - "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, - "https://api.nuget.org/v3/index.json": {} - }, - "frameworks": { - "net45": { - "projectReferences": {} - } - } - }, - "frameworks": { - "net45": { - "dependencies": { - "Newtonsoft.Json": { - "target": "Package", - "version": "[12.0.2, )" - } - } - } - }, - "runtimes": { - "win": { - "#import": [] - }, - "win-x64": { - "#import": [] - }, - "win-x86": { - "#import": [] - } - } - } - } -} \ No newline at end of file diff --git a/api/Aardvark/SimulatorFileIO/obj/SimulatorAPI.csproj.nuget.g.props b/api/Aardvark/SimulatorFileIO/obj/SimulatorAPI.csproj.nuget.g.props deleted file mode 100644 index 17a75d7382..0000000000 --- a/api/Aardvark/SimulatorFileIO/obj/SimulatorAPI.csproj.nuget.g.props +++ /dev/null @@ -1,18 +0,0 @@ - - - - True - NuGet - $(MSBuildThisFileDirectory)project.assets.json - $(UserProfile)\.nuget\packages\ - C:\Users\hunte\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages - PackageReference - 5.8.0 - - - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - \ No newline at end of file diff --git a/api/Aardvark/SimulatorFileIO/obj/SimulatorAPI.csproj.nuget.g.targets b/api/Aardvark/SimulatorFileIO/obj/SimulatorAPI.csproj.nuget.g.targets deleted file mode 100644 index 53cfaa19b1..0000000000 --- a/api/Aardvark/SimulatorFileIO/obj/SimulatorAPI.csproj.nuget.g.targets +++ /dev/null @@ -1,6 +0,0 @@ - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - \ No newline at end of file diff --git a/api/Aardvark/SimulatorFileIO/obj/project.assets.json b/api/Aardvark/SimulatorFileIO/obj/project.assets.json deleted file mode 100644 index c76211b0d5..0000000000 --- a/api/Aardvark/SimulatorFileIO/obj/project.assets.json +++ /dev/null @@ -1,143 +0,0 @@ -{ - "version": 3, - "targets": { - ".NETFramework,Version=v4.5": { - "Newtonsoft.Json/12.0.2": { - "type": "package", - "compile": { - "lib/net45/Newtonsoft.Json.dll": {} - }, - "runtime": { - "lib/net45/Newtonsoft.Json.dll": {} - } - } - }, - ".NETFramework,Version=v4.5/win": { - "Newtonsoft.Json/12.0.2": { - "type": "package", - "compile": { - "lib/net45/Newtonsoft.Json.dll": {} - }, - "runtime": { - "lib/net45/Newtonsoft.Json.dll": {} - } - } - }, - ".NETFramework,Version=v4.5/win-x64": { - "Newtonsoft.Json/12.0.2": { - "type": "package", - "compile": { - "lib/net45/Newtonsoft.Json.dll": {} - }, - "runtime": { - "lib/net45/Newtonsoft.Json.dll": {} - } - } - }, - ".NETFramework,Version=v4.5/win-x86": { - "Newtonsoft.Json/12.0.2": { - "type": "package", - "compile": { - "lib/net45/Newtonsoft.Json.dll": {} - }, - "runtime": { - "lib/net45/Newtonsoft.Json.dll": {} - } - } - } - }, - "libraries": { - "Newtonsoft.Json/12.0.2": { - "sha512": "rTK0s2EKlfHsQsH6Yx2smvcTCeyoDNgCW7FEYyV01drPlh2T243PR2DiDXqtC5N4GDm4Ma/lkxfW5a/4793vbA==", - "type": "package", - "path": "newtonsoft.json/12.0.2", - "files": [ - ".nupkg.metadata", - ".signature.p7s", - "LICENSE.md", - "lib/net20/Newtonsoft.Json.dll", - "lib/net20/Newtonsoft.Json.xml", - "lib/net35/Newtonsoft.Json.dll", - "lib/net35/Newtonsoft.Json.xml", - "lib/net40/Newtonsoft.Json.dll", - "lib/net40/Newtonsoft.Json.xml", - "lib/net45/Newtonsoft.Json.dll", - "lib/net45/Newtonsoft.Json.xml", - "lib/netstandard1.0/Newtonsoft.Json.dll", - "lib/netstandard1.0/Newtonsoft.Json.xml", - "lib/netstandard1.3/Newtonsoft.Json.dll", - "lib/netstandard1.3/Newtonsoft.Json.xml", - "lib/netstandard2.0/Newtonsoft.Json.dll", - "lib/netstandard2.0/Newtonsoft.Json.xml", - "lib/portable-net40+sl5+win8+wp8+wpa81/Newtonsoft.Json.dll", - "lib/portable-net40+sl5+win8+wp8+wpa81/Newtonsoft.Json.xml", - "lib/portable-net45+win8+wp8+wpa81/Newtonsoft.Json.dll", - "lib/portable-net45+win8+wp8+wpa81/Newtonsoft.Json.xml", - "newtonsoft.json.12.0.2.nupkg.sha512", - "newtonsoft.json.nuspec" - ] - } - }, - "projectFileDependencyGroups": { - ".NETFramework,Version=v4.5": [ - "Newtonsoft.Json >= 12.0.2" - ] - }, - "packageFolders": { - "C:\\Users\\hunte\\.nuget\\packages\\": {}, - "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {} - }, - "project": { - "version": "1.0.0", - "restore": { - "projectUniqueName": "C:\\Users\\hunte\\git\\synthesis\\api\\aardvark\\SimulatorFileIO\\SimulatorAPI.csproj", - "projectName": "SimulatorAPI", - "projectPath": "C:\\Users\\hunte\\git\\synthesis\\api\\aardvark\\SimulatorFileIO\\SimulatorAPI.csproj", - "packagesPath": "C:\\Users\\hunte\\.nuget\\packages\\", - "outputPath": "C:\\Users\\hunte\\git\\synthesis\\api\\aardvark\\SimulatorFileIO\\obj\\", - "projectStyle": "PackageReference", - "skipContentFileWrite": true, - "fallbackFolders": [ - "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" - ], - "configFilePaths": [ - "C:\\Users\\hunte\\AppData\\Roaming\\NuGet\\NuGet.Config", - "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config", - "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" - ], - "originalTargetFrameworks": [ - "net45" - ], - "sources": { - "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, - "https://api.nuget.org/v3/index.json": {} - }, - "frameworks": { - "net45": { - "projectReferences": {} - } - } - }, - "frameworks": { - "net45": { - "dependencies": { - "Newtonsoft.Json": { - "target": "Package", - "version": "[12.0.2, )" - } - } - } - }, - "runtimes": { - "win": { - "#import": [] - }, - "win-x64": { - "#import": [] - }, - "win-x86": { - "#import": [] - } - } - } -} \ No newline at end of file diff --git a/api/Aardvark/SimulatorFileIO/obj/project.nuget.cache b/api/Aardvark/SimulatorFileIO/obj/project.nuget.cache deleted file mode 100644 index 1f5613401c..0000000000 --- a/api/Aardvark/SimulatorFileIO/obj/project.nuget.cache +++ /dev/null @@ -1,10 +0,0 @@ -{ - "version": 2, - "dgSpecHash": "8pD7Bb3/xSdFCAlN1y6LICoZcW4bjFP2YEP6kKg+uDWdj5crXFThFeneqk8O5XzxA44chxHJlYlq1KPcTfvYRw==", - "success": true, - "projectFilePath": "C:\\Users\\hunte\\git\\synthesis\\api\\aardvark\\SimulatorFileIO\\SimulatorAPI.csproj", - "expectedPackageFiles": [ - "C:\\Users\\hunte\\.nuget\\packages\\newtonsoft.json\\12.0.2\\newtonsoft.json.12.0.2.nupkg.sha512" - ], - "logs": [] -} \ No newline at end of file diff --git a/api/Aardvark/Utilities/ArrayUtilities.cs b/api/Aardvark/Utilities/ArrayUtilities.cs deleted file mode 100644 index f751ed59b6..0000000000 --- a/api/Aardvark/Utilities/ArrayUtilities.cs +++ /dev/null @@ -1,58 +0,0 @@ -public class ArrayUtilities -{ - public delegate T MakeVector2(double x, double y); - public delegate T MakeVector3(double x, double y, double z); - public delegate T MakeColor(byte r, byte g, byte b, byte a); - - /// - /// Wraps the given array of 2D vector elements into an array of 2D vectors - /// - /// The type to create - /// The delegate to create an instance - /// The vector element array - /// The wrapped array - public static T[] WrapArray(MakeVector2 maker, double[] array) - { - T[] results = new T[array.Length / 2]; - for (int i = 0, j = 0; i < results.Length; i++, j += 2) - { - results[i] = maker(array[j], array[j + 1]); - } - return results; - } - - /// - /// Wraps the given array of 3D vector elements into an array of 3D vectors - /// - /// The type to create - /// The delegate to create an instance - /// The vector element array - /// The wrapped array - public static T[] WrapArray(MakeVector3 maker, double[] array) - { - T[] results = new T[array.Length / 3]; - for (int i = 0, j = 0; i < results.Length; i++, j += 3) - { - results[i] = maker(array[j], array[j + 1], array[j + 2]); - } - return results; - } - - /// - /// Wraps the given array of 4D color elements into an array of colors - /// - /// The type to create - /// The delegate to create an instance - /// The vector element array - /// The wrapped array - public static T[] WrapArray(MakeColor maker, uint[] array) - { - T[] results = new T[array.Length]; - for (int i = 0; i < results.Length; i++) - { - uint val = array[i]; - results[i] = maker((byte) (val & 0xFF), (byte) ((val >> 8) & 0xFF), (byte) ((val >> 16) & 0xFF), (byte) ((val >> 24) & 0xFF)); - } - return results; - } -} \ No newline at end of file diff --git a/api/Aardvark/Utilities/FileUtilities.cs b/api/Aardvark/Utilities/FileUtilities.cs deleted file mode 100644 index 13e1bb1c06..0000000000 --- a/api/Aardvark/Utilities/FileUtilities.cs +++ /dev/null @@ -1,18 +0,0 @@ - -class FileUtilities -{ - /// - /// Removes unsanitary characters from a file name and replaces them with sane ones. - /// - /// The filename - /// The optional character to replace with - /// The sane filename - public static string SanatizeFileName(string fileName, char sanity = '_') - { - foreach (char c in System.IO.Path.GetInvalidFileNameChars()) - { - fileName = fileName.Replace(c, sanity); - } - return fileName; - } -} diff --git a/api/Api/Aether/Lobby/LobbyClient.cs b/api/Api/Aether/Lobby/LobbyClient.cs deleted file mode 100644 index effb1eae1e..0000000000 --- a/api/Api/Aether/Lobby/LobbyClient.cs +++ /dev/null @@ -1,506 +0,0 @@ -using Google.Protobuf; -using SynthesisAPI.Controller; -using SynthesisAPI.Utilities; -using System; -using System.Collections.Concurrent; -using System.IO; -using System.Text; -using System.Collections.Generic; -using System.Net.Sockets; -using System.Threading; -using System.Threading.Tasks; - -#nullable enable - -namespace SynthesisAPI.Aether.Lobby { - public class LobbyClient : IDisposable { - - private const long HEARTBEAT_FREQUENCY = 1000; - - public string IP => _instance == null ? string.Empty : _instance.IP; - private Inner? _instance; - - public ulong? Guid => _instance?.Handler.Guid; - public string Name => _instance?.Handler.Name ?? "--unknown--"; - public bool IsAlive => _instance != null; - - public List RobotsFromServer => _instance?.RobotsFromServer ?? new List(); - - public LobbyClient(string ip, string name) { - _instance = new Inner(ip, name); - } - - public Task? GetLobbyInformation() { - return _instance?.GetLobbyInformation(); - } - - public Task> UploadRobotData(DataRobot robot) - => _instance?.UploadRobotData(robot) ?? Task.FromResult(new Result(new Exception("No instance"))); - - public Task> RequestServerRobotData() - => _instance?.RequestServerRobotData() ?? Task.FromResult(new Result(new Exception("No instance"))); - - public Task> UpdateControllableState(List updates) - => _instance?.UpdateControllableState(updates) ?? Task.FromResult(new Result(new Exception("No instance"))); - - public Task> UpdateTransforms(List transforms) - => _instance?.UpdateTransforms(transforms) ?? Task.FromResult(new Result(new Exception("No instance"))); - - private class Inner : IDisposable { - - private Atomic _isAlive = new Atomic(true); - - public readonly string IP; - private readonly LobbyClientHandler _handler; - public LobbyClientHandler Handler => _handler; - - public ReaderWriterLockSlim TransformDataLock; - public Dictionary TransformData; - - private ConcurrentQueue>> _requestQueue; - - private readonly Thread _heartbeatThread; - private readonly Thread _requestSenderThread; - - public List RobotsFromServer { get; private set; } - - public Inner(string ip, string name) { - IP = ip; - - TransformData = new Dictionary(); - TransformDataLock = new ReaderWriterLockSlim(); - - _requestQueue = new ConcurrentQueue>>(); - - var tcp = new TcpClient(); - tcp.Connect(ip, LobbyServer.TCP_PORT); - - var handlerRes = LobbyClientHandler.InitClientSide(tcp, name); - if (handlerRes.isError) - throw handlerRes.GetError(); - _handler = handlerRes.GetResult(); - - // TODO: Add lifetime stuff - _heartbeatThread = new Thread(ClientHeartbeat); - _heartbeatThread.Start(); - - _requestSenderThread = new Thread(RequestQueueProcessor); - _requestSenderThread.Start(); - - RobotsFromServer = new List(); - } - - ~Inner() { - if (_isAlive) - Dispose(); - } - - public Task? GetLobbyInformation() { - var msg = new LobbyMessage{ - ToGetLobbyInformation = new LobbyMessage.Types.ToGetLobbyInformation{ - SenderGuid = _handler.Guid - } - }; - - if (_handler.WriteMessage(msg).isError) { - return null; - } - - return Task.Factory.StartNew(() => { - var msgTask = _handler.ReadMessage(); - msgTask.Wait(); - var msgRes = msgTask.Result; - - if (msgRes.isError) { - Logger.Log($"Failed to Read: [{msgRes.GetError().GetType().Name}] {msgRes.GetError().Message}\n\n{msgRes.GetError().StackTrace}"); - } - - var msg = msgRes.GetResult(); - - if (msg.MessageTypeCase != LobbyMessage.MessageTypeOneofCase.FromGetLobbyInformation) { - return null; - } - - return msg.FromGetLobbyInformation; - }); - } - - private void RequestQueueProcessor() { - while (_isAlive) { - var success = _requestQueue.TryDequeue(out var task); - if (!success) - continue; - - task.Start(); - task.Wait(); - } - } - - private void ClientHeartbeat() { - long lastUpdate = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(); - while (_isAlive) { - long currentTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(); - if (currentTime - lastUpdate > HEARTBEAT_FREQUENCY) { - var task = new Task>(() => { - var res = _handler.WriteMessage(new LobbyMessage { ToClientHeartbeat = new LobbyMessage.Types.ToClientHeartbeat() }); - if (res.isError) - return new Result(res.GetError()); - return new Result(val: null); - }); - _requestQueue.Enqueue(task); - - lastUpdate = currentTime; - } else { - Thread.Sleep(100); - } - } - } - - public Task> UploadRobotData(DataRobot robot) { - if (!_isAlive.Value) - return Task.FromResult(new Result(new Exception("Client no longer alive"))); - - var request = new LobbyMessage.Types.ToDataRobot { - Guid = _handler.Guid, - DataRobot = robot - }; - - var task = new Task>(() => { - var response = HandleResponseBoilerplate(new LobbyMessage { ToDataRobot = request }); - if (response.isError) { - return response; - } - - var msg = response.GetResult()!; - if (msg.MessageTypeCase != LobbyMessage.MessageTypeOneofCase.FromDataRobot) { - return new Result(new Exception("Invalid message")); - } - - return new Result(msg); - }); - - _requestQueue.Enqueue(task); - return task; - } - - public Task> RequestServerRobotData() { - if (!_isAlive.Value) - return Task.FromResult(new Result(new Exception("Client no longer alive"))); - - var request = new LobbyMessage.Types.ToRequestDataRobots { - Guid = _handler.Guid - }; - - var task = new Task>(() => { - var response = HandleResponseBoilerplate(new LobbyMessage { ToRequestDataRobots = request }); - if (response.isError) { - return response; - } - - var msg = response.GetResult()!; - if (msg.MessageTypeCase != LobbyMessage.MessageTypeOneofCase.FromRequestDataRobots) { - return new Result(new Exception("Invalid message")); - } - - RobotsFromServer = new List(msg.FromRequestDataRobots.AllAvailableRobots); - return new Result(msg); - }); - - _requestQueue.Enqueue(task); - return task; - } - - public Task> UpdateControllableState(List updates) { - if (!_isAlive.Value) - return Task.FromResult(new Result(new Exception("Client no longer alive"))); - - var request = new LobbyMessage.Types.ToUpdateControllableState { - Guid = _handler.Guid - }; - request.Data.Add(updates); - - var task = new Task>(() => { - var response = HandleResponseBoilerplate(new LobbyMessage { ToUpdateControllableState = request }); - if (response.isError) { - return response; - } - - var msg = response.GetResult()!; - switch (msg.MessageTypeCase) { - case LobbyMessage.MessageTypeOneofCase.FromSimulationTransformData: - // Logger.Log("Received transform response"); - break; - default: - return new Result(new Exception("Invalid message")); - } - - return new Result(msg); - - }); - _requestQueue.Enqueue(task); - return task; - } - - public Task> UpdateTransforms(List transforms) { - if (!_isAlive.Value) - return Task.FromResult(new Result(new Exception("Client no longer alive"))); - - var request = new LobbyMessage.Types.ToUpdateTransformData(); - request.TransformData.AddRange(transforms); - - var task = new Task>(() => { - var response = HandleResponseBoilerplate(new LobbyMessage { ToUpdateTransformData = request }); - if (response.isError) { - return response; - } - - var msg = response.GetResult()!; - switch (msg.MessageTypeCase) { - case LobbyMessage.MessageTypeOneofCase.FromControllableStates: - // TODO: Update signal data - // Logger.Log("Received controllable state response"); - break; - default: - return new Result(new Exception("Invalid message")); - } - - return new Result(msg); - - }); - _requestQueue.Enqueue(task); - return task; - } - - /// - /// TODO: Rename - /// - private Result HandleResponseBoilerplate(LobbyMessage request) { - var writeResult = _handler.WriteMessage(request); - if (writeResult.isError) - return new Result(writeResult.GetError()); - - var readResult = _handler.ReadMessage(); - var completedBeforeTimeout = readResult.Wait(1000); - if (!completedBeforeTimeout) - return new Result(new Exception("Task Timeout")); - else if (readResult.Result.isError) - return new Result(readResult.Result.GetError()); - - return new Result(readResult.Result.GetResult()); - } - - public void Dispose() { - _isAlive.Value = false; - _heartbeatThread.Join(); - _requestSenderThread.Join(); - _handler.Dispose(); - } - - } - - public void Dispose() { - _instance?.Dispose(); - _instance = null; - } - - } - - internal class LobbyClientHandler : IDisposable { - - private const int READ_TIMEOUT_MS = 10000; - private const int READ_BUFFER_SIZE = 2048; - - private readonly LobbyClientInformation _clientInformation; - public LobbyClientInformation ClientInformation => _clientInformation.Clone(); - - public DateTime? LastHeartbeat { get; private set; } // Milliseconds - - public ulong Guid => _clientInformation.Guid; - public string Name => _clientInformation.Name; - - private readonly TcpClient _tcp; - private NetworkStream _stream => _tcp.GetStream(); // Concurrency issues? - private readonly Mutex _streamLock; - - private LobbyClientHandler(TcpClient tcp, string name, ulong guid) { - _tcp = tcp; - _clientInformation = new LobbyClientInformation { Name = name, Guid = guid }; - _streamLock = new Mutex(); - } - - public void UpdateHeartbeat() { - LastHeartbeat = DateTime.UtcNow; - } - - public Task> ReadMessage() - => ReadMessage(_stream, _streamLock); - - public Result WriteMessage(LobbyMessage message) - => WriteMessage(message, _stream, _streamLock); - - private static Task> ReadMessage(NetworkStream stream, Mutex? mutex = null) { - return Task>.Factory.StartNew(() => { - Result? result = null; - bool isLocked = false; - try { - - // DateTime startedRead = DateTime.UtcNow; - // while (!stream.DataAvailable && (DateTime.UtcNow - startedRead).TotalMilliseconds < READ_TIMEOUT_MS) { - // Thread.Sleep(50); - // } - - // if (!stream.DataAvailable) { - // result = new Result(new NoDataException()); - // throw result.GetError(); - // } - - mutex?.WaitOne(); - isLocked = true; - - var intBuf = new byte[4]; - stream.Read(intBuf, 0, 4); - int msgSize = BitConverter.ToInt32(intBuf, 0); - - var msgBuf = new byte[msgSize]; - int bytesRead = 0; - while (bytesRead < msgSize) { - bytesRead += stream.Read(msgBuf, bytesRead, msgSize - bytesRead); - } - - if (bytesRead != msgSize) { - Logger.Log($"Mismatch of read bytes. Expected '{msgSize}', read '{bytesRead}'"); - } - LobbyMessage msg = LobbyMessage.Parser.ParseFrom(msgBuf); - - result = new Result(msg); - - } catch (IOException) { - throw new NoDataException(); - } catch (Exception e) { - if (result == null) { - result = new Result( - new ServerReadException($"Read failure:\n{e.Message}\n{e.StackTrace}") - ); - } - } finally { - if (isLocked) { - mutex?.ReleaseMutex(); - } - } - - return result; - }); - } - - private const bool TRUE = true; - - private static Result WriteMessage(LobbyMessage message, NetworkStream stream, Mutex? mutex = null) { - try { - int size = message.CalculateSize(); - mutex?.WaitOne(); - stream.Write(BitConverter.GetBytes(size), 0, 4); - message.WriteTo(stream); - stream.Flush(); - - return new Result(TRUE); - } catch (Exception e) { - return new Result(e); - } finally { - mutex?.ReleaseMutex(); - } - } - - public static Result InitServerSide(TcpClient tcp, ulong guid) { - - tcp.GetStream().ReadTimeout = READ_TIMEOUT_MS; - - var msgTask = ReadMessage(tcp.GetStream()); - msgTask.Wait(); - var msgRes = msgTask.Result; - if (msgRes.isError) { - Logger.Log($"Failed to Read: [{msgRes.GetError().GetType().Name}] {msgRes.GetError().Message}\n\n{msgRes.GetError().StackTrace}"); - return new Result(new Exception("Failed to read request")); - } - - var msg = msgRes.GetResult(); - - LobbyClientHandler? handler = null; - - switch (msg.MessageTypeCase) { - case LobbyMessage.MessageTypeOneofCase.ToRegisterClient: - var info = msg.ToRegisterClient.ClientInfo; - if (info == null) - break; - - info.Guid = guid; - var response = new LobbyMessage.Types.FromRegisterClient { UpdatedClientInfo = info }; - if (WriteMessage(new LobbyMessage { FromRegisterClient = response }, tcp.GetStream()).isError) - break; - - handler = new LobbyClientHandler(tcp, info.Name, info.Guid); - - break; - } - - return handler == null ? - new Result(new Exception("Failed to create ClientHandler")) : - new Result(handler); - } - - public static Result InitClientSide(TcpClient tcp, string name) { - - tcp.GetStream().ReadTimeout = READ_TIMEOUT_MS; - - var request = new LobbyMessage.Types.ToRegisterClient { ClientInfo = new LobbyClientInformation { Name = name } }; - if (WriteMessage(new LobbyMessage { ToRegisterClient = request }, tcp.GetStream()).isError) - return new Result(new Exception("Failed to send Register request")); - - var msgTask = ReadMessage(tcp.GetStream()); - msgTask.Wait(); - var msgRes = msgTask.Result; - if (msgRes.isError) { - Logger.Log($"Failed to Read: [{msgRes.GetError().GetType().Name}] {msgRes.GetError().Message}\n\n{msgRes.GetError().StackTrace}"); - return new Result(new Exception("Failed to read response")); - } - - var msg = msgRes.GetResult(); - - LobbyClientHandler? handler = null; - - switch (msg.MessageTypeCase) { - case LobbyMessage.MessageTypeOneofCase.FromRegisterClient: - var info = msg.FromRegisterClient.UpdatedClientInfo; - if (info == null) - break; - - handler = new LobbyClientHandler(tcp, info.Name, info.Guid); - - break; - } - - return handler == null ? - new Result(new Exception("Failed to create ClientHandler")) : - new Result(handler); - } - - public override string ToString() { - int time = LastHeartbeat.HasValue ? (int)System.Math.Round((DateTime.UtcNow - LastHeartbeat.Value).TotalMilliseconds) : -1; - return $"[{ClientInformation.Guid}] {ClientInformation.Name} <- {time}ms"; - } - - public void Dispose() { - _tcp.Dispose(); - } - - public class ServerReadException : Exception { - public ServerReadException() { } - public ServerReadException(string msg) : base(msg) { } - } - public class ReadTimeoutException : ServerReadException { - public ReadTimeoutException() : base("Timeout") { } - } - public class NoDataException : ServerReadException { - public NoDataException() : base("No Data") { } - } - } -} diff --git a/api/Api/Aether/Lobby/LobbyServer.cs b/api/Api/Aether/Lobby/LobbyServer.cs deleted file mode 100644 index 6d0187a830..0000000000 --- a/api/Api/Aether/Lobby/LobbyServer.cs +++ /dev/null @@ -1,346 +0,0 @@ -using SynthesisAPI.Controller; -using SynthesisAPI.Utilities; -using System; -using System.Collections.Generic; -using System.Net; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Threading; - -#nullable enable - -namespace SynthesisAPI.Aether.Lobby { - public class LobbyServer : IDisposable { - - public const int TCP_PORT = 23456; - public const int CLIENT_LISTEN_TIMEOUT_MS = 3000; - - private Inner? _instance; - - public IReadOnlyCollection Clients => _instance?.Clients ?? new List(1).AsReadOnly(); - public IReadOnlyCollection AvailableRobots => _instance?.AvailableRobots ?? new List(1).AsReadOnly(); - - public LobbyServer() { - _instance = new Inner(); - } - - public ControllableState? GetControllableState(ulong guid) - => _instance?.GetControllableState(guid); - - private class Inner : IDisposable { - - private ulong _nextGuid = 1; - private readonly Atomic _isAlive = new Atomic(true); - - private readonly ReaderWriterLockSlim _clientsLock; - private readonly ReaderWriterLockSlim _remoteDataLock; - - private readonly TcpListener _listener; - private readonly Dictionary _clients; - private readonly LinkedList _clientThreads; - - private readonly Dictionary _remoteData; - - public IReadOnlyCollection Clients { - get { - List clientsInfo; - _clientsLock.EnterReadLock(); - try { - clientsInfo = new List(_clients.Count); - _clients.Values.ForEach(x => clientsInfo.Add(x.ToString())); - } finally { - _clientsLock.ExitReadLock(); - } - - return clientsInfo.AsReadOnly(); - } - } - - private readonly ReaderWriterLockSlim _robotDataLock; - private List _availableRobots; - public IReadOnlyCollection AvailableRobots { - get { - List robots; - _robotDataLock.EnterReadLock(); - try { - robots = new List(_availableRobots); - } finally { - _robotDataLock.ExitReadLock(); - } - - return robots.AsReadOnly(); - } - } - - public Inner() { - _clientsLock = new ReaderWriterLockSlim(); - _remoteDataLock = new ReaderWriterLockSlim(); - _robotDataLock = new ReaderWriterLockSlim(); - - _clients = new Dictionary(); - _clientThreads = new LinkedList(); - _availableRobots = new List(); - - _remoteData = new Dictionary(); - - _listener = new TcpListener(IPAddress.Any, TCP_PORT); - _listener.Start(); - _listener.BeginAcceptTcpClient(AcceptTcpClient, null); - } - - ~Inner() { - if (_isAlive) - Dispose(); - } - - private void AcceptTcpClient(IAsyncResult result) { - try { - var clientTcp = _listener.EndAcceptTcpClient(result); - - if (clientTcp != null) { - var client = LobbyClientHandler.InitServerSide(clientTcp, _nextGuid++); - if (!client.isError) { - _clientsLock.EnterWriteLock(); - var clientResult = client.GetResult(); - _clients.Add(clientResult.Guid, clientResult); - - _remoteDataLock.EnterWriteLock(); - _remoteData.Add(clientResult.Guid, new RemoteData(clientResult.Guid)); - _remoteDataLock.ExitWriteLock(); - - var clientThread = new Thread(() => ClientListener(client)); - clientThread.Start(); - _clientThreads.AddLast(clientThread); - } - - } - } catch (ObjectDisposedException) { - } catch (Exception e) { - Logger.Log($"Failed to accept new client: {e.Message}"); - } finally { - _clientsLock.ExitWriteLock(); - } - - if (_isAlive) - _listener.BeginAcceptTcpClient(AcceptTcpClient, null); - } - - private void ClientListener(LobbyClientHandler handler) { - while (_isAlive) { - var msgTask = handler.ReadMessage(); - var finishedBeforeTimeout = msgTask.Wait(CLIENT_LISTEN_TIMEOUT_MS); - if (!finishedBeforeTimeout || msgTask.Result == null) { - Logger.Log("Read Time Out"); - continue; - } - - var msgRes = msgTask.Result; - if (msgRes.isError) { - if (!(msgRes.GetError() is LobbyClientHandler.ReadTimeoutException) && !(msgRes.GetError() is LobbyClientHandler.NoDataException)) { - Logger.Log($"Failed to Read: [{msgRes.GetError().GetType().Name}] {msgRes.GetError().Message}\n\n{msgRes.GetError().StackTrace}"); - } - continue; - } - - var msg = msgRes.GetResult(); - switch (msg.MessageTypeCase) { - case LobbyMessage.MessageTypeOneofCase.ToGetLobbyInformation: - OnGetLobbyInformation(msg.ToGetLobbyInformation, handler); - break; - case LobbyMessage.MessageTypeOneofCase.ToDataRobot: - AcceptRobotData(msg.ToDataRobot, handler); - break; - case LobbyMessage.MessageTypeOneofCase.ToRequestDataRobots: - OnRequestDataRobots(msg.ToRequestDataRobots, handler); - break; - case LobbyMessage.MessageTypeOneofCase.ToUpdateControllableState: - OnControllableStateUpdate(msg.ToUpdateControllableState, handler); - break; - case LobbyMessage.MessageTypeOneofCase.ToUpdateTransformData: - OnTransformDataUpdate(msg.ToUpdateTransformData, handler); - break; - case LobbyMessage.MessageTypeOneofCase.ToDataDump: - case LobbyMessage.MessageTypeOneofCase.ToClientHeartbeat: - handler.UpdateHeartbeat(); - break; - default: - Logger.Log($"Received unknown message type: {msg.MessageTypeCase}"); - break; - } - } - } - - private void OnGetLobbyInformation(LobbyMessage.Types.ToGetLobbyInformation _, LobbyClientHandler handler) { - LobbyMessage.Types.FromGetLobbyInformation response; - _clientsLock.EnterReadLock(); - - try { - response = new LobbyMessage.Types.FromGetLobbyInformation { - LobbyInformation = new LobbyInformation() - }; - _clients.Values.ForEach(x => response.LobbyInformation.Clients.Add(x.ClientInformation)); - } finally { - _clientsLock.ExitReadLock(); - } - - handler.WriteMessage(new LobbyMessage { FromGetLobbyInformation = response }); - } - - private void AcceptRobotData(LobbyMessage.Types.ToDataRobot robot, LobbyClientHandler handler) { - _robotDataLock.EnterWriteLock(); - try { - SHA256 sha = SHA256.Create(); - var checksum = Convert.ToBase64String(sha.ComputeHash(robot.DataRobot.Data.ToByteArray())); - _availableRobots.Add(new DataRobot(robot.DataRobot)); - } finally { - _robotDataLock.ExitWriteLock(); - } - - var response = new LobbyMessage.Types.FromDataRobot { - Guid = handler.Guid - }; - - handler.WriteMessage(new LobbyMessage { FromDataRobot = response }); - } - - private void OnRequestDataRobots(LobbyMessage.Types.ToRequestDataRobots request, LobbyClientHandler handler) { - var response = new LobbyMessage.Types.FromRequestDataRobots(); - _robotDataLock.EnterReadLock(); - try { - response.AllAvailableRobots.AddRange(_availableRobots); - } finally { - _robotDataLock.ExitReadLock(); - } - - handler.WriteMessage(new LobbyMessage { FromRequestDataRobots = response }); - } - - private void OnControllableStateUpdate(LobbyMessage.Types.ToUpdateControllableState updateRequest, LobbyClientHandler handler) { - RemoteData data; - - _remoteDataLock.EnterReadLock(); - try { - data = _remoteData[updateRequest.Guid]; - } finally { - _remoteDataLock.ExitReadLock(); - } - - data.EnterWriteLock(); - try { - updateRequest.Data.ForEach(x => { - data.State.SetValue(x.SignalGuid, x.Value); - data.State.SignalMap[x.SignalGuid].Name = x.Name; - }); - } finally { - data.ExitWriteLock(); - } - - var response = new LobbyMessage.Types.FromSimulationTransformData(); - - _remoteDataLock.EnterReadLock(); - try { - _remoteData.ForEach(kvp => { - kvp.Value.EnterReadLock(); - response.TransformData.Add(kvp.Value.Transforms); - kvp.Value.ExitReadLock(); - }); - } finally { - _remoteDataLock.ExitReadLock(); - } - - handler.WriteMessage(new LobbyMessage { FromSimulationTransformData = response }); - } - - private void OnTransformDataUpdate(LobbyMessage.Types.ToUpdateTransformData updateRequest, LobbyClientHandler handler) { - var response = new LobbyMessage.Types.FromControllableStates(); - _remoteDataLock.EnterReadLock(); - try { - updateRequest.TransformData.ForEach(x => { - var data = _remoteData[x.Guid]; - data.EnterWriteLock(); - - x.Transforms.ForEach(kvp => { - data.Transforms.Transforms[kvp.Key] = kvp.Value; - }); - - data.ExitWriteLock(); - }); - - - _remoteData.ForEach(kvp => { - kvp.Value.EnterWriteLock(); - if (kvp.Value.State.HasUpdates) { - SignalUpdates updates = new SignalUpdates { - Guid = kvp.Key - }; - updates.UpdatedSignals.AddRange(kvp.Value.State.CompileChanges()); - response.AllUpdates.Add(updates); - } - kvp.Value.ExitWriteLock(); - }); - } finally { - _remoteDataLock.ExitReadLock(); - } - - handler.WriteMessage(new LobbyMessage { FromControllableStates = response }); - } - - public ControllableState? GetControllableState(ulong guid) { - if (!_remoteData.ContainsKey(guid)) - return null; - - var data = _remoteData[guid]; - ControllableState state; - data.EnterReadLock(); - try { - state = new ControllableState(data.State); - } finally { - data.ExitReadLock(); - } - - return state; - } - - public void Dispose() { - - Logger.Log("Disposing Server"); - - _isAlive.Value = false; - _listener.Stop(); - _clientThreads.ForEach(x => x.Join()); - _clients.ForEach(x => x.Value.Dispose()); - - Logger.Log("Server Disposed"); - } - } - - public void Dispose() { - _instance?.Dispose(); - _instance = null; - } - } - - public class RemoteData { - private readonly ulong _owningClient; - public ulong OwningClient { get => _owningClient; } - - private readonly ReaderWriterLockSlim _lock; - - public ControllableState State; - public ServerTransforms Transforms; - - public RemoteData(ulong owningClient) { - _owningClient = owningClient; - _lock = new ReaderWriterLockSlim(); - - State = new ControllableState(); - Transforms = new ServerTransforms(); - Transforms.Guid = owningClient; - } - - public void EnterReadLock() => _lock.EnterReadLock(); - public void EnterWriteLock() => _lock.EnterWriteLock(); - public void ExitReadLock() => _lock.ExitReadLock(); - public void ExitWriteLock() => _lock.ExitWriteLock(); - } -} diff --git a/api/Api/Aether/Proto/ServerTransformData.cs b/api/Api/Aether/Proto/ServerTransformData.cs deleted file mode 100644 index ea1c64709b..0000000000 --- a/api/Api/Aether/Proto/ServerTransformData.cs +++ /dev/null @@ -1,21 +0,0 @@ -using UnityEngine; - -public partial class ServerTransformData { - public static explicit operator ServerTransformData(Matrix4x4 m) - => new ServerTransformData() { - MatrixData = { - m[0, 0], m[0, 1], m[0, 2], m[0, 3], - m[1, 0], m[1, 1], m[1, 2], m[1, 3], - m[2, 0], m[2, 1], m[2, 2], m[2, 3], - m[3, 0], m[3, 1], m[3, 2], m[3, 3] - } - }; - - public static explicit operator Matrix4x4(ServerTransformData transform) - => new Matrix4x4( - new Vector4(transform.MatrixData[0], transform.MatrixData[4], transform.MatrixData[8], transform.MatrixData[12]), - new Vector4(transform.MatrixData[1], transform.MatrixData[5], transform.MatrixData[9], transform.MatrixData[13]), - new Vector4(transform.MatrixData[2], transform.MatrixData[6], transform.MatrixData[10], transform.MatrixData[14]), - new Vector4(transform.MatrixData[3], transform.MatrixData[7], transform.MatrixData[11], transform.MatrixData[15]) - ); -} diff --git a/api/Api/Aether/Utilities/IO.cs b/api/Api/Aether/Utilities/IO.cs deleted file mode 100644 index ea529bb8c8..0000000000 --- a/api/Api/Aether/Utilities/IO.cs +++ /dev/null @@ -1,127 +0,0 @@ -using Google.Protobuf; -using Google.Protobuf.WellKnownTypes; -using SynthesisServer.Proto; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Net.Sockets; -using System.Text; - -namespace SynthesisAPI.Aether -{ - public static class IO - { - public static byte[] GetNextMessage(ref byte[] buffer) - { - byte[] msgLength = new byte[sizeof(int)]; - Array.Copy(buffer, 0, msgLength, 0, msgLength.Length); - - byte[] msg = new byte[BitConverter.ToInt32(msgLength, 0)]; - Array.Copy(buffer, sizeof(int), msg, 0, msg.Length); - - buffer = buffer.Skip(msgLength.Length + msg.Length).ToArray(); - return msg; - } - public static void SendMessage(IMessage msg, string clientID, Socket socket, AsyncCallback sendCallback) - { - Any packedMsg = Any.Pack(msg); - byte[] msgBytes = new byte[packedMsg.CalculateSize()]; - packedMsg.WriteTo(msgBytes); - - MessageHeader header = new MessageHeader() { IsEncrypted = false, ClientId = clientID }; - byte[] headerBytes = new byte[header.CalculateSize()]; - header.WriteTo(headerBytes); - - byte[] data = new byte[sizeof(int) + headerBytes.Length + sizeof(int) + msgBytes.Length]; - - BitConverter.GetBytes(headerBytes.Length).CopyTo(data, 0); - headerBytes.CopyTo(data, sizeof(int)); - - BitConverter.GetBytes(msgBytes.Length).CopyTo(data, sizeof(int) + headerBytes.Length); - msgBytes.CopyTo(data, sizeof(int) + headerBytes.Length + sizeof(int)); - - if (BitConverter.IsLittleEndian) { Array.Reverse(data); } - socket.BeginSend(data, 0, data.Length, SocketFlags.None, sendCallback, null); - } - public static void SendEncryptedMessage(IMessage msg, string clientID, byte[] symmetricKey, Socket socket, SymmetricEncryptor encryptor, AsyncCallback sendCallback) - { - Any packedMsg = Any.Pack(msg); - byte[] msgBytes = new byte[packedMsg.CalculateSize()]; - packedMsg.WriteTo(msgBytes); - - byte[] delimitedMessage = new byte[sizeof(int) + msgBytes.Length]; - BitConverter.GetBytes(msgBytes.Length).CopyTo(delimitedMessage, 0); - msgBytes.CopyTo(delimitedMessage, sizeof(int)); - - byte[] encryptedMessage = encryptor.Encrypt(delimitedMessage, symmetricKey); - - MessageHeader header = new MessageHeader() { IsEncrypted = true, ClientId = clientID }; - byte[] headerBytes = new byte[header.CalculateSize()]; - header.WriteTo(headerBytes); - - byte[] data = new byte[sizeof(int) + headerBytes.Length + encryptedMessage.Length]; - - BitConverter.GetBytes(headerBytes.Length).CopyTo(data, 0); - headerBytes.CopyTo(data, sizeof(int)); - - encryptedMessage.CopyTo(data, sizeof(int) + headerBytes.Length); - - if (BitConverter.IsLittleEndian) { Array.Reverse(data); } - socket.BeginSend(data, 0, data.Length, SocketFlags.None, sendCallback, null); - } - public static void SendMessageTo(IMessage msg, string clientID, Socket socket, EndPoint remoteEP, AsyncCallback sendCallback) - { - Any packedMsg = Any.Pack(msg); - byte[] msgBytes = new byte[packedMsg.CalculateSize()]; - packedMsg.WriteTo(msgBytes); - - MessageHeader header = new MessageHeader() { IsEncrypted = false, ClientId = clientID }; - byte[] headerBytes = new byte[header.CalculateSize()]; - header.WriteTo(headerBytes); - - byte[] data = new byte[sizeof(int) + headerBytes.Length + sizeof(int) + msgBytes.Length]; - - BitConverter.GetBytes(headerBytes.Length).CopyTo(data, 0); - headerBytes.CopyTo(data, sizeof(int)); - - BitConverter.GetBytes(msgBytes.Length).CopyTo(data, sizeof(int) + headerBytes.Length); - msgBytes.CopyTo(data, sizeof(int) + headerBytes.Length + sizeof(int)); - - if (BitConverter.IsLittleEndian) { Array.Reverse(data); } - socket.BeginSendTo(data, 0, data.Length, SocketFlags.None, remoteEP, sendCallback, null); - } - public static void SendEncryptedMessageTo(IMessage msg, string clientID, byte[] symmetricKey, Socket socket, EndPoint remoteEP, SymmetricEncryptor encryptor, AsyncCallback sendCallback) - { - Any packedMsg = Any.Pack(msg); - byte[] msgBytes = new byte[packedMsg.CalculateSize()]; - packedMsg.WriteTo(msgBytes); - - byte[] delimitedMessage = new byte[sizeof(int) + msgBytes.Length]; - BitConverter.GetBytes(msgBytes.Length).CopyTo(delimitedMessage, 0); - msgBytes.CopyTo(delimitedMessage, sizeof(int)); - - byte[] encryptedMessage = encryptor.Encrypt(delimitedMessage, symmetricKey); - - MessageHeader header = new MessageHeader() { IsEncrypted = true, ClientId = clientID }; - byte[] headerBytes = new byte[header.CalculateSize()]; - header.WriteTo(headerBytes); - - byte[] data = new byte[sizeof(int) + headerBytes.Length + encryptedMessage.Length]; - - BitConverter.GetBytes(headerBytes.Length).CopyTo(data, 0); - headerBytes.CopyTo(data, sizeof(int)); - - encryptedMessage.CopyTo(data, sizeof(int) + headerBytes.Length); - - if (BitConverter.IsLittleEndian) { Array.Reverse(data); } - socket.BeginSendTo(data, 0, data.Length, SocketFlags.None, remoteEP, sendCallback, null); - } - - public static byte[] GetBuffer(this IMessage msg) { - byte[] buf = new byte[msg.CalculateSize()]; - msg.WriteTo(buf); - return buf; - } - } -} diff --git a/api/Api/Aether/Utilities/SymmetricEncryptor.cs b/api/Api/Aether/Utilities/SymmetricEncryptor.cs deleted file mode 100644 index ed936bc72d..0000000000 --- a/api/Api/Aether/Utilities/SymmetricEncryptor.cs +++ /dev/null @@ -1,100 +0,0 @@ -using Org.BouncyCastle.Crypto; -using Org.BouncyCastle.Crypto.Digests; -using Org.BouncyCastle.Crypto.Generators; -using Org.BouncyCastle.Crypto.Parameters; -using Org.BouncyCastle.Math; -using Org.BouncyCastle.Security; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; - -namespace SynthesisAPI.Aether -{ - public class SymmetricEncryptor - { - private readonly RandomNumberGenerator _random; - private const int _AES_BLOCK_BYTE_SIZE = 128 / 8; - - public SymmetricEncryptor() - { - _random = RandomNumberGenerator.Create(); - } - - private byte[] GenerateRandomBytes(int numberOfBytes) - { - var randomBytes = new byte[numberOfBytes]; - _random.GetBytes(randomBytes); - return randomBytes; - } - - - public byte[] GenerateSharedSecret(string importedPublicKey, DHParameters parameters, AsymmetricCipherKeyPair keyPair) - { - DHPublicKeyParameters importedPublicKeyParameters = new DHPublicKeyParameters(new BigInteger(importedPublicKey), parameters); - IBasicAgreement internalKeyAgreement = AgreementUtilities.GetBasicAgreement("DH"); - internalKeyAgreement.Init(keyPair.Private); - BigInteger sharedKey = internalKeyAgreement.CalculateAgreement(importedPublicKeyParameters); - byte[] sharedKeyBytes = sharedKey.ToByteArray(); - - IDigest digest = new Sha256Digest(); - byte[] SymmetricKey = new byte[digest.GetDigestSize()]; - digest.BlockUpdate(sharedKeyBytes, 0, sharedKeyBytes.Length); - digest.DoFinal(SymmetricKey, 0); - return SymmetricKey; - } - - public AsymmetricCipherKeyPair GenerateKeys(DHParameters parameters) - { - var keyGen = GeneratorUtilities.GetKeyPairGenerator("DH"); - var kgp = new DHKeyGenerationParameters(new SecureRandom(), parameters); - keyGen.Init(kgp); - return keyGen.GenerateKeyPair(); - } - - public DHParameters GenerateParameters() - { - DHParametersGenerator generator = new DHParametersGenerator(); - generator.Init(512, 80, new SecureRandom()); // not too sure about these numbers - return generator.GenerateParameters(); - } - - public byte[] Encrypt(byte[] data, byte[] symmetricKey) - { - using (Aes aes = Aes.Create()) - { - aes.Key = symmetricKey; - aes.IV = GenerateRandomBytes(_AES_BLOCK_BYTE_SIZE); - - using (ICryptoTransform encryptor = aes.CreateEncryptor()) - { - - byte[] encryptedData = encryptor.TransformFinalBlock(data, 0, data.Length); - byte[] result = new byte[aes.IV.Length + encryptedData.Length]; - - aes.IV.CopyTo(result, 0); - encryptedData.CopyTo(result, aes.IV.Length); - - return result; - } - } - } - - public byte[] Decrypt(byte[] encryptedData, byte[] symmetricKey) - { - using (Aes aes = Aes.Create()) - { - aes.Key = symmetricKey; - aes.IV = encryptedData.Take(_AES_BLOCK_BYTE_SIZE).ToArray(); - - byte[] data = encryptedData.Skip(_AES_BLOCK_BYTE_SIZE).ToArray(); - - using (ICryptoTransform decryptor = aes.CreateDecryptor()) - { - return decryptor.TransformFinalBlock(data, 0, data.Length); - } - } - } - } -} diff --git a/api/Api/Api.csproj b/api/Api/Api.csproj deleted file mode 100644 index 0ef1db61ba..0000000000 --- a/api/Api/Api.csproj +++ /dev/null @@ -1,79 +0,0 @@ - - - - netstandard2.0 - 8 - Autodesk.Synthesis.Module.API - 0.1.0 - Autodesk Inc - Autodesk - Synthesis - An API for developing modules for the Synthesis™ platform - © 2020 Autodesk Inc. - https://synthesis.autodesk.com/ - synthesis.png - https://github.com/Autodesk/synthesis/tree/master/api - git - Autodesk, Synthesis, FRC, Robotics, Simulator - An experimental release of the Synthesis Module API. - -This release is for those looking to kickstart their module development for the Synthesis platform early before the release of version 5.1.0. -To get started with this API, you'll need to acquire a development build of Synthesis from either one of the following outlets: -- Clone from Git into your local Unity environment: https://github.com/Autodesk/synthesis.git -- Download an Engine build from our CI build artifacts: https://github.com/Autodesk/synthesis/actions - -Please note that this release is EXPERIMENTAL and still in development. More documentation will be available soon. - -For support contact frc@autodesk.com - en-US - Apache-2.0 - true - disable - false - - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - ..\libs\UnityEngine.dll - - - - - - - - - - - - - True - - - - - - - ..\libs\UnityEngine.dll - - - - - - - - diff --git a/api/Api/AssetManager/Asset.cs b/api/Api/AssetManager/Asset.cs deleted file mode 100644 index c7532fd07e..0000000000 --- a/api/Api/AssetManager/Asset.cs +++ /dev/null @@ -1,77 +0,0 @@ -using SynthesisAPI.Utilities; -using SynthesisAPI.VirtualFileSystem; -using Directory = SynthesisAPI.VirtualFileSystem.Directory; - -#nullable enable - -namespace SynthesisAPI.AssetManager -{ - /// - /// Base class for any read-only data class in the vitual file system - /// - public abstract class Asset : IEntry - { - /// - /// Initialize Asset data - /// - /// - /// - /// - internal void Init(string name, Permissions perm, string sourcePath) - { - _name = name; - _permissions = perm; - _parent = null!; - SourcePath = sourcePath; - } - - public string Name => ((IEntry)this).Name; - public Permissions Permissions => ((IEntry)this).Permissions; - public Directory? Parent => ((IEntry)this).Parent; - - public string SourcePath { get; private set; } = ""; - - private string _name { get; set; } = ""; - private Permissions _permissions { get; set; } - private Directory? _parent { get; set; } - - string IEntry.Name { get => _name; set => _name = value; } - Permissions IEntry.Permissions { get => _permissions; set => _permissions = value; } - Directory? IEntry.Parent { get => _parent; set => _parent = value; } - - [ExposedApi] - public virtual void Delete() - { - using var _ = ApiCallSource.StartExternalCall(); - DeleteInner(); - } - - [ExposedApi] - void IEntry.Delete() { - using var _ = ApiCallSource.StartExternalCall(); - DeleteInner(); - } - - internal virtual void DeleteInner() - { - ApiCallSource.AssertAccess(Permissions, Access.Write); - if (Parent != null) - { - Parent.RemoveEntryInner(Name); - } - } - - void IEntry.DeleteInner() - { - ApiCallSource.AssertAccess(Permissions, Access.Write); - DeleteInner(); - } - - /// - /// This function should not be called manually. It is called automatically during the asset important process. - /// - /// - /// This loaded asset - public abstract IEntry Load(byte[] data); - } -} diff --git a/api/Api/AssetManager/AssetImportEvent.cs b/api/Api/AssetManager/AssetImportEvent.cs deleted file mode 100644 index 96a2ab4b63..0000000000 --- a/api/Api/AssetManager/AssetImportEvent.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SynthesisAPI.AssetManager -{ - public class AssetImportEvent : EventBus.IEvent - { - public const string Tag = "AssetImport"; - - public string AssetName { get; } - public string AssetLocation { get; } - public string AssetType { get; } - - public AssetImportEvent(string assetName, string assetLocation, string assetType) - { - AssetName = assetName; - AssetLocation = assetLocation; - AssetType = assetType; - } - - public object[] GetArguments() => new[] { AssetName, AssetLocation, AssetType }; - } -} diff --git a/api/Api/AssetManager/AssetManager.cs b/api/Api/AssetManager/AssetManager.cs deleted file mode 100644 index a78931d7fd..0000000000 --- a/api/Api/AssetManager/AssetManager.cs +++ /dev/null @@ -1,522 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using SynthesisAPI.Utilities; -using SynthesisAPI.VirtualFileSystem; - -#nullable enable - -namespace SynthesisAPI.AssetManager -{ - /// - /// API for managing asset types and importing and fetching loaded assets - /// - public static class AssetManager - { - /// - /// Asset-type-specific function delegate used to process asset data on import - /// - /// - /// - /// - /// - /// - public delegate Asset? HandlerFunc(string name, Permissions perm, - string sourcePath, params object[] args); - - /// - /// Register a handler for importing a new type of asset - /// - /// - /// - /// - [ExposedApi] - public static void RegisterAssetType(string assetType, string[] fileExtensions, HandlerFunc handler) - { - using var _ = ApiCallSource.StartExternalCall(); - RegisterAssetTypeInner(assetType, fileExtensions, handler); - } - - internal static void RegisterAssetTypeInner(string assetType, string[] fileExtensions, HandlerFunc handler) - { - InnerInstance.RegisterAssetType(assetType, fileExtensions, handler); - } - - /// - /// Register a handler for importing a new type of asset - /// - /// - /// - /// - /// - [ExposedApi] - public static void RegisterAssetType(string type, string subtype, string[] fileExtensions, HandlerFunc handler) - { - using var _ = ApiCallSource.StartExternalCall(); - RegisterAssetTypeInner(type, subtype, fileExtensions, handler); - } - - internal static void RegisterAssetTypeInner(string type, string subtype, string[] fileExtensions, HandlerFunc handler) - { - InnerInstance.RegisterAsset(type, subtype, fileExtensions, handler); - } - - /// - /// Fetch an Asset from the virtual file system - /// - /// - /// - [ExposedApi] - public static Asset? GetAsset(string targetPath) - { - using var _ = ApiCallSource.StartExternalCall(); - return GetAssetInner(targetPath); - } - - internal static Asset? GetAssetInner(string targetPath) - { - return InnerInstance.GetAsset(targetPath); - } - - /// - /// Fetch an Asset from the virtual file system - /// - /// - /// - /// - [ExposedApi] - public static TAsset? GetAsset(string targetPath) where TAsset : Asset - { - using var _ = ApiCallSource.StartExternalCall(); - return GetAssetInner(targetPath); - } - - internal static TAsset? GetAssetInner(string targetPath) where TAsset : Asset - { - return (TAsset?)InnerInstance.GetAsset(targetPath); - } - - #region Search - - /// - /// Recursively search the virtual file system for an asset with a given name - /// - /// - /// - /// - [ExposedApi] - public static TAsset? Search(string name) where TAsset : Asset - { - using var _ = ApiCallSource.StartExternalCall(); - return SearchInner(name); - } - - internal static TAsset? SearchInner(string name) where TAsset : Asset - { - return FileSystem.SearchInner(name); - } - - /// - /// Recursively search a directory for an asset with a given name - /// - /// - /// - /// - /// - [ExposedApi] - public static TAsset? Search(VirtualFileSystem.Directory parent, string name) where TAsset : Asset - { - using var _ = ApiCallSource.StartExternalCall(); - return SearchInner(parent, name); - } - - internal static TAsset? SearchInner(VirtualFileSystem.Directory parent, string name) where TAsset : Asset - { - return FileSystem.SearchInner(parent, name); - } - - /// - /// Recursively search the virtual file system for an asset with a given name - /// - /// - /// - [ExposedApi] - public static Asset? Search(string name) - { - using var _ = ApiCallSource.StartExternalCall(); - return SearchInner(name); - } - - internal static Asset? SearchInner(string name) - { - return (Asset?)FileSystem.SearchInner(name); - } - - /// - /// Recursively search a directory for an asset with a given name - /// - /// - /// - /// - [ExposedApi] - public static Asset? Search(VirtualFileSystem.Directory parent, string name) - { - using var _ = ApiCallSource.StartExternalCall(); - return SearchInner(parent, name); - } - - internal static Asset? SearchInner(VirtualFileSystem.Directory parent, string name) - { - return (Asset?)FileSystem.SearchInner(parent, name); - } - - #endregion - - #region Import from File - - /// - /// Import a new asset into the virtual file system and create it if import fails - /// - /// - /// - /// - /// - /// - /// - /// - [ExposedApi] - public static Asset? Import(string assetType, bool createOnFail, string targetPath, string name, Permissions perm, string sourcePath, params object[] args) - { - using var _ = ApiCallSource.StartExternalCall(); - return ImportInner(assetType, createOnFail, targetPath, name, perm, sourcePath, args); - } - - internal static Asset? ImportInner(string assetType, bool createOnFail, string targetPath, string name, Permissions perm, string sourcePath, params object[] args) - { - return InnerInstance.Import(assetType, createOnFail, false, null, targetPath, name, perm, sourcePath, args); - } - - /// - /// Import a new asset into the virtual file system and create it if import fails - /// - /// - /// - /// - /// - /// - /// - /// - /// - [ExposedApi] - public static TAsset? Import(string assetType, bool createOnFail, string targetPath, string name, Permissions perm, string sourcePath, params object[] args) where TAsset : Asset - { - using var _ = ApiCallSource.StartExternalCall(); - return ImportInner(assetType, createOnFail, targetPath, name, perm, sourcePath, args); - } - - internal static TAsset? ImportInner(string assetType, bool createOnFail, string targetPath, string name, Permissions perm, string sourcePath, params object[] args) where TAsset : Asset - { - return (TAsset?)ImportInner(assetType, createOnFail, targetPath, name, perm, sourcePath, args); - } - - #endregion - - #region Import from Stream - - /// - /// Import a new asset into the virtual file system - /// - /// - /// - /// - /// - /// - /// - /// - /// - [ExposedApi] - public static Asset? Import(string assetType, Stream stream, string targetPath, string name, - Permissions perm, string sourcePath, params object[] args) - { - using var _ = ApiCallSource.StartExternalCall(); - return ImportInner(assetType, stream, targetPath, name, perm, sourcePath, args); - } - - internal static Asset? ImportInner(string assetType, Stream stream, string targetPath, string name, - Permissions perm, string sourcePath, params object[] args) - { - return InnerInstance.Import(assetType, false, false, stream, targetPath, name, perm, sourcePath, args); - } - - /// - /// Import a new asset into the virtual file system - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - [ExposedApi] - public static TAsset? Import(string assetType, Stream stream, string targetPath, string name, - Permissions perm, string sourcePath, params object[] args) where TAsset : Asset - { - using var _ = ApiCallSource.StartExternalCall(); - return ImportInner(assetType, stream, targetPath, name, perm, sourcePath, args); - } - - internal static TAsset? ImportInner(string assetType, Stream stream, string targetPath, string name, - Permissions perm, string sourcePath, params object[] args) where TAsset : Asset - { - return (TAsset?)ImportInner(assetType, stream, targetPath, name, perm, sourcePath, args); - } - - #region Lazy Imports - - [ExposedApi] - public static LazyAsset? ImportLazy(string assetType, bool createOnFail, string targetPath, string name, Permissions perm, string sourcePath, params object[] args) - { - using var _ = ApiCallSource.StartExternalCall(); - return ImportLazyInner(assetType, createOnFail, targetPath, name, perm, sourcePath, args); - } - - internal static LazyAsset? ImportLazyInner(string assetType, bool createOnFail, string targetPath, string name, Permissions perm, string sourcePath, params object[] args) - { - return (LazyAsset?)InnerInstance.Import(assetType, createOnFail, true, null, targetPath, name, perm, sourcePath, args); - } - - [ExposedApi] - public static LazyAsset? ImportLazy(string assetType, Stream stream, string targetPath, string name, - Permissions perm, string sourcePath, params object[] args) - { - using var _ = ApiCallSource.StartExternalCall(); - return ImportLazyInner(assetType, stream, targetPath, name, perm, sourcePath, args); - } - - internal static LazyAsset? ImportLazyInner(string assetType, Stream stream, string targetPath, string name, - Permissions perm, string sourcePath, params object[] args) - { - return (LazyAsset?)InnerInstance.Import(assetType, false, true, stream, targetPath, name, perm, sourcePath, args); - } - - #endregion - - #endregion - - public static string? GetTypeFromFileExtension(string fileName) - { - return InnerInstance.GetTypeFromFileExtension(fileName); - } - - /// - /// Implementation of the public API of the AssetManager - /// - private class Inner - { - private Inner() - { - AssetHandlers = new Dictionary>(); - FileExtensionAssetTypes = new Dictionary(); - - RegisterAssetType("text/plain", new[]{".txt"}, - (name, perms, sourcePath, args) => - { - if (args.Length != 0) - throw new Exception("Import of text/plain asset: wrong number of arguments"); - return new TextAsset(name, perms, sourcePath); - }); - - RegisterAssetType("text/xml", new[] { ".xml" }, - (name, perm, sourcePath, args) => - { - if (args.Length != 0) - throw new Exception("Import of text/xml asset: wrong number of arguments"); - return new XmlAsset(name, perm, sourcePath); - }); - - RegisterAssetType("text/json", new[] { ".json" }, - (name, perm, sourcePath, args) => - { - if (args.Length != 0) - throw new Exception("Import of text/json asset: wrong number of arguments"); - return new JsonAsset(name, perm, sourcePath); - }); - - RegisterAssetType("text/uss", new[] { ".uss" }, - (name, perm, sourcePath, args) => - { - if (args.Length != 0) - throw new Exception("Import of text/uss asset: wrong number of arguments"); - return new UssAsset(name, perm, sourcePath); - }); - - RegisterAssetType("image/sprite", new[] { ".png", ".jpeg" }, - (name, perm, sourcePath, args) => - { - if (args.Length != 0) - throw new Exception("Import of image/sprite asset: wrong number of arguments"); - return new SpriteAsset(name, perm, sourcePath); - }); - - RegisterAssetType("text/uxml", new[] { ".uxml" }, - (name, perm, sourcePath, args) => - { - if (args.Length != 0) - throw new Exception("Import of text/uxml asset: wrong number of arguments"); - return new VisualElementAsset(name, perm, sourcePath); - }); - - // RegisterAssetType("text/gltf", new[] { ".gltf", ".glb" }, - // (name, perm, sourcePath, args) => - // { - // if (args.Length != 0) - // throw new Exception("Import of text/gltf asset: wrong number of arguments"); - // return new GltfAsset(name, perm, sourcePath); - // }); - RegisterAssetType("audio/wav", new[] { ".wav" }, - (name, perm, sourcePath, args) => - { - if (args.Length != 0) - throw new Exception("Import of audio/wav asset: wrong number of arguments"); - return new AudioClipAsset(name, perm, sourcePath); - }); - } - - private Dictionary> AssetHandlers { get; } - private Dictionary FileExtensionAssetTypes { get; } - - /// - /// Split a media type into type and subtype - /// - /// Example: "text/plain" => "test" "plain" - /// - /// - /// - private string[] SplitAssetType(string assetType) - { - var types = assetType.Split('/'); - if (types.Length != 2) - { - throw new Exception("Splitting asset type: wrong type format"); - } - return types; - } - - public void RegisterAssetType(string assetType, string[] fileExtensions, HandlerFunc handler) - { - string[] types = SplitAssetType(assetType); - RegisterAsset(types[0], types[1], fileExtensions, handler); - } - - public void RegisterAsset(string type, string subtype, string[] fileExtensions, HandlerFunc handler) - { - if(AssetHandlers.ContainsKey(type) && AssetHandlers[type].ContainsKey(subtype)) - { - throw new Exception($"Registering duplicate handler for {type}/{subtype}"); - } - - if (!AssetHandlers.ContainsKey(type)) - { - AssetHandlers[type] = new Dictionary(); - } - - foreach (var fileExtension in fileExtensions) - { - if (FileExtensionAssetTypes.ContainsKey(fileExtension)) - { - throw new Exception($"Registering duplicate handler for asset type with file extension {fileExtension}"); - } - FileExtensionAssetTypes[fileExtension] = type + "/" + subtype; - } - - AssetHandlers[type][subtype] = handler; - } - - public Asset? GetAsset(string targetPath) => (Asset?)FileSystem.TraverseInner(targetPath); - - public string? GetTypeFromFileExtension(string fileName) - { - return FileExtensionAssetTypes.TryGetValue(Path.GetExtension(fileName), out string type) ? type : null; - } - - public Asset? Import(string assetType, bool createOnFail, bool lazyImport, Stream? sourceStream, string targetPath, string name, - Permissions perm, string sourcePath, params object[] args) - { - var types = SplitAssetType(assetType); - return Import(types[0], types[1], createOnFail, lazyImport, sourceStream, targetPath, name, perm, sourcePath, args); - } - - public Asset? Import(string type, string subtype, bool createOnFail, bool lazyImport, Stream? sourceStream, string targetPath, - string name, Permissions perm, string sourcePath, params object[] args) - { - if (!AssetHandlers.ContainsKey(type) || !AssetHandlers[type].ContainsKey(subtype)) - { - throw new Exception($"Importing asset with unregistered type {type}/{subtype}"); - } - - string path = FileSystem.BasePath + sourcePath; - - if (sourceStream == null && sourcePath != "") // We need to read it - { - if (!File.Exists(path)) - { - if (createOnFail) - { - System.IO.Directory.CreateDirectory(Path.GetDirectoryName(path)); - sourceStream = File.Create(path); - } - } - else - { - sourceStream = File.Open(path, FileMode.Open, FileAccess.ReadWrite); - } - - if (sourceStream == null) - { - throw new SynthesisException("Source stream for import is empty"); - } - } - - Asset? newAsset = AssetHandlers[type][subtype](name, perm, path, args); - - if (newAsset == null) - { - return null; - } - - EventBus.EventBus.Push(AssetImportEvent.Tag, new AssetImportEvent(name, targetPath, type + "/" + subtype)); - - if (lazyImport) - { - if (sourceStream == null) { - // I have no clue if this is true but apparently so. - throw new Exception("Cannot load a lazy asset without a source stream."); - } - LazyAsset lazyAsset = new LazyAsset(newAsset, sourceStream, targetPath); - return (Asset?)FileSystem.AddEntry(targetPath, lazyAsset.Load(new byte[0])); - } - - byte[] data = new byte[0]; - if (sourceStream != null) - { - int streamLength = (int)sourceStream.Length; - - data = new byte[streamLength]; - sourceStream.Read(data, 0, streamLength); - - sourceStream.Close(); - } - - // TODO make it so we don't have to allocate twice the size of the asset every - // time we import it (i.e. a 500 KB asset will result in 1000 KB of allocation) - return (Asset?)FileSystem.AddEntry(targetPath, newAsset.Load(data)); - } - - public static readonly Inner InnerInstance = new Inner(); - } - private static Inner InnerInstance => Inner.InnerInstance; - } -} \ No newline at end of file diff --git a/api/Api/AssetManager/AudioClipAsset.cs b/api/Api/AssetManager/AudioClipAsset.cs deleted file mode 100644 index d34e3b17db..0000000000 --- a/api/Api/AssetManager/AudioClipAsset.cs +++ /dev/null @@ -1,39 +0,0 @@ -using SynthesisAPI.VirtualFileSystem; -using System.IO; -using UnityEngine; -using UnityEngine.Networking; - -#nullable enable - -namespace SynthesisAPI.AssetManager -{ - public class AudioClipAsset : Asset - { - private AudioClip _clip; - - // this should always return a clip but it's up to the user to decide if it's valid - internal AudioClip GetClip() => _clip; - - public AudioClipAsset(string name, Permissions perm, string sourcePath) - { - Init(name, perm, sourcePath); - - // create empty clip - _clip = AudioClip.Create("EmptyClip", 44100, 1, 44100, false); - float[] data = new float[44100]; - _clip.SetData(data, 0); - } - - public override IEntry Load(byte[] data) - { - string tempFile = Path.GetTempPath() + "\\synthesis_temp.wav"; - File.WriteAllBytes(tempFile, data); - var request = UnityWebRequestMultimedia.GetAudioClip(tempFile, AudioType.WAV); - var handle = request.SendWebRequest(); - while (!handle.isDone) - _ = 0; // - _clip = DownloadHandlerAudioClip.GetContent(request); - return this; - } - } -} diff --git a/api/Api/AssetManager/BinaryAsset.cs b/api/Api/AssetManager/BinaryAsset.cs deleted file mode 100644 index 43fdadc0db..0000000000 --- a/api/Api/AssetManager/BinaryAsset.cs +++ /dev/null @@ -1,72 +0,0 @@ -using SynthesisAPI.Utilities; -using SynthesisAPI.VirtualFileSystem; -using System; -using System.IO; -using System.Threading; - -#nullable enable - -namespace SynthesisAPI.AssetManager -{ - /// - /// Representation of a binary asset - /// - public class BinaryAsset : Asset - { - private readonly Stream _stream; - private SharedBinaryStream SharedStream { get; set; } = null!; - private readonly ReaderWriterLockSlim _rwLock; - - public BinaryAsset(string name, Permissions perm, string sourcePath) - { - Init(name, perm, sourcePath); - _rwLock = new ReaderWriterLockSlim(); - _stream = new MemoryStream(); - } - - [ExposedApi] - public void SaveToFile() - { - using var _ = ApiCallSource.StartExternalCall(); - SaveToFileInner(); - } - - private void SaveToFileInner() - { - ApiCallSource.AssertAccess(Permissions, Access.Write); - - long pos = SharedStream.Stream.Position; - SharedStream.Seek(0); - File.WriteAllBytes(SourcePath, SharedStream.ReadToEnd()); - SharedStream.Seek(pos); - } - - public override IEntry Load(byte[] data) - { - _stream.Write(data, 0, data.Length); - _stream.Position = 0; - SharedStream = new SharedBinaryStream(_stream, _rwLock); - - return this; - } - - [ExposedApi] - public byte[]? ReadToEnd() - { - using var _ = ApiCallSource.StartExternalCall(); - return ReadToEndInner(); - } - - internal byte[]? ReadToEndInner() - { - ApiCallSource.AssertAccess(Permissions, Access.Read); - return SharedStream?.ReadToEnd(); - } - - internal override void DeleteInner() - { - base.DeleteInner(); - _stream.Close(); - } - } -} diff --git a/api/Api/AssetManager/GltfAsset.cs b/api/Api/AssetManager/GltfAsset.cs deleted file mode 100644 index 4769ba2d6d..0000000000 --- a/api/Api/AssetManager/GltfAsset.cs +++ /dev/null @@ -1,329 +0,0 @@ -using System.Collections.Generic; -using System; -using System.IO; -using SynthesisAPI.VirtualFileSystem; -// using SharpGLTF.Schema2; -using SynthesisAPI.Utilities; -using SynthesisAPI.EnvironmentManager; -using System.Linq; -using MathNet.Spatial.Euclidean; -// using SharpGLTF.IO; -using SynthesisAPI.EventBus; -using SynthesisAPI.EnvironmentManager.Components; -// using Mesh = SharpGLTF.Schema2.Mesh; - -namespace SynthesisAPI.AssetManager -{ - // public class GltfAsset : Asset - // { - // private string OFFICIAL_TRACKING_CODE = "228533714"; - // - // private ModelRoot model = null; - // private static int modelCounter = 0; - // private static long triangleCount = 0; - // - // public GltfAsset(string name, Permissions perm, string sourcePath) - // { - // Init(name, perm, sourcePath); - // } - // - // public override IEntry Load(byte[] data) - // { - // var stream = new MemoryStream(); - // stream.Write(data, 0, data.Length); - // stream.Position = 0; - // - // GetModelInfo(stream, true); - // - // return this; - // } - // - // private void GetModelInfo(MemoryStream stream, bool tryFix = false) - // { - // try - // { - // var settings = tryFix ? SharpGLTF.Validation.ValidationMode.TryFix : SharpGLTF.Validation.ValidationMode.Strict; - // - // model = ModelRoot.ReadGLB(stream, settings); - // } - // catch (Exception) - // { - // Logger.Log($"GLTF asset \"{Name}\" either could not be read or could not be interpretted", LogLevel.Error); - // } - // } - // - // #region Object Bundle - // - // public static implicit operator Bundle(GltfAsset gltfAsset) => gltfAsset.Parse(); - // - // private Dictionary> preprocessedJoints; - // private Dictionary rigidbodies; - // private List<(EnvironmentManager.Components.Rigidbody, EnvironmentManager.Components.Rigidbody)> defaultRigidjoints; - // private List exporterType; - // private bool rigidbodyPresent; - // public Bundle Parse() - // { - // if (model == null) return null; - // - // triangleCount = 0; - // - // preprocessedJoints = new Dictionary>(); - // rigidbodies = new Dictionary(); - // defaultRigidjoints = new List<(EnvironmentManager.Components.Rigidbody, EnvironmentManager.Components.Rigidbody)>(); - // exporterType = new List(); - // rigidbodyPresent = false; - // - // PreprocessJoints(); - // ExportInfoGathering(); - // - // var bundle = CreateBundle(model.DefaultScene.VisualChildren.First()); - // - // bundle.Components.Add(ParseJoints()); - // - // modelCounter++; - // return bundle; - // } - // - // private void PreprocessJoints() { - // RecursiveUuidGathering(model.DefaultScene.VisualChildren.First()); - // var joints = (model.Extras as JsonDictionary)["joints"] as JsonList; - // foreach (var j in joints) { - // preprocessedJoints[(j as JsonDictionary).Get("occurrenceOneUUID")].Add((j as JsonDictionary).Get("occurrenceTwoUUID")); - // preprocessedJoints[(j as JsonDictionary).Get("occurrenceTwoUUID")].Add((j as JsonDictionary).Get("occurrenceOneUUID")); - // } - // } - // - // private void RecursiveUuidGathering(Node root) { - // if ((root.Extras as JsonDictionary)?.ContainsKey("uuid") ?? false) { - // preprocessedJoints.Add((string)(root.Extras as JsonDictionary)!["uuid"], new List()); - // } - // foreach (Node child in root.VisualChildren) - // RecursiveUuidGathering(child); - // } - // private void ExportInfoGathering() - // { - // Analytics.SetUnityPrefs(OFFICIAL_TRACKING_CODE, true); - // string generator = model.Asset.Generator; - // Analytics.LogEventAsync(Analytics.EventCategory.ExporterType, Analytics.EventAction.Load, generator, 10); - // Analytics.UploadDump(); - // - // var version = model.Asset.MinVersion; - // Analytics.LogEventAsync(Analytics.EventCategory.ExporterVersion, Analytics.EventAction.Load, version.ToString(), 10); - // Analytics.UploadDump(); - // } - // - // private Bundle CreateBundle(Node node, Node parentNode = null, Bundle parentBundle = null) - // { - // Bundle bundle = new Bundle(parentBundle); - // - // AddComponents(bundle, node, parentNode); - // - // foreach (Node child in node.VisualChildren) { - // bundle.ChildBundles.Add(CreateBundle(child, node, bundle)); - // } - // - // return bundle; - // } - // - // private void AddComponents(Bundle bundle, Node node, Node parent = null) - // { - // if (parent != null) { - // var scale = node.LocalTransform.Scale; - // var parentScale = parent.LocalTransform.Scale; - // scale = new System.Numerics.Vector3(scale.X * parentScale.X, scale.Y * parentScale.Y, scale.Z * parentScale.Z); - // var localTransform = node.LocalTransform; - // localTransform.Scale = scale; - // node.LocalTransform = localTransform; - // } - // - // bundle.Components.Add(ParseTransform(node.LocalTransform, node.Name)); - // if (node.Mesh != null) - // { - // var sc = node.LocalTransform.Scale; - // bundle.Components.Add(ParseMesh(node.Mesh, new Vector3D(sc.X, sc.Y, sc.Z))); - // bundle.Components.Add(ParseMeshCollider(node.Mesh)); - // - // if ((node.Extras as JsonDictionary)?.ContainsKey("uuid") ?? false) { - // var rigid = ParseRigidbody(node.Mesh); - // bundle.Components.Add(rigid); - // var uuid = (node.Extras as JsonDictionary)?.Get("uuid"); - // rigid.ExportedJointUuid = uuid; - // rigidbodies.Add(uuid, rigid); - // - // // Identify parent physics body (if any) - // var seniorRB = GetSeniorRigidbody(bundle.ParentBundle); - // if (seniorRB != null) { - // if (seniorRB.ExportedJointUuid == string.Empty) { - // defaultRigidjoints.Add((seniorRB, rigid)); - // } else { - // if (!preprocessedJoints[uuid].Contains(seniorRB.ExportedJointUuid)) { - // defaultRigidjoints.Add((seniorRB, rigid)); - // } - // } - // } else { - // Logger.Log("Not rigidbody???", LogLevel.Warning); - // } - // } else if (parent == null) { - // var rigid = ParseRigidbody(node.Mesh); - // bundle.Components.Add(rigid); - // return; - // } - // else - // { - // - // var seniorRB = GetSeniorRigidbody(bundle.ParentBundle); - // //if(seniorRB != null) - // //{ - // // seniorRB.mass += ParseMass(node.Mesh) ?? 0; - // //} - // } - // } else if (parent == null) { - // var rigid = ParseRigidbody(null); - // bundle.Components.Add(rigid); - // } - // } - // - // private EnvironmentManager.Components.Rigidbody? GetSeniorRigidbody(Bundle? b) { - // if (b == null) - // return null; - // else if (b.Components.HasType()) - // return b.Components.Get(); - // else - // return GetSeniorRigidbody(b.ParentBundle); - // } - // - // private static float? ParseMass(Mesh nodeMesh, float defaultMass = 1) - // { - // if (nodeMesh != null) - // { - // if ((nodeMesh.Extras as JsonDictionary).TryGetValue("physicalProperties", out object physicalProperties)) - // { - // if ((physicalProperties as JsonDictionary).TryGetValue("mass", out object massStr)) - // { - // if (float.TryParse(massStr.ToString(), out float mass)) - // { - // return mass; - // } - // } - // } - // return null; - // } - // return defaultMass; - // } - // - // private EnvironmentManager.Components.Rigidbody ParseRigidbody(Mesh nodeMesh) - // { - // EnvironmentManager.Components.Rigidbody rigidbody = new EnvironmentManager.Components.Rigidbody(); - // rigidbody.mass = ParseMass(nodeMesh) ?? throw new SynthesisException($"Failed to parse mass of rigidbody in GLTF asset: {Name}"); - // return rigidbody; - // } - // - // private EnvironmentManager.Components.MeshCollider ParseMeshCollider(Mesh nodeMesh) - // { - // EnvironmentManager.Components.MeshCollider collider = new EnvironmentManager.Components.MeshCollider(); - // collider.collisionLayer = $"ent-{modelCounter}"; - // return collider; - // } - // - // private EnvironmentManager.Components.Mesh ParseMesh(Mesh nodeMesh, Vector3D scaleFactor) - // { - // EnvironmentManager.Components.Mesh m = new EnvironmentManager.Components.Mesh(); - // foreach (MeshPrimitive primitive in nodeMesh.Primitives) - // { - // int c = m.Vertices.Count(); - // // checks for POSITION or NORMAL vertex as not all designs have both (TODO: This doesn't trip, if it did would we screw up the triangles?) - // if (primitive.VertexAccessors.ContainsKey("POSITION")) - // { - // var vertices = primitive.GetVertices("POSITION").AsVector3Array(); - // foreach (var vertex in vertices) - // m.Vertices.Add(new Vector3D(vertex.X * scaleFactor.X, vertex.Y * scaleFactor.Y, vertex.Z * scaleFactor.Z)); - // } - // - // var triangles = primitive.GetIndices(); - // triangleCount += triangles.Count / 3; - // for (int i = 0; i < triangles.Count; i++) - // m.Triangles.Add((int)triangles[i] + c); - // } - // return m; - // } - // - // private EnvironmentManager.Components.Transform ParseTransform(SharpGLTF.Transforms.AffineTransform nodeTransform, string name) - // { - // EnvironmentManager.Components.Transform t = new EnvironmentManager.Components.Transform(); - // - // t.Rotation = new Quaternion(nodeTransform.Rotation.W, - // nodeTransform.Rotation.X, nodeTransform.Rotation.Y, nodeTransform.Rotation.Z); - // t.Position = new Vector3D(nodeTransform.Translation.X * nodeTransform.Scale.X, - // nodeTransform.Translation.Y * nodeTransform.Scale.Y, nodeTransform.Translation.Z * nodeTransform.Scale.Z); - // //scale is applied directly to vertices -> default 1x - // - // return t; - // } - // - // #endregion - // - // private EnvironmentManager.Components.Joints ParseJoints() - // { - // var joints = (model.Extras as JsonDictionary)["joints"] as JsonList; - // - // var allJoints = new EnvironmentManager.Components.Joints(); - // - // foreach (var jointObj in joints) { - // var joint = jointObj as JsonDictionary; - // string name = joint.Get("header").Get("name"); // Probably not gonna be used - // Vector3D anchor = ParseJointVector3D(joint.Get("origin")); - // EnvironmentManager.Components.Rigidbody parent = rigidbodies[joint.Get("occurrenceOneUUID")]; - // EnvironmentManager.Components.Rigidbody child = rigidbodies[joint.Get("occurrenceTwoUUID")]; - // - // if (joint.ContainsKey("revoluteJointMotion")) { - // var revoluteData = joint.Get("revoluteJointMotion"); - // Vector3D axis = ParseJointVector3D(revoluteData.Get("rotationAxisVector")); - // // TODO: Support limits - // var result = new EnvironmentManager.Components.HingeJoint(); - // result.Anchor = anchor; - // result.Axis = axis; - // result.ConnectedParent = parent; - // result.ConnectedChild = child; - // allJoints.Add(result); - // } else { // For yet to be supported and fixed motion joints - // var result = new EnvironmentManager.Components.FixedJoint(); - // result.Anchor = anchor; - // result.ConnectedParent = parent; - // result.ConnectedChild = child; - // allJoints.Add(result); - // } - // } - // - // // Add the remaining potential joints - // foreach (var x in defaultRigidjoints) { - // var j = new EnvironmentManager.Components.FixedJoint(); - // j.Anchor = new Vector3D(0, 0, 0); // Pretty sure this doesn't matter. From what I can tell, Unity FixedJoints only really care about the bodies - // j.ConnectedParent = x.Item1; - // j.ConnectedChild = x.Item2; - // allJoints.Add(j); - // } - // - // return allJoints; - // } - // - // private Vector3D ParseJointVector3D(JsonDictionary dict) => - // new Vector3D((double)dict.TryGet("x", 0), - // (double)dict.TryGet("y", 0), (double)dict.TryGet("z", 0)); - // } - // - // public static class GltfAssetExtensions { - // public static T Get(this JsonDictionary dict, string key) => (T)dict[key]; - // public static T TryGet(this JsonDictionary dict, string key, T defaultObj) { - // if (dict.ContainsKey(key)) - // return (T)dict[key]; - // else - // return defaultObj; - // } - // public static JsonDictionary Get(this JsonDictionary dict, string key) => (JsonDictionary)dict[key]; - // - // public static void ForEach(this IEnumerable e, Action method) { - // for (int i = 0; i < e.Count(); ++i) - // method(i, e.ElementAt(i)); // I really hope this holds reference - // } - // } -} diff --git a/api/Api/AssetManager/JsonAsset.cs b/api/Api/AssetManager/JsonAsset.cs deleted file mode 100644 index 08dd36e183..0000000000 --- a/api/Api/AssetManager/JsonAsset.cs +++ /dev/null @@ -1,75 +0,0 @@ -using Newtonsoft.Json; -using SynthesisAPI.Utilities; -using SynthesisAPI.VirtualFileSystem; -using System.IO; - -namespace SynthesisAPI.AssetManager -{ - /// - /// Representation of a JSON asset - /// - public class JsonAsset : TextAsset - { - public JsonAsset(string name, Permissions perm, string sourcePath) : - base(name, perm, sourcePath) { } - - [ExposedApi] - public TObject Deserialize(long offset = long.MaxValue, SeekOrigin loc = SeekOrigin.Begin, - bool retainPosition = true) - { - using var _ = ApiCallSource.StartExternalCall(); - return DeserializeInner(offset, loc, retainPosition); - } - - - internal TObject DeserializeInner(long offset = long.MaxValue, SeekOrigin loc = SeekOrigin.Begin, - bool retainPosition = true) - { - ApiCallSource.AssertAccess(Permissions, Access.Read); - long? returnPosition = null; - if (offset != long.MaxValue) - { - if (retainPosition) - { - returnPosition = SharedStream.Stream.Position; - } - SharedStream.Seek(offset, loc); - } - - var obj = JsonConvert.DeserializeObject(SharedStream.ReadToEnd()); - - if (returnPosition != null) - { - SharedStream.Seek(returnPosition.Value); - } - - if (obj == null) { - throw new System.Exception("Failed to deserialize a Json object!"); - } - - return obj; - } - - [ExposedApi] - public void Serialize(TObject obj, WriteMode writeMode = WriteMode.Overwrite) - { - using var _ = ApiCallSource.StartExternalCall(); - SerializeInner(obj, writeMode); - } - - internal void SerializeInner(TObject obj, WriteMode writeMode = WriteMode.Overwrite) - { - ApiCallSource.AssertAccess(Permissions, Access.Write); - if (writeMode == WriteMode.Overwrite) - { - SharedStream.Seek(0); - SharedStream.SetLength(0); - } - else - { - SharedStream.Seek(0, SeekOrigin.End); - } - SharedStream.WriteLine(JsonConvert.SerializeObject(obj, Formatting.Indented)); - } - } -} diff --git a/api/Api/AssetManager/LazyAsset.cs b/api/Api/AssetManager/LazyAsset.cs deleted file mode 100644 index 81c806db88..0000000000 --- a/api/Api/AssetManager/LazyAsset.cs +++ /dev/null @@ -1,52 +0,0 @@ -using SynthesisAPI.Utilities; -using SynthesisAPI.VirtualFileSystem; -using System.IO; - -#nullable enable - -namespace SynthesisAPI.AssetManager -{ - public class LazyAsset : Asset - { - private readonly Asset inner; - private readonly Stream _sourceStream; - private readonly string _targetPath; - - public LazyAsset(Asset asset, Stream sourceStream, string targetPath) - { - Init(asset.Name, asset.Permissions, asset.SourcePath); - inner = asset; - _sourceStream = sourceStream; // this can be null technically? - _targetPath = targetPath; - } - - public IEntry Load() - { - base.DeleteInner(); - - byte[] data = new byte[_sourceStream.Length]; - _sourceStream.Read(data, 0, (int)_sourceStream.Length); - _sourceStream.Close(); - - var entry = FileSystem.AddEntry(_targetPath, inner.Load(data)); - - if (entry != null) - { - return entry; - } - - throw new System.Exception("Failed to load lazy asset"); - } - - public override IEntry Load(byte[] _) - { - return this; - } - - internal override void DeleteInner() - { - base.DeleteInner(); - _sourceStream.Close(); - } - } -} diff --git a/api/Api/AssetManager/SpriteAsset.cs b/api/Api/AssetManager/SpriteAsset.cs deleted file mode 100644 index db545d1231..0000000000 --- a/api/Api/AssetManager/SpriteAsset.cs +++ /dev/null @@ -1,51 +0,0 @@ -using MathNet.Spatial.Euclidean; -using SynthesisAPI.Utilities; -using SynthesisAPI.VirtualFileSystem; -using System; -using UnityEngine; - -#nullable enable - -namespace SynthesisAPI.AssetManager -{ - /// - /// Representation of a Unity Sprite asset - /// - /// Only PNG and JPEG images are supported for import - /// - public class SpriteAsset : Asset - { - internal Sprite? Sprite { get; private set; } - - public SpriteAsset(string name, Permissions perm, string sourcePath) - { - Init(name, perm, sourcePath); - } - - public override IEntry Load(byte[] data) - { - Texture2D texture = new Texture2D(1, 1); // LoadImage will replace with incoming image size - - if (!texture.LoadImage(data)) // LoadImage works for PNG and JPEG images as byte arrays - { - throw new Exception("Failed to load image"); - } - - Sprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(.5f, .5f)); - - return this; - } - - /// - /// Create a sprite asset from a texture - /// - /// Texture to use - /// Defines rectangular section of the texture to use for the sprite - /// Defines rectangular section of the texture to use for the sprite - /// Sprite's pivot point relative to its graphic rectangle - internal void SetSprite(Texture2D texture, Vector2D position, Vector2D size, Vector2D pivot) - { - Sprite = Sprite.Create(texture, new Rect(MathUtil.MapVector2D(position), MathUtil.MapVector2D(size)), MathUtil.MapVector2D(pivot)); - } - } -} \ No newline at end of file diff --git a/api/Api/AssetManager/TextAsset.cs b/api/Api/AssetManager/TextAsset.cs deleted file mode 100644 index f3ab59f153..0000000000 --- a/api/Api/AssetManager/TextAsset.cs +++ /dev/null @@ -1,80 +0,0 @@ -using SynthesisAPI.Utilities; -using SynthesisAPI.VirtualFileSystem; -using System.IO; -using System.Threading; - -#nullable enable - -namespace SynthesisAPI.AssetManager -{ - /// - /// Representation of a plain text asset - /// - public class TextAsset : Asset - { - // please stop putting private members at the bottom. - // we get it. c++ is cool. But it's a mess and not effective unless there are headers. - private readonly Stream _stream; - protected SharedTextStream SharedStream { get; set; } - private readonly ReaderWriterLockSlim _rwLock; - - public enum WriteMode - { - Append, - Overwrite - } - - public TextAsset(string name, Permissions perm, string sourcePath) - { - Init(name, perm, sourcePath); - _rwLock = new ReaderWriterLockSlim(); - _stream = new MemoryStream(); - SharedStream = new SharedTextStream(new MemoryStream(), _rwLock); - } - - [ExposedApi] - public void SaveToFile() - { - using var _ = ApiCallSource.StartExternalCall(); - SaveToFileInner(); - } - - internal void SaveToFileInner() - { - ApiCallSource.AssertAccess(Permissions, Access.Write); - - var pos = SharedStream.Stream.Position; - SharedStream.Seek(0); - File.WriteAllText(SourcePath, SharedStream.ReadToEnd()); - SharedStream.Seek(pos); - } - - public override IEntry Load(byte[] data) - { - _stream.Write(data, 0, data.Length); - _stream.Position = 0; - SharedStream = new SharedTextStream(_stream, _rwLock)!; - - return this; - } - - [ExposedApi] - public string? ReadToEnd() - { - using var _ = ApiCallSource.StartExternalCall(); - return ReadToEndInner(); - } - - internal string? ReadToEndInner() - { - ApiCallSource.AssertAccess(Permissions, Access.Read); - return SharedStream?.ReadToEnd(); - } - - internal override void DeleteInner() - { - base.DeleteInner(); - _stream.Close(); - } - } -} diff --git a/api/Api/AssetManager/UssAsset.cs b/api/Api/AssetManager/UssAsset.cs deleted file mode 100644 index adb8cff588..0000000000 --- a/api/Api/AssetManager/UssAsset.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text; -using SynthesisAPI.UIManager; -using SynthesisAPI.Utilities; -using SynthesisAPI.VirtualFileSystem; - -#nullable enable - -namespace SynthesisAPI.AssetManager -{ - /// - /// Representation of a USS asset - /// - public class UssAsset : Asset - { - public StyleSheet? StyleSheet { get; private set; } - - public UssAsset(string name, Permissions perm, string sourcePath) - { - Init(name, perm, sourcePath); - } - - public override IEntry Load(byte[] data) - { - string[] contents = Encoding.UTF8.GetString(data).Split('\n'); - try - { - StyleSheet = new StyleSheet(contents); - } - catch(Exception e) - { - Logger.Log($"Failed to load stylesheet {Name}\n{e}", LogLevel.Error); - } - return this; - } - } -} diff --git a/api/Api/AssetManager/VisualElementAsset.cs b/api/Api/AssetManager/VisualElementAsset.cs deleted file mode 100644 index f2b2c16fad..0000000000 --- a/api/Api/AssetManager/VisualElementAsset.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.IO; -using System.Xml; -using SynthesisAPI.UIManager; -using SynthesisAPI.UIManager.VisualElements; -using SynthesisAPI.VirtualFileSystem; - -namespace SynthesisAPI.AssetManager -{ - public class VisualElementAsset: Asset - { - private XmlDocument _document; - - public VisualElementAsset(string name, Permissions perms, string sourcePath) - { - Init(name, perms, sourcePath); - _document = new XmlDocument(); - } - - public VisualElement GetElement(string name) => UIParser.CreateVisualElement(name, _document); - - public override IEntry Load(byte[] data) - { - MemoryStream stream = new MemoryStream(); - stream.Write(data, 0, data.Length); - stream.Position = 0; - _document.Load(stream); - return this; - } - } -} \ No newline at end of file diff --git a/api/Api/AssetManager/XmlAsset.cs b/api/Api/AssetManager/XmlAsset.cs deleted file mode 100644 index 106599dc72..0000000000 --- a/api/Api/AssetManager/XmlAsset.cs +++ /dev/null @@ -1,72 +0,0 @@ -using SynthesisAPI.Utilities; -using SynthesisAPI.VirtualFileSystem; -using System.IO; -using System.Xml.Serialization; - -namespace SynthesisAPI.AssetManager -{ - /// - /// Representation of an XML asset - /// - public class XmlAsset : TextAsset - { - public XmlAsset(string name, Permissions perm, string sourcePath) : - base(name, perm, sourcePath) { } - - [ExposedApi] - public TObject Deserialize(long offset = long.MaxValue, SeekOrigin loc = SeekOrigin.Begin, bool retainPosition = true) - { - using var _ = ApiCallSource.StartExternalCall(); - return DeserializeInner(offset, loc, retainPosition); - } - - internal TObject DeserializeInner(long offset = long.MaxValue, SeekOrigin loc = SeekOrigin.Begin, bool retainPosition = true) - { - ApiCallSource.AssertAccess(Permissions, Access.Read); - long? returnPosition = null; - if (offset != long.MaxValue) - { - if(retainPosition) - { - returnPosition = SharedStream.Stream.Position; - } - SharedStream.Seek(offset, loc); - } - - TObject obj = (TObject)new XmlSerializer(typeof(TObject)).Deserialize(new StreamReader(SharedStream.Stream)); - - if (returnPosition != null) - { - SharedStream.Seek(returnPosition.Value); - } - return obj; - } - - [ExposedApi] - public void Serialize(TObject obj, WriteMode writeMode = WriteMode.Overwrite) - { - using var _ = ApiCallSource.StartExternalCall(); - SerializeInner(obj, writeMode); - } - - internal void SerializeInner(TObject obj, WriteMode writeMode = WriteMode.Overwrite) - { - ApiCallSource.AssertAccess(Permissions, Access.Write); - if (writeMode == WriteMode.Overwrite) - { - SharedStream.Seek(0); - SharedStream.SetLength(0); - } - else - { - SharedStream.Seek(0, SeekOrigin.End); - } - - using (var writer = new StringWriter()) - { - new XmlSerializer(typeof(TObject)).Serialize(writer, obj); - SharedStream.WriteLine(writer.ToString()); - } - } - } -} diff --git a/api/Api/Controller/ControllableState.cs b/api/Api/Controller/ControllableState.cs deleted file mode 100644 index 60348dc020..0000000000 --- a/api/Api/Controller/ControllableState.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading; -using Google.Protobuf.WellKnownTypes; -using Mirabuf.Signal; -using SynthesisAPI.Utilities; - -#nullable enable - -namespace SynthesisAPI.Controller { - - public partial class ControllableState { - - private ReaderWriterLockSlim? _signalMapLock; - public ReaderWriterLockSlim SignalMapLock { - get => _signalMapLock ?? (_signalMapLock = new ReaderWriterLockSlim()); - } - - private Dictionary? _modifiedSignals; - private Dictionary ModifiedSignals { - get => _modifiedSignals ?? (_modifiedSignals = new Dictionary()); - } - - public bool HasUpdates => ModifiedSignals.Count > 0; - - public ControllableState(params Signals[] allSignals) { - allSignals.ForEach(partSignals => partSignals.SignalMap.ForEach(x => { - if (!SignalMap.ContainsKey(x.Key)) - SignalMap.Add( - x.Key, - new SignalData { - SignalGuid = x.Key, - Name = x.Value.Info.Name, - Value = Value.ForNull() - } - ); - })); - } - - public Value? GetValue(string signal_guid) { - // TODO: Limit read to tho classified as output and write to inputs - Value? result = null; - - SignalMapLock.EnterReadLock(); - SignalMap.TryGetValue(signal_guid, out SignalData sig); - if (sig != null) { - result = new Value(sig.Value); - } - SignalMapLock.ExitReadLock(); - - return result; - } - - public void SetValue(string signal_guid, Value v, bool trackChange = true) { - SignalData s; - if (!SignalMap.ContainsKey(signal_guid)) { - s = new SignalData() { Io = UpdateIOType.Input, SignalGuid = signal_guid }; - SignalMap.Add(signal_guid, s); - } else { - s = SignalMap[signal_guid]; - } - SignalMapLock.EnterWriteLock(); - s.Value = new Value(v); - ModifiedSignals[signal_guid] = false; - SignalMapLock.ExitWriteLock(); - } - - public List CompileChanges() { - SignalMapLock.EnterWriteLock(); - List updatedSignals = new List(ModifiedSignals.Count); - ModifiedSignals.ForEach(x => updatedSignals.Add(new SignalData(SignalMap[x.Key]))); - ModifiedSignals.Clear(); - SignalMapLock.ExitWriteLock(); - return updatedSignals; - } - - } - -} - diff --git a/api/Api/DevelopmentTools/ProfilerMarker.cs b/api/Api/DevelopmentTools/ProfilerMarker.cs deleted file mode 100644 index 02ba0d1655..0000000000 --- a/api/Api/DevelopmentTools/ProfilerMarker.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace SynthesisAPI.DevelopmentTools -{ - public class ProfilerMarker - { - private DateTime _startTimestamp { get; set; } - - public ProfilerMarker() - { - _startTimestamp = DateTime.Now; - } - - public TimeSpan TimeSinceCreation => DateTime.Now.Subtract(_startTimestamp); - } -} diff --git a/api/Api/EnvironmentManager/Bundle.cs b/api/Api/EnvironmentManager/Bundle.cs deleted file mode 100644 index 2eca6876e8..0000000000 --- a/api/Api/EnvironmentManager/Bundle.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Collections.Generic; -using SynthesisAPI.Utilities; - -#nullable enable - -namespace SynthesisAPI.EnvironmentManager -{ - public class Bundle - { - public UniqueTypeList Components { get; private set; } - public List ChildBundles { get; private set; } - public Bundle? ParentBundle { get; private set; } - public Bundle() - { - Components = new UniqueTypeList(); - ChildBundles = new List(); - ParentBundle = null; - } - - public Bundle(Bundle parentBundle) { - Components = new UniqueTypeList(); - ChildBundles = new List(); - ParentBundle = parentBundle; - } - } -} diff --git a/api/Api/EnvironmentManager/Component.cs b/api/Api/EnvironmentManager/Component.cs deleted file mode 100644 index 4fa3a7027e..0000000000 --- a/api/Api/EnvironmentManager/Component.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace SynthesisAPI.EnvironmentManager -{ - public class Component - { - public Entity? Entity { get; private set; } = null; - - internal void SetEntity(Entity entity) - { - Entity = entity; - } - } -} \ No newline at end of file diff --git a/api/Api/EnvironmentManager/Components/AlwaysOnTop.cs b/api/Api/EnvironmentManager/Components/AlwaysOnTop.cs deleted file mode 100644 index 7bf21fb824..0000000000 --- a/api/Api/EnvironmentManager/Components/AlwaysOnTop.cs +++ /dev/null @@ -1,9 +0,0 @@ -using SynthesisAPI.Modules.Attributes; - -namespace SynthesisAPI.EnvironmentManager.Components -{ - // [BuiltIn] - public class AlwaysOnTop : Component - { - } -} diff --git a/api/Api/EnvironmentManager/Components/AudioSource.cs b/api/Api/EnvironmentManager/Components/AudioSource.cs deleted file mode 100644 index 6a903ec165..0000000000 --- a/api/Api/EnvironmentManager/Components/AudioSource.cs +++ /dev/null @@ -1,27 +0,0 @@ -using SynthesisAPI.AssetManager; -using System; - -namespace SynthesisAPI.EnvironmentManager.Components -{ - public class AudioSource : Component - { - internal Action LinkedSetter; - internal Func LinkedGetter; - - private void Set(string n, object o) => LinkedSetter(n, o); - private T Get(string n) => (T)LinkedGetter(n); - - public bool IsPlaying { - get => Get("isplaying"); - set => Set("isplaying", value); - } - public AudioClipAsset AudioClip { - set => Set("clip", value); - get => Get("clip"); - } - public float Volume { - set => Set("volume", value); - get => Get("volume"); - } - } -} diff --git a/api/Api/EnvironmentManager/Components/BundleMarker.cs b/api/Api/EnvironmentManager/Components/BundleMarker.cs deleted file mode 100644 index 5aa2914241..0000000000 --- a/api/Api/EnvironmentManager/Components/BundleMarker.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using SynthesisAPI.Modules.Attributes; - -#nullable enable - -namespace SynthesisAPI.EnvironmentManager.Components { - public class BundleMarker : Component { - public string Name { get; set; } - - public BundleMarker() { - Name = ""; - } - } -} diff --git a/api/Api/EnvironmentManager/Components/Camera.cs b/api/Api/EnvironmentManager/Components/Camera.cs deleted file mode 100644 index 586febf751..0000000000 --- a/api/Api/EnvironmentManager/Components/Camera.cs +++ /dev/null @@ -1,9 +0,0 @@ -using SynthesisAPI.Modules.Attributes; - -namespace SynthesisAPI.EnvironmentManager.Components -{ - public class Camera : Component - { - - } -} \ No newline at end of file diff --git a/api/Api/EnvironmentManager/Components/FixedJoint.cs b/api/Api/EnvironmentManager/Components/FixedJoint.cs deleted file mode 100644 index f98acdba3e..0000000000 --- a/api/Api/EnvironmentManager/Components/FixedJoint.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System; -using System.ComponentModel; -using System.Runtime.CompilerServices; -using MathNet.Spatial.Euclidean; - -#nullable enable - -namespace SynthesisAPI.EnvironmentManager.Components -{ - public class FixedJoint : IJoint - { - public event PropertyChangedEventHandler? PropertyChanged; - - protected void OnPropertyChanged([CallerMemberName] string? name = null) - { - if (name is null) - { - throw new ArgumentNullException(nameof(name)); - } - - PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); - } - - #region Properties - - internal Vector3D axis = new Vector3D(1, 0, 0); - public Vector3D Axis { - get => axis; - set { - axis = value; - OnPropertyChanged(); - } - } - internal Vector3D anchor = new Vector3D(0, 0, 0); - public Vector3D Anchor { - get => anchor; - set { - anchor = value; - OnPropertyChanged(); - } - } - internal Rigidbody? connectedParent = null; - public Rigidbody? ConnectedParent { - get => connectedParent; - set { - connectedParent = value; - OnPropertyChanged(); - } - } - internal Rigidbody? connectedChild = null; - public Rigidbody? ConnectedChild { - get => connectedChild; - set { - connectedChild = value; - OnPropertyChanged(); - } - } - internal float breakForce = float.PositiveInfinity; - public float BreakForce { - get => breakForce; - set { - breakForce = value < 0.0f ? 0.0f : value; - OnPropertyChanged(); - } - } - internal float breakTorque = float.PositiveInfinity; - public float BreakTorque { - get => breakTorque; - set { - breakTorque = value < 0.0f ? 0.0f : value; - OnPropertyChanged(); - } - } - internal bool enableCollision = false; - public bool EnableCollision { - get => enableCollision; - set { - enableCollision = value; - OnPropertyChanged(); - } - } - - #endregion - } -} diff --git a/api/Api/EnvironmentManager/Components/HingeJoint.cs b/api/Api/EnvironmentManager/Components/HingeJoint.cs deleted file mode 100644 index 7117be647b..0000000000 --- a/api/Api/EnvironmentManager/Components/HingeJoint.cs +++ /dev/null @@ -1,191 +0,0 @@ -using MathNet.Spatial.Euclidean; -using System.ComponentModel; -using System.Runtime.CompilerServices; - -#nullable enable - -namespace SynthesisAPI.EnvironmentManager.Components -{ - public class HingeJoint : IJoint - { - #region Properties - //TODO: Add parent and child body connections - - internal Vector3D anchor = new Vector3D(0, 0, 0); - public Vector3D Anchor { - get => anchor; - set { - anchor = value; - OnPropertyChanged(); - } - } - internal Vector3D axis = new Vector3D(1, 0, 0); - public Vector3D Axis { - get => axis; - set { - axis = value; - OnPropertyChanged(); - } - } - internal float breakForce = float.PositiveInfinity; - public float BreakForce { - get => breakForce; - set { - breakForce = value < 0.0f ? 0.0f : value; - OnPropertyChanged(); - } - } - internal float breakTorque = float.PositiveInfinity; - public float BreakTorque { - get => breakTorque; - set { - breakTorque = value < 0.0f ? 0.0f : value; - OnPropertyChanged(); - } - } - internal Rigidbody? connectedParent = null; - public Rigidbody? ConnectedParent { - get => connectedParent; - set { - connectedParent = value; - OnPropertyChanged(); - } - } - internal Rigidbody? connectedChild = null; - public Rigidbody? ConnectedChild { - get => connectedChild; - set { - connectedChild = value; - OnPropertyChanged(); - } - } - internal bool enableCollision = false; - public bool EnableCollision { - get => enableCollision; - set { - enableCollision = value; - OnPropertyChanged(); - } - } - internal bool useLimits = false; - public bool UseLimits { - get => useLimits; - set { - useLimits = value; - OnPropertyChanged(); - } - } - internal JointLimits limits = new JointLimits(); - public JointLimits Limits { - get => limits; - set { - limits = value; - OnPropertyChanged(); - } - } - internal float velocity = 0.0f; - public float Velocity { - get => velocity; - } - internal float angle = 0.0f; - public float Angle { - get => angle; - } - internal bool useMotor = false; - public bool UseMotor { - get => useMotor; - set { - useMotor = value; - OnPropertyChanged(); - } - } - internal JointMotor motor = new JointMotor(); - public JointMotor Motor { - get => motor; - set { - motor = value; - OnPropertyChanged(); - } - } - - public event PropertyChangedEventHandler? PropertyChanged; - - protected void OnPropertyChanged([CallerMemberName] string? name = null) - { - PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); - } - - #endregion - } - - #region Enums - - public enum ConfigurableJointMotion - { - Locked, - Limited, - Free - } - - #endregion - - public class JointLimits - { - private UnityEngine.JointLimits _container; - - public float Min { - get => _container.min; - set => _container.min = value; - } - public float Max { - get => _container.max; - set => _container.max = value; - } - public float Bounciness { - get => _container.bounciness; - set => _container.bounciness = value; - } - public float BounceMinVelocity { - get => _container.bounceMinVelocity; - set => _container.bounceMinVelocity = value; - } - public float ContactDistance { - get => _container.contactDistance; - set => _container.contactDistance = value; - } - - public JointLimits() - { - _container = new UnityEngine.JointLimits(); - } - - internal JointLimits(UnityEngine.JointLimits container) - { - _container = container; - } - - internal UnityEngine.JointLimits GetUnity() => _container; - } - - public class JointMotor - { - private UnityEngine.JointMotor _container; - - public float TargetVelocity { - get => _container.targetVelocity; - set => _container.targetVelocity = value; - } - public float Force { - get => _container.force; - set => _container.force = value; - } - public bool FreeSpin { - get => _container.freeSpin; - set => _container.freeSpin = value; - } - - public JointMotor() { _container = new UnityEngine.JointMotor(); } - internal JointMotor(UnityEngine.JointMotor container) { _container = container; } - internal UnityEngine.JointMotor GetUnity() => _container; - } -} diff --git a/api/Api/EnvironmentManager/Components/IJoint.cs b/api/Api/EnvironmentManager/Components/IJoint.cs deleted file mode 100644 index 2ce6206e5a..0000000000 --- a/api/Api/EnvironmentManager/Components/IJoint.cs +++ /dev/null @@ -1,14 +0,0 @@ -using MathNet.Spatial.Euclidean; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Runtime.CompilerServices; -using System.Text; - -namespace SynthesisAPI.EnvironmentManager.Components -{ - public interface IJoint { - public event PropertyChangedEventHandler PropertyChanged; - public Vector3D Anchor { get; set; } - } -} diff --git a/api/Api/EnvironmentManager/Components/Joints.cs b/api/Api/EnvironmentManager/Components/Joints.cs deleted file mode 100644 index 23eae0eeee..0000000000 --- a/api/Api/EnvironmentManager/Components/Joints.cs +++ /dev/null @@ -1,77 +0,0 @@ -using SynthesisAPI.Modules.Attributes; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Text; - -#nullable enable - -namespace SynthesisAPI.EnvironmentManager.Components -{ - /// - /// A container for Joints stored in an entity - /// - public class Joints : Component - { - private Guid _guid; - private static List _allJointContainers = new List(); - - public delegate void JointChanged(IJoint joint); - public static event JointChanged? GlobalAddJoint; - internal event JointChanged? AddJoint; - public static event JointChanged? GlobalRemoveJoint; - internal event JointChanged? RemoveJoint; - - private List _joints = new List(); - public List AllJoints { - get => _joints; - } - public static List GlobalAllJoints { - get { - var allJoints = new List(); - _allJointContainers.ForEach(x => allJoints.AddRange(x._joints)); - return allJoints; - } - } - - public float Count => _joints.Count; - - public Joints() { - _guid = Guid.NewGuid(); - _allJointContainers.Add(this); - } - - ~Joints() { - _allJointContainers.RemoveAll(x => Equals(x)); - } - - public void Add(IJoint joint) - { - _joints.Add(joint); - AddJoint?.Invoke(joint); - GlobalAddJoint?.Invoke(joint); - } - - public void Remove(IJoint joint) - { - _joints.RemoveAt(_joints.IndexOf(joint)); // Unsure if this will work because it doesn't have a HashCode or Equals function - RemoveJoint?.Invoke(joint); - GlobalRemoveJoint?.Invoke(joint); - } - - public IEnumerable GetJointsWhere(Func predicate) - { - return _joints.Where(predicate); - } - - public override bool Equals(object obj) { - if (!(obj is Joints)) - return false; - - return (obj as Joints)?.GetHashCode() == GetHashCode(); - } - public override int GetHashCode() => _guid.GetHashCode(); - } -} diff --git a/api/Api/EnvironmentManager/Components/Layer.cs b/api/Api/EnvironmentManager/Components/Layer.cs deleted file mode 100644 index d1b548b6bd..0000000000 --- a/api/Api/EnvironmentManager/Components/Layer.cs +++ /dev/null @@ -1,54 +0,0 @@ -#if false -using SynthesisAPI.Modules.Attributes; -using _UnityLayerMask = UnityEngine.LayerMask; - -namespace SynthesisAPI.EnvironmentManager.Components -{ - // [BuiltIn] - public class Layer : Component - { - internal int _layerMask; - internal string _layerName; - internal bool Changed { get; private set; } = true; - internal void ProcessedChanges() => Changed = false; - - /* - public static int GetMask(params string[] layerNames) - { - return _UnityLayerMask.GetMask(layerNames); - } - */ - public static string LayerToName(int layer) - { - return _UnityLayerMask.LayerToName(layer); - } - public static int NameToLayer(string layerName) - { - return _UnityLayerMask.NameToLayer(layerName); - } - - public int LayerMask - { - get => _layerMask; - set - { - _layerMask = value; - _layerName = LayerToName(_layerMask); - Changed = true; - } - } - - public string LayerName - { - get => _layerName; - set - { - _layerName = value; - _layerMask = NameToLayer(_layerName); - Changed = true; - } - } - } -} - -#endif \ No newline at end of file diff --git a/api/Api/EnvironmentManager/Components/Mesh.cs b/api/Api/EnvironmentManager/Components/Mesh.cs deleted file mode 100644 index 881e222bb3..0000000000 --- a/api/Api/EnvironmentManager/Components/Mesh.cs +++ /dev/null @@ -1,96 +0,0 @@ -using System.Collections.Generic; -using MathNet.Spatial.Euclidean; -using SynthesisAPI.Utilities; -using System.ComponentModel; -using System.Runtime.CompilerServices; - -#nullable enable - -namespace SynthesisAPI.EnvironmentManager.Components -{ - public class Mesh : Component - { - public Mesh() { } - - internal Mesh(UnityEngine.Mesh mesh) - { - Triangles = new List(mesh.triangles); - - foreach (var v in mesh.vertices) - Vertices.Add(v.Map()); - foreach (var u in mesh.uv) - UVs.Add(u.Map()); - } - - internal List _vertices = new List(); - internal List _uvs = new List(); - internal List _triangles = new List(); - internal (float r, float g, float b, float a) _color; - - public (float r, float g, float b, float a) Color { - get => _color; - set { - _color = value; - OnPropertyChanged(); - } - } - - public List Vertices - { - get => _vertices; - set { - _vertices = value; - OnPropertyChanged(); - } - } - public List UVs - { - get => _uvs; - set { - _uvs = value; - OnPropertyChanged(); - } - } - - public List Triangles - { - get => _triangles; - set { - _triangles = value; - OnPropertyChanged(); - } - } - - public void RecalculateNormals() => OnPropertyChanged(name: "recalculate"); - - internal static Mesh FromUnity(UnityEngine.Mesh mesh) => new Mesh(mesh); - internal UnityEngine.Mesh ToUnity() - { - UnityEngine.Mesh m = new UnityEngine.Mesh(); - var verts = new UnityEngine.Vector3[Vertices.Count]; - var uvs = new UnityEngine.Vector2[UVs.Count]; - var tris = Triangles.ToArray(); - - for (int i = 0; i < verts.Length; i++) - verts[i] = Vertices[i].Map(); - for (int i = 0; i < uvs.Length; i++) - uvs[i] = UVs[i].Map(); - - m.vertices = verts; - m.uv = uvs; - m.triangles = tris; - - return m; - } - - public bool Changed { get; private set; } - internal void ProcessedChanges() => Changed = false; - - public event PropertyChangedEventHandler? PropertyChanged; - - protected void OnPropertyChanged([CallerMemberName] string? name = null) - { - PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); - } - } -} \ No newline at end of file diff --git a/api/Api/EnvironmentManager/Components/MeshCollider.cs b/api/Api/EnvironmentManager/Components/MeshCollider.cs deleted file mode 100644 index 91b59a1757..0000000000 --- a/api/Api/EnvironmentManager/Components/MeshCollider.cs +++ /dev/null @@ -1,137 +0,0 @@ -using MathNet.Spatial.Euclidean; -using SynthesisAPI.Utilities; -using System.ComponentModel; -using System.Runtime.CompilerServices; - -#nullable enable - -namespace SynthesisAPI.EnvironmentManager.Components -{ - public class MeshCollider : Component - { - #region Properties - - public event PropertyChangedEventHandler? PropertyChanged; - - public class Collision - { - public readonly Vector3D Impulse; - public readonly Vector3D RelativeVelocity; - public readonly Entity? CollidingEntity; - internal Collision(Vector3D impulse, Vector3D relativeVelocity, Entity? collidingEntity) - { - Impulse = impulse; - RelativeVelocity = relativeVelocity; - CollidingEntity = collidingEntity; - } - } - - public delegate void CollisionHandler(Collision collision); - - public CollisionHandler? OnCollisionEnter; - public CollisionHandler? OnCollisionStay; - public CollisionHandler? OnCollisionExit; - - internal bool convex = true; - /// - /// This is just here so when it detects changes it will default this - /// - public bool Convex { - get => convex; - } - internal MeshColliderCookingOptions cookingOptions = MeshColliderCookingOptions.UseFastMidphase - | MeshColliderCookingOptions.CookForFasterSimulation | MeshColliderCookingOptions.EnableMeshCleaning - | MeshColliderCookingOptions.WeldColocatedVertices; - public MeshColliderCookingOptions CookingOptions { - get => cookingOptions; - set { - cookingOptions = value; - OnPropertyChanged(); - } - } - internal Mesh? sharedMesh = null; // If mesh is null, it will attempt to grab from the MeshAdapter - public Mesh? SharedMesh { - get => sharedMesh; - set { - sharedMesh = value; - OnPropertyChanged(); - } - } - internal PhysicsMaterial material = new PhysicsMaterial(); // TODO: Some default friction and bounce values? - public PhysicsMaterial Material { - get => material; - set { - material = value; - OnPropertyChanged(); - } - } - internal string collisionLayer = string.Empty; - public string CollisionLayer { - get => collisionLayer; - set { - collisionLayer = value; - OnPropertyChanged(); - } - } - - #endregion - - protected void OnPropertyChanged([CallerMemberName] string? name = null) - { - PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); - } - - } - - public enum MeshColliderCookingOptions - { - None = 0x0, CookForFasterSimulation = 0x2, EnableMeshCleaning = 0x4, - WeldColocatedVertices = 0x8, UseFastMidphase = 0x10 - } - - public enum PhysicMaterialCombine - { - Average = 0, - Minimum = 2, - Multiply = 1, - Maximum = 3 - } - - public class PhysicsMaterial - { - private UnityEngine.PhysicMaterial _container; - - public float Bounciness { - get => _container.bounciness; - set => _container.bounciness = value; - } - public float DynamicFriction { - get => _container.dynamicFriction; - set => _container.dynamicFriction = value; - } - public float StaticFriction { - get => _container.staticFriction; - set => _container.staticFriction = value; - } - public PhysicMaterialCombine FrictionCombine { - get => _container.frictionCombine.Convert(); - set => _container.frictionCombine = value.Convert(); - } - public PhysicMaterialCombine BounceCombine { - get => _container.bounceCombine.Convert(); - set => _container.bounceCombine = value.Convert(); - } - - public PhysicsMaterial() - { - _container = new UnityEngine.PhysicMaterial(); - } - - internal PhysicsMaterial(UnityEngine.PhysicMaterial container) - { - _container = container; - } - - internal UnityEngine.PhysicMaterial GetUnity() => _container; - } -} diff --git a/api/Api/EnvironmentManager/Components/MeshCollider2D.cs b/api/Api/EnvironmentManager/Components/MeshCollider2D.cs deleted file mode 100644 index 64b7e5a239..0000000000 --- a/api/Api/EnvironmentManager/Components/MeshCollider2D.cs +++ /dev/null @@ -1,30 +0,0 @@ -using SynthesisAPI.EnvironmentManager; -using SynthesisAPI.Utilities; - -#nullable enable - -namespace SynthesisAPI.EnvironmentManager.Components -{ - // [BuiltIn] - public class MeshCollider2D : Component - { - public delegate void EventDelegate(); - - public Mesh Mesh { get; internal set; } - public Bounds Bounds { get; internal set; } - public EventDelegate OnMouseDown; - public EventDelegate OnMouseUp; - - - public MeshCollider2D() - { - Mesh = new Mesh(); - Bounds = new Bounds(); - OnMouseDown = () => { }; - OnMouseUp = () => { }; - } - - public bool Changed { get; internal set; } = true; - internal void ProcessedChanges() => Changed = false; - } -} \ No newline at end of file diff --git a/api/Api/EnvironmentManager/Components/Parent.cs b/api/Api/EnvironmentManager/Components/Parent.cs deleted file mode 100644 index 4d4e927cd6..0000000000 --- a/api/Api/EnvironmentManager/Components/Parent.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.ComponentModel; -using System.Runtime.CompilerServices; - -#nullable enable - -namespace SynthesisAPI.EnvironmentManager.Components -{ - public class Parent : Component - { - public event PropertyChangedEventHandler? PropertyChanged; - - internal Entity parentEntity = 0; - public static implicit operator Entity(Parent p) => p.parentEntity; - //TODO wont set if entity does not exist - - public Entity ParentEntity { - get => parentEntity; - set { - parentEntity = value; - OnPropertyChanged(); - } - } - - public bool Changed { get; private set; } - internal void ProcessedChanges() => Changed = false; - - protected void OnPropertyChanged([CallerMemberName] string? name = null) - { - PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); - } - } -} diff --git a/api/Api/EnvironmentManager/Components/Rigidbody.cs b/api/Api/EnvironmentManager/Components/Rigidbody.cs deleted file mode 100644 index cdbdf1c017..0000000000 --- a/api/Api/EnvironmentManager/Components/Rigidbody.cs +++ /dev/null @@ -1,216 +0,0 @@ -using MathNet.Spatial.Euclidean; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Runtime.CompilerServices; - -#nullable enable - -namespace SynthesisAPI.EnvironmentManager.Components -{ - public class Rigidbody : Component - { - internal object? Adapter = null; - - #region Properties - - public delegate void CollisionFeedback(float magn); - public CollisionFeedback OnEnterCollision = m => { }; - - public event PropertyChangedEventHandler? PropertyChanged; - - public string ExportedJointUuid { get; set; } = string.Empty; - - internal bool useGravity = true; - public bool UseGravity { - get => useGravity; - set { - useGravity = value; - OnPropertyChanged(); - } - } - internal bool isKinematic = false; - /// - /// Essentially toggle for physics. When Kinematic physical forces won't apply to this body - /// - public bool IsKinematic { - get => isKinematic; - set { - isKinematic = value; - OnPropertyChanged(); - } - } - internal float mass = 1.0f; - /// - /// Mass of body in kilograms - /// - public float Mass { - get => mass; - set { - mass = value < 0.0001f ? 0.0001f : value; - OnPropertyChanged(); - } - } - internal Vector3D velocity = new Vector3D(0, 0, 0); - /// - /// Velocity of body in meters/second - /// - public Vector3D Velocity { - get => velocity; - set { - velocity = value; // TODO: Validate? - OnPropertyChanged(); - } - } - internal float drag = 0.0f; - /// - /// Linear drag coefficent of the body - /// - public float Drag { - get => drag; - set { - drag = value; // TODO: Validate? - OnPropertyChanged(); - } - } - internal Vector3D angularVelocity = new Vector3D(0, 0, 0); - /// - /// Angular velocity of the body in radians/second - /// - public Vector3D AngularVelocity { - get => angularVelocity; - set { - angularVelocity = value; // TODO: Validate? - OnPropertyChanged(); - } - } - internal float angularDrag = 0.05f; - /// - /// Angular drag coefficent of the body - /// - public float AngularDrag { - get => angularDrag; - set { - angularDrag = value; // TODO: Validate? - OnPropertyChanged(); - } - } - internal float maxAngularVelocity = 7.0f; - public float MaxAngularVelocity { - get => maxAngularVelocity; - set { - maxAngularVelocity = value > 0.0f ? value : 0.0f; - OnPropertyChanged(); - } - } - internal float maxDepenetrationVelocity = 30.0f; // I don't know what the default is - public float MaxDepenetrationVelocity { - get => maxDepenetrationVelocity; - set { - maxDepenetrationVelocity = value; // TODO: Validate? - OnPropertyChanged(); - } - } - internal CollisionDetectionMode collisionDetectionMode = CollisionDetectionMode.Discrete; - /// - /// - /// - public CollisionDetectionMode CollisionDetectionMode { - get => collisionDetectionMode; - set { - collisionDetectionMode = value; - OnPropertyChanged(); - } - } - internal RigidbodyConstraints constraints = RigidbodyConstraints.None; - public RigidbodyConstraints Constraints { - get => constraints; - set { - constraints = value; - OnPropertyChanged(); - } - } - internal bool detectCollisions = true; - public bool DetectCollisions - { - get => detectCollisions; - set - { - detectCollisions = value; - OnPropertyChanged(); - } - } - - #endregion - - internal List<(Vector3D Force, Vector3D Position, bool Relative, ForceMode Mode)> AdditionalForces - { get; private set; } = new List<(Vector3D Force, Vector3D Position, bool Relative, ForceMode Mode)>(); - internal List<(Vector3D Torque, bool Relative, ForceMode Mode)> AdditionalTorques - { get; private set; } = new List<(Vector3D Torque, bool Relative, ForceMode Mode)>(); - - /// - /// Add force to body - /// - /// Force in Newtons * DeltaT - /// - /// - public void AddForce(Vector3D force, bool relative = false, ForceMode mode = ForceMode.Force) - { - AdditionalForces.Add((force, Vector3D.NaN, relative, mode)); - Changed = true; - } - - public void AddForce(Vector3D force, Vector3D position, ForceMode mode = ForceMode.Force) - { - AdditionalForces.Add((force, position, false, mode)); - Changed = true; - } - - public void AddTorque(Vector3D torque, bool relative = false, ForceMode mode = ForceMode.Force) - { - AdditionalTorques.Add((torque, relative, mode)); - Changed = true; - } - - internal bool Changed { get; private set; } = true; - internal void ProcessedChanges() => Changed = false; - - private TResult ConvertEnum(object i) => (TResult)Enum.Parse(typeof(TResult), i.ToString(), true); - - protected void OnPropertyChanged([CallerMemberName] string? name = null) - { - PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); - } - } - - #region Enums - - public enum CollisionDetectionMode - { - Discrete, Continuous, ContinuousDynamic, - ContinuousSpeculative - } - - public enum ForceMode - { - Force = 0, Acceleration = 5, - Impulse = 1, VelocityChange = 2 - } - - [Flags] - public enum RigidbodyConstraints - { - None = 0, - FreezePositionX = 2, - FreezePositionY = 4, - FreezePositionZ = 8, - FreezeRotationX = 0x10, - FreezeRotationY = 0x20, - FreezeRotationZ = 0x40, - FreezePosition = 14, - FreezeRotation = 112, - FreezeAll = 126 - } - - #endregion -} diff --git a/api/Api/EnvironmentManager/Components/Selectable.cs b/api/Api/EnvironmentManager/Components/Selectable.cs deleted file mode 100644 index e4e20712fb..0000000000 --- a/api/Api/EnvironmentManager/Components/Selectable.cs +++ /dev/null @@ -1,76 +0,0 @@ -using SynthesisAPI.EventBus; - -#nullable enable - -namespace SynthesisAPI.EnvironmentManager.Components -{ - /// - /// Makes an entity mouse-selectable if it has a collider. If it does not have a collider, then - /// it uses its children's colliders to determine if it has been selected. - /// - public class Selectable : Component - { - /// - /// Unselected = Not clicked - /// Selected = Single clicked - /// ExtendedSelectionPending = Single clicked but may become double click - /// ExtendedSelection = Double clicked - /// - public enum SelectionType - { - Unselected, - Selected, - ExtendedSelectionPending, - ExtendedSelection - } - - public SelectionType State { get; private set; } - - public static Selectable? Selected { get; private set; } = null; - - public bool IsSelected => State != SelectionType.Unselected; - /// - /// If the selectable component is using its entity's collider or its' entity's childrens' colliders - /// - public bool UsingChildren { get; internal set; } - - public delegate void EventDelegate(); - - public EventDelegate OnSelect; - public EventDelegate OnDeselect; - - public Selectable() - { - UsingChildren = false; - State = SelectionType.Unselected; - OnSelect = () => { }; - OnDeselect = () => { }; - } - - public class SelectionChangeEvent: IEvent - { - public readonly Selectable? NewSelection; - public readonly Selectable? LastSelection; - - public SelectionChangeEvent(Selectable? newSelection, Selectable? lastSelection) - { - NewSelection = newSelection; - LastSelection = lastSelection; - } - } - - internal void SetSelected(SelectionType state) - { - State = state; - if (IsSelected) - { - Selected = this; - } - } - - public static void ResetSelected() - { - Selected = null; - } - } -} diff --git a/api/Api/EnvironmentManager/Components/Sprite.cs b/api/Api/EnvironmentManager/Components/Sprite.cs deleted file mode 100644 index 3c90f4435b..0000000000 --- a/api/Api/EnvironmentManager/Components/Sprite.cs +++ /dev/null @@ -1,77 +0,0 @@ -using SynthesisAPI.AssetManager; -using SynthesisAPI.Utilities; -using System.Drawing; - -#nullable enable - -namespace SynthesisAPI.EnvironmentManager.Components -{ - // [BuiltIn] - public class Sprite : Component - { - internal UnityEngine.Sprite? _sprite; - internal bool _flipX = false; - internal bool _flipY = false; - internal Color _color = Color.FromArgb(255, 255, 255, 255); - internal bool _visible = true; - - public Sprite() { } - - public Sprite(SpriteAsset spriteAsset) - { - _sprite = spriteAsset.Sprite; - } - - public void SetSprite(SpriteAsset spriteAsset) - { - _sprite = spriteAsset.Sprite; - Changed = true; - } - - public bool FlipX - { - get => _flipX; - set - { - _flipX = value; - Changed = true; - } - } - public bool FlipY - { - get => _flipY; - set - { - _flipY = value; - Changed = true; - } - } - - public bool Visible - { - get => _visible; - set - { - _visible = value; - Changed = true; - } - } - - public Color Color - { - get => _color; - set - { - _color = value; - Changed = true; - } - } - - public Bounds Bounds { get; internal set; } = new Bounds(); - public int Width => _sprite != null ? 0 : _sprite!.texture.width; - public int Height => _sprite != null ? 0 : _sprite!.texture.height; - - public bool Changed { get; private set; } = true; - internal void ProcessedChanges() => Changed = false; - } -} \ No newline at end of file diff --git a/api/Api/EnvironmentManager/Components/Transform.cs b/api/Api/EnvironmentManager/Components/Transform.cs deleted file mode 100644 index d6106e4ab3..0000000000 --- a/api/Api/EnvironmentManager/Components/Transform.cs +++ /dev/null @@ -1,126 +0,0 @@ -using System.ComponentModel; -using System.Runtime.CompilerServices; -using MathNet.Spatial.Euclidean; -using MathNet.Spatial.Units; -using SynthesisAPI.Utilities; - -#nullable enable - -namespace SynthesisAPI.EnvironmentManager.Components -{ - public class Transform : Component - { - public UnitVector3D Forward => MathUtil.QuaternionToForwardVector(Rotation); - - public delegate Vector3D PositionValidatorDelegate(Vector3D position); - public delegate Quaternion RotationValidatorDelegate(Quaternion rotation); - public delegate Vector3D ScaleValidatorDelegate(Vector3D scale); - - public PositionValidatorDelegate PositionValidator = (Vector3D position) => position; - public RotationValidatorDelegate RotationValidator = (Quaternion rotation) => rotation.Normalized; - public ScaleValidatorDelegate ScaleValidator = (Vector3D scale) => scale; - - public event PropertyChangedEventHandler? PropertyChanged; - - internal Vector3D position = new Vector3D(0, 0, 0); - public Vector3D Position - { - get => position; - set { - position = PositionValidator(value); - OnPropertyChanged(); - } - } - - internal Vector3D globalPosition = new Vector3D(0, 0, 0); - public Vector3D GlobalPosition - { - get => globalPosition; - set - { - globalPosition = PositionValidator(value); - OnPropertyChanged(); - } - } - - internal Quaternion rotation = new Quaternion(1, 0, 0, 0); - public Quaternion Rotation - { - get => rotation; - set - { - // if (!value.IsUnitQuaternion) - // Logger.Log($"Warning: assigning rotation to non-unit quaternion {value}", LogLevel.Warning); - rotation = RotationValidator(value); - OnPropertyChanged(); - } - } - internal Quaternion globalRotation = new Quaternion(1, 0, 0, 0); - public Quaternion GlobalRotation - { - get => globalRotation; - set - { - globalRotation = RotationValidator(value); - OnPropertyChanged(); - } - } - - internal Vector3D scale = new Vector3D(1, 1, 1); - public Vector3D Scale - { - get => scale; - set { - scale = ScaleValidator(value); - OnPropertyChanged(); - } - } - - public void Rotate(UnitVector3D axis, double angle, bool useWorldAxis = false) - { - Rotation = MathUtil.Rotate(Rotation, axis, angle, useWorldAxis); - } - - public void Rotate(UnitVector3D axis, Angle angle, bool useWorldAxis = false) - { - Rotation = MathUtil.Rotate(Rotation, axis, angle, useWorldAxis); - } - - public void Rotate(Vector3D eulerAngles) - { - Rotation = MathUtil.Rotate(Rotation, eulerAngles); - } - - public void Rotate(EulerAngles eulerAngles) - { - Rotation = MathUtil.Rotate(Rotation, eulerAngles); - } - - public void Rotate(Quaternion rotation) - { - Rotation = MathUtil.Rotate(Rotation, rotation); - } - - public void Translate(Vector3D v) - { - Position += v; - } - - public void LookAt(Vector3D targetPosition) - { - Rotation = MathUtil.LookAt((targetPosition - Position).Normalize()); - } - public void LookAt(Vector3D targetPosition, UnitVector3D upward) - { - Rotation = MathUtil.LookAt((targetPosition - Position).Normalize(), upward); - } - - protected void OnPropertyChanged([CallerMemberName] string? name = null) - { - PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); - } - - internal bool Changed { get; private set; } = true; - internal void ProcessedChanges() => Changed = false; - } -} \ No newline at end of file diff --git a/api/Api/EnvironmentManager/Entity.cs b/api/Api/EnvironmentManager/Entity.cs deleted file mode 100644 index 7578b44cc9..0000000000 --- a/api/Api/EnvironmentManager/Entity.cs +++ /dev/null @@ -1,75 +0,0 @@ -using System; -using SynthesisAPI.EnvironmentManager.Components; - -namespace SynthesisAPI.EnvironmentManager -{ - /// - /// Entity is a 32 bit generational index - /// 1st 16 bits represent index - /// 2nd 16 bits represent generation - /// - public struct Entity - { - private UInt32 _value; - - public static implicit operator Entity(UInt32 value) => new Entity{ _value = value }; - - public static implicit operator Entity(Int32 value) => new Entity { _value = (UInt32)value }; - - public static implicit operator UInt32(Entity e) => e._value; - - #region EntityBitModifier - - //first 16 bits - public ushort Index { get => (ushort)(_value >> 16); } - - //last 16 bits - public ushort Gen { get => (ushort)(_value & 65535); } - - public static Entity Create(ushort index, ushort gen) - { - return ((uint)index << 16) + gen; - } - public Entity SetIndex(ushort index) - { - return ((uint)index << 16) + (_value & 65535); - } - public Entity SetGen(ushort gen) - { - return (_value & 4294901760) + gen; - } - - #endregion - - public override string ToString() => _value.ToString(); - - public override bool Equals(object obj) => Equals((Entity)obj); - - public bool Equals(Entity e) => _value == e._value; - - public bool Equals(UInt32 e) => _value == e; - - public bool Equals(int e) => _value == e; - - public override int GetHashCode() - { - return _value.GetHashCode(); - } - - public static bool operator ==(Entity lhs, Entity rhs) - { - return lhs._value == rhs._value; - } - - public static bool operator !=(Entity lhs, Entity rhs) - { - return !(lhs == rhs); - } - } - - public static class EntityExtensions - { - public static bool Equals(this UInt32 i, Entity e) => i == (UInt32)e; - public static bool Equals(this int i, Entity e) => i == (UInt32)e; - } -} diff --git a/api/Api/EnvironmentManager/EnvironmentManager.cs b/api/Api/EnvironmentManager/EnvironmentManager.cs deleted file mode 100644 index 37297f7ce0..0000000000 --- a/api/Api/EnvironmentManager/EnvironmentManager.cs +++ /dev/null @@ -1,216 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using SynthesisAPI.EnvironmentManager.Components; -using SynthesisAPI.Modules; -using SynthesisAPI.Runtime; -using SynthesisAPI.Utilities; -using UnityEngine.PlayerLoop; - -#nullable enable - -namespace SynthesisAPI.EnvironmentManager -{ - /// - /// ECS System - /// - public static class EnvironmentManager - { - private static AnyMap components = new AnyMap(); //dynamic mapping of components to Entity by index - private static List entities = new List(); //Entities that are in environment - private static Stack removed = new Stack(); //deallocated Entities that still exist in entities null Entities - - private static readonly Entity NULL_ENTITY = 0; - private const ushort BASE_GEN = 1; //no entity should have a generation of 0 - - - #region EntityManagement - - /// - /// Create and allocate new entity - /// - /// new Entity - public static Entity AddEntity() - { - Entity newEntity; - if (removed.Count > 0) //allocates empty/deallocated spaces in entities - { - Entity oldEntity = removed.Pop(); - ushort oldEntityIndex = oldEntity.Index; - ushort oldEntityGen = oldEntity.Gen; - newEntity = oldEntity.SetGen((ushort)(oldEntityGen + 1)); - ApiProvider.AddEntityToScene(newEntity); - entities[oldEntityIndex] = newEntity; - } - else //adds entity by increasing entity list size - { - newEntity = Entity.Create((ushort)entities.Count, BASE_GEN); - ApiProvider.AddEntityToScene(newEntity); - entities.Add(newEntity); - } - newEntity.AddComponent(); - return newEntity; - } - - /// - /// Remove and deallocate entity - /// - /// entity to be removed - /// if entity was removed - will only return false if entity does not exist/is not allocated - public static bool RemoveEntity(this Entity entity) - { - if (!EntityExists(entity)) - return false; - ApiProvider.RemoveEntityFromScene(entity); - removed.Push(entity); //deallocate entity - entities[entity.Index] = NULL_ENTITY; //invalidate components - return true; - } - - /// - /// Check if entity exists in current context - /// - /// entity to be checked - /// if entity equals the entity in its given index - public static bool EntityExists(this Entity entity) - { - ushort entityIndex = entity.Index; - return entityIndex < entities.Count && entities[entityIndex] == entity; - } - - - public static IEnumerable GetEntitiesWhere(Func predicate) - { - return entities.Where(predicate); - } - - #endregion - - #region ComponentManagement - - /// - /// Get component of type, TComponent, that is associated with the given entity - /// - /// Component type - /// given entity - /// Component instance - public static TComponent? GetComponent(this Entity entity) where TComponent : Component - { - return (TComponent?) GetComponent(entity, typeof(TComponent)); - } - - public static Component? GetComponent(this Entity entity, Type componentType) - { - if (IsComponent(componentType) && EntityExists(entity)) - return components.Get(entity.Index, entity.Gen, componentType); - return null; - } - - public static List? GetComponents(this Entity entity) => components.GetAll(entity.Index, entity.Gen); - - /// - /// Set component of type, TComponent, to the given entity - /// - /// given entity - /// instance of component to be set - public static Component? AddComponent(this Entity entity, Type componentType) - { - if (IsComponent(componentType) && EntityExists(entity)) - { - Component? c = ApiProvider.AddComponentToScene(entity, componentType); - if (c == null) - throw new SynthesisException($"Failed to add component of type {componentType.FullName} to entity"); - components.Set(entity.Index, entity.Gen, c); - return c; - } - return null; - } - - public static TComponent? AddComponent(this Entity entity) where TComponent : Component - { - return (TComponent?) AddComponent(entity, typeof(TComponent)); - } - - private static void AddComponent(this Entity entity, TComponent component) where TComponent : Component - { - if (EntityExists(entity)) - { - ApiProvider.AddComponentToScene(entity, component); - components.Set(entity.Index, entity.Gen, component); - } - } - - - /// - /// Remove component (sets component to null) of type, TComponent, from given entity - /// - /// Component Type - /// given entity - public static void RemoveComponent(this Entity entity) where TComponent : Component - { - RemoveComponent(entity, typeof(TComponent)); - } - - public static void RemoveComponent(this Entity entity, Type componentType) - { - if (IsComponent(componentType) && EntityExists(entity)) - { - ApiProvider.RemoveComponentFromScene(entity, componentType); - components.Remove(entity.Index, entity.Gen, componentType); - } - } - - private static bool IsComponent(Type type) - { - return type.IsSubclassOf(typeof(Component)) || type == typeof(Component); - } - - public static IEnumerable GetComponentsWhere(Func predicate) where TComponent : Component - { - List result = new List(); - foreach (var e in entities) - { - foreach (var c in components.GetAll(e.Index, e.Gen) ?? new List()) - { - if (c is TComponent tc && predicate(tc)) - { - result.Add(tc); - } - } - - } - return result; - } - - public static void AddBundle(this Entity entity, Bundle bundle) - { - if (EntityExists(entity)){ - foreach (Bundle b in bundle.ChildBundles) - { - Entity e = AddEntity(); - e.GetComponent()!.ParentEntity = entity; - e.AddBundle(b); - } - foreach (Component c in bundle.Components) - entity.AddComponent(c); - } - } - - #endregion - - public static void Clear() - { - if (AppDomain.CurrentDomain.GetAssemblies() - .Any(a => a.FullName.ToLowerInvariant().StartsWith("nunit.framework"))) - { - components.Clear(); - entities.Clear(); - removed.Clear(); - } - else - { - throw new Exception("Users are not allowed to clear the environment manager"); - } - } - } -} \ No newline at end of file diff --git a/api/Api/EnvironmentManager/IControllable.cs b/api/Api/EnvironmentManager/IControllable.cs deleted file mode 100644 index 603c0115e6..0000000000 --- a/api/Api/EnvironmentManager/IControllable.cs +++ /dev/null @@ -1,12 +0,0 @@ -using SynthesisAPI.EnvironmentManager; -using System; -using System.Collections.Generic; -using System.Text; - -namespace SynthesisAPI.EnvironmentManager -{ - public interface IControllable - { - - } -} diff --git a/api/Api/EnvironmentManager/SystemBase.cs b/api/Api/EnvironmentManager/SystemBase.cs deleted file mode 100644 index d986880709..0000000000 --- a/api/Api/EnvironmentManager/SystemBase.cs +++ /dev/null @@ -1,35 +0,0 @@ -namespace SynthesisAPI.EnvironmentManager -{ - public abstract class SystemBase : Component - { - /// - /// Called once to setup the SystemBase - /// - public abstract void Setup(); - - /// - /// Called on frame update - /// - public abstract void OnUpdate(); - - /// - /// Called on physics update - /// - public abstract void OnPhysicsUpdate(); - - public virtual void OnGUI() - { - - } - - public virtual void OnKeyPress(string kc) - { - - } - - /// - /// Called once to teardown the SystemBase - /// - public abstract void Teardown(); - } -} \ No newline at end of file diff --git a/api/Api/EnvironmentManager/Time.cs b/api/Api/EnvironmentManager/Time.cs deleted file mode 100644 index 27ab443991..0000000000 --- a/api/Api/EnvironmentManager/Time.cs +++ /dev/null @@ -1,19 +0,0 @@ -using UnityTime = UnityEngine.Time; - -namespace SynthesisAPI.EnvironmentManager -{ - public static class Time - { - public static float TimeSinceStartup => UnityTime.fixedTime; - public static float RealTimeSinceStartup => UnityTime.realtimeSinceStartup; - public static float TimeScale - { - get => UnityTime.timeScale; - set => UnityTime.timeScale = value; - } - public static float TimeSinceLastFrameUpdate => UnityTime.deltaTime; - public static float TimeSinceLastPhysicsUpdate => UnityTime.fixedDeltaTime; - - public static float TimeMilliseconds => (UnityTime.time); - } -} diff --git a/api/Api/EventBus/Analytics.cs b/api/Api/EventBus/Analytics.cs deleted file mode 100644 index 8530f7bca2..0000000000 --- a/api/Api/EventBus/Analytics.cs +++ /dev/null @@ -1,536 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Net; -using System.Threading; -using System.Threading.Tasks; - -#nullable enable - -namespace SynthesisAPI.EventBus -{ - public static class Analytics - { - private const string URL_COLLECT = "https://www.google-analytics.com/collect"; - private const string URL_BATCH = "https://www.google-analytics.com/batch"; - public const string OFFICIAL_TRACKING_ID = "UA-81892961-7"; // actual analytics tracking - //private const string TESTING_ID = "UA-81892961-3"; // test project id - public static string GUID { get; private set; } = "not-set"; - public static bool DataCollection { get; private set; } = true; - - - /// - /// Sets client ID and data preferences - /// - /// Client ID (For Synthesis use Unity GUID) - /// Boolean value, is true if user has agreed to share data - public static void SetUnityPrefs(String unityGuid, bool dataPref) - { - GUID = unityGuid; - DataCollection = dataPref; - } - - /// - /// Stores the start time of a timing event - /// - /// Label corresponding to timing event - /// Variable corresponding to timing event - /// Start time in seconds - public static void StartTime(string label, string variable, float time) - { - StartTimes.Add(new KeyValuePair(label + "|" + variable, time)); - } - - /// - /// Returns time elapsed between start and end of a timing event - /// - /// Label corresponding to timing event - /// Variable corresponding to timing event - /// End time in seconds - public static float GetElapsedTime(string label, string variable, float time) - { - float a = StartTimes.Find(x => x.Key.Equals(label + "|" + variable)).Value; - return (time - a) * 1000; - } - - /// - /// Removes start time of a timing event - /// - /// Label corresponding to timing event - /// Variable corresponding to timing event - public static void RemoveTime(string label, string variable) - { - StartTimes.Remove(StartTimes.Find(x => x.Key.Equals(label + "|" + variable))); - } - - /// - /// Logs an event locally - /// - /// The category the event should be reported under in Google Analytics - /// The action the event should be reported under in Google Analytics - /// The label the event should be reported under in Google Analytics, null if not applicable - /// The value the event should be reported with in Google Analytics, null if not applicable - public static void LogEvent(string category, string action, string label, int value) - { - LoggedData.Enqueue(new KeyValuePair("v", "1")); - LoggedData.Enqueue(new KeyValuePair("tid", OFFICIAL_TRACKING_ID)); - LoggedData.Enqueue(new KeyValuePair("cid", GUID)); - LoggedData.Enqueue(new KeyValuePair("t", "event")); - LoggedData.Enqueue(new KeyValuePair("ec", category)); - LoggedData.Enqueue(new KeyValuePair("ea", action)); - if (label != null) LoggedData.Enqueue(new KeyValuePair("el", label)); - LoggedData.Enqueue(new KeyValuePair("ev", value.ToString())); - LoggedData.Enqueue(new KeyValuePair("NEW", "")); - } - - /// - /// Logs a screenview locally - /// - /// The name of the screen as it should be reported in Google Analytics - public static void LogScreenView(string screenName) - { - LoggedData.Enqueue(new KeyValuePair("v", "1")); - LoggedData.Enqueue(new KeyValuePair("tid", OFFICIAL_TRACKING_ID)); - LoggedData.Enqueue(new KeyValuePair("cid", GUID)); - LoggedData.Enqueue(new KeyValuePair("t", "screenview")); - LoggedData.Enqueue(new KeyValuePair("an", "synthesis")); - LoggedData.Enqueue(new KeyValuePair("cd", screenName)); - LoggedData.Enqueue(new KeyValuePair("NEW", "")); - } - - /// - /// Logs a timing event locally given an ending time if the start time was - /// recorded earlier using the StartTime method - /// - /// The category the event should be reported under in Google Analytics - /// The action the event should be reported with in Google Analytics - /// The label the event should be reported under in Google Analytics, null if not applicable - /// The time the event ended in seconds - public static void LogElapsedTime(string category, string variable, string label, float time) - { - int milli = (int)GetElapsedTime(label, variable, time); - RemoveTime(label, variable); - LogTiming(category, variable, label, milli); - } - - /// - /// Logs a timing event locally given an integer value for the - /// duration of the event in milliseconds - /// - /// The category the event should be reported under in Google Analytics - /// The variable the event should be reported with in Google Analytics - /// The label the event should be reported under in Google Analytics, null if not applicable - /// The duration of the event in milliseconds - public static void LogTiming(string category, string variable, string label, int time) - { - LoggedData.Enqueue(new KeyValuePair("v", "1")); - LoggedData.Enqueue(new KeyValuePair("tid", OFFICIAL_TRACKING_ID)); - LoggedData.Enqueue(new KeyValuePair("cid", GUID)); - LoggedData.Enqueue(new KeyValuePair("t", "timing")); - LoggedData.Enqueue(new KeyValuePair("utc", category)); - LoggedData.Enqueue(new KeyValuePair("utv", variable)); - LoggedData.Enqueue(new KeyValuePair("utt", time.ToString())); - LoggedData.Enqueue(new KeyValuePair("utl", label)); - LoggedData.Enqueue(new KeyValuePair("NEW", "")); - } - - /// - /// Pushes local data to the Google Analytics server - /// - public static void UploadDump() - { - if (LoggedData.Count < 1 || !DataCollection) - { - Console.WriteLine("Clearing log"); - LoggedData.Clear(); - return; - } - - string data = ""; - - Queue> loggedCopy = new Queue>(LoggedData); - LoggedData.Clear(); - - bool batchSend = false; - bool lastEnd = false; - while (loggedCopy.Count > 0) - { - KeyValuePair pair = loggedCopy.Dequeue(); - if (pair.Key != null) - { - if (pair.Key.Equals("NEW")) - { - data += "\n"; - batchSend = true; - lastEnd = true; - } - else - { - if ((data != "") && !lastEnd) data += "&"; - - data += pair.Key + "=" + pair.Value; - lastEnd = false; - } - } - - } - - string result; - - try - { - if (batchSend) - { - Console.WriteLine("Posting"); - result = client.UploadString(URL_BATCH, data); - Console.WriteLine(data); - Console.WriteLine("Server response" + result); - } - else - { - Console.WriteLine("Collecting"); - result = client.UploadString(URL_COLLECT, "POST", data); - Console.WriteLine(data); - Console.WriteLine("Server response" + result); - } - } - catch (Exception e) - { - Console.WriteLine("Error: " + e.ToString()); - } - } - - - #region AsyncMethods - - /// - /// Creates an asynchronous task to log an event locally - /// - /// The category the event should be reported under in Google Analytics - /// The action the event should be reported under in Google Analytics - /// The label the event should be reported under in Google Analytics, null if not applicable - /// The value the event should be reported with in Google Analytics, null if not applicable - /// Task that can be run asynchronously to log the event - public static Task LogEventAsync(string category, string action, string label, int value) - { - return Task.Factory.StartNew(() => - { - mutex.WaitOne(); - LoggedData.Enqueue(new KeyValuePair("v", "1")); - LoggedData.Enqueue(new KeyValuePair("tid", OFFICIAL_TRACKING_ID)); - LoggedData.Enqueue(new KeyValuePair("cid", GUID)); - LoggedData.Enqueue(new KeyValuePair("t", "event")); - LoggedData.Enqueue(new KeyValuePair("ec", category)); - LoggedData.Enqueue(new KeyValuePair("ea", action)); - if (label != null) LoggedData.Enqueue(new KeyValuePair("el", label)); - LoggedData.Enqueue(new KeyValuePair("ev", value.ToString())); - LoggedData.Enqueue(new KeyValuePair("NEW", "")); - mutex.ReleaseMutex(); - }); - } - - /// - /// Creates an asynchronous task to log a screenview locally - /// - /// The name of the screen as it should be reported in Google Analytics - /// Task that can be run asynchronously to log the screenview - public static Task LogScreenViewAsync(string screenName) - { - return Task.Factory.StartNew(() => - { - mutex.WaitOne(); - LoggedData.Enqueue(new KeyValuePair("v", "1")); - LoggedData.Enqueue(new KeyValuePair("tid", OFFICIAL_TRACKING_ID)); - LoggedData.Enqueue(new KeyValuePair("cid", GUID)); - LoggedData.Enqueue(new KeyValuePair("t", "screenview")); - LoggedData.Enqueue(new KeyValuePair("an", "synthesis")); - LoggedData.Enqueue(new KeyValuePair("cd", screenName)); - LoggedData.Enqueue(new KeyValuePair("NEW", "")); - mutex.ReleaseMutex(); - }); - } - - /// - /// Creates an asynchronous task to log a timing event locally given an ending time - /// if the start time was recorded earlier using the StartTime method - /// - /// The category the event should be reported under in Google Analytics - /// The action the event should be reported with in Google Analytics - /// The label the event should be reported under in Google Analytics, null if not applicable - /// The time the event ended in seconds - /// Task that can be run asynchronously to log the timing event - public static Task LogElapsedTimeAsync(string category, string variable, string label, float currentTime) - { - int milli = (int)GetElapsedTime(label, variable, currentTime); - RemoveTime(label, variable); - return LogTimingAsync(category, variable, label, milli); - } - - /// - /// Creates an asynchronous task to log a timing event locally given an integer value - /// for the duration of the event in milliseconds - /// - /// The category the event should be reported under in Google Analytics - /// The variable the event should be reported with in Google Analytics - /// The label the event should be reported under in Google Analytics, null if not applicable - /// The duration of the event in milliseconds - /// Task that can be run asynchronously to log the timing event - - public static Task LogTimingAsync(string category, string variable, string label, int time) - { - return Task.Factory.StartNew(() => - { - mutex.WaitOne(); - LoggedData.Enqueue(new KeyValuePair("v", "1")); - LoggedData.Enqueue(new KeyValuePair("tid", OFFICIAL_TRACKING_ID)); - LoggedData.Enqueue(new KeyValuePair("cid", GUID)); - LoggedData.Enqueue(new KeyValuePair("t", "timing")); - LoggedData.Enqueue(new KeyValuePair("utc", category)); - LoggedData.Enqueue(new KeyValuePair("utv", variable)); - LoggedData.Enqueue(new KeyValuePair("utt", time.ToString())); - LoggedData.Enqueue(new KeyValuePair("utl", label)); - LoggedData.Enqueue(new KeyValuePair("NEW", "")); - mutex.ReleaseMutex(); - }); - } - - /// - /// Creates a task to push local data to the Google Analytics server asynchronously - /// - /// Task that can be run asynchronously to log the timing event - public static Task UploadDumpAsync() - { - return Task.Factory.StartNew(() => - { - mutex.WaitOne(); - if (LoggedData.Count < 1 || !DataCollection) - { - Console.WriteLine("Clearing log"); - LoggedData.Clear(); - mutex.ReleaseMutex(); - return; - } - - string data = ""; - - Queue> loggedCopy = new Queue>(LoggedData); - LoggedData.Clear(); - mutex.ReleaseMutex(); - - bool batchSend = false; - bool lastEnd = false; - while (loggedCopy.Count > 0) - { - KeyValuePair pair = loggedCopy.Dequeue(); - if (pair.Key != null) - { - if (pair.Key.Equals("NEW")) - { - data += "\n"; - batchSend = true; - lastEnd = true; - } - else - { - if ((data != "") && !lastEnd) data += "&"; - - data += pair.Key + "=" + pair.Value; - lastEnd = false; - } - } - - } - - string result; - - try - { - if (batchSend) - { - Console.WriteLine("Posting"); - result = client.UploadString(URL_BATCH, data); - Console.WriteLine(data); - Console.WriteLine("Server response" + result); - } - else - { - Console.WriteLine("Collecting"); - result = client.UploadString(URL_COLLECT, "POST", data); - Console.WriteLine(data); - Console.WriteLine("Server response" + result); - } - } - catch (Exception e) - { - Console.WriteLine("Error: " + e.ToString()); - } - }); - } - - #endregion - - /// - /// Closes mutex, kills any async tasks that have not already completed - /// - public static void CleanUp() - { - mutex.Close(); - } - - /// - /// Categories group multiple objects together. Each main category is grouped by the tabs - /// in the simulator. Most events will fall into one of the tab categories (e.g. Engine or Entity tab.) - /// - public static class EventCategory - { - public const string - // Start of analytics tracking - MainSimulator = "Main Simulator", - - // Toolbars - EngineToolbar = "Engine Toolbar", - EntityToolbar = "Entity Toolbar", - - // Exporter analytics - ExporterType = "Exported Generator", // determines if model is from Fusion or Inventor - ExporterVersion = "Exporter Version", // export version? - - // Help and tutorials remain their own category based on the importance of tracking users utilizing these assets - Help = "Help Panel", - Tutorials = "Tutorials", - Versioning = "Synthesis Version", - - // Global categories - AddRobot = "Add Robot", - ChangeRobot = "Change Robot", - LoadRobot = "Load Robot", - ChangeField = "Change Field", - Reset = "Reset", - CameraView = "Camera View"; - } - - /// - /// Actions for user behaviors - /// - public static class EventAction - { - public const string - - StartSim = "Started Simulator", - TutorialRequest = "Requested Tutorial", - BackedOut = "Back", - Next = "Next", - Clicked = "Clicked", - Added = "Added", - Removed = "Removed", - Edited = "Edited", - Toggled = "Toggled", - Viewed = "Viewed", - Load = "Load", - Exit = "Exit", - Changed = "Changed"; - } - - /// - /// Name of the screen the user is on - /// - public static class ScreenName - { - public const string - MainSimMenu = "simMenu", - MixAndMatchMenu = "mixMenu", - MultiplayerMenu = "multiplayerMenu", - MainSimulator = "mainSimulator", - MixAndMatchSimulator = "mixSimulator", - MultiplayerSimulator = "multiplayerSimulator"; - } - - /// - /// Similar to event categories, timing categories organize objects - /// into various groups. - /// - public static class TimingCategory - { - public const string - EngineTab = "Engine Tab", - EntityTab = "Entity Tab", - - Main = "Main Menu", - MixMatch = "Mix and Match", - Multiplater = "Multiplayer", - - MainSimulator = "In Simulator", - MenuTab = "Menu Tab", - HomeTab = "Home Tab", - DPMTab = "Gamepiece Tab", - ScoringTab = "Scoring Tab", - SensorTab = "Sensor Tab", - EmulationTab = "Emulation Tab", - Tab = "Toolbar Tab"; - } - - /// - /// Actions for timing events - /// a - public static class TimingVariable - { - public const string - Loading = "Loading", - Interacting = "Interacting", - Customizing = "Customizing", - Viewing = "Viewing", - Starting = "Starting"; - } - - /// - /// Additional information to expand on the timing categories. - /// - public static class TimingLabel - { - public const string - EngineTab = "Engine Tab", - EntityTab = "Entity Tab", - - MixAndMatchMenu = "Mix and Match Menu", - MainSimMenu = "Main Menu", - MultiplayerLobbyMenu = "Multiplayer Lobby Menu", - - MainSimulator = "Main Simulator", - ResetField = "Reset Field", - ChangeField = "Change Field", - MixAndMatch = "Mix and Match Mode", - ReplayMode = "Replay Mode", - - HomeTab = "Home Tab", - DPMTab = "Gamepiece Tab", - ScoringTab = "Scoring Tab", - SensorTab = "Sensor Tab", - EmulationTab = "Emulation Tab"; - } - - private class Inner - { - - - public Mutex mutex; - public WebClient client; - public Queue> LoggedData; - public List> StartTimes; - - private Inner() - { - mutex = new Mutex(); - client = new WebClient(); - LoggedData = new Queue>(); - StartTimes = new List>(); - } - - private static Inner? _inst; - public static Inner InnerInstance => _inst ??= new Inner(); - } - private static Queue> LoggedData => Instance.LoggedData; - private static List> StartTimes => Instance.StartTimes; - private static WebClient client => Instance.client; - private static Mutex mutex => Instance.mutex; - private static Inner Instance => Inner.InnerInstance; - } -} \ No newline at end of file diff --git a/api/Api/EventBus/EventBus.cs b/api/Api/EventBus/EventBus.cs deleted file mode 100644 index 54ca9dbbb6..0000000000 --- a/api/Api/EventBus/EventBus.cs +++ /dev/null @@ -1,208 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -namespace SynthesisAPI.EventBus -{ - public static class EventBus - { - public delegate void EventCallback(IEvent eventInfo); - - /// - /// Activates all callback functions that are listening to a particular - /// IEvent type and passes event information to those functions - /// - /// Type of event - /// Event to be passed to callback functions - /// True if message was pushed to subscribers, false if no subscribers were found - public static bool Push(TEvent eventInfo) where TEvent : IEvent - { - var type = eventInfo.Name(); - if (Instance.TypeSubscribers.ContainsKey(type) && Instance.TypeSubscribers[type] != null) - { - Instance.TypeSubscribers[type](eventInfo); - return true; - } - return false; - } - - /// - /// Activates all callback functions that are listening to a particular - /// tag or to the IEvent type of eventInfo and passes event information to - /// those listener functions - /// - /// Type of event - /// Event to be passed to callback functions - /// Tag corresponding to the group of listener functions to be activated - /// True if message was pushed to subscribers, false if no subscribers were found - - public static bool Push(string tag, TEvent eventInfo) where TEvent : IEvent - { - string type = eventInfo.Name(); - if (Instance.TagSubscribers.ContainsKey(tag) && Instance.TagSubscribers[tag] != null) - { - Instance.TagSubscribers[tag](eventInfo); - Push(eventInfo); - return true; - } - if (Instance.TypeSubscribers.ContainsKey(type) && Instance.TypeSubscribers[type] != null) - { - Instance.TypeSubscribers[type](eventInfo); - return true; - } - return false; - } - - /// - /// Activates all callback functions that are listening to a particular - /// set of tags or to the IEvent type of eventInfo and passes event - /// information to those listener functions - /// - /// Type of event - /// Event to be passed to callback functions - /// Tags corresponding to the group of listener functions to be activated - /// True if message was pushed to subscribers, false if no subscribers were found - public static bool Push(IEnumerable tags, TEvent eventInfo) where TEvent : IEvent - { - bool pushed = false; - foreach (var tag in tags) - { - pushed |= Push(tag, eventInfo); - } - return pushed; - } - - /// - /// Adds a callback function that is activated by an event of - /// the specified type - /// - /// Type of event to listen for - /// The callback function to be activated - public static void NewTypeListener(EventCallback callback) where TEvent : IEvent - { - string type = typeof(TEvent).FullName; - if (Instance.TypeSubscribers.ContainsKey(type)) - Instance.TypeSubscribers[type] += callback; - else - Instance.TypeSubscribers.Add(type, callback); - } - - /// - /// Adds a callback function that is activated by an event - /// being pushed to the specified tag - /// - /// The tag to listen for - /// The callback function to be activated - public static void NewTagListener(string tag, EventCallback callback) - { - if (Instance.TagSubscribers.ContainsKey(tag)) - Instance.TagSubscribers[tag] += callback; - else - Instance.TagSubscribers.Add(tag, callback); - } - - /// - /// Unsubscribes listener from receiving further events of specified type - /// - /// Type of event to stop listening for - /// The callback function to be removed - /// True if listener was successfully removed and false if type was not found - public static bool RemoveTypeListener(EventCallback callback) where TEvent : IEvent - { - string type = typeof(TEvent).FullName; - if (TypeSubscribers.ContainsKey(type) && Instance.TypeSubscribers[type] != null) - { - if (Instance.TypeSubscribers[type].GetInvocationList().Contains(callback)) - { - // ReSharper disable once DelegateSubtraction - TypeSubscribers[type] -= callback; - return true; - } - return false; - } - return false; - } - - public static bool RemoveAllTypeListeners() where TEvent : IEvent - { - string type = typeof(TEvent).FullName; - if (TypeSubscribers.ContainsKey(type) && Instance.TypeSubscribers[type] != null) - { - TypeSubscribers.Remove(type); - return true; - } - return false; - } - - /// - /// Unsubscribes listener from receiving further events of specified tag - /// - /// The tag to stop listening for - /// The callback function to be removed - /// True if listener was successfully removed and false if tag was not found - public static bool RemoveTagListener(string tag, EventCallback callback) - { - if (TagSubscribers.ContainsKey(tag) && TagSubscribers[tag] != null) - { - if (TagSubscribers[tag].GetInvocationList().Contains(callback)) { - TagSubscribers[tag] -= callback; - return true; - } - return false; - } - return false; - } - - public static bool RemoveAllTagListeners(string tag) - { - if (TagSubscribers.ContainsKey(tag) && TagSubscribers[tag] != null) - { - TagSubscribers.Remove(tag); - return true; - } - return false; - } - - public static void ResetAllListeners() - { - Inner.ResetAllListeners(); - } - - public static bool HasTagSubscriber(string tag) => TagSubscribers.ContainsKey(tag); - public static bool HasTypeSubscriber(Type type) => TypeSubscribers.ContainsKey(type.FullName); - - private class Inner - { - public Dictionary TypeSubscribers; - public Dictionary TagSubscribers; - - public static void ResetAllListeners() - { - if (AppDomain.CurrentDomain.GetAssemblies() - .Any(a => a.FullName.ToLowerInvariant().StartsWith("nunit.framework"))) - { - _inst!.TypeSubscribers = new Dictionary(); - _inst!.TagSubscribers = new Dictionary(); - } - else - { - throw new Exception("Cannot reset all listeners outside of test suite"); - } - } - - private Inner() - { - TypeSubscribers = new Dictionary(); - TagSubscribers = new Dictionary(); - } - - private static Inner _inst; - public static Inner InnerInstance => _inst ??= new Inner(); - } - - private static Dictionary TypeSubscribers => Instance.TypeSubscribers; - private static Dictionary TagSubscribers => Instance.TagSubscribers; - - private static Inner Instance => Inner.InnerInstance; - } -} \ No newline at end of file diff --git a/api/Api/EventBus/IEvent.cs b/api/Api/EventBus/IEvent.cs deleted file mode 100644 index bcf2c75514..0000000000 --- a/api/Api/EventBus/IEvent.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace SynthesisAPI.EventBus -{ - public interface IEvent - { - // public object[] GetArguments(); // TODO delete this? - } - - // ReSharper disable once InconsistentNaming - public static class IEventExtension - { - public static string Name(this IEvent e) => e.GetType().FullName; - } - -} diff --git a/api/Api/GUI/GUIInstance.cs b/api/Api/GUI/GUIInstance.cs deleted file mode 100644 index 19c32b0d15..0000000000 --- a/api/Api/GUI/GUIInstance.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using SynthesisAPI.Runtime; - -namespace Api.GUI -{ - public abstract class GUIInstance : IDisposable - { - private bool _disposed = false; - private bool _initialized = false; - internal int _id; - - internal void SetId(int id) - { - if (!_initialized) - { - _id = id; - _initialized = true; - } - else - { - throw new Exception("Object already initialized"); - } - } - - internal bool IsInitialized => _initialized; - internal bool IsDisposed => _disposed; - - - public void Dispose() => Dispose(true); - - protected virtual void Dispose(bool disposing) - { - if (_disposed) - { - return; - } - - if (disposing) - { - ApiProvider.GetGUIManager().Free(_id); - } - } - } -} \ No newline at end of file diff --git a/api/Api/GUI/GUIManager.cs b/api/Api/GUI/GUIManager.cs deleted file mode 100644 index 5da302bd85..0000000000 --- a/api/Api/GUI/GUIManager.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; - -namespace Api.GUI -{ - public class GUIManager - { - protected List _instances = new List(); - - protected Dictionary _builders = new Dictionary(); - - internal void RegisterBuilder(IGUIBuilderFactory builderFactory) where TGUI : GUIInstance - { - if (_builders.ContainsKey(typeof(TGUI))) - { - throw new Exception("builder with this name already exists"); - } - - _builders[typeof(TGUI)] = builderFactory; - } - - internal void RegisterInstance(GUIInstance i) - { - i._id = _instances.Count; - _instances.Add(i); - } - - internal void Free(int id) - { - if (id > _instances.Count) - { - throw new Exception("invalid id"); - } - if (_instances[id].IsDisposed) - { - throw new Exception("Object already freed"); - } - } - - public IGUIBuilder NewBuilder() where TGUI : GUIInstance => _builders[typeof(TGUI)].New(); - } -} \ No newline at end of file diff --git a/api/Api/GUI/IGUIBuilder.cs b/api/Api/GUI/IGUIBuilder.cs deleted file mode 100644 index 4ce30c7e1d..0000000000 --- a/api/Api/GUI/IGUIBuilder.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Api.GUI -{ - public interface IGUIBuilder - { - GUIInstance Build(); - } -} \ No newline at end of file diff --git a/api/Api/GUI/IGUIBuilderFactory.cs b/api/Api/GUI/IGUIBuilderFactory.cs deleted file mode 100644 index 4f75571d8c..0000000000 --- a/api/Api/GUI/IGUIBuilderFactory.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Api.GUI -{ - public interface IGUIBuilderFactory - { - IGUIBuilder New(params dynamic[] args); - } -} \ No newline at end of file diff --git a/api/Api/InputManager/InputEvents.cs b/api/Api/InputManager/InputEvents.cs deleted file mode 100644 index 66fd0b9e7c..0000000000 --- a/api/Api/InputManager/InputEvents.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using SynthesisAPI.InputManager.Inputs; -using SynthesisAPI.EventBus; -using MathNet.Spatial.Euclidean; - -namespace SynthesisAPI.InputManager.InputEvents -{ - public interface IInputEvent : IEvent - { - string Name { get; } - } - /* - public class AnalogEvent : IInputEvent // TODO make an event stream type instead - { - public string Name { get; private set; } - public float Value { get; private set; } - public AnalogEvent(string name, float value) - { - Name = name; - Value = value; - } - } - */ - public class DigitalEvent : IInputEvent - { - public string Name { get; private set; } - public float Value { get; private set; } - public DigitalState State { get; private set; } - public DigitalEvent(string name, float value, DigitalState state) - { - Name = name; - Value = value; - State = state; - } - } - - public class MouseDownEvent : DigitalEvent - { - public Vector2D MousePosition { get; private set; } - public MouseDownEvent(string name, float value, DigitalState state, Vector2D mousePosition) : base(name, value, state) - { - MousePosition = mousePosition; - } - } -} diff --git a/api/Api/InputManager/InputManager.cs b/api/Api/InputManager/InputManager.cs deleted file mode 100644 index 6becb3833b..0000000000 --- a/api/Api/InputManager/InputManager.cs +++ /dev/null @@ -1,184 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using SynthesisAPI.EventBus; -using SynthesisAPI.InputManager.InputEvents; -using SynthesisAPI.InputManager.Inputs; -using UnityEngine; - -#nullable enable - -using Input = SynthesisAPI.InputManager.Inputs.Input; - -namespace SynthesisAPI.InputManager -{ - public static class InputManager - { - public static readonly string[] IGNORE_KEYS = new string[] { - "AltGr" - }; - - // TODO: Should this still be an array? - internal static Dictionary _mappedDigitalInputs = new Dictionary(); - internal static Dictionary _mappedValueInputs = new Dictionary(); - public static IReadOnlyDictionary MappedDigitalInputs { - get => new ReadOnlyDictionary(_mappedDigitalInputs); - } - public static IReadOnlyDictionary MappedValueInputs { - get => new ReadOnlyDictionary(_mappedValueInputs); - } - - public static void AssignDigitalInput(string name, Digital input, EventBus.EventBus.EventCallback? callback = null) { // TODO remove callback argument? - _mappedDigitalInputs[name] = new Digital[] { input }; - if (callback != null) - EventBus.EventBus.NewTagListener($"input/{name}", callback); - } - - public static void UnassignDigitalInput(string name) { - if (!_mappedDigitalInputs.ContainsKey(name)) - return; - _mappedDigitalInputs.Remove(name); - EventBus.EventBus.RemoveAllTagListeners($"input/{name}"); - } - - public static void AssignDigitalInputs(string name, Digital[] input, EventBus.EventBus.EventCallback? callback = null) { - _mappedDigitalInputs[name] = input; - if(callback != null) - EventBus.EventBus.NewTagListener($"input/{name}", callback); - } - - /// - /// Assign a name to an input. - /// - /// Name of Input - /// Analog of the input to check for activity for - /// Set mute to true if you wish to mute the event call for the input being assigned - public static void AssignValueInput(string name, Analog input, bool mute = false) { - _mappedValueInputs[name] = input; - if (!mute) - EventBus.EventBus.Push(new ValueInputAssignedEvent(name, input)); - } - - public static void UpdateInputs(uint context = 0x00000001) { - foreach(string name in _mappedDigitalInputs.Keys) { - foreach(Input input in _mappedDigitalInputs[name]) { - if (!input.Name.EndsWith("non-ui") && input.Update(context: context)) { - if (input is MouseDown mouseDown) { - EventBus.EventBus.Push($"input/{name}", - new MouseDownEvent(name, mouseDown.Value, mouseDown.State, mouseDown.MousePosition) - ); - } else if (input is Digital digitalInput) { - EventBus.EventBus.Push($"input/{name}", - new DigitalEvent(name, digitalInput.Value, digitalInput.State) - ); - } - } - } - } - } - - public static Analog GetAnalog(string name) - { - if (_mappedValueInputs.ContainsKey(name)) - { - _mappedValueInputs[name].Update(); - return _mappedValueInputs[name]; - } - throw new Exception($"Analog Input is not mapped with name \"{name}\""); - } - - public static float GetValue(string name) { - if (_mappedValueInputs.ContainsKey(name)) { - _mappedValueInputs[name].Update(); - return _mappedValueInputs[name].Value; - } - throw new Exception($"Value Input is not mapped with name \"{name}\""); - } - - public static void SetAllDigitalInputs(Dictionary input) { - _mappedDigitalInputs = input; - } - - public static void SetAllValueInputs(Dictionary input) { - _mappedValueInputs = input; - } - - // TODO: Exclusion cases - public static Analog? GetAny() { - foreach (var k in AllInputs) { - if (k.Update(true)) - return k.WithModifier(GetModifier()); - } - - return null; - } - - public static int GetModifier() { - int mod = 0x00; - ModifierInputs.ForEach(x => { - x.Update(true); - if (x.State > DigitalState.None) { - mod = mod ^ (int)Enum.Parse(typeof(ModKey), x.Name); - } - }); - return mod; - } - - public static List GetAll() => AllInputs.Where(k => k.Update()).ToList(); - - private static List? _allInputs; - public static IReadOnlyCollection AllInputs { - get { - if (_allInputs == null) { - _allInputs = new List(); - - // KeyCodes - var modKeyNames = Enum.GetNames(typeof(ModKey)); - foreach (var k in Enum.GetNames(typeof(KeyCode))) { - if (!modKeyNames.Contains(k) && !IGNORE_KEYS.Contains(k)) - _allInputs.Add(new Digital(k)); - } - - // Joystick Controls - for (int j = 0; j <= 11; j++) { - for (int ab = 1; ab <= 20; ab++) { - var joystickId = j == 0 ? "" : $"{j} "; - var joystickPrefix = $"Joystick {joystickId}"; - _allInputs.Add(new Digital(joystickPrefix + $"Button {ab}")); - _allInputs.Add(new Analog(joystickPrefix + $"Axis {ab}", true)); - _allInputs.Add(new Analog(joystickPrefix + $"Axis {ab}", false)); - } - } - - } - return _allInputs; - } - } - - // constructors need to call this and intialize the list properly, for now this works - private static List? _modifierInputs; - public static IReadOnlyCollection ModifierInputs { - get { - if (_modifierInputs == null) { - _modifierInputs = new List(); - - var modKeys = Enum.GetNames(typeof(ModKey)); - modKeys.ForEach(x => { - _modifierInputs.Add(new Digital(x)); - }); - } - return _modifierInputs; - } - } - } - - public class ValueInputAssignedEvent : IEvent { - public readonly string InputKey; - public readonly Analog Input; - public ValueInputAssignedEvent(string key, Analog input) { - InputKey = key; - Input = input; - } - } -} diff --git a/api/Api/InputManager/Inputs.cs b/api/Api/InputManager/Inputs.cs deleted file mode 100644 index 77aadfa991..0000000000 --- a/api/Api/InputManager/Inputs.cs +++ /dev/null @@ -1,198 +0,0 @@ -using System; -using MathNet.Spatial.Euclidean; -using Newtonsoft.Json; -using SynthesisAPI.Runtime; -using SynthesisAPI.Utilities; -using UnityEngine; -using UnityEngine.UIElements; -using Logger = UnityEngine.Logger; -using Math = System.Math; - -#nullable enable - -namespace SynthesisAPI.InputManager.Inputs -{ - // TODO: Should I add HashCodes? - - public interface Input { - uint ContextBitmask { get; } - string Name { get; } - float Value { get; } - int Modifier { get; } - bool Update(bool ignoreMod = false, uint context = 0x00000001); - } - - [JsonObject(MemberSerialization.OptIn)] - public class Analog : Input { - [JsonProperty] - public uint ContextBitmask { get; set; } - [JsonProperty] - public string Name { get; protected set; } - public float Value - { - get - { - Update(); - return _value; - } - protected set => _value = value; - } - - [JsonProperty] - public bool UsePositiveSide { get; private set; } - [JsonProperty] - public int Modifier { get; protected set; } - [JsonProperty] - public float BaseValue { get; private set; } - [JsonProperty] - public bool Inverted { get; private set; } - - private float _value; - - public Analog(string name, bool usePositiveSide, bool inverted = false, int modifier = 0, float baseValue = 0, uint context = 0xFFFFFFFF) - { - Name = name; - Inverted = inverted; - Modifier = modifier; - UsePositiveSide = usePositiveSide; - BaseValue = baseValue; - ContextBitmask = context; - } - - //public bool Update() { - // return Update(false); - //} - // TODO: Use modifier for analogs? - public virtual bool Update(bool ignoreMod = false, uint context = 0x00000001) { - if ((context & ContextBitmask) == 0) - return false; - - _value = UnityEngine.Input.GetAxis(Name); - _value = Inverted ? _value *= -1 : _value; - _value = Mathf.Clamp(_value, UsePositiveSide ? BaseValue : -999, UsePositiveSide ? 999 : BaseValue); - return Math.Abs(_value - BaseValue) > 0.1; - } - - public virtual Analog WithModifier(int newMod) - => new Analog(Name, UsePositiveSide, Inverted, newMod, BaseValue); - - public override bool Equals(object obj) { - if (ReferenceEquals(obj, null) || !(obj is Analog)) - return false; - return (obj as Analog)?.GetHashCode() == GetHashCode(); - } - - public override int GetHashCode() - => 092847146 * Name.GetHashCode() - + (UsePositiveSide ? 174829543 : 243563928) - + 748273952 * Modifier - + 374865392 * (int)(1000 * BaseValue) - + (Inverted ? 345234768 : 980789437); - } - [JsonObject(MemberSerialization.OptIn)] - public class Digital : Analog - { - public DigitalState State { get; private set; } - public Digital(string name, int modifier = 0, uint context = 0xFFFFFFFF) : base(name, true, context: context) - { - Name = name; - Modifier = modifier; - Value = 0.0f; - State = DigitalState.Up; - } - - public Digital(Analog analog) : base(analog.Name, true) { - Name = analog.Name; - Modifier = analog.Modifier; - Value = 0.0f; - State = DigitalState.Up; - } - - [JsonConstructor] - private Digital() : base(string.Empty, true) { } - - public override bool Update(bool ignoreMod = false, uint context = 0x00000001) { - if ((context & ContextBitmask) == 0) - return false; - - try - { - int activeMod = 0; - if (!ignoreMod) - activeMod = InputManager.GetModifier(); - if (activeMod == Modifier) { - if (InputUtils.GetKeyOrButtonDown(Name)) - State = DigitalState.Down; - else if (InputUtils.GetKeyOrButton(Name)) - State = DigitalState.Held; - else if (InputUtils.GetKeyOrButtonUp(Name)) - State = DigitalState.Up; - else - State = DigitalState.None; - } else { - State = State > DigitalState.None ? DigitalState.Up : DigitalState.None; - } - Value = State > 0 ? 1 : 0; - return State != DigitalState.None; - } - catch (ArgumentException) - { - Utilities.Logger.Log($"Key {Name} is invalid." ); - return false; - } - } - - // Make sure you do this for new input types if it matters - public override Analog WithModifier(int newMod) - => new Digital(Name, newMod); - - public override bool Equals(object obj) { - if (ReferenceEquals(obj, null) || !(obj is Digital)) - return false; - return (obj as Digital)?.GetHashCode() == GetHashCode(); - } - - public override int GetHashCode() - => base.GetHashCode(); - } - - [Flags] - public enum ModKey - { - LeftShift = 0x0001, - LeftCommand = 0x0002, - LeftApple = 0x0004, - LeftAlt = 0x0008, - RightShift = 0x0010, - RightCommand = 0x0020, - RightApple = 0x0040, - RightAlt = 0x0080, - LeftControl = 0x0100, - RightControl = 0x0200 - } - - // TODO: Should this be MouseDown or just like Mouse/MouseInput - public class MouseDown: Digital { - public Vector2D MousePosition { get; private set; } - public MouseDown(string name, int modifier = 0, uint context = 0xFFFFFFFF): base(name, modifier, context: context) { } - public override bool Update(bool ignoreMod = false, uint context = 0x00000001) { - if ((context & ContextBitmask) == 0) - return false; - - var r = base.Update(ignoreMod); - MousePosition = ((UnityEngine.Vector2)UnityEngine.Input.mousePosition).Map(); - return r; - } - - public static readonly MouseDown LeftMouseButton = new MouseDown("Mouse 0"); - public static readonly MouseDown RightMouseButton = new MouseDown("Mouse 1"); - public static readonly MouseDown MiddleMouseButton = new MouseDown("Mouse 2"); - - public override Analog WithModifier(int newMod) - => new MouseDown(base.Name, newMod); - } - - public enum DigitalState { - Down = 1, Up = -1, Held = 2, None = 0 - } -} diff --git a/api/Api/InputManager/KeyEvent.cs b/api/Api/InputManager/KeyEvent.cs deleted file mode 100644 index 80f6f5486d..0000000000 --- a/api/Api/InputManager/KeyEvent.cs +++ /dev/null @@ -1,20 +0,0 @@ -using SynthesisAPI.EventBus; -using UnityEngine; - -namespace Api.InputManager -{ - public class KeyEvent : IEvent - { - public string KeyString; - - public KeyEvent(string keyString) - { - KeyString = keyString; - } - - internal KeyEvent(KeyCode kc) - { - KeyString = kc.ToString(); - } - } -} \ No newline at end of file diff --git a/api/Api/Mirabuf/Appearance.cs b/api/Api/Mirabuf/Appearance.cs deleted file mode 100644 index bdd057611a..0000000000 --- a/api/Api/Mirabuf/Appearance.cs +++ /dev/null @@ -1,86 +0,0 @@ -using UnityEngine; -using UMaterial = UnityEngine.Material; -using SynthesisAPI.Utilities; - -using Logger = SynthesisAPI.Utilities.Logger; - -#nullable enable - -namespace Mirabuf.Material { - public partial class Appearance { - private UMaterial? _unityMaterial = null; - public UMaterial UnityMaterial { - get { - if (_unityMaterial == null) { - Color32 c = new Color32((byte)Albedo.R, (byte)Albedo.G, (byte)Albedo.B, (byte)Albedo.A); - // Logger.Log($"[{c.r}, {c.g}, {c.b}, {c.a}]"); - - // TODO: Something here breaks transparent materials for builds - - if (c.a < 255) { - _unityMaterial = new UMaterial(DefaultTransparentShader); - _unityMaterial.SetColor(TRANSPARENT_COLOR, c); - _unityMaterial.SetFloat(TRANSPARENT_SMOOTHNESS, 1 - (float)Roughness); - // _unityMaterial.SetColor("Color", c); - // _unityMaterial.SetFloat("Alpha", c.a); - //_unityMaterial.SetOverrideTag("RenderTag", "Transparent"); - //_unityMaterial.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.SrcAlpha); - //_unityMaterial.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha); - //_unityMaterial.SetInt("_ZWrite", 0); - //_unityMaterial.DisableKeyword("_ALPHATEST_ON"); - //_unityMaterial.EnableKeyword("_ALPHABLEND_ON"); - //_unityMaterial.DisableKeyword("_ALPHAPREMULTIPLY_ON"); - // _unityMaterial.renderQueue = 3000; - } else { - _unityMaterial = new UMaterial(DefaultOpaqueShader); - _unityMaterial.SetColor(OPAQUE_COLOR, c); - _unityMaterial.SetFloat(OPAQUE_SMOOTHNESS, 1 - (float)Roughness); - _unityMaterial.SetFloat(OPAQUE_METALLIC, (float)Metallic); - } - - /// - /// To enable the use of the renderQueue use the following: - /// _unityMaterial.renderQueue = 3000; - /// - /// It was disabled because it make the Grid shader work - /// - - _unityMaterial.enableInstancing = true; - // TODO: Specular and Metallic - } - return _unityMaterial; - } - } - - public const string OPAQUE_COLOR = "Color_2aa135b32e7e4808b9be05c544657380"; - public const string OPAQUE_SMOOTHNESS = "Vector1_dd87d7fcd1f1419f894566001d248ab9"; - public const string OPAQUE_METALLIC = "OPAQUE_METALLIC"; - private static Shader? _defaultOpaqueShader = null; - public static Shader DefaultOpaqueShader { - get { - if (_defaultOpaqueShader == null) { - _defaultOpaqueShader = Shader.Find("Shader Graphs/DefaultSynthesisShader"); - } - return _defaultOpaqueShader; - } - } - public const string TRANSPARENT_COLOR = "Color_48545d7793c14f3d9e1dd2264f072068"; - public const string TRANSPARENT_SMOOTHNESS = "Vector1_d66a0e8b289a457c85b3b4408b4f3c2f"; - private static Shader? _defaultTransparentShader = null; - public static Shader DefaultTransparentShader { - get { - if (_defaultTransparentShader == null) { - _defaultTransparentShader = Shader.Find("Shader Graphs/DefaultSynthesisTransparentShader"); - } - return _defaultTransparentShader; - } - } - - public static readonly Appearance DefaultAppearance = new Appearance { - Albedo = new Color { A = 255, R = 12, G = 12, B = 12 }, - Roughness = 0.7, - Metallic = 0.1, - Specular = 0.1 - }; - } -} diff --git a/api/Api/Mirabuf/Assembly.cs b/api/Api/Mirabuf/Assembly.cs deleted file mode 100644 index bbc67d6895..0000000000 --- a/api/Api/Mirabuf/Assembly.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.Collections.Generic; - -#nullable enable - -namespace Mirabuf { - public partial class Assembly { - - private Dictionary>? _partJointMap = null; - - private void LoadPartJointMap() { - _partJointMap = new Dictionary>(); - Data.Parts.PartInstances.ForEach(x => { - _partJointMap[x.Key] = new List(); - Data.Joints.JointInstances.ForEach(y => { - if (y.Value.ChildPart == x.Key || y.Value.ParentPart == x.Key) - _partJointMap[x.Key].Add(y.Key); - }); - }); - } - - public List GetPartJoints(string partInstance) { - if (_partJointMap == null) - LoadPartJointMap(); - // The previous line should fill this I guess ? - _partJointMap!.TryGetValue(partInstance, out List joints); - return joints; - } - } -} \ No newline at end of file diff --git a/api/Api/Mirabuf/Extensions.cs b/api/Api/Mirabuf/Extensions.cs deleted file mode 100644 index 2bac4daa90..0000000000 --- a/api/Api/Mirabuf/Extensions.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using UnityEngine; - -internal static class Extensions { - public static Vector2[] ToVector2Array(this IEnumerable data) { - Vector2[] vertices = new Vector2[data.Count() / 2]; - for (int i = 0; i < data.Count(); i += 2) { - // TODO: Flip the X - vertices[i / 2] = new Vector2(data.ElementAt(i), data.ElementAt(i + 1)); - } - return vertices; - } - public static Vector3[] ToVector3Array(this IEnumerable data, bool normalize = false) { - Vector3[] vertices = new Vector3[data.Count() / 3]; - for (int i = 0; i < data.Count(); i += 3) { - // TODO: Flip the X - vertices[i / 3] = new Vector3(data.ElementAt(i) * -0.01f, data.ElementAt(i + 1) * 0.01f, data.ElementAt(i + 2) * 0.01f); - if (normalize) - vertices[i / 3] = vertices[i / 3].normalized; - } - return vertices; - } - - public static void ForEach(this IEnumerable e, Action act) { - foreach (var a in e) { - act(a); - } - } -} diff --git a/api/Api/Mirabuf/JointInstance.cs b/api/Api/Mirabuf/JointInstance.cs deleted file mode 100644 index f4727bc1e7..0000000000 --- a/api/Api/Mirabuf/JointInstance.cs +++ /dev/null @@ -1,39 +0,0 @@ -namespace Mirabuf.Joint { - public partial class JointInstance { - - public enum WheelTypeEnum { - Standard = 0, Omni = 1 - } - - private bool? _isWheel = null; - public bool IsWheel(Assembly assembly) { - if (!_isWheel.HasValue) { - _isWheel = Info.Name != "grounded" - && assembly.Data.Joints.JointDefinitions[JointReference].UserData != null - && assembly.Data.Joints.JointDefinitions[JointReference].UserData.Data - .TryGetValue("wheel", out var isWheel) - && isWheel == "true"; - } - return _isWheel.Value; - } - - private WheelTypeEnum? _wheelType = null; - public WheelTypeEnum GetWheelType(Assembly assembly) { - if (!_wheelType.HasValue) { - if (IsWheel(assembly)) { - var hasValue = assembly.Data.Joints.JointDefinitions[JointReference].UserData.Data - .TryGetValue("wheelType", out var wheelType); - if (hasValue && wheelType.Equals("1")) { - _wheelType = WheelTypeEnum.Omni; - } else { - _wheelType = WheelTypeEnum.Standard; - } - } else { - throw new System.Exception("Non-wheels don't have wheel types"); - } - } - - return _wheelType.Value; - } - } -} diff --git a/api/Api/Mirabuf/Part.cs b/api/Api/Mirabuf/Part.cs deleted file mode 100644 index d96d9177e3..0000000000 --- a/api/Api/Mirabuf/Part.cs +++ /dev/null @@ -1,18 +0,0 @@ -using UnityEngine; -using System.Linq; - -namespace Mirabuf { - public partial class PartInstance { - - // public Matrix4x4 GlobalTransform = Matrix4x4.identity; - - // public bool IsJointed(Assembly assembly) { - // var res = false; - // Joints.ForEach(x => { - // if (assembly.Data.Joints.Joints_.ContainsKey(x)) - // res = true; - // }); - // return res; - // } - } -} diff --git a/api/Api/Mirabuf/SimpleMotor.cs b/api/Api/Mirabuf/SimpleMotor.cs deleted file mode 100644 index 40232d4928..0000000000 --- a/api/Api/Mirabuf/SimpleMotor.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Mirabuf.Motor { - public partial class SimpleMotor { - - // Extremely arbitrary - - private UnityEngine.JointMotor? _unityMotor; - public UnityEngine.JointMotor UnityMotor { - get { - if (!_unityMotor.HasValue) { - _unityMotor = new UnityEngine.JointMotor { - force = StallTorque, - targetVelocity = MaxVelocity, - freeSpin = BrakingConstant > 0 - }; - } - return _unityMotor.Value; - } - } - } -} diff --git a/api/Api/Mirabuf/Transform.cs b/api/Api/Mirabuf/Transform.cs deleted file mode 100644 index c29cfa0340..0000000000 --- a/api/Api/Mirabuf/Transform.cs +++ /dev/null @@ -1,65 +0,0 @@ -using UnityEngine; - -namespace Mirabuf { - public partial class Transform { - /// - /// Transform data in the Fusion360 coordinate system. - /// - /// It's used a lot because I forgot to translate it at first and its now translated - /// everywhere else except for right here. Hence, why UnityMatrix is now a thing - /// - private Matrix4x4 _mirabufMatrix; - public Matrix4x4 MirabufMatrix { - get { - if (_mirabufMatrix == default) { - _mirabufMatrix = new Matrix4x4( - new Vector4(SpatialMatrix[0], SpatialMatrix[4], SpatialMatrix[8], SpatialMatrix[12]), - new Vector4(SpatialMatrix[1], SpatialMatrix[5], SpatialMatrix[9], SpatialMatrix[13]), - new Vector4(SpatialMatrix[2], SpatialMatrix[6], SpatialMatrix[10], SpatialMatrix[14]), - new Vector4(SpatialMatrix[3], SpatialMatrix[7], SpatialMatrix[11], SpatialMatrix[15]) - ); - } - return _mirabufMatrix; - } - } - - /// - /// Puts the transform data into the Unity coordinate system - /// - private Matrix4x4? _unityMatrix; - public Matrix4x4 UnityMatrix { - get { - if (!_unityMatrix.HasValue) { - _unityMatrix = MirabufMatrix; - _unityMatrix = Matrix4x4.TRS( - new UnityEngine.Vector3(_unityMatrix.Value.m03 * -0.01f, _unityMatrix.Value.m13 * 0.01f, _unityMatrix.Value.m23 * 0.01f), - new Quaternion(-_unityMatrix.Value.rotation.x, _unityMatrix.Value.rotation.y, - _unityMatrix.Value.rotation.z, -_unityMatrix.Value.rotation.w - ), - UnityEngine.Vector3.one - ); - } - return _unityMatrix.Value; - } - } - - public static implicit operator Matrix4x4(Transform t) - => t.MirabufMatrix; - - public static implicit operator Transform(Matrix4x4 m) - => new Transform {SpatialMatrix = { - m[0, 0], m[0, 1], m[0, 2], m[0, 3], - m[1, 0], m[1, 1], m[1, 2], m[1, 3], - m[2, 0], m[2, 1], m[2, 2], m[2, 3], - m[3, 0], m[3, 1], m[3, 2], m[3, 3] - }}; - - // I think? - public static readonly Transform IDENTITY = new Transform { SpatialMatrix = { - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1 - } }; // (row, column) => (0, 0), (0, 1), (0, 2), (0, 3), (1, 0) ... - } -} diff --git a/api/Api/Mirabuf/TriangleMesh.cs b/api/Api/Mirabuf/TriangleMesh.cs deleted file mode 100644 index 761b20b54b..0000000000 --- a/api/Api/Mirabuf/TriangleMesh.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Linq; -using UnityEngine; -using UMesh = UnityEngine.Mesh; - -namespace Mirabuf { - public partial class TriangleMesh { - private UMesh _unityMesh = null; - private UMesh _colliderMesh = null; - public UMesh UnityMesh { - get { - if (_unityMesh == null) { - _unityMesh = MakeMesh(); - } - return _unityMesh; - } - } - public UMesh ColliderMesh { - get { - if (_colliderMesh == null) { - try { - _colliderMesh = MakeMesh(); - Physics.BakeMesh(_colliderMesh.GetInstanceID(), true); - } catch (Exception) { - // TODO: Maybe don't silently fail - _colliderMesh = new UMesh(); - Debug.LogError("Failed to bake physics mesh!"); - } - } - return _colliderMesh; - } - } - - private UMesh MakeMesh() { - var m = new UMesh(); - switch (MeshTypeCase) { - case MeshTypeOneofCase.Mesh: - m.vertices = this.Mesh.Verts.ToVector3Array(); - m.triangles = this.Mesh.Indices.Reverse().ToArray(); - if (this.Mesh.Normals.Count > 0) - m.normals = this.Mesh.Normals.ToVector3Array(); - else - m.RecalculateNormals(); - if (this.Mesh.Uv.Count > 0) // You can leave the uvs blank if you don't have any specifications - m.uv = this.Mesh.Uv.ToVector2Array(); - break; - } - return m; - } - } -} diff --git a/api/Api/Mirabuf/Vector3.cs b/api/Api/Mirabuf/Vector3.cs deleted file mode 100644 index a26c12207c..0000000000 --- a/api/Api/Mirabuf/Vector3.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; - -namespace Mirabuf { - public partial class Vector3 { - public float Magnitude => (float)Math.Sqrt(Math.Pow(X, 2) + Math.Pow(Y, 2) + Math.Pow(Z, 2)); - public Vector3 Normalize() { - var mag = Magnitude; - X /= mag; - Y /= mag; - Z /= mag; - return this; - } - - public static implicit operator Vector3(UnityEngine.Vector3 v) - => new Vector3() { X = v.x * -100, Y = v.y * 100, Z = v.z * 100 }; - public static implicit operator UnityEngine.Vector3(Vector3 v) - => new UnityEngine.Vector3(v.X * -0.01f, v.Y * 0.01f, v.Z * 0.01f); - - public static Vector3 operator +(Vector3 a, Vector3 b) => new Vector3() { X = a.X + b.X, Y = a.Y + b.Y, Z = a.Z + b.Z }; - public static Vector3 operator -(Vector3 a, Vector3 b) => new Vector3() { X = a.X - b.X, Y = a.Y - b.Y, Z = a.Z - b.Z }; - public static Vector3 operator -(Vector3 a) => new Vector3() { X = -a.X, Y = -a.Y, Z = -a.Z }; - public static Vector3 operator /(Vector3 a, float b) => new Vector3 { X = a.X / b, Y = a.Y / b, Z = a.Z / b }; - public static Vector3 operator *(Vector3 a, float b) => new Vector3 { X = a.X * b, Y = a.Y * b, Z = a.Z * b }; - public static Vector3 operator /(Vector3 a, double b) => new Vector3 { X = a.X / (float)b, Y = a.Y / (float)b, Z = a.Z / (float)b }; - public static Vector3 operator *(Vector3 a, double b) => new Vector3 { X = a.X * (float)b, Y = a.Y * (float)b, Z = a.Z * (float)b }; - } -} diff --git a/api/Api/Modules/Attributes/BuiltInAttribute.cs b/api/Api/Modules/Attributes/BuiltInAttribute.cs deleted file mode 100644 index 3dd6220b98..0000000000 --- a/api/Api/Modules/Attributes/BuiltInAttribute.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; - -#nullable enable - -namespace SynthesisAPI.Modules.Attributes -{ - [AttributeUsage(AttributeTargets.Class)] - internal class BuiltInAttribute : Attribute - { - public BuiltInAttribute(Type t) - { - DependencyType = t; - } - public Type? DependencyType = null; - } -} \ No newline at end of file diff --git a/api/Api/Modules/Attributes/CallbackAttribute.cs b/api/Api/Modules/Attributes/CallbackAttribute.cs deleted file mode 100644 index 9cc9af4380..0000000000 --- a/api/Api/Modules/Attributes/CallbackAttribute.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; - -namespace SynthesisAPI.Modules.Attributes -{ - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Delegate)] - public class CallbackAttribute : Attribute - { - - } -} \ No newline at end of file diff --git a/api/Api/Modules/Attributes/InitializationPriorityAttribute.cs b/api/Api/Modules/Attributes/InitializationPriorityAttribute.cs deleted file mode 100644 index 06b9c57c6d..0000000000 --- a/api/Api/Modules/Attributes/InitializationPriorityAttribute.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; - -namespace SynthesisAPI.Modules.Attributes -{ - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)] - public class InitializationPriorityAttribute : Attribute - { - - public InitializationPriorityAttribute(byte v) - { - Value = v; - } - - public InitializationPriorityAttribute() - { - Value = 255; - } - public readonly byte Value; - } -} \ No newline at end of file diff --git a/api/Api/Modules/Attributes/ModuleOmitAttribute.cs b/api/Api/Modules/Attributes/ModuleOmitAttribute.cs deleted file mode 100644 index 23f4389bb0..0000000000 --- a/api/Api/Modules/Attributes/ModuleOmitAttribute.cs +++ /dev/null @@ -1,7 +0,0 @@ -using System; - -namespace SynthesisAPI.Modules.Attributes -{ - [AttributeUsage(AttributeTargets.Class)] - public class ModuleOmitAttribute : Attribute {} -} \ No newline at end of file diff --git a/api/Api/Modules/Attributes/TaggedCallbackAttribute.cs b/api/Api/Modules/Attributes/TaggedCallbackAttribute.cs deleted file mode 100644 index 1f567176ee..0000000000 --- a/api/Api/Modules/Attributes/TaggedCallbackAttribute.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; - -namespace SynthesisAPI.Modules.Attributes -{ - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Delegate)] - public class TaggedCallbackAttribute : Attribute - { - public readonly string Tag; - - public TaggedCallbackAttribute(string tag) { - Tag = tag; - } - } -} \ No newline at end of file diff --git a/api/Api/Modules/ModuleManager.cs b/api/Api/Modules/ModuleManager.cs deleted file mode 100644 index ec13398737..0000000000 --- a/api/Api/Modules/ModuleManager.cs +++ /dev/null @@ -1,114 +0,0 @@ -using SynthesisAPI.Utilities; -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; - -using Zippo = System.IO.Compression.ZipFile; - -[assembly: InternalsVisibleTo("CoreEngine")] -[assembly: InternalsVisibleTo("MockApi")] -[assembly: InternalsVisibleTo("TestApi")] -[assembly: InternalsVisibleTo("PlayMode.Tests")] - -namespace SynthesisAPI.Modules -{ - public static class ModuleManager - { - public class ModuleInfo - { - public string Name { get; } - public string Version { get; } - public string Author { get; } - public string Description { get; } - - public ModuleInfo(string name, string version) - { - Name = name; - Version = version; - Author = ""; - Description = ""; - } - public ModuleInfo(string name, string version, string author, string description) - { - Name = name; - Version = version; - Author = author; - Description = description; - } - - public override bool Equals(object obj) - { - if(obj is ModuleInfo mod) - { - return mod.Name == Name && mod.Version == Version; - } - return false; - } - - public override int GetHashCode() - { - int hashCode = 2112831277; - hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(Name); - hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(Version); - return hashCode; - } - } - - [ExposedApi] - internal static void AddToLoadedModuleList(ModuleInfo module) - { - if (!IsModuleLoaded(module)) - { - Instance.LoadedModules.Add(module); - } - } - - public static bool IsFinishedLoading { get => Instance.IsFinishedLoading; } - - internal static void MarkFinishedLoading() - { - Instance.IsFinishedLoading = true; - } - - [ExposedApi] - public static List GetLoadedModules() - { - return Instance.LoadedModules; - } - - [ExposedApi] - public static bool IsModuleLoaded(ModuleInfo module) - { - return Instance.LoadedModules.Contains(module); - } - - [ExposedApi] - public static string GetDeclaringModule(Type type) - { - var callSite = type.Assembly.GetName().Name; - return Instance.AssemblyOwners.ContainsKey(callSite) ? Instance.AssemblyOwners[callSite] : $"{callSite}.dll"; - } - - internal static void RegisterModuleAssemblyName(string assemblyName, string owningModule) - { - Instance.AssemblyOwners.Add(assemblyName, owningModule); - } - - private class Inner - { - public Inner() - { - LoadedModules = new List(); - AssemblyOwners = new Dictionary(); - } - - public List LoadedModules; - public Dictionary AssemblyOwners; - public bool IsFinishedLoading { get; set; } - - public static readonly Inner Instance = new Inner(); - } - - private static Inner Instance => Inner.Instance; - } -} diff --git a/api/Api/PreferenceManager/PreferenceManager.cs b/api/Api/PreferenceManager/PreferenceManager.cs deleted file mode 100644 index 348866d916..0000000000 --- a/api/Api/PreferenceManager/PreferenceManager.cs +++ /dev/null @@ -1,209 +0,0 @@ -using Newtonsoft.Json; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using SynthesisAPI.AssetManager; -using SynthesisAPI.VirtualFileSystem; -using System.Threading.Tasks; -using SynthesisAPI.Utilities; - -// This has a template that is possibly nullable -#nullable disable - -namespace SynthesisAPI.PreferenceManager -{ - public static class PreferenceManager - { - public static bool UnsavedChanges { get; private set; } - private static Dictionary> _preferences = new Dictionary>(); - public static IReadOnlyDictionary> Preferences { - get => new ReadOnlyDictionary>(_preferences); - } - - private static readonly (string Directory, string Name) VirtualFilePath = ("/modules", "preferences.json"); - - private static JsonAsset _asset; - private static void ImportPreferencesAsset() - { - _asset = AssetManager.AssetManager.Import("text/json", true, VirtualFilePath.Directory, - VirtualFilePath.Name, Permissions.PublicReadWrite, - $"{VirtualFilePath.Directory}/{VirtualFilePath.Name}"); - } - - /// - /// Set a preference using an identifier inside your unique dictionary. Uses an object type - /// - /// Type of preference. No constraints - /// name of the owner module - /// Identifier for preference - /// Preference value - [ExposedApi] - public static void SetPreferenceObject(string moduleName, string key, object value) { - if (!_preferences.ContainsKey(moduleName)) - _preferences[moduleName] = new Dictionary(); - _preferences[moduleName][key] = value; - UnsavedChanges = true; - } - - /// - /// Set a preference using an identifier inside your unique dictionary. Uses a generic type - /// - /// Type of preference. No constraints - /// name of the owner module - /// Identifier for preference - /// Preference value - [ExposedApi] - public static void SetPreference(string moduleName, string key, T value) - { - if (!_preferences.ContainsKey(moduleName)) - _preferences[moduleName] = new Dictionary(); - _preferences[moduleName][key] = JsonConvert.SerializeObject(value); - UnsavedChanges = true; - } - - public static void SetPreferences(string moduleName, Dictionary preferences) - { - foreach (string key in preferences.Keys) - { - SetPreference(moduleName, key, preferences[key]); - } - } - - /// - /// This function will return a specific preference that has loaded in and/or - /// set using the method - /// - /// name of the owner module - /// Identifier for preference - /// Preference or null if no preference exists. Potential problems with the way JSON deserializes into object types - [ExposedApi] - public static object GetPreferenceObject(string moduleName, string key) { - return ContainsPreference(moduleName, key) ? _preferences[moduleName][key] : null; - } - - public static bool ContainsPreference(string moduleName, string key) - { - if (_preferences.ContainsKey(moduleName)) - { - if (_preferences[moduleName].ContainsKey(key)) - { - return true; - } - //Logger.Log($"There is no key of value \"{key}\" for module \"{moduleName}\""); - } - //Logger.Log($"There is no module with name \"{moduleName}\""); - return false; - } - - /// - /// This function will return a specific preference that has loaded in and/or - /// set using the method - /// - /// Return type. If useJsonReserialization is true this type must - /// have a JsonObjectAttribute - /// name of the owner module - /// Identifier for preference - /// Preference or default if no preference exists. Will be of type T - [ExposedApi] - public static T GetPreference(string moduleName, string key) { - if (_preferences.ContainsKey(moduleName)) { - if (_preferences[moduleName].ContainsKey(key)) { - return JsonConvert.DeserializeObject((string)_preferences[moduleName][key]); - } - Logger.Log($"There is no key of value \"{key}\" for module \"{moduleName}\""); - } - Logger.Log($"There is no module with name \"{moduleName}\""); - return default(T); - } - - /// - /// Clear your dictionary of preferences - /// - /// Your module name - [ExposedApi] - public static void ClearPreferences(string moduleName) - { - _preferences[moduleName] = new Dictionary(); - UnsavedChanges = true; - } - - #region IO - - /// - /// Loads a JSON file asynchronously and loads preference data - /// - /// Load regardless of unsaved data - /// Whether or not preferences were loaded successfully - [ExposedApi] - public static Task LoadAsync(bool overrideChanges = false) => Task.Factory.StartNew(() => Load(overrideChanges)); - - /// - /// Loads a JSON file that stores preference data - /// - /// Load regardless of unsaved data - /// Whether or not preferences were loaded successfully - [ExposedApi] - public static bool Load(bool overrideChanges = false) - { - using var _ = ApiCallSource.StartExternalCall(); - return LoadInner(overrideChanges); - } - - internal static bool LoadInner(bool overrideChanges = false) - { - if (!overrideChanges && UnsavedChanges) - { - Logger.Log("Load failed: Preferences would have been overwritten"); - return false; - } - - if (_asset == null) - { - ImportPreferencesAsset(); - if(_asset == null) - { - Logger.Log("Load failed: No preferences exist"); - return false; - } - } - - _preferences = _asset!.DeserializeInner>>(offset: 0, retainPosition: true) ?? new Dictionary>(); - - UnsavedChanges = false; - - return true; - } - - /// - /// Saves a JSON file with preference data asynchronously - /// - /// Whether or not the save executed successfully - [ExposedApi] - public static Task SaveAsync() => Task.Factory.StartNew(Save); - - /// - /// Saves a JSON file with preference data - /// - /// Whether or not the save executed successfully - [ExposedApi] - public static bool Save() - { - using var _ = ApiCallSource.StartExternalCall(); - return SaveInner(); - } - - internal static bool SaveInner() - { - if(_asset == null) - ImportPreferencesAsset(); - - _asset.SerializeInner(_preferences); - _asset.SaveToFileInner(); - - UnsavedChanges = false; - - return true; - } - - #endregion - } -} diff --git a/api/Api/PreferenceManager/PreferencesIOEvent.cs b/api/Api/PreferenceManager/PreferencesIOEvent.cs deleted file mode 100644 index 8e389ba4ee..0000000000 --- a/api/Api/PreferenceManager/PreferencesIOEvent.cs +++ /dev/null @@ -1,19 +0,0 @@ -using SynthesisAPI.EventBus; - -namespace SynthesisAPI.PreferenceManager -{ - public class PreferencesIOEvent : IEvent - { - public Status PreferencesStatus { get; private set; } - - public PreferencesIOEvent(Status status) - { - PreferencesStatus = status; - } - - public enum Status - { - PreSave = 1, PostLoad = 2 - } - } -} \ No newline at end of file diff --git a/api/Api/RoboRIO/RoboRIOState.cs b/api/Api/RoboRIO/RoboRIOState.cs deleted file mode 100644 index 113a998fc0..0000000000 --- a/api/Api/RoboRIO/RoboRIOState.cs +++ /dev/null @@ -1,324 +0,0 @@ -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading; - -namespace SynthesisAPI.RoboRIO { - - [JsonObject(MemberSerialization.OptIn)] - public class RoboRIOState { - private Dictionary _registeredTypes = new Dictionary() { - { "AI", typeof(AIData) }, - { "PWM", typeof(PWMData) }, - { "DriverStation", typeof(DriverStationData) }, - { "dPWM", typeof(DPWMData) }, - { "Encoder", typeof(EncoderData) } - }; - - private Mutex _dataMutex = new Mutex(); - - [JsonProperty] - private Dictionary> _allHardware = new Dictionary>(); - - public event Action OnUnrecognizedMessage; - - public RoboRIOState() { - _registeredTypes.ForEach(kvp => _allHardware[kvp.Key] = new Dictionary()); - } - - /// - /// Change data in the RioState. - /// This overload of UpdateData is meant for the WebSocket server to pass nearly raw data into, not really meant for API users. - /// - /// Websocket type alias - /// Device ID (Could be number or something else) - /// Data you wish to change. This will not dump keys that aren't included in jsonData - /// Whether or not the data you tried to modify was successfully modified - public bool UpdateData(string type, string device, Dictionary jsonData) { - if (!_allHardware.ContainsKey(type)) { - string data = $"TYPE: \"{type}\"\n{JsonConvert.SerializeObject(jsonData)}"; - // _unrecognizedMessages.Add(data); - if (OnUnrecognizedMessage != null) - OnUnrecognizedMessage(data); - return false; - } - - _dataMutex.WaitOne(); - - if (!_allHardware[type].ContainsKey(device)) { - _allHardware[type][device] = (HardwareTypeData)Activator.CreateInstance(_registeredTypes[type]); - } - _allHardware[type][device].Update(jsonData); - - _dataMutex.ReleaseMutex(); - - return true; - } - - /// - /// Change data in the RioState. - /// This overload of UpdateData is meant to be used by users of the API. The wonky design is due to thread safety, sorry. -Hunter - /// - /// HardwareTypeData type associated with the data you are modifying - /// Device ID (Could be number or something else) - /// Action in which to do your modifications. They will be ran within a mutex - /// Will throw if the type alias you use isn't registered to the T type you passed in - /// Whether or not the data you tried to modify was successfully modified - public bool UpdateData(string device, Action updateAct) where T : HardwareTypeData { - - string type = HardwareTypeData.GetMetaData().RegisteredTypeName; - - if (!_allHardware.ContainsKey(type)) - return false; - - if (!_registeredTypes.ContainsKey(type) || _registeredTypes[type] != typeof(T)) - throw new Exception($"Data type '{type}' isn't registered to C# type '{typeof(T).Name}'"); - - _dataMutex.WaitOne(); - - if (!_allHardware[type].ContainsKey(device)) { - _allHardware[type][device] = (HardwareTypeData)Activator.CreateInstance(_registeredTypes[type]); - } - - updateAct((T)_allHardware[type][device]); - - _dataMutex.ReleaseMutex(); - - return true; - } - - /// - /// Get data from the RioState - /// - /// Type of data - /// Device ID - /// Will throw if the type alias you use isn't registered to the T type you passed in - /// Data if available. If type doesn't exist, returns null - public T GetData(string device) where T : HardwareTypeData { - - string type = HardwareTypeData.GetMetaData().RegisteredTypeName; - - if (!_allHardware.ContainsKey(type)) - return null; - - if (!_registeredTypes.ContainsKey(type) || _registeredTypes[type] != typeof(T)) - throw new Exception($"Data type '{type}' isn't registered to C# type '{typeof(T).FullName}'"); - - _dataMutex.WaitOne(); - - if (!_allHardware[type].ContainsKey(device)) - _allHardware[type][device] = (T)Activator.CreateInstance(typeof(T)); - - var res = (T)Activator.CreateInstance(typeof(T)); - res.Update(_allHardware[type][device].GetData()); - - _dataMutex.ReleaseMutex(); - - return res; - } - } - - [RioData("DriverStation")] - public class DriverStationData : HardwareTypeData { - public bool NewData { - get => (bool)_rawData.TryGetDefault(">new_data", false); - set { - _rawData[">new_data"] = value; - } - } - public bool Enabled { - get => (bool)_rawData.TryGetDefault(">enabled", false); - set { - _rawData[">enabled"] = value; - } - } - public bool Autonomous { - get => (bool)_rawData.TryGetDefault(">autonomous", false); - set { - _rawData[">autonomous"] = value; - } - } - public double MatchTime { - get => (double)_rawData.TryGetDefault(">match_time", -1.0); - set { - _rawData[">match_time"] = value; - } - } - - public override RioDataAttribute GetMetaData() - => GetMetaData(); - } - - [RioData("AI")] - public class AIData : HardwareTypeData { - public bool Init { - get => (bool)_rawData.TryGetDefault(" (double)_rawData.TryGetDefault(">voltage", 0.0); - set { - _rawData[">voltage"] = value; - } - } - - public override RioDataAttribute GetMetaData() - => GetMetaData(); - } - - [RioData("PWM")] - public class PWMData : HardwareTypeData { - public bool Init { - get => (bool)_rawData.TryGetDefault(" (double)_rawData.TryGetDefault(" (double)_rawData.TryGetDefault(" (int)_rawData.TryGetDefault(" (int)_rawData.TryGetDefault(" (bool)_rawData.TryGetDefault(" GetMetaData(); - } - - [RioData("dPWM")] - public class DPWMData : HardwareTypeData { - public bool Init { - get => (bool)_rawData.TryGetDefault(" (double)_rawData.TryGetDefault(" (int)_rawData.TryGetDefault(" GetMetaData(); - } - - [RioData("Encoder")] - public class EncoderData : HardwareTypeData { - public bool Init { - get => (bool)_rawData.TryGetDefault(" (long)_rawData.TryGetDefault(" (long)_rawData.TryGetDefault(" (int)_rawData.TryGetDefault(" (int)_rawData.TryGetDefault(">count", 0); - set { - _rawData[">count"] = value; - } - } - public float Period { - get => (float)_rawData.TryGetDefault(">period", 0f); - set { - _rawData[">period"] = value; - } - } - - public override RioDataAttribute GetMetaData() - => GetMetaData(); - } - - [JsonObject(MemberSerialization.OptIn)] - public abstract class HardwareTypeData { - - [JsonProperty] - protected Dictionary _rawData = new Dictionary(); - - public HardwareTypeData() { } - - /// - /// Converts data to JSON - /// - /// - public IReadOnlyDictionary GetData() { - return (IReadOnlyDictionary)_rawData; - } - - public void Update(IReadOnlyDictionary data) { - data.ForEach(kvp => _rawData[kvp.Key] = kvp.Value); - } - - public static RioDataAttribute GetMetaData() where T : HardwareTypeData { - var attr = Attribute.GetCustomAttributes(typeof(T)).Where(x => x is RioDataAttribute); - if (!attr.Any() || !(attr.First() is RioDataAttribute)) - throw new Exception($"Data type incorrectly registered: \"{typeof(T).FullName}\""); - - return (RioDataAttribute)attr.First(); - } - - public abstract RioDataAttribute GetMetaData(); - } - - public class RioDataAttribute : Attribute { - private readonly string _typeName; - public string RegisteredTypeName => _typeName; - - internal RioDataAttribute(string registeredTypeName) { - _typeName = registeredTypeName; - } - } -} diff --git a/api/Api/Runtime/ApiProvider.cs b/api/Api/Runtime/ApiProvider.cs deleted file mode 100644 index 5080909519..0000000000 --- a/api/Api/Runtime/ApiProvider.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System; -using System.Collections; -using System.Runtime.CompilerServices; -using Api.GUI; -using SynthesisAPI.EnvironmentManager; -using SynthesisAPI.Utilities; -using UnityEngine.UIElements; -using Component = SynthesisAPI.EnvironmentManager.Component; - -#nullable enable - -namespace SynthesisAPI.Runtime -{ - internal static class ApiProvider - { - private static IApiProvider? Instance => Inner.Instance; - - // why does this exist - public static void RegisterApiProvider(IApiProvider provider) - { - if (Inner.Instance != null) - { - throw new Exception("Attempt to register multiple API instances"); - } - - Inner.Instance = provider; - } - - private static class Inner - { - // ReSharper disable once EmptyConstructor - static Inner() {} - // ReSharper disable once MemberHidesStaticFromOuterClass - internal static IApiProvider? Instance; - } - - // Why would we get this far without having instance defined ? - // Why would the provider not just have possibly undefined function links if you are worried about unity? - // Why wouldn't instance be defined as a part of the construction process and make this a scoped object that stays alive and is part of a singleton ? - // This is very poorly designed, Blame Nick and Logan we gotta do better code reviews and teach people about nullable types. - - public static void AddEntityToScene(Entity entity) => Instance!.AddEntityToScene(entity); - - public static void RemoveEntityFromScene(Entity entity) => Instance!.RemoveEntityFromScene(entity); - - public static Component? AddComponentToScene(Entity entity, Type t) => Instance!.AddComponentToScene(entity,t); - - public static void AddComponentToScene(Entity entity, Component component) => Instance!.AddComponentToScene(entity, component); - - public static void RemoveComponentFromScene(Entity entity, Type t) => Instance!.RemoveComponentFromScene(entity, t); - - public static void EnqueueTaskForMainThread(Action task) => Instance!.EnqueueTaskForMainThread(task); - - public static UnityEngine.Coroutine? StartCoroutine(IEnumerator routine) => Instance!.StartCoroutine(routine); - public static void StopCoroutine(IEnumerator routine) => Instance?.StopCoroutine(routine); - - public static T CreateUnityType(params object[] args) where T : class => Instance!.CreateUnityType(args); - - public static VisualElement? GetRootVisualElement() => - Instance?.GetRootVisualElement(); - - internal static GUIManager GetGUIManager() => Instance!.GetGUIManager(); - } -} diff --git a/api/Api/Runtime/IApiProvider.cs b/api/Api/Runtime/IApiProvider.cs deleted file mode 100644 index 5a48e0ca2b..0000000000 --- a/api/Api/Runtime/IApiProvider.cs +++ /dev/null @@ -1,41 +0,0 @@ -using SynthesisAPI.EnvironmentManager; -using SynthesisAPI.Utilities; -using System; -using System.Collections; -using System.Runtime.CompilerServices; -using Api.GUI; -using UnityEngine.UIElements; -using Component = SynthesisAPI.EnvironmentManager.Component; - -namespace SynthesisAPI.Runtime -{ - internal interface IApiProvider - { - void AddEntityToScene(Entity entity); - - void RemoveEntityFromScene(Entity entity); - - #nullable enable - Component? AddComponentToScene(Entity entity, Type t); - - void AddComponentToScene(Entity entity, Component component); - - void RemoveComponentFromScene(Entity entity, Type t); - - void EnqueueTaskForMainThread(Action task); - - UnityEngine.Coroutine StartCoroutine(IEnumerator routine); - void StopCoroutine(IEnumerator routine); - - T CreateUnityType(params object[] args) where T : class; - - #region UI - - // TUnityType InstantiateFocusable() where TUnityType : UnityEngine.UIElements.Focusable; - UnityEngine.UIElements.VisualElement GetRootVisualElement(); - - GUIManager GetGUIManager(); - - #endregion - } -} diff --git a/api/Api/Simulation/Driver.cs b/api/Api/Simulation/Driver.cs deleted file mode 100644 index 86b79c1e92..0000000000 --- a/api/Api/Simulation/Driver.cs +++ /dev/null @@ -1,69 +0,0 @@ -using SynthesisAPI.Controller; - -namespace SynthesisAPI.Simulation { - public abstract class Driver { - protected string _name; - public string Name { - get => _name; - } - // What will the driver read to find out what to do - protected string[] _inputs; - // What will the driver write so others can know what has been done - protected string[] _outputs; - protected SimObject _simObject; - - public SimObject _SimObject { - get => _simObject; - } - - public ControllableState State { - get => _simObject.State; - } - - private bool _enabled = true; - public bool Enabled { - get => _enabled; - set { - if (_enabled != value) { - _enabled = value; - if (_enabled) - OnEnable(); - else - OnDisable(); - } - } - } - - public Driver(string name, string[] inputs, string[] outputs, SimObject simObject) { - _name = name; - _inputs = inputs; - _outputs = outputs; - _simObject = simObject; - - // if (GetType().FullName != typeof(Driver).FullName) // Idk if this is necessary - // SimulationManager.OnDriverUpdate += this.Update; - } - - ~Driver() { - // if (GetType().FullName != typeof(Driver).FullName) // Idk if this is necessary - // SimulationManager.OnDriverUpdate -= this.Update; - } - - protected virtual void OnEnable() { } - protected virtual void OnDisable() { } - public virtual void OnRemove() { } - public abstract void Update(); - public virtual void FixedUpdate() { } - - public override int GetHashCode() - => _inputs.GetHashCode() * 374124789 - + _outputs.GetHashCode() * 875920184 - + _simObject.GetHashCode() * 395018496; - - public override bool Equals(object obj) { - if (ReferenceEquals(obj, null)) - return false; - return obj.GetHashCode() == GetHashCode(); - } - } -} \ No newline at end of file diff --git a/api/Api/Simulation/SimBehaviour.cs b/api/Api/Simulation/SimBehaviour.cs deleted file mode 100644 index cd6059c21a..0000000000 --- a/api/Api/Simulation/SimBehaviour.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using SynthesisAPI.InputManager.Inputs; -using SynthesisAPI.Utilities; - -namespace SynthesisAPI.Simulation { - public abstract class SimBehaviour { - - protected List<(string key, string displayName)> _reservedInput = new List<(string key, string displayName)>(); - public IReadOnlyCollection<(string key, string displayName)> ReservedInput => _reservedInput.AsReadOnly(); - - private bool _enabled = false; - public bool Enabled { - get => _enabled; - set { - if (_enabled != value) { - _enabled = value; - if (_enabled) - OnEnable(); - else - OnDisable(); - } - } - } - - public string SimObjectId { get; protected set; } - public string MiraId { get; protected set; } - - /// - /// Constructor for a SimObject - /// - /// ID of the SimObject within the SimulationManager - /// A list of reserved inputs by the behaviour, along with a input to assign to each - public SimBehaviour(string simObjectId, bool autoEnable = true) { - Enabled = autoEnable; - SimObjectId = simObjectId; - string id = simObjectId; - int _i = id.IndexOf("_", 0); - MiraId = id.Remove(_i, id.Length - _i); - } - - public void InitInputs(params (string key, string displayName, Analog defaultInput)[] inputs) { - inputs.ForEach(x => { - _reservedInput.Add((x.key, x.displayName)); - InputManager.InputManager.AssignValueInput(x.key, x.defaultInput, true); - }); - } - - ~SimBehaviour() { - Enabled = false; - } - - protected virtual void OnEnable() { } - protected virtual void OnDisable() { } - public virtual void OnRemove() { } - public abstract void Update(); - public virtual void FixedUpdate() { } - } -} \ No newline at end of file diff --git a/api/Api/Simulation/SimObject.cs b/api/Api/Simulation/SimObject.cs deleted file mode 100644 index 7cf56adafc..0000000000 --- a/api/Api/Simulation/SimObject.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System.Collections.Generic; -using SynthesisAPI.Controller; -using Mirabuf.Signal; - -namespace SynthesisAPI.Simulation { - public class SimObject { - protected string _name; - public string Name { - get => _name; - } - - protected ControllableState _state; - public ControllableState State { - get => _state; - } - - protected bool _behavioursEnabled = true; - public bool BehavioursEnabled { - get => _behavioursEnabled; - set { - _behavioursEnabled = value; - SimulationManager.Behaviours[_name].ForEach(b => { - b.Enabled = _behavioursEnabled; - }); - } - } - - protected bool _driversEnabled = true; - public bool DriversEnabled { - get => _driversEnabled; - set { - _driversEnabled = value; - SimulationManager.Drivers[_name].ForEach(d => { - d.Enabled = _driversEnabled; - }); - } - } - - public SimObject(string name, Signals[] signalLayout) { - _name = name; - _state = new ControllableState(signalLayout); - } - - // This was Init. No idea why but it might need to be - public SimObject(string name, ControllableState state) { - _name = name; - _state = state; - } - - public virtual void Destroy() { } - - public List<(string key, string displayName)> GetAllReservedInputs() { - var res = new List<(string key, string displayName)>(); - SimulationManager.Behaviours[_name].ForEach(x => x.ReservedInput.ForEach(y => res.Add(y))); - return res; - } - - public override int GetHashCode() - => _name.GetHashCode() * 482901849; - } -} \ No newline at end of file diff --git a/api/Api/Simulation/SimulationManager.cs b/api/Api/Simulation/SimulationManager.cs deleted file mode 100644 index 86f64df08f..0000000000 --- a/api/Api/Simulation/SimulationManager.cs +++ /dev/null @@ -1,155 +0,0 @@ -using System; -using System.Linq; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using SynthesisAPI.EnvironmentManager; -using SynthesisAPI.Utilities; - -#nullable enable - -namespace SynthesisAPI.Simulation { - public static class SimulationManager { - public delegate void SimObjectEvent(SimObject entity); - - public static event SimObjectEvent? OnNewSimulationObject; - public static event SimObjectEvent? OnRemoveSimulationObject; - - internal static Dictionary _simObjects = new Dictionary(); - public static IReadOnlyDictionary SimulationObjects - = new ReadOnlyDictionary(_simObjects); - - public delegate void UpdateDelegate(); - public static event UpdateDelegate? OnDriverUpdate; - public static event UpdateDelegate? OnBehaviourUpdate; - public static event UpdateDelegate? OnDriverFixedUpdate; - public static event UpdateDelegate? OnBehaviourFixedUpdate; - - - // TODO: Switch to using guids cuz all the signals have the same name - public static Dictionary> Drivers = new Dictionary>(); - public static Dictionary> Behaviours = new Dictionary>(); - - public static void Update() { - Drivers.ForEach(x => { - if (_simObjects[x.Key].DriversEnabled) - x.Value.Where(y => y.Enabled).ForEach(y => y.Update()); - }); - if (OnDriverUpdate != null) - OnDriverUpdate(); - Behaviours.ForEach(x => { - if (_simObjects[x.Key].BehavioursEnabled) - x.Value.Where(y => y.Enabled).ForEach(y => y.Update()); - }); - if (OnBehaviourUpdate != null) - OnBehaviourUpdate(); - // _drivers.ForEach(x => x.Update()); - } - - public static void FixedUpdate() { - Drivers.ForEach(x => { - if (_simObjects[x.Key].DriversEnabled) - x.Value.Where(y => y.Enabled).ForEach(y => y.FixedUpdate()); - }); - if (OnDriverFixedUpdate != null) - OnDriverFixedUpdate(); - Behaviours.ForEach(x => { - if (_simObjects[x.Key].BehavioursEnabled) - x.Value.Where(y => y.Enabled).ForEach(y => y.FixedUpdate()); - }); - if (OnBehaviourFixedUpdate != null) - OnBehaviourFixedUpdate(); - // _drivers.ForEach(x => x.Update()); - } - - public static void AddDriver(string simObjectName, Driver d) - { - if (!Drivers.ContainsKey(simObjectName)) - { - Drivers[simObjectName] = new LinkedList(); - } - Drivers[simObjectName].AddLast(d); - } - - public static void AddBehaviour(string simObjectName, SimBehaviour d) - { - if (!Behaviours.ContainsKey(simObjectName)) - { - Behaviours[simObjectName] = new LinkedList(); - } - Behaviours[simObjectName].AddLast(d); - } - - public static bool RemoveDriver(string simObjectName, Driver d) - { - if (!Drivers.ContainsKey(simObjectName)) - return false; - - var list = Drivers[simObjectName]; - bool removed = false; - var cursor = list.First; - while (!removed && cursor != null) { - if (cursor.Value.Equals(d)) { - cursor.Value.OnRemove(); - list.Remove(cursor); - removed = true; - } - cursor = cursor.Next; - } - - return removed; - } - - public static bool RemoveBehaviour(string simObjectName, SimBehaviour b) { - if (!Behaviours.ContainsKey(simObjectName)) - return false; - - var list = Behaviours[simObjectName]; - bool removed = false; - var cursor = list.First; - while (!removed && cursor != null) { - if (cursor.Value.Equals(b)) { - cursor.Value.Enabled = false; - cursor.Value.OnRemove(); - list.Remove(cursor); - removed = true; - } - cursor = cursor.Next; - } - - return removed; - } - - public static void RegisterSimObject(SimObject so) { - if (_simObjects.ContainsKey(so.Name)) // Probably use some GUID - throw new Exception("Name already exists"); - _simObjects[so.Name] = so; - Drivers[so.Name] = new LinkedList(); - Behaviours[so.Name] = new LinkedList(); - - if (OnNewSimulationObject != null) - OnNewSimulationObject(so); - } - - public static bool RemoveSimObject(SimObject so) { - return RemoveSimObject(so.Name); - } - - public static bool RemoveSimObject(string so) { - bool exists = _simObjects.TryGetValue(so, out SimObject s); - if (!exists) - return false; - Drivers.Remove(so); - Behaviours.Remove(so); - var res = _simObjects.Remove(so); - if (res) { - s.Destroy(); - if (OnRemoveSimulationObject != null) { - OnRemoveSimulationObject(s); - } - } else { - Logger.Log("No sim object found by that name", LogLevel.Warning); - } - return res; - } - } -} \ No newline at end of file diff --git a/api/Api/Translation/Translator.cs b/api/Api/Translation/Translator.cs deleted file mode 100644 index 2303071754..0000000000 --- a/api/Api/Translation/Translator.cs +++ /dev/null @@ -1,694 +0,0 @@ -// Very Sad -Hunter -//using System; -//using System.Collections.Generic; -//using System.IO; -//using System.Text; -//using System.Threading.Tasks; -//using Google.Protobuf; -//using SynthesisAPI.Proto; -//using System.Linq; -//using System.Net; -//using System.Security.Cryptography; -//using System.Threading; -//using System.Xml; -//using Google.Protobuf.Reflection; -//using UnityEngine; -//using Material = SynthesisAPI.Proto.Material; -//using Mesh = SynthesisAPI.Proto.Mesh; -//using UQuat = UnityEngine.Quaternion; -//using UVec3 = UnityEngine.Vector3; -//using Logger = SynthesisAPI.Utilities.Logger; - -//namespace SynthesisAPI.Translation { - -// /// -// /// The Translator translates other serialized data into another form of serialized data. -// /// We use this to support legacy exported robots and fields -// /// -// public static class Translator { - -// public const string SERIALIZER_SIGNATURE = "PTL"; - -// public delegate Task TranslationFuncString(string path, string output = null); -// public delegate Task TranslationFuncBuffer(byte[] buf); - -// public static Dictionary Translations -// = new Dictionary() { -// { TranslationType.BXDF_TO_PROTO_FIELD, (BXDFToProtoFieldAsync, null) }, -// { TranslationType.BXDJ_TO_PROTO_ROBOT, (BXDJToProtoRobotAsync, null) } -// }; - -// #region Waited Functions - -// /// -// /// Loads serialized file and translates it to a different format -// /// -// /// Path to original file -// /// Optional path to where to write the new data to -// /// Path to the newly translated file -// public static string Translate(string path, TranslationType transType, string output = null) { -// var a = TranslateAsync(path, transType, output); -// a.Start(); -// a.Wait(); -// return a.Result; -// } - -// public static string Translate(string path, TranslationFuncString transFunc, string output = null) { -// var a = TranslateAsync(path, transFunc, output); -// a.Start(); -// a.Wait(); -// return a.Result; -// } -// public static byte[] Translate(byte[] buf, TranslationType transType) { -// var a = TranslateAsync(buf, transType); -// a.Start(); -// a.Wait(); -// return a.Result; -// } - -// public static byte[] Translate(byte[] buf, TranslationFuncBuffer transFunc) { -// var a = TranslateAsync(buf, transFunc); -// a.Start(); -// a.Wait(); -// return a.Result; -// } - -// #endregion - -// #region Asynchronous Functions - -// /// -// /// Loads serialized file and translates it to a different format -// /// -// /// Path to original file -// /// Optional path to where to write the new data to -// /// Task that results in a path to the newly translated file -// public static Task TranslateAsync(string path, TranslationType transType, string output = null) { -// if (!Translations.ContainsKey(transType)) -// return Task.FromResult(string.Empty); - -// return TranslateAsync(path, Translations[transType].strFunc, output); -// } - -// public static Task TranslateAsync(string path, TranslationFuncString transFunc, string output = null) { -// return transFunc(path, output); -// } - -// public static Task TranslateAsync(byte[] buf, TranslationType transType) { -// if (!Translations.ContainsKey(transType)) -// return Task.FromResult(new byte[0]); - -// return TranslateAsync(buf, Translations[transType].bufFunc); -// } - -// public static Task TranslateAsync(byte[] buf, TranslationFuncBuffer transFunc) { -// return transFunc(buf); -// } - -// #endregion - -// #region ToProto -// private static bool CPU_OPTIMIZE = false; - -// public static Task BXDFToProtoFieldAsync(string source, string output = null) { -// var myTask = new Task(() => { - -// var protoField = new ProtoField(); -// var protoNode = new Node(); - -// BXDAMesh mesh = new BXDAMesh(); -// mesh.ReadFromFile(source + Path.AltDirectorySeparatorChar + "mesh.bxda"); - -// var fieldDef = -// BXDFProperties.ReadProperties(source + Path.AltDirectorySeparatorChar + "definition.bxdf"); - -// var fieldData = new XmlDocument(); -// fieldData.LoadXml(File.ReadAllText(source + Path.AltDirectorySeparatorChar + "field_data.xml")); -// var gamepieceDefinitions = ParseFieldData(fieldData); -// protoField.GamepieceDefinitions.AddRange(gamepieceDefinitions); - -// var instances = new Dictionary>(); - -// foreach (var node in fieldDef.NodeGroup.EnumerateAllLeafFieldNodes()) { -// if (node.SubMeshID != -1) { -// if (!instances.ContainsKey(node.SubMeshID)) -// instances[node.SubMeshID] = new List<(FieldNode node, BXDVector3 position, BXDQuaternion rotation)>(); - -// instances[node.SubMeshID].Add((node, node.Position, node.Rotation)); -// } -// } - -// #region VisualMesh & Colliders - -// var meshColliders = new List(); -// // var boxColliders = new List(); // TODO: Box collider support -// var sphereColliders = new List(); -// var v = new List(); -// var t = new List(); -// var materials = new List(); -// var subMeshes = new List(); -// var materialsAndSubMeshes = new Dictionary>(); -// for (int j = 0; j < mesh.meshes.Count; j++) { -// var sub = mesh.meshes[j]; - -// for (int h = 0; h < instances[j].Count; h++) { - -// var colV = new List(); -// var colT = new List(); -// var gpMats = new List(); -// var gpSubMeshes = new List(); - -// int initVertCount = v.Count; - -// for (int k = 0; k < sub.surfaces.Count; k++) { -// var surf = sub.surfaces[k]; -// var cpy = new int[surf.indicies.Length]; -// Array.Copy(surf.indicies, cpy, cpy.Length); -// Array.Reverse(cpy); -// var start = t.Count + colT.Count; -// foreach (int a in cpy) { -// colT.Add(a); -// } - -// var mat = (Material)surf; -// if (CPU_OPTIMIZE) { -// if (!materialsAndSubMeshes.ContainsKey(mat)) -// materialsAndSubMeshes[mat] = new List<(int start, int length)>(); -// materialsAndSubMeshes[mat].Add((start, (t.Count + colT.Count) - start)); -// } - -// var subMesh = new SubMeshDescription() { Start = start, Count = (t.Count + colT.Count) - start }; -// gpSubMeshes.Add(subMesh); -// gpMats.Add(mat); -// } - -// for (int k = 0; k < sub.verts.Length; k += 3) { -// var vec = new BXDVector3() { -// x = (float)sub.verts[k], y = (float)sub.verts[k + 1], z = (float)sub.verts[k + 2] -// }; -// var moddedVec = ModVec(instances[j][h].rotation, vec, instances[j][h].position); -// colV.Add(moddedVec); -// } - -// Gamepiece gamepiece = null; -// var isGamepiece = false; - -// if (fieldDef.GetPropertySets().ContainsKey(instances[j][h].node.PropertySetID)) { -// var propertySet = fieldDef.GetPropertySets()[instances[j][h].node.PropertySetID]; -// var colliderType = propertySet -// .Collider -// .CollisionType; - -// gamepiece = new Gamepiece(); -// isGamepiece = gamepieceDefinitions.Exists(x => x.Name == propertySet.PropertySetID); -// if (isGamepiece) { -// gamepiece.Definition = gamepieceDefinitions.Find(x => x.Name == propertySet.PropertySetID); -// var bounds = colV.Bounds(); -// gamepiece.Position = (bounds.min + bounds.max) / 2; -// colV = colV.Map(x => x - gamepiece.Position); -// gpSubMeshes = gpSubMeshes.Map(x => new SubMeshDescription() { -// Start = x.Start - t.Count, -// Count = x.Count -// }); -// gamepiece.VisualMaterials.AddRange(gpMats); -// Mesh vm = new Mesh(); -// vm.Vertices.AddRange(colV); -// vm.Triangles.AddRange(colT); -// vm.SubMeshes.AddRange(gpSubMeshes); -// gamepiece.VisualMesh = vm; -// gamepiece.PhysicalProperties = new PhysProps { -// Mass = propertySet.Mass, DynamicFriction = (propertySet.Friction / 100.0f), -// StaticFriction = (propertySet.Friction / 100.0f), CenterOfMass = new Vec3() -// }; - -// // Logger.Log() -// Logger.Log("Found Existing Gamepiece"); -// } - -// switch (colliderType) { -// case PropertySet.PropertySetCollider.PropertySetCollisionType.BOX: // MARK: Wow, are box colliders annoying -// case PropertySet.PropertySetCollider.PropertySetCollisionType.MESH: -// Mesh colliderMesh = new Mesh(); -// colliderMesh.Vertices.AddRange(colV); -// colliderMesh.Triangles.AddRange(colT); -// colliderMesh.SubMeshes.Add(new SubMeshDescription() -// { Start = 0, Count = colT.Count }); -// if (isGamepiece) { -// // gamepiece.ColliderCase = Gamepiece.ColliderOneofCase.MeshCollider; -// gamepiece.MeshCollider = colliderMesh; -// } else { -// meshColliders.Add(colliderMesh); -// } -// break; -// case PropertySet.PropertySetCollider.PropertySetCollisionType.SPHERE: -// if (isGamepiece) { -// gamepiece.SphereCollider = Sphere.CreateFromVerts(colV); -// } else { -// sphereColliders.Add(Sphere.CreateFromVerts(colV)); -// } -// break; -// } -// } - -// if (isGamepiece) { -// protoField.Gamepieces.Add(gamepiece); -// } else { -// v.AddRange(colV); -// t.AddRange(colT.Map(x => x + initVertCount)); -// subMeshes.AddRange(gpSubMeshes); -// materials.AddRange(gpMats); -// } -// } -// } - -// Mesh m = new Mesh(); - -// // Organize indices and materials. This should hopefully perform better -// if (CPU_OPTIMIZE) { -// var organizedIndices = new List(); -// var organizedSubMeshes = new List(); -// var organizedMaterials = new List(); -// int vertTotal = 0; -// foreach (var kvp in materialsAndSubMeshes) { -// organizedMaterials.Add(kvp.Key); -// var subMesh = new SubMeshDescription() { Start = organizedIndices.Count }; -// int indicesCountForMaterial = 0; - -// kvp.Value.ForEach(x => { -// indicesCountForMaterial += x.length; -// vertTotal += x.length / 3; -// organizedIndices.AddRange(t.Skip(x.start).Take(x.length)); -// }); -// subMesh.Count = indicesCountForMaterial; -// Logger.Log($"{subMesh.Count / 3} verts in sub mesh"); -// organizedSubMeshes.Add(subMesh); -// } - -// Logger.Log($"{vertTotal} total vertices"); - -// m.Vertices.AddRange(v); -// // Logger.Log($"{m.Vertices.Count} verts"); -// m.Triangles.AddRange(organizedIndices); -// m.SubMeshes.AddRange(organizedSubMeshes); -// protoNode.VisualMaterials.AddRange(organizedMaterials); -// } else { -// m.Vertices.AddRange(v); -// Logger.Log($"{m.Vertices.Count} verts"); -// m.Triangles.AddRange(t); -// m.SubMeshes.AddRange(subMeshes); -// protoNode.VisualMaterials.AddRange(materials); -// } - -// protoNode.VisualMesh = m; - -// protoNode.MeshColliders.AddRange(meshColliders); -// protoNode.SphereColliders.AddRange(sphereColliders); - -// Logger.Log($"{meshColliders.Count} Mesh Colliders"); -// Logger.Log($"{sphereColliders.Count} Sphere Colliders"); -// #endregion - -// protoNode.PhysicalProperties = new PhysProps { Mass = 1, CenterOfMass = new Vec3() }; -// protoNode.Guid = mesh.GUID; -// protoNode.ParentGuid = null; -// protoNode.IsStatic = true; - -// #region Serialization -// DynamicObject dyno = new DynamicObject(); -// dyno.Nodes.Add(protoNode); -// string name = source.Substring(source.LastIndexOf(Path.AltDirectorySeparatorChar) + 1); -// dyno.Name = name; - -// protoField.Object = dyno; -// protoField.SerializerSignature = SERIALIZER_SIGNATURE; - -// return protoField.Serialize(output); - -// #endregion -// }); -// return myTask; -// } - -// public static Task BXDJToProtoRobotAsync(string source, string output = null) { -// Logger.Log("Creating Task"); - -// var myTask = new Task(() => { - -// Logger.Log("Starting Translation from BXDJ to Proto"); -// var rootNode = ReadSkeletonSafe(source + Path.AltDirectorySeparatorChar + "skeleton"); -// var nodes = rootNode.ListAllNodes(); - -// var protoNodes = new Node[nodes.Count]; -// var nodeTasks = new List(); - -// var bxdMeshes = new Dictionary(); -// var collectivePhysProps = new Dictionary(); -// var childrenDirectory = new Dictionary>(); -// var collectiveMasses = new Dictionary(); - -// for (int i = 0; i < nodes.Count; i++) { -// var mesh = new BXDAMesh(); -// mesh.ReadFromFile(source + Path.AltDirectorySeparatorChar + nodes[i].ModelFileName); -// bxdMeshes.Add(nodes[i].GUID, mesh); - -// var physProps = new PhysProps { -// Mass = mesh.physics.mass, CenterOfMass = mesh.physics.centerOfMass -// }; - -// if (nodes[i].GetParent() != null) { -// if (childrenDirectory.ContainsKey(nodes[i].GetParent().GUID)) -// childrenDirectory[nodes[i].GetParent().GUID].Add(nodes[i].GUID); -// else -// childrenDirectory.Add(nodes[i].GetParent().GUID, new List(new Guid[] { nodes[i].GUID })); -// } - -// collectivePhysProps.Add(nodes[i].GUID, physProps); -// Logger.Log($"All physical properties saved for node {i + 1}"); -// } -// foreach (var n in nodes) { -// float collectMass = bxdMeshes[n.GUID].physics.mass + GetCollectiveMass(n.GUID, bxdMeshes, childrenDirectory); -// collectiveMasses[n.GUID] = collectMass; -// } -// Logger.Log("Cached all mesh data"); - -// object wheelAxisLock = new object(); -// Vec3 wheelAxis = null; - -// for (int _i = 0; _i < nodes.Count; _i++) { -// int i = _i; -// Logger.Log($"Creating node task {_i + 1}"); -// nodeTasks.Add(new Task(() => { - -// try { - -// var mesh = bxdMeshes.Values.ElementAt(i); -// Logger.Log($"Starting node {i + 1} translation"); -// var protoNode = new Node { -// Guid = nodes[i].GUID -// }; -// if (nodes[i].GetParent() == null) -// protoNode.ParentGuid = null; -// else -// protoNode.ParentGuid = nodes[i].GetParent().GUID; - -// protoNode.PhysicalProperties = collectivePhysProps[nodes[i].GUID]; - -// #region Visual Mesh - -// var v = new List(); -// var t = new List(); -// var materials = new List(); -// var subMeshes = new List(); -// for (int j = 0; j < mesh.meshes.Count; j++) { -// var sub = mesh.meshes[j]; - -// for (int k = 0; k < sub.surfaces.Count; k++) { -// var surf = sub.surfaces[k]; -// var cpy = new int[surf.indicies.Length]; -// Array.Copy(surf.indicies, cpy, cpy.Length); -// Array.Reverse(cpy); -// var start = t.Count; -// foreach (int a in cpy) { -// t.Add(a + v.Count); -// } -// subMeshes.Add(new SubMeshDescription() { Start = start, Count = t.Count - start }); - -// materials.Add((Material)surf); -// } -// for (int k = 0; k < sub.verts.Length; k += 3) { -// v.Add(new Vec3 { X = (float)(sub.verts[k] * -0.01), Y = (float)(sub.verts[k + 1] * 0.01), Z = (float)(sub.verts[k + 2] * 0.01) }); -// } -// } -// Mesh m = new Mesh(); -// m.Vertices.AddRange(v); -// m.Triangles.AddRange(t); -// m.SubMeshes.AddRange(subMeshes); -// protoNode.VisualMesh = m; -// protoNode.VisualMaterials.AddRange(materials); -// #endregion -// Logger.Log($"Completed Visual Mesh for node {i + 1}"); - -// #region Collision Meshes - -// var colliders = new List(); -// for (int j = 0; j < mesh.colliders.Count; j++) { -// var sub = mesh.colliders[j]; -// v.Clear(); -// t.Clear(); -// subMeshes.Clear(); - -// for (int k = 0; k < sub.surfaces.Count; k++) { -// var cpy = new int[sub.surfaces[k].indicies.Length]; -// Array.Copy(sub.surfaces[k].indicies, cpy, cpy.Length); -// Array.Reverse(cpy); -// var start = t.Count; -// t.AddRange(cpy); -// subMeshes.Add(new SubMeshDescription() { Start = start, Count = t.Count - start }); -// } -// for (int k = 0; k < sub.verts.Length; k += 3) { -// v.Add(new Vec3 { X = (float)(sub.verts[k] * -0.01), Y = (float)(sub.verts[k + 1] * 0.01), Z = (float)(sub.verts[k + 2] * 0.01) }); -// } - -// m = new Mesh(); -// m.Vertices.AddRange(v); -// m.Triangles.AddRange(t); -// m.SubMeshes.AddRange(subMeshes); -// colliders.Add(m); -// } -// protoNode.MeshColliders.AddRange(colliders); -// #endregion -// Logger.Log($"Completed Colliders for node {i + 1}"); - -// #region Joint -// // Joint -// var skeletalJoint = nodes[i].GetSkeletalJoint(); -// if (skeletalJoint != null) { -// var jointType = skeletalJoint.GetJointType(); - -// switch (jointType) { -// case SkeletalJointType.ROTATIONAL: - -// var jointData = skeletalJoint as RotationalJoint_Base; -// var rotationalJoint = new RotationalJoint(); -// rotationalJoint.ConnectedBody = nodes[i].GetParent().GUID; -// rotationalJoint.Anchor = jointData.basePoint; -// rotationalJoint.Axis = ((Vec3)jointData.axis).Normalize(); -// if (jointData.hasAngularLimit) { -// rotationalJoint.UseLimits = true; -// rotationalJoint.CurrentAngle = RadiansToDegrees(jointData.currentAngularPosition); -// rotationalJoint.LowerLimit = RadiansToDegrees(jointData.angularLimitLow); -// rotationalJoint.UpperLimit = RadiansToDegrees(jointData.angularLimitHigh); -// } else { -// rotationalJoint.UseLimits = false; -// } -// rotationalJoint.MassScale = collectiveMasses[nodes[i].GetParent().GUID] / collectiveMasses[nodes[i].GUID]; - -// rotationalJoint.IsWheel = HasDriverMeta(nodes[i]) && GetDriverMeta(nodes[i]).type != WheelType.NOT_A_WHEEL; -// if (rotationalJoint.IsWheel) { -// // TODO: Axis correction? -// switch (GetDriverMeta(nodes[i]).type) { -// case WheelType.NORMAL: -// rotationalJoint.WheelType = -// RotationalJoint.Types.ProtoWheelType.Normal; -// break; -// case WheelType.OMNI: -// rotationalJoint.WheelType = -// RotationalJoint.Types.ProtoWheelType.Omni; -// break; -// case WheelType.MECANUM: -// rotationalJoint.WheelType = -// RotationalJoint.Types.ProtoWheelType.Mecanum; -// break; -// } - -// var bounds = protoNode.VisualMesh.Vertices.Bounds(); -// var center = (bounds.min + bounds.max) / 2; -// var radius = (bounds.max - bounds.min).Magnitude / 2; -// protoNode.MeshColliders.Clear(); -// protoNode.SphereColliders.Add(new Sphere() {Center = center, Radius = radius}); -// protoNode.PhysicalProperties.StaticFriction = 2.2f; -// protoNode.PhysicalProperties.DynamicFriction = 0.9f; - -// lock (wheelAxisLock) { -// if (wheelAxis == null) { -// wheelAxis = rotationalJoint.Axis; -// Logger.Log( -// $"Axis Choosen: {wheelAxis.X}, {wheelAxis.Y}, {wheelAxis.Z}"); -// } else if ((wheelAxis - rotationalJoint.Axis).Magnitude > 0.05f) { -// Logger.Log( -// $"Axis Replaced: {rotationalJoint.Axis.X}, {rotationalJoint.Axis.Y}, {rotationalJoint.Axis.Z}"); -// rotationalJoint.Axis = wheelAxis; -// } - -// } -// } - -// protoNode.RotationalJoint = rotationalJoint; // I think? - -// break; -// default: -// protoNode.OtherJoint = new OtherJoint() { -// ConnectedBody = nodes[i].GetParent().GUID, -// MassScale = collectiveMasses[nodes[i].GetParent().GUID] / collectiveMasses[nodes[i].GUID] -// }; -// break; -// } -// } -// #endregion -// Logger.Log($"Completed Joint for node {i + 1}"); - -// protoNodes[i] = protoNode; - -// } catch (Exception e) { -// Logger.Log($"Node {i} has a whoopsie"); -// Logger.Log(e.Message); -// Logger.Log(e.StackTrace); -// throw new Exception(); -// } - -// })); -// } - -// nodeTasks.ForEach(x => x.Start()); -// Logger.Log("All node tasks created. Waiting..."); -// nodeTasks.ForEach(x => x.Wait()); -// Logger.Log("Finished all node task"); - -// #region Serialization - -// var dyno = new DynamicObject(); -// dyno.Nodes.AddRange(protoNodes); -// dyno.Name = source.Substring(source.LastIndexOf(Path.AltDirectorySeparatorChar) + 1); - -// var protoRobot = new ProtoRobot(); -// protoRobot.Object = dyno; -// protoRobot.SerializerSignature = SERIALIZER_SIGNATURE; - -// string o = protoRobot.Serialize(output); - -// #endregion - -// Logger.Log(" === BXDJ to Proto translation complete === "); -// return o; -// }); - -// Logger.Log("Task created"); -// return myTask; -// } - -// private static List ParseFieldData(XmlDocument doc) { -// var root = doc.FirstChild; - -// Logger.Log(doc.OuterXml); - -// var gamepieceXmls = doc.SelectNodes("/FieldData/General/Gamepieces/gamepiece").ToList(); - -// var gamepieceDefinitions = new List(); -// gamepieceXmls.ForEach(x => { -// Logger.Log("Checking for Gamepiece"); -// if (x.Attributes.Count != 0) { // WHY -// var id = x.Attributes["id"].Value; -// // TODO: Holding limit? -// var X = float.Parse(x.Attributes["x"].Value); -// var Y = float.Parse(x.Attributes["y"].Value); -// var Z = float.Parse(x.Attributes["z"].Value); -// Vec3 spawnPoint = new Vec3 { X = X, Y = Y, Z = Z }; -// gamepieceDefinitions.Add(new GamepieceDefinition { Name = id, SpawnLocation = spawnPoint }); -// Logger.Log($"Registering Gamepiece: {id}"); -// } -// }); -// return gamepieceDefinitions; -// } - -// public static Vec3 ModVec(BXDQuaternion q, BXDVector3 original, BXDVector3 offset) { -// var uvec = new UVec3(original.x * -0.01f, original.y * 0.01f, original.z * 0.01f); -// var uquat = new UQuat(-q.X, q.Y, q.Z, -q.W).normalized; -// var v = uquat * uvec; -// return new Vec3() { X = v.x + (offset.x * -0.01f), Y = v.y + (offset.y * 0.01f), Z = v.z + (offset.z * 0.01f) }; -// } - -// private static float GetCollectiveMass(Guid a, Dictionary meshes, Dictionary> children) { -// if (!children.ContainsKey(a)) -// return 0; -// float sum = 0.0f; -// foreach (var child in children[a]) { -// sum += meshes[child].physics.mass; -// sum += GetCollectiveMass(child, meshes, children); -// } -// return sum; -// } - -// private static RigidNode_Base GetRoot(RigidNode_Base a) { -// RigidNode_Base b; -// while ((b = a.GetParent()) != null) -// a = b; -// return a; -// } - -// private static RigidNode_Base ReadSkeletonSafe(string path) { -// string jsonPath = path + ".json"; -// string xmlPath = path + ".bxdj"; -// RigidNode_Base node = null; -// if (File.Exists(jsonPath)) { -// node = BXDJSkeletonJson.ReadSkeleton(jsonPath); -// } else { -// node = BXDJSkeleton.ReadSkeleton(xmlPath); -// } -// return node; -// } - -// public static T GetDriverMeta(RigidNode_Base node) where T : JointDriverMeta { -// return node != null && node.GetSkeletalJoint() != null && node.GetSkeletalJoint().cDriver != null ? node.GetSkeletalJoint().cDriver.GetInfo() : null; -// } - -// public static bool HasDriverMeta(RigidNode_Base node) where T : JointDriverMeta { -// return GetDriverMeta(node) != null; -// } -// #endregion - -// #region Misc - -// public static float RadiansToDegrees(float a) => (a * 180.0f) / (float)Math.PI; - -// public struct TranslationType { - -// public static readonly TranslationType BXDJ_TO_PROTO_ROBOT = new TranslationType("bxdj_proto_robot"); -// public static readonly TranslationType BXDF_TO_PROTO_FIELD = new TranslationType("bxdf_proto_field"); - -// public string Indentifier { get; private set; } - -// public TranslationType(string indentifier) { -// Indentifier = indentifier; -// } -// } - -// private static HashAlgorithm sha = SHA256.Create(); -// /// -// /// Hashes the contents of a file at a path -// /// -// /// Path to file to generate hash -// /// Hash -// public static byte[] TempFileHash(string path) => sha.ComputeHash(File.ReadAllBytes(path)); -// /// -// /// Hashes a byte buffer -// /// -// /// Content to hash -// /// Hash -// public static byte[] TempFileHash(byte[] content) => sha.ComputeHash(content); -// /// -// /// Hashes the contents of a file at a path -// /// -// /// Path to file to generate hash -// /// File name -// public static string TempFileName(string path) => TempFileHash(File.ReadAllBytes(path)).ToHexString(); -// /// -// /// Hashes a byte buffer -// /// -// /// Content to hash -// /// File name -// public static string TempFileName(byte[] content) => TempFileHash(content).ToHexString(); - -// #endregion - -// } -//} diff --git a/api/Api/UIManager/ApplicationWindow.cs b/api/Api/UIManager/ApplicationWindow.cs deleted file mode 100644 index 088b8be777..0000000000 --- a/api/Api/UIManager/ApplicationWindow.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace SynthesisAPI.UIManager -{ - public static class ApplicationWindow - { - public static int Width => UnityEngine.Screen.width; - public static int Height => UnityEngine.Screen.height; - } -} diff --git a/api/Api/UIManager/ClosePanelEvent.cs b/api/Api/UIManager/ClosePanelEvent.cs deleted file mode 100644 index 34ec7eb100..0000000000 --- a/api/Api/UIManager/ClosePanelEvent.cs +++ /dev/null @@ -1,15 +0,0 @@ -using SynthesisAPI.EventBus; -using SynthesisAPI.UIManager.UIComponents; - -namespace SynthesisAPI.UIManager -{ - public class ClosePanelEvent : IEvent - { - public Panel Panel; - - public ClosePanelEvent(Panel panel) - { - Panel = panel; - } - } -} \ No newline at end of file diff --git a/api/Api/UIManager/DragManipulator.cs b/api/Api/UIManager/DragManipulator.cs deleted file mode 100644 index 56f1d1ecda..0000000000 --- a/api/Api/UIManager/DragManipulator.cs +++ /dev/null @@ -1,85 +0,0 @@ -using MathNet.Spatial.Euclidean; -using SynthesisAPI.Utilities; -using UnityEngine.UIElements; - -namespace SynthesisAPI.UIManager -{ - /// - /// A manipulator that makes a visual element draggable - /// - /// Taken from a Unity demo at: - /// https://github.com/Unity-Technologies/UIElementsUniteLATurretDemo/blob/master/Assets/Demo/Editor/TextureDragger.cs - /// - internal class DragManipulator : MouseManipulator - { - private Vector2D startPosition; - protected bool isActive; - - public DragManipulator() - { - activators.Add(new ManipulatorActivationFilter { button = MouseButton.LeftMouse }); - isActive = false; - } - - protected override void RegisterCallbacksOnTarget() - { - target.RegisterCallback(OnMouseDown); - target.RegisterCallback(OnMouseMove); - target.RegisterCallback(OnMouseUp); - } - - protected override void UnregisterCallbacksFromTarget() - { - target.UnregisterCallback(OnMouseDown); - target.UnregisterCallback(OnMouseMove); - target.UnregisterCallback(OnMouseUp); - } - - private void OnMouseDown(MouseDownEvent e) - { - if (isActive) - { - e.StopImmediatePropagation(); - return; - } - - if (CanStartManipulation(e)) - { - startPosition = e.localMousePosition.Map(); - - isActive = true; - target.CaptureMouse(); - e.StopPropagation(); - } - } - - private void OnMouseMove(MouseMoveEvent e) - { - if (!isActive || !target.HasMouseCapture()) - return; - - var diff = e.localMousePosition.Map() - startPosition; - - var newTop = target.worldBound.y + diff.Y; - var newLeft = target.worldBound.x + diff.X; - - if (newTop > -e.localMousePosition.y && (newTop + e.localMousePosition.y) < UnityEngine.Screen.height) - target.style.top = (StyleLength)(target.layout.y + diff.Y); - - if (newLeft > -e.localMousePosition.x && (newLeft + e.localMousePosition.x) < UnityEngine.Screen.width) - target.style.left = (StyleLength)newLeft; - - e.StopPropagation(); - } - - private void OnMouseUp(MouseUpEvent e) - { - if (!isActive || !target.HasMouseCapture() || !CanStopManipulation(e)) - return; - - isActive = false; - target.ReleaseMouse(); - e.StopPropagation(); - } - } -} diff --git a/api/Api/UIManager/SelectTabEvent.cs b/api/Api/UIManager/SelectTabEvent.cs deleted file mode 100644 index 5cb61406bc..0000000000 --- a/api/Api/UIManager/SelectTabEvent.cs +++ /dev/null @@ -1,14 +0,0 @@ -using SynthesisAPI.EventBus; - -namespace SynthesisAPI.UIManager -{ - public class SelectTabEvent: IEvent - { - public string TabName; - - public SelectTabEvent(string tabName) - { - TabName = tabName; - } - } -} \ No newline at end of file diff --git a/api/Api/UIManager/ShowPanelEvent.cs b/api/Api/UIManager/ShowPanelEvent.cs deleted file mode 100644 index 61467afdfc..0000000000 --- a/api/Api/UIManager/ShowPanelEvent.cs +++ /dev/null @@ -1,15 +0,0 @@ -using SynthesisAPI.EventBus; -using SynthesisAPI.UIManager.UIComponents; - -namespace SynthesisAPI.UIManager -{ - public class ShowPanelEvent : IEvent - { - public Panel Panel; - - public ShowPanelEvent(Panel panel) - { - Panel = panel; - } - } -} \ No newline at end of file diff --git a/api/Api/UIManager/StyleSheet.cs b/api/Api/UIManager/StyleSheet.cs deleted file mode 100644 index 9b020aaa7a..0000000000 --- a/api/Api/UIManager/StyleSheet.cs +++ /dev/null @@ -1,92 +0,0 @@ -using _UnityVisualElement = UnityEngine.UIElements.VisualElement; -using System.Collections.Generic; -using SynthesisAPI.Utilities; - -#nullable enable - -namespace SynthesisAPI.UIManager -{ - public class StyleSheet - { - private Dictionary classes = new Dictionary(); - - public StyleSheet(string[] contents) - { - ParseLines(contents); - } - - private void ParseLines(string[] lines) - { - UssClass? currentClass = null; - - foreach (string rawLine in lines) - { - string line = rawLine.Trim(); // removes indentation spaces on left - - if (line.StartsWith(".")) - { - if(line[line.Length - 1] == '{') - { - line = line.Substring(0, line.Length - 1).Trim(); // remove " {" from line - } - string[] lineContents = line.Split('.'); - string className = lineContents[1]; - - currentClass = new UssClass(className); - //Logger.Log("[UI] New class found with name [" + className + "]"); - } - else if (line.StartsWith("}")) - { - if (currentClass != null) - { - if (HasClass(currentClass.ClassName)) - { - Logger.Log($"Stylesheet defines class with duplicate name: {currentClass.ClassName}", LogLevel.Warning); - } - else - { - classes.Add(currentClass.ClassName, currentClass); - } - } - } - else if (line.StartsWith("#")) - { - Logger.Log("Stylesheet contains ID identifier '#' which is not currently supported", LogLevel.Error); - } - else - { - if (currentClass != null && line.Length > 2) - { - if (line.StartsWith("border-") && line.EndsWith("px;")) - { - currentClass.AddLine(line.Substring(0, line.Length - 3)); // substring to remove px and semicolon - } - else - { - currentClass.AddLine(line.Substring(0, line.Length - 1)); // substring to remove semicolon - } - } - } - } - } - - public bool HasClass(string className) - { - return classes.ContainsKey(className); - } - - internal _UnityVisualElement? ApplyClassToVisualElement(string className, _UnityVisualElement? visualElement) - { - //Logger.Log("[UI] Attempting to apply class [" + className + "] to [" + visualElement.name + "]"); - UssClass ussClass = classes[className]; - - foreach (string line in ussClass.Lines) - { - visualElement = UIParser.ParseEntry(line, visualElement); - } - - return visualElement; - } - - } -} \ No newline at end of file diff --git a/api/Api/UIManager/StyleSheetManager.cs b/api/Api/UIManager/StyleSheetManager.cs deleted file mode 100644 index 231d33e208..0000000000 --- a/api/Api/UIManager/StyleSheetManager.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System.Collections.Generic; -using SynthesisAPI.AssetManager; -using SynthesisAPI.Utilities; - -#nullable enable - -namespace SynthesisAPI.UIManager -{ - public class StyleSheetManager - { - private static Dictionary styleSheets = new Dictionary(); - - public static void AttemptRegistryOfNewStyleSheet(UssAsset asset) - { - // Logger.Log("[UI] Attempting registry of new stylesheet with name [" + asset.Name + "]"); - if (!styleSheets.ContainsKey(asset.Name) && asset.StyleSheet != null) - { - styleSheets.Add(asset.Name, asset.StyleSheet); - } - } - - internal static UnityEngine.UIElements.VisualElement? ApplyClassFromStyleSheets(string className, UnityEngine.UIElements.VisualElement? visualElement) - { - // Logger.Log("[UI] ApplyClassFromStyleSheets called with [" + styleSheets.Count + "] stylesheets loaded"); - foreach (StyleSheet styleSheet in styleSheets.Values) - { - if (styleSheet.HasClass(className)) - { - // Logger.Log("[UI] Class [" + className + "] found in stylesheet"); - return styleSheet.ApplyClassToVisualElement(className, visualElement); - } - } - - string visualElementName = visualElement != null ? visualElement.name : "null"; - Logger.Log("Could not apply class [" + className + "] to [" + visualElementName + "] with [" + styleSheets.Count + "] stylesheets currently loaded", LogLevel.Warning); - - return visualElement; - } - } -} \ No newline at end of file diff --git a/api/Api/UIManager/TooltipManipulator.cs b/api/Api/UIManager/TooltipManipulator.cs deleted file mode 100644 index 98de213194..0000000000 --- a/api/Api/UIManager/TooltipManipulator.cs +++ /dev/null @@ -1,119 +0,0 @@ -using SynthesisAPI.Runtime; -using System.Collections; -using UnityEngine.UIElements; - -#nullable enable - -namespace SynthesisAPI.UIManager -{ - /// - /// A manipulator that adds a tooltip to a visual element - /// - internal class TooltipManipulator : MouseManipulator - { - private const int HoverDuration = 1000; // ms - - private static UnityEngine.Vector2 mousePosition; - - private static bool isTooltipOpen; - private static IEnumerator? timerCoroutine = null; - - private static VisualElements.Label? tooltip = null; - - public string Text; - - public TooltipManipulator(string text = "") - { - isTooltipOpen = false; - Text = text; - } - - protected override void RegisterCallbacksOnTarget() - { - target.RegisterCallback(OnMouseMove); - target.RegisterCallback(OnMouseLeave); - } - - protected override void UnregisterCallbacksFromTarget() - { - target.UnregisterCallback(OnMouseMove); - target.UnregisterCallback(OnMouseLeave); - } - - private void OnMouseLeave(MouseLeaveEvent e) - { - CancelTooltips(); - } - - private void OnMouseMove(MouseMoveEvent e) - { - CancelTooltips(); - - mousePosition = e.mousePosition; - - timerCoroutine = StartTimer(); - ApiProvider.StartCoroutine(timerCoroutine); - - e.StopPropagation(); - } - - private IEnumerator StartTimer() - { - yield return new UnityEngine.WaitForSeconds(HoverDuration / 1000f); - - OpenTooltip(); - } - - private void OpenTooltip() - { - if (!isTooltipOpen && Text != "") - { - isTooltipOpen = true; - if (tooltip == null) - { - tooltip = new VisualElements.Label - { - Name = "test-tooltip" - }; - - tooltip.AddToClassList("tooltip"); - - tooltip.SetStyleProperty("height", "25px"); - } - - tooltip.SetStyleProperty("top", $"{mousePosition.y + 15}px"); - tooltip.SetStyleProperty("left", $"{mousePosition.x + 12}px"); - - tooltip.Text = Text; - - double width = tooltip.Text.Length * 6.3; - tooltip.SetStyleProperty("width", $"{(int)width}px"); - - UIManager.RootElement.Add(tooltip); - } - } - - private void CloseTooltip() - { - if (isTooltipOpen) - { - // if tooltip is open then tooltip will not be null - tooltip!.RemoveFromHierarchy(); - isTooltipOpen = false; - } - } - - private void CancelTooltips() - { - if (timerCoroutine != null) - { - ApiProvider.StopCoroutine(timerCoroutine); - timerCoroutine = null; - } - if (isTooltipOpen) - { - CloseTooltip(); - } - } - } -} diff --git a/api/Api/UIManager/UIComponents/Panel.cs b/api/Api/UIManager/UIComponents/Panel.cs deleted file mode 100644 index c2755b6fb3..0000000000 --- a/api/Api/UIManager/UIComponents/Panel.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using SynthesisAPI.AssetManager; -using SynthesisAPI.UIManager.VisualElements; - -#nullable enable - -namespace SynthesisAPI.UIManager.UIComponents -{ - public struct Panel - { - public string Name { get; private set; } - public VisualElementAsset Ui { get; private set; } - public Action BindPanel { get; set; } - public bool CachePanel { get; set; } - internal VisualElement? PanelElement; - - public Panel(string name, VisualElementAsset ui, Action bindPanel, bool cachePanel = true) - { - Name = name; - Ui = ui; - BindPanel = bindPanel; - CachePanel = cachePanel; - PanelElement = null; - } - - } -} \ No newline at end of file diff --git a/api/Api/UIManager/UIComponents/Tab.cs b/api/Api/UIManager/UIComponents/Tab.cs deleted file mode 100644 index 3e8937ef1d..0000000000 --- a/api/Api/UIManager/UIComponents/Tab.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using SynthesisAPI.AssetManager; -using SynthesisAPI.UIManager.VisualElements; - -#nullable enable - -namespace SynthesisAPI.UIManager.UIComponents -{ - public struct Tab - { - public string Name { get; private set; } - public VisualElementAsset ToobarAsset { get; private set; } - public BindToolbarDelegate BindToolbar { get; set; } - public bool CacheToolbar { get; set; } - internal VisualElement? ToolbarElement; - internal Button? buttonElement; - - public delegate void BindToolbarDelegate(VisualElement toolbarElement); - - public Tab(string name, VisualElementAsset toolbarAsset, BindToolbarDelegate bindToolbar, bool cacheToolbar = true) - { - Name = name; - BindToolbar = bindToolbar; - ToobarAsset = toolbarAsset; - CacheToolbar = cacheToolbar; - ToolbarElement = null; - buttonElement = null; - } - } -} \ No newline at end of file diff --git a/api/Api/UIManager/UIManager.cs b/api/Api/UIManager/UIManager.cs deleted file mode 100644 index 55c9562f14..0000000000 --- a/api/Api/UIManager/UIManager.cs +++ /dev/null @@ -1,468 +0,0 @@ -using System; -using System.Collections.Generic; -using SynthesisAPI.Runtime; -using SynthesisAPI.UIManager.UIComponents; -using UnityEngine.UIElements; -using UnityVisualElement = UnityEngine.UIElements.VisualElement; -using UnityButton = UnityEngine.UIElements.Button; -using VisualElement = SynthesisAPI.UIManager.VisualElements.VisualElement; -using SynthesisAPI.AssetManager; -using SynthesisAPI.Utilities; -using SynthesisAPI.InputManager.Inputs; -using SynthesisAPI.InputManager.InputEvents; - -#nullable enable - -namespace SynthesisAPI.UIManager -{ - public static class UIManager - { - private const string SelectedTabBlankName = "__"; - - public static VisualElement RootElement { - get { - var root = ApiProvider.GetRootVisualElement(); - - if (root == null) - { - return new VisualElement(); // Returning a blank element to prevent a nullable cascade - } - - return root.GetVisualElement(); - } - } - private static UnityVisualElement CreateTab(string tabName) => BlankTabAsset.GetElement(tabName).UnityVisualElement; - - public static void SetBlankTabAsset(VisualElementAsset blankTabAsset) - { - if (blankTabAsset.GetElement("test").Get("blank-tab") == null) - { - throw new SynthesisException("Blank tab asset must have an element with name \"blank-tab\""); - } - BlankTabAsset = blankTabAsset; - } - - public static void SetTitleBar(VisualElement titleBarElement) - { - if(titleBarElement.Get("tab-container") == null) - { - throw new SynthesisException("Title bar must have an element with name \"tab-container\""); - } - foreach (var i in Instance.TitleBarContainer.GetChildren()) - { - Instance.TitleBarContainer.Remove(i); - } - Instance.TitleBarContainer.Add(titleBarElement); - Instance.TitleBarContainer.style.height = titleBarElement.UnityVisualElement.style.height; - } - public static void AddTab(Tab tab) - { - if (LoadedTabs.ContainsKey(tab.Name)) - { - Logger.Log($"Adding tab with duplicate name {tab.Name}", LogLevel.Warning); - } - else - { - tab.buttonElement = new VisualElements.Button(CreateTab(tab.Name).Q(name: "blank-tab")); - LoadedTabs.Add(tab.Name, tab); - // TODO: Spawn in tab button - tab.buttonElement.Element.name = $"tab-{tab.Name}"; - tab.buttonElement.Element.text = tab.Name; - tab.buttonElement.Element.clickable.clicked += () => - EventBus.EventBus.Push("ui/select-tab", new SelectTabEvent(tab.Name)); - Instance.TabContainer.Add(tab.buttonElement); - if (SelectedTabName == SelectedTabBlankName && tab.Name == DefaultSelectedTabName) - SelectTab(tab.Name); - } - } - - public static void RemoveTab(string tabName) - { - if (LoadedTabs.Remove(tabName)) - { - var container = RootElement.UnityVisualElement.Q(name: "tab-container"); - container.Remove(container.Q(name: $"tab-{tabName}")); - - if (tabName == SelectedTabName) - SelectTab(DefaultSelectedTabName); - } - } - - public static void SelectTab(string tabName) - { - if (SelectedTabName == tabName) - { - return; - } - // Remove Existing - SetToolbarVisible(false, false); - - if (tabName == SelectedTabBlankName) - { - SelectedTabName = SelectedTabBlankName; - } - else - { - if (LoadedTabs[tabName].ToobarAsset == null) - throw new Exception($"UI for tab \"{tabName}\" is null"); - - SelectedTabName = tabName; - - SetToolbarVisible(IsToolbarVisible); - } - - // Add class active-tab to currently selected tab - foreach (var i in LoadedTabs) - { - if (i.Value.buttonElement != null) - { - i.Value.buttonElement.RemoveFromClassList("active-tab"); - i.Value.buttonElement.AddToClassList("inactive-tab"); - StyleSheetManager.ApplyClassFromStyleSheets("inactive-tab", i.Value.buttonElement.UnityVisualElement); - } - } - if (LoadedTabs.ContainsKey(SelectedTabName)) - { - LoadedTabs[SelectedTabName].buttonElement?.AddToClassList("active-tab"); - LoadedTabs[SelectedTabName].buttonElement?.RemoveFromClassList("inactive-tab"); - StyleSheetManager.ApplyClassFromStyleSheets("active-tab", LoadedTabs[SelectedTabName].buttonElement?.UnityVisualElement); - } - - // TODO: Maybe some event - } - - public static void SetDefaultTab(string tabName) - { - if (LoadedTabs.ContainsKey(tabName)) - { - DefaultSelectedTabName = tabName; - - if (SelectedTabName == SelectedTabBlankName) - SelectTab(DefaultSelectedTabName); - } - else - { - Logger.Log($"Cannot set default tab to non-existent tab {tabName}", Utilities.LogLevel.Warning); - } - } - - public static void ResetDefaultTab() - { - DefaultSelectedTabName = SelectedTabBlankName; - } - - public static void SetToolbarVisible(bool visible, bool rememberVisibility = true) - { - if(rememberVisibility) - IsToolbarVisible = visible; - var toolbarContainer = Instance.ToolbarContainer; - if (!visible) // Remove toolbar - { - var existingToolbar = toolbarContainer.Get(name: "active-toolbar"); - if (existingToolbar != null) - { - float height = 0; - foreach (var i in existingToolbar.GetChildren()) - { - height += i.UnityVisualElement.style.height.value.value; - } - toolbarContainer.UnityVisualElement.style.height = 0; - Instance.TitleBarContainer.UnityVisualElement.style.height = Instance.TitleBarContainer.UnityVisualElement.style.height.value.value - height; - toolbarContainer.Remove(existingToolbar); - } - } - else if(LoadedTabs.ContainsKey(SelectedTabName)) // Add toolbar - { - if (!LoadedTabs[SelectedTabName].CacheToolbar || LoadedTabs[SelectedTabName].ToolbarElement == null) - { - var toolbar = LoadedTabs[SelectedTabName].ToobarAsset.GetElement("active-toolbar"); - LoadedTabs[SelectedTabName].BindToolbar(toolbar); - var x = LoadedTabs[SelectedTabName]; - x.ToolbarElement = toolbar; - LoadedTabs[SelectedTabName] = x; - } - // toolbar.VisualElement.AddToClassList("custom-toolbar"); // May cause some kind of error - float height = 0; - - if (LoadedTabs[SelectedTabName].ToolbarElement != null) - { - toolbarContainer.Add(LoadedTabs[SelectedTabName].ToolbarElement!); - - foreach(var i in LoadedTabs[SelectedTabName].ToolbarElement!.GetChildren()) - { - height += i.UnityVisualElement.style.height.value.value; - } - } - - toolbarContainer.UnityVisualElement.style.height = height; - Instance.TitleBarContainer.UnityVisualElement.style.height = Instance.TitleBarContainer.UnityVisualElement.style.height.value.value + height; - } - } - - public static void AddPanel(Panel panel) - { - LoadedPanels.Add(panel.Name, panel); - } - - public static void ShowPanel(string panelName) - { - var existingPanel = Instance.PanelContainer.Get(name: $"panel-{panelName}"); - if (existingPanel == null) - { - Instance.PanelContainer.Enabled = true; - var elm = LoadedPanels[panelName].Ui.GetElement($"panel-{panelName}"); - if (!LoadedPanels[panelName].CachePanel || LoadedPanels[panelName].PanelElement == null) - { - LoadedPanels[panelName].BindPanel(elm); - var x = LoadedPanels[panelName]; - x.PanelElement = elm; - LoadedPanels[panelName] = x; - } - - if (LoadedPanels[panelName].PanelElement != null) - { - Instance.PanelContainer.Add(LoadedPanels[panelName].PanelElement!); - } - - EventBus.EventBus.Push("ui/show-panel", new ShowPanelEvent(LoadedPanels[panelName])); - } - - // TODO: Maybe some event - } - - public static void ClosePanel(string panelName) - { - var existingPanel = Instance.PanelContainer.Get(name: $"panel-{panelName}"); - if (existingPanel != null) - { - EventBus.EventBus.Push("ui/close-panel", new ClosePanelEvent(LoadedPanels[panelName])); - Instance.PanelContainer.Remove(existingPanel); - Instance.PanelContainer.Enabled = ((List)Instance.PanelContainer.GetChildren()).Count > 0; - } - } - - public static void TogglePanel(string panelName) - { - var panelToToggle = Instance.PanelContainer.Get(name: $"panel-{panelName}"); - if (panelToToggle == null) - { - ShowPanel(panelName); - } - else - { - ClosePanel(panelName); - } - } - - internal static void Setup() - { - var root = RootElement.Get("catch-all-mouse-down"); - - if (root != null) { - Instance.SetupCatchAllMouseDown(root); - } - - Instance.PanelContainer.Enabled = false; - } - - private class Inner - { - private VisualElement? _panelContainer = null; - public VisualElement PanelContainer - { - get - { - if(_panelContainer == null) - _panelContainer = RootElement.UnityVisualElement.Q(name: "panel-center").GetVisualElement(); - return _panelContainer; - } - } - - private VisualElement? _tabContainer = null; - - public VisualElement TabContainer - { - get - { - if (_tabContainer == null) - _tabContainer = RootElement.UnityVisualElement.Q(name: "tab-container").GetVisualElement() ; - return _tabContainer; - } - } - - private VisualElement? _titleBarContainer = null; - - public VisualElement TitleBarContainer - { - get - { - if (_titleBarContainer == null) - _titleBarContainer = RootElement.UnityVisualElement.Q(name: "title-bar-container").GetVisualElement(); - return _titleBarContainer; - } - } - - private VisualElement? _toolbarContainer = null; - - public VisualElement ToolbarContainer - { - get - { - if (_toolbarContainer == null) - _toolbarContainer = RootElement.UnityVisualElement.Q(name: "bottom").GetVisualElement(); - return _toolbarContainer; - } - } - - public bool CursorBlockedByUI { get; private set; } - - private bool[] nonUIMouseDown = new bool[3]; - private bool nonUIMouseForwardingSetup = false; - - public void SetupCatchAllMouseDown(VisualElement visualElement) - { - visualElement.UnityVisualElement.RegisterCallback(e => - { - nonUIMouseDown[e.button] = true; - SendNonUIMouseEvent(e.button, DigitalState.Down); - }); - visualElement.UnityVisualElement.RegisterCallback(e => - { - CursorBlockedByUI = false; - }); - visualElement.UnityVisualElement.RegisterCallback(e => - { - CursorBlockedByUI = true; - }); - if (!nonUIMouseForwardingSetup) - { - ForwardNonUIMouseEvent(0); - ForwardNonUIMouseEvent(1); - ForwardNonUIMouseEvent(2); - nonUIMouseForwardingSetup = true; - } - } - - private const string InputNameMouse0 = "mouse 0 non-ui"; - private const string InputNameMouse1 = "mouse 1 non-ui"; - private const string InputNameMouse2 = "mouse 2 non-ui"; - - private void ForwardNonUIMouseEvent(int button) - { - InputManager.InputManager.AssignDigitalInput($"_internal mouse {button} non-ui-forwarder", new Digital($"mouse {button}"), e => - { - if (nonUIMouseDown[button]) - { - var digitalEvent = (DigitalEvent)e; - if (digitalEvent.State == DigitalState.Up) - { - nonUIMouseDown[button] = false; - SendNonUIMouseEvent(0, DigitalState.Up); - } - else if (digitalEvent.State == DigitalState.Held) - { - SendNonUIMouseEvent(0, DigitalState.Held); - } - } - }); - } - private void SendNonUIMouseEvent(int button, DigitalState state) - { - foreach (string name in InputManager.InputManager._mappedDigitalInputs.Keys) - { - foreach (Input input in InputManager.InputManager._mappedDigitalInputs[name]) - { - if (input.Name.EndsWith("non-ui") && input is Digital digitalInput) - { - if ((digitalInput.Name == InputNameMouse0 && button == 0) || - (digitalInput.Name == InputNameMouse1 && button == 1) || - (digitalInput.Name == InputNameMouse2 && button == 2)) - { - EventBus.EventBus.Push($"input/{name}", - new DigitalEvent(name, state > 0 ? 1 : 0, state) - ); - } - } - } - } - } - - public VisualElementAsset? BlankTabAsset; - - public string SelectedTabName = SelectedTabBlankName; - public string DefaultSelectedTabName = SelectedTabBlankName; - public bool IsToolbarVisible = true; - - public Dictionary LoadedTabs; - public Dictionary LoadedPanels; - - private Inner() - { - LoadedTabs = new Dictionary(); - LoadedPanels = new Dictionary(); - - // Setup events - EventBus.EventBus.NewTagListener($"ui/select-tab", info => - { - string tabName = (info as SelectTabEvent)!.TabName; - UIManager.SelectTab(tabName); - // Logger.Log($"Selecting Tab: {tabName}"); - }); - } - - private static Inner _instance = null!; - - public static Inner InnerInstance - { - set - { - _instance = value; - } - get - { - if (_instance == null) - _instance = new Inner(); - return _instance; - } - } - } - - private static Inner Instance - { - get => Inner.InnerInstance; - set => Inner.InnerInstance = value; - } - private static Dictionary LoadedTabs - { - get => Instance.LoadedTabs; - set => Instance.LoadedTabs = value; - } - private static Dictionary LoadedPanels => Instance.LoadedPanels; - private static string SelectedTabName { - get => Instance.SelectedTabName; - set => Instance.SelectedTabName = value; - } - - private static bool IsToolbarVisible - { - get => Instance.IsToolbarVisible; - set => Instance.IsToolbarVisible = value; - } - private static string DefaultSelectedTabName - { - get => Instance.DefaultSelectedTabName; - set => Instance.DefaultSelectedTabName = value; - } - private static VisualElementAsset BlankTabAsset - { - get { - if (Instance.BlankTabAsset == null) - Instance.BlankTabAsset = AssetManager.AssetManager.GetAsset("ui/blank-tab"); - return Instance.BlankTabAsset!; - } - set => Instance.BlankTabAsset = value; - } - - public static bool CursorBlockedByUI => Instance.CursorBlockedByUI; - } -} diff --git a/api/Api/UIManager/UIParser.cs b/api/Api/UIManager/UIParser.cs deleted file mode 100644 index e5a14e17c1..0000000000 --- a/api/Api/UIManager/UIParser.cs +++ /dev/null @@ -1,430 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Xml; -using SynthesisAPI.AssetManager; -using VisualElementAsset = SynthesisAPI.UIManager.VisualElements.VisualElement; -using _UnityVisualElement = UnityEngine.UIElements.VisualElement; -using UnityEngine; -using UnityEngine.UIElements; -using SynthesisAPI.Runtime; -using SynthesisAPI.Utilities; -using Logger = SynthesisAPI.Utilities.Logger; -using System.Reflection; - -#nullable enable - -namespace SynthesisAPI.UIManager -{ - // ReSharper disable once InconsistentNaming - public static class UIParser - { - public static VisualElementAsset CreateVisualElement(string name, XmlDocument doc) - { - return doc.FirstChild.Name.Replace("ui:", "") == "UXML" ? - CreateVisualElements(name, doc.FirstChild.ChildNodes) : - CreateVisualElements(name, doc.ChildNodes); - } - - public static VisualElementAsset CreateVisualElements(string name, XmlNodeList nodes) - { - SearchForStyleSheet(nodes); - _UnityVisualElement root = new _UnityVisualElement() { name = name }; - foreach (XmlNode node in nodes) - { - if (node.Name.Replace("ui:", "") != "Style") { - VisualElementAsset? asset = CreateVisualElement(node); - - if (asset != null) - { - root.Add(asset.UnityVisualElement); - } - - } - } - return root.GetVisualElement(); - } - - /// - /// Parse an XmlNode into a VisualElement. - /// TODO: Account for other types of VisualElements with special attributes (i.e. Label, Button, etc.) - /// - /// - /// - public static VisualElementAsset? CreateVisualElement(XmlNode node) - { - if (node == null) - throw new Exception("Node is null"); - - // Logger.Log($"Looking for type: {node.Name.Replace("ui:", "")}"); - Type elementType = Array.Find(typeof(_UnityVisualElement).Assembly.GetTypes(), x => - x.Name.Equals(node.Name.Replace("ui:", ""))); - if (elementType == null) - { - if (!node.Name.Replace("ui:", "").Equals("Style")) - { - Logger.Log($"Couldn't find type \"{node.Name.Replace("ui:", "")}\"\nSkipping...", LogLevel.Warning); - } - return null; - } - _UnityVisualElement? element = (_UnityVisualElement)typeof(ApiProvider).GetMethod("CreateUnityType").MakeGenericMethod(elementType) - .Invoke(null, new object[] { new object[] {} }); - if (element != null) - { - // Logger.Log("Creating element.."); - - foreach (XmlAttribute attr in node.Attributes) - { - // Logger.Log("Parsing Attribute"); - - var property = elementType.GetProperty(MapCssName(attr.Name)); - - if (attr.Name.Equals("class")) - { - //Logger.Log("Class found with value: " + attr.Value); - element!.AddToClassList(attr.Value); - element = StyleSheetManager.ApplyClassFromStyleSheets(attr.Value, element); - } - - if (property == null) - { - if (!attr.Name.Equals("class")) - { - Logger.Log($"Skipping attribute \"{attr.Name}\"", LogLevel.Warning); - } - // throw new Exception($"No property found with name \"{attr.Name}\""); - continue; - } - - if (property.PropertyType.IsEnum) - { - property.SetValue(element, Enum.Parse(property.PropertyType, attr.Value)); - continue; - } - switch (property.PropertyType.Name) - { - case "Boolean": - // Logger.Log($"Parsing Boolean: {attr.Value}"); - property.SetValue(element, bool.Parse(attr.Value)); - break; - case "String": - // Logger.Log($"Parsing String: {attr.Value}"); - property.SetValue(element, attr.Value); - break; - case "IStyle": - // Logger.Log("Parsing IStyle"); - element = ParseStyle(attr.Value, element); - break; - default: - throw new Exception($"Found no matching type to {property.PropertyType.FullName}"); - } - - // Logger.Log($"Finished Parsing Attribute: {attr.Name}"); - } - } else - { - element = ApiProvider.CreateUnityType<_UnityVisualElement>(); - } - - // Logger.Log("Finished Creating Element"); - - _UnityVisualElement resultElement = (_UnityVisualElement)element!; - - foreach (XmlNode child in node.ChildNodes) - { - // Logger.Log($"Adding child: {child.Name}"); - var parsedChild = CreateVisualElement(child); - if (parsedChild != null) - resultElement.Add(parsedChild.UnityVisualElement); - // Logger.Log($"Finished adding child: {child.Name}"); - } - - // Logger.Log("Returning Result"); - return resultElement.GetVisualElement(); - } - - /// - /// - /// - /// WARNING: Make sure this type is or inherits - internal static _UnityVisualElement? ParseStyle(string data, _UnityVisualElement? element) - { - var list = data.Replace("'", "\"").Split(';').ToList(); - foreach (string entry in list) - { - if (entry != " ") - { - var el = ParseEntry(entry, element); - if (el != null) { - element = el; // TODO: I have no clue what they were trying to accomplish with this but hopefully this works ? Technically this was returning nulls randomly before. - } - - } - } - return element; - } - - public static string MapCssName(string cssTag) => - (cssTag[0] == '-' ? char.ToLower(cssTag[1]) : char.ToLower(cssTag[0])) + cssTag.Split('-') - .Select(s => s != "" ? char.ToUpper(s[0]) + s.Substring(1) : "") - .Aggregate("", (s, s1) => s + s1).Substring(1); - - internal static PropertyInfo? MapProperty(string propertyStr) - { - string propertyName = MapCssName(propertyStr); - if (propertyName == "unityFontStyle") propertyName = "unityFontStyleAndWeight"; - if (propertyName == "textAlign") propertyName = "unityTextAlign"; - return typeof(IStyle).GetProperty(propertyName); - } - - internal static object? ParseProperty(PropertyInfo property, string value) - { - if (property.PropertyType.GenericTypeArguments.Length > 0) - { - var result = typeof(UIParser) - .GetMethod("ToStyleEnum", - BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static) - .MakeGenericMethod(property.PropertyType.GenericTypeArguments[0]) - .Invoke(null, new object[] { value }); - - return result; - } - - switch (property.PropertyType.Name) - { - case "StyleFloat": - return ToStyleFloat(value); - case "StyleInt": - return ToStyleInt(value); - case "StyleLength": - return ToStyleLength(value); - case "StyleFont": - return ToStyleFont(value); - case "StyleCursor": - return ToStyleCursor(value); - case "StyleColor": - return ToStyleColor(value); - case "StyleBackground": - return ToStyleBackground(value); - default: - Logger.Log("Unhandled type in USS parser", LogLevel.Warning); - break; - } - return null; - } - - internal static _UnityVisualElement? ParseEntry(string entry, _UnityVisualElement? element) - { - if(element == null) - { - // I guess this is a non-critical failure so I will make it nullable - Logger.Log($"Failed to parse entry, element was null", LogLevel.Warning); - return null; - } - var entrySplit = entry.Split(':'); - entrySplit[0] = entrySplit[0].Replace(" ", ""); - if (entrySplit[0] == "") return element; - - var property = MapProperty(entrySplit[0]); - if (property == null) - { - Logger.Log($"Failed to find property \"{MapCssName(entrySplit[0])}\"", LogLevel.Warning); - // Debug.Log($"Type of style: \"{typeof(element.style).FullName}\""); - } - - if (property != null) - { - try - { - var value = ParseProperty(property, entrySplit[1]); - if (value == null) - { - Logger.Log($"Failed to parse entry {property.Name}\n\"{entry}\"", LogLevel.Warning); - } - else - { - property.SetValue(element.style, value); - } - } - catch (Exception) - { - Logger.Log($"Failed to set property. Skipping {property.Name}\n\"{entry}\"", LogLevel.Warning); - } - } else { - Logger.Log($"Failed to set property. Property does not exist for \n\"{entry}\""); - } - - - return element; - } - - internal static StyleFloat ToStyleFloat(string str) => new StyleFloat(float.Parse(str.Replace("px", ""))); - - internal static StyleInt ToStyleInt(string str) => new StyleInt(int.Parse(str.Replace("px", ""))); - - internal static StyleLength ToStyleLength(string str) - { - str = str.Replace(" ", ""); - if (str.Contains("auto")) - return new StyleLength(StyleKeyword.Auto); - - bool isPercent = str.Contains("%"); - LengthUnit unit; - if (isPercent) - unit = LengthUnit.Percent; - else - unit = LengthUnit.Pixel; - - // Debug.Log($"StyleInt from: \"{str}\""); - // Debug.Log($"Units: \"{unit}\""); - - return new StyleLength(new Length(float.Parse(str.Replace("%", "").Replace("px", "")), unit)); - - } - - internal static StyleFont ToStyleFont(string _) => new StyleFont(StyleKeyword.Null); - - internal static StyleBackground ToStyleBackground(string str) - { - string path = str.Replace(" ", ""); - - if (path.StartsWith("url(\"") || path.StartsWith("url('")) - path = path.Remove(0, 5); - if (path.EndsWith("\")") || path.EndsWith("')")) - path = path.Remove(path.Length - 2, 2); - - try - { - SpriteAsset? asset = AssetManager.AssetManager.GetAsset(path); - if (asset == null) - { - Logger.Log($"Can't find USS background image asset: {path}", LogLevel.Warning); - return new StyleBackground(StyleKeyword.Null); - } - else - { - if (asset.Sprite != null) - return new StyleBackground(asset.Sprite!.texture); - else { - Logger.Log($"Failed to find Sprite for the given Asset : {asset.Name}", LogLevel.Warning); - return new StyleBackground(StyleKeyword.Null); - } - } - } - catch (Exception e) - { - // FAIL TO GET TEXTURE - Logger.Log($"Exception when parsing background texture\n{e}", LogLevel.Warning); - return new StyleBackground(StyleKeyword.Null); - } - } - - internal static StyleCursor ToStyleCursor(string _) => new StyleCursor(StyleKeyword.Null); - - internal static StyleColor ToStyleColor(string str) - { - var color = new StyleColor(); - - if (str[0] == ' ') - str = str.Substring(1); - - var numbers = new List(); - string start = str.Substring(str.IndexOf('(') + 1); - while (true) - { - if (start.IndexOf(',') >= 0) - { - numbers.Add(start.Substring(0, start.IndexOf(','))); - start = start.Substring(start.IndexOf(',') + 2); - } else - { - numbers.Add(start.Substring(0, start.IndexOf(')'))); - break; - } - } - - switch (str.Substring(0, str.IndexOf('('))) - { - case "rgb": - color.value = new Color( - float.Parse(numbers[0]) / 255.0f, - float.Parse(numbers[1]) / 255.0f, - float.Parse(numbers[2]) / 255.0f); - break; - case "rgba": - color.value = new Color( - float.Parse(numbers[0]) / 255.0f, - float.Parse(numbers[1]) / 255.0f, - float.Parse(numbers[2]) / 255.0f, - float.Parse(numbers[3])); - break; - } - - return color; - } - - internal static StyleEnum ToStyleEnum(string str) where T : struct, IConvertible => new StyleEnum - {value = (T) Enum.Parse(typeof(T), MapCssName(str.Replace(" ", "")), true)}; - - /// - /// This is an extension method to properly convert a VisualElement type into a Synthesis analog. - /// The Synthesis analog essentially stores visual element objects and reveals layers of usability. - /// In order to properly parse they need to be converted to their child form then stored as their - /// analog. - /// - /// - /// - internal static VisualElementAsset GetVisualElement(this _UnityVisualElement element) - { - if(element == null) - { - throw new SynthesisException("Cannot get visual element of null unity element"); - } - - Type? t = default; - - try - { - t = typeof(VisualElementAsset).Assembly.GetTypes().First(t => - t.Name == element.GetType().Name && t.FullName != element.GetType().FullName); - } - catch(Exception e) - { - throw new SynthesisException($"Failed to get visual element of {element.GetType().FullName}, could not find matching type", e); - } - - try - { - BindingFlags flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance; - return (VisualElementAsset)Activator.CreateInstance(t, flags, null, new object[] { element }, null); - } - catch(Exception e) - { - throw new SynthesisException($"Failed to get visual element of {element.GetType().FullName}, attempted type {t.FullName}", e); - } - } - - private static void SearchForStyleSheet(XmlNodeList nodeList) - { - foreach (XmlNode node in nodeList) - { - if (node.Name.Equals("Style")) - { - var styleSheetPath = node.Attributes["src"].Value; - var ussAsset = AssetManager.AssetManager.GetAsset(styleSheetPath); - if (ussAsset == null) - { - throw new SynthesisException($"Failed to find style sheet \n{styleSheetPath}\" when loading style sheets"); - } - StyleSheetManager.AttemptRegistryOfNewStyleSheet(ussAsset); - } - - if (node.HasChildNodes) - { - SearchForStyleSheet(node.ChildNodes); - } - } - } - - } -} diff --git a/api/Api/UIManager/UssClass.cs b/api/Api/UIManager/UssClass.cs deleted file mode 100644 index b38270e7cf..0000000000 --- a/api/Api/UIManager/UssClass.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Collections.ObjectModel; -using System.Collections.Generic; - -namespace SynthesisAPI.UIManager -{ - public class UssClass - { - private List lines = new List(); - public ReadOnlyCollection Lines { get => lines.AsReadOnly(); } - public string ClassName { get; } - - public UssClass(string className) - { - this.ClassName = className; - } - - public void AddLine(string line) - { - lines.Add(line); - } - - } -} \ No newline at end of file diff --git a/api/Api/UIManager/VisualElements/Button.cs b/api/Api/UIManager/VisualElements/Button.cs deleted file mode 100644 index c1f72a1fef..0000000000 --- a/api/Api/UIManager/VisualElements/Button.cs +++ /dev/null @@ -1,72 +0,0 @@ -using SynthesisAPI.Runtime; -using System; -using System.Collections.Generic; -using SynthesisAPI.EventBus; -using _UnityButton = UnityEngine.UIElements.Button; -using SynthesisAPI.Utilities; - -#nullable enable - -namespace SynthesisAPI.UIManager.VisualElements -{ - public class Button : VisualElement - { - private EventBus.EventBus.EventCallback? _callback; - - internal _UnityButton Element - { - get => (_visualElement as _UnityButton)!; - set => _visualElement = value; - } - - private static int Id = 0; - private int id; - - public string EventTag - { - get => $"button/{Element.name}-{id}"; - } - - public string Text { - get => Element.text; - set => Element.text = value; - } - - public Button() - { - _visualElement = ApiProvider.CreateUnityType<_UnityButton>()!; - if (_visualElement == null) - throw new Exception(); - id = Id; - Id++; - } - - internal Button(_UnityButton element) - { - Element = element; - id = Id; - Id++; - } - - // Unsure if this is needed - ~Button() - { - /*if (EventBus.EventBus.HasTagSubscriber(EventTag)) - EventBus.EventBus.RemoveTagListener(EventTag, _callback);*/ - } - - public override IEnumerable PostUxmlLoad() - { - Element.clickable.clicked += () => EventBus.EventBus.Push(EventTag, new ButtonClickableEvent(Name)); - base.PostUxmlLoad(); - return null!; - } - - public void Subscribe(Action action) - { - _callback = e => action(e); - EventBus.EventBus.NewTagListener(EventTag, _callback); - PostUxmlLoad(); - } - } -} diff --git a/api/Api/UIManager/VisualElements/ButtonClickableEvent.cs b/api/Api/UIManager/VisualElements/ButtonClickableEvent.cs deleted file mode 100644 index fbd3dab0b4..0000000000 --- a/api/Api/UIManager/VisualElements/ButtonClickableEvent.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using SynthesisAPI.EventBus; - -namespace SynthesisAPI.UIManager.VisualElements -{ - public struct ButtonClickableEvent: IEvent - { - public readonly string Name; - - public ButtonClickableEvent(string name) - { - Name = name; - } - - public object[] GetArguments() => new[] { Name }; - } -} \ No newline at end of file diff --git a/api/Api/UIManager/VisualElements/Label.cs b/api/Api/UIManager/VisualElements/Label.cs deleted file mode 100644 index c2ae01eafd..0000000000 --- a/api/Api/UIManager/VisualElements/Label.cs +++ /dev/null @@ -1,37 +0,0 @@ -using SynthesisAPI.Runtime; -using System; -using _UnityLabel = UnityEngine.UIElements.Label; - -namespace SynthesisAPI.UIManager.VisualElements -{ - public class Label : VisualElement - { - private protected _UnityLabel Element - { - get => (_visualElement as _UnityLabel)!; - set => _visualElement = value; - } - - public string Text { - get => Element.text; - set => Element.text = value; - } - - public (float r, float g, float b, float a) Color { - get => (style.color.value.r, style.color.value.g, style.color.value.b, style.color.value.a); - set => style.color = new UnityEngine.UIElements.StyleColor(new UnityEngine.Color(value.r, value.g, value.b, value.a)); - } - - public Label() - { - Element = ApiProvider.CreateUnityType<_UnityLabel>()!; - if (Element == null) - throw new Exception(); - } - - internal Label(_UnityLabel element) - { - Element = element; - } - } -} diff --git a/api/Api/UIManager/VisualElements/ListView.cs b/api/Api/UIManager/VisualElements/ListView.cs deleted file mode 100644 index 2f1dcb43db..0000000000 --- a/api/Api/UIManager/VisualElements/ListView.cs +++ /dev/null @@ -1,142 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; -using SynthesisAPI.EventBus; -using SynthesisAPI.Runtime; -using _SelectionType = UnityEngine.UIElements.SelectionType; -using _UnityListView = UnityEngine.UIElements.ListView; - -#nullable enable - -namespace SynthesisAPI.UIManager.VisualElements -{ - public class ListView: VisualElement - { - /* - /// - /// Wrapper for the Unity ListView - /// This is necessary because these methods are currently protected and we need access to them - /// - public class _UnityListViewWrapper : _UnityListView - { - public new void AddToSelection(int index) => base.AddToSelection(index); - public new void ClearSelection() => base.ClearSelection(); - public new void RemoveFromSelection(int index) => base.RemoveFromSelection(index); - public new void SetSelection(int index) => base.SetSelection(index); - } - */ - - private EventBus.EventBus.EventCallback? _callback; - - private protected _UnityListView Element - { - get => (_visualElement as _UnityListView)!; - set => _visualElement = value; - } - - // internal static explicit operator UnityListViewWrapper(ListView e) => e.Element; - // internal static explicit operator ListView(UnityListViewWrapper e) => new ListView(e); - // public static explicit operator SynListView(VisualElement e) => new SynListView((e as UnityListView)!); - - private (IList Source, Func MakeItem, Action BindItem) PopulateParams = - (new List(), () => null!, (element, i) => { }); - - public ListView() - { - // Element = ApiProvider.InstantiateFocusable()!; - Element = ApiProvider.CreateUnityType<_UnityListView>()!; - if (Element == null) - throw new Exception(); - Element.selectionType = _SelectionType.Single; - } - - internal ListView(_UnityListView element) - { - Element = element; - } - - // Unsure if this is needed - ~ListView() - { - /*if (EventBus.EventBus.HasTagSubscriber(EventTag)) - EventBus.EventBus.RemoveTagListener(EventTag, _callback);*/ - } - - public void Populate(IList source, Func makeItem, Action bindItem) - { - PopulateParams = (source, makeItem, bindItem); - PostUxmlLoad(); - } - - public void Refresh() - { - Element.Refresh(); - } - - public int SelectedIndex => Element.selectedIndex; - public object SelectedItem => Element.selectedItem; - public int ItemHeight - { - get => Element.itemHeight; - set => Element.itemHeight = value; - } - // public void ClearSelection() => Element.ClearSelection(); - public void ScrollTo(VisualElement visualElement) => Element.ScrollTo(visualElement.UnityVisualElement); - public void ScrollToItem(int index) => Element.ScrollToItem(index); - - public string SelectedEventTag => $"listview-button/{Element.name}"; - public string ItemChosenEventTag => $"item-chosen/{Element.name}"; - - public class SelectionChangedEvent: IEvent - { - public List SelectedObjects { get; private set; } - public SelectionChangedEvent(List selectedObjects) - { - SelectedObjects = selectedObjects; - } - } - - public class ItemChosenEvent : IEvent - { - public object Item{ get; private set; } - public ItemChosenEvent(object item) - { - Item = item; - } - } - - public void SubscribeOnSelectionChanged(Action callback) - { - if (_callback != null) - EventBus.EventBus.RemoveTagListener(SelectedEventTag, _callback); - _callback = e => callback(e); - EventBus.EventBus.NewTagListener(SelectedEventTag, _callback); - - Element.onSelectionChange += l => EventBus.EventBus.Push(SelectedEventTag, new SelectionChangedEvent((List)l)); - } - - public void SubscribeOnItemChosen(Action callback) - { - if (_callback != null) - EventBus.EventBus.RemoveTagListener(ItemChosenEventTag, _callback); - _callback = e => callback(e); - EventBus.EventBus.NewTagListener(ItemChosenEventTag, _callback); - - Element.onItemsChosen += o => EventBus.EventBus.Push(ItemChosenEventTag, new ItemChosenEvent(o)); - } - - public override IEnumerable PostUxmlLoad() - { - Element.makeItem = () => PopulateParams.MakeItem().UnityVisualElement; - Type t = PopulateParams.MakeItem().GetType(); - BindingFlags flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance; - Element.bindItem = (element, index) => PopulateParams.BindItem( - (VisualElement)Activator.CreateInstance(t, flags, null, new object[] { element }, null), - index); - Element.itemsSource = PopulateParams.Source; - base.PostUxmlLoad(); - return null!; - } - } -} \ No newline at end of file diff --git a/api/Api/UIManager/VisualElements/ScrollView.cs b/api/Api/UIManager/VisualElements/ScrollView.cs deleted file mode 100644 index 3f7c4cbb19..0000000000 --- a/api/Api/UIManager/VisualElements/ScrollView.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using SynthesisAPI.Runtime; -using _UnityScrollView = UnityEngine.UIElements.ScrollView; - -namespace SynthesisAPI.UIManager.VisualElements -{ - public class ScrollView : VisualElement - { - private protected _UnityScrollView Element - { - get => (_visualElement as _UnityScrollView)!; - set => _visualElement = value; - } - - internal ScrollView(_UnityScrollView visualElement) - { - Element = visualElement; - } - public ScrollView(VisualElement visualElement) - { - Element = (_UnityScrollView)visualElement.UnityVisualElement; - } - public ScrollView() - { - Element = ApiProvider.CreateUnityType<_UnityScrollView>()!; - if (Element == null) - throw new Exception(); - } - public void ScrollTo(VisualElement visualElement) => Element.ScrollTo(visualElement.UnityVisualElement); - } -} \ No newline at end of file diff --git a/api/Api/UIManager/VisualElements/TextField.cs b/api/Api/UIManager/VisualElements/TextField.cs deleted file mode 100644 index c313934ea1..0000000000 --- a/api/Api/UIManager/VisualElements/TextField.cs +++ /dev/null @@ -1,160 +0,0 @@ -using System; -using System.Collections.Generic; -using SynthesisAPI.EventBus; -using SynthesisAPI.Runtime; -using _UnityTextField = UnityEngine.UIElements.TextField; - -#nullable enable - -namespace SynthesisAPI.UIManager.VisualElements -{ - public class TextField: VisualElement - { - /* - /// - /// This wrapper exposes the protected member text of the Unity TextField - /// - internal class UnityTextFieldWrapper: _UnityTextField - { - public new string text - { - get => base.text; - set => base.text = value; - } - } - */ - - private EventBus.EventBus.EventCallback? _changeCallback; - private EventBus.EventBus.EventCallback? _focusCallback; - private bool _isChangeCallbackRegistered = false; - private bool _isFocusCallbackRegistered = false; - - private static int Id = 0; - private int id; - - public string ChangeEventTag => $"text-field-change/{Element.name}-{id}"; - public string FocusLeaveEventTag => $"text-field-focus-leave/{Element.name}-{id}"; - - private protected _UnityTextField Element - { - get => (_visualElement as _UnityTextField)!; - set => _visualElement = value; - } - - //public static explicit operator _UnityTextField(TextField element) => (element._visualElement as _UnityTextField)!; - //public static explicit operator TextField(_UnityTextField element) => new TextField(element); - - public string Label - { - get => Element.label; - set => Element.label = value; - } - - /* - public string Text - { - get => Element.text; - set => Element.text = value; - } - */ - - public string Value - { - get => Element.value; - set => Element.value = value; - } - - public bool IsReadOnly - { - get => Element.isReadOnly; - set => Element.isReadOnly = value; - } - - public bool IsMultiline - { - get => Element.multiline; - set => Element.multiline = value; - } - - public bool IsDelayed - { - get => Element.isDelayed; - set => Element.isDelayed = value; - } - - public void SetValueWithoutNotify(string value) - { - Element.SetValueWithoutNotify(value); - } - - public void SubscribeOnChange(Action action) - { - _changeCallback = e => action(e); - EventBus.EventBus.NewTagListener(ChangeEventTag, _changeCallback); - - if (!_isChangeCallbackRegistered) - { - Element.RegisterCallback>(e => - { - EventBus.EventBus.Push(ChangeEventTag, new TextFieldChangeEvent(Name, e.previousValue, e.newValue)); - }); - _isChangeCallbackRegistered = true; - } - } - - public void SubscribeOnFocusLeave(Action action) - { - _focusCallback = e => action(e); - EventBus.EventBus.NewTagListener(FocusLeaveEventTag, _focusCallback); - - if (!_isFocusCallbackRegistered) - { - Element.RegisterCallback(_ => - { - EventBus.EventBus.Push(FocusLeaveEventTag, new TextFieldFocusLeaveEvent(Name)); - }); - _isFocusCallbackRegistered = true; - } - } - - public class TextFieldChangeEvent : IEvent - { - public readonly string Name; - public readonly string PreviousValue; - public readonly string NewValue; - - public TextFieldChangeEvent(string name, string previousValue, string newValue) - { - Name = name; - PreviousValue = previousValue; - NewValue = newValue; - } - } - - public class TextFieldFocusLeaveEvent : IEvent - { - public readonly string Name; - - public TextFieldFocusLeaveEvent(string name) - { - Name = name; - } - } - - public TextField() - { - Element = ApiProvider.CreateUnityType<_UnityTextField>()!; - if (Element == null) - throw new Exception(); - id = Id; - Id++; - } - - internal TextField(_UnityTextField element) - { - Element = element; - id = Id; - Id++; - } - } -} \ No newline at end of file diff --git a/api/Api/UIManager/VisualElements/VisualElement.cs b/api/Api/UIManager/VisualElements/VisualElement.cs deleted file mode 100644 index 56f2107387..0000000000 --- a/api/Api/UIManager/VisualElements/VisualElement.cs +++ /dev/null @@ -1,210 +0,0 @@ -using MathNet.Spatial.Euclidean; -using SynthesisAPI.Runtime; -using SynthesisAPI.Utilities; -using System; -using System.Collections.Generic; -using UnityEngine.UIElements; -using _UnityVisualElement = UnityEngine.UIElements.VisualElement; - -#nullable enable - -namespace SynthesisAPI.UIManager.VisualElements -{ - public class VisualElement - { - private protected _UnityVisualElement _visualElement; - - public VisualElement() - { - _visualElement = ApiProvider.CreateUnityType<_UnityVisualElement>()!; - if (_visualElement == null) - throw new SynthesisException("Failed to instantiate VisualElement"); - } - - internal VisualElement(_UnityVisualElement visualElement) - { - _visualElement = visualElement; - } - - public string Name { - get => _visualElement.name; - set => _visualElement.name = value; - } - - public bool Focusable - { - get => _visualElement.focusable; - set => _visualElement.focusable = value; - } - - public bool Enabled - { - get => _visualElement.enabledSelf; - set => _visualElement.SetEnabled(value); - } - - internal IStyle style { - get => _visualElement.style; - } - - public void OnMouseEnter(Action onEnter) - { - _visualElement.RegisterCallback(_ => onEnter()); - } - - public void OnMouseLeave(Action onLeave) - { - _visualElement.RegisterCallback(_ => onLeave()); - } - - public void OnMouseDown(Action onMouseDown) - { - _visualElement.RegisterCallback(_ => onMouseDown()); - } - - internal _UnityVisualElement UnityVisualElement { - get => _visualElement; - } - - public virtual IEnumerable? PostUxmlLoad() - { - foreach (var child in _visualElement.Children()) - { - child.GetVisualElement().PostUxmlLoad(); - } - return null; - } - public IEnumerable GetAllChildrenWhere(Func predicate) - { - var children = new List(); - foreach (var child in _visualElement.Children()) - { - var synChild = child.GetVisualElement(); - if (predicate(synChild)) - { - children.Add(synChild); - } - children.AddRange(synChild.GetAllChildrenWhere(predicate)); - } - return children; - } - - public IEnumerable GetAllChildren() - { - var children = new List(); - foreach (var child in _visualElement.Children()) - { - var synChild = child.GetVisualElement(); - children.Add(synChild); - children.AddRange(synChild.GetAllChildren()); - } - return children; - } - - public IEnumerable GetChildren() - { - var children = new List(); - foreach (var child in _visualElement.Children()) - children.Add(child.GetVisualElement()); - return children; - } - - public VisualElement? Get(string? name = null, string? className = null) - { - if (_visualElement == null) - return null; - var found = _visualElement.Q(name, className); - if (found == null) - return null; - try - { - return found.GetVisualElement(); - } - catch (Exception) - { - return new VisualElement(found); - } - } - - private Manipulator? tooltipManipulator = null; - - private string tooltip = ""; - - public string Tooltip - { - get => tooltip; - set - { - if (value != tooltip) - { - tooltip = value; - if (tooltip != "") - { - if (tooltipManipulator == null) - { - tooltipManipulator = new TooltipManipulator(tooltip); - _visualElement.AddManipulator(tooltipManipulator); - } - else - { - ((TooltipManipulator)tooltipManipulator).Text = tooltip; - } - } - else if (tooltipManipulator != null) - { - _visualElement.RemoveManipulator(tooltipManipulator); - tooltipManipulator = null; - } - - } - } - } - - private bool isDraggable = false; - private Manipulator? dragManipulator = null; - public bool IsDraggable - { - get => isDraggable; - set - { - if (value != isDraggable) - { - isDraggable = value; - if (isDraggable) - { - dragManipulator = new DragManipulator(); - _visualElement.AddManipulator(dragManipulator); - } - else if (dragManipulator != null) - { - _visualElement.RemoveManipulator(dragManipulator); - dragManipulator = null; - } - } - } - } - - public void OnLoseFocus(Action onLose) => _visualElement.RegisterCallback(_ => onLose()); - public void Focus() => _visualElement.Focus(); - - public void Add(VisualElement element) => _visualElement.Add(element._visualElement); - public void Remove(VisualElement element) => _visualElement.Remove(element._visualElement); - public void RemoveAt(int index) => _visualElement.RemoveAt(index); - public void Insert(int index, VisualElement element) => _visualElement.Insert(index, element._visualElement); - public void AddToClassList(string className) => _visualElement.AddToClassList(className); - public void RemoveFromClassList(string className) => _visualElement.RemoveFromClassList(className); - public void RemoveFromHierarchy() => _visualElement.RemoveFromHierarchy(); - public IEnumerable GetClasses() => _visualElement.GetClasses(); - public Vector2D Position { get => _visualElement.worldBound.position.Map(); } - public Vector2D Size { get => _visualElement.worldBound.size.Map(); } - public bool ContainsLocalPoint(Vector2D localPoint) => _visualElement.ContainsPoint(localPoint.Map()); - public bool ContainsPoint(Vector2D worldPoint) => _visualElement.ContainsPoint((worldPoint - Position).Map()); - public bool ClassesContains(string className) => _visualElement.ClassListContains(className); - - public void SetStyleProperty(string name, string value) - { - var elem = UIParser.ParseEntry($"{name}:{value}", _visualElement); - if (elem != null) _visualElement = elem; - } - } -} diff --git a/api/Api/Utilities/AnyMap.cs b/api/Api/Utilities/AnyMap.cs deleted file mode 100644 index b010221742..0000000000 --- a/api/Api/Utilities/AnyMap.cs +++ /dev/null @@ -1,122 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -#nullable enable - -namespace SynthesisAPI.Utilities -{ - /// - /// Dynamic mapping of any reference type to its corresponding GenIndexArray - /// - public class AnyMap where TValue : class - { - Dictionary componentDict; - public AnyMap() - { - componentDict = new Dictionary(); - } - public void Set(ushort index, ushort gen, TValue val) - { - if (componentDict.TryGetValue(val.GetType(), out GenIndexArray arr)) - arr.Set(index, gen, val); - else - { - componentDict.Add(val.GetType(), new GenIndexArray()); - Set(index, gen, val); - } - } - - public void Remove(ushort index, ushort gen, Type componentType) - { - if (componentDict.TryGetValue(componentType, out GenIndexArray arr)) - arr.Set(index, gen, null); - } - - public TValue? Get(ushort index, ushort gen, Type componentType) - { - if (componentDict.TryGetValue(componentType, out GenIndexArray arr)) - { - return arr.Get(index, gen); - } - else - return null; - } - - public List? GetAll(ushort index, ushort gen) - { - var output = new List(); - foreach (var type in componentDict.Keys) - { - var entry = Get(index, gen, type); - if (entry != null) - output.Add(entry); - } - - return output; - } - - public void Clear() - { - componentDict.Clear(); - } - - #region GenIndexArray - - /// - /// Maps Entity to its component by its index : component index in entries is the same as Entity index - /// - class GenIndexArray - { - List entries; - - public GenIndexArray() - { - entries = new List(); - } - - struct Entry - { - public Entry(TValue? val, ulong gen) - { - Val = val; - Gen = gen; - } - public TValue? Val { get; } - public ulong Gen { get; } - } - - public void Set(ushort index, ushort gen, TValue? val) - { - ushort entityIndex = index; - ushort entityGen = gen; - if (entityIndex < entries.Count) - entries[entityIndex] = new Entry(val, entityGen); - else - { - //increase list size by populating "null" Entry so we can add value at index which is outside of bounds - for (int i = entries.Count; i < entityIndex; i++) - entries.Add(new Entry(null, 0)); //no Entity has gen of 0 so these entries can never be accessed - entries.Add(new Entry(val, entityGen)); - } - } - - public TValue? Get(ushort index, ushort gen) - { - ushort entityIndex = index; - ushort entityGen = gen; - if (entityIndex >= entries.Count) - return null; //prevents IndexOutOfBoundsException - Entry entry = entries[entityIndex]; - //only get component if generations match - avoids having reallocated Entities point to the components of deallocated Entities - if (entry.Gen == entityGen) - return entry.Val; - return null; - } - } - - #endregion - } -} diff --git a/api/Api/Utilities/Atomic.cs b/api/Api/Utilities/Atomic.cs deleted file mode 100644 index 549d2667db..0000000000 --- a/api/Api/Utilities/Atomic.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.Threading; - -namespace SynthesisAPI.Utilities { - - public class Atomic where T: struct { - private readonly ReaderWriterLockSlim _lock; - private T _value; - public T Value { - get { - _lock.EnterReadLock(); - var result = _value; - _lock.ExitReadLock(); - return result; - } - set { - _lock.EnterWriteLock(); - _value = value; - _lock.ExitWriteLock(); - } - } - - public Atomic(T val) { - _value = val; - _lock = new ReaderWriterLockSlim(); - } - - public static implicit operator T(Atomic atomic) => atomic.Value; - } - -} \ No newline at end of file diff --git a/api/Api/Utilities/BiDictionary.cs b/api/Api/Utilities/BiDictionary.cs deleted file mode 100644 index f241347be8..0000000000 --- a/api/Api/Utilities/BiDictionary.cs +++ /dev/null @@ -1,100 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; - -namespace SynthesisAPI.Utilities -{ - public class BiDictionary : IEnumerable> - { - private List> collection = new List>(); - - public B this[A query] { - get { - var i = collection.FindIndex(x => x.Key.Equals(query)); - if (i == -1) - throw new ArgumentException($"BiDictionary does not contain matching item for {query}"); - return collection[i].Value; - } - set { - collection.RemoveAll(x => x.Key.Equals(query)); - collection.Add(new KeyValuePair(query, value)); - } - } - public A this[B query] { - get { - var i = collection.FindIndex(x => x.Value.Equals(query)); - if (i == -1) - throw new ArgumentException($"BiDictionary does not contain matching item for {query}"); - return collection[i].Key; - } - set { - collection.RemoveAll(x => x.Value.Equals(query)); - collection.Add(new KeyValuePair(value, query)); - } - } - - public bool Contains(A query) - { - return collection.FindIndex(x => x.Key.Equals(query)) != -1; - } - - public bool Contains(B query) - { - return collection.FindIndex(x => x.Value.Equals(query)) != -1; - } - - public void Add(A key, B value) - { - if (!Contains(key) && !Contains(value)) - { - collection.Add(new KeyValuePair(key, value)); - } - else - { - throw new ArgumentException($"BiDictionary: Element already exists with key {key} or value {value}"); - } - } - - public bool TryGetValue(A key, out B value) - { - if (Contains(key)) - { - value = this[key]; - return true; - } - value = default; - return false; - } - - public bool TryGetValue(B value, out A key) - { - if (Contains(value)) - { - key = this[value]; - return true; - } - key = default; - return false; - } - - public IEnumerator> GetEnumerator() - { - return ((IEnumerable>)collection).GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return ((IEnumerable>)collection).GetEnumerator(); - } - - public void Add(BiDictionary dict) - { - collection.AddRange(dict.collection); - } - - public B GetUsingA(A key) => collection.Find(x => x.Key.Equals(key)).Value; - - public A GetUsingB(B key) => collection.Find(x => x.Value.Equals(key)).Key; - } -} \ No newline at end of file diff --git a/api/Api/Utilities/Bounds.cs b/api/Api/Utilities/Bounds.cs deleted file mode 100644 index d618b5e7dd..0000000000 --- a/api/Api/Utilities/Bounds.cs +++ /dev/null @@ -1,18 +0,0 @@ -using MathNet.Spatial.Euclidean; - -namespace SynthesisAPI.Utilities -{ - public class Bounds - { - internal UnityEngine.Bounds _bounds; - - public Bounds() - { - _bounds = new UnityEngine.Bounds(); - } - - public Vector3D Size => MathUtil.MapVector3(_bounds.size); - public Vector3D Extents => MathUtil.MapVector3(_bounds.extents); - public Vector3D Center => MathUtil.MapVector3(_bounds.center); - } -} diff --git a/api/Api/Utilities/GeneralHelper.cs b/api/Api/Utilities/GeneralHelper.cs deleted file mode 100644 index 619e4c4a12..0000000000 --- a/api/Api/Utilities/GeneralHelper.cs +++ /dev/null @@ -1,13 +0,0 @@ -using SynthesisAPI.RoboRIO; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace SynthesisAPI.Utilities -{ - public static class GeneralHelper - { - public static TResult Convert(this Enum i) => (TResult)Enum.Parse(typeof(TResult), i.ToString(), true); - } -} diff --git a/api/Api/Utilities/GlobalUtil.cs b/api/Api/Utilities/GlobalUtil.cs deleted file mode 100644 index 7f9842b902..0000000000 --- a/api/Api/Utilities/GlobalUtil.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -internal static class GlobalUtil { - - public static V TryGetDefault(this Dictionary dict, K key) where V : struct { - var success = dict.TryGetValue(key, out V res); - return success ? res : default; - } - - public static V TryGetDefault(this Dictionary dict, K key, V defa) { - var success = dict.TryGetValue(key, out V res); - return success ? res : defa; - } - -} diff --git a/api/Api/Utilities/ILogger.cs b/api/Api/Utilities/ILogger.cs deleted file mode 100644 index 4ce9868e8d..0000000000 --- a/api/Api/Utilities/ILogger.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace SynthesisAPI.Utilities -{ - public interface ILogger - { - void Log(object o, LogLevel logLevel = LogLevel.Info, [CallerMemberName] string memberName = "", [CallerFilePath] string filePath = "", [CallerLineNumber] int lineNumber = 0); - - void SetEnableDebugLogs(bool enable); - - void SetEnabled(bool enabled); - bool IsEnabled(); - } -} diff --git a/api/Api/Utilities/InputUtils.cs b/api/Api/Utilities/InputUtils.cs deleted file mode 100644 index 0624706a77..0000000000 --- a/api/Api/Utilities/InputUtils.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System; -using System.Linq; -using System.Text.RegularExpressions; -using UnityEngine; - -namespace SynthesisAPI.Utilities -{ - public static class InputUtils - { - public static bool GetKeyOrButtonDown(string name) - { - try - { - try - { - return Input.GetKeyDown((KeyCode)Enum.Parse(typeof(KeyCode), name)); - } - catch - { - return Input.GetKeyDown(name); - } - } - catch (ArgumentException) - { - try - { - return Input.GetButtonDown(name); - } - catch (ArgumentException) - { - Logger.Log($"Failed to find key or button named {name}"); - return false; - } - } - } - - public static bool GetKeyOrButton(string name) - { - try - { - - try - { - return Input.GetKey((KeyCode)Enum.Parse(typeof(KeyCode), name)); - } - catch - { - return Input.GetKey(name); - } - } - catch (ArgumentException) - { - try - { - return Input.GetButton(name); - } - catch (ArgumentException) - { - Logger.Log($"Failed to find key or button named {name}"); - return false; - } - } - } - - public static bool GetKeyOrButtonUp(string name) - { - try - { - try - { - return Input.GetKeyUp((KeyCode)Enum.Parse(typeof(KeyCode), name)); - } - catch - { - return Input.GetKeyUp(name); - } - } - catch (ArgumentException) - { - try - { - return Input.GetButtonUp(name); - } - catch (ArgumentException) - { - Logger.Log($"Failed to find key or button named {name}"); - return false; - } - } - } - } -} \ No newline at end of file diff --git a/api/Api/Utilities/LogLevel.cs b/api/Api/Utilities/LogLevel.cs deleted file mode 100644 index 0a69764a8e..0000000000 --- a/api/Api/Utilities/LogLevel.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace SynthesisAPI.Utilities -{ - public enum LogLevel - { - Info = 0, - Debug = 1, - Warning = 2, - Error = 3 - } -} diff --git a/api/Api/Utilities/Logger.cs b/api/Api/Utilities/Logger.cs deleted file mode 100644 index 84faa1c332..0000000000 --- a/api/Api/Utilities/Logger.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; - -#nullable enable - -namespace SynthesisAPI.Utilities -{ - public static class Logger - { - private static List Loggers => Inner.Loggers; - - public static void RegisterLogger(ILogger logger) - { - Loggers.Add(logger); - } - - // TODO ability to de-register a logger - - public static void Log(object o, LogLevel logLevel = LogLevel.Info, [CallerMemberName] string memberName = "", [CallerFilePath] string filePath = "", [CallerLineNumber] int lineNumber = 0) - { - foreach(var logger in Loggers) - { - logger.Log(o, logLevel, memberName, filePath, lineNumber); - } - } - - public static void SetEnableDebugLogs(bool enable) { - foreach (var logger in Loggers) { - if (logger.IsEnabled()) - logger.SetEnableDebugLogs(enable); - } - } - - private static class Inner - { - static Inner() { } - internal static List Loggers = new List(); - } - } -} diff --git a/api/Api/Utilities/Math.cs b/api/Api/Utilities/Math.cs deleted file mode 100644 index 27519c0f0e..0000000000 --- a/api/Api/Utilities/Math.cs +++ /dev/null @@ -1,46 +0,0 @@ -using MathNet.Spatial.Euclidean; -using System; - -namespace SynthesisAPI.Utilities -{ - public static class Math - { - public static T Min(T a, T b) where T : IComparable - { - return a.CompareTo(b) < 0 ? a : b; - } - - public static T Max(T a, T b) where T : IComparable - { - return a.CompareTo(b) < 0 ? b : a; - } - - public static T Clamp(T value, T min, T max) where T : IComparable - { - return Max(Min(value, max), min); - } - - public static double Abs(double v) - { - return v > 0 ? v : -v; - } - - public static bool ApproxEquals(double a, double b) - { - return System.Math.Abs(a - b) < 0.001; - } - - public static bool ApproxEquals(Quaternion a, Quaternion b) - { - return ApproxEquals(a.Real, b.Real) && - ApproxEquals(a.ImagX, b.ImagX) && - ApproxEquals(a.ImagY, b.ImagY) && - ApproxEquals(a.ImagZ, b.ImagZ); - } - - public static bool SameSign(double a, double b) - { - return (a < 0) == (b < 0); - } - } -} diff --git a/api/Api/Utilities/MathUtil.cs b/api/Api/Utilities/MathUtil.cs deleted file mode 100644 index f5d6832167..0000000000 --- a/api/Api/Utilities/MathUtil.cs +++ /dev/null @@ -1,179 +0,0 @@ -using System; -using MathNet.Spatial.Euclidean; -using MathNet.Spatial.Units; - -namespace SynthesisAPI.Utilities -{ - public static class MathUtil - { - public static Quaternion FromEuler(EulerAngles inAngle) - { - // Math from https://math.stackexchange.com/questions/2975109/how-to-convert-euler-angles-to-quaternions-and-get-the-same-euler-angles-back-fr - - var yaw = inAngle.Alpha.Radians; - var pitch = inAngle.Beta.Radians; - var roll = inAngle.Gamma.Radians; - - var sinYaw = System.Math.Sin(yaw / 2); - var cosYaw = System.Math.Cos(yaw / 2); - var sinPitch = System.Math.Sin(pitch / 2); - var cosPitch = System.Math.Cos(pitch / 2); - var sinRoll = System.Math.Sin(roll / 2); - var cosRoll = System.Math.Cos(roll / 2); - - var qx = sinRoll * cosPitch * cosYaw - cosRoll * sinPitch * sinYaw; - - var qy = cosRoll * sinPitch * cosYaw + sinRoll * cosPitch * sinYaw; - - var qz = cosRoll * cosPitch * sinYaw - sinRoll * sinPitch * cosYaw; - - var qw = cosRoll * cosPitch * cosYaw + sinRoll * sinPitch * sinYaw; - - // This z, y, x order works correctly with interchanging Quaternions and EulerAngles - // using Quaternion.ToEulerAngles() - return new Quaternion(qw, qz, qy, qx); - } - - public static Vector3D ToVector(EulerAngles eulerAngles) - { - return new Vector3D(eulerAngles.Alpha.Degrees, eulerAngles.Beta.Degrees, eulerAngles.Gamma.Degrees); - } - - public static UnitVector3D ToWorldVector(UnitVector3D vector, Quaternion rotation) - { - return ToWorldVector(vector.ToVector3D(), rotation).Normalize(); - } - - public static Vector3D ToWorldVector(Vector3D vector, Quaternion rotation) - { - var rot = rotation.Inversed.Normalized; - - // Math from https://gamedev.stackexchange.com/questions/28395/rotating-vector3-by-a-quaternion - - Vector3D u = new Vector3D(rot.ImagX, rot.ImagY, rot.ImagZ); - double s = rot.Real; - - return 2d * u.DotProduct(vector) * u - + (s * s - u.DotProduct(u)) * vector - + 2d * s * u.CrossProduct(vector); - } - - /// - /// Linear interpolation - /// - public static double Lerp(double a, double b, double by) - { - return a * (1 - by) + b * by; - } - - /// - /// Linear interpolation - /// - public static Vector3D Lerp(Vector3D a, Vector3D b, double by) - { - return new Vector3D(Lerp(a.X, b.X, by), Lerp(a.Y, b.Y, by), Lerp(a.Z, b.Z, by)); - } - - public static Quaternion Lerp(Quaternion a, Quaternion b, double by) - { - return new Quaternion(Lerp(a.Real, b.Real, by), Lerp(a.ImagX, b.ImagX, by), Lerp(a.ImagY, b.ImagY, by), Lerp(a.ImagZ, b.ImagZ, by)); - } - - public static Quaternion LookAt(UnitVector3D forward) - { - return LookAt(forward, UnitVector3D.YAxis); - } - - public static Quaternion LookAt(UnitVector3D forward, UnitVector3D upward) - { - return MapUnityQuaternion(UnityEngine.Quaternion.LookRotation( - MapVector3D(forward.ToVector3D()), - MapVector3D(upward.ToVector3D()))).Normalized; - } - - public static Quaternion RotateTowards(Quaternion from, Quaternion to, float maxDegreesDelta) - { - return MapUnityQuaternion(UnityEngine.Quaternion.RotateTowards(MapQuaternion(from), MapQuaternion(to), maxDegreesDelta)).Normalized; - } - - internal static Vector2D MapVector2(UnityEngine.Vector2 vec) => - new Vector2D(vec.x, vec.y); - internal static UnityEngine.Vector2 MapVector2D(Vector2D vec) => - new UnityEngine.Vector2((float)vec.X, (float)vec.Y); - internal static UnityEngine.Vector3 MapVector3D(Vector3D vec) => - new UnityEngine.Vector3((float)vec.X, (float)vec.Y, (float)vec.Z); - internal static Vector3D MapVector3(UnityEngine.Vector3 vec) => - new Vector3D(vec.x, vec.y, vec.z); - internal static Quaternion MapUnityQuaternion(UnityEngine.Quaternion q) => - new Quaternion(q.w, q.x, q.y, q.z); - internal static UnityEngine.Quaternion MapQuaternion(Quaternion q) => - new UnityEngine.Quaternion((float)q.ImagX, (float)q.ImagY, (float)q.ImagZ, (float)q.Real); - - public static UnitVector3D QuaternionToForwardVector(Quaternion rotation) - { - var q = MapQuaternion(rotation); - return MapVector3(q * UnityEngine.Vector3.forward).Normalize(); - } - - public static Quaternion Rotate(Quaternion start, UnitVector3D axis, double angle, bool useWorldAxis = false) - { - return Rotate(start, axis, Angle.FromDegrees(angle), useWorldAxis); - } - - public static Quaternion Rotate(Quaternion start, UnitVector3D axis, Angle angle, bool useWorldAxis = false) - { - if (useWorldAxis) - { - axis = MathUtil.ToWorldVector(axis, start); - } - - // Math from https://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm - var real = System.Math.Cos(angle.Radians / 2d); - - var factor = System.Math.Sin(angle.Radians / 2d); - var imagX = axis.X * factor; - var imagY = axis.Y * factor; - var imagZ = axis.Z * factor; - try - { - start = new Quaternion(real, imagX, imagY, imagZ).Normalized.RotateRotationQuaternion(start).Normalized; - } - catch (Exception e) - { - throw new Exception($"Rotation of {start} failed: {angle} around axis {axis}", e); - } - return start; - } - - public static Quaternion Rotate(Quaternion start, Vector3D eulerAngles) - { - return Rotate(start, new EulerAngles(Angle.FromDegrees(eulerAngles.X), Angle.FromDegrees(eulerAngles.Y), - Angle.FromDegrees(eulerAngles.Z))); - } - - public static Quaternion Rotate(Quaternion start, EulerAngles eulerAngles) - { - return Rotate(start, MathUtil.FromEuler(eulerAngles)); - } - - public static Quaternion Rotate(Quaternion start, Quaternion rotation) - { - try - { - start = rotation.Normalized.RotateRotationQuaternion(start).Normalized; - } - catch (Exception e) - { - throw new Exception($"Rotation of {start} failed with provided quaternion {rotation}", e); - } - return start; - } - - public static Vector2D Map(this UnityEngine.Vector2 vec) => new Vector2D(vec.x, vec.y); - public static Vector3D Map(this UnityEngine.Vector3 vec) => new Vector3D(vec.x, vec.y, vec.z); - public static Quaternion Map(this UnityEngine.Quaternion quat) => MapUnityQuaternion(quat); - public static UnityEngine.Vector2 Map(this Vector2D vec) => MapVector2D(vec); - public static UnityEngine.Vector3 Map(this Vector3D vec) => MapVector3D(vec); - public static UnityEngine.Quaternion Map(this Quaternion quat) => MapQuaternion(quat); - } -} \ No newline at end of file diff --git a/api/Api/Utilities/ParamsHelper.cs b/api/Api/Utilities/ParamsHelper.cs deleted file mode 100644 index a4191b5ac4..0000000000 --- a/api/Api/Utilities/ParamsHelper.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; - -namespace SynthesisAPI.Utilities -{ - public static class ParamsHelper - { - public static object[] CollapseTuple((T1 t1, T2 t2) t) => new object[] {t.t1!, t.t2!}; - public static object[] CollapseTuple((T1 t1, T2 t2, T3 t3) t) => new object[] {t.t1!, t.t2!, t.t3!}; - public static object[] CollapseTuple((T1 t1, T2 t2, T3 t3, T4 t4) t) => new object[] {t.t1!, t.t2!, t.t3!, t.t4!}; - - - public static (T1, T2) PackParams(params object[] args) - { - if(args.Length != 2) - throw new Exception("Invalid argument count."); - return ((T1) args[0], (T2) args[1]); - } - - public static (T1, T2, T3) PackParams(params object[] args) - { - if(args.Length != 3) - throw new Exception("Invalid argument count."); - return ((T1) args[0], (T2) args[1], (T3) args[2]); - } - - public static (T1, T2, T3, T4) PackParams(params object[] args) - { - if(args.Length != 4) - throw new Exception("Invalid argument count."); - return ((T1) args[0], (T2) args[1], (T3) args[2], (T4) args[3]); - } - } -} diff --git a/api/Api/Utilities/ReflectHelper.cs b/api/Api/Utilities/ReflectHelper.cs deleted file mode 100644 index 5baa60bad6..0000000000 --- a/api/Api/Utilities/ReflectHelper.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SynthesisAPI.Utilities -{ - public static class ReflectHelper - { - - //https://stackoverflow.com/questions/457676/check-if-a-class-is-derived-from-a-generic-class - public static bool IsSubclassOfRawGeneric(Type generic, Type toCheck) - { - while (toCheck != null && toCheck != typeof(object)) - { - var cur = toCheck.IsGenericType ? toCheck.GetGenericTypeDefinition() : toCheck; - if (generic == cur) - { - return true; - } - - toCheck = toCheck.BaseType; - } - - return false; - } - public static T CastObject(object input) => (T) input; - } - -} diff --git a/api/Api/Utilities/Result.cs b/api/Api/Utilities/Result.cs deleted file mode 100644 index 688c103f74..0000000000 --- a/api/Api/Utilities/Result.cs +++ /dev/null @@ -1,76 +0,0 @@ -using SynthesisAPI.VirtualFileSystem; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SynthesisAPI.Utilities -{ - /// - /// A type intended for use as a return, encapsulates both success and failure states - /// - /// Value type of the return - /// Possible error type of the function - public class Result where TError: Exception - { - - public Result(TValue val) => value = val; - - public Result(TError err) - { - error = err; - isError = true; - } - - public TValue GetResult() - { - if (!isError) - return value; - throw error; - } - - public TError GetError() - { - if (!isError) - throw new SynthesisException("Result is not an error type"); - return error; - } - - public static implicit operator TValue(Result res) - { - return res.GetResult(); - } - - public static implicit operator TError(Result res) - { - return res.GetError(); - } - - public Result MapResult(Func f) - { - if(isError) - { - return new Result(error); - } - return new Result(f(value)); - } - - public Result MapError(Func f) where TNewError : Exception - { - if(!isError) - { - return new Result(value); - } - return new Result(f(error)); - } - - public Result Map(Func f, - Func g) where TNewError : Exception => - MapResult(f).MapError(g); - - public readonly bool isError; - private readonly TValue value = default!; - private readonly TError error = default!; - } -} diff --git a/api/Api/Utilities/SharedBinaryStream.cs b/api/Api/Utilities/SharedBinaryStream.cs deleted file mode 100644 index 8ff33f80fd..0000000000 --- a/api/Api/Utilities/SharedBinaryStream.cs +++ /dev/null @@ -1,228 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading; -using System.Threading.Tasks; - -#nullable enable - -namespace SynthesisAPI.Utilities -{ - /// - /// A thread-dafe binary stream - /// - /// The type of stream to use - public class SharedBinaryStream - { - public SharedBinaryStream(Stream stream, ReaderWriterLockSlim lck, int t) - { - Timeout = t; - RwLock = lck; - Stream = stream; - Reader = new BinaryReader(Stream); - Writer = new BinaryWriter(Stream); - } - - public SharedBinaryStream(Stream stream, ReaderWriterLockSlim lck) : this(stream, lck, DefaultTimeout) { } - - private const int DefaultTimeout = 5000; - - private ReaderWriterLockSlim RwLock { get; set; } - - public int Timeout { get; set; } // ms - - public Stream Stream { get; private set; } - - private BinaryReader Reader { get; set; } - - private BinaryWriter Writer { get; set; } - - public void SetLength(long len) - { - if (RwLock.TryEnterReadLock(Timeout)) - { - try - { - Stream.SetLength(len); - } - finally - { - RwLock.ExitReadLock(); - } - } - else - { - throw new Exception(); - } - - } - - public bool TrySetLength(long len) - { - if (RwLock.TryEnterReadLock(Timeout)) - { - try - { - Stream.SetLength(len); - } - finally - { - RwLock.ExitReadLock(); - } - return true; - } - else - { - return false; - } - - } - - public long Seek(long offset, SeekOrigin loc = SeekOrigin.Begin) - { - if (RwLock.TryEnterReadLock(Timeout)) - { - try - { - return Stream.Seek(offset, loc); - } - finally - { - RwLock.ExitReadLock(); - } - } - else - { - throw new Exception(); - } - - } - - public long? TrySeek(long offset, SeekOrigin loc = SeekOrigin.Begin) - { - if (RwLock.TryEnterReadLock(Timeout)) - { - try - { - return Stream.Seek(offset, loc); - } - finally - { - RwLock.ExitReadLock(); - } - } - else - { - return null; - } - - } - - public byte[] ReadBytes(int count) - { - if (RwLock.TryEnterReadLock(Timeout)) - { - try - { - long pos = Stream.Position; - byte[] read = Reader.ReadBytes(count); - Stream.Position = pos + read.Length; - return read; - } - finally - { - RwLock.ExitReadLock(); - } - } - else - { - throw new Exception(); - } - } - - public byte[]? TryReadBytes(int count) - { - if (RwLock.TryEnterReadLock(Timeout)) - { - try - { - long pos = Stream.Position; - byte[] read = Reader.ReadBytes(count); - Stream.Position = pos + read.Length; - return read; - } - finally - { - RwLock.ExitReadLock(); - } - } - else - { - return null; - } - } - - public byte[] ReadToEnd() - { - return ReadBytes((int)Stream.Length); - } - - public byte[]? TryReadToEnd() - { - return TryReadBytes((int)Stream.Length); - } - - public void WriteBytes(byte[] buffer) => WriteBytes(buffer, 0, buffer.Length); - - public void WriteBytes(string line) => WriteBytes(Encoding.UTF8.GetBytes(line)); - public void WriteBytes(byte[] buffer, int index, int count) - { - if (RwLock.TryEnterWriteLock(Timeout)) - { - try - { - Writer.Write(buffer, index, count); - Writer.Flush(); // TODO - } - finally - { - RwLock.ExitWriteLock(); - } - } - else - { - throw new Exception(); - } - } - - public bool TryWriteBytes(string line) => - TryWriteBytes(Encoding.UTF8.GetBytes(line)); - - - public bool TryWriteBytes(byte[] buffer) => - TryWriteBytes(buffer, 0, buffer.Length); - - public bool TryWriteBytes(byte[] buffer, int index, int count) - { - if (RwLock.TryEnterWriteLock(Timeout)) - { - try - { - Writer.Write(buffer, index, count); - Writer.Flush(); // TODO - } - finally - { - RwLock.ExitWriteLock(); - } - return true; - } - else - { - return false; - } - } - } -} diff --git a/api/Api/Utilities/SharedTextStream.cs b/api/Api/Utilities/SharedTextStream.cs deleted file mode 100644 index 6765450b44..0000000000 --- a/api/Api/Utilities/SharedTextStream.cs +++ /dev/null @@ -1,238 +0,0 @@ -using System; -using System.IO; -using System.Threading; - -#nullable enable - -namespace SynthesisAPI.Utilities -{ - /// - /// A thread-dafe text stream - /// - /// The type of stream to use - public class SharedTextStream - { - // TODO ref_count for dispose function? - // TODO combine with SharedBinaryStream - - public SharedTextStream(Stream stream, ReaderWriterLockSlim lck, int t) - { - Timeout = t; - RwLock = lck; - Stream = stream; - Reader = new StreamReader(Stream); - Writer = new StreamWriter(Stream); - } - - public SharedTextStream(Stream stream, ReaderWriterLockSlim lck) : this(stream, lck, DefaultTimeout) { } - - private const int DefaultTimeout = 5000; - - private ReaderWriterLockSlim RwLock { get; set; } - - public int Timeout { get; set; } // ms - - public Stream Stream { get; private set; } - - private StreamReader Reader { get; set; } - - private StreamWriter Writer { get; set; } - - public void SetLength(long len) - { - if (RwLock.TryEnterReadLock(Timeout)) - { - try - { - Stream.SetLength(len); - } - finally - { - RwLock.ExitReadLock(); - } - } - else - { - throw new Exception(); - } - - } - - public bool TrySetLength(long len) - { - if (RwLock.TryEnterReadLock(Timeout)) - { - try - { - Stream.SetLength(len); - } - finally - { - RwLock.ExitReadLock(); - } - return true; - } - else - { - return false; - } - - } - public long Seek(long offset, SeekOrigin loc = SeekOrigin.Begin) - { - if (RwLock.TryEnterReadLock(Timeout)) - { - try - { - return Stream.Seek(offset, loc); - } - finally - { - RwLock.ExitReadLock(); - } - } - else - { - throw new Exception(); - } - - } - - public long? TrySeek(long offset, SeekOrigin loc = SeekOrigin.Begin) - { - if (RwLock.TryEnterReadLock(Timeout)) - { - try - { - return Stream.Seek(offset, loc); - } - finally - { - RwLock.ExitReadLock(); - } - } - else - { - return null; - } - - } - - public string ReadLine() - { - if (RwLock.TryEnterReadLock(Timeout)) - { - try - { - return Reader.ReadLine(); - } - finally - { - RwLock.ExitReadLock(); - } - } - else - { - throw new Exception("Cannot ReadLine, Thread lock timed out"); // why though and also what, should this be an empty string ?, probably should through a specific exception about the mutex lock - } - } - - public string? TryReadLine() - { - if (RwLock.TryEnterReadLock(Timeout)) - { - try - { - return Reader.ReadLine(); - } - finally - { - RwLock.ExitReadLock(); - } - } - else - { - return null; - } - } - - public string ReadToEnd() - { - if (RwLock.TryEnterReadLock(Timeout)) - { - try - { - return Reader.ReadToEnd(); - } - finally - { - RwLock.ExitReadLock(); - } - } - else - { - throw new Exception(); - } - } - - public string? TryReadToEnd() - { - if (RwLock.TryEnterReadLock(Timeout)) - { - try - { - return Reader.ReadToEnd(); - } - finally - { - RwLock.ExitReadLock(); - } - } - else - { - return null; - } - } - - public void WriteLine(string line) - { - if (RwLock.TryEnterWriteLock(Timeout)) - { - try - { - Writer.WriteLine(line); - Writer.Flush(); // TODO - } - finally - { - RwLock.ExitWriteLock(); - } - } - else - { - throw new Exception(); - } - } - - public bool TryWriteLine(string line) - { - if (RwLock.TryEnterWriteLock(Timeout)) - { - try - { - Writer.WriteLine(line); - Writer.Flush(); // TODO - } - finally - { - RwLock.ExitWriteLock(); - } - return true; - } - else - { - return false; - } - } - } -} diff --git a/api/Api/Utilities/SynthesisException.cs b/api/Api/Utilities/SynthesisException.cs deleted file mode 100644 index 32f2142d2b..0000000000 --- a/api/Api/Utilities/SynthesisException.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; - -namespace SynthesisAPI.Utilities -{ - public class SynthesisException : Exception - { - public SynthesisException() { } - public SynthesisException(string message) : base(message) { } - public SynthesisException(string message, Exception inner) : base(message, inner) { } - } -} diff --git a/api/Api/Utilities/Text.cs b/api/Api/Utilities/Text.cs deleted file mode 100644 index d73293a5f4..0000000000 --- a/api/Api/Utilities/Text.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.Collections.Generic; - -namespace SynthesisAPI.Utilities -{ - public static class Text - { - /// - /// Split a line along new-lines or at the last space before the line exceeds the max line limit - /// - /// The line of text to format - /// Maximum number of characters on a line - /// - public static List SplitLines(string text, int maxLineLength) - { - var lines = new List(); - for (var i = 0; i < text.Length;) - { - var nextRangeLength = Math.Min(maxLineLength, text.Length - i); - var newline = text.IndexOf('\n', i, nextRangeLength); - if (newline != -1) // If there's a new line character, then break there - { - lines.Add(text.Substring(i, newline - i)); - i = newline + 1; - } - else if ((i + nextRangeLength) == text.Length) // If this is the last chunk of text, then break there - { - lines.Add(text.Substring(i, nextRangeLength)); - i += nextRangeLength; - } - else - { - var lastSpace = text.LastIndexOf(' ', i + nextRangeLength - 1, nextRangeLength); - if (lastSpace != -1) // Break at last space on the line - { - lines.Add(text.Substring(i, lastSpace - i)); - i = lastSpace + 1; - } - else // Break once the line exceeds maxLineLength - { - lines.Add(text.Substring(i, nextRangeLength)); - i += nextRangeLength; - } - } - } - return lines; - } - } -} diff --git a/api/Api/Utilities/Toolkit.cs b/api/Api/Utilities/Toolkit.cs deleted file mode 100644 index e2e0cf7ad8..0000000000 --- a/api/Api/Utilities/Toolkit.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; - -namespace SynthesisAPI.Utilities -{ - public class Toolkit - { - public static T DeserializeJson(string jsonString) - { - // object result = System.Text.Json.JsonSerializer.Deserialize(jsonString); - // return (T) Convert.ChangeType(result, typeof(T)); - return default; - } - } -} \ No newline at end of file diff --git a/api/Api/Utilities/TranslatorUtil.cs b/api/Api/Utilities/TranslatorUtil.cs deleted file mode 100644 index cc88c7048a..0000000000 --- a/api/Api/Utilities/TranslatorUtil.cs +++ /dev/null @@ -1,91 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Xml; - -#nullable enable - -/// -/// Utility class defined in the main scope -/// - -[assembly: InternalsVisibleTo(assemblyName: "TranslatorTest")] - -internal static class TranslatorUtil { - public static XmlNode? Find(this XmlNodeList nodes, Predicate condition) { - var enumerator = nodes.GetEnumerator(); - enumerator.Reset(); - while (enumerator.MoveNext()) { - if (condition((XmlNode)enumerator.Current)) - return (XmlNode)enumerator.Current; - } - - return null; - } - - public static List FindAll(this XmlNodeList nodes, Predicate condition) { - var matchingNodes = new List(); - var enumerator = nodes.GetEnumerator(); - enumerator.Reset(); - while (enumerator.MoveNext()) { - if (condition((XmlNode)enumerator.Current)) - matchingNodes.Add((XmlNode)enumerator.Current); - } - - return matchingNodes; - } - - public static List Map(this IEnumerable collection, Func modification) { - List modCollection = new List(); - foreach (var x in collection) { - modCollection.Add(modification(x)); - } - return modCollection; - } - - public static List Map(this IEnumerable collection, Func modification) { - List modCollection = new List(); - foreach (var x in collection) { - modCollection.Add(modification(x)); - } - return modCollection; - } - - public static List ToList(this XmlNodeList nodes) { - var nodeList = new List(); - foreach (XmlNode n in nodes) { - nodeList.Add(n); - } - return nodeList; - } - - public static string ToHexString(this byte[] buf) { - List strs = buf.Map(x => x.ToHexString()); - string res = string.Empty; - foreach (var s in strs) { - res += s; - } - return res; - } - public static string ToHexString(this byte b) - => ((byte)((b & 0xF0) >> 4)).ToHexCharacter().ToString() - + ((byte)(b & 0x0F)).ToHexCharacter(); - public static char ToHexCharacter(this byte b) { - switch (b) { - case 10: - return 'a'; - case 11: - return 'b'; - case 12: - return 'c'; - case 13: - return 'd'; - case 14: - return 'e'; - case 15: - return 'f'; - default: - return b.ToString()[0]; - } - } -} diff --git a/api/Api/Utilities/UniqueTypeList.cs b/api/Api/Utilities/UniqueTypeList.cs deleted file mode 100644 index 8efa4c4b56..0000000000 --- a/api/Api/Utilities/UniqueTypeList.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; - -namespace SynthesisAPI.Utilities -{ - public class UniqueTypeList : IEnumerable - { - private Dictionary entries; - public UniqueTypeList() - { - entries = new Dictionary(); - } - public U Get() where U : T - { - if (entries.ContainsKey(typeof(U))) - return (U) entries[typeof(U)]; - return default; // TODO indicate error of some kind - } - public bool HasType() where U : T => entries.ContainsKey(typeof(U)); - public bool HasType(Type t) => entries.ContainsKey(t); - public bool Add(U val) where U : T - { - if (entries.ContainsKey(typeof(U))) - return false; - entries[typeof(U)] = val; - return true; - } - public void ForceAdd(U val) where U : T - { - entries[typeof(U)] = val; - } - public bool Remove() - { - return Remove(typeof(U)); - } - public bool Remove(Type type) - { - return entries.Remove(type); - } - - public IEnumerator GetEnumerator() - { - return entries.Values.GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - - public IEnumerable Values { get => entries.Values; } - } -} diff --git a/api/Api/Utilities/UnityResyncer.cs b/api/Api/Utilities/UnityResyncer.cs deleted file mode 100644 index 40cb9fa986..0000000000 --- a/api/Api/Utilities/UnityResyncer.cs +++ /dev/null @@ -1,81 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading; -using UnityEngine; - -#nullable enable - -namespace SynthesisAPI.Utilities { - /// - /// The Unity Resyncer schedules actions to be run on the main thread. Unity requires an annoying - /// amount to be run on the main thread, and this should help - /// - /// TODO: TEST THIS - /// - public static class UnityResyncer { - - /// - /// Queue an action to be run on the main thread - /// - /// Action you wish to run on the main thread - /// Handler for the action - public static ResyncHandler Resync(Action act) { - - if (Instance == null) - throw new Exception("Instance doesn't exist yet"); - - var handler = new ResyncHandler(); - Instance.queueTasks.Enqueue((act, handler)); - return handler; - } - - public static UnityResyncerComponent? Instance = null; - } - - /// - /// The actual Unity component to schedule actions to run on the main thread - /// - public class UnityResyncerComponent : MonoBehaviour { - public float MaxExecuteTimeS = 0.1f; - - public Queue<(Action act, ResyncHandler handler)> queueTasks = new Queue<(Action act, ResyncHandler handler)>(); - - private void Awake() { - UnityResyncer.Instance = this; - } - - private void Update() { - float start = Time.realtimeSinceStartup; - while (Time.realtimeSinceStartup - start < MaxExecuteTimeS && queueTasks.Count > 0) { - var q = queueTasks.Dequeue(); - q.act(); - q.handler.IsDone = true; - } - } - } - - /// - /// Handler class for checking on the status of a resynced task - /// - /// TODO: TEST THIS - /// - public class ResyncHandler { - private readonly object threadLock = new object(); - private bool isDone = false; - public bool IsDone { - get => isDone; - set { - lock (threadLock) { - isDone = value; - } - } - } - - public void Wait(double timeOutS) { - double start = DateTimeOffset.UtcNow.ToUnixTimeSeconds(); - while (!isDone && DateTimeOffset.UtcNow.ToUnixTimeSeconds() - start < timeOutS) { - Thread.Sleep(5); - } - } - } -} diff --git a/api/Api/VirtualFileSystem/Directory.cs b/api/Api/VirtualFileSystem/Directory.cs deleted file mode 100644 index 172c5c7e0f..0000000000 --- a/api/Api/VirtualFileSystem/Directory.cs +++ /dev/null @@ -1,375 +0,0 @@ -using SynthesisAPI.Utilities; -using System; -using System.Collections.Generic; -using System.Linq; - -#nullable enable - -namespace SynthesisAPI.VirtualFileSystem -{ - /// - /// A wrapper for a dictionary of entries that gives structure to the virtual file system - /// - public sealed class Directory : IEntry - { - public string Name => ((IEntry)this).Name; - public Permissions Permissions => ((IEntry)this).Permissions; - public Directory? Parent => ((IEntry)this).Parent; - - private string _name { get; set; } - private Permissions _permissions { get; set; } - private Directory? _parent { get; set; } - - string IEntry.Name { get => _name; set => _name = value; } - Permissions IEntry.Permissions { get => _permissions; set => _permissions = value; } - Directory? IEntry.Parent { get => _parent; set => _parent = value; } - - internal Dictionary Entries; - - public static readonly char DirectorySeparatorChar = '/'; - - public Directory(string name, Permissions perm) - { - // unclear why init existed - _name = name; - _permissions = perm; - _parent = null!; - - Entries = new Dictionary {{".", this}, {"..", null!}}; - } - - [ExposedApi] - void IEntry.Delete() - { - using var _ = ApiCallSource.StartExternalCall(); - DeleteInner(); - } - - [ExposedApi] - public void Delete() - { - using var _ = ApiCallSource.StartExternalCall(); - - DeleteInner(); - } - - internal void DeleteInner() { - ApiCallSource.AssertAccess(Permissions, Access.Write); - foreach (var e in Entries) - { - if (e.Key != "" && e.Key != "." && e.Key != "..") - { - e.Value.DeleteInner(); - } - } - if (Parent != null) - { - Parent.RemoveEntryInner(Name); - } - } - - void IEntry.DeleteInner() - { - ApiCallSource.AssertAccess(Permissions, Access.Write); - DeleteInner(); - } - - [ExposedApi] - public static string MakePath(params string[] subpaths) - { - return String.Join(DirectorySeparatorChar.ToString(), subpaths); - } - - internal static (string, string[]) GetTopDirectory(string[] paths) - { - if(paths.Length == 0) - { - throw new DirectoryException(); - } - string target = paths[0]; - paths = paths.Skip(1).ToArray(); - return (target, paths); - } - - internal static string[] SplitPath(string path) - { - if (path.Length > 0 && path[path.Length - 1] == DirectorySeparatorChar) - { - // trim the last slash? (ex: "/modules/sample_module/" -> "/modules/sample_module") - path = path.Remove(path.Length - 1, 1); - } - return path.Split(DirectorySeparatorChar); - } - - [ExposedApi] - public string GetPath() - { - using var _ = ApiCallSource.StartExternalCall(); - return GetPathInner(); - } - - internal string GetPathInner() - { - string path = ""; - Directory? dir = this; - while (dir != null) { - path = dir.Name + DirectorySeparatorChar + path; - - dir = dir.Parent; - } - return path; - } - - private IEntry? TraverseImpl(string[] subpaths) - { - if (subpaths.Length == 0) - { - return null; - } - - string target; - (target, subpaths) = GetTopDirectory(subpaths); - - var next = TryGetEntryInner(target); - - if (subpaths.Length == 0) - { - return next; - } - - if (next == null) - { - return null; - } - - if (next is Directory directory) - { - return directory.TraverseImpl(subpaths); - } - - return null; - } - - /// - /// Traverse this Directory and subdirectories to a entry given a file path - /// - /// - /// - [ExposedApi] - public IEntry? Traverse(string[] subpaths) - { - using var _ = ApiCallSource.StartExternalCall(); - - return TraverseInner(subpaths); - } - - - internal IEntry? TraverseInner(string[] subpaths) - { - using var _ = ApiCallSource.StartExternalCall(); - - return TraverseImpl(subpaths); - } - - [ExposedApi] - public TEntry? Traverse(string[] subpaths) where TEntry : class, IEntry - { - using var _ = ApiCallSource.StartExternalCall(); - - return TraverseInner(subpaths); - } - - - internal TEntry? TraverseInner(string[] subpaths) where TEntry : class, IEntry - { - using var _ = ApiCallSource.StartExternalCall(); - - return (TEntry?)TraverseImpl(subpaths); - } - - /// - /// Traverse this Directory and subdirectories to an entry given a file path - /// - /// - /// - [ExposedApi] - public IEntry? Traverse(string path) - { - using var _ = ApiCallSource.StartExternalCall(); - - return TraverseInner(path); - } - - internal IEntry? TraverseInner(string path) - { - ApiCallSource.AssertAccess(Permissions, Access.Read); - return TraverseImpl(SplitPath(path)); - } - - [ExposedApi] - public TEntry? Traverse(string path) where TEntry : class, IEntry - { - using var _ = ApiCallSource.StartExternalCall(); - - return TraverseInner(path); - } - - internal TEntry? TraverseInner(string path) where TEntry : class, IEntry - { - ApiCallSource.AssertAccess(Permissions, Access.Read); - return (TEntry?)TraverseImpl(SplitPath(path)); - } - - [ExposedApi] - public IEntry? TryGetEntry(string key) - { - using var _ = ApiCallSource.StartExternalCall(); - return TryGetEntryInner(key); - } - - internal IEntry? TryGetEntryInner(string key) - { - return Entries.TryGetValue(key, out var x) ? x : null; - } - - /// - /// Add a new entry to this Directory - /// - /// - /// - /// - [ExposedApi] - public TEntry AddEntry(TEntry value) where TEntry : IEntry - { - using var _ = ApiCallSource.StartExternalCall(); - - return AddEntryInner(value); - } - - internal TEntry AddEntryInner(TEntry value) where TEntry : IEntry - { - return (TEntry)AddEntryImpl(value); - } - - /// - /// Add a new entry to this Directory - /// - /// - /// - [ExposedApi] - public IEntry AddEntry(IEntry value) - { - using var _ = ApiCallSource.StartExternalCall(); - - return AddEntryImpl(value); - } - - private IEntry AddEntryImpl(IEntry value) - { - ApiCallSource.AssertAccess(Permissions, Access.Write); - if (value.Name.Equals("")) - { - throw new DirectoryException("Directory: adding entry with empty name"); - } - if (Entries.ContainsKey(value.Name)) - { - throw new DirectoryException($"Directory: adding entry to \"{GetPathInner()}\" with existing name \"{value.Name}\""); - } - Entries.Add(value.Name, value); - - // Set this as the parent of the entry. - // If the entry is a directory, then add the parent (this) to its list of entries - value.Parent = this; - if (value is Directory dir) - { - if (dir.Entries[".."] != null) - { - throw new DirectoryException($"Directory: adding entry \"{value.Name}\" with existing parent (entries cannot exist in multiple directories)"); - } - if (dir.Parent != null) - dir.Entries[".."] = dir.Parent; - } - - return Entries[value.Name]; - } - - [ExposedApi] - public void DeleteEntry(string key) - { - using var _ = ApiCallSource.StartExternalCall(); - - DeleteEntryInner(key); - } - - internal void DeleteEntryInner(string key) - { - ApiCallSource.AssertAccess(Permissions, Access.Write); - if (key.Equals("") || key.Equals(".") || key.Equals("..")) - { - throw new DirectoryException("Cannot remove this \".\" or parent \"..\" from directory entries"); - } - - if (Entries.ContainsKey(key)) - { - Entries[key].DeleteInner(); - } - } - - [ExposedApi] - public IEntry? RemoveEntry(string key) - { - using var _ = ApiCallSource.StartExternalCall(); - return RemoveEntryInner(key); - } - - internal IEntry? RemoveEntryInner(string key) - { - ApiCallSource.AssertAccess(Permissions, Access.Write); - if (key.Equals("") || key.Equals(".") || key.Equals("..")) - { - throw new DirectoryException("Cannot remove this \".\" or parent \"..\" from directory entries"); - } - - if (Entries.ContainsKey(key)) - { - var entry = Entries[key]; - entry.Parent = null; - Entries.Remove(key); - return entry; - } - return null; - } - - [ExposedApi] - public bool EntryExists(string key) where TEntry : IEntry - { - using var _ = ApiCallSource.StartExternalCall(); - return EntryExistsInner(key); - } - - internal bool EntryExistsInner(string key) where TEntry : IEntry - { - ApiCallSource.AssertAccess(Permissions, Access.Read); - return Entries.ContainsKey(key) && Entries[key] is TEntry; - } - - [ExposedApi] - public bool EntryExists(string key) - { - using var _ = ApiCallSource.StartExternalCall(); - return EntryExistsInner(key); - } - - internal bool EntryExistsInner(string key) - { - ApiCallSource.AssertAccess(Permissions, Access.Read); - return Entries.ContainsKey(key); - } - - [ExposedApi] - public IEntry? this[string name] - { - get => TryGetEntry(name); - } - } -} diff --git a/api/Api/VirtualFileSystem/DirectoryException.cs b/api/Api/VirtualFileSystem/DirectoryException.cs deleted file mode 100644 index 90ac532307..0000000000 --- a/api/Api/VirtualFileSystem/DirectoryException.cs +++ /dev/null @@ -1,17 +0,0 @@ -using SynthesisAPI.Utilities; -using System; - -namespace SynthesisAPI.VirtualFileSystem -{ - public class DirectoryException : SynthesisException - { - public DirectoryException() { } - public DirectoryException(string message) : base(message) { } - public DirectoryException(string message, Exception inner) : base(message, inner) { } - } - - public class DirectroyDepthExpection : DirectoryException - { - public DirectroyDepthExpection(int depth) : base($"FileSystem: traversing path would exceed maximum directory depth of {FileSystem.MaxDirectoryDepth} (Path depth is {depth})") { } - } -} diff --git a/api/Api/VirtualFileSystem/ExposedApiAttribute.cs b/api/Api/VirtualFileSystem/ExposedApiAttribute.cs deleted file mode 100644 index dee185cd42..0000000000 --- a/api/Api/VirtualFileSystem/ExposedApiAttribute.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; - -namespace SynthesisAPI.Utilities -{ - /// - /// Marks a function as exposed in the API. - /// - /// Be sure to mark the API call source as external before calling any internal functions - /// - /// For example: - /// internal void FunctionInner() { } - /// - /// [ExposedApi] - /// public void Function() { - /// using var _ = ApiCallSource.ExternalCall(); - /// FunctionInner(); - /// } - /// - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property)] - internal class ExposedApiAttribute : Attribute { } -} diff --git a/api/Api/VirtualFileSystem/FileSystem.cs b/api/Api/VirtualFileSystem/FileSystem.cs deleted file mode 100644 index 08709cd4f8..0000000000 --- a/api/Api/VirtualFileSystem/FileSystem.cs +++ /dev/null @@ -1,386 +0,0 @@ -using SynthesisAPI.Utilities; -using System; -using System.IO; - -#nullable enable - -namespace SynthesisAPI.VirtualFileSystem -{ - /// - /// A virtual file system that manages entries and assets as a tree - /// - public static class FileSystem - { - /// - /// Maximum number of nested directories allowed - /// - public const int MaxDirectoryDepth = 30; - - /// - /// Base path for files on disk - /// - public static readonly string BasePath = string.Format("{0}{1}Autodesk{1}Synthesis{1}", - Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), - Path.DirectorySeparatorChar); - - public static readonly string TestPathLocal = $"test{Path.DirectorySeparatorChar}"; - - public static readonly string TestPath = BasePath + TestPathLocal; - - /// - /// Add a new entry to a the file system at a given destination - /// - /// - /// - /// - /// - [ExposedApi] - public static TEntry? AddEntry(string path, TEntry entry, Permissions perm = Permissions.PublicReadWrite) where TEntry : class, IEntry - { - using var _ = ApiCallSource.StartExternalCall(); - return AddEntryInner(path, entry, perm); - } - - private static TEntry? AddEntryInner(string path, TEntry entry, Permissions perm = Permissions.PublicReadWrite) where TEntry : class, IEntry - { - CheckPath(Directory.MakePath(path, entry.Name)); - Directory? parentDir = CreatePathInner(path, perm); - - return parentDir?.AddEntryInner(entry); - } - - /// - /// Add a new entry to the file system at a given desitnation - /// - /// - /// - /// - [ExposedApi] - public static IEntry? AddEntry(string path, IEntry entry, Permissions perm = Permissions.PublicReadWrite) - { - using var _ = ApiCallSource.StartExternalCall(); - - return AddEntryInner(path, entry, perm); - } - - internal static IEntry? AddEntryInner(string path, IEntry entry, Permissions perm = Permissions.PublicReadWrite) - { - CheckPath(Directory.MakePath(path, entry.Name)); - - Directory? parentDir = CreatePathInner(path, perm); - - return parentDir?.AddEntry(entry); - } - - [ExposedApi] - public static void DeleteEntry(string path) - { - using var _ = ApiCallSource.StartExternalCall(); - - DeleteEntryInner(path); - } - - internal static void DeleteEntryInner(string path) - { - TraverseInner(path)?.DeleteInner(); - } - - [ExposedApi] - public static void DeleteEntry(string path, string name) - { - using var _ = ApiCallSource.StartExternalCall(); - - DeleteEntryInner(path, name); - } - - internal static void DeleteEntryInner(string path, string name) - { - Directory? parentDir = (Directory?)TraverseInner(path); - - parentDir?.DeleteEntryInner(name); - } - - [ExposedApi] - public static bool EntryExists(string path) - { - using var _ = ApiCallSource.StartExternalCall(); - - return EntryExistsInner(path); - } - - internal static bool EntryExistsInner(string path) - { - return TraverseInner(path) != null; - } - - [ExposedApi] - public static bool EntryExists(string path, string name) - { - using var _ = ApiCallSource.StartExternalCall(); - - return EntryExistsInner(path, name); - } - - internal static bool EntryExistsInner(string path, string name) - { - Directory? parentDir = (Directory?)TraverseInner(path); - - return parentDir != null && parentDir.EntryExistsInner(name); - } - - /// - /// Determine the depth of a given path (i.e. the number of nested directories) - /// - /// - /// - public static int DepthOfPath(string path) - { - return Directory.SplitPath(path).Length; - } - - private static string[] CheckPath(string path) - { - return CheckPath(Directory.SplitPath(path)); - } - - private static string[] CheckPath(string[] path) - { - var (top, actualPath) = Directory.GetTopDirectory(path); - if (top != Instance.RootNode.Name) - { - throw new DirectoryException($"Path outside of virtual file system \"{string.Join(Directory.DirectorySeparatorChar.ToString(), path)}\""); - } - if (path.Length > MaxDirectoryDepth) - { - throw new DirectroyDepthExpection(path.Length); - } - return actualPath; - } - - /// - /// Traverse the file system - /// - /// - /// - [ExposedApi] - public static TEntry? Traverse(string path) where TEntry : class, IEntry - { - using var _ = ApiCallSource.StartExternalCall(); - - return TraverseInner(path); - } - - internal static TEntry? TraverseInner(string path) where TEntry : class, IEntry - { - var actualPath = CheckPath(path); - return Instance.RootNode.TraverseInner(actualPath); - } - - [ExposedApi] - public static Directory? CreatePath(string path, Permissions perm) - { - using var _ = ApiCallSource.StartExternalCall(); - return CreatePathInner(path, perm); - } - - internal static Directory? CreatePathInner(string path, Permissions perm) - { - var subpaths = CheckPath(path); - string top; - - Directory? dir = Instance.RootNode; - - while(subpaths.Length > 0) { - (top, subpaths) = Directory.GetTopDirectory(subpaths); - - if (!dir.EntryExistsInner(top)) - { - dir = dir.AddEntryInner(new Directory(top, perm)); - } - else - { - dir = dir.TraverseInner(top); - } - if(dir == null) - { - throw new DirectoryException("Failed to create directory"); - } - } - return dir; - } - - /// - /// Traverse the file system - /// - /// - /// - [ExposedApi] - public static IEntry? Traverse(string[] path) - { - using var _ = ApiCallSource.StartExternalCall(); - - return TraverseInner(path); - } - - internal static IEntry? TraverseInner(string[] path) - { - var actualPath = CheckPath(path); - return Instance.RootNode.TraverseInner(actualPath); - } - - /// - /// Traverse the file system - /// - /// - /// - [ExposedApi] - public static IEntry? Traverse(string path) - { - using var _ = ApiCallSource.StartExternalCall(); - - return TraverseInner(path); - } - - internal static IEntry? TraverseInner(string path) - { - var actualPath = CheckPath(path); - return Instance.RootNode.TraverseInner(actualPath); - } - - /// - /// Recursively search the virtual file system for an entry with a given name - /// - /// - /// - /// - [ExposedApi] - public static TEntry? Search(string name) where TEntry : class, IEntry - { - using var _ = ApiCallSource.StartExternalCall(); - - return SearchInner(Instance.RootNode, name); - } - - internal static TEntry? SearchInner(string name) where TEntry : class, IEntry - { - return SearchInner(Instance.RootNode, name); - } - - /// - /// Recursively search a directory for an entry with a given name - /// - /// - /// - /// - /// - [ExposedApi] - public static TEntry? Search(Directory parent, string name) where TEntry : class, IEntry - { - using var _ = ApiCallSource.StartExternalCall(); - - return SearchInner(parent, name); - } - - internal static TEntry? SearchInner(Directory parent, string name) where TEntry : class, IEntry - { - var entry = parent[name]; - if (entry != null && entry is TEntry) - { - return (TEntry?)entry; - } - foreach (var e in parent.Entries) - { - if (e.Key == "." || e.Key == "..") - continue; - - if (e.Value is Directory directory) - { - var result = SearchInner(directory, name); - if (result != null) - { - return result; - } - } - } - return null; - } - - /// - /// Recursively search the virtual file system for an entry with a given name - /// - /// - /// - [ExposedApi] - public static IEntry? Search(string name) - { - using var _ = ApiCallSource.StartExternalCall(); - - return SearchInner(Instance.RootNode, name); - } - - internal static IEntry? SearchInner(string name) - { - return SearchInner(Instance.RootNode, name); - } - - /// - /// Recursively search a directory for an entry with a given name - /// - /// - /// - /// - [ExposedApi] - public static IEntry? Search(Directory parent, string name) - { - using var _ = ApiCallSource.StartExternalCall(); - - return SearchInner(parent, name); - } - - internal static IEntry? SearchInner(Directory parent, string name) - { - var asset = parent[name]; - if (asset != null) - { - return asset; - } - foreach (var e in parent.Entries) - { - if (e.Key == "." || e.Key == "..") - continue; - - if (e.Value is Directory directory) - { - var result = SearchInner(directory, name); - if (result != null) - { - return result; - } - } - } - return null; - } - - private class Inner - { - private Inner() - { - using var _ = ApiCallSource.ForceInternalCall(); - RootNode = new Directory("", Permissions.PublicReadOnly); // root node name is "" so paths begin with "/" (since path strings are split at '/') - RootNode.AddEntryInner(new Directory("environment", Permissions.PublicReadWrite)); - RootNode.AddEntryInner(new Directory("modules", Permissions.PublicReadWrite)); - RootNode.AddEntryInner(new Directory("runtime", Permissions.PublicReadWrite)); - RootNode.AddEntryInner(new Directory("temp", Permissions.PublicReadWrite)); - } - - /// - /// The root of the file system - /// - public Directory RootNode { get; private set; } - - public static readonly Inner Instance = new Inner(); - } - - private static Inner Instance => Inner.Instance; - } -} diff --git a/api/Api/VirtualFileSystem/IEntry.cs b/api/Api/VirtualFileSystem/IEntry.cs deleted file mode 100644 index ca19405fca..0000000000 --- a/api/Api/VirtualFileSystem/IEntry.cs +++ /dev/null @@ -1,34 +0,0 @@ -using SynthesisAPI.Utilities; - -#nullable enable - -namespace SynthesisAPI.VirtualFileSystem -{ - /// - /// Any type of entry managed by the virtual file system - /// - public interface IEntry - { - /// - /// Name of the entry (used as its identifier in the virtual file system) - /// - public string Name { get; internal set; } - - /// - /// Access permissions of this entry - /// - public Permissions Permissions { get; internal set; } - - /// - /// Parent directory of this entry in the virtual file system - /// - /// (null if unset) - /// - public Directory? Parent { get; internal set; } - - [ExposedApi] - public void Delete(); - - internal void DeleteInner(); - } -} diff --git a/api/Api/VirtualFileSystem/Permissions.cs b/api/Api/VirtualFileSystem/Permissions.cs deleted file mode 100644 index 8e3fe6a5e5..0000000000 --- a/api/Api/VirtualFileSystem/Permissions.cs +++ /dev/null @@ -1,96 +0,0 @@ -using SynthesisAPI.Utilities; -using System; - -namespace SynthesisAPI.VirtualFileSystem -{ - /// - /// Access permissions for entries in the virtual file system - /// - [Flags] - public enum Permissions - { - PrivateReadOnly, // Accessible only by the Synthesis Core - PrivateReadWrite, // Writable only by the Synthesis Core - PublicReadOnly, // Readable by modules - PublicReadWrite // Readable and writeable by modules - } - - public enum Access - { - Read, - Write - } - - public class PermissionsExpcetion : SynthesisException - { - public PermissionsExpcetion() { } - - public PermissionsExpcetion(string message) : base(message) { } - - public PermissionsExpcetion(string message, Exception inner) : base(message, inner) { } - } - - internal static class ApiCallSource - { - internal class ExternalCallLifetimeClass : IDisposable - { - public void Dispose() - { - ApiCallSource._externalCalls -= 1; - } - } - - internal class InternalCallLifetimeClass : IDisposable - { - public void Dispose() - { - ApiCallSource._forceInternal -= 1; - } - } - - internal static ExternalCallLifetimeClass StartExternalCall() - { - _externalCalls += 1; - return new ExternalCallLifetimeClass(); - } - - internal static InternalCallLifetimeClass ForceInternalCall() - { - _forceInternal += 1; - return new InternalCallLifetimeClass(); - } - - private static uint _forceInternal; - - private static uint _externalCalls; - - internal static bool IsInternal => _externalCalls == 0 || _forceInternal > 0; - - public static void AssertAccess(Permissions perm, Access access) - { - if (CannotAccess(perm, access)) - { - throw new PermissionsExpcetion("Missing required permissions: Permissions: " + perm.ToString() + - ", Operation: " + (IsInternal ? "Private" : "Public") + " " + - access.ToString()); - } - } - - public static bool CannotAccess(Permissions perm, Access access) - { - return !CanAccess(perm, access); - } - - public static bool CanAccess(Permissions perm, Access access) - { - return perm switch - { - Permissions.PrivateReadOnly => IsInternal && access == Access.Read, - Permissions.PrivateReadWrite => IsInternal, - Permissions.PublicReadOnly => access == Access.Read || IsInternal, - Permissions.PublicReadWrite => true, - _ => false, // Error - }; - } - } -} diff --git a/api/Api/WebSockets/WebSocketServer.cs b/api/Api/WebSockets/WebSocketServer.cs deleted file mode 100644 index 994548d3d0..0000000000 --- a/api/Api/WebSockets/WebSocketServer.cs +++ /dev/null @@ -1,279 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net; -using System.Net.Sockets; -using System.Text; -using System.Threading; - -#nullable enable - -namespace SynthesisAPI.WS { - - public class WebSocketServer : IDisposable { - - private readonly Inner _instance; // On dispose we close this instance, one construct we create the instance, this isn't nullable - - public IReadOnlyList Clients => _instance._clientDict.Keys.ToList().AsReadOnly(); - - public WebSocketServer(string hostname, int port) { - _instance = new Inner(hostname, port); - } - - // It is beyond me why someone would do this. these should be supplied either as a passthrough or to the constructor - public void AddOnMessageListener(Action onMessage) - => _instance.OnMessage += onMessage; - - public void AddOnConnectListener(Action onConnect) - => _instance.OnConnect += onConnect; - - public void AddOnDisconnectListener(Action onDisconnect) - => _instance.OnDisconnect += onDisconnect; - - public void SendToClient(Guid client, string message) - => _instance.SendToClient(client, message); - - private class Inner { - - private readonly TcpListener _listener; - private readonly Mutex _clientDictMut = new Mutex(); - - public Dictionary _clientDict = new Dictionary(); - - public event Action? OnMessage; - public event Action? OnConnect; - public event Action? OnDisconnect; - - public Inner(string hostname, int port) { - _listener = new TcpListener(IPAddress.Parse(hostname), port); - _listener.Start(2); - _listener.BeginAcceptTcpClient(AcceptTcpClient, null); - } - - ~Inner() { - Close(); - } - - public void Close() { - _listener.Stop(); - _clientDict.ForEach(x => x.Value.Kill()); - _clientDict.Clear(); - } - - private void AcceptTcpClient(IAsyncResult ar) { - var clientTcp = _listener.EndAcceptTcpClient(ar); - - _listener.BeginAcceptTcpClient(AcceptTcpClient, null); - - if (!clientTcp.Connected) { - return; - } - - _clientDictMut.WaitOne(); - var client = new WSClientHandler(Guid.NewGuid(), clientTcp); - _clientDict.Add(client.GUID, client); - _clientDictMut.ReleaseMutex(); - - if (OnConnect != null) - OnConnect(client.GUID); - - while (clientTcp.Available < 3) ; - byte[] bytes = new byte[clientTcp.Available]; - clientTcp.GetStream().Read(bytes, 0, clientTcp.Available); - string request = Encoding.UTF8.GetString(bytes); - - // Console.WriteLine(request); - - string eol = "\r\n"; // Apparently this is a thing - string response = "HTTP/1.1 101 Switching Protocols\n"; - - response += "Connection: Upgrade\n" - + "Upgrade: websocket\n"; - - string key = request.Substring(request.IndexOf("Sec-WebSocket-Key: ") + 19); - key = key.Substring(0, key.IndexOf("==") + 2); - string what = key + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; - // Console.WriteLine(what); - var wsAccept = Convert.ToBase64String( - System.Security.Cryptography.SHA1.Create().ComputeHash( - Encoding.UTF8.GetBytes(what) - ) - ); - - response += "Sec-WebSocket-Accept: " + wsAccept + eol; - response += eol; - - - client.Write(response); - - try { - while (client.Connected) { - - var frame = client.ReadWS(); - - OnMessage?.Invoke(client.GUID, frame.ParseAsPlainText()); - } - } catch (IOException) { } finally { - _clientDictMut.WaitOne(); - if (_clientDict.ContainsKey(client.GUID)) - _clientDict[client.GUID].Kill(); - _clientDict.Remove(client.GUID); - _clientDictMut.ReleaseMutex(); - OnDisconnect?.Invoke(client.GUID); - } - } - - public void SendToClient(Guid client, string message) { - if (!_clientDict.ContainsKey(client)) - throw new Exception($"No client with guid '{client}'"); - _clientDict[client].WriteWS(message); - } - } - - public void Dispose() { - _instance.Close(); - } - } - - public struct WSFrame { - - public bool finished; - public int opcode; - public byte[] payload; - - public static WSFrame ParseNextFrame(NetworkStream stream) { - byte[] buff = new byte[2]; - stream.Read(buff, 0, 2); - - WSFrame frame; - - var bitfield = buff[0]; - // Console.WriteLine(bitfield); - bool fin = (bitfield & 0x80) != 0; - int opcode = (bitfield & 0x0F); - bool mask = (buff[1] & 0x80) != 0; - ulong payloadLength = (ulong)(buff[1] & 0x7F); - - frame.opcode = opcode; - frame.finished = fin; - - if (payloadLength == 126) { - buff = new byte[2]; - stream.Read(buff, 0, 2); - if (BitConverter.IsLittleEndian) - Array.Reverse(buff); - payloadLength = BitConverter.ToUInt16(buff, 0); - } else if (payloadLength == 127) { - buff = new byte[8]; - stream.Read(buff, 0, 8); - if (BitConverter.IsLittleEndian) - Array.Reverse(buff); - payloadLength = BitConverter.ToUInt64(buff, 0); // I can't actually do a payload of more than 32 signed int long - } - - if (mask) { - byte[] maskBytes = new byte[4]; - stream.Read(maskBytes, 0, 4); - frame.payload = new byte[payloadLength]; - for (uint i = 0; i < payloadLength; i++) { - frame.payload[i] = (byte)(stream.ReadByte() ^ maskBytes[i % 4]); - } - } else { - frame.payload = new byte[payloadLength]; - if (payloadLength < UInt16.MaxValue) { - stream.Read(frame.payload, 0, (int)payloadLength); - } else { - for (uint i = 0; i < payloadLength; i++) { - frame.payload[i] = (byte)stream.ReadByte(); - } - } - } - - return frame; - } - - public static byte[] Make(string message) { - byte[] payload = Encoding.UTF8.GetBytes(message); - - List buff = new List(); - - buff.Add(0x81); - - if (payload.Length > UInt16.MaxValue) { // 65536+ - buff.Add(0x7f); - byte[] sizeBytes = BitConverter.GetBytes(payload.Length); - if (BitConverter.IsLittleEndian) { - Array.Reverse(sizeBytes); - } - buff.AddRange(new byte[4]); - buff.AddRange(sizeBytes); - } else if (payload.Length > 126 && payload.Length <= UInt16.MaxValue) { // 126 - 65535 - buff.Add(0x7e); - byte[] sizeBytes = BitConverter.GetBytes(payload.Length); - if (BitConverter.IsLittleEndian) { - Array.Reverse(sizeBytes); - } - buff.AddRange(sizeBytes.Skip(2)); - } else { // 0 - 125 - buff.Add((byte)payload.Length); - } - - buff.AddRange(payload); - - return buff.ToArray(); - } - - public string ParseAsPlainText() { - return Encoding.UTF8.GetString(payload); - //if (payload.Length < 126) { - // return ""; // - //} else { - // return $"Too Volatile\nSize {payload.Length}"; - //} - } - } - - public class WSClientHandler { - - public Guid GUID { get; private set; } - private TcpClient _client; - private NetworkStream _stream; - - public int Available => _client.Available; - public bool Connected => _client.Connected; - - public WSClientHandler(Guid guid, TcpClient client) { - GUID = guid; - _client = client; - _stream = client.GetStream(); - } - - public void Write(string message) { - Write(Encoding.UTF8.GetBytes(message)); - } - - public void Write(byte[] buff) { - _stream.Write(buff, 0, buff.Length); - _stream.Flush(); - } - - public void WriteWS(string message) { - byte[] buff = WSFrame.Make(message); - Write(buff); - } - - public void Read(byte[] buff, int offset, int length) { - _stream.Read(buff, offset, length); - } - - public WSFrame ReadWS() - => WSFrame.ParseNextFrame(_stream); - - public void Kill() { - _stream.Close(); - _client.Close(); - } - } - -} diff --git a/api/BenchmarkApi/BenchmarkApi.csproj b/api/BenchmarkApi/BenchmarkApi.csproj deleted file mode 100644 index c7a67181a8..0000000000 --- a/api/BenchmarkApi/BenchmarkApi.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - Exe - net7.0 - - - - - - - - - - - - diff --git a/api/BenchmarkApi/BenchmarkAssetManager.cs b/api/BenchmarkApi/BenchmarkAssetManager.cs deleted file mode 100644 index 35cb137b75..0000000000 --- a/api/BenchmarkApi/BenchmarkAssetManager.cs +++ /dev/null @@ -1,83 +0,0 @@ -using BenchmarkDotNet.Attributes; -using SynthesisAPI.AssetManager; -using SynthesisAPI.Utilities; -using SynthesisAPI.VirtualFileSystem; -using System; -using System.IO; -using System.Linq; - -namespace BenchmarkApi -{ - [MemoryDiagnoser] - [Orderer(BenchmarkDotNet.Order.SummaryOrderPolicy.FastestToSlowest)] - [RankColumn] - public class BenchmarkAssetManager - { - private static readonly string LargeTextFileName = "test_large.txt"; - - [GlobalSetup] - public void Setup() - { - - if (!System.IO.Directory.Exists(FileSystem.TestPath)) - { - System.IO.Directory.CreateDirectory(FileSystem.TestPath); - } - - string text_string = String.Concat(Enumerable.Repeat("123456789 ", 50000)); - - if (!File.Exists(FileSystem.TestPath + LargeTextFileName)) - { - File.WriteAllText(FileSystem.TestPath + LargeTextFileName, text_string); - } - } - - [Benchmark] - public void DirectLoadLargeTextAsset() - { - byte[] data = File.ReadAllBytes(FileSystem.TestPath + LargeTextFileName); - } - - [Benchmark] - public void OpenLargeTextAssetStream() - { - FileStream stream = File.Open(FileSystem.TestPath + LargeTextFileName, FileMode.Open); - stream.Close(); - } - - private static System.Threading.ReaderWriterLockSlim RWLock = new System.Threading.ReaderWriterLockSlim(); - - [Benchmark] - public void LargeTextAssetSharedStream() - { - FileStream stream = File.Open(FileSystem.TestPath + LargeTextFileName, FileMode.Open); - SharedBinaryStream sharedStream = new SharedBinaryStream(stream, RWLock); - byte[] data = sharedStream.ReadToEnd(); - stream.Close(); - } - - [Benchmark] - public void ImportLargeTextAsset() - { - string fileName = FileSystem.TestPathLocal + LargeTextFileName; - string type = AssetManager.GetTypeFromFileExtension(fileName); - AssetManager.Import(type, false, "/temp/", LargeTextFileName, Permissions.PublicReadWrite, fileName).Delete(); - } - - [Benchmark] - public void ImportLazyLargeTextAsset() - { - string fileName = FileSystem.TestPathLocal + LargeTextFileName; - string type = AssetManager.GetTypeFromFileExtension(fileName); - AssetManager.ImportLazy(type, false, "/temp/", LargeTextFileName, Permissions.PublicReadWrite, fileName).Delete(); - } - - [Benchmark] - public void ImportLazyLargeTextAssetAndLoad() - { - string fileName = FileSystem.TestPathLocal + LargeTextFileName; - string type = AssetManager.GetTypeFromFileExtension(fileName); - AssetManager.ImportLazy(type, false, "/temp/", LargeTextFileName, Permissions.PublicReadWrite, fileName).Load().Delete(); - } - } -} diff --git a/api/BenchmarkApi/BenchmarkVirtualFileSystem.cs b/api/BenchmarkApi/BenchmarkVirtualFileSystem.cs deleted file mode 100644 index f41d45ab65..0000000000 --- a/api/BenchmarkApi/BenchmarkVirtualFileSystem.cs +++ /dev/null @@ -1,45 +0,0 @@ -using BenchmarkDotNet.Attributes; -using SynthesisAPI.VirtualFileSystem; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace BenchmarkApi -{ - [MemoryDiagnoser] - [Orderer(BenchmarkDotNet.Order.SummaryOrderPolicy.FastestToSlowest)] - [RankColumn] - public class BenchmarkVirtualFileSystem - { - // public property - public IEnumerable ValuesForTestPath() - { - string path = "/temp"; - int inc = 5; - for (var i = FileSystem.DepthOfPath(path); i < FileSystem.MaxDirectoryDepth; i += inc) - { - path += String.Concat(Enumerable.Repeat("/newDir", inc)); - yield return path; - } - } - - [ParamsSource(nameof(ValuesForTestPath))] - public string TestPath { get; set; } - - [GlobalSetup] - public void Setup() { - string path = "/temp"; - for (var i = FileSystem.DepthOfPath(path); i < FileSystem.MaxDirectoryDepth; i++) - { - path += "/newDir"; - } - FileSystem.CreatePath(path, Permissions.PublicReadWrite); - } - - [Benchmark] - public void MaximumDepthTraversal() - { - var entry = FileSystem.Traverse(TestPath); - } - } -} diff --git a/api/BenchmarkApi/Program.cs b/api/BenchmarkApi/Program.cs deleted file mode 100644 index 94ce1cc229..0000000000 --- a/api/BenchmarkApi/Program.cs +++ /dev/null @@ -1,23 +0,0 @@ -using BenchmarkDotNet.Running; -using SynthesisAPI.WS; -using System; -using System.Threading; - -namespace BenchmarkApi -{ - public class Program - { - static void Main(string[] args) - { - // BenchmarkRunner.Run(); - // BenchmarkRunner.Run(); - - var server = new WebSocketServer("127.0.0.1", 3300); - // server.OnMessage += (guid, m) => Console.WriteLine(m + "\n"); - server.AddOnConnectListener((guid) => Console.WriteLine($"{guid} - Connected")); - server.AddOnDisconnectListener((guid) => Console.WriteLine($"{guid} - Disconnected")); - - while (true) { } - } - } -} diff --git a/api/Mirabuf/Assembly.cs b/api/Mirabuf/Assembly.cs deleted file mode 100644 index a0381ad5fe..0000000000 --- a/api/Mirabuf/Assembly.cs +++ /dev/null @@ -1,3469 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: assembly.proto -// -#pragma warning disable 1591, 0612, 3021, 8981 -#region Designer generated code - -using pb = global::Google.Protobuf; -using pbc = global::Google.Protobuf.Collections; -using pbr = global::Google.Protobuf.Reflection; -using scg = global::System.Collections.Generic; -namespace Mirabuf { - - /// Holder for reflection information generated from assembly.proto - public static partial class AssemblyReflection { - - #region Descriptor - /// File descriptor for assembly.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static AssemblyReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "Cg5hc3NlbWJseS5wcm90bxIHbWlyYWJ1ZhoLdHlwZXMucHJvdG8aC2pvaW50", - "LnByb3RvGg5tYXRlcmlhbC5wcm90bxoMc2lnbmFsLnByb3RvIsQCCghBc3Nl", - "bWJseRIbCgRpbmZvGAEgASgLMg0ubWlyYWJ1Zi5JbmZvEiMKBGRhdGEYAiAB", - "KAsyFS5taXJhYnVmLkFzc2VtYmx5RGF0YRIPCgdkeW5hbWljGAMgASgIEjIK", - "DXBoeXNpY2FsX2RhdGEYBCABKAsyGy5taXJhYnVmLlBoeXNpY2FsUHJvcGVy", - "dGllcxIxChBkZXNpZ25faGllcmFyY2h5GAUgASgLMhcubWlyYWJ1Zi5HcmFw", - "aENvbnRhaW5lchIwCg9qb2ludF9oaWVyYXJjaHkYBiABKAsyFy5taXJhYnVm", - "LkdyYXBoQ29udGFpbmVyEiUKCXRyYW5zZm9ybRgHIAEoCzISLm1pcmFidWYu", - "VHJhbnNmb3JtEiUKCXRodW1ibmFpbBgIIAEoCzISLm1pcmFidWYuVGh1bWJu", - "YWlsIq4BCgxBc3NlbWJseURhdGESHQoFcGFydHMYASABKAsyDi5taXJhYnVm", - "LlBhcnRzEiUKBmpvaW50cxgCIAEoCzIVLm1pcmFidWYuam9pbnQuSm9pbnRz", - "Ei4KCW1hdGVyaWFscxgDIAEoCzIbLm1pcmFidWYubWF0ZXJpYWwuTWF0ZXJp", - "YWxzEigKB3NpZ25hbHMYBCABKAsyFy5taXJhYnVmLnNpZ25hbC5TaWduYWxz", - "IuICCgVQYXJ0cxIbCgRpbmZvGAEgASgLMg0ubWlyYWJ1Zi5JbmZvEj0KEHBh", - "cnRfZGVmaW5pdGlvbnMYAiADKAsyIy5taXJhYnVmLlBhcnRzLlBhcnREZWZp", - "bml0aW9uc0VudHJ5EjkKDnBhcnRfaW5zdGFuY2VzGAMgAygLMiEubWlyYWJ1", - "Zi5QYXJ0cy5QYXJ0SW5zdGFuY2VzRW50cnkSJAoJdXNlcl9kYXRhGAQgASgL", - "MhEubWlyYWJ1Zi5Vc2VyRGF0YRpPChRQYXJ0RGVmaW5pdGlvbnNFbnRyeRIL", - "CgNrZXkYASABKAkSJgoFdmFsdWUYAiABKAsyFy5taXJhYnVmLlBhcnREZWZp", - "bml0aW9uOgI4ARpLChJQYXJ0SW5zdGFuY2VzRW50cnkSCwoDa2V5GAEgASgJ", - "EiQKBXZhbHVlGAIgASgLMhUubWlyYWJ1Zi5QYXJ0SW5zdGFuY2U6AjgBIu8B", - "Cg5QYXJ0RGVmaW5pdGlvbhIbCgRpbmZvGAEgASgLMg0ubWlyYWJ1Zi5JbmZv", - "EjIKDXBoeXNpY2FsX2RhdGEYAiABKAsyGy5taXJhYnVmLlBoeXNpY2FsUHJv", - "cGVydGllcxIqCg5iYXNlX3RyYW5zZm9ybRgDIAEoCzISLm1pcmFidWYuVHJh", - "bnNmb3JtEh0KBmJvZGllcxgEIAMoCzINLm1pcmFidWYuQm9keRIPCgdkeW5h", - "bWljGAUgASgIEhkKEWZyaWN0aW9uX292ZXJyaWRlGAYgASgCEhUKDW1hc3Nf", - "b3ZlcnJpZGUYByABKAIi+QEKDFBhcnRJbnN0YW5jZRIbCgRpbmZvGAEgASgL", - "Mg0ubWlyYWJ1Zi5JbmZvEiEKGXBhcnRfZGVmaW5pdGlvbl9yZWZlcmVuY2UY", - "AiABKAkSJQoJdHJhbnNmb3JtGAMgASgLMhIubWlyYWJ1Zi5UcmFuc2Zvcm0S", - "LAoQZ2xvYmFsX3RyYW5zZm9ybRgEIAEoCzISLm1pcmFidWYuVHJhbnNmb3Jt", - "Eg4KBmpvaW50cxgFIAMoCRISCgphcHBlYXJhbmNlGAYgASgJEhkKEXBoeXNp", - "Y2FsX21hdGVyaWFsGAcgASgJEhUKDXNraXBfY29sbGlkZXIYCCABKAgifAoE", - "Qm9keRIbCgRpbmZvGAEgASgLMg0ubWlyYWJ1Zi5JbmZvEgwKBHBhcnQYAiAB", - "KAkSLAoNdHJpYW5nbGVfbWVzaBgDIAEoCzIVLm1pcmFidWYuVHJpYW5nbGVN", - "ZXNoEhsKE2FwcGVhcmFuY2Vfb3ZlcnJpZGUYBCABKAkirQEKDFRyaWFuZ2xl", - "TWVzaBIbCgRpbmZvGAEgASgLMg0ubWlyYWJ1Zi5JbmZvEhIKCmhhc192b2x1", - "bWUYAiABKAgSGgoSbWF0ZXJpYWxfcmVmZXJlbmNlGAMgASgJEh0KBG1lc2gY", - "BCABKAsyDS5taXJhYnVmLk1lc2hIABIkCgVibWVzaBgFIAEoCzITLm1pcmFi", - "dWYuQmluYXJ5TWVzaEgAQgsKCW1lc2hfdHlwZSJDCgRNZXNoEg0KBXZlcnRz", - "GAEgAygCEg8KB25vcm1hbHMYAiADKAISCgoCdXYYAyADKAISDwoHaW5kaWNl", - "cxgEIAMoBSIaCgpCaW5hcnlNZXNoEgwKBGRhdGEYASABKAxCAkgBYgZwcm90", - "bzM=")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { global::Mirabuf.TypesReflection.Descriptor, global::Mirabuf.Joint.JointReflection.Descriptor, global::Mirabuf.Material.MaterialReflection.Descriptor, global::Mirabuf.Signal.SignalReflection.Descriptor, }, - new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.Assembly), global::Mirabuf.Assembly.Parser, new[]{ "Info", "Data", "Dynamic", "PhysicalData", "DesignHierarchy", "JointHierarchy", "Transform", "Thumbnail" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.AssemblyData), global::Mirabuf.AssemblyData.Parser, new[]{ "Parts", "Joints", "Materials", "Signals" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.Parts), global::Mirabuf.Parts.Parser, new[]{ "Info", "PartDefinitions", "PartInstances", "UserData" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, null, }), - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.PartDefinition), global::Mirabuf.PartDefinition.Parser, new[]{ "Info", "PhysicalData", "BaseTransform", "Bodies", "Dynamic", "FrictionOverride", "MassOverride" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.PartInstance), global::Mirabuf.PartInstance.Parser, new[]{ "Info", "PartDefinitionReference", "Transform", "GlobalTransform", "Joints", "Appearance", "PhysicalMaterial", "SkipCollider" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.Body), global::Mirabuf.Body.Parser, new[]{ "Info", "Part", "TriangleMesh", "AppearanceOverride" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.TriangleMesh), global::Mirabuf.TriangleMesh.Parser, new[]{ "Info", "HasVolume", "MaterialReference", "Mesh", "Bmesh" }, new[]{ "MeshType" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.Mesh), global::Mirabuf.Mesh.Parser, new[]{ "Verts", "Normals", "Uv", "Indices" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.BinaryMesh), global::Mirabuf.BinaryMesh.Parser, new[]{ "Data" }, null, null, null, null) - })); - } - #endregion - - } - #region Messages - /// - ///* - /// Assembly - /// Base Design to be interacted with - /// THIS IS THE CURRENT FILE EXPORTED - /// - public sealed partial class Assembly : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Assembly()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.AssemblyReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Assembly() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Assembly(Assembly other) : this() { - info_ = other.info_ != null ? other.info_.Clone() : null; - data_ = other.data_ != null ? other.data_.Clone() : null; - dynamic_ = other.dynamic_; - physicalData_ = other.physicalData_ != null ? other.physicalData_.Clone() : null; - designHierarchy_ = other.designHierarchy_ != null ? other.designHierarchy_.Clone() : null; - jointHierarchy_ = other.jointHierarchy_ != null ? other.jointHierarchy_.Clone() : null; - transform_ = other.transform_ != null ? other.transform_.Clone() : null; - thumbnail_ = other.thumbnail_ != null ? other.thumbnail_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Assembly Clone() { - return new Assembly(this); - } - - /// Field number for the "info" field. - public const int InfoFieldNumber = 1; - private global::Mirabuf.Info info_; - /// - //// Basic information (name, Author, etc) - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Info Info { - get { return info_; } - set { - info_ = value; - } - } - - /// Field number for the "data" field. - public const int DataFieldNumber = 2; - private global::Mirabuf.AssemblyData data_; - /// - //// All of the data in the assembly - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.AssemblyData Data { - get { return data_; } - set { - data_ = value; - } - } - - /// Field number for the "dynamic" field. - public const int DynamicFieldNumber = 3; - private bool dynamic_; - /// - //// Can it be effected by the simulation dynamically - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Dynamic { - get { return dynamic_; } - set { - dynamic_ = value; - } - } - - /// Field number for the "physical_data" field. - public const int PhysicalDataFieldNumber = 4; - private global::Mirabuf.PhysicalProperties physicalData_; - /// - //// Overall physical data of the assembly - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.PhysicalProperties PhysicalData { - get { return physicalData_; } - set { - physicalData_ = value; - } - } - - /// Field number for the "design_hierarchy" field. - public const int DesignHierarchyFieldNumber = 5; - private global::Mirabuf.GraphContainer designHierarchy_; - /// - //// The Design hierarchy represented by Part Refs - The first object is a root container for all top level items - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.GraphContainer DesignHierarchy { - get { return designHierarchy_; } - set { - designHierarchy_ = value; - } - } - - /// Field number for the "joint_hierarchy" field. - public const int JointHierarchyFieldNumber = 6; - private global::Mirabuf.GraphContainer jointHierarchy_; - /// - //// The Joint hierarchy for compound shapes - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.GraphContainer JointHierarchy { - get { return jointHierarchy_; } - set { - jointHierarchy_ = value; - } - } - - /// Field number for the "transform" field. - public const int TransformFieldNumber = 7; - private global::Mirabuf.Transform transform_; - /// - //// The Transform in space currently - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Transform Transform { - get { return transform_; } - set { - transform_ = value; - } - } - - /// Field number for the "thumbnail" field. - public const int ThumbnailFieldNumber = 8; - private global::Mirabuf.Thumbnail thumbnail_; - /// - //// Optional thumbnail saved from Fusion 360 or scraped from previous configuration - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Thumbnail Thumbnail { - get { return thumbnail_; } - set { - thumbnail_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Assembly); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Assembly other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(Info, other.Info)) return false; - if (!object.Equals(Data, other.Data)) return false; - if (Dynamic != other.Dynamic) return false; - if (!object.Equals(PhysicalData, other.PhysicalData)) return false; - if (!object.Equals(DesignHierarchy, other.DesignHierarchy)) return false; - if (!object.Equals(JointHierarchy, other.JointHierarchy)) return false; - if (!object.Equals(Transform, other.Transform)) return false; - if (!object.Equals(Thumbnail, other.Thumbnail)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (info_ != null) hash ^= Info.GetHashCode(); - if (data_ != null) hash ^= Data.GetHashCode(); - if (Dynamic != false) hash ^= Dynamic.GetHashCode(); - if (physicalData_ != null) hash ^= PhysicalData.GetHashCode(); - if (designHierarchy_ != null) hash ^= DesignHierarchy.GetHashCode(); - if (jointHierarchy_ != null) hash ^= JointHierarchy.GetHashCode(); - if (transform_ != null) hash ^= Transform.GetHashCode(); - if (thumbnail_ != null) hash ^= Thumbnail.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (info_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Info); - } - if (data_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Data); - } - if (Dynamic != false) { - output.WriteRawTag(24); - output.WriteBool(Dynamic); - } - if (physicalData_ != null) { - output.WriteRawTag(34); - output.WriteMessage(PhysicalData); - } - if (designHierarchy_ != null) { - output.WriteRawTag(42); - output.WriteMessage(DesignHierarchy); - } - if (jointHierarchy_ != null) { - output.WriteRawTag(50); - output.WriteMessage(JointHierarchy); - } - if (transform_ != null) { - output.WriteRawTag(58); - output.WriteMessage(Transform); - } - if (thumbnail_ != null) { - output.WriteRawTag(66); - output.WriteMessage(Thumbnail); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (info_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Info); - } - if (data_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Data); - } - if (Dynamic != false) { - output.WriteRawTag(24); - output.WriteBool(Dynamic); - } - if (physicalData_ != null) { - output.WriteRawTag(34); - output.WriteMessage(PhysicalData); - } - if (designHierarchy_ != null) { - output.WriteRawTag(42); - output.WriteMessage(DesignHierarchy); - } - if (jointHierarchy_ != null) { - output.WriteRawTag(50); - output.WriteMessage(JointHierarchy); - } - if (transform_ != null) { - output.WriteRawTag(58); - output.WriteMessage(Transform); - } - if (thumbnail_ != null) { - output.WriteRawTag(66); - output.WriteMessage(Thumbnail); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (info_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Info); - } - if (data_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Data); - } - if (Dynamic != false) { - size += 1 + 1; - } - if (physicalData_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(PhysicalData); - } - if (designHierarchy_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(DesignHierarchy); - } - if (jointHierarchy_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(JointHierarchy); - } - if (transform_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Transform); - } - if (thumbnail_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Thumbnail); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Assembly other) { - if (other == null) { - return; - } - if (other.info_ != null) { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - Info.MergeFrom(other.Info); - } - if (other.data_ != null) { - if (data_ == null) { - Data = new global::Mirabuf.AssemblyData(); - } - Data.MergeFrom(other.Data); - } - if (other.Dynamic != false) { - Dynamic = other.Dynamic; - } - if (other.physicalData_ != null) { - if (physicalData_ == null) { - PhysicalData = new global::Mirabuf.PhysicalProperties(); - } - PhysicalData.MergeFrom(other.PhysicalData); - } - if (other.designHierarchy_ != null) { - if (designHierarchy_ == null) { - DesignHierarchy = new global::Mirabuf.GraphContainer(); - } - DesignHierarchy.MergeFrom(other.DesignHierarchy); - } - if (other.jointHierarchy_ != null) { - if (jointHierarchy_ == null) { - JointHierarchy = new global::Mirabuf.GraphContainer(); - } - JointHierarchy.MergeFrom(other.JointHierarchy); - } - if (other.transform_ != null) { - if (transform_ == null) { - Transform = new global::Mirabuf.Transform(); - } - Transform.MergeFrom(other.Transform); - } - if (other.thumbnail_ != null) { - if (thumbnail_ == null) { - Thumbnail = new global::Mirabuf.Thumbnail(); - } - Thumbnail.MergeFrom(other.Thumbnail); - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - input.ReadMessage(Info); - break; - } - case 18: { - if (data_ == null) { - Data = new global::Mirabuf.AssemblyData(); - } - input.ReadMessage(Data); - break; - } - case 24: { - Dynamic = input.ReadBool(); - break; - } - case 34: { - if (physicalData_ == null) { - PhysicalData = new global::Mirabuf.PhysicalProperties(); - } - input.ReadMessage(PhysicalData); - break; - } - case 42: { - if (designHierarchy_ == null) { - DesignHierarchy = new global::Mirabuf.GraphContainer(); - } - input.ReadMessage(DesignHierarchy); - break; - } - case 50: { - if (jointHierarchy_ == null) { - JointHierarchy = new global::Mirabuf.GraphContainer(); - } - input.ReadMessage(JointHierarchy); - break; - } - case 58: { - if (transform_ == null) { - Transform = new global::Mirabuf.Transform(); - } - input.ReadMessage(Transform); - break; - } - case 66: { - if (thumbnail_ == null) { - Thumbnail = new global::Mirabuf.Thumbnail(); - } - input.ReadMessage(Thumbnail); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - input.ReadMessage(Info); - break; - } - case 18: { - if (data_ == null) { - Data = new global::Mirabuf.AssemblyData(); - } - input.ReadMessage(Data); - break; - } - case 24: { - Dynamic = input.ReadBool(); - break; - } - case 34: { - if (physicalData_ == null) { - PhysicalData = new global::Mirabuf.PhysicalProperties(); - } - input.ReadMessage(PhysicalData); - break; - } - case 42: { - if (designHierarchy_ == null) { - DesignHierarchy = new global::Mirabuf.GraphContainer(); - } - input.ReadMessage(DesignHierarchy); - break; - } - case 50: { - if (jointHierarchy_ == null) { - JointHierarchy = new global::Mirabuf.GraphContainer(); - } - input.ReadMessage(JointHierarchy); - break; - } - case 58: { - if (transform_ == null) { - Transform = new global::Mirabuf.Transform(); - } - input.ReadMessage(Transform); - break; - } - case 66: { - if (thumbnail_ == null) { - Thumbnail = new global::Mirabuf.Thumbnail(); - } - input.ReadMessage(Thumbnail); - break; - } - } - } - } - #endif - - } - - /// - ///* - /// Data used to construct the assembly - /// - public sealed partial class AssemblyData : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AssemblyData()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.AssemblyReflection.Descriptor.MessageTypes[1]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public AssemblyData() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public AssemblyData(AssemblyData other) : this() { - parts_ = other.parts_ != null ? other.parts_.Clone() : null; - joints_ = other.joints_ != null ? other.joints_.Clone() : null; - materials_ = other.materials_ != null ? other.materials_.Clone() : null; - signals_ = other.signals_ != null ? other.signals_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public AssemblyData Clone() { - return new AssemblyData(this); - } - - /// Field number for the "parts" field. - public const int PartsFieldNumber = 1; - private global::Mirabuf.Parts parts_; - /// - //// Meshes and Design Objects - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Parts Parts { - get { return parts_; } - set { - parts_ = value; - } - } - - /// Field number for the "joints" field. - public const int JointsFieldNumber = 2; - private global::Mirabuf.Joint.Joints joints_; - /// - //// Joint Definition Set - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Joint.Joints Joints { - get { return joints_; } - set { - joints_ = value; - } - } - - /// Field number for the "materials" field. - public const int MaterialsFieldNumber = 3; - private global::Mirabuf.Material.Materials materials_; - /// - //// Appearance and Physical Material Set - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Material.Materials Materials { - get { return materials_; } - set { - materials_ = value; - } - } - - /// Field number for the "signals" field. - public const int SignalsFieldNumber = 4; - private global::Mirabuf.Signal.Signals signals_; - /// - /// Contains table of all signals with ID reference - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Signal.Signals Signals { - get { return signals_; } - set { - signals_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as AssemblyData); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(AssemblyData other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(Parts, other.Parts)) return false; - if (!object.Equals(Joints, other.Joints)) return false; - if (!object.Equals(Materials, other.Materials)) return false; - if (!object.Equals(Signals, other.Signals)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (parts_ != null) hash ^= Parts.GetHashCode(); - if (joints_ != null) hash ^= Joints.GetHashCode(); - if (materials_ != null) hash ^= Materials.GetHashCode(); - if (signals_ != null) hash ^= Signals.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (parts_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Parts); - } - if (joints_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Joints); - } - if (materials_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Materials); - } - if (signals_ != null) { - output.WriteRawTag(34); - output.WriteMessage(Signals); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (parts_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Parts); - } - if (joints_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Joints); - } - if (materials_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Materials); - } - if (signals_ != null) { - output.WriteRawTag(34); - output.WriteMessage(Signals); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (parts_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Parts); - } - if (joints_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Joints); - } - if (materials_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Materials); - } - if (signals_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Signals); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(AssemblyData other) { - if (other == null) { - return; - } - if (other.parts_ != null) { - if (parts_ == null) { - Parts = new global::Mirabuf.Parts(); - } - Parts.MergeFrom(other.Parts); - } - if (other.joints_ != null) { - if (joints_ == null) { - Joints = new global::Mirabuf.Joint.Joints(); - } - Joints.MergeFrom(other.Joints); - } - if (other.materials_ != null) { - if (materials_ == null) { - Materials = new global::Mirabuf.Material.Materials(); - } - Materials.MergeFrom(other.Materials); - } - if (other.signals_ != null) { - if (signals_ == null) { - Signals = new global::Mirabuf.Signal.Signals(); - } - Signals.MergeFrom(other.Signals); - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - if (parts_ == null) { - Parts = new global::Mirabuf.Parts(); - } - input.ReadMessage(Parts); - break; - } - case 18: { - if (joints_ == null) { - Joints = new global::Mirabuf.Joint.Joints(); - } - input.ReadMessage(Joints); - break; - } - case 26: { - if (materials_ == null) { - Materials = new global::Mirabuf.Material.Materials(); - } - input.ReadMessage(Materials); - break; - } - case 34: { - if (signals_ == null) { - Signals = new global::Mirabuf.Signal.Signals(); - } - input.ReadMessage(Signals); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - if (parts_ == null) { - Parts = new global::Mirabuf.Parts(); - } - input.ReadMessage(Parts); - break; - } - case 18: { - if (joints_ == null) { - Joints = new global::Mirabuf.Joint.Joints(); - } - input.ReadMessage(Joints); - break; - } - case 26: { - if (materials_ == null) { - Materials = new global::Mirabuf.Material.Materials(); - } - input.ReadMessage(Materials); - break; - } - case 34: { - if (signals_ == null) { - Signals = new global::Mirabuf.Signal.Signals(); - } - input.ReadMessage(Signals); - break; - } - } - } - } - #endif - - } - - /// - /// Part file can be exported seperately in the future - /// - public sealed partial class Parts : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Parts()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.AssemblyReflection.Descriptor.MessageTypes[2]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Parts() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Parts(Parts other) : this() { - info_ = other.info_ != null ? other.info_.Clone() : null; - partDefinitions_ = other.partDefinitions_.Clone(); - partInstances_ = other.partInstances_.Clone(); - userData_ = other.userData_ != null ? other.userData_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Parts Clone() { - return new Parts(this); - } - - /// Field number for the "info" field. - public const int InfoFieldNumber = 1; - private global::Mirabuf.Info info_; - /// - //// Part name, version, GUID - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Info Info { - get { return info_; } - set { - info_ = value; - } - } - - /// Field number for the "part_definitions" field. - public const int PartDefinitionsFieldNumber = 2; - private static readonly pbc::MapField.Codec _map_partDefinitions_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::Mirabuf.PartDefinition.Parser), 18); - private readonly pbc::MapField partDefinitions_ = new pbc::MapField(); - /// - //// Map of the Exported Part Definitions - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::MapField PartDefinitions { - get { return partDefinitions_; } - } - - /// Field number for the "part_instances" field. - public const int PartInstancesFieldNumber = 3; - private static readonly pbc::MapField.Codec _map_partInstances_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::Mirabuf.PartInstance.Parser), 26); - private readonly pbc::MapField partInstances_ = new pbc::MapField(); - /// - //// Map of the Exported Parts that make up the object - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::MapField PartInstances { - get { return partInstances_; } - } - - /// Field number for the "user_data" field. - public const int UserDataFieldNumber = 4; - private global::Mirabuf.UserData userData_; - /// - //// other associated data that can be used - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.UserData UserData { - get { return userData_; } - set { - userData_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Parts); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Parts other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(Info, other.Info)) return false; - if (!PartDefinitions.Equals(other.PartDefinitions)) return false; - if (!PartInstances.Equals(other.PartInstances)) return false; - if (!object.Equals(UserData, other.UserData)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (info_ != null) hash ^= Info.GetHashCode(); - hash ^= PartDefinitions.GetHashCode(); - hash ^= PartInstances.GetHashCode(); - if (userData_ != null) hash ^= UserData.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (info_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Info); - } - partDefinitions_.WriteTo(output, _map_partDefinitions_codec); - partInstances_.WriteTo(output, _map_partInstances_codec); - if (userData_ != null) { - output.WriteRawTag(34); - output.WriteMessage(UserData); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (info_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Info); - } - partDefinitions_.WriteTo(ref output, _map_partDefinitions_codec); - partInstances_.WriteTo(ref output, _map_partInstances_codec); - if (userData_ != null) { - output.WriteRawTag(34); - output.WriteMessage(UserData); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (info_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Info); - } - size += partDefinitions_.CalculateSize(_map_partDefinitions_codec); - size += partInstances_.CalculateSize(_map_partInstances_codec); - if (userData_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(UserData); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Parts other) { - if (other == null) { - return; - } - if (other.info_ != null) { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - Info.MergeFrom(other.Info); - } - partDefinitions_.MergeFrom(other.partDefinitions_); - partInstances_.MergeFrom(other.partInstances_); - if (other.userData_ != null) { - if (userData_ == null) { - UserData = new global::Mirabuf.UserData(); - } - UserData.MergeFrom(other.UserData); - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - input.ReadMessage(Info); - break; - } - case 18: { - partDefinitions_.AddEntriesFrom(input, _map_partDefinitions_codec); - break; - } - case 26: { - partInstances_.AddEntriesFrom(input, _map_partInstances_codec); - break; - } - case 34: { - if (userData_ == null) { - UserData = new global::Mirabuf.UserData(); - } - input.ReadMessage(UserData); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - input.ReadMessage(Info); - break; - } - case 18: { - partDefinitions_.AddEntriesFrom(ref input, _map_partDefinitions_codec); - break; - } - case 26: { - partInstances_.AddEntriesFrom(ref input, _map_partInstances_codec); - break; - } - case 34: { - if (userData_ == null) { - UserData = new global::Mirabuf.UserData(); - } - input.ReadMessage(UserData); - break; - } - } - } - } - #endif - - } - - /// - ///* - /// Part Definition - /// Unique Definition of a part that can be replicated. - /// Useful for keeping the object counter down in the scene. - /// - public sealed partial class PartDefinition : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PartDefinition()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.AssemblyReflection.Descriptor.MessageTypes[3]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public PartDefinition() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public PartDefinition(PartDefinition other) : this() { - info_ = other.info_ != null ? other.info_.Clone() : null; - physicalData_ = other.physicalData_ != null ? other.physicalData_.Clone() : null; - baseTransform_ = other.baseTransform_ != null ? other.baseTransform_.Clone() : null; - bodies_ = other.bodies_.Clone(); - dynamic_ = other.dynamic_; - frictionOverride_ = other.frictionOverride_; - massOverride_ = other.massOverride_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public PartDefinition Clone() { - return new PartDefinition(this); - } - - /// Field number for the "info" field. - public const int InfoFieldNumber = 1; - private global::Mirabuf.Info info_; - /// - //// Information about version - id - name - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Info Info { - get { return info_; } - set { - info_ = value; - } - } - - /// Field number for the "physical_data" field. - public const int PhysicalDataFieldNumber = 2; - private global::Mirabuf.PhysicalProperties physicalData_; - /// - //// Physical data associated with Part - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.PhysicalProperties PhysicalData { - get { return physicalData_; } - set { - physicalData_ = value; - } - } - - /// Field number for the "base_transform" field. - public const int BaseTransformFieldNumber = 3; - private global::Mirabuf.Transform baseTransform_; - /// - //// Base Transform applied - Most Likely Identity Matrix - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Transform BaseTransform { - get { return baseTransform_; } - set { - baseTransform_ = value; - } - } - - /// Field number for the "bodies" field. - public const int BodiesFieldNumber = 4; - private static readonly pb::FieldCodec _repeated_bodies_codec - = pb::FieldCodec.ForMessage(34, global::Mirabuf.Body.Parser); - private readonly pbc::RepeatedField bodies_ = new pbc::RepeatedField(); - /// - //// Mesh Bodies to populate part - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Bodies { - get { return bodies_; } - } - - /// Field number for the "dynamic" field. - public const int DynamicFieldNumber = 5; - private bool dynamic_; - /// - //// Optional value to state whether an object is a dynamic object in a static assembly - all children are also considered overriden - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Dynamic { - get { return dynamic_; } - set { - dynamic_ = value; - } - } - - /// Field number for the "friction_override" field. - public const int FrictionOverrideFieldNumber = 6; - private float frictionOverride_; - /// - //// Optional value for overriding the friction value 0-1 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float FrictionOverride { - get { return frictionOverride_; } - set { - frictionOverride_ = value; - } - } - - /// Field number for the "mass_override" field. - public const int MassOverrideFieldNumber = 7; - private float massOverride_; - /// - //// Optional value for overriding an indiviaul object's mass - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float MassOverride { - get { return massOverride_; } - set { - massOverride_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as PartDefinition); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(PartDefinition other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(Info, other.Info)) return false; - if (!object.Equals(PhysicalData, other.PhysicalData)) return false; - if (!object.Equals(BaseTransform, other.BaseTransform)) return false; - if(!bodies_.Equals(other.bodies_)) return false; - if (Dynamic != other.Dynamic) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(FrictionOverride, other.FrictionOverride)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MassOverride, other.MassOverride)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (info_ != null) hash ^= Info.GetHashCode(); - if (physicalData_ != null) hash ^= PhysicalData.GetHashCode(); - if (baseTransform_ != null) hash ^= BaseTransform.GetHashCode(); - hash ^= bodies_.GetHashCode(); - if (Dynamic != false) hash ^= Dynamic.GetHashCode(); - if (FrictionOverride != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(FrictionOverride); - if (MassOverride != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MassOverride); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (info_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Info); - } - if (physicalData_ != null) { - output.WriteRawTag(18); - output.WriteMessage(PhysicalData); - } - if (baseTransform_ != null) { - output.WriteRawTag(26); - output.WriteMessage(BaseTransform); - } - bodies_.WriteTo(output, _repeated_bodies_codec); - if (Dynamic != false) { - output.WriteRawTag(40); - output.WriteBool(Dynamic); - } - if (FrictionOverride != 0F) { - output.WriteRawTag(53); - output.WriteFloat(FrictionOverride); - } - if (MassOverride != 0F) { - output.WriteRawTag(61); - output.WriteFloat(MassOverride); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (info_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Info); - } - if (physicalData_ != null) { - output.WriteRawTag(18); - output.WriteMessage(PhysicalData); - } - if (baseTransform_ != null) { - output.WriteRawTag(26); - output.WriteMessage(BaseTransform); - } - bodies_.WriteTo(ref output, _repeated_bodies_codec); - if (Dynamic != false) { - output.WriteRawTag(40); - output.WriteBool(Dynamic); - } - if (FrictionOverride != 0F) { - output.WriteRawTag(53); - output.WriteFloat(FrictionOverride); - } - if (MassOverride != 0F) { - output.WriteRawTag(61); - output.WriteFloat(MassOverride); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (info_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Info); - } - if (physicalData_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(PhysicalData); - } - if (baseTransform_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(BaseTransform); - } - size += bodies_.CalculateSize(_repeated_bodies_codec); - if (Dynamic != false) { - size += 1 + 1; - } - if (FrictionOverride != 0F) { - size += 1 + 4; - } - if (MassOverride != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(PartDefinition other) { - if (other == null) { - return; - } - if (other.info_ != null) { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - Info.MergeFrom(other.Info); - } - if (other.physicalData_ != null) { - if (physicalData_ == null) { - PhysicalData = new global::Mirabuf.PhysicalProperties(); - } - PhysicalData.MergeFrom(other.PhysicalData); - } - if (other.baseTransform_ != null) { - if (baseTransform_ == null) { - BaseTransform = new global::Mirabuf.Transform(); - } - BaseTransform.MergeFrom(other.BaseTransform); - } - bodies_.Add(other.bodies_); - if (other.Dynamic != false) { - Dynamic = other.Dynamic; - } - if (other.FrictionOverride != 0F) { - FrictionOverride = other.FrictionOverride; - } - if (other.MassOverride != 0F) { - MassOverride = other.MassOverride; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - input.ReadMessage(Info); - break; - } - case 18: { - if (physicalData_ == null) { - PhysicalData = new global::Mirabuf.PhysicalProperties(); - } - input.ReadMessage(PhysicalData); - break; - } - case 26: { - if (baseTransform_ == null) { - BaseTransform = new global::Mirabuf.Transform(); - } - input.ReadMessage(BaseTransform); - break; - } - case 34: { - bodies_.AddEntriesFrom(input, _repeated_bodies_codec); - break; - } - case 40: { - Dynamic = input.ReadBool(); - break; - } - case 53: { - FrictionOverride = input.ReadFloat(); - break; - } - case 61: { - MassOverride = input.ReadFloat(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - input.ReadMessage(Info); - break; - } - case 18: { - if (physicalData_ == null) { - PhysicalData = new global::Mirabuf.PhysicalProperties(); - } - input.ReadMessage(PhysicalData); - break; - } - case 26: { - if (baseTransform_ == null) { - BaseTransform = new global::Mirabuf.Transform(); - } - input.ReadMessage(BaseTransform); - break; - } - case 34: { - bodies_.AddEntriesFrom(ref input, _repeated_bodies_codec); - break; - } - case 40: { - Dynamic = input.ReadBool(); - break; - } - case 53: { - FrictionOverride = input.ReadFloat(); - break; - } - case 61: { - MassOverride = input.ReadFloat(); - break; - } - } - } - } - #endif - - } - - /// - /// - /// Part - /// Represents a object that does not have to be unique - /// Can be an override for an existing definition - /// - public sealed partial class PartInstance : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PartInstance()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.AssemblyReflection.Descriptor.MessageTypes[4]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public PartInstance() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public PartInstance(PartInstance other) : this() { - info_ = other.info_ != null ? other.info_.Clone() : null; - partDefinitionReference_ = other.partDefinitionReference_; - transform_ = other.transform_ != null ? other.transform_.Clone() : null; - globalTransform_ = other.globalTransform_ != null ? other.globalTransform_.Clone() : null; - joints_ = other.joints_.Clone(); - appearance_ = other.appearance_; - physicalMaterial_ = other.physicalMaterial_; - skipCollider_ = other.skipCollider_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public PartInstance Clone() { - return new PartInstance(this); - } - - /// Field number for the "info" field. - public const int InfoFieldNumber = 1; - private global::Mirabuf.Info info_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Info Info { - get { return info_; } - set { - info_ = value; - } - } - - /// Field number for the "part_definition_reference" field. - public const int PartDefinitionReferenceFieldNumber = 2; - private string partDefinitionReference_ = ""; - /// - //// Reference to the Part Definition defined in Assembly Data - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string PartDefinitionReference { - get { return partDefinitionReference_; } - set { - partDefinitionReference_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "transform" field. - public const int TransformFieldNumber = 3; - private global::Mirabuf.Transform transform_; - /// - //// Overriding the object transform (moves the part from the def) - in design hierarchy context - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Transform Transform { - get { return transform_; } - set { - transform_ = value; - } - } - - /// Field number for the "global_transform" field. - public const int GlobalTransformFieldNumber = 4; - private global::Mirabuf.Transform globalTransform_; - /// - //// Position transform from a global scope - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Transform GlobalTransform { - get { return globalTransform_; } - set { - globalTransform_ = value; - } - } - - /// Field number for the "joints" field. - public const int JointsFieldNumber = 5; - private static readonly pb::FieldCodec _repeated_joints_codec - = pb::FieldCodec.ForString(42); - private readonly pbc::RepeatedField joints_ = new pbc::RepeatedField(); - /// - //// Joints that interact with this element - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Joints { - get { return joints_; } - } - - /// Field number for the "appearance" field. - public const int AppearanceFieldNumber = 6; - private string appearance_ = ""; - /// - /// Appearance Reference to link to `Materials->Appearance->Info->id` - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Appearance { - get { return appearance_; } - set { - appearance_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "physical_material" field. - public const int PhysicalMaterialFieldNumber = 7; - private string physicalMaterial_ = ""; - /// - //// Physical Material Reference to link to `Materials->PhysicalMaterial->Info->id` - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string PhysicalMaterial { - get { return physicalMaterial_; } - set { - physicalMaterial_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "skip_collider" field. - public const int SkipColliderFieldNumber = 8; - private bool skipCollider_; - /// - //// Flag that if enabled indicates we should skip generating a collider, defaults to FALSE or undefined - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool SkipCollider { - get { return skipCollider_; } - set { - skipCollider_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as PartInstance); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(PartInstance other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(Info, other.Info)) return false; - if (PartDefinitionReference != other.PartDefinitionReference) return false; - if (!object.Equals(Transform, other.Transform)) return false; - if (!object.Equals(GlobalTransform, other.GlobalTransform)) return false; - if(!joints_.Equals(other.joints_)) return false; - if (Appearance != other.Appearance) return false; - if (PhysicalMaterial != other.PhysicalMaterial) return false; - if (SkipCollider != other.SkipCollider) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (info_ != null) hash ^= Info.GetHashCode(); - if (PartDefinitionReference.Length != 0) hash ^= PartDefinitionReference.GetHashCode(); - if (transform_ != null) hash ^= Transform.GetHashCode(); - if (globalTransform_ != null) hash ^= GlobalTransform.GetHashCode(); - hash ^= joints_.GetHashCode(); - if (Appearance.Length != 0) hash ^= Appearance.GetHashCode(); - if (PhysicalMaterial.Length != 0) hash ^= PhysicalMaterial.GetHashCode(); - if (SkipCollider != false) hash ^= SkipCollider.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (info_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Info); - } - if (PartDefinitionReference.Length != 0) { - output.WriteRawTag(18); - output.WriteString(PartDefinitionReference); - } - if (transform_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Transform); - } - if (globalTransform_ != null) { - output.WriteRawTag(34); - output.WriteMessage(GlobalTransform); - } - joints_.WriteTo(output, _repeated_joints_codec); - if (Appearance.Length != 0) { - output.WriteRawTag(50); - output.WriteString(Appearance); - } - if (PhysicalMaterial.Length != 0) { - output.WriteRawTag(58); - output.WriteString(PhysicalMaterial); - } - if (SkipCollider != false) { - output.WriteRawTag(64); - output.WriteBool(SkipCollider); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (info_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Info); - } - if (PartDefinitionReference.Length != 0) { - output.WriteRawTag(18); - output.WriteString(PartDefinitionReference); - } - if (transform_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Transform); - } - if (globalTransform_ != null) { - output.WriteRawTag(34); - output.WriteMessage(GlobalTransform); - } - joints_.WriteTo(ref output, _repeated_joints_codec); - if (Appearance.Length != 0) { - output.WriteRawTag(50); - output.WriteString(Appearance); - } - if (PhysicalMaterial.Length != 0) { - output.WriteRawTag(58); - output.WriteString(PhysicalMaterial); - } - if (SkipCollider != false) { - output.WriteRawTag(64); - output.WriteBool(SkipCollider); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (info_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Info); - } - if (PartDefinitionReference.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(PartDefinitionReference); - } - if (transform_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Transform); - } - if (globalTransform_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(GlobalTransform); - } - size += joints_.CalculateSize(_repeated_joints_codec); - if (Appearance.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Appearance); - } - if (PhysicalMaterial.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(PhysicalMaterial); - } - if (SkipCollider != false) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(PartInstance other) { - if (other == null) { - return; - } - if (other.info_ != null) { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - Info.MergeFrom(other.Info); - } - if (other.PartDefinitionReference.Length != 0) { - PartDefinitionReference = other.PartDefinitionReference; - } - if (other.transform_ != null) { - if (transform_ == null) { - Transform = new global::Mirabuf.Transform(); - } - Transform.MergeFrom(other.Transform); - } - if (other.globalTransform_ != null) { - if (globalTransform_ == null) { - GlobalTransform = new global::Mirabuf.Transform(); - } - GlobalTransform.MergeFrom(other.GlobalTransform); - } - joints_.Add(other.joints_); - if (other.Appearance.Length != 0) { - Appearance = other.Appearance; - } - if (other.PhysicalMaterial.Length != 0) { - PhysicalMaterial = other.PhysicalMaterial; - } - if (other.SkipCollider != false) { - SkipCollider = other.SkipCollider; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - input.ReadMessage(Info); - break; - } - case 18: { - PartDefinitionReference = input.ReadString(); - break; - } - case 26: { - if (transform_ == null) { - Transform = new global::Mirabuf.Transform(); - } - input.ReadMessage(Transform); - break; - } - case 34: { - if (globalTransform_ == null) { - GlobalTransform = new global::Mirabuf.Transform(); - } - input.ReadMessage(GlobalTransform); - break; - } - case 42: { - joints_.AddEntriesFrom(input, _repeated_joints_codec); - break; - } - case 50: { - Appearance = input.ReadString(); - break; - } - case 58: { - PhysicalMaterial = input.ReadString(); - break; - } - case 64: { - SkipCollider = input.ReadBool(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - input.ReadMessage(Info); - break; - } - case 18: { - PartDefinitionReference = input.ReadString(); - break; - } - case 26: { - if (transform_ == null) { - Transform = new global::Mirabuf.Transform(); - } - input.ReadMessage(Transform); - break; - } - case 34: { - if (globalTransform_ == null) { - GlobalTransform = new global::Mirabuf.Transform(); - } - input.ReadMessage(GlobalTransform); - break; - } - case 42: { - joints_.AddEntriesFrom(ref input, _repeated_joints_codec); - break; - } - case 50: { - Appearance = input.ReadString(); - break; - } - case 58: { - PhysicalMaterial = input.ReadString(); - break; - } - case 64: { - SkipCollider = input.ReadBool(); - break; - } - } - } - } - #endif - - } - - /// - /// - /// Body object - /// Can contain a TriangleMesh or Collection of Faces. - /// Must be unique in the context of the Assembly. - /// - public sealed partial class Body : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Body()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.AssemblyReflection.Descriptor.MessageTypes[5]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Body() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Body(Body other) : this() { - info_ = other.info_ != null ? other.info_.Clone() : null; - part_ = other.part_; - triangleMesh_ = other.triangleMesh_ != null ? other.triangleMesh_.Clone() : null; - appearanceOverride_ = other.appearanceOverride_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Body Clone() { - return new Body(this); - } - - /// Field number for the "info" field. - public const int InfoFieldNumber = 1; - private global::Mirabuf.Info info_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Info Info { - get { return info_; } - set { - info_ = value; - } - } - - /// Field number for the "part" field. - public const int PartFieldNumber = 2; - private string part_ = ""; - /// - //// Reference to Part Definition - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Part { - get { return part_; } - set { - part_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "triangle_mesh" field. - public const int TriangleMeshFieldNumber = 3; - private global::Mirabuf.TriangleMesh triangleMesh_; - /// - //// Triangle Mesh for rendering - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.TriangleMesh TriangleMesh { - get { return triangleMesh_; } - set { - triangleMesh_ = value; - } - } - - /// Field number for the "appearance_override" field. - public const int AppearanceOverrideFieldNumber = 4; - private string appearanceOverride_ = ""; - /// - //// Override Visual Appearance for the body - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string AppearanceOverride { - get { return appearanceOverride_; } - set { - appearanceOverride_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Body); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Body other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(Info, other.Info)) return false; - if (Part != other.Part) return false; - if (!object.Equals(TriangleMesh, other.TriangleMesh)) return false; - if (AppearanceOverride != other.AppearanceOverride) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (info_ != null) hash ^= Info.GetHashCode(); - if (Part.Length != 0) hash ^= Part.GetHashCode(); - if (triangleMesh_ != null) hash ^= TriangleMesh.GetHashCode(); - if (AppearanceOverride.Length != 0) hash ^= AppearanceOverride.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (info_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Info); - } - if (Part.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Part); - } - if (triangleMesh_ != null) { - output.WriteRawTag(26); - output.WriteMessage(TriangleMesh); - } - if (AppearanceOverride.Length != 0) { - output.WriteRawTag(34); - output.WriteString(AppearanceOverride); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (info_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Info); - } - if (Part.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Part); - } - if (triangleMesh_ != null) { - output.WriteRawTag(26); - output.WriteMessage(TriangleMesh); - } - if (AppearanceOverride.Length != 0) { - output.WriteRawTag(34); - output.WriteString(AppearanceOverride); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (info_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Info); - } - if (Part.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Part); - } - if (triangleMesh_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(TriangleMesh); - } - if (AppearanceOverride.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(AppearanceOverride); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Body other) { - if (other == null) { - return; - } - if (other.info_ != null) { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - Info.MergeFrom(other.Info); - } - if (other.Part.Length != 0) { - Part = other.Part; - } - if (other.triangleMesh_ != null) { - if (triangleMesh_ == null) { - TriangleMesh = new global::Mirabuf.TriangleMesh(); - } - TriangleMesh.MergeFrom(other.TriangleMesh); - } - if (other.AppearanceOverride.Length != 0) { - AppearanceOverride = other.AppearanceOverride; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - input.ReadMessage(Info); - break; - } - case 18: { - Part = input.ReadString(); - break; - } - case 26: { - if (triangleMesh_ == null) { - TriangleMesh = new global::Mirabuf.TriangleMesh(); - } - input.ReadMessage(TriangleMesh); - break; - } - case 34: { - AppearanceOverride = input.ReadString(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - input.ReadMessage(Info); - break; - } - case 18: { - Part = input.ReadString(); - break; - } - case 26: { - if (triangleMesh_ == null) { - TriangleMesh = new global::Mirabuf.TriangleMesh(); - } - input.ReadMessage(TriangleMesh); - break; - } - case 34: { - AppearanceOverride = input.ReadString(); - break; - } - } - } - } - #endif - - } - - /// - ///* - /// Traingle Mesh for Storing Display Mesh data - /// - public sealed partial class TriangleMesh : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TriangleMesh()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.AssemblyReflection.Descriptor.MessageTypes[6]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public TriangleMesh() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public TriangleMesh(TriangleMesh other) : this() { - info_ = other.info_ != null ? other.info_.Clone() : null; - hasVolume_ = other.hasVolume_; - materialReference_ = other.materialReference_; - switch (other.MeshTypeCase) { - case MeshTypeOneofCase.Mesh: - Mesh = other.Mesh.Clone(); - break; - case MeshTypeOneofCase.Bmesh: - Bmesh = other.Bmesh.Clone(); - break; - } - - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public TriangleMesh Clone() { - return new TriangleMesh(this); - } - - /// Field number for the "info" field. - public const int InfoFieldNumber = 1; - private global::Mirabuf.Info info_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Info Info { - get { return info_; } - set { - info_ = value; - } - } - - /// Field number for the "has_volume" field. - public const int HasVolumeFieldNumber = 2; - private bool hasVolume_; - /// - //// Is this object a Plane ? (Does it have volume) - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool HasVolume { - get { return hasVolume_; } - set { - hasVolume_ = value; - } - } - - /// Field number for the "material_reference" field. - public const int MaterialReferenceFieldNumber = 3; - private string materialReference_ = ""; - /// - //// Rendered Appearance properties referenced from Assembly Data - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string MaterialReference { - get { return materialReference_; } - set { - materialReference_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "mesh" field. - public const int MeshFieldNumber = 4; - /// - //// Stored as true types, inidicies, verts, uv - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Mesh Mesh { - get { return meshTypeCase_ == MeshTypeOneofCase.Mesh ? (global::Mirabuf.Mesh) meshType_ : null; } - set { - meshType_ = value; - meshTypeCase_ = value == null ? MeshTypeOneofCase.None : MeshTypeOneofCase.Mesh; - } - } - - /// Field number for the "bmesh" field. - public const int BmeshFieldNumber = 5; - /// - //// Stored as binary data in bytes - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.BinaryMesh Bmesh { - get { return meshTypeCase_ == MeshTypeOneofCase.Bmesh ? (global::Mirabuf.BinaryMesh) meshType_ : null; } - set { - meshType_ = value; - meshTypeCase_ = value == null ? MeshTypeOneofCase.None : MeshTypeOneofCase.Bmesh; - } - } - - private object meshType_; - /// Enum of possible cases for the "mesh_type" oneof. - public enum MeshTypeOneofCase { - None = 0, - Mesh = 4, - Bmesh = 5, - } - private MeshTypeOneofCase meshTypeCase_ = MeshTypeOneofCase.None; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MeshTypeOneofCase MeshTypeCase { - get { return meshTypeCase_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearMeshType() { - meshTypeCase_ = MeshTypeOneofCase.None; - meshType_ = null; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as TriangleMesh); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(TriangleMesh other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(Info, other.Info)) return false; - if (HasVolume != other.HasVolume) return false; - if (MaterialReference != other.MaterialReference) return false; - if (!object.Equals(Mesh, other.Mesh)) return false; - if (!object.Equals(Bmesh, other.Bmesh)) return false; - if (MeshTypeCase != other.MeshTypeCase) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (info_ != null) hash ^= Info.GetHashCode(); - if (HasVolume != false) hash ^= HasVolume.GetHashCode(); - if (MaterialReference.Length != 0) hash ^= MaterialReference.GetHashCode(); - if (meshTypeCase_ == MeshTypeOneofCase.Mesh) hash ^= Mesh.GetHashCode(); - if (meshTypeCase_ == MeshTypeOneofCase.Bmesh) hash ^= Bmesh.GetHashCode(); - hash ^= (int) meshTypeCase_; - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (info_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Info); - } - if (HasVolume != false) { - output.WriteRawTag(16); - output.WriteBool(HasVolume); - } - if (MaterialReference.Length != 0) { - output.WriteRawTag(26); - output.WriteString(MaterialReference); - } - if (meshTypeCase_ == MeshTypeOneofCase.Mesh) { - output.WriteRawTag(34); - output.WriteMessage(Mesh); - } - if (meshTypeCase_ == MeshTypeOneofCase.Bmesh) { - output.WriteRawTag(42); - output.WriteMessage(Bmesh); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (info_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Info); - } - if (HasVolume != false) { - output.WriteRawTag(16); - output.WriteBool(HasVolume); - } - if (MaterialReference.Length != 0) { - output.WriteRawTag(26); - output.WriteString(MaterialReference); - } - if (meshTypeCase_ == MeshTypeOneofCase.Mesh) { - output.WriteRawTag(34); - output.WriteMessage(Mesh); - } - if (meshTypeCase_ == MeshTypeOneofCase.Bmesh) { - output.WriteRawTag(42); - output.WriteMessage(Bmesh); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (info_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Info); - } - if (HasVolume != false) { - size += 1 + 1; - } - if (MaterialReference.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(MaterialReference); - } - if (meshTypeCase_ == MeshTypeOneofCase.Mesh) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Mesh); - } - if (meshTypeCase_ == MeshTypeOneofCase.Bmesh) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Bmesh); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(TriangleMesh other) { - if (other == null) { - return; - } - if (other.info_ != null) { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - Info.MergeFrom(other.Info); - } - if (other.HasVolume != false) { - HasVolume = other.HasVolume; - } - if (other.MaterialReference.Length != 0) { - MaterialReference = other.MaterialReference; - } - switch (other.MeshTypeCase) { - case MeshTypeOneofCase.Mesh: - if (Mesh == null) { - Mesh = new global::Mirabuf.Mesh(); - } - Mesh.MergeFrom(other.Mesh); - break; - case MeshTypeOneofCase.Bmesh: - if (Bmesh == null) { - Bmesh = new global::Mirabuf.BinaryMesh(); - } - Bmesh.MergeFrom(other.Bmesh); - break; - } - - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - input.ReadMessage(Info); - break; - } - case 16: { - HasVolume = input.ReadBool(); - break; - } - case 26: { - MaterialReference = input.ReadString(); - break; - } - case 34: { - global::Mirabuf.Mesh subBuilder = new global::Mirabuf.Mesh(); - if (meshTypeCase_ == MeshTypeOneofCase.Mesh) { - subBuilder.MergeFrom(Mesh); - } - input.ReadMessage(subBuilder); - Mesh = subBuilder; - break; - } - case 42: { - global::Mirabuf.BinaryMesh subBuilder = new global::Mirabuf.BinaryMesh(); - if (meshTypeCase_ == MeshTypeOneofCase.Bmesh) { - subBuilder.MergeFrom(Bmesh); - } - input.ReadMessage(subBuilder); - Bmesh = subBuilder; - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - input.ReadMessage(Info); - break; - } - case 16: { - HasVolume = input.ReadBool(); - break; - } - case 26: { - MaterialReference = input.ReadString(); - break; - } - case 34: { - global::Mirabuf.Mesh subBuilder = new global::Mirabuf.Mesh(); - if (meshTypeCase_ == MeshTypeOneofCase.Mesh) { - subBuilder.MergeFrom(Mesh); - } - input.ReadMessage(subBuilder); - Mesh = subBuilder; - break; - } - case 42: { - global::Mirabuf.BinaryMesh subBuilder = new global::Mirabuf.BinaryMesh(); - if (meshTypeCase_ == MeshTypeOneofCase.Bmesh) { - subBuilder.MergeFrom(Bmesh); - } - input.ReadMessage(subBuilder); - Bmesh = subBuilder; - break; - } - } - } - } - #endif - - } - - /// - ///* - /// Mesh Data stored as generic Data Structure - /// - public sealed partial class Mesh : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Mesh()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.AssemblyReflection.Descriptor.MessageTypes[7]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Mesh() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Mesh(Mesh other) : this() { - verts_ = other.verts_.Clone(); - normals_ = other.normals_.Clone(); - uv_ = other.uv_.Clone(); - indices_ = other.indices_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Mesh Clone() { - return new Mesh(this); - } - - /// Field number for the "verts" field. - public const int VertsFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_verts_codec - = pb::FieldCodec.ForFloat(10); - private readonly pbc::RepeatedField verts_ = new pbc::RepeatedField(); - /// - //// Tri Mesh Verts vec3 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Verts { - get { return verts_; } - } - - /// Field number for the "normals" field. - public const int NormalsFieldNumber = 2; - private static readonly pb::FieldCodec _repeated_normals_codec - = pb::FieldCodec.ForFloat(18); - private readonly pbc::RepeatedField normals_ = new pbc::RepeatedField(); - /// - //// Tri Mesh Normals vec3 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Normals { - get { return normals_; } - } - - /// Field number for the "uv" field. - public const int UvFieldNumber = 3; - private static readonly pb::FieldCodec _repeated_uv_codec - = pb::FieldCodec.ForFloat(26); - private readonly pbc::RepeatedField uv_ = new pbc::RepeatedField(); - /// - //// Tri Mesh uv Mapping vec2 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Uv { - get { return uv_; } - } - - /// Field number for the "indices" field. - public const int IndicesFieldNumber = 4; - private static readonly pb::FieldCodec _repeated_indices_codec - = pb::FieldCodec.ForInt32(34); - private readonly pbc::RepeatedField indices_ = new pbc::RepeatedField(); - /// - //// Tri Mesh indicies (Vert Map) - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Indices { - get { return indices_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Mesh); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Mesh other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!verts_.Equals(other.verts_)) return false; - if(!normals_.Equals(other.normals_)) return false; - if(!uv_.Equals(other.uv_)) return false; - if(!indices_.Equals(other.indices_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - hash ^= verts_.GetHashCode(); - hash ^= normals_.GetHashCode(); - hash ^= uv_.GetHashCode(); - hash ^= indices_.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - verts_.WriteTo(output, _repeated_verts_codec); - normals_.WriteTo(output, _repeated_normals_codec); - uv_.WriteTo(output, _repeated_uv_codec); - indices_.WriteTo(output, _repeated_indices_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - verts_.WriteTo(ref output, _repeated_verts_codec); - normals_.WriteTo(ref output, _repeated_normals_codec); - uv_.WriteTo(ref output, _repeated_uv_codec); - indices_.WriteTo(ref output, _repeated_indices_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - size += verts_.CalculateSize(_repeated_verts_codec); - size += normals_.CalculateSize(_repeated_normals_codec); - size += uv_.CalculateSize(_repeated_uv_codec); - size += indices_.CalculateSize(_repeated_indices_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Mesh other) { - if (other == null) { - return; - } - verts_.Add(other.verts_); - normals_.Add(other.normals_); - uv_.Add(other.uv_); - indices_.Add(other.indices_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: - case 13: { - verts_.AddEntriesFrom(input, _repeated_verts_codec); - break; - } - case 18: - case 21: { - normals_.AddEntriesFrom(input, _repeated_normals_codec); - break; - } - case 26: - case 29: { - uv_.AddEntriesFrom(input, _repeated_uv_codec); - break; - } - case 34: - case 32: { - indices_.AddEntriesFrom(input, _repeated_indices_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: - case 13: { - verts_.AddEntriesFrom(ref input, _repeated_verts_codec); - break; - } - case 18: - case 21: { - normals_.AddEntriesFrom(ref input, _repeated_normals_codec); - break; - } - case 26: - case 29: { - uv_.AddEntriesFrom(ref input, _repeated_uv_codec); - break; - } - case 34: - case 32: { - indices_.AddEntriesFrom(ref input, _repeated_indices_codec); - break; - } - } - } - } - #endif - - } - - /// - //// Mesh used for more effective file transfers - /// - public sealed partial class BinaryMesh : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BinaryMesh()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.AssemblyReflection.Descriptor.MessageTypes[8]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public BinaryMesh() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public BinaryMesh(BinaryMesh other) : this() { - data_ = other.data_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public BinaryMesh Clone() { - return new BinaryMesh(this); - } - - /// Field number for the "data" field. - public const int DataFieldNumber = 1; - private pb::ByteString data_ = pb::ByteString.Empty; - /// - //// BEWARE of ENDIANESS - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pb::ByteString Data { - get { return data_; } - set { - data_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as BinaryMesh); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(BinaryMesh other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Data != other.Data) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (Data.Length != 0) hash ^= Data.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Data.Length != 0) { - output.WriteRawTag(10); - output.WriteBytes(Data); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Data.Length != 0) { - output.WriteRawTag(10); - output.WriteBytes(Data); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (Data.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeBytesSize(Data); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(BinaryMesh other) { - if (other == null) { - return; - } - if (other.Data.Length != 0) { - Data = other.Data; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Data = input.ReadBytes(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Data = input.ReadBytes(); - break; - } - } - } - } - #endif - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/api/Mirabuf/Joint.cs b/api/Mirabuf/Joint.cs deleted file mode 100644 index 4877f7706c..0000000000 --- a/api/Mirabuf/Joint.cs +++ /dev/null @@ -1,4270 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: joint.proto -// -#pragma warning disable 1591, 0612, 3021, 8981 -#region Designer generated code - -using pb = global::Google.Protobuf; -using pbc = global::Google.Protobuf.Collections; -using pbr = global::Google.Protobuf.Reflection; -using scg = global::System.Collections.Generic; -namespace Mirabuf.Joint { - - /// Holder for reflection information generated from joint.proto - public static partial class JointReflection { - - #region Descriptor - /// File descriptor for joint.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static JointReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "Cgtqb2ludC5wcm90bxINbWlyYWJ1Zi5qb2ludBoLdHlwZXMucHJvdG8aC21v", - "dG9yLnByb3RvIp0ECgZKb2ludHMSGwoEaW5mbxgBIAEoCzINLm1pcmFidWYu", - "SW5mbxJGChFqb2ludF9kZWZpbml0aW9ucxgCIAMoCzIrLm1pcmFidWYuam9p", - "bnQuSm9pbnRzLkpvaW50RGVmaW5pdGlvbnNFbnRyeRJCCg9qb2ludF9pbnN0", - "YW5jZXMYAyADKAsyKS5taXJhYnVmLmpvaW50LkpvaW50cy5Kb2ludEluc3Rh", - "bmNlc0VudHJ5Ei8KDHJpZ2lkX2dyb3VwcxgEIAMoCzIZLm1pcmFidWYuam9p", - "bnQuUmlnaWRHcm91cBJGChFtb3Rvcl9kZWZpbml0aW9ucxgFIAMoCzIrLm1p", - "cmFidWYuam9pbnQuSm9pbnRzLk1vdG9yRGVmaW5pdGlvbnNFbnRyeRpNChVK", - "b2ludERlZmluaXRpb25zRW50cnkSCwoDa2V5GAEgASgJEiMKBXZhbHVlGAIg", - "ASgLMhQubWlyYWJ1Zi5qb2ludC5Kb2ludDoCOAEaUwoTSm9pbnRJbnN0YW5j", - "ZXNFbnRyeRILCgNrZXkYASABKAkSKwoFdmFsdWUYAiABKAsyHC5taXJhYnVm", - "LmpvaW50LkpvaW50SW5zdGFuY2U6AjgBGk0KFU1vdG9yRGVmaW5pdGlvbnNF", - "bnRyeRILCgNrZXkYASABKAkSIwoFdmFsdWUYAiABKAsyFC5taXJhYnVmLm1v", - "dG9yLk1vdG9yOgI4ASKZAgoNSm9pbnRJbnN0YW5jZRIbCgRpbmZvGAEgASgL", - "Mg0ubWlyYWJ1Zi5JbmZvEhUKDWlzRW5kRWZmZWN0b3IYAiABKAgSEwoLcGFy", - "ZW50X3BhcnQYAyABKAkSEgoKY2hpbGRfcGFydBgEIAEoCRIXCg9qb2ludF9y", - "ZWZlcmVuY2UYBSABKAkSIAoGb2Zmc2V0GAYgASgLMhAubWlyYWJ1Zi5WZWN0", - "b3IzEiYKBXBhcnRzGAcgASgLMhcubWlyYWJ1Zi5HcmFwaENvbnRhaW5lchIY", - "ChBzaWduYWxfcmVmZXJlbmNlGAggASgJEi4KC21vdGlvbl9saW5rGAkgAygL", - "MhkubWlyYWJ1Zi5qb2ludC5Nb3Rpb25MaW5rIkUKCk1vdGlvbkxpbmsSFgoO", - "am9pbnRfaW5zdGFuY2UYASABKAkSDQoFcmF0aW8YAiABKAISEAoIcmV2ZXJz", - "ZWQYAyABKAgi/AIKBUpvaW50EhsKBGluZm8YASABKAsyDS5taXJhYnVmLklu", - "Zm8SIAoGb3JpZ2luGAIgASgLMhAubWlyYWJ1Zi5WZWN0b3IzEjUKEWpvaW50", - "X21vdGlvbl90eXBlGAMgASgOMhoubWlyYWJ1Zi5qb2ludC5Kb2ludE1vdGlv", - "bhIXCg9icmVha19tYWduaXR1ZGUYBCABKAISNAoKcm90YXRpb25hbBgFIAEo", - "CzIeLm1pcmFidWYuam9pbnQuUm90YXRpb25hbEpvaW50SAASMgoJcHJpc21h", - "dGljGAYgASgLMh0ubWlyYWJ1Zi5qb2ludC5QcmlzbWF0aWNKb2ludEgAEiwK", - "BmN1c3RvbRgHIAEoCzIaLm1pcmFidWYuam9pbnQuQ3VzdG9tSm9pbnRIABIk", - "Cgl1c2VyX2RhdGEYCCABKAsyES5taXJhYnVmLlVzZXJEYXRhEhcKD21vdG9y", - "X3JlZmVyZW5jZRgJIAEoCUINCgtKb2ludE1vdGlvbiItCghEeW5hbWljcxIP", - "CgdkYW1waW5nGAEgASgCEhAKCGZyaWN0aW9uGAIgASgCIkgKBkxpbWl0cxIN", - "CgVsb3dlchgBIAEoAhINCgV1cHBlchgCIAEoAhIQCgh2ZWxvY2l0eRgDIAEo", - "AhIOCgZlZmZvcnQYBCABKAIiWgoGU2FmZXR5EhMKC2xvd2VyX2xpbWl0GAEg", - "ASgCEhMKC3VwcGVyX2xpbWl0GAIgASgCEhIKCmtfcG9zaXRpb24YAyABKAIS", - "EgoKa192ZWxvY2l0eRgEIAEoAiK7AQoDRE9GEgwKBG5hbWUYASABKAkSHgoE", - "YXhpcxgCIAEoCzIQLm1pcmFidWYuVmVjdG9yMxIlCg5waXZvdERpcmVjdGlv", - "bhgDIAEoDjINLm1pcmFidWYuQXhpcxIpCghkeW5hbWljcxgEIAEoCzIXLm1p", - "cmFidWYuam9pbnQuRHluYW1pY3MSJQoGbGltaXRzGAUgASgLMhUubWlyYWJ1", - "Zi5qb2ludC5MaW1pdHMSDQoFdmFsdWUYBiABKAIiLwoLQ3VzdG9tSm9pbnQS", - "IAoEZG9mcxgBIAMoCzISLm1pcmFidWYuam9pbnQuRE9GIkEKD1JvdGF0aW9u", - "YWxKb2ludBIuChJyb3RhdGlvbmFsX2ZyZWVkb20YASABKAsyEi5taXJhYnVm", - "LmpvaW50LkRPRiJ1CglCYWxsSm9pbnQSHwoDeWF3GAEgASgLMhIubWlyYWJ1", - "Zi5qb2ludC5ET0YSIQoFcGl0Y2gYAiABKAsyEi5taXJhYnVmLmpvaW50LkRP", - "RhIkCghyb3RhdGlvbhgDIAEoCzISLm1pcmFidWYuam9pbnQuRE9GIj8KDlBy", - "aXNtYXRpY0pvaW50Ei0KEXByaXNtYXRpY19mcmVlZG9tGAEgASgLMhIubWly", - "YWJ1Zi5qb2ludC5ET0YiLwoKUmlnaWRHcm91cBIMCgRuYW1lGAEgASgJEhMK", - "C29jY3VycmVuY2VzGAIgAygJKnIKC0pvaW50TW90aW9uEgkKBVJJR0lEEAAS", - "DAoIUkVWT0xVVEUQARIKCgZTTElERVIQAhIPCgtDWUxJTkRSSUNBTBADEgsK", - "B1BJTlNMT1QQBBIKCgZQTEFOQVIQBRIICgRCQUxMEAYSCgoGQ1VTVE9NEAdi", - "BnByb3RvMw==")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { global::Mirabuf.TypesReflection.Descriptor, global::Mirabuf.Motor.MotorReflection.Descriptor, }, - new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Mirabuf.Joint.JointMotion), }, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.Joint.Joints), global::Mirabuf.Joint.Joints.Parser, new[]{ "Info", "JointDefinitions", "JointInstances", "RigidGroups", "MotorDefinitions" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, null, null, }), - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.Joint.JointInstance), global::Mirabuf.Joint.JointInstance.Parser, new[]{ "Info", "IsEndEffector", "ParentPart", "ChildPart", "JointReference", "Offset", "Parts", "SignalReference", "MotionLink" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.Joint.MotionLink), global::Mirabuf.Joint.MotionLink.Parser, new[]{ "JointInstance", "Ratio", "Reversed" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.Joint.Joint), global::Mirabuf.Joint.Joint.Parser, new[]{ "Info", "Origin", "JointMotionType", "BreakMagnitude", "Rotational", "Prismatic", "Custom", "UserData", "MotorReference" }, new[]{ "JointMotion" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.Joint.Dynamics), global::Mirabuf.Joint.Dynamics.Parser, new[]{ "Damping", "Friction" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.Joint.Limits), global::Mirabuf.Joint.Limits.Parser, new[]{ "Lower", "Upper", "Velocity", "Effort" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.Joint.Safety), global::Mirabuf.Joint.Safety.Parser, new[]{ "LowerLimit", "UpperLimit", "KPosition", "KVelocity" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.Joint.DOF), global::Mirabuf.Joint.DOF.Parser, new[]{ "Name", "Axis", "PivotDirection", "Dynamics", "Limits", "Value" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.Joint.CustomJoint), global::Mirabuf.Joint.CustomJoint.Parser, new[]{ "Dofs" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.Joint.RotationalJoint), global::Mirabuf.Joint.RotationalJoint.Parser, new[]{ "RotationalFreedom" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.Joint.BallJoint), global::Mirabuf.Joint.BallJoint.Parser, new[]{ "Yaw", "Pitch", "Rotation" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.Joint.PrismaticJoint), global::Mirabuf.Joint.PrismaticJoint.Parser, new[]{ "PrismaticFreedom" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.Joint.RigidGroup), global::Mirabuf.Joint.RigidGroup.Parser, new[]{ "Name", "Occurrences" }, null, null, null, null) - })); - } - #endregion - - } - #region Enums - /// - /// Describes the joint - Not really sure what to do with this for now - TBD - /// - public enum JointMotion { - [pbr::OriginalName("RIGID")] Rigid = 0, - [pbr::OriginalName("REVOLUTE")] Revolute = 1, - [pbr::OriginalName("SLIDER")] Slider = 2, - [pbr::OriginalName("CYLINDRICAL")] Cylindrical = 3, - [pbr::OriginalName("PINSLOT")] Pinslot = 4, - [pbr::OriginalName("PLANAR")] Planar = 5, - [pbr::OriginalName("BALL")] Ball = 6, - [pbr::OriginalName("CUSTOM")] Custom = 7, - } - - #endregion - - #region Messages - /// - ///* - /// Joints - /// A way to define the motion between various group connections - /// - public sealed partial class Joints : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Joints()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.Joint.JointReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Joints() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Joints(Joints other) : this() { - info_ = other.info_ != null ? other.info_.Clone() : null; - jointDefinitions_ = other.jointDefinitions_.Clone(); - jointInstances_ = other.jointInstances_.Clone(); - rigidGroups_ = other.rigidGroups_.Clone(); - motorDefinitions_ = other.motorDefinitions_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Joints Clone() { - return new Joints(this); - } - - /// Field number for the "info" field. - public const int InfoFieldNumber = 1; - private global::Mirabuf.Info info_; - /// - //// name, version, uid - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Info Info { - get { return info_; } - set { - info_ = value; - } - } - - /// Field number for the "joint_definitions" field. - public const int JointDefinitionsFieldNumber = 2; - private static readonly pbc::MapField.Codec _map_jointDefinitions_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::Mirabuf.Joint.Joint.Parser), 18); - private readonly pbc::MapField jointDefinitions_ = new pbc::MapField(); - /// - //// Unique Joint Implementations - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::MapField JointDefinitions { - get { return jointDefinitions_; } - } - - /// Field number for the "joint_instances" field. - public const int JointInstancesFieldNumber = 3; - private static readonly pbc::MapField.Codec _map_jointInstances_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::Mirabuf.Joint.JointInstance.Parser), 26); - private readonly pbc::MapField jointInstances_ = new pbc::MapField(); - /// - //// Instances of the Joint Implementations - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::MapField JointInstances { - get { return jointInstances_; } - } - - /// Field number for the "rigid_groups" field. - public const int RigidGroupsFieldNumber = 4; - private static readonly pb::FieldCodec _repeated_rigidGroups_codec - = pb::FieldCodec.ForMessage(34, global::Mirabuf.Joint.RigidGroup.Parser); - private readonly pbc::RepeatedField rigidGroups_ = new pbc::RepeatedField(); - /// - //// Rigidgroups ? - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField RigidGroups { - get { return rigidGroups_; } - } - - /// Field number for the "motor_definitions" field. - public const int MotorDefinitionsFieldNumber = 5; - private static readonly pbc::MapField.Codec _map_motorDefinitions_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::Mirabuf.Motor.Motor.Parser), 42); - private readonly pbc::MapField motorDefinitions_ = new pbc::MapField(); - /// - //// Collection of all Motors exported - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::MapField MotorDefinitions { - get { return motorDefinitions_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Joints); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Joints other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(Info, other.Info)) return false; - if (!JointDefinitions.Equals(other.JointDefinitions)) return false; - if (!JointInstances.Equals(other.JointInstances)) return false; - if(!rigidGroups_.Equals(other.rigidGroups_)) return false; - if (!MotorDefinitions.Equals(other.MotorDefinitions)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (info_ != null) hash ^= Info.GetHashCode(); - hash ^= JointDefinitions.GetHashCode(); - hash ^= JointInstances.GetHashCode(); - hash ^= rigidGroups_.GetHashCode(); - hash ^= MotorDefinitions.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (info_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Info); - } - jointDefinitions_.WriteTo(output, _map_jointDefinitions_codec); - jointInstances_.WriteTo(output, _map_jointInstances_codec); - rigidGroups_.WriteTo(output, _repeated_rigidGroups_codec); - motorDefinitions_.WriteTo(output, _map_motorDefinitions_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (info_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Info); - } - jointDefinitions_.WriteTo(ref output, _map_jointDefinitions_codec); - jointInstances_.WriteTo(ref output, _map_jointInstances_codec); - rigidGroups_.WriteTo(ref output, _repeated_rigidGroups_codec); - motorDefinitions_.WriteTo(ref output, _map_motorDefinitions_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (info_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Info); - } - size += jointDefinitions_.CalculateSize(_map_jointDefinitions_codec); - size += jointInstances_.CalculateSize(_map_jointInstances_codec); - size += rigidGroups_.CalculateSize(_repeated_rigidGroups_codec); - size += motorDefinitions_.CalculateSize(_map_motorDefinitions_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Joints other) { - if (other == null) { - return; - } - if (other.info_ != null) { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - Info.MergeFrom(other.Info); - } - jointDefinitions_.MergeFrom(other.jointDefinitions_); - jointInstances_.MergeFrom(other.jointInstances_); - rigidGroups_.Add(other.rigidGroups_); - motorDefinitions_.MergeFrom(other.motorDefinitions_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - input.ReadMessage(Info); - break; - } - case 18: { - jointDefinitions_.AddEntriesFrom(input, _map_jointDefinitions_codec); - break; - } - case 26: { - jointInstances_.AddEntriesFrom(input, _map_jointInstances_codec); - break; - } - case 34: { - rigidGroups_.AddEntriesFrom(input, _repeated_rigidGroups_codec); - break; - } - case 42: { - motorDefinitions_.AddEntriesFrom(input, _map_motorDefinitions_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - input.ReadMessage(Info); - break; - } - case 18: { - jointDefinitions_.AddEntriesFrom(ref input, _map_jointDefinitions_codec); - break; - } - case 26: { - jointInstances_.AddEntriesFrom(ref input, _map_jointInstances_codec); - break; - } - case 34: { - rigidGroups_.AddEntriesFrom(ref input, _repeated_rigidGroups_codec); - break; - } - case 42: { - motorDefinitions_.AddEntriesFrom(ref input, _map_motorDefinitions_codec); - break; - } - } - } - } - #endif - - } - - /// - ///* - /// Instance of a Joint that has a defined motion and limits. - /// Instancing helps with identifiy closed loop systems. - /// - public sealed partial class JointInstance : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new JointInstance()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.Joint.JointReflection.Descriptor.MessageTypes[1]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public JointInstance() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public JointInstance(JointInstance other) : this() { - info_ = other.info_ != null ? other.info_.Clone() : null; - isEndEffector_ = other.isEndEffector_; - parentPart_ = other.parentPart_; - childPart_ = other.childPart_; - jointReference_ = other.jointReference_; - offset_ = other.offset_ != null ? other.offset_.Clone() : null; - parts_ = other.parts_ != null ? other.parts_.Clone() : null; - signalReference_ = other.signalReference_; - motionLink_ = other.motionLink_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public JointInstance Clone() { - return new JointInstance(this); - } - - /// Field number for the "info" field. - public const int InfoFieldNumber = 1; - private global::Mirabuf.Info info_; - /// - /// Joint name, ID, version, etc - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Info Info { - get { return info_; } - set { - info_ = value; - } - } - - /// Field number for the "isEndEffector" field. - public const int IsEndEffectorFieldNumber = 2; - private bool isEndEffector_; - /// - /// Is this joint the end effector in the tree ? - might remove this - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool IsEndEffector { - get { return isEndEffector_; } - set { - isEndEffector_ = value; - } - } - - /// Field number for the "parent_part" field. - public const int ParentPartFieldNumber = 3; - private string parentPart_ = ""; - /// - /// Object that contains the joint - the ID - Part usually - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string ParentPart { - get { return parentPart_; } - set { - parentPart_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "child_part" field. - public const int ChildPartFieldNumber = 4; - private string childPart_ = ""; - /// - /// Object that is affected by the joint - the ID - Part usually - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string ChildPart { - get { return childPart_; } - set { - childPart_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "joint_reference" field. - public const int JointReferenceFieldNumber = 5; - private string jointReference_ = ""; - /// - /// Reference to the Joint Definition - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string JointReference { - get { return jointReference_; } - set { - jointReference_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "offset" field. - public const int OffsetFieldNumber = 6; - private global::Mirabuf.Vector3 offset_; - /// - /// Offset from Joint Definition Origin - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Vector3 Offset { - get { return offset_; } - set { - offset_ = value; - } - } - - /// Field number for the "parts" field. - public const int PartsFieldNumber = 7; - private global::Mirabuf.GraphContainer parts_; - /// - /// Part Instances all contained and affected by this joint directly - tree - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.GraphContainer Parts { - get { return parts_; } - set { - parts_ = value; - } - } - - /// Field number for the "signal_reference" field. - public const int SignalReferenceFieldNumber = 8; - private string signalReference_ = ""; - /// - /// Reference to the Signals as Drivers - use for signal_map in Assembly Data - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string SignalReference { - get { return signalReference_; } - set { - signalReference_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "motion_link" field. - public const int MotionLinkFieldNumber = 9; - private static readonly pb::FieldCodec _repeated_motionLink_codec - = pb::FieldCodec.ForMessage(74, global::Mirabuf.Joint.MotionLink.Parser); - private readonly pbc::RepeatedField motionLink_ = new pbc::RepeatedField(); - /// - /// Motion Links to other joints - ways to preserve motion between dynamic objects - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField MotionLink { - get { return motionLink_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as JointInstance); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(JointInstance other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(Info, other.Info)) return false; - if (IsEndEffector != other.IsEndEffector) return false; - if (ParentPart != other.ParentPart) return false; - if (ChildPart != other.ChildPart) return false; - if (JointReference != other.JointReference) return false; - if (!object.Equals(Offset, other.Offset)) return false; - if (!object.Equals(Parts, other.Parts)) return false; - if (SignalReference != other.SignalReference) return false; - if(!motionLink_.Equals(other.motionLink_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (info_ != null) hash ^= Info.GetHashCode(); - if (IsEndEffector != false) hash ^= IsEndEffector.GetHashCode(); - if (ParentPart.Length != 0) hash ^= ParentPart.GetHashCode(); - if (ChildPart.Length != 0) hash ^= ChildPart.GetHashCode(); - if (JointReference.Length != 0) hash ^= JointReference.GetHashCode(); - if (offset_ != null) hash ^= Offset.GetHashCode(); - if (parts_ != null) hash ^= Parts.GetHashCode(); - if (SignalReference.Length != 0) hash ^= SignalReference.GetHashCode(); - hash ^= motionLink_.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (info_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Info); - } - if (IsEndEffector != false) { - output.WriteRawTag(16); - output.WriteBool(IsEndEffector); - } - if (ParentPart.Length != 0) { - output.WriteRawTag(26); - output.WriteString(ParentPart); - } - if (ChildPart.Length != 0) { - output.WriteRawTag(34); - output.WriteString(ChildPart); - } - if (JointReference.Length != 0) { - output.WriteRawTag(42); - output.WriteString(JointReference); - } - if (offset_ != null) { - output.WriteRawTag(50); - output.WriteMessage(Offset); - } - if (parts_ != null) { - output.WriteRawTag(58); - output.WriteMessage(Parts); - } - if (SignalReference.Length != 0) { - output.WriteRawTag(66); - output.WriteString(SignalReference); - } - motionLink_.WriteTo(output, _repeated_motionLink_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (info_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Info); - } - if (IsEndEffector != false) { - output.WriteRawTag(16); - output.WriteBool(IsEndEffector); - } - if (ParentPart.Length != 0) { - output.WriteRawTag(26); - output.WriteString(ParentPart); - } - if (ChildPart.Length != 0) { - output.WriteRawTag(34); - output.WriteString(ChildPart); - } - if (JointReference.Length != 0) { - output.WriteRawTag(42); - output.WriteString(JointReference); - } - if (offset_ != null) { - output.WriteRawTag(50); - output.WriteMessage(Offset); - } - if (parts_ != null) { - output.WriteRawTag(58); - output.WriteMessage(Parts); - } - if (SignalReference.Length != 0) { - output.WriteRawTag(66); - output.WriteString(SignalReference); - } - motionLink_.WriteTo(ref output, _repeated_motionLink_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (info_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Info); - } - if (IsEndEffector != false) { - size += 1 + 1; - } - if (ParentPart.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(ParentPart); - } - if (ChildPart.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(ChildPart); - } - if (JointReference.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(JointReference); - } - if (offset_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Offset); - } - if (parts_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Parts); - } - if (SignalReference.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(SignalReference); - } - size += motionLink_.CalculateSize(_repeated_motionLink_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(JointInstance other) { - if (other == null) { - return; - } - if (other.info_ != null) { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - Info.MergeFrom(other.Info); - } - if (other.IsEndEffector != false) { - IsEndEffector = other.IsEndEffector; - } - if (other.ParentPart.Length != 0) { - ParentPart = other.ParentPart; - } - if (other.ChildPart.Length != 0) { - ChildPart = other.ChildPart; - } - if (other.JointReference.Length != 0) { - JointReference = other.JointReference; - } - if (other.offset_ != null) { - if (offset_ == null) { - Offset = new global::Mirabuf.Vector3(); - } - Offset.MergeFrom(other.Offset); - } - if (other.parts_ != null) { - if (parts_ == null) { - Parts = new global::Mirabuf.GraphContainer(); - } - Parts.MergeFrom(other.Parts); - } - if (other.SignalReference.Length != 0) { - SignalReference = other.SignalReference; - } - motionLink_.Add(other.motionLink_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - input.ReadMessage(Info); - break; - } - case 16: { - IsEndEffector = input.ReadBool(); - break; - } - case 26: { - ParentPart = input.ReadString(); - break; - } - case 34: { - ChildPart = input.ReadString(); - break; - } - case 42: { - JointReference = input.ReadString(); - break; - } - case 50: { - if (offset_ == null) { - Offset = new global::Mirabuf.Vector3(); - } - input.ReadMessage(Offset); - break; - } - case 58: { - if (parts_ == null) { - Parts = new global::Mirabuf.GraphContainer(); - } - input.ReadMessage(Parts); - break; - } - case 66: { - SignalReference = input.ReadString(); - break; - } - case 74: { - motionLink_.AddEntriesFrom(input, _repeated_motionLink_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - input.ReadMessage(Info); - break; - } - case 16: { - IsEndEffector = input.ReadBool(); - break; - } - case 26: { - ParentPart = input.ReadString(); - break; - } - case 34: { - ChildPart = input.ReadString(); - break; - } - case 42: { - JointReference = input.ReadString(); - break; - } - case 50: { - if (offset_ == null) { - Offset = new global::Mirabuf.Vector3(); - } - input.ReadMessage(Offset); - break; - } - case 58: { - if (parts_ == null) { - Parts = new global::Mirabuf.GraphContainer(); - } - input.ReadMessage(Parts); - break; - } - case 66: { - SignalReference = input.ReadString(); - break; - } - case 74: { - motionLink_.AddEntriesFrom(ref input, _repeated_motionLink_codec); - break; - } - } - } - } - #endif - - } - - /// - ///* - /// Motion Link Feature - /// Enables the restriction on a joint to a certain range of motion as it is relative to another joint - /// This is useful for moving parts restricted by belts and gears - /// - public sealed partial class MotionLink : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MotionLink()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.Joint.JointReflection.Descriptor.MessageTypes[2]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MotionLink() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MotionLink(MotionLink other) : this() { - jointInstance_ = other.jointInstance_; - ratio_ = other.ratio_; - reversed_ = other.reversed_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MotionLink Clone() { - return new MotionLink(this); - } - - /// Field number for the "joint_instance" field. - public const int JointInstanceFieldNumber = 1; - private string jointInstance_ = ""; - /// - /// The Joint that this is linked to - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string JointInstance { - get { return jointInstance_; } - set { - jointInstance_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "ratio" field. - public const int RatioFieldNumber = 2; - private float ratio_; - /// - /// Ratio of motion between joint 1 and joint 2, we assume this is in mm for linear and deg for rotational - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float Ratio { - get { return ratio_; } - set { - ratio_ = value; - } - } - - /// Field number for the "reversed" field. - public const int ReversedFieldNumber = 3; - private bool reversed_; - /// - /// Reverse the relationship - turn in the same or opposite directions - useful when moving axis arent both the same way. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Reversed { - get { return reversed_; } - set { - reversed_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as MotionLink); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(MotionLink other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (JointInstance != other.JointInstance) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Ratio, other.Ratio)) return false; - if (Reversed != other.Reversed) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (JointInstance.Length != 0) hash ^= JointInstance.GetHashCode(); - if (Ratio != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Ratio); - if (Reversed != false) hash ^= Reversed.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (JointInstance.Length != 0) { - output.WriteRawTag(10); - output.WriteString(JointInstance); - } - if (Ratio != 0F) { - output.WriteRawTag(21); - output.WriteFloat(Ratio); - } - if (Reversed != false) { - output.WriteRawTag(24); - output.WriteBool(Reversed); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (JointInstance.Length != 0) { - output.WriteRawTag(10); - output.WriteString(JointInstance); - } - if (Ratio != 0F) { - output.WriteRawTag(21); - output.WriteFloat(Ratio); - } - if (Reversed != false) { - output.WriteRawTag(24); - output.WriteBool(Reversed); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (JointInstance.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(JointInstance); - } - if (Ratio != 0F) { - size += 1 + 4; - } - if (Reversed != false) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(MotionLink other) { - if (other == null) { - return; - } - if (other.JointInstance.Length != 0) { - JointInstance = other.JointInstance; - } - if (other.Ratio != 0F) { - Ratio = other.Ratio; - } - if (other.Reversed != false) { - Reversed = other.Reversed; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - JointInstance = input.ReadString(); - break; - } - case 21: { - Ratio = input.ReadFloat(); - break; - } - case 24: { - Reversed = input.ReadBool(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - JointInstance = input.ReadString(); - break; - } - case 21: { - Ratio = input.ReadFloat(); - break; - } - case 24: { - Reversed = input.ReadBool(); - break; - } - } - } - } - #endif - - } - - /// - ///* - /// A unqiue implementation of a joint motion - /// Contains information about motion but not assembly relation - /// NOTE: A spring motion is a joint with no driver - /// - public sealed partial class Joint : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Joint()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.Joint.JointReflection.Descriptor.MessageTypes[3]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Joint() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Joint(Joint other) : this() { - info_ = other.info_ != null ? other.info_.Clone() : null; - origin_ = other.origin_ != null ? other.origin_.Clone() : null; - jointMotionType_ = other.jointMotionType_; - breakMagnitude_ = other.breakMagnitude_; - userData_ = other.userData_ != null ? other.userData_.Clone() : null; - motorReference_ = other.motorReference_; - switch (other.JointMotionCase) { - case JointMotionOneofCase.Rotational: - Rotational = other.Rotational.Clone(); - break; - case JointMotionOneofCase.Prismatic: - Prismatic = other.Prismatic.Clone(); - break; - case JointMotionOneofCase.Custom: - Custom = other.Custom.Clone(); - break; - } - - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Joint Clone() { - return new Joint(this); - } - - /// Field number for the "info" field. - public const int InfoFieldNumber = 1; - private global::Mirabuf.Info info_; - /// - //// Joint name, ID, version, etc - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Info Info { - get { return info_; } - set { - info_ = value; - } - } - - /// Field number for the "origin" field. - public const int OriginFieldNumber = 2; - private global::Mirabuf.Vector3 origin_; - /// - /// Transform relative to the parent - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Vector3 Origin { - get { return origin_; } - set { - origin_ = value; - } - } - - /// Field number for the "joint_motion_type" field. - public const int JointMotionTypeFieldNumber = 3; - private global::Mirabuf.Joint.JointMotion jointMotionType_ = global::Mirabuf.Joint.JointMotion.Rigid; - /// - /// type of motion described by the joint - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Joint.JointMotion JointMotionType { - get { return jointMotionType_; } - set { - jointMotionType_ = value; - } - } - - /// Field number for the "break_magnitude" field. - public const int BreakMagnitudeFieldNumber = 4; - private float breakMagnitude_; - /// - /// At what effort does it come apart at. - leave blank if it doesn't - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float BreakMagnitude { - get { return breakMagnitude_; } - set { - breakMagnitude_ = value; - } - } - - /// Field number for the "rotational" field. - public const int RotationalFieldNumber = 5; - /// - //// ONEOF rotational joint - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Joint.RotationalJoint Rotational { - get { return jointMotionCase_ == JointMotionOneofCase.Rotational ? (global::Mirabuf.Joint.RotationalJoint) jointMotion_ : null; } - set { - jointMotion_ = value; - jointMotionCase_ = value == null ? JointMotionOneofCase.None : JointMotionOneofCase.Rotational; - } - } - - /// Field number for the "prismatic" field. - public const int PrismaticFieldNumber = 6; - /// - //// ONEOF prismatic joint - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Joint.PrismaticJoint Prismatic { - get { return jointMotionCase_ == JointMotionOneofCase.Prismatic ? (global::Mirabuf.Joint.PrismaticJoint) jointMotion_ : null; } - set { - jointMotion_ = value; - jointMotionCase_ = value == null ? JointMotionOneofCase.None : JointMotionOneofCase.Prismatic; - } - } - - /// Field number for the "custom" field. - public const int CustomFieldNumber = 7; - /// - //// ONEOF custom joint - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Joint.CustomJoint Custom { - get { return jointMotionCase_ == JointMotionOneofCase.Custom ? (global::Mirabuf.Joint.CustomJoint) jointMotion_ : null; } - set { - jointMotion_ = value; - jointMotionCase_ = value == null ? JointMotionOneofCase.None : JointMotionOneofCase.Custom; - } - } - - /// Field number for the "user_data" field. - public const int UserDataFieldNumber = 8; - private global::Mirabuf.UserData userData_; - /// - //// Additional information someone can query or store relative to your joint. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.UserData UserData { - get { return userData_; } - set { - userData_ = value; - } - } - - /// Field number for the "motor_reference" field. - public const int MotorReferenceFieldNumber = 9; - private string motorReference_ = ""; - /// - //// Motor definition reference to lookup in joints collection - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string MotorReference { - get { return motorReference_; } - set { - motorReference_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - private object jointMotion_; - /// Enum of possible cases for the "JointMotion" oneof. - public enum JointMotionOneofCase { - None = 0, - Rotational = 5, - Prismatic = 6, - Custom = 7, - } - private JointMotionOneofCase jointMotionCase_ = JointMotionOneofCase.None; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public JointMotionOneofCase JointMotionCase { - get { return jointMotionCase_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearJointMotion() { - jointMotionCase_ = JointMotionOneofCase.None; - jointMotion_ = null; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Joint); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Joint other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(Info, other.Info)) return false; - if (!object.Equals(Origin, other.Origin)) return false; - if (JointMotionType != other.JointMotionType) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(BreakMagnitude, other.BreakMagnitude)) return false; - if (!object.Equals(Rotational, other.Rotational)) return false; - if (!object.Equals(Prismatic, other.Prismatic)) return false; - if (!object.Equals(Custom, other.Custom)) return false; - if (!object.Equals(UserData, other.UserData)) return false; - if (MotorReference != other.MotorReference) return false; - if (JointMotionCase != other.JointMotionCase) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (info_ != null) hash ^= Info.GetHashCode(); - if (origin_ != null) hash ^= Origin.GetHashCode(); - if (JointMotionType != global::Mirabuf.Joint.JointMotion.Rigid) hash ^= JointMotionType.GetHashCode(); - if (BreakMagnitude != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(BreakMagnitude); - if (jointMotionCase_ == JointMotionOneofCase.Rotational) hash ^= Rotational.GetHashCode(); - if (jointMotionCase_ == JointMotionOneofCase.Prismatic) hash ^= Prismatic.GetHashCode(); - if (jointMotionCase_ == JointMotionOneofCase.Custom) hash ^= Custom.GetHashCode(); - if (userData_ != null) hash ^= UserData.GetHashCode(); - if (MotorReference.Length != 0) hash ^= MotorReference.GetHashCode(); - hash ^= (int) jointMotionCase_; - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (info_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Info); - } - if (origin_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Origin); - } - if (JointMotionType != global::Mirabuf.Joint.JointMotion.Rigid) { - output.WriteRawTag(24); - output.WriteEnum((int) JointMotionType); - } - if (BreakMagnitude != 0F) { - output.WriteRawTag(37); - output.WriteFloat(BreakMagnitude); - } - if (jointMotionCase_ == JointMotionOneofCase.Rotational) { - output.WriteRawTag(42); - output.WriteMessage(Rotational); - } - if (jointMotionCase_ == JointMotionOneofCase.Prismatic) { - output.WriteRawTag(50); - output.WriteMessage(Prismatic); - } - if (jointMotionCase_ == JointMotionOneofCase.Custom) { - output.WriteRawTag(58); - output.WriteMessage(Custom); - } - if (userData_ != null) { - output.WriteRawTag(66); - output.WriteMessage(UserData); - } - if (MotorReference.Length != 0) { - output.WriteRawTag(74); - output.WriteString(MotorReference); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (info_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Info); - } - if (origin_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Origin); - } - if (JointMotionType != global::Mirabuf.Joint.JointMotion.Rigid) { - output.WriteRawTag(24); - output.WriteEnum((int) JointMotionType); - } - if (BreakMagnitude != 0F) { - output.WriteRawTag(37); - output.WriteFloat(BreakMagnitude); - } - if (jointMotionCase_ == JointMotionOneofCase.Rotational) { - output.WriteRawTag(42); - output.WriteMessage(Rotational); - } - if (jointMotionCase_ == JointMotionOneofCase.Prismatic) { - output.WriteRawTag(50); - output.WriteMessage(Prismatic); - } - if (jointMotionCase_ == JointMotionOneofCase.Custom) { - output.WriteRawTag(58); - output.WriteMessage(Custom); - } - if (userData_ != null) { - output.WriteRawTag(66); - output.WriteMessage(UserData); - } - if (MotorReference.Length != 0) { - output.WriteRawTag(74); - output.WriteString(MotorReference); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (info_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Info); - } - if (origin_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Origin); - } - if (JointMotionType != global::Mirabuf.Joint.JointMotion.Rigid) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) JointMotionType); - } - if (BreakMagnitude != 0F) { - size += 1 + 4; - } - if (jointMotionCase_ == JointMotionOneofCase.Rotational) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Rotational); - } - if (jointMotionCase_ == JointMotionOneofCase.Prismatic) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Prismatic); - } - if (jointMotionCase_ == JointMotionOneofCase.Custom) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Custom); - } - if (userData_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(UserData); - } - if (MotorReference.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(MotorReference); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Joint other) { - if (other == null) { - return; - } - if (other.info_ != null) { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - Info.MergeFrom(other.Info); - } - if (other.origin_ != null) { - if (origin_ == null) { - Origin = new global::Mirabuf.Vector3(); - } - Origin.MergeFrom(other.Origin); - } - if (other.JointMotionType != global::Mirabuf.Joint.JointMotion.Rigid) { - JointMotionType = other.JointMotionType; - } - if (other.BreakMagnitude != 0F) { - BreakMagnitude = other.BreakMagnitude; - } - if (other.userData_ != null) { - if (userData_ == null) { - UserData = new global::Mirabuf.UserData(); - } - UserData.MergeFrom(other.UserData); - } - if (other.MotorReference.Length != 0) { - MotorReference = other.MotorReference; - } - switch (other.JointMotionCase) { - case JointMotionOneofCase.Rotational: - if (Rotational == null) { - Rotational = new global::Mirabuf.Joint.RotationalJoint(); - } - Rotational.MergeFrom(other.Rotational); - break; - case JointMotionOneofCase.Prismatic: - if (Prismatic == null) { - Prismatic = new global::Mirabuf.Joint.PrismaticJoint(); - } - Prismatic.MergeFrom(other.Prismatic); - break; - case JointMotionOneofCase.Custom: - if (Custom == null) { - Custom = new global::Mirabuf.Joint.CustomJoint(); - } - Custom.MergeFrom(other.Custom); - break; - } - - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - input.ReadMessage(Info); - break; - } - case 18: { - if (origin_ == null) { - Origin = new global::Mirabuf.Vector3(); - } - input.ReadMessage(Origin); - break; - } - case 24: { - JointMotionType = (global::Mirabuf.Joint.JointMotion) input.ReadEnum(); - break; - } - case 37: { - BreakMagnitude = input.ReadFloat(); - break; - } - case 42: { - global::Mirabuf.Joint.RotationalJoint subBuilder = new global::Mirabuf.Joint.RotationalJoint(); - if (jointMotionCase_ == JointMotionOneofCase.Rotational) { - subBuilder.MergeFrom(Rotational); - } - input.ReadMessage(subBuilder); - Rotational = subBuilder; - break; - } - case 50: { - global::Mirabuf.Joint.PrismaticJoint subBuilder = new global::Mirabuf.Joint.PrismaticJoint(); - if (jointMotionCase_ == JointMotionOneofCase.Prismatic) { - subBuilder.MergeFrom(Prismatic); - } - input.ReadMessage(subBuilder); - Prismatic = subBuilder; - break; - } - case 58: { - global::Mirabuf.Joint.CustomJoint subBuilder = new global::Mirabuf.Joint.CustomJoint(); - if (jointMotionCase_ == JointMotionOneofCase.Custom) { - subBuilder.MergeFrom(Custom); - } - input.ReadMessage(subBuilder); - Custom = subBuilder; - break; - } - case 66: { - if (userData_ == null) { - UserData = new global::Mirabuf.UserData(); - } - input.ReadMessage(UserData); - break; - } - case 74: { - MotorReference = input.ReadString(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - input.ReadMessage(Info); - break; - } - case 18: { - if (origin_ == null) { - Origin = new global::Mirabuf.Vector3(); - } - input.ReadMessage(Origin); - break; - } - case 24: { - JointMotionType = (global::Mirabuf.Joint.JointMotion) input.ReadEnum(); - break; - } - case 37: { - BreakMagnitude = input.ReadFloat(); - break; - } - case 42: { - global::Mirabuf.Joint.RotationalJoint subBuilder = new global::Mirabuf.Joint.RotationalJoint(); - if (jointMotionCase_ == JointMotionOneofCase.Rotational) { - subBuilder.MergeFrom(Rotational); - } - input.ReadMessage(subBuilder); - Rotational = subBuilder; - break; - } - case 50: { - global::Mirabuf.Joint.PrismaticJoint subBuilder = new global::Mirabuf.Joint.PrismaticJoint(); - if (jointMotionCase_ == JointMotionOneofCase.Prismatic) { - subBuilder.MergeFrom(Prismatic); - } - input.ReadMessage(subBuilder); - Prismatic = subBuilder; - break; - } - case 58: { - global::Mirabuf.Joint.CustomJoint subBuilder = new global::Mirabuf.Joint.CustomJoint(); - if (jointMotionCase_ == JointMotionOneofCase.Custom) { - subBuilder.MergeFrom(Custom); - } - input.ReadMessage(subBuilder); - Custom = subBuilder; - break; - } - case 66: { - if (userData_ == null) { - UserData = new global::Mirabuf.UserData(); - } - input.ReadMessage(UserData); - break; - } - case 74: { - MotorReference = input.ReadString(); - break; - } - } - } - } - #endif - - } - - /// - ///* - /// Dynamics specify the mechanical effects on the motion. - /// - public sealed partial class Dynamics : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Dynamics()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.Joint.JointReflection.Descriptor.MessageTypes[4]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Dynamics() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Dynamics(Dynamics other) : this() { - damping_ = other.damping_; - friction_ = other.friction_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Dynamics Clone() { - return new Dynamics(this); - } - - /// Field number for the "damping" field. - public const int DampingFieldNumber = 1; - private float damping_; - /// - //// Damping effect on a given joint motion - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float Damping { - get { return damping_; } - set { - damping_ = value; - } - } - - /// Field number for the "friction" field. - public const int FrictionFieldNumber = 2; - private float friction_; - /// - //// Friction effect on a given joint motion - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float Friction { - get { return friction_; } - set { - friction_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Dynamics); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Dynamics other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Damping, other.Damping)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Friction, other.Friction)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (Damping != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Damping); - if (Friction != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Friction); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Damping != 0F) { - output.WriteRawTag(13); - output.WriteFloat(Damping); - } - if (Friction != 0F) { - output.WriteRawTag(21); - output.WriteFloat(Friction); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Damping != 0F) { - output.WriteRawTag(13); - output.WriteFloat(Damping); - } - if (Friction != 0F) { - output.WriteRawTag(21); - output.WriteFloat(Friction); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (Damping != 0F) { - size += 1 + 4; - } - if (Friction != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Dynamics other) { - if (other == null) { - return; - } - if (other.Damping != 0F) { - Damping = other.Damping; - } - if (other.Friction != 0F) { - Friction = other.Friction; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 13: { - Damping = input.ReadFloat(); - break; - } - case 21: { - Friction = input.ReadFloat(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 13: { - Damping = input.ReadFloat(); - break; - } - case 21: { - Friction = input.ReadFloat(); - break; - } - } - } - } - #endif - - } - - /// - ///* - /// Limits specify the mechanical range of a given joint. - /// - /// TODO: Add units - /// - public sealed partial class Limits : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Limits()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.Joint.JointReflection.Descriptor.MessageTypes[5]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Limits() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Limits(Limits other) : this() { - lower_ = other.lower_; - upper_ = other.upper_; - velocity_ = other.velocity_; - effort_ = other.effort_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Limits Clone() { - return new Limits(this); - } - - /// Field number for the "lower" field. - public const int LowerFieldNumber = 1; - private float lower_; - /// - //// Lower Limit corresponds to default displacement - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float Lower { - get { return lower_; } - set { - lower_ = value; - } - } - - /// Field number for the "upper" field. - public const int UpperFieldNumber = 2; - private float upper_; - /// - //// Upper Limit is the joint extent - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float Upper { - get { return upper_; } - set { - upper_ = value; - } - } - - /// Field number for the "velocity" field. - public const int VelocityFieldNumber = 3; - private float velocity_; - /// - //// Velocity Max in m/s^2 (angular for rotational) - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float Velocity { - get { return velocity_; } - set { - velocity_ = value; - } - } - - /// Field number for the "effort" field. - public const int EffortFieldNumber = 4; - private float effort_; - /// - //// Effort is the absolute force a joint can apply for a given instant - ROS has a great article on it http://wiki.ros.org/pr2_controller_manager/safety_limits - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float Effort { - get { return effort_; } - set { - effort_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Limits); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Limits other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Lower, other.Lower)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Upper, other.Upper)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Velocity, other.Velocity)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Effort, other.Effort)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (Lower != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Lower); - if (Upper != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Upper); - if (Velocity != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Velocity); - if (Effort != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Effort); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Lower != 0F) { - output.WriteRawTag(13); - output.WriteFloat(Lower); - } - if (Upper != 0F) { - output.WriteRawTag(21); - output.WriteFloat(Upper); - } - if (Velocity != 0F) { - output.WriteRawTag(29); - output.WriteFloat(Velocity); - } - if (Effort != 0F) { - output.WriteRawTag(37); - output.WriteFloat(Effort); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Lower != 0F) { - output.WriteRawTag(13); - output.WriteFloat(Lower); - } - if (Upper != 0F) { - output.WriteRawTag(21); - output.WriteFloat(Upper); - } - if (Velocity != 0F) { - output.WriteRawTag(29); - output.WriteFloat(Velocity); - } - if (Effort != 0F) { - output.WriteRawTag(37); - output.WriteFloat(Effort); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (Lower != 0F) { - size += 1 + 4; - } - if (Upper != 0F) { - size += 1 + 4; - } - if (Velocity != 0F) { - size += 1 + 4; - } - if (Effort != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Limits other) { - if (other == null) { - return; - } - if (other.Lower != 0F) { - Lower = other.Lower; - } - if (other.Upper != 0F) { - Upper = other.Upper; - } - if (other.Velocity != 0F) { - Velocity = other.Velocity; - } - if (other.Effort != 0F) { - Effort = other.Effort; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 13: { - Lower = input.ReadFloat(); - break; - } - case 21: { - Upper = input.ReadFloat(); - break; - } - case 29: { - Velocity = input.ReadFloat(); - break; - } - case 37: { - Effort = input.ReadFloat(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 13: { - Lower = input.ReadFloat(); - break; - } - case 21: { - Upper = input.ReadFloat(); - break; - } - case 29: { - Velocity = input.ReadFloat(); - break; - } - case 37: { - Effort = input.ReadFloat(); - break; - } - } - } - } - #endif - - } - - /// - ///* - /// Safety switch configuration for a given joint. - /// Can usefully indicate a bounds issue. - /// Inspired by the URDF implementation. - /// - /// This should really just be created by the controller. - /// http://wiki.ros.org/pr2_controller_manager/safety_limits - /// - public sealed partial class Safety : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Safety()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.Joint.JointReflection.Descriptor.MessageTypes[6]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Safety() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Safety(Safety other) : this() { - lowerLimit_ = other.lowerLimit_; - upperLimit_ = other.upperLimit_; - kPosition_ = other.kPosition_; - kVelocity_ = other.kVelocity_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Safety Clone() { - return new Safety(this); - } - - /// Field number for the "lower_limit" field. - public const int LowerLimitFieldNumber = 1; - private float lowerLimit_; - /// - //// Lower software limit - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float LowerLimit { - get { return lowerLimit_; } - set { - lowerLimit_ = value; - } - } - - /// Field number for the "upper_limit" field. - public const int UpperLimitFieldNumber = 2; - private float upperLimit_; - /// - //// Upper Software limit - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float UpperLimit { - get { return upperLimit_; } - set { - upperLimit_ = value; - } - } - - /// Field number for the "k_position" field. - public const int KPositionFieldNumber = 3; - private float kPosition_; - /// - //// Relation between position and velocity limit - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float KPosition { - get { return kPosition_; } - set { - kPosition_ = value; - } - } - - /// Field number for the "k_velocity" field. - public const int KVelocityFieldNumber = 4; - private float kVelocity_; - /// - //// Relation between effort and velocity limit - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float KVelocity { - get { return kVelocity_; } - set { - kVelocity_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Safety); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Safety other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(LowerLimit, other.LowerLimit)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(UpperLimit, other.UpperLimit)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(KPosition, other.KPosition)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(KVelocity, other.KVelocity)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (LowerLimit != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(LowerLimit); - if (UpperLimit != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(UpperLimit); - if (KPosition != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(KPosition); - if (KVelocity != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(KVelocity); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (LowerLimit != 0F) { - output.WriteRawTag(13); - output.WriteFloat(LowerLimit); - } - if (UpperLimit != 0F) { - output.WriteRawTag(21); - output.WriteFloat(UpperLimit); - } - if (KPosition != 0F) { - output.WriteRawTag(29); - output.WriteFloat(KPosition); - } - if (KVelocity != 0F) { - output.WriteRawTag(37); - output.WriteFloat(KVelocity); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (LowerLimit != 0F) { - output.WriteRawTag(13); - output.WriteFloat(LowerLimit); - } - if (UpperLimit != 0F) { - output.WriteRawTag(21); - output.WriteFloat(UpperLimit); - } - if (KPosition != 0F) { - output.WriteRawTag(29); - output.WriteFloat(KPosition); - } - if (KVelocity != 0F) { - output.WriteRawTag(37); - output.WriteFloat(KVelocity); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (LowerLimit != 0F) { - size += 1 + 4; - } - if (UpperLimit != 0F) { - size += 1 + 4; - } - if (KPosition != 0F) { - size += 1 + 4; - } - if (KVelocity != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Safety other) { - if (other == null) { - return; - } - if (other.LowerLimit != 0F) { - LowerLimit = other.LowerLimit; - } - if (other.UpperLimit != 0F) { - UpperLimit = other.UpperLimit; - } - if (other.KPosition != 0F) { - KPosition = other.KPosition; - } - if (other.KVelocity != 0F) { - KVelocity = other.KVelocity; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 13: { - LowerLimit = input.ReadFloat(); - break; - } - case 21: { - UpperLimit = input.ReadFloat(); - break; - } - case 29: { - KPosition = input.ReadFloat(); - break; - } - case 37: { - KVelocity = input.ReadFloat(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 13: { - LowerLimit = input.ReadFloat(); - break; - } - case 21: { - UpperLimit = input.ReadFloat(); - break; - } - case 29: { - KPosition = input.ReadFloat(); - break; - } - case 37: { - KVelocity = input.ReadFloat(); - break; - } - } - } - } - #endif - - } - - /// - ///* - /// DOF - representing the construction of a joint motion - /// - public sealed partial class DOF : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DOF()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.Joint.JointReflection.Descriptor.MessageTypes[7]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public DOF() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public DOF(DOF other) : this() { - name_ = other.name_; - axis_ = other.axis_ != null ? other.axis_.Clone() : null; - pivotDirection_ = other.pivotDirection_; - dynamics_ = other.dynamics_ != null ? other.dynamics_.Clone() : null; - limits_ = other.limits_ != null ? other.limits_.Clone() : null; - value_ = other.value_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public DOF Clone() { - return new DOF(this); - } - - /// Field number for the "name" field. - public const int NameFieldNumber = 1; - private string name_ = ""; - /// - //// In case you want to name this degree of freedom - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Name { - get { return name_; } - set { - name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "axis" field. - public const int AxisFieldNumber = 2; - private global::Mirabuf.Vector3 axis_; - /// - //// Axis the degree of freedom is pivoting by - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Vector3 Axis { - get { return axis_; } - set { - axis_ = value; - } - } - - /// Field number for the "pivotDirection" field. - public const int PivotDirectionFieldNumber = 3; - private global::Mirabuf.Axis pivotDirection_ = global::Mirabuf.Axis.X; - /// - //// Direction the axis vector is offset from - this has an incorrect naming scheme - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Axis PivotDirection { - get { return pivotDirection_; } - set { - pivotDirection_ = value; - } - } - - /// Field number for the "dynamics" field. - public const int DynamicsFieldNumber = 4; - private global::Mirabuf.Joint.Dynamics dynamics_; - /// - //// Dynamic properties of this joint pivot - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Joint.Dynamics Dynamics { - get { return dynamics_; } - set { - dynamics_ = value; - } - } - - /// Field number for the "limits" field. - public const int LimitsFieldNumber = 5; - private global::Mirabuf.Joint.Limits limits_; - /// - //// Limits of this freedom - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Joint.Limits Limits { - get { return limits_; } - set { - limits_ = value; - } - } - - /// Field number for the "value" field. - public const int ValueFieldNumber = 6; - private float value_; - /// - //// Current value of the DOF - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float Value { - get { return value_; } - set { - value_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as DOF); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(DOF other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Name != other.Name) return false; - if (!object.Equals(Axis, other.Axis)) return false; - if (PivotDirection != other.PivotDirection) return false; - if (!object.Equals(Dynamics, other.Dynamics)) return false; - if (!object.Equals(Limits, other.Limits)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Value, other.Value)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (Name.Length != 0) hash ^= Name.GetHashCode(); - if (axis_ != null) hash ^= Axis.GetHashCode(); - if (PivotDirection != global::Mirabuf.Axis.X) hash ^= PivotDirection.GetHashCode(); - if (dynamics_ != null) hash ^= Dynamics.GetHashCode(); - if (limits_ != null) hash ^= Limits.GetHashCode(); - if (Value != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Value); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Name.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Name); - } - if (axis_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Axis); - } - if (PivotDirection != global::Mirabuf.Axis.X) { - output.WriteRawTag(24); - output.WriteEnum((int) PivotDirection); - } - if (dynamics_ != null) { - output.WriteRawTag(34); - output.WriteMessage(Dynamics); - } - if (limits_ != null) { - output.WriteRawTag(42); - output.WriteMessage(Limits); - } - if (Value != 0F) { - output.WriteRawTag(53); - output.WriteFloat(Value); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Name.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Name); - } - if (axis_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Axis); - } - if (PivotDirection != global::Mirabuf.Axis.X) { - output.WriteRawTag(24); - output.WriteEnum((int) PivotDirection); - } - if (dynamics_ != null) { - output.WriteRawTag(34); - output.WriteMessage(Dynamics); - } - if (limits_ != null) { - output.WriteRawTag(42); - output.WriteMessage(Limits); - } - if (Value != 0F) { - output.WriteRawTag(53); - output.WriteFloat(Value); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (Name.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); - } - if (axis_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Axis); - } - if (PivotDirection != global::Mirabuf.Axis.X) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) PivotDirection); - } - if (dynamics_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Dynamics); - } - if (limits_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Limits); - } - if (Value != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(DOF other) { - if (other == null) { - return; - } - if (other.Name.Length != 0) { - Name = other.Name; - } - if (other.axis_ != null) { - if (axis_ == null) { - Axis = new global::Mirabuf.Vector3(); - } - Axis.MergeFrom(other.Axis); - } - if (other.PivotDirection != global::Mirabuf.Axis.X) { - PivotDirection = other.PivotDirection; - } - if (other.dynamics_ != null) { - if (dynamics_ == null) { - Dynamics = new global::Mirabuf.Joint.Dynamics(); - } - Dynamics.MergeFrom(other.Dynamics); - } - if (other.limits_ != null) { - if (limits_ == null) { - Limits = new global::Mirabuf.Joint.Limits(); - } - Limits.MergeFrom(other.Limits); - } - if (other.Value != 0F) { - Value = other.Value; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - if (axis_ == null) { - Axis = new global::Mirabuf.Vector3(); - } - input.ReadMessage(Axis); - break; - } - case 24: { - PivotDirection = (global::Mirabuf.Axis) input.ReadEnum(); - break; - } - case 34: { - if (dynamics_ == null) { - Dynamics = new global::Mirabuf.Joint.Dynamics(); - } - input.ReadMessage(Dynamics); - break; - } - case 42: { - if (limits_ == null) { - Limits = new global::Mirabuf.Joint.Limits(); - } - input.ReadMessage(Limits); - break; - } - case 53: { - Value = input.ReadFloat(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - if (axis_ == null) { - Axis = new global::Mirabuf.Vector3(); - } - input.ReadMessage(Axis); - break; - } - case 24: { - PivotDirection = (global::Mirabuf.Axis) input.ReadEnum(); - break; - } - case 34: { - if (dynamics_ == null) { - Dynamics = new global::Mirabuf.Joint.Dynamics(); - } - input.ReadMessage(Dynamics); - break; - } - case 42: { - if (limits_ == null) { - Limits = new global::Mirabuf.Joint.Limits(); - } - input.ReadMessage(Limits); - break; - } - case 53: { - Value = input.ReadFloat(); - break; - } - } - } - } - #endif - - } - - /// - ///* - /// CustomJoint is a joint with N degrees of freedom specified. - /// There should be input validation to handle max freedom case. - /// - public sealed partial class CustomJoint : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CustomJoint()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.Joint.JointReflection.Descriptor.MessageTypes[8]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public CustomJoint() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public CustomJoint(CustomJoint other) : this() { - dofs_ = other.dofs_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public CustomJoint Clone() { - return new CustomJoint(this); - } - - /// Field number for the "dofs" field. - public const int DofsFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_dofs_codec - = pb::FieldCodec.ForMessage(10, global::Mirabuf.Joint.DOF.Parser); - private readonly pbc::RepeatedField dofs_ = new pbc::RepeatedField(); - /// - //// A list of degrees of freedom that the joint can contain - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Dofs { - get { return dofs_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as CustomJoint); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(CustomJoint other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!dofs_.Equals(other.dofs_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - hash ^= dofs_.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - dofs_.WriteTo(output, _repeated_dofs_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - dofs_.WriteTo(ref output, _repeated_dofs_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - size += dofs_.CalculateSize(_repeated_dofs_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(CustomJoint other) { - if (other == null) { - return; - } - dofs_.Add(other.dofs_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - dofs_.AddEntriesFrom(input, _repeated_dofs_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - dofs_.AddEntriesFrom(ref input, _repeated_dofs_codec); - break; - } - } - } - } - #endif - - } - - /// - ///* - /// RotationalJoint describes a joint with rotational translation. - /// This is the exact same as prismatic for now. - /// - public sealed partial class RotationalJoint : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RotationalJoint()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.Joint.JointReflection.Descriptor.MessageTypes[9]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public RotationalJoint() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public RotationalJoint(RotationalJoint other) : this() { - rotationalFreedom_ = other.rotationalFreedom_ != null ? other.rotationalFreedom_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public RotationalJoint Clone() { - return new RotationalJoint(this); - } - - /// Field number for the "rotational_freedom" field. - public const int RotationalFreedomFieldNumber = 1; - private global::Mirabuf.Joint.DOF rotationalFreedom_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Joint.DOF RotationalFreedom { - get { return rotationalFreedom_; } - set { - rotationalFreedom_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as RotationalJoint); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(RotationalJoint other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(RotationalFreedom, other.RotationalFreedom)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (rotationalFreedom_ != null) hash ^= RotationalFreedom.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (rotationalFreedom_ != null) { - output.WriteRawTag(10); - output.WriteMessage(RotationalFreedom); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (rotationalFreedom_ != null) { - output.WriteRawTag(10); - output.WriteMessage(RotationalFreedom); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (rotationalFreedom_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(RotationalFreedom); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(RotationalJoint other) { - if (other == null) { - return; - } - if (other.rotationalFreedom_ != null) { - if (rotationalFreedom_ == null) { - RotationalFreedom = new global::Mirabuf.Joint.DOF(); - } - RotationalFreedom.MergeFrom(other.RotationalFreedom); - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - if (rotationalFreedom_ == null) { - RotationalFreedom = new global::Mirabuf.Joint.DOF(); - } - input.ReadMessage(RotationalFreedom); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - if (rotationalFreedom_ == null) { - RotationalFreedom = new global::Mirabuf.Joint.DOF(); - } - input.ReadMessage(RotationalFreedom); - break; - } - } - } - } - #endif - - } - - public sealed partial class BallJoint : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BallJoint()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.Joint.JointReflection.Descriptor.MessageTypes[10]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public BallJoint() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public BallJoint(BallJoint other) : this() { - yaw_ = other.yaw_ != null ? other.yaw_.Clone() : null; - pitch_ = other.pitch_ != null ? other.pitch_.Clone() : null; - rotation_ = other.rotation_ != null ? other.rotation_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public BallJoint Clone() { - return new BallJoint(this); - } - - /// Field number for the "yaw" field. - public const int YawFieldNumber = 1; - private global::Mirabuf.Joint.DOF yaw_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Joint.DOF Yaw { - get { return yaw_; } - set { - yaw_ = value; - } - } - - /// Field number for the "pitch" field. - public const int PitchFieldNumber = 2; - private global::Mirabuf.Joint.DOF pitch_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Joint.DOF Pitch { - get { return pitch_; } - set { - pitch_ = value; - } - } - - /// Field number for the "rotation" field. - public const int RotationFieldNumber = 3; - private global::Mirabuf.Joint.DOF rotation_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Joint.DOF Rotation { - get { return rotation_; } - set { - rotation_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as BallJoint); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(BallJoint other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(Yaw, other.Yaw)) return false; - if (!object.Equals(Pitch, other.Pitch)) return false; - if (!object.Equals(Rotation, other.Rotation)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (yaw_ != null) hash ^= Yaw.GetHashCode(); - if (pitch_ != null) hash ^= Pitch.GetHashCode(); - if (rotation_ != null) hash ^= Rotation.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (yaw_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Yaw); - } - if (pitch_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Pitch); - } - if (rotation_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Rotation); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (yaw_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Yaw); - } - if (pitch_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Pitch); - } - if (rotation_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Rotation); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (yaw_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Yaw); - } - if (pitch_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Pitch); - } - if (rotation_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Rotation); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(BallJoint other) { - if (other == null) { - return; - } - if (other.yaw_ != null) { - if (yaw_ == null) { - Yaw = new global::Mirabuf.Joint.DOF(); - } - Yaw.MergeFrom(other.Yaw); - } - if (other.pitch_ != null) { - if (pitch_ == null) { - Pitch = new global::Mirabuf.Joint.DOF(); - } - Pitch.MergeFrom(other.Pitch); - } - if (other.rotation_ != null) { - if (rotation_ == null) { - Rotation = new global::Mirabuf.Joint.DOF(); - } - Rotation.MergeFrom(other.Rotation); - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - if (yaw_ == null) { - Yaw = new global::Mirabuf.Joint.DOF(); - } - input.ReadMessage(Yaw); - break; - } - case 18: { - if (pitch_ == null) { - Pitch = new global::Mirabuf.Joint.DOF(); - } - input.ReadMessage(Pitch); - break; - } - case 26: { - if (rotation_ == null) { - Rotation = new global::Mirabuf.Joint.DOF(); - } - input.ReadMessage(Rotation); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - if (yaw_ == null) { - Yaw = new global::Mirabuf.Joint.DOF(); - } - input.ReadMessage(Yaw); - break; - } - case 18: { - if (pitch_ == null) { - Pitch = new global::Mirabuf.Joint.DOF(); - } - input.ReadMessage(Pitch); - break; - } - case 26: { - if (rotation_ == null) { - Rotation = new global::Mirabuf.Joint.DOF(); - } - input.ReadMessage(Rotation); - break; - } - } - } - } - #endif - - } - - /// - ///* - /// Prismatic Joint describes a motion that translates the position in a single axis - /// - public sealed partial class PrismaticJoint : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PrismaticJoint()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.Joint.JointReflection.Descriptor.MessageTypes[11]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public PrismaticJoint() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public PrismaticJoint(PrismaticJoint other) : this() { - prismaticFreedom_ = other.prismaticFreedom_ != null ? other.prismaticFreedom_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public PrismaticJoint Clone() { - return new PrismaticJoint(this); - } - - /// Field number for the "prismatic_freedom" field. - public const int PrismaticFreedomFieldNumber = 1; - private global::Mirabuf.Joint.DOF prismaticFreedom_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Joint.DOF PrismaticFreedom { - get { return prismaticFreedom_; } - set { - prismaticFreedom_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as PrismaticJoint); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(PrismaticJoint other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(PrismaticFreedom, other.PrismaticFreedom)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (prismaticFreedom_ != null) hash ^= PrismaticFreedom.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (prismaticFreedom_ != null) { - output.WriteRawTag(10); - output.WriteMessage(PrismaticFreedom); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (prismaticFreedom_ != null) { - output.WriteRawTag(10); - output.WriteMessage(PrismaticFreedom); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (prismaticFreedom_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(PrismaticFreedom); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(PrismaticJoint other) { - if (other == null) { - return; - } - if (other.prismaticFreedom_ != null) { - if (prismaticFreedom_ == null) { - PrismaticFreedom = new global::Mirabuf.Joint.DOF(); - } - PrismaticFreedom.MergeFrom(other.PrismaticFreedom); - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - if (prismaticFreedom_ == null) { - PrismaticFreedom = new global::Mirabuf.Joint.DOF(); - } - input.ReadMessage(PrismaticFreedom); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - if (prismaticFreedom_ == null) { - PrismaticFreedom = new global::Mirabuf.Joint.DOF(); - } - input.ReadMessage(PrismaticFreedom); - break; - } - } - } - } - #endif - - } - - public sealed partial class RigidGroup : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RigidGroup()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.Joint.JointReflection.Descriptor.MessageTypes[12]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public RigidGroup() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public RigidGroup(RigidGroup other) : this() { - name_ = other.name_; - occurrences_ = other.occurrences_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public RigidGroup Clone() { - return new RigidGroup(this); - } - - /// Field number for the "name" field. - public const int NameFieldNumber = 1; - private string name_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Name { - get { return name_; } - set { - name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "occurrences" field. - public const int OccurrencesFieldNumber = 2; - private static readonly pb::FieldCodec _repeated_occurrences_codec - = pb::FieldCodec.ForString(18); - private readonly pbc::RepeatedField occurrences_ = new pbc::RepeatedField(); - /// - /// this could be the full path of the occurrence in order to make it easier to assembly them possibly - just parse on the unity side - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Occurrences { - get { return occurrences_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as RigidGroup); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(RigidGroup other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Name != other.Name) return false; - if(!occurrences_.Equals(other.occurrences_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (Name.Length != 0) hash ^= Name.GetHashCode(); - hash ^= occurrences_.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Name.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Name); - } - occurrences_.WriteTo(output, _repeated_occurrences_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Name.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Name); - } - occurrences_.WriteTo(ref output, _repeated_occurrences_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (Name.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); - } - size += occurrences_.CalculateSize(_repeated_occurrences_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(RigidGroup other) { - if (other == null) { - return; - } - if (other.Name.Length != 0) { - Name = other.Name; - } - occurrences_.Add(other.occurrences_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - occurrences_.AddEntriesFrom(input, _repeated_occurrences_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - occurrences_.AddEntriesFrom(ref input, _repeated_occurrences_codec); - break; - } - } - } - } - #endif - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/api/Mirabuf/Material.cs b/api/Mirabuf/Material.cs deleted file mode 100644 index e1a2732c15..0000000000 --- a/api/Mirabuf/Material.cs +++ /dev/null @@ -1,2228 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: material.proto -// -#pragma warning disable 1591, 0612, 3021, 8981 -#region Designer generated code - -using pb = global::Google.Protobuf; -using pbc = global::Google.Protobuf.Collections; -using pbr = global::Google.Protobuf.Reflection; -using scg = global::System.Collections.Generic; -namespace Mirabuf.Material { - - /// Holder for reflection information generated from material.proto - public static partial class MaterialReflection { - - #region Descriptor - /// File descriptor for material.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static MaterialReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "Cg5tYXRlcmlhbC5wcm90bxIQbWlyYWJ1Zi5tYXRlcmlhbBoLdHlwZXMucHJv", - "dG8i6gIKCU1hdGVyaWFscxIbCgRpbmZvGAEgASgLMg0ubWlyYWJ1Zi5JbmZv", - "Ek0KEXBoeXNpY2FsTWF0ZXJpYWxzGAIgAygLMjIubWlyYWJ1Zi5tYXRlcmlh", - "bC5NYXRlcmlhbHMuUGh5c2ljYWxNYXRlcmlhbHNFbnRyeRJBCgthcHBlYXJh", - "bmNlcxgDIAMoCzIsLm1pcmFidWYubWF0ZXJpYWwuTWF0ZXJpYWxzLkFwcGVh", - "cmFuY2VzRW50cnkaXAoWUGh5c2ljYWxNYXRlcmlhbHNFbnRyeRILCgNrZXkY", - "ASABKAkSMQoFdmFsdWUYAiABKAsyIi5taXJhYnVmLm1hdGVyaWFsLlBoeXNp", - "Y2FsTWF0ZXJpYWw6AjgBGlAKEEFwcGVhcmFuY2VzRW50cnkSCwoDa2V5GAEg", - "ASgJEisKBXZhbHVlGAIgASgLMhwubWlyYWJ1Zi5tYXRlcmlhbC5BcHBlYXJh", - "bmNlOgI4ASKAAQoKQXBwZWFyYW5jZRIbCgRpbmZvGAEgASgLMg0ubWlyYWJ1", - "Zi5JbmZvEh4KBmFsYmVkbxgCIAEoCzIOLm1pcmFidWYuQ29sb3ISEQoJcm91", - "Z2huZXNzGAMgASgBEhAKCG1ldGFsbGljGAQgASgBEhAKCHNwZWN1bGFyGAUg", - "ASgBIoIGChBQaHlzaWNhbE1hdGVyaWFsEhsKBGluZm8YASABKAsyDS5taXJh", - "YnVmLkluZm8SEwoLZGVzY3JpcHRpb24YAiABKAkSOwoHdGhlcm1hbBgDIAEo", - "CzIqLm1pcmFidWYubWF0ZXJpYWwuUGh5c2ljYWxNYXRlcmlhbC5UaGVybWFs", - "EkEKCm1lY2hhbmljYWwYBCABKAsyLS5taXJhYnVmLm1hdGVyaWFsLlBoeXNp", - "Y2FsTWF0ZXJpYWwuTWVjaGFuaWNhbBI9CghzdHJlbmd0aBgFIAEoCzIrLm1p", - "cmFidWYubWF0ZXJpYWwuUGh5c2ljYWxNYXRlcmlhbC5TdHJlbmd0aBIYChBk", - "eW5hbWljX2ZyaWN0aW9uGAYgASgCEhcKD3N0YXRpY19mcmljdGlvbhgHIAEo", - "AhITCgtyZXN0aXR1dGlvbhgIIAEoAhISCgpkZWZvcm1hYmxlGAkgASgIEkAK", - "B21hdFR5cGUYCiABKA4yLy5taXJhYnVmLm1hdGVyaWFsLlBoeXNpY2FsTWF0", - "ZXJpYWwuTWF0ZXJpYWxUeXBlGmUKB1RoZXJtYWwSHAoUdGhlcm1hbF9jb25k", - "dWN0aXZpdHkYASABKAISFQoNc3BlY2lmaWNfaGVhdBgCIAEoAhIlCh10aGVy", - "bWFsX2V4cGFuc2lvbl9jb2VmZmljaWVudBgDIAEoAhp3CgpNZWNoYW5pY2Fs", - "EhEKCXlvdW5nX21vZBgBIAEoAhIVCg1wb2lzc29uX3JhdGlvGAIgASgCEhEK", - "CXNoZWFyX21vZBgDIAEoAhIPCgdkZW5zaXR5GAQgASgCEhsKE2RhbXBpbmdf", - "Y29lZmZpY2llbnQYBSABKAIaVwoIU3RyZW5ndGgSFgoOeWllbGRfc3RyZW5n", - "dGgYASABKAISGAoQdGVuc2lsZV9zdHJlbmd0aBgCIAEoAhIZChF0aGVybWFs", - "X3RyZWF0bWVudBgDIAEoCCImCgxNYXRlcmlhbFR5cGUSCQoFTUVUQUwQABIL", - "CgdQTEFTVElDEAFiBnByb3RvMw==")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { global::Mirabuf.TypesReflection.Descriptor, }, - new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.Material.Materials), global::Mirabuf.Material.Materials.Parser, new[]{ "Info", "PhysicalMaterials", "Appearances" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, null, }), - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.Material.Appearance), global::Mirabuf.Material.Appearance.Parser, new[]{ "Info", "Albedo", "Roughness", "Metallic", "Specular" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.Material.PhysicalMaterial), global::Mirabuf.Material.PhysicalMaterial.Parser, new[]{ "Info", "Description", "Thermal", "Mechanical", "Strength", "DynamicFriction", "StaticFriction", "Restitution", "Deformable", "MatType" }, null, new[]{ typeof(global::Mirabuf.Material.PhysicalMaterial.Types.MaterialType) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.Material.PhysicalMaterial.Types.Thermal), global::Mirabuf.Material.PhysicalMaterial.Types.Thermal.Parser, new[]{ "ThermalConductivity", "SpecificHeat", "ThermalExpansionCoefficient" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.Material.PhysicalMaterial.Types.Mechanical), global::Mirabuf.Material.PhysicalMaterial.Types.Mechanical.Parser, new[]{ "YoungMod", "PoissonRatio", "ShearMod", "Density", "DampingCoefficient" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.Material.PhysicalMaterial.Types.Strength), global::Mirabuf.Material.PhysicalMaterial.Types.Strength.Parser, new[]{ "YieldStrength", "TensileStrength", "ThermalTreatment" }, null, null, null, null)}) - })); - } - #endregion - - } - #region Messages - /// - ///* - /// Represents a File or Set of Materials with Appearances and Physical Data - /// - /// Can be Stored in AssemblyData - /// - public sealed partial class Materials : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Materials()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.Material.MaterialReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Materials() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Materials(Materials other) : this() { - info_ = other.info_ != null ? other.info_.Clone() : null; - physicalMaterials_ = other.physicalMaterials_.Clone(); - appearances_ = other.appearances_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Materials Clone() { - return new Materials(this); - } - - /// Field number for the "info" field. - public const int InfoFieldNumber = 1; - private global::Mirabuf.Info info_; - /// - //// Identifiable information (id, name, version) - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Info Info { - get { return info_; } - set { - info_ = value; - } - } - - /// Field number for the "physicalMaterials" field. - public const int PhysicalMaterialsFieldNumber = 2; - private static readonly pbc::MapField.Codec _map_physicalMaterials_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::Mirabuf.Material.PhysicalMaterial.Parser), 18); - private readonly pbc::MapField physicalMaterials_ = new pbc::MapField(); - /// - //// Map of Physical Materials - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::MapField PhysicalMaterials { - get { return physicalMaterials_; } - } - - /// Field number for the "appearances" field. - public const int AppearancesFieldNumber = 3; - private static readonly pbc::MapField.Codec _map_appearances_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::Mirabuf.Material.Appearance.Parser), 26); - private readonly pbc::MapField appearances_ = new pbc::MapField(); - /// - //// Map of Appearances that are purely visual - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::MapField Appearances { - get { return appearances_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Materials); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Materials other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(Info, other.Info)) return false; - if (!PhysicalMaterials.Equals(other.PhysicalMaterials)) return false; - if (!Appearances.Equals(other.Appearances)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (info_ != null) hash ^= Info.GetHashCode(); - hash ^= PhysicalMaterials.GetHashCode(); - hash ^= Appearances.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (info_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Info); - } - physicalMaterials_.WriteTo(output, _map_physicalMaterials_codec); - appearances_.WriteTo(output, _map_appearances_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (info_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Info); - } - physicalMaterials_.WriteTo(ref output, _map_physicalMaterials_codec); - appearances_.WriteTo(ref output, _map_appearances_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (info_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Info); - } - size += physicalMaterials_.CalculateSize(_map_physicalMaterials_codec); - size += appearances_.CalculateSize(_map_appearances_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Materials other) { - if (other == null) { - return; - } - if (other.info_ != null) { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - Info.MergeFrom(other.Info); - } - physicalMaterials_.MergeFrom(other.physicalMaterials_); - appearances_.MergeFrom(other.appearances_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - input.ReadMessage(Info); - break; - } - case 18: { - physicalMaterials_.AddEntriesFrom(input, _map_physicalMaterials_codec); - break; - } - case 26: { - appearances_.AddEntriesFrom(input, _map_appearances_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - input.ReadMessage(Info); - break; - } - case 18: { - physicalMaterials_.AddEntriesFrom(ref input, _map_physicalMaterials_codec); - break; - } - case 26: { - appearances_.AddEntriesFrom(ref input, _map_appearances_codec); - break; - } - } - } - } - #endif - - } - - /// - ///* - /// Contains information on how a object looks - /// Limited to just color for now - /// - public sealed partial class Appearance : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Appearance()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.Material.MaterialReflection.Descriptor.MessageTypes[1]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Appearance() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Appearance(Appearance other) : this() { - info_ = other.info_ != null ? other.info_.Clone() : null; - albedo_ = other.albedo_ != null ? other.albedo_.Clone() : null; - roughness_ = other.roughness_; - metallic_ = other.metallic_; - specular_ = other.specular_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Appearance Clone() { - return new Appearance(this); - } - - /// Field number for the "info" field. - public const int InfoFieldNumber = 1; - private global::Mirabuf.Info info_; - /// - //// Identfiable information (id, name, version) - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Info Info { - get { return info_; } - set { - info_ = value; - } - } - - /// Field number for the "albedo" field. - public const int AlbedoFieldNumber = 2; - private global::Mirabuf.Color albedo_; - /// - //// albedo map RGBA 0-255 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Color Albedo { - get { return albedo_; } - set { - albedo_ = value; - } - } - - /// Field number for the "roughness" field. - public const int RoughnessFieldNumber = 3; - private double roughness_; - /// - //// roughness value 0-1 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public double Roughness { - get { return roughness_; } - set { - roughness_ = value; - } - } - - /// Field number for the "metallic" field. - public const int MetallicFieldNumber = 4; - private double metallic_; - /// - //// metallic value 0-1 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public double Metallic { - get { return metallic_; } - set { - metallic_ = value; - } - } - - /// Field number for the "specular" field. - public const int SpecularFieldNumber = 5; - private double specular_; - /// - //// specular value 0-1 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public double Specular { - get { return specular_; } - set { - specular_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Appearance); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Appearance other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(Info, other.Info)) return false; - if (!object.Equals(Albedo, other.Albedo)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Roughness, other.Roughness)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Metallic, other.Metallic)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Specular, other.Specular)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (info_ != null) hash ^= Info.GetHashCode(); - if (albedo_ != null) hash ^= Albedo.GetHashCode(); - if (Roughness != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Roughness); - if (Metallic != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Metallic); - if (Specular != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Specular); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (info_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Info); - } - if (albedo_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Albedo); - } - if (Roughness != 0D) { - output.WriteRawTag(25); - output.WriteDouble(Roughness); - } - if (Metallic != 0D) { - output.WriteRawTag(33); - output.WriteDouble(Metallic); - } - if (Specular != 0D) { - output.WriteRawTag(41); - output.WriteDouble(Specular); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (info_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Info); - } - if (albedo_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Albedo); - } - if (Roughness != 0D) { - output.WriteRawTag(25); - output.WriteDouble(Roughness); - } - if (Metallic != 0D) { - output.WriteRawTag(33); - output.WriteDouble(Metallic); - } - if (Specular != 0D) { - output.WriteRawTag(41); - output.WriteDouble(Specular); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (info_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Info); - } - if (albedo_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Albedo); - } - if (Roughness != 0D) { - size += 1 + 8; - } - if (Metallic != 0D) { - size += 1 + 8; - } - if (Specular != 0D) { - size += 1 + 8; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Appearance other) { - if (other == null) { - return; - } - if (other.info_ != null) { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - Info.MergeFrom(other.Info); - } - if (other.albedo_ != null) { - if (albedo_ == null) { - Albedo = new global::Mirabuf.Color(); - } - Albedo.MergeFrom(other.Albedo); - } - if (other.Roughness != 0D) { - Roughness = other.Roughness; - } - if (other.Metallic != 0D) { - Metallic = other.Metallic; - } - if (other.Specular != 0D) { - Specular = other.Specular; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - input.ReadMessage(Info); - break; - } - case 18: { - if (albedo_ == null) { - Albedo = new global::Mirabuf.Color(); - } - input.ReadMessage(Albedo); - break; - } - case 25: { - Roughness = input.ReadDouble(); - break; - } - case 33: { - Metallic = input.ReadDouble(); - break; - } - case 41: { - Specular = input.ReadDouble(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - input.ReadMessage(Info); - break; - } - case 18: { - if (albedo_ == null) { - Albedo = new global::Mirabuf.Color(); - } - input.ReadMessage(Albedo); - break; - } - case 25: { - Roughness = input.ReadDouble(); - break; - } - case 33: { - Metallic = input.ReadDouble(); - break; - } - case 41: { - Specular = input.ReadDouble(); - break; - } - } - } - } - #endif - - } - - /// - ///* - /// Data to represent any given Physical Material - /// - public sealed partial class PhysicalMaterial : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PhysicalMaterial()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.Material.MaterialReflection.Descriptor.MessageTypes[2]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public PhysicalMaterial() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public PhysicalMaterial(PhysicalMaterial other) : this() { - info_ = other.info_ != null ? other.info_.Clone() : null; - description_ = other.description_; - thermal_ = other.thermal_ != null ? other.thermal_.Clone() : null; - mechanical_ = other.mechanical_ != null ? other.mechanical_.Clone() : null; - strength_ = other.strength_ != null ? other.strength_.Clone() : null; - dynamicFriction_ = other.dynamicFriction_; - staticFriction_ = other.staticFriction_; - restitution_ = other.restitution_; - deformable_ = other.deformable_; - matType_ = other.matType_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public PhysicalMaterial Clone() { - return new PhysicalMaterial(this); - } - - /// Field number for the "info" field. - public const int InfoFieldNumber = 1; - private global::Mirabuf.Info info_; - /// - //// Identifiable information (id, name, version, etc) - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Info Info { - get { return info_; } - set { - info_ = value; - } - } - - /// Field number for the "description" field. - public const int DescriptionFieldNumber = 2; - private string description_ = ""; - /// - //// short description of physical material - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Description { - get { return description_; } - set { - description_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "thermal" field. - public const int ThermalFieldNumber = 3; - private global::Mirabuf.Material.PhysicalMaterial.Types.Thermal thermal_; - /// - //// Thermal Physical properties of the model OPTIONAL - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Material.PhysicalMaterial.Types.Thermal Thermal { - get { return thermal_; } - set { - thermal_ = value; - } - } - - /// Field number for the "mechanical" field. - public const int MechanicalFieldNumber = 4; - private global::Mirabuf.Material.PhysicalMaterial.Types.Mechanical mechanical_; - /// - //// Mechanical properties of the model OPTIONAL - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Material.PhysicalMaterial.Types.Mechanical Mechanical { - get { return mechanical_; } - set { - mechanical_ = value; - } - } - - /// Field number for the "strength" field. - public const int StrengthFieldNumber = 5; - private global::Mirabuf.Material.PhysicalMaterial.Types.Strength strength_; - /// - //// Physical Strength properties of the model OPTIONAL - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Material.PhysicalMaterial.Types.Strength Strength { - get { return strength_; } - set { - strength_ = value; - } - } - - /// Field number for the "dynamic_friction" field. - public const int DynamicFrictionFieldNumber = 6; - private float dynamicFriction_; - /// - //// Frictional force for dampening - Interpolate (0-1) - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float DynamicFriction { - get { return dynamicFriction_; } - set { - dynamicFriction_ = value; - } - } - - /// Field number for the "static_friction" field. - public const int StaticFrictionFieldNumber = 7; - private float staticFriction_; - /// - //// Frictional force override at stop - Interpolate (0-1) - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float StaticFriction { - get { return staticFriction_; } - set { - staticFriction_ = value; - } - } - - /// Field number for the "restitution" field. - public const int RestitutionFieldNumber = 8; - private float restitution_; - /// - //// Restitution of the object - Interpolate (0-1) - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float Restitution { - get { return restitution_; } - set { - restitution_ = value; - } - } - - /// Field number for the "deformable" field. - public const int DeformableFieldNumber = 9; - private bool deformable_; - /// - //// should this object deform when encountering large forces - TODO: This needs a proper message and equation field - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Deformable { - get { return deformable_; } - set { - deformable_ = value; - } - } - - /// Field number for the "matType" field. - public const int MatTypeFieldNumber = 10; - private global::Mirabuf.Material.PhysicalMaterial.Types.MaterialType matType_ = global::Mirabuf.Material.PhysicalMaterial.Types.MaterialType.Metal; - /// - //// generic type to assign some default params - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Material.PhysicalMaterial.Types.MaterialType MatType { - get { return matType_; } - set { - matType_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as PhysicalMaterial); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(PhysicalMaterial other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(Info, other.Info)) return false; - if (Description != other.Description) return false; - if (!object.Equals(Thermal, other.Thermal)) return false; - if (!object.Equals(Mechanical, other.Mechanical)) return false; - if (!object.Equals(Strength, other.Strength)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(DynamicFriction, other.DynamicFriction)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(StaticFriction, other.StaticFriction)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Restitution, other.Restitution)) return false; - if (Deformable != other.Deformable) return false; - if (MatType != other.MatType) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (info_ != null) hash ^= Info.GetHashCode(); - if (Description.Length != 0) hash ^= Description.GetHashCode(); - if (thermal_ != null) hash ^= Thermal.GetHashCode(); - if (mechanical_ != null) hash ^= Mechanical.GetHashCode(); - if (strength_ != null) hash ^= Strength.GetHashCode(); - if (DynamicFriction != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(DynamicFriction); - if (StaticFriction != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(StaticFriction); - if (Restitution != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Restitution); - if (Deformable != false) hash ^= Deformable.GetHashCode(); - if (MatType != global::Mirabuf.Material.PhysicalMaterial.Types.MaterialType.Metal) hash ^= MatType.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (info_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Info); - } - if (Description.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Description); - } - if (thermal_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Thermal); - } - if (mechanical_ != null) { - output.WriteRawTag(34); - output.WriteMessage(Mechanical); - } - if (strength_ != null) { - output.WriteRawTag(42); - output.WriteMessage(Strength); - } - if (DynamicFriction != 0F) { - output.WriteRawTag(53); - output.WriteFloat(DynamicFriction); - } - if (StaticFriction != 0F) { - output.WriteRawTag(61); - output.WriteFloat(StaticFriction); - } - if (Restitution != 0F) { - output.WriteRawTag(69); - output.WriteFloat(Restitution); - } - if (Deformable != false) { - output.WriteRawTag(72); - output.WriteBool(Deformable); - } - if (MatType != global::Mirabuf.Material.PhysicalMaterial.Types.MaterialType.Metal) { - output.WriteRawTag(80); - output.WriteEnum((int) MatType); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (info_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Info); - } - if (Description.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Description); - } - if (thermal_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Thermal); - } - if (mechanical_ != null) { - output.WriteRawTag(34); - output.WriteMessage(Mechanical); - } - if (strength_ != null) { - output.WriteRawTag(42); - output.WriteMessage(Strength); - } - if (DynamicFriction != 0F) { - output.WriteRawTag(53); - output.WriteFloat(DynamicFriction); - } - if (StaticFriction != 0F) { - output.WriteRawTag(61); - output.WriteFloat(StaticFriction); - } - if (Restitution != 0F) { - output.WriteRawTag(69); - output.WriteFloat(Restitution); - } - if (Deformable != false) { - output.WriteRawTag(72); - output.WriteBool(Deformable); - } - if (MatType != global::Mirabuf.Material.PhysicalMaterial.Types.MaterialType.Metal) { - output.WriteRawTag(80); - output.WriteEnum((int) MatType); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (info_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Info); - } - if (Description.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Description); - } - if (thermal_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Thermal); - } - if (mechanical_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Mechanical); - } - if (strength_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Strength); - } - if (DynamicFriction != 0F) { - size += 1 + 4; - } - if (StaticFriction != 0F) { - size += 1 + 4; - } - if (Restitution != 0F) { - size += 1 + 4; - } - if (Deformable != false) { - size += 1 + 1; - } - if (MatType != global::Mirabuf.Material.PhysicalMaterial.Types.MaterialType.Metal) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) MatType); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(PhysicalMaterial other) { - if (other == null) { - return; - } - if (other.info_ != null) { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - Info.MergeFrom(other.Info); - } - if (other.Description.Length != 0) { - Description = other.Description; - } - if (other.thermal_ != null) { - if (thermal_ == null) { - Thermal = new global::Mirabuf.Material.PhysicalMaterial.Types.Thermal(); - } - Thermal.MergeFrom(other.Thermal); - } - if (other.mechanical_ != null) { - if (mechanical_ == null) { - Mechanical = new global::Mirabuf.Material.PhysicalMaterial.Types.Mechanical(); - } - Mechanical.MergeFrom(other.Mechanical); - } - if (other.strength_ != null) { - if (strength_ == null) { - Strength = new global::Mirabuf.Material.PhysicalMaterial.Types.Strength(); - } - Strength.MergeFrom(other.Strength); - } - if (other.DynamicFriction != 0F) { - DynamicFriction = other.DynamicFriction; - } - if (other.StaticFriction != 0F) { - StaticFriction = other.StaticFriction; - } - if (other.Restitution != 0F) { - Restitution = other.Restitution; - } - if (other.Deformable != false) { - Deformable = other.Deformable; - } - if (other.MatType != global::Mirabuf.Material.PhysicalMaterial.Types.MaterialType.Metal) { - MatType = other.MatType; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - input.ReadMessage(Info); - break; - } - case 18: { - Description = input.ReadString(); - break; - } - case 26: { - if (thermal_ == null) { - Thermal = new global::Mirabuf.Material.PhysicalMaterial.Types.Thermal(); - } - input.ReadMessage(Thermal); - break; - } - case 34: { - if (mechanical_ == null) { - Mechanical = new global::Mirabuf.Material.PhysicalMaterial.Types.Mechanical(); - } - input.ReadMessage(Mechanical); - break; - } - case 42: { - if (strength_ == null) { - Strength = new global::Mirabuf.Material.PhysicalMaterial.Types.Strength(); - } - input.ReadMessage(Strength); - break; - } - case 53: { - DynamicFriction = input.ReadFloat(); - break; - } - case 61: { - StaticFriction = input.ReadFloat(); - break; - } - case 69: { - Restitution = input.ReadFloat(); - break; - } - case 72: { - Deformable = input.ReadBool(); - break; - } - case 80: { - MatType = (global::Mirabuf.Material.PhysicalMaterial.Types.MaterialType) input.ReadEnum(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - input.ReadMessage(Info); - break; - } - case 18: { - Description = input.ReadString(); - break; - } - case 26: { - if (thermal_ == null) { - Thermal = new global::Mirabuf.Material.PhysicalMaterial.Types.Thermal(); - } - input.ReadMessage(Thermal); - break; - } - case 34: { - if (mechanical_ == null) { - Mechanical = new global::Mirabuf.Material.PhysicalMaterial.Types.Mechanical(); - } - input.ReadMessage(Mechanical); - break; - } - case 42: { - if (strength_ == null) { - Strength = new global::Mirabuf.Material.PhysicalMaterial.Types.Strength(); - } - input.ReadMessage(Strength); - break; - } - case 53: { - DynamicFriction = input.ReadFloat(); - break; - } - case 61: { - StaticFriction = input.ReadFloat(); - break; - } - case 69: { - Restitution = input.ReadFloat(); - break; - } - case 72: { - Deformable = input.ReadBool(); - break; - } - case 80: { - MatType = (global::Mirabuf.Material.PhysicalMaterial.Types.MaterialType) input.ReadEnum(); - break; - } - } - } - } - #endif - - #region Nested types - /// Container for nested types declared in the PhysicalMaterial message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static partial class Types { - public enum MaterialType { - [pbr::OriginalName("METAL")] Metal = 0, - [pbr::OriginalName("PLASTIC")] Plastic = 1, - } - - /// - ///* - /// Thermal Properties Set Definition for Simulation. - /// - public sealed partial class Thermal : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Thermal()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.Material.PhysicalMaterial.Descriptor.NestedTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Thermal() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Thermal(Thermal other) : this() { - thermalConductivity_ = other.thermalConductivity_; - specificHeat_ = other.specificHeat_; - thermalExpansionCoefficient_ = other.thermalExpansionCoefficient_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Thermal Clone() { - return new Thermal(this); - } - - /// Field number for the "thermal_conductivity" field. - public const int ThermalConductivityFieldNumber = 1; - private float thermalConductivity_; - /// - //// W/(m*K) - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float ThermalConductivity { - get { return thermalConductivity_; } - set { - thermalConductivity_ = value; - } - } - - /// Field number for the "specific_heat" field. - public const int SpecificHeatFieldNumber = 2; - private float specificHeat_; - /// - //// J/(g*C) - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float SpecificHeat { - get { return specificHeat_; } - set { - specificHeat_ = value; - } - } - - /// Field number for the "thermal_expansion_coefficient" field. - public const int ThermalExpansionCoefficientFieldNumber = 3; - private float thermalExpansionCoefficient_; - /// - //// um/(m*C) - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float ThermalExpansionCoefficient { - get { return thermalExpansionCoefficient_; } - set { - thermalExpansionCoefficient_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Thermal); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Thermal other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(ThermalConductivity, other.ThermalConductivity)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(SpecificHeat, other.SpecificHeat)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(ThermalExpansionCoefficient, other.ThermalExpansionCoefficient)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (ThermalConductivity != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(ThermalConductivity); - if (SpecificHeat != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(SpecificHeat); - if (ThermalExpansionCoefficient != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(ThermalExpansionCoefficient); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (ThermalConductivity != 0F) { - output.WriteRawTag(13); - output.WriteFloat(ThermalConductivity); - } - if (SpecificHeat != 0F) { - output.WriteRawTag(21); - output.WriteFloat(SpecificHeat); - } - if (ThermalExpansionCoefficient != 0F) { - output.WriteRawTag(29); - output.WriteFloat(ThermalExpansionCoefficient); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (ThermalConductivity != 0F) { - output.WriteRawTag(13); - output.WriteFloat(ThermalConductivity); - } - if (SpecificHeat != 0F) { - output.WriteRawTag(21); - output.WriteFloat(SpecificHeat); - } - if (ThermalExpansionCoefficient != 0F) { - output.WriteRawTag(29); - output.WriteFloat(ThermalExpansionCoefficient); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (ThermalConductivity != 0F) { - size += 1 + 4; - } - if (SpecificHeat != 0F) { - size += 1 + 4; - } - if (ThermalExpansionCoefficient != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Thermal other) { - if (other == null) { - return; - } - if (other.ThermalConductivity != 0F) { - ThermalConductivity = other.ThermalConductivity; - } - if (other.SpecificHeat != 0F) { - SpecificHeat = other.SpecificHeat; - } - if (other.ThermalExpansionCoefficient != 0F) { - ThermalExpansionCoefficient = other.ThermalExpansionCoefficient; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 13: { - ThermalConductivity = input.ReadFloat(); - break; - } - case 21: { - SpecificHeat = input.ReadFloat(); - break; - } - case 29: { - ThermalExpansionCoefficient = input.ReadFloat(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 13: { - ThermalConductivity = input.ReadFloat(); - break; - } - case 21: { - SpecificHeat = input.ReadFloat(); - break; - } - case 29: { - ThermalExpansionCoefficient = input.ReadFloat(); - break; - } - } - } - } - #endif - - } - - /// - ///* - /// Mechanical Properties Set Definition for Simulation. - /// - public sealed partial class Mechanical : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Mechanical()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.Material.PhysicalMaterial.Descriptor.NestedTypes[1]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Mechanical() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Mechanical(Mechanical other) : this() { - youngMod_ = other.youngMod_; - poissonRatio_ = other.poissonRatio_; - shearMod_ = other.shearMod_; - density_ = other.density_; - dampingCoefficient_ = other.dampingCoefficient_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Mechanical Clone() { - return new Mechanical(this); - } - - /// Field number for the "young_mod" field. - public const int YoungModFieldNumber = 1; - private float youngMod_; - /// - /// naming scheme changes here - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float YoungMod { - get { return youngMod_; } - set { - youngMod_ = value; - } - } - - /// Field number for the "poisson_ratio" field. - public const int PoissonRatioFieldNumber = 2; - private float poissonRatio_; - /// - //// ? - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float PoissonRatio { - get { return poissonRatio_; } - set { - poissonRatio_ = value; - } - } - - /// Field number for the "shear_mod" field. - public const int ShearModFieldNumber = 3; - private float shearMod_; - /// - //// MPa - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float ShearMod { - get { return shearMod_; } - set { - shearMod_ = value; - } - } - - /// Field number for the "density" field. - public const int DensityFieldNumber = 4; - private float density_; - /// - //// g/cm^3 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float Density { - get { return density_; } - set { - density_ = value; - } - } - - /// Field number for the "damping_coefficient" field. - public const int DampingCoefficientFieldNumber = 5; - private float dampingCoefficient_; - /// - //// ? - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float DampingCoefficient { - get { return dampingCoefficient_; } - set { - dampingCoefficient_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Mechanical); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Mechanical other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(YoungMod, other.YoungMod)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(PoissonRatio, other.PoissonRatio)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(ShearMod, other.ShearMod)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Density, other.Density)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(DampingCoefficient, other.DampingCoefficient)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (YoungMod != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(YoungMod); - if (PoissonRatio != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(PoissonRatio); - if (ShearMod != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(ShearMod); - if (Density != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Density); - if (DampingCoefficient != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(DampingCoefficient); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (YoungMod != 0F) { - output.WriteRawTag(13); - output.WriteFloat(YoungMod); - } - if (PoissonRatio != 0F) { - output.WriteRawTag(21); - output.WriteFloat(PoissonRatio); - } - if (ShearMod != 0F) { - output.WriteRawTag(29); - output.WriteFloat(ShearMod); - } - if (Density != 0F) { - output.WriteRawTag(37); - output.WriteFloat(Density); - } - if (DampingCoefficient != 0F) { - output.WriteRawTag(45); - output.WriteFloat(DampingCoefficient); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (YoungMod != 0F) { - output.WriteRawTag(13); - output.WriteFloat(YoungMod); - } - if (PoissonRatio != 0F) { - output.WriteRawTag(21); - output.WriteFloat(PoissonRatio); - } - if (ShearMod != 0F) { - output.WriteRawTag(29); - output.WriteFloat(ShearMod); - } - if (Density != 0F) { - output.WriteRawTag(37); - output.WriteFloat(Density); - } - if (DampingCoefficient != 0F) { - output.WriteRawTag(45); - output.WriteFloat(DampingCoefficient); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (YoungMod != 0F) { - size += 1 + 4; - } - if (PoissonRatio != 0F) { - size += 1 + 4; - } - if (ShearMod != 0F) { - size += 1 + 4; - } - if (Density != 0F) { - size += 1 + 4; - } - if (DampingCoefficient != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Mechanical other) { - if (other == null) { - return; - } - if (other.YoungMod != 0F) { - YoungMod = other.YoungMod; - } - if (other.PoissonRatio != 0F) { - PoissonRatio = other.PoissonRatio; - } - if (other.ShearMod != 0F) { - ShearMod = other.ShearMod; - } - if (other.Density != 0F) { - Density = other.Density; - } - if (other.DampingCoefficient != 0F) { - DampingCoefficient = other.DampingCoefficient; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 13: { - YoungMod = input.ReadFloat(); - break; - } - case 21: { - PoissonRatio = input.ReadFloat(); - break; - } - case 29: { - ShearMod = input.ReadFloat(); - break; - } - case 37: { - Density = input.ReadFloat(); - break; - } - case 45: { - DampingCoefficient = input.ReadFloat(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 13: { - YoungMod = input.ReadFloat(); - break; - } - case 21: { - PoissonRatio = input.ReadFloat(); - break; - } - case 29: { - ShearMod = input.ReadFloat(); - break; - } - case 37: { - Density = input.ReadFloat(); - break; - } - case 45: { - DampingCoefficient = input.ReadFloat(); - break; - } - } - } - } - #endif - - } - - /// - ///* - /// Strength Properties Set Definition for Simulation. - /// - public sealed partial class Strength : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Strength()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.Material.PhysicalMaterial.Descriptor.NestedTypes[2]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Strength() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Strength(Strength other) : this() { - yieldStrength_ = other.yieldStrength_; - tensileStrength_ = other.tensileStrength_; - thermalTreatment_ = other.thermalTreatment_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Strength Clone() { - return new Strength(this); - } - - /// Field number for the "yield_strength" field. - public const int YieldStrengthFieldNumber = 1; - private float yieldStrength_; - /// - //// MPa - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float YieldStrength { - get { return yieldStrength_; } - set { - yieldStrength_ = value; - } - } - - /// Field number for the "tensile_strength" field. - public const int TensileStrengthFieldNumber = 2; - private float tensileStrength_; - /// - //// MPa - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float TensileStrength { - get { return tensileStrength_; } - set { - tensileStrength_ = value; - } - } - - /// Field number for the "thermal_treatment" field. - public const int ThermalTreatmentFieldNumber = 3; - private bool thermalTreatment_; - /// - //// yes / no - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool ThermalTreatment { - get { return thermalTreatment_; } - set { - thermalTreatment_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Strength); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Strength other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(YieldStrength, other.YieldStrength)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(TensileStrength, other.TensileStrength)) return false; - if (ThermalTreatment != other.ThermalTreatment) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (YieldStrength != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(YieldStrength); - if (TensileStrength != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(TensileStrength); - if (ThermalTreatment != false) hash ^= ThermalTreatment.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (YieldStrength != 0F) { - output.WriteRawTag(13); - output.WriteFloat(YieldStrength); - } - if (TensileStrength != 0F) { - output.WriteRawTag(21); - output.WriteFloat(TensileStrength); - } - if (ThermalTreatment != false) { - output.WriteRawTag(24); - output.WriteBool(ThermalTreatment); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (YieldStrength != 0F) { - output.WriteRawTag(13); - output.WriteFloat(YieldStrength); - } - if (TensileStrength != 0F) { - output.WriteRawTag(21); - output.WriteFloat(TensileStrength); - } - if (ThermalTreatment != false) { - output.WriteRawTag(24); - output.WriteBool(ThermalTreatment); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (YieldStrength != 0F) { - size += 1 + 4; - } - if (TensileStrength != 0F) { - size += 1 + 4; - } - if (ThermalTreatment != false) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Strength other) { - if (other == null) { - return; - } - if (other.YieldStrength != 0F) { - YieldStrength = other.YieldStrength; - } - if (other.TensileStrength != 0F) { - TensileStrength = other.TensileStrength; - } - if (other.ThermalTreatment != false) { - ThermalTreatment = other.ThermalTreatment; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 13: { - YieldStrength = input.ReadFloat(); - break; - } - case 21: { - TensileStrength = input.ReadFloat(); - break; - } - case 24: { - ThermalTreatment = input.ReadBool(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 13: { - YieldStrength = input.ReadFloat(); - break; - } - case 21: { - TensileStrength = input.ReadFloat(); - break; - } - case 24: { - ThermalTreatment = input.ReadBool(); - break; - } - } - } - } - #endif - - } - - } - #endregion - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/api/Mirabuf/Motor.cs b/api/Mirabuf/Motor.cs deleted file mode 100644 index f753157c5d..0000000000 --- a/api/Mirabuf/Motor.cs +++ /dev/null @@ -1,1596 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: motor.proto -// -#pragma warning disable 1591, 0612, 3021, 8981 -#region Designer generated code - -using pb = global::Google.Protobuf; -using pbc = global::Google.Protobuf.Collections; -using pbr = global::Google.Protobuf.Reflection; -using scg = global::System.Collections.Generic; -namespace Mirabuf.Motor { - - /// Holder for reflection information generated from motor.proto - public static partial class MotorReflection { - - #region Descriptor - /// File descriptor for motor.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static MotorReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "Cgttb3Rvci5wcm90bxINbWlyYWJ1Zi5tb3RvchoLdHlwZXMucHJvdG8imAEK", - "BU1vdG9yEhsKBGluZm8YASABKAsyDS5taXJhYnVmLkluZm8SKgoIZGNfbW90", - "b3IYAiABKAsyFi5taXJhYnVmLm1vdG9yLkRDTW90b3JIABIyCgxzaW1wbGVf", - "bW90b3IYAyABKAsyGi5taXJhYnVmLm1vdG9yLlNpbXBsZU1vdG9ySABCDAoK", - "bW90b3JfdHlwZUoECAQQBiJTCgtTaW1wbGVNb3RvchIUCgxzdGFsbF90b3Jx", - "dWUYASABKAISFAoMbWF4X3ZlbG9jaXR5GAIgASgCEhgKEGJyYWtpbmdfY29u", - "c3RhbnQYAyABKAIinQMKB0RDTW90b3ISFQoNcmVmZXJlbmNlX3VybBgCIAEo", - "CRIXCg90b3JxdWVfY29uc3RhbnQYAyABKAISFAoMZW1mX2NvbnN0YW50GAQg", - "ASgCEhIKCnJlc2lzdGFuY2UYBSABKAISGgoSbWF4aW11bV9lZmZlY2llbmN5", - "GAYgASgNEhUKDW1heGltdW1fcG93ZXIYByABKA0SLQoKZHV0eV9jeWNsZRgI", - "IAEoDjIZLm1pcmFidWYubW90b3IuRHV0eUN5Y2xlcxIxCghhZHZhbmNlZBgQ", - "IAEoCzIfLm1pcmFidWYubW90b3IuRENNb3Rvci5BZHZhbmNlZBqWAQoIQWR2", - "YW5jZWQSFAoMZnJlZV9jdXJyZW50GAEgASgCEhIKCmZyZWVfc3BlZWQYAiAB", - "KA0SFQoNc3RhbGxfY3VycmVudBgDIAEoAhIUCgxzdGFsbF90b3JxdWUYBCAB", - "KAISFQoNaW5wdXRfdm9sdGFnZRgFIAEoDRIcChRyZXNpc3RhbmNlX3Zhcmlh", - "dGlvbhgHIAEoAkoECAEQAkoECAkQECpoCgpEdXR5Q3ljbGVzEhYKEkNPTlRJ", - "TlVPVVNfUlVOTklORxAAEg4KClNIT1JUX1RJTUUQARIZChVJTlRFUk1JVFRF", - "TlRfUEVSSU9ESUMQAhIXChNDT05USU5VT1VTX1BFUklPRElDEANiBnByb3Rv", - "Mw==")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { global::Mirabuf.TypesReflection.Descriptor, }, - new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Mirabuf.Motor.DutyCycles), }, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.Motor.Motor), global::Mirabuf.Motor.Motor.Parser, new[]{ "Info", "DcMotor", "SimpleMotor" }, new[]{ "MotorType" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.Motor.SimpleMotor), global::Mirabuf.Motor.SimpleMotor.Parser, new[]{ "StallTorque", "MaxVelocity", "BrakingConstant" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.Motor.DCMotor), global::Mirabuf.Motor.DCMotor.Parser, new[]{ "ReferenceUrl", "TorqueConstant", "EmfConstant", "Resistance", "MaximumEffeciency", "MaximumPower", "DutyCycle", "Advanced" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.Motor.DCMotor.Types.Advanced), global::Mirabuf.Motor.DCMotor.Types.Advanced.Parser, new[]{ "FreeCurrent", "FreeSpeed", "StallCurrent", "StallTorque", "InputVoltage", "ResistanceVariation" }, null, null, null, null)}) - })); - } - #endregion - - } - #region Enums - /// - ///* - /// Duty Cycles for electric motors - /// Affects the dynamic output of the motor - /// https://www.news.benevelli-group.com/index.php/en/88-what-motor-duty-cycle.html - /// These each have associated data we are not going to use right now - /// - public enum DutyCycles { - /// - //// S1 - /// - [pbr::OriginalName("CONTINUOUS_RUNNING")] ContinuousRunning = 0, - /// - //// S2 - /// - [pbr::OriginalName("SHORT_TIME")] ShortTime = 1, - /// - //// S3 - /// - [pbr::OriginalName("INTERMITTENT_PERIODIC")] IntermittentPeriodic = 2, - /// - //// S6 Continuous Operation with Periodic Duty - /// - [pbr::OriginalName("CONTINUOUS_PERIODIC")] ContinuousPeriodic = 3, - } - - #endregion - - #region Messages - /// - ///* - /// A Motor should determine the relationship between an input and joint motion - /// Could represent something like a DC Motor relationship - /// - public sealed partial class Motor : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Motor()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.Motor.MotorReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Motor() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Motor(Motor other) : this() { - info_ = other.info_ != null ? other.info_.Clone() : null; - switch (other.MotorTypeCase) { - case MotorTypeOneofCase.DcMotor: - DcMotor = other.DcMotor.Clone(); - break; - case MotorTypeOneofCase.SimpleMotor: - SimpleMotor = other.SimpleMotor.Clone(); - break; - } - - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Motor Clone() { - return new Motor(this); - } - - /// Field number for the "info" field. - public const int InfoFieldNumber = 1; - private global::Mirabuf.Info info_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Info Info { - get { return info_; } - set { - info_ = value; - } - } - - /// Field number for the "dc_motor" field. - public const int DcMotorFieldNumber = 2; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Motor.DCMotor DcMotor { - get { return motorTypeCase_ == MotorTypeOneofCase.DcMotor ? (global::Mirabuf.Motor.DCMotor) motorType_ : null; } - set { - motorType_ = value; - motorTypeCase_ = value == null ? MotorTypeOneofCase.None : MotorTypeOneofCase.DcMotor; - } - } - - /// Field number for the "simple_motor" field. - public const int SimpleMotorFieldNumber = 3; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Motor.SimpleMotor SimpleMotor { - get { return motorTypeCase_ == MotorTypeOneofCase.SimpleMotor ? (global::Mirabuf.Motor.SimpleMotor) motorType_ : null; } - set { - motorType_ = value; - motorTypeCase_ = value == null ? MotorTypeOneofCase.None : MotorTypeOneofCase.SimpleMotor; - } - } - - private object motorType_; - /// Enum of possible cases for the "motor_type" oneof. - public enum MotorTypeOneofCase { - None = 0, - DcMotor = 2, - SimpleMotor = 3, - } - private MotorTypeOneofCase motorTypeCase_ = MotorTypeOneofCase.None; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MotorTypeOneofCase MotorTypeCase { - get { return motorTypeCase_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void ClearMotorType() { - motorTypeCase_ = MotorTypeOneofCase.None; - motorType_ = null; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Motor); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Motor other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(Info, other.Info)) return false; - if (!object.Equals(DcMotor, other.DcMotor)) return false; - if (!object.Equals(SimpleMotor, other.SimpleMotor)) return false; - if (MotorTypeCase != other.MotorTypeCase) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (info_ != null) hash ^= Info.GetHashCode(); - if (motorTypeCase_ == MotorTypeOneofCase.DcMotor) hash ^= DcMotor.GetHashCode(); - if (motorTypeCase_ == MotorTypeOneofCase.SimpleMotor) hash ^= SimpleMotor.GetHashCode(); - hash ^= (int) motorTypeCase_; - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (info_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Info); - } - if (motorTypeCase_ == MotorTypeOneofCase.DcMotor) { - output.WriteRawTag(18); - output.WriteMessage(DcMotor); - } - if (motorTypeCase_ == MotorTypeOneofCase.SimpleMotor) { - output.WriteRawTag(26); - output.WriteMessage(SimpleMotor); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (info_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Info); - } - if (motorTypeCase_ == MotorTypeOneofCase.DcMotor) { - output.WriteRawTag(18); - output.WriteMessage(DcMotor); - } - if (motorTypeCase_ == MotorTypeOneofCase.SimpleMotor) { - output.WriteRawTag(26); - output.WriteMessage(SimpleMotor); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (info_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Info); - } - if (motorTypeCase_ == MotorTypeOneofCase.DcMotor) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(DcMotor); - } - if (motorTypeCase_ == MotorTypeOneofCase.SimpleMotor) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(SimpleMotor); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Motor other) { - if (other == null) { - return; - } - if (other.info_ != null) { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - Info.MergeFrom(other.Info); - } - switch (other.MotorTypeCase) { - case MotorTypeOneofCase.DcMotor: - if (DcMotor == null) { - DcMotor = new global::Mirabuf.Motor.DCMotor(); - } - DcMotor.MergeFrom(other.DcMotor); - break; - case MotorTypeOneofCase.SimpleMotor: - if (SimpleMotor == null) { - SimpleMotor = new global::Mirabuf.Motor.SimpleMotor(); - } - SimpleMotor.MergeFrom(other.SimpleMotor); - break; - } - - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - input.ReadMessage(Info); - break; - } - case 18: { - global::Mirabuf.Motor.DCMotor subBuilder = new global::Mirabuf.Motor.DCMotor(); - if (motorTypeCase_ == MotorTypeOneofCase.DcMotor) { - subBuilder.MergeFrom(DcMotor); - } - input.ReadMessage(subBuilder); - DcMotor = subBuilder; - break; - } - case 26: { - global::Mirabuf.Motor.SimpleMotor subBuilder = new global::Mirabuf.Motor.SimpleMotor(); - if (motorTypeCase_ == MotorTypeOneofCase.SimpleMotor) { - subBuilder.MergeFrom(SimpleMotor); - } - input.ReadMessage(subBuilder); - SimpleMotor = subBuilder; - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - input.ReadMessage(Info); - break; - } - case 18: { - global::Mirabuf.Motor.DCMotor subBuilder = new global::Mirabuf.Motor.DCMotor(); - if (motorTypeCase_ == MotorTypeOneofCase.DcMotor) { - subBuilder.MergeFrom(DcMotor); - } - input.ReadMessage(subBuilder); - DcMotor = subBuilder; - break; - } - case 26: { - global::Mirabuf.Motor.SimpleMotor subBuilder = new global::Mirabuf.Motor.SimpleMotor(); - if (motorTypeCase_ == MotorTypeOneofCase.SimpleMotor) { - subBuilder.MergeFrom(SimpleMotor); - } - input.ReadMessage(subBuilder); - SimpleMotor = subBuilder; - break; - } - } - } - } - #endif - - } - - /// - ///* - /// SimpleMotor Configuration - /// Very easy motor used to simulate joints without specifying a real motor - /// Can set braking_constant - stall_torque - and max_velocity - /// Assumes you are solving using a velocity constraint for a joint and not a acceleration constraint - /// - public sealed partial class SimpleMotor : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SimpleMotor()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.Motor.MotorReflection.Descriptor.MessageTypes[1]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public SimpleMotor() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public SimpleMotor(SimpleMotor other) : this() { - stallTorque_ = other.stallTorque_; - maxVelocity_ = other.maxVelocity_; - brakingConstant_ = other.brakingConstant_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public SimpleMotor Clone() { - return new SimpleMotor(this); - } - - /// Field number for the "stall_torque" field. - public const int StallTorqueFieldNumber = 1; - private float stallTorque_; - /// - //// Torque at 0 rpm with a inverse linear relationship to max_velocity - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float StallTorque { - get { return stallTorque_; } - set { - stallTorque_ = value; - } - } - - /// Field number for the "max_velocity" field. - public const int MaxVelocityFieldNumber = 2; - private float maxVelocity_; - /// - //// The target velocity in RPM, will use stall_torque relationship to reach each step - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float MaxVelocity { - get { return maxVelocity_; } - set { - maxVelocity_ = value; - } - } - - /// Field number for the "braking_constant" field. - public const int BrakingConstantFieldNumber = 3; - private float brakingConstant_; - /// - //// (Optional) 0 - 1, the relationship of stall_torque used to perserve the position of this motor - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float BrakingConstant { - get { return brakingConstant_; } - set { - brakingConstant_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as SimpleMotor); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(SimpleMotor other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(StallTorque, other.StallTorque)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaxVelocity, other.MaxVelocity)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(BrakingConstant, other.BrakingConstant)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (StallTorque != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(StallTorque); - if (MaxVelocity != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaxVelocity); - if (BrakingConstant != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(BrakingConstant); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (StallTorque != 0F) { - output.WriteRawTag(13); - output.WriteFloat(StallTorque); - } - if (MaxVelocity != 0F) { - output.WriteRawTag(21); - output.WriteFloat(MaxVelocity); - } - if (BrakingConstant != 0F) { - output.WriteRawTag(29); - output.WriteFloat(BrakingConstant); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (StallTorque != 0F) { - output.WriteRawTag(13); - output.WriteFloat(StallTorque); - } - if (MaxVelocity != 0F) { - output.WriteRawTag(21); - output.WriteFloat(MaxVelocity); - } - if (BrakingConstant != 0F) { - output.WriteRawTag(29); - output.WriteFloat(BrakingConstant); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (StallTorque != 0F) { - size += 1 + 4; - } - if (MaxVelocity != 0F) { - size += 1 + 4; - } - if (BrakingConstant != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(SimpleMotor other) { - if (other == null) { - return; - } - if (other.StallTorque != 0F) { - StallTorque = other.StallTorque; - } - if (other.MaxVelocity != 0F) { - MaxVelocity = other.MaxVelocity; - } - if (other.BrakingConstant != 0F) { - BrakingConstant = other.BrakingConstant; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 13: { - StallTorque = input.ReadFloat(); - break; - } - case 21: { - MaxVelocity = input.ReadFloat(); - break; - } - case 29: { - BrakingConstant = input.ReadFloat(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 13: { - StallTorque = input.ReadFloat(); - break; - } - case 21: { - MaxVelocity = input.ReadFloat(); - break; - } - case 29: { - BrakingConstant = input.ReadFloat(); - break; - } - } - } - } - #endif - - } - - /// - ///* - /// DCMotor Configuration - /// Parameters to simulate a DC Electric Motor - /// Still needs some more but overall they are most of the parameters we can use - /// - public sealed partial class DCMotor : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DCMotor()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.Motor.MotorReflection.Descriptor.MessageTypes[2]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public DCMotor() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public DCMotor(DCMotor other) : this() { - referenceUrl_ = other.referenceUrl_; - torqueConstant_ = other.torqueConstant_; - emfConstant_ = other.emfConstant_; - resistance_ = other.resistance_; - maximumEffeciency_ = other.maximumEffeciency_; - maximumPower_ = other.maximumPower_; - dutyCycle_ = other.dutyCycle_; - advanced_ = other.advanced_ != null ? other.advanced_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public DCMotor Clone() { - return new DCMotor(this); - } - - /// Field number for the "reference_url" field. - public const int ReferenceUrlFieldNumber = 2; - private string referenceUrl_ = ""; - /// - //// Reference for purchase page or spec sheet - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string ReferenceUrl { - get { return referenceUrl_; } - set { - referenceUrl_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "torque_constant" field. - public const int TorqueConstantFieldNumber = 3; - private float torqueConstant_; - /// - //// m-Nm/Amp - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float TorqueConstant { - get { return torqueConstant_; } - set { - torqueConstant_ = value; - } - } - - /// Field number for the "emf_constant" field. - public const int EmfConstantFieldNumber = 4; - private float emfConstant_; - /// - //// mV/rad/sec - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float EmfConstant { - get { return emfConstant_; } - set { - emfConstant_ = value; - } - } - - /// Field number for the "resistance" field. - public const int ResistanceFieldNumber = 5; - private float resistance_; - /// - //// Resistance of Motor - Optional if other values are known - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float Resistance { - get { return resistance_; } - set { - resistance_ = value; - } - } - - /// Field number for the "maximum_effeciency" field. - public const int MaximumEffeciencyFieldNumber = 6; - private uint maximumEffeciency_; - /// - //// measure in percentage of 100 - generally around 60 - measured under optimal load - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public uint MaximumEffeciency { - get { return maximumEffeciency_; } - set { - maximumEffeciency_ = value; - } - } - - /// Field number for the "maximum_power" field. - public const int MaximumPowerFieldNumber = 7; - private uint maximumPower_; - /// - //// measured in Watts - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public uint MaximumPower { - get { return maximumPower_; } - set { - maximumPower_ = value; - } - } - - /// Field number for the "duty_cycle" field. - public const int DutyCycleFieldNumber = 8; - private global::Mirabuf.Motor.DutyCycles dutyCycle_ = global::Mirabuf.Motor.DutyCycles.ContinuousRunning; - /// - //// Stated Duty Cycle of motor - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Motor.DutyCycles DutyCycle { - get { return dutyCycle_; } - set { - dutyCycle_ = value; - } - } - - /// Field number for the "advanced" field. - public const int AdvancedFieldNumber = 16; - private global::Mirabuf.Motor.DCMotor.Types.Advanced advanced_; - /// - //// Optional data that can give a better relationship to the simulation - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Motor.DCMotor.Types.Advanced Advanced { - get { return advanced_; } - set { - advanced_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as DCMotor); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(DCMotor other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (ReferenceUrl != other.ReferenceUrl) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(TorqueConstant, other.TorqueConstant)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(EmfConstant, other.EmfConstant)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Resistance, other.Resistance)) return false; - if (MaximumEffeciency != other.MaximumEffeciency) return false; - if (MaximumPower != other.MaximumPower) return false; - if (DutyCycle != other.DutyCycle) return false; - if (!object.Equals(Advanced, other.Advanced)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (ReferenceUrl.Length != 0) hash ^= ReferenceUrl.GetHashCode(); - if (TorqueConstant != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(TorqueConstant); - if (EmfConstant != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(EmfConstant); - if (Resistance != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Resistance); - if (MaximumEffeciency != 0) hash ^= MaximumEffeciency.GetHashCode(); - if (MaximumPower != 0) hash ^= MaximumPower.GetHashCode(); - if (DutyCycle != global::Mirabuf.Motor.DutyCycles.ContinuousRunning) hash ^= DutyCycle.GetHashCode(); - if (advanced_ != null) hash ^= Advanced.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (ReferenceUrl.Length != 0) { - output.WriteRawTag(18); - output.WriteString(ReferenceUrl); - } - if (TorqueConstant != 0F) { - output.WriteRawTag(29); - output.WriteFloat(TorqueConstant); - } - if (EmfConstant != 0F) { - output.WriteRawTag(37); - output.WriteFloat(EmfConstant); - } - if (Resistance != 0F) { - output.WriteRawTag(45); - output.WriteFloat(Resistance); - } - if (MaximumEffeciency != 0) { - output.WriteRawTag(48); - output.WriteUInt32(MaximumEffeciency); - } - if (MaximumPower != 0) { - output.WriteRawTag(56); - output.WriteUInt32(MaximumPower); - } - if (DutyCycle != global::Mirabuf.Motor.DutyCycles.ContinuousRunning) { - output.WriteRawTag(64); - output.WriteEnum((int) DutyCycle); - } - if (advanced_ != null) { - output.WriteRawTag(130, 1); - output.WriteMessage(Advanced); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (ReferenceUrl.Length != 0) { - output.WriteRawTag(18); - output.WriteString(ReferenceUrl); - } - if (TorqueConstant != 0F) { - output.WriteRawTag(29); - output.WriteFloat(TorqueConstant); - } - if (EmfConstant != 0F) { - output.WriteRawTag(37); - output.WriteFloat(EmfConstant); - } - if (Resistance != 0F) { - output.WriteRawTag(45); - output.WriteFloat(Resistance); - } - if (MaximumEffeciency != 0) { - output.WriteRawTag(48); - output.WriteUInt32(MaximumEffeciency); - } - if (MaximumPower != 0) { - output.WriteRawTag(56); - output.WriteUInt32(MaximumPower); - } - if (DutyCycle != global::Mirabuf.Motor.DutyCycles.ContinuousRunning) { - output.WriteRawTag(64); - output.WriteEnum((int) DutyCycle); - } - if (advanced_ != null) { - output.WriteRawTag(130, 1); - output.WriteMessage(Advanced); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (ReferenceUrl.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(ReferenceUrl); - } - if (TorqueConstant != 0F) { - size += 1 + 4; - } - if (EmfConstant != 0F) { - size += 1 + 4; - } - if (Resistance != 0F) { - size += 1 + 4; - } - if (MaximumEffeciency != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(MaximumEffeciency); - } - if (MaximumPower != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(MaximumPower); - } - if (DutyCycle != global::Mirabuf.Motor.DutyCycles.ContinuousRunning) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) DutyCycle); - } - if (advanced_ != null) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(Advanced); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(DCMotor other) { - if (other == null) { - return; - } - if (other.ReferenceUrl.Length != 0) { - ReferenceUrl = other.ReferenceUrl; - } - if (other.TorqueConstant != 0F) { - TorqueConstant = other.TorqueConstant; - } - if (other.EmfConstant != 0F) { - EmfConstant = other.EmfConstant; - } - if (other.Resistance != 0F) { - Resistance = other.Resistance; - } - if (other.MaximumEffeciency != 0) { - MaximumEffeciency = other.MaximumEffeciency; - } - if (other.MaximumPower != 0) { - MaximumPower = other.MaximumPower; - } - if (other.DutyCycle != global::Mirabuf.Motor.DutyCycles.ContinuousRunning) { - DutyCycle = other.DutyCycle; - } - if (other.advanced_ != null) { - if (advanced_ == null) { - Advanced = new global::Mirabuf.Motor.DCMotor.Types.Advanced(); - } - Advanced.MergeFrom(other.Advanced); - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 18: { - ReferenceUrl = input.ReadString(); - break; - } - case 29: { - TorqueConstant = input.ReadFloat(); - break; - } - case 37: { - EmfConstant = input.ReadFloat(); - break; - } - case 45: { - Resistance = input.ReadFloat(); - break; - } - case 48: { - MaximumEffeciency = input.ReadUInt32(); - break; - } - case 56: { - MaximumPower = input.ReadUInt32(); - break; - } - case 64: { - DutyCycle = (global::Mirabuf.Motor.DutyCycles) input.ReadEnum(); - break; - } - case 130: { - if (advanced_ == null) { - Advanced = new global::Mirabuf.Motor.DCMotor.Types.Advanced(); - } - input.ReadMessage(Advanced); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 18: { - ReferenceUrl = input.ReadString(); - break; - } - case 29: { - TorqueConstant = input.ReadFloat(); - break; - } - case 37: { - EmfConstant = input.ReadFloat(); - break; - } - case 45: { - Resistance = input.ReadFloat(); - break; - } - case 48: { - MaximumEffeciency = input.ReadUInt32(); - break; - } - case 56: { - MaximumPower = input.ReadUInt32(); - break; - } - case 64: { - DutyCycle = (global::Mirabuf.Motor.DutyCycles) input.ReadEnum(); - break; - } - case 130: { - if (advanced_ == null) { - Advanced = new global::Mirabuf.Motor.DCMotor.Types.Advanced(); - } - input.ReadMessage(Advanced); - break; - } - } - } - } - #endif - - #region Nested types - /// Container for nested types declared in the DCMotor message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static partial class Types { - /// - //// Information usually found on datasheet - /// - public sealed partial class Advanced : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Advanced()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.Motor.DCMotor.Descriptor.NestedTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Advanced() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Advanced(Advanced other) : this() { - freeCurrent_ = other.freeCurrent_; - freeSpeed_ = other.freeSpeed_; - stallCurrent_ = other.stallCurrent_; - stallTorque_ = other.stallTorque_; - inputVoltage_ = other.inputVoltage_; - resistanceVariation_ = other.resistanceVariation_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Advanced Clone() { - return new Advanced(this); - } - - /// Field number for the "free_current" field. - public const int FreeCurrentFieldNumber = 1; - private float freeCurrent_; - /// - //// measured in AMPs - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float FreeCurrent { - get { return freeCurrent_; } - set { - freeCurrent_ = value; - } - } - - /// Field number for the "free_speed" field. - public const int FreeSpeedFieldNumber = 2; - private uint freeSpeed_; - /// - //// measured in RPM - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public uint FreeSpeed { - get { return freeSpeed_; } - set { - freeSpeed_ = value; - } - } - - /// Field number for the "stall_current" field. - public const int StallCurrentFieldNumber = 3; - private float stallCurrent_; - /// - //// measure in AMPs - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float StallCurrent { - get { return stallCurrent_; } - set { - stallCurrent_ = value; - } - } - - /// Field number for the "stall_torque" field. - public const int StallTorqueFieldNumber = 4; - private float stallTorque_; - /// - //// measured in Nm - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float StallTorque { - get { return stallTorque_; } - set { - stallTorque_ = value; - } - } - - /// Field number for the "input_voltage" field. - public const int InputVoltageFieldNumber = 5; - private uint inputVoltage_; - /// - //// measured in Volts DC - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public uint InputVoltage { - get { return inputVoltage_; } - set { - inputVoltage_ = value; - } - } - - /// Field number for the "resistance_variation" field. - public const int ResistanceVariationFieldNumber = 7; - private float resistanceVariation_; - /// - //// between (K * (N / 4)) and (K * ((N-2) / 4)) where N is number of poles - leave at 0 if unknown - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float ResistanceVariation { - get { return resistanceVariation_; } - set { - resistanceVariation_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Advanced); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Advanced other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(FreeCurrent, other.FreeCurrent)) return false; - if (FreeSpeed != other.FreeSpeed) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(StallCurrent, other.StallCurrent)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(StallTorque, other.StallTorque)) return false; - if (InputVoltage != other.InputVoltage) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(ResistanceVariation, other.ResistanceVariation)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (FreeCurrent != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(FreeCurrent); - if (FreeSpeed != 0) hash ^= FreeSpeed.GetHashCode(); - if (StallCurrent != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(StallCurrent); - if (StallTorque != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(StallTorque); - if (InputVoltage != 0) hash ^= InputVoltage.GetHashCode(); - if (ResistanceVariation != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(ResistanceVariation); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (FreeCurrent != 0F) { - output.WriteRawTag(13); - output.WriteFloat(FreeCurrent); - } - if (FreeSpeed != 0) { - output.WriteRawTag(16); - output.WriteUInt32(FreeSpeed); - } - if (StallCurrent != 0F) { - output.WriteRawTag(29); - output.WriteFloat(StallCurrent); - } - if (StallTorque != 0F) { - output.WriteRawTag(37); - output.WriteFloat(StallTorque); - } - if (InputVoltage != 0) { - output.WriteRawTag(40); - output.WriteUInt32(InputVoltage); - } - if (ResistanceVariation != 0F) { - output.WriteRawTag(61); - output.WriteFloat(ResistanceVariation); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (FreeCurrent != 0F) { - output.WriteRawTag(13); - output.WriteFloat(FreeCurrent); - } - if (FreeSpeed != 0) { - output.WriteRawTag(16); - output.WriteUInt32(FreeSpeed); - } - if (StallCurrent != 0F) { - output.WriteRawTag(29); - output.WriteFloat(StallCurrent); - } - if (StallTorque != 0F) { - output.WriteRawTag(37); - output.WriteFloat(StallTorque); - } - if (InputVoltage != 0) { - output.WriteRawTag(40); - output.WriteUInt32(InputVoltage); - } - if (ResistanceVariation != 0F) { - output.WriteRawTag(61); - output.WriteFloat(ResistanceVariation); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (FreeCurrent != 0F) { - size += 1 + 4; - } - if (FreeSpeed != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(FreeSpeed); - } - if (StallCurrent != 0F) { - size += 1 + 4; - } - if (StallTorque != 0F) { - size += 1 + 4; - } - if (InputVoltage != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(InputVoltage); - } - if (ResistanceVariation != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Advanced other) { - if (other == null) { - return; - } - if (other.FreeCurrent != 0F) { - FreeCurrent = other.FreeCurrent; - } - if (other.FreeSpeed != 0) { - FreeSpeed = other.FreeSpeed; - } - if (other.StallCurrent != 0F) { - StallCurrent = other.StallCurrent; - } - if (other.StallTorque != 0F) { - StallTorque = other.StallTorque; - } - if (other.InputVoltage != 0) { - InputVoltage = other.InputVoltage; - } - if (other.ResistanceVariation != 0F) { - ResistanceVariation = other.ResistanceVariation; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 13: { - FreeCurrent = input.ReadFloat(); - break; - } - case 16: { - FreeSpeed = input.ReadUInt32(); - break; - } - case 29: { - StallCurrent = input.ReadFloat(); - break; - } - case 37: { - StallTorque = input.ReadFloat(); - break; - } - case 40: { - InputVoltage = input.ReadUInt32(); - break; - } - case 61: { - ResistanceVariation = input.ReadFloat(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 13: { - FreeCurrent = input.ReadFloat(); - break; - } - case 16: { - FreeSpeed = input.ReadUInt32(); - break; - } - case 29: { - StallCurrent = input.ReadFloat(); - break; - } - case 37: { - StallTorque = input.ReadFloat(); - break; - } - case 40: { - InputVoltage = input.ReadUInt32(); - break; - } - case 61: { - ResistanceVariation = input.ReadFloat(); - break; - } - } - } - } - #endif - - } - - } - #endregion - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/api/Mirabuf/Signal.cs b/api/Mirabuf/Signal.cs deleted file mode 100644 index 36cc49fb4f..0000000000 --- a/api/Mirabuf/Signal.cs +++ /dev/null @@ -1,689 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: signal.proto -// -#pragma warning disable 1591, 0612, 3021, 8981 -#region Designer generated code - -using pb = global::Google.Protobuf; -using pbc = global::Google.Protobuf.Collections; -using pbr = global::Google.Protobuf.Reflection; -using scg = global::System.Collections.Generic; -namespace Mirabuf.Signal { - - /// Holder for reflection information generated from signal.proto - public static partial class SignalReflection { - - #region Descriptor - /// File descriptor for signal.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static SignalReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CgxzaWduYWwucHJvdG8SDm1pcmFidWYuc2lnbmFsGgt0eXBlcy5wcm90byKs", - "AQoHU2lnbmFscxIbCgRpbmZvGAEgASgLMg0ubWlyYWJ1Zi5JbmZvEjoKCnNp", - "Z25hbF9tYXAYAiADKAsyJi5taXJhYnVmLnNpZ25hbC5TaWduYWxzLlNpZ25h", - "bE1hcEVudHJ5GkgKDlNpZ25hbE1hcEVudHJ5EgsKA2tleRgBIAEoCRIlCgV2", - "YWx1ZRgCIAEoCzIWLm1pcmFidWYuc2lnbmFsLlNpZ25hbDoCOAEiogEKBlNp", - "Z25hbBIbCgRpbmZvGAEgASgLMg0ubWlyYWJ1Zi5JbmZvEiIKAmlvGAIgASgO", - "MhYubWlyYWJ1Zi5zaWduYWwuSU9UeXBlEhMKC2N1c3RvbV90eXBlGAMgASgJ", - "EhEKCXNpZ25hbF9pZBgEIAEoDRIvCgtkZXZpY2VfdHlwZRgFIAEoDjIaLm1p", - "cmFidWYuc2lnbmFsLkRldmljZVR5cGUqHwoGSU9UeXBlEgkKBUlOUFVUEAAS", - "CgoGT1VUUFVUEAEqTwoKRGV2aWNlVHlwZRIHCgNQV00QABILCgdEaWdpdGFs", - "EAESCgoGQW5hbG9nEAISBwoDSTJDEAMSCgoGQ0FOQlVTEAQSCgoGQ1VTVE9N", - "EAViBnByb3RvMw==")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { global::Mirabuf.TypesReflection.Descriptor, }, - new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Mirabuf.Signal.IOType), typeof(global::Mirabuf.Signal.DeviceType), }, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.Signal.Signals), global::Mirabuf.Signal.Signals.Parser, new[]{ "Info", "SignalMap" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.Signal.Signal), global::Mirabuf.Signal.Signal.Parser, new[]{ "Info", "Io", "CustomType", "SignalId", "DeviceType" }, null, null, null, null) - })); - } - #endregion - - } - #region Enums - /// - ///* - /// IOType is a way to specify Input or Output. - /// - /// - public enum IOType { - /// - //// Input Signal - /// - [pbr::OriginalName("INPUT")] Input = 0, - /// - //// Output Signal - /// - [pbr::OriginalName("OUTPUT")] Output = 1, - } - - /// - ///* - /// DeviceType needs to be a type of device that has a supported connection - /// As well as a signal frmae but that can come later - /// - public enum DeviceType { - [pbr::OriginalName("PWM")] Pwm = 0, - [pbr::OriginalName("Digital")] Digital = 1, - [pbr::OriginalName("Analog")] Analog = 2, - [pbr::OriginalName("I2C")] I2C = 3, - [pbr::OriginalName("CANBUS")] Canbus = 4, - [pbr::OriginalName("CUSTOM")] Custom = 5, - } - - #endregion - - #region Messages - /// - ///* - /// Signals is a container for all of the potential signals. - /// - public sealed partial class Signals : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Signals()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.Signal.SignalReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Signals() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Signals(Signals other) : this() { - info_ = other.info_ != null ? other.info_.Clone() : null; - signalMap_ = other.signalMap_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Signals Clone() { - return new Signals(this); - } - - /// Field number for the "info" field. - public const int InfoFieldNumber = 1; - private global::Mirabuf.Info info_; - /// - //// Has identifiable data (id, name, version) - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Info Info { - get { return info_; } - set { - info_ = value; - } - } - - /// Field number for the "signal_map" field. - public const int SignalMapFieldNumber = 2; - private static readonly pbc::MapField.Codec _map_signalMap_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::Mirabuf.Signal.Signal.Parser), 18); - private readonly pbc::MapField signalMap_ = new pbc::MapField(); - /// - //// Contains a full collection of symbols - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::MapField SignalMap { - get { return signalMap_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Signals); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Signals other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(Info, other.Info)) return false; - if (!SignalMap.Equals(other.SignalMap)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (info_ != null) hash ^= Info.GetHashCode(); - hash ^= SignalMap.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (info_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Info); - } - signalMap_.WriteTo(output, _map_signalMap_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (info_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Info); - } - signalMap_.WriteTo(ref output, _map_signalMap_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (info_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Info); - } - size += signalMap_.CalculateSize(_map_signalMap_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Signals other) { - if (other == null) { - return; - } - if (other.info_ != null) { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - Info.MergeFrom(other.Info); - } - signalMap_.MergeFrom(other.signalMap_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - input.ReadMessage(Info); - break; - } - case 18: { - signalMap_.AddEntriesFrom(input, _map_signalMap_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - input.ReadMessage(Info); - break; - } - case 18: { - signalMap_.AddEntriesFrom(ref input, _map_signalMap_codec); - break; - } - } - } - } - #endif - - } - - /// - ///* - /// Signal is a way to define a controlling signal. - /// - /// TODO: Add Origin - /// TODO: Decide how this is linked to a exported object - /// - public sealed partial class Signal : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Signal()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.Signal.SignalReflection.Descriptor.MessageTypes[1]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Signal() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Signal(Signal other) : this() { - info_ = other.info_ != null ? other.info_.Clone() : null; - io_ = other.io_; - customType_ = other.customType_; - signalId_ = other.signalId_; - deviceType_ = other.deviceType_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Signal Clone() { - return new Signal(this); - } - - /// Field number for the "info" field. - public const int InfoFieldNumber = 1; - private global::Mirabuf.Info info_; - /// - //// Has identifiable data (id, name, version) - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Info Info { - get { return info_; } - set { - info_ = value; - } - } - - /// Field number for the "io" field. - public const int IoFieldNumber = 2; - private global::Mirabuf.Signal.IOType io_ = global::Mirabuf.Signal.IOType.Input; - /// - //// Is this a Input or Output - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Signal.IOType Io { - get { return io_; } - set { - io_ = value; - } - } - - /// Field number for the "custom_type" field. - public const int CustomTypeFieldNumber = 3; - private string customType_ = ""; - /// - //// The name of a custom input type that is not listed as a device type - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string CustomType { - get { return customType_; } - set { - customType_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "signal_id" field. - public const int SignalIdFieldNumber = 4; - private uint signalId_; - /// - //// ID for a given signal that exists... PWM 2, CANBUS 4 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public uint SignalId { - get { return signalId_; } - set { - signalId_ = value; - } - } - - /// Field number for the "device_type" field. - public const int DeviceTypeFieldNumber = 5; - private global::Mirabuf.Signal.DeviceType deviceType_ = global::Mirabuf.Signal.DeviceType.Pwm; - /// - //// Enum for device type that should always be set - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Signal.DeviceType DeviceType { - get { return deviceType_; } - set { - deviceType_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Signal); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Signal other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(Info, other.Info)) return false; - if (Io != other.Io) return false; - if (CustomType != other.CustomType) return false; - if (SignalId != other.SignalId) return false; - if (DeviceType != other.DeviceType) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (info_ != null) hash ^= Info.GetHashCode(); - if (Io != global::Mirabuf.Signal.IOType.Input) hash ^= Io.GetHashCode(); - if (CustomType.Length != 0) hash ^= CustomType.GetHashCode(); - if (SignalId != 0) hash ^= SignalId.GetHashCode(); - if (DeviceType != global::Mirabuf.Signal.DeviceType.Pwm) hash ^= DeviceType.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (info_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Info); - } - if (Io != global::Mirabuf.Signal.IOType.Input) { - output.WriteRawTag(16); - output.WriteEnum((int) Io); - } - if (CustomType.Length != 0) { - output.WriteRawTag(26); - output.WriteString(CustomType); - } - if (SignalId != 0) { - output.WriteRawTag(32); - output.WriteUInt32(SignalId); - } - if (DeviceType != global::Mirabuf.Signal.DeviceType.Pwm) { - output.WriteRawTag(40); - output.WriteEnum((int) DeviceType); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (info_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Info); - } - if (Io != global::Mirabuf.Signal.IOType.Input) { - output.WriteRawTag(16); - output.WriteEnum((int) Io); - } - if (CustomType.Length != 0) { - output.WriteRawTag(26); - output.WriteString(CustomType); - } - if (SignalId != 0) { - output.WriteRawTag(32); - output.WriteUInt32(SignalId); - } - if (DeviceType != global::Mirabuf.Signal.DeviceType.Pwm) { - output.WriteRawTag(40); - output.WriteEnum((int) DeviceType); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (info_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Info); - } - if (Io != global::Mirabuf.Signal.IOType.Input) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Io); - } - if (CustomType.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(CustomType); - } - if (SignalId != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(SignalId); - } - if (DeviceType != global::Mirabuf.Signal.DeviceType.Pwm) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) DeviceType); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Signal other) { - if (other == null) { - return; - } - if (other.info_ != null) { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - Info.MergeFrom(other.Info); - } - if (other.Io != global::Mirabuf.Signal.IOType.Input) { - Io = other.Io; - } - if (other.CustomType.Length != 0) { - CustomType = other.CustomType; - } - if (other.SignalId != 0) { - SignalId = other.SignalId; - } - if (other.DeviceType != global::Mirabuf.Signal.DeviceType.Pwm) { - DeviceType = other.DeviceType; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - input.ReadMessage(Info); - break; - } - case 16: { - Io = (global::Mirabuf.Signal.IOType) input.ReadEnum(); - break; - } - case 26: { - CustomType = input.ReadString(); - break; - } - case 32: { - SignalId = input.ReadUInt32(); - break; - } - case 40: { - DeviceType = (global::Mirabuf.Signal.DeviceType) input.ReadEnum(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - if (info_ == null) { - Info = new global::Mirabuf.Info(); - } - input.ReadMessage(Info); - break; - } - case 16: { - Io = (global::Mirabuf.Signal.IOType) input.ReadEnum(); - break; - } - case 26: { - CustomType = input.ReadString(); - break; - } - case 32: { - SignalId = input.ReadUInt32(); - break; - } - case 40: { - DeviceType = (global::Mirabuf.Signal.DeviceType) input.ReadEnum(); - break; - } - } - } - } - #endif - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/api/Mirabuf/Types.cs b/api/Mirabuf/Types.cs deleted file mode 100644 index 780ebc3278..0000000000 --- a/api/Mirabuf/Types.cs +++ /dev/null @@ -1,2488 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: types.proto -// -#pragma warning disable 1591, 0612, 3021, 8981 -#region Designer generated code - -using pb = global::Google.Protobuf; -using pbc = global::Google.Protobuf.Collections; -using pbr = global::Google.Protobuf.Reflection; -using scg = global::System.Collections.Generic; -namespace Mirabuf { - - /// Holder for reflection information generated from types.proto - public static partial class TypesReflection { - - #region Descriptor - /// File descriptor for types.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static TypesReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "Cgt0eXBlcy5wcm90bxIHbWlyYWJ1ZiJcCgROb2RlEg0KBXZhbHVlGAEgASgJ", - "Eh8KCGNoaWxkcmVuGAIgAygLMg0ubWlyYWJ1Zi5Ob2RlEiQKCXVzZXJfZGF0", - "YRgDIAEoCzIRLm1pcmFidWYuVXNlckRhdGEiLgoOR3JhcGhDb250YWluZXIS", - "HAoFbm9kZXMYASADKAsyDS5taXJhYnVmLk5vZGUiYgoIVXNlckRhdGESKQoE", - "ZGF0YRgBIAMoCzIbLm1pcmFidWYuVXNlckRhdGEuRGF0YUVudHJ5GisKCURh", - "dGFFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBIioKB1Zl", - "Y3RvcjMSCQoBeBgBIAEoAhIJCgF5GAIgASgCEgkKAXoYAyABKAIicAoSUGh5", - "c2ljYWxQcm9wZXJ0aWVzEg8KB2RlbnNpdHkYASABKAESDAoEbWFzcxgCIAEo", - "ARIOCgZ2b2x1bWUYAyABKAESDAoEYXJlYRgEIAEoARIdCgNjb20YBSABKAsy", - "EC5taXJhYnVmLlZlY3RvcjMiIwoJVHJhbnNmb3JtEhYKDnNwYXRpYWxfbWF0", - "cml4GAEgAygCIjMKBUNvbG9yEgkKAVIYASABKAUSCQoBRxgCIAEoBRIJCgFC", - "GAMgASgFEgkKAUEYBCABKAUiMwoESW5mbxIMCgRHVUlEGAEgASgJEgwKBG5h", - "bWUYAiABKAkSDwoHdmVyc2lvbhgDIAEoDSJgCglUaHVtYm5haWwSDQoFd2lk", - "dGgYASABKAUSDgoGaGVpZ2h0GAIgASgFEhEKCWV4dGVuc2lvbhgDIAEoCRIT", - "Cgt0cmFuc3BhcmVudBgEIAEoCBIMCgRkYXRhGAUgASgMKhsKBEF4aXMSBQoB", - "WBAAEgUKAVkQARIFCgFaEAJiBnByb3RvMw==")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { }, - new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Mirabuf.Axis), }, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.Node), global::Mirabuf.Node.Parser, new[]{ "Value", "Children", "UserData" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.GraphContainer), global::Mirabuf.GraphContainer.Parser, new[]{ "Nodes" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.UserData), global::Mirabuf.UserData.Parser, new[]{ "Data" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.Vector3), global::Mirabuf.Vector3.Parser, new[]{ "X", "Y", "Z" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.PhysicalProperties), global::Mirabuf.PhysicalProperties.Parser, new[]{ "Density", "Mass", "Volume", "Area", "Com" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.Transform), global::Mirabuf.Transform.Parser, new[]{ "SpatialMatrix" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.Color), global::Mirabuf.Color.Parser, new[]{ "R", "G", "B", "A" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.Info), global::Mirabuf.Info.Parser, new[]{ "GUID", "Name", "Version" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Mirabuf.Thumbnail), global::Mirabuf.Thumbnail.Parser, new[]{ "Width", "Height", "Extension", "Transparent", "Data" }, null, null, null, null) - })); - } - #endregion - - } - #region Enums - /// - /// Axis Enum - /// - public enum Axis { - [pbr::OriginalName("X")] X = 0, - [pbr::OriginalName("Y")] Y = 1, - [pbr::OriginalName("Z")] Z = 2, - } - - #endregion - - #region Messages - /// - /// Each proper object within the Graph - First one is Root - /// - public sealed partial class Node : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Node()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.TypesReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Node() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Node(Node other) : this() { - value_ = other.value_; - children_ = other.children_.Clone(); - userData_ = other.userData_ != null ? other.userData_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Node Clone() { - return new Node(this); - } - - /// Field number for the "value" field. - public const int ValueFieldNumber = 1; - private string value_ = ""; - /// - //// the reference ID for whatever kind of graph this is - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Value { - get { return value_; } - set { - value_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "children" field. - public const int ChildrenFieldNumber = 2; - private static readonly pb::FieldCodec _repeated_children_codec - = pb::FieldCodec.ForMessage(18, global::Mirabuf.Node.Parser); - private readonly pbc::RepeatedField children_ = new pbc::RepeatedField(); - /// - //// the children for the given leaf - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Children { - get { return children_; } - } - - /// Field number for the "user_data" field. - public const int UserDataFieldNumber = 3; - private global::Mirabuf.UserData userData_; - /// - //// other associated data that can be used - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.UserData UserData { - get { return userData_; } - set { - userData_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Node); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Node other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Value != other.Value) return false; - if(!children_.Equals(other.children_)) return false; - if (!object.Equals(UserData, other.UserData)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (Value.Length != 0) hash ^= Value.GetHashCode(); - hash ^= children_.GetHashCode(); - if (userData_ != null) hash ^= UserData.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Value.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Value); - } - children_.WriteTo(output, _repeated_children_codec); - if (userData_ != null) { - output.WriteRawTag(26); - output.WriteMessage(UserData); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Value.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Value); - } - children_.WriteTo(ref output, _repeated_children_codec); - if (userData_ != null) { - output.WriteRawTag(26); - output.WriteMessage(UserData); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (Value.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Value); - } - size += children_.CalculateSize(_repeated_children_codec); - if (userData_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(UserData); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Node other) { - if (other == null) { - return; - } - if (other.Value.Length != 0) { - Value = other.Value; - } - children_.Add(other.children_); - if (other.userData_ != null) { - if (userData_ == null) { - UserData = new global::Mirabuf.UserData(); - } - UserData.MergeFrom(other.UserData); - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Value = input.ReadString(); - break; - } - case 18: { - children_.AddEntriesFrom(input, _repeated_children_codec); - break; - } - case 26: { - if (userData_ == null) { - UserData = new global::Mirabuf.UserData(); - } - input.ReadMessage(UserData); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Value = input.ReadString(); - break; - } - case 18: { - children_.AddEntriesFrom(ref input, _repeated_children_codec); - break; - } - case 26: { - if (userData_ == null) { - UserData = new global::Mirabuf.UserData(); - } - input.ReadMessage(UserData); - break; - } - } - } - } - #endif - - } - - /// - /// Top level GraphContainer - /// Contains all Graph element roots within - /// - public sealed partial class GraphContainer : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GraphContainer()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.TypesReflection.Descriptor.MessageTypes[1]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public GraphContainer() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public GraphContainer(GraphContainer other) : this() { - nodes_ = other.nodes_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public GraphContainer Clone() { - return new GraphContainer(this); - } - - /// Field number for the "nodes" field. - public const int NodesFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_nodes_codec - = pb::FieldCodec.ForMessage(10, global::Mirabuf.Node.Parser); - private readonly pbc::RepeatedField nodes_ = new pbc::RepeatedField(); - /// - /// represents the root of each seperate assembly - most of the time 1 node - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField Nodes { - get { return nodes_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as GraphContainer); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(GraphContainer other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!nodes_.Equals(other.nodes_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - hash ^= nodes_.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - nodes_.WriteTo(output, _repeated_nodes_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - nodes_.WriteTo(ref output, _repeated_nodes_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - size += nodes_.CalculateSize(_repeated_nodes_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(GraphContainer other) { - if (other == null) { - return; - } - nodes_.Add(other.nodes_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - nodes_.AddEntriesFrom(input, _repeated_nodes_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - nodes_.AddEntriesFrom(ref input, _repeated_nodes_codec); - break; - } - } - } - } - #endif - - } - - /// - ///* - /// UserData - /// - /// Arbitrary data to append to a given message in map form - /// - public sealed partial class UserData : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new UserData()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.TypesReflection.Descriptor.MessageTypes[2]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public UserData() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public UserData(UserData other) : this() { - data_ = other.data_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public UserData Clone() { - return new UserData(this); - } - - /// Field number for the "data" field. - public const int DataFieldNumber = 1; - private static readonly pbc::MapField.Codec _map_data_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForString(18, ""), 10); - private readonly pbc::MapField data_ = new pbc::MapField(); - /// - //// e.g. data["wheel"] = "yes" - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::MapField Data { - get { return data_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as UserData); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(UserData other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!Data.Equals(other.Data)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - hash ^= Data.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - data_.WriteTo(output, _map_data_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - data_.WriteTo(ref output, _map_data_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - size += data_.CalculateSize(_map_data_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(UserData other) { - if (other == null) { - return; - } - data_.MergeFrom(other.data_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - data_.AddEntriesFrom(input, _map_data_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - data_.AddEntriesFrom(ref input, _map_data_codec); - break; - } - } - } - } - #endif - - } - - public sealed partial class Vector3 : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Vector3()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.TypesReflection.Descriptor.MessageTypes[3]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Vector3() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Vector3(Vector3 other) : this() { - x_ = other.x_; - y_ = other.y_; - z_ = other.z_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Vector3 Clone() { - return new Vector3(this); - } - - /// Field number for the "x" field. - public const int XFieldNumber = 1; - private float x_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float X { - get { return x_; } - set { - x_ = value; - } - } - - /// Field number for the "y" field. - public const int YFieldNumber = 2; - private float y_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float Y { - get { return y_; } - set { - y_ = value; - } - } - - /// Field number for the "z" field. - public const int ZFieldNumber = 3; - private float z_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float Z { - get { return z_; } - set { - z_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Vector3); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Vector3 other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(X, other.X)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Y, other.Y)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Z, other.Z)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (X != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(X); - if (Y != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Y); - if (Z != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Z); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (X != 0F) { - output.WriteRawTag(13); - output.WriteFloat(X); - } - if (Y != 0F) { - output.WriteRawTag(21); - output.WriteFloat(Y); - } - if (Z != 0F) { - output.WriteRawTag(29); - output.WriteFloat(Z); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (X != 0F) { - output.WriteRawTag(13); - output.WriteFloat(X); - } - if (Y != 0F) { - output.WriteRawTag(21); - output.WriteFloat(Y); - } - if (Z != 0F) { - output.WriteRawTag(29); - output.WriteFloat(Z); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (X != 0F) { - size += 1 + 4; - } - if (Y != 0F) { - size += 1 + 4; - } - if (Z != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Vector3 other) { - if (other == null) { - return; - } - if (other.X != 0F) { - X = other.X; - } - if (other.Y != 0F) { - Y = other.Y; - } - if (other.Z != 0F) { - Z = other.Z; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 13: { - X = input.ReadFloat(); - break; - } - case 21: { - Y = input.ReadFloat(); - break; - } - case 29: { - Z = input.ReadFloat(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 13: { - X = input.ReadFloat(); - break; - } - case 21: { - Y = input.ReadFloat(); - break; - } - case 29: { - Z = input.ReadFloat(); - break; - } - } - } - } - #endif - - } - - public sealed partial class PhysicalProperties : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PhysicalProperties()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.TypesReflection.Descriptor.MessageTypes[4]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public PhysicalProperties() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public PhysicalProperties(PhysicalProperties other) : this() { - density_ = other.density_; - mass_ = other.mass_; - volume_ = other.volume_; - area_ = other.area_; - com_ = other.com_ != null ? other.com_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public PhysicalProperties Clone() { - return new PhysicalProperties(this); - } - - /// Field number for the "density" field. - public const int DensityFieldNumber = 1; - private double density_; - /// - //// kg per cubic cm kg/(cm^3) - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public double Density { - get { return density_; } - set { - density_ = value; - } - } - - /// Field number for the "mass" field. - public const int MassFieldNumber = 2; - private double mass_; - /// - //// kg - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public double Mass { - get { return mass_; } - set { - mass_ = value; - } - } - - /// Field number for the "volume" field. - public const int VolumeFieldNumber = 3; - private double volume_; - /// - //// cm^3 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public double Volume { - get { return volume_; } - set { - volume_ = value; - } - } - - /// Field number for the "area" field. - public const int AreaFieldNumber = 4; - private double area_; - /// - //// cm^2 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public double Area { - get { return area_; } - set { - area_ = value; - } - } - - /// Field number for the "com" field. - public const int ComFieldNumber = 5; - private global::Mirabuf.Vector3 com_; - /// - //// non-negative? Vec3 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Mirabuf.Vector3 Com { - get { return com_; } - set { - com_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as PhysicalProperties); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(PhysicalProperties other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Density, other.Density)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Mass, other.Mass)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Volume, other.Volume)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Area, other.Area)) return false; - if (!object.Equals(Com, other.Com)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (Density != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Density); - if (Mass != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Mass); - if (Volume != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Volume); - if (Area != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Area); - if (com_ != null) hash ^= Com.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Density != 0D) { - output.WriteRawTag(9); - output.WriteDouble(Density); - } - if (Mass != 0D) { - output.WriteRawTag(17); - output.WriteDouble(Mass); - } - if (Volume != 0D) { - output.WriteRawTag(25); - output.WriteDouble(Volume); - } - if (Area != 0D) { - output.WriteRawTag(33); - output.WriteDouble(Area); - } - if (com_ != null) { - output.WriteRawTag(42); - output.WriteMessage(Com); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Density != 0D) { - output.WriteRawTag(9); - output.WriteDouble(Density); - } - if (Mass != 0D) { - output.WriteRawTag(17); - output.WriteDouble(Mass); - } - if (Volume != 0D) { - output.WriteRawTag(25); - output.WriteDouble(Volume); - } - if (Area != 0D) { - output.WriteRawTag(33); - output.WriteDouble(Area); - } - if (com_ != null) { - output.WriteRawTag(42); - output.WriteMessage(Com); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (Density != 0D) { - size += 1 + 8; - } - if (Mass != 0D) { - size += 1 + 8; - } - if (Volume != 0D) { - size += 1 + 8; - } - if (Area != 0D) { - size += 1 + 8; - } - if (com_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Com); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(PhysicalProperties other) { - if (other == null) { - return; - } - if (other.Density != 0D) { - Density = other.Density; - } - if (other.Mass != 0D) { - Mass = other.Mass; - } - if (other.Volume != 0D) { - Volume = other.Volume; - } - if (other.Area != 0D) { - Area = other.Area; - } - if (other.com_ != null) { - if (com_ == null) { - Com = new global::Mirabuf.Vector3(); - } - Com.MergeFrom(other.Com); - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 9: { - Density = input.ReadDouble(); - break; - } - case 17: { - Mass = input.ReadDouble(); - break; - } - case 25: { - Volume = input.ReadDouble(); - break; - } - case 33: { - Area = input.ReadDouble(); - break; - } - case 42: { - if (com_ == null) { - Com = new global::Mirabuf.Vector3(); - } - input.ReadMessage(Com); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 9: { - Density = input.ReadDouble(); - break; - } - case 17: { - Mass = input.ReadDouble(); - break; - } - case 25: { - Volume = input.ReadDouble(); - break; - } - case 33: { - Area = input.ReadDouble(); - break; - } - case 42: { - if (com_ == null) { - Com = new global::Mirabuf.Vector3(); - } - input.ReadMessage(Com); - break; - } - } - } - } - #endif - - } - - /// - ///* - /// Transform - /// - /// Data needed to apply scale, position, and rotational changes - /// - public sealed partial class Transform : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Transform()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.TypesReflection.Descriptor.MessageTypes[5]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Transform() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Transform(Transform other) : this() { - spatialMatrix_ = other.spatialMatrix_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Transform Clone() { - return new Transform(this); - } - - /// Field number for the "spatial_matrix" field. - public const int SpatialMatrixFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_spatialMatrix_codec - = pb::FieldCodec.ForFloat(10); - private readonly pbc::RepeatedField spatialMatrix_ = new pbc::RepeatedField(); - /// - /// - /// flat map of 4x4 transform matrix - /// [00][01][02][03][10][11][12][13][20][21][22][23] - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField SpatialMatrix { - get { return spatialMatrix_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Transform); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Transform other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!spatialMatrix_.Equals(other.spatialMatrix_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - hash ^= spatialMatrix_.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - spatialMatrix_.WriteTo(output, _repeated_spatialMatrix_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - spatialMatrix_.WriteTo(ref output, _repeated_spatialMatrix_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - size += spatialMatrix_.CalculateSize(_repeated_spatialMatrix_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Transform other) { - if (other == null) { - return; - } - spatialMatrix_.Add(other.spatialMatrix_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: - case 13: { - spatialMatrix_.AddEntriesFrom(input, _repeated_spatialMatrix_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: - case 13: { - spatialMatrix_.AddEntriesFrom(ref input, _repeated_spatialMatrix_codec); - break; - } - } - } - } - #endif - - } - - /// - /// RGBA in expanded form 0-255 - /// - public sealed partial class Color : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Color()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.TypesReflection.Descriptor.MessageTypes[6]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Color() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Color(Color other) : this() { - r_ = other.r_; - g_ = other.g_; - b_ = other.b_; - a_ = other.a_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Color Clone() { - return new Color(this); - } - - /// Field number for the "R" field. - public const int RFieldNumber = 1; - private int r_; - /// - /// red - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int R { - get { return r_; } - set { - r_ = value; - } - } - - /// Field number for the "G" field. - public const int GFieldNumber = 2; - private int g_; - /// - /// green - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int G { - get { return g_; } - set { - g_ = value; - } - } - - /// Field number for the "B" field. - public const int BFieldNumber = 3; - private int b_; - /// - /// blue - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int B { - get { return b_; } - set { - b_ = value; - } - } - - /// Field number for the "A" field. - public const int AFieldNumber = 4; - private int a_; - /// - /// alpha - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int A { - get { return a_; } - set { - a_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Color); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Color other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (R != other.R) return false; - if (G != other.G) return false; - if (B != other.B) return false; - if (A != other.A) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (R != 0) hash ^= R.GetHashCode(); - if (G != 0) hash ^= G.GetHashCode(); - if (B != 0) hash ^= B.GetHashCode(); - if (A != 0) hash ^= A.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (R != 0) { - output.WriteRawTag(8); - output.WriteInt32(R); - } - if (G != 0) { - output.WriteRawTag(16); - output.WriteInt32(G); - } - if (B != 0) { - output.WriteRawTag(24); - output.WriteInt32(B); - } - if (A != 0) { - output.WriteRawTag(32); - output.WriteInt32(A); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (R != 0) { - output.WriteRawTag(8); - output.WriteInt32(R); - } - if (G != 0) { - output.WriteRawTag(16); - output.WriteInt32(G); - } - if (B != 0) { - output.WriteRawTag(24); - output.WriteInt32(B); - } - if (A != 0) { - output.WriteRawTag(32); - output.WriteInt32(A); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (R != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(R); - } - if (G != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(G); - } - if (B != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(B); - } - if (A != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(A); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Color other) { - if (other == null) { - return; - } - if (other.R != 0) { - R = other.R; - } - if (other.G != 0) { - G = other.G; - } - if (other.B != 0) { - B = other.B; - } - if (other.A != 0) { - A = other.A; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - R = input.ReadInt32(); - break; - } - case 16: { - G = input.ReadInt32(); - break; - } - case 24: { - B = input.ReadInt32(); - break; - } - case 32: { - A = input.ReadInt32(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - R = input.ReadInt32(); - break; - } - case 16: { - G = input.ReadInt32(); - break; - } - case 24: { - B = input.ReadInt32(); - break; - } - case 32: { - A = input.ReadInt32(); - break; - } - } - } - } - #endif - - } - - /// - ///* - /// Defines basic fields for almost all objects - /// The location where you can access the GUID for a reference - /// - public sealed partial class Info : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Info()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.TypesReflection.Descriptor.MessageTypes[7]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Info() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Info(Info other) : this() { - gUID_ = other.gUID_; - name_ = other.name_; - version_ = other.version_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Info Clone() { - return new Info(this); - } - - /// Field number for the "GUID" field. - public const int GUIDFieldNumber = 1; - private string gUID_ = ""; - /// - /// GUID unique value - must always be defined - /// since guid's have exactly 128bits could be represented with bytes[] - /// however endian becomes an issue - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string GUID { - get { return gUID_; } - set { - gUID_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "name" field. - public const int NameFieldNumber = 2; - private string name_ = ""; - /// - /// Generic readable name - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Name { - get { return name_; } - set { - name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "version" field. - public const int VersionFieldNumber = 3; - private uint version_; - /// - /// Version of object iteration - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public uint Version { - get { return version_; } - set { - version_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Info); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Info other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (GUID != other.GUID) return false; - if (Name != other.Name) return false; - if (Version != other.Version) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (GUID.Length != 0) hash ^= GUID.GetHashCode(); - if (Name.Length != 0) hash ^= Name.GetHashCode(); - if (Version != 0) hash ^= Version.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (GUID.Length != 0) { - output.WriteRawTag(10); - output.WriteString(GUID); - } - if (Name.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Name); - } - if (Version != 0) { - output.WriteRawTag(24); - output.WriteUInt32(Version); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (GUID.Length != 0) { - output.WriteRawTag(10); - output.WriteString(GUID); - } - if (Name.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Name); - } - if (Version != 0) { - output.WriteRawTag(24); - output.WriteUInt32(Version); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (GUID.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(GUID); - } - if (Name.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); - } - if (Version != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Version); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Info other) { - if (other == null) { - return; - } - if (other.GUID.Length != 0) { - GUID = other.GUID; - } - if (other.Name.Length != 0) { - Name = other.Name; - } - if (other.Version != 0) { - Version = other.Version; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - GUID = input.ReadString(); - break; - } - case 18: { - Name = input.ReadString(); - break; - } - case 24: { - Version = input.ReadUInt32(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - GUID = input.ReadString(); - break; - } - case 18: { - Name = input.ReadString(); - break; - } - case 24: { - Version = input.ReadUInt32(); - break; - } - } - } - } - #endif - - } - - /// - ///* - /// A basic Thumbnail to be encoded in the file - /// Most of the Time Fusion can encode the file with transparency as PNG not bitmap - /// - public sealed partial class Thumbnail : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Thumbnail()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Mirabuf.TypesReflection.Descriptor.MessageTypes[8]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Thumbnail() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Thumbnail(Thumbnail other) : this() { - width_ = other.width_; - height_ = other.height_; - extension_ = other.extension_; - transparent_ = other.transparent_; - data_ = other.data_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Thumbnail Clone() { - return new Thumbnail(this); - } - - /// Field number for the "width" field. - public const int WidthFieldNumber = 1; - private int width_; - /// - //// Image Width - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int Width { - get { return width_; } - set { - width_ = value; - } - } - - /// Field number for the "height" field. - public const int HeightFieldNumber = 2; - private int height_; - /// - //// Image Height - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int Height { - get { return height_; } - set { - height_ = value; - } - } - - /// Field number for the "extension" field. - public const int ExtensionFieldNumber = 3; - private string extension_ = ""; - /// - //// Image Extension - ex. (.png, .bitmap, .jpeg) - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Extension { - get { return extension_; } - set { - extension_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "transparent" field. - public const int TransparentFieldNumber = 4; - private bool transparent_; - /// - //// Transparency - true from fusion when correctly configured - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Transparent { - get { return transparent_; } - set { - transparent_ = value; - } - } - - /// Field number for the "data" field. - public const int DataFieldNumber = 5; - private pb::ByteString data_ = pb::ByteString.Empty; - /// - //// Data as read from the file in bytes[] form - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pb::ByteString Data { - get { return data_; } - set { - data_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Thumbnail); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Thumbnail other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Width != other.Width) return false; - if (Height != other.Height) return false; - if (Extension != other.Extension) return false; - if (Transparent != other.Transparent) return false; - if (Data != other.Data) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (Width != 0) hash ^= Width.GetHashCode(); - if (Height != 0) hash ^= Height.GetHashCode(); - if (Extension.Length != 0) hash ^= Extension.GetHashCode(); - if (Transparent != false) hash ^= Transparent.GetHashCode(); - if (Data.Length != 0) hash ^= Data.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Width != 0) { - output.WriteRawTag(8); - output.WriteInt32(Width); - } - if (Height != 0) { - output.WriteRawTag(16); - output.WriteInt32(Height); - } - if (Extension.Length != 0) { - output.WriteRawTag(26); - output.WriteString(Extension); - } - if (Transparent != false) { - output.WriteRawTag(32); - output.WriteBool(Transparent); - } - if (Data.Length != 0) { - output.WriteRawTag(42); - output.WriteBytes(Data); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Width != 0) { - output.WriteRawTag(8); - output.WriteInt32(Width); - } - if (Height != 0) { - output.WriteRawTag(16); - output.WriteInt32(Height); - } - if (Extension.Length != 0) { - output.WriteRawTag(26); - output.WriteString(Extension); - } - if (Transparent != false) { - output.WriteRawTag(32); - output.WriteBool(Transparent); - } - if (Data.Length != 0) { - output.WriteRawTag(42); - output.WriteBytes(Data); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (Width != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Width); - } - if (Height != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Height); - } - if (Extension.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Extension); - } - if (Transparent != false) { - size += 1 + 1; - } - if (Data.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeBytesSize(Data); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Thumbnail other) { - if (other == null) { - return; - } - if (other.Width != 0) { - Width = other.Width; - } - if (other.Height != 0) { - Height = other.Height; - } - if (other.Extension.Length != 0) { - Extension = other.Extension; - } - if (other.Transparent != false) { - Transparent = other.Transparent; - } - if (other.Data.Length != 0) { - Data = other.Data; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - Width = input.ReadInt32(); - break; - } - case 16: { - Height = input.ReadInt32(); - break; - } - case 26: { - Extension = input.ReadString(); - break; - } - case 32: { - Transparent = input.ReadBool(); - break; - } - case 42: { - Data = input.ReadBytes(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - Width = input.ReadInt32(); - break; - } - case 16: { - Height = input.ReadInt32(); - break; - } - case 26: { - Extension = input.ReadString(); - break; - } - case 32: { - Transparent = input.ReadBool(); - break; - } - case 42: { - Data = input.ReadBytes(); - break; - } - } - } - } - #endif - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/api/MockApi/MockApi.cs b/api/MockApi/MockApi.cs deleted file mode 100644 index d9c2f04dc6..0000000000 --- a/api/MockApi/MockApi.cs +++ /dev/null @@ -1,204 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using Api.GUI; -using SynthesisAPI.EnvironmentManager; -using SynthesisAPI.EventBus; -using SynthesisAPI.Modules.Attributes; -using SynthesisAPI.Runtime; -using SynthesisAPI.Utilities; -using SynthesisAPI.VirtualFileSystem; -using UnityEngine; -using UnityEngine.UIElements; - -namespace MockApi -{ - public static class MockApi - { - public static void Init() - { - SynthesisAPI.Runtime.ApiProvider.RegisterApiProvider(new MockApiProvider()); - foreach (var type in AppDomain.CurrentDomain.GetAssemblies().SelectMany(a => - a.GetTypes()).Where(e => e.IsSubclassOf(typeof(SystemBase)))) - { - var entity = EnvironmentManager.AddEntity(); - entity.AddComponent(type); - } - foreach (var type in AppDomain.CurrentDomain.GetAssemblies().SelectMany(a => - a.GetTypes()).Where(e => e.GetMethods().Any( - m => m.GetCustomAttribute() != null || m.GetCustomAttribute() != null))) - { - var instance = Activator.CreateInstance(type); - foreach (var callback in type.GetMethods() - .Where(m => m.GetCustomAttribute() != null)) - { - RegisterTypeCallbackByMethodInfo(callback, instance); - } - foreach (var callback in type.GetMethods() - .Where(m => m.GetCustomAttribute() != null)) - { - RegisterTagCallbackByMethodInfo(callback, instance); - } - } - } - - private static void RegisterTagCallbackByMethodInfo(MethodInfo callback, object instance) - { - if (instance.GetType() != callback.DeclaringType) - { - throw new Exception( - $"Type of instance variable \"{instance.GetType()}\" does not match declaring type of callback \"{callback.Name}\" (expected \"{callback.DeclaringType}\""); - } - var eventType = callback.GetParameters().First().ParameterType; - var tag = callback.GetCustomAttribute().Tag; - typeof(EventBus).GetMethod("NewTagListener") - ?.Invoke(null, new object[] - { - tag, - CreateEventCallback(callback, instance, eventType) - }); - } - - private static void RegisterTypeCallbackByMethodInfo(MethodInfo callback, object instance) - { - if (instance.GetType() != callback.DeclaringType) - { - throw new Exception( - $"Type of instance variable \"{instance.GetType()}\" does not match declaring type of callback \"{callback.Name}\" (expected \"{callback.DeclaringType}\""); - } - var eventType = callback.GetParameters().First().ParameterType; - typeof(EventBus).GetMethod("NewTypeListener") - ?.MakeGenericMethod(eventType).Invoke(null, new object[] - { - CreateEventCallback(callback, instance, eventType) - }); - } - - static EventBus.EventCallback CreateEventCallback(MethodInfo m, object instance, Type eventType) - { - return (e) => m.Invoke(instance, - new[] - { - typeof(ReflectHelper).GetMethod("CastObject") - ?.MakeGenericMethod(eventType) - .Invoke(null, new object[] {e}) - }); - } - - - private class MockApiProvider : IApiProvider - { - private bool debugLogsEnabled = false; - - private void LogAction(string function, string msg = "") - { - var m = $"MockApiProvider.{function}"; - if (msg != "") - { - m += $": {msg}"; - } - Log(m); - } - - public void AddEntityToScene(Entity entity) - { - LogAction($"Add Entity {entity}"); - } - - public void RemoveEntityFromScene(Entity entity) - { - LogAction($"Remove Entity {entity}"); - } - -#nullable enable - public SynthesisAPI.EnvironmentManager.Component? AddComponentToScene(Entity entity, Type t) - { - LogAction("Add Component", $"Adding {t} to {entity}"); - return (SynthesisAPI.EnvironmentManager.Component?)Activator.CreateInstance(t); - } - - public void AddComponentToScene(Entity entity, SynthesisAPI.EnvironmentManager.Component component) - { - LogAction("Add Component", $"Adding instance of {component.GetType()} to {entity}"); - } - - - public void RemoveComponentFromScene(Entity entity, Type t) - { - LogAction("Remove Component", $"Adding {t} to {entity}"); - } - - public void Log(object o, LogLevel logLevel = LogLevel.Info, string memberName = "", string filePath = "", int lineNumber = 0) - { - switch (logLevel) - { - case LogLevel.Debug: - if (!debugLogsEnabled) - { - return; - } else { - Console.WriteLine(o); - break; - } - case LogLevel.Warning: - case LogLevel.Error: - case LogLevel.Info: - { - Console.WriteLine(o); - break; - } - default: - throw new SynthesisException("Unhandled log level"); - } - } - - public void SetEnableDebugLogs(bool enable) - { - debugLogsEnabled = enable; - } - - - public T CreateUnityType(params object[] args) where T : class - { - throw new NotImplementedException(); - } - - public VisualTreeAsset GetDefaultUIAsset(string assetName) - { - throw new NotImplementedException(); - } - - // public TUnityType InstantiateFocusable() where TUnityType : Focusable - // { - // throw new NotImplementedException(); - // } - - public VisualElement GetRootVisualElement() - { - throw new NotImplementedException(); - } - - public GUIManager GetGUIManager() - { - throw new NotImplementedException(); - } - - public void EnqueueTaskForMainThread(Action task) - { - throw new NotImplementedException(); - } - - public Coroutine StartCoroutine(IEnumerator routine) - { - throw new NotImplementedException(); - } - - public void StopCoroutine(IEnumerator routine) - { - throw new NotImplementedException(); - } - } - } -} \ No newline at end of file diff --git a/api/MockApi/MockApi.csproj b/api/MockApi/MockApi.csproj deleted file mode 100644 index e8e97e0e9a..0000000000 --- a/api/MockApi/MockApi.csproj +++ /dev/null @@ -1,22 +0,0 @@ - - - - netstandard2.0 - 8 - - - - - - - - - ..\libs\UnityEngine.dll - - - - - - - - diff --git a/api/Patchbay/ClientData.cs b/api/Patchbay/ClientData.cs deleted file mode 100644 index 39245329cd..0000000000 --- a/api/Patchbay/ClientData.cs +++ /dev/null @@ -1,56 +0,0 @@ -using Org.BouncyCastle.Crypto; -using Org.BouncyCastle.Crypto.Digests; -using Org.BouncyCastle.Crypto.Generators; -using Org.BouncyCastle.Crypto.Parameters; -using Org.BouncyCastle.Math; -using Org.BouncyCastle.Security; -using SynthesisAPI.Aether; -using System; -using System.Collections.Generic; -using System.Net; -using System.Net.Sockets; -using System.Threading; -using SynthesisServer.Proto; - -using Client = SynthesisServer.Proto.Client; - -namespace SynthesisServer { - public class ClientData { - // The public and private key for the server that corresponds with a client - // Maybe try implementing ECDH in the future - - //public IPEndPoint ClientEndpoint { get; set; } - public string Name { get; set; } = "Epic Gamer"; - public byte[] SymmetricKey { get; private set; } - public long LastHeartbeat { get; private set; } - public bool IsReady { get; set; } - public string CurrentLobby { get; set; } = string.Empty; - public Socket ClientSocket { get; private set; } - public IPEndPoint UDPEndPoint { get; set; } - public string ID { get; private set; } - - private AsymmetricCipherKeyPair _keyPair; - - private DHParameters _parameters; - - public ClientData(Socket socket, string id) { - ID = id; - ClientSocket = socket; - IsReady = false; - LastHeartbeat = System.DateTimeOffset.Now.ToUnixTimeMilliseconds(); - } - - public void GenerateSharedSecret(string importedPublicKey, DHParameters parameters, SymmetricEncryptor encryptor) { - _parameters = parameters; - _keyPair = encryptor.GenerateKeys(parameters); - SymmetricKey = encryptor.GenerateSharedSecret(importedPublicKey, parameters, _keyPair); - } - - public String GetPublicKey() { return ((DHPublicKeyParameters)_keyPair.Public).Y.ToString(); } - - public void UpdateHeartbeat() { LastHeartbeat = System.DateTimeOffset.Now.ToUnixTimeMilliseconds(); } - - public static implicit operator SynthesisServer.Proto.Client(ClientData data) - => new SynthesisServer.Proto.Client() { Id = data.ID, Name = data.Name }; - } -} \ No newline at end of file diff --git a/api/Patchbay/Commands/RestartCommand.cs b/api/Patchbay/Commands/RestartCommand.cs deleted file mode 100644 index 10ce54e4b4..0000000000 --- a/api/Patchbay/Commands/RestartCommand.cs +++ /dev/null @@ -1,19 +0,0 @@ -using CommandLine; -using System; -using System.Collections.Generic; -using System.Text; - -namespace SynthesisServer -{ - [Verb("restart", HelpText = "Restart the Synthesis Server if it is already running")] - class RestartCommand - { - [Option('t', "timeout", Required = false, HelpText = "Sets the time (ms) that the server will wait for all other instances to die (Defaults to 5000 milliseconds)")] - public int Timeout { get; set; } = 5000; - - [Option('f', "force", Required = false, HelpText = "Server will start regaurdless of whether all other instances are alive (Defaults to false which is strongly recommended)")] - public bool Force { get; set; } = false; - - public Command CommandType { get; } = Command.RESTART; - } -} diff --git a/api/Patchbay/Commands/StartCommand.cs b/api/Patchbay/Commands/StartCommand.cs deleted file mode 100644 index 7700446e67..0000000000 --- a/api/Patchbay/Commands/StartCommand.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using CommandLine; - - -namespace SynthesisServer -{ - [Verb("start", HelpText = "Start the Synthesis Server")] - class StartCommand - { - #nullable enable - - [Option('c', "config", Required = false, HelpText = "Specify a path to an appsettings.json file. Defaults to the same directory as the binary.")] - public string? ConfigPath { get; set; } = null; - - [Option('p', "port", Required = false, HelpText = "Specify the UDP port you want the server to listen on.")] - public int? Port { get; set; } = null; - - [Option('l', "lobby-timeout", Required = false, HelpText = "Set the maximum amount of time in seconds that a client can have a lobby up. (-1 for infinite)")] - public int? LobbyTimeout { get; set; } = null; - - [Option('m', "max-lobbies", Required = false, HelpText = "Set the maximum number of lobbies that can be created on the server. (-1 for infinite)")] - public int? MaxHosts { get; set; } = null; - - [Option('i', "heartbeat-interval", Required = false, HelpText = "Set the time interval in seconds that a client must send a heartbeat signal by. (-1 for infinite; Not recommended)")] - public int? HearbeatInterval { get; set; } = null; - - #nullable disable - - [Option('n', "new-config", Required = false, HelpText = "Will generate a new config file based on arguments and current configuration if true. (Defaults to false)")] - public bool NewConfig { get; set; } = false; - - [Option('f', "force", Required = false, HelpText = "Will run even if another instance is running. Defaults to false.")] - public bool Force { get; set; } = false; - - public Command CommandType { get; } = Command.START; - } -} diff --git a/api/Patchbay/Commands/StopCommand.cs b/api/Patchbay/Commands/StopCommand.cs deleted file mode 100644 index 8239585a21..0000000000 --- a/api/Patchbay/Commands/StopCommand.cs +++ /dev/null @@ -1,13 +0,0 @@ -using CommandLine; -using System; -using System.Collections.Generic; -using System.Text; - -namespace SynthesisServer -{ - [Verb("stop", HelpText = "Stop the Synthesis Server")] - public class StopCommand - { - public Command CommandType { get; } = Command.STOP; - } -} diff --git a/api/Patchbay/DaemonConfig.cs b/api/Patchbay/DaemonConfig.cs deleted file mode 100644 index 08f9194917..0000000000 --- a/api/Patchbay/DaemonConfig.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -namespace SynthesisServer -{ - /* Properties are assigned default values. Then values are updated based on available JSON config. Finally Command Line arguments are applied*/ - public class DaemonConfig - { - // Command line arguments - public string[] Arguments { get; set; } - - // Configurable values - public string Version { get; set; } = "1.0"; - public string DaemonName { get; set; } = "synthesisd"; - public int Port { get; set; } = 10800; - public int LobbyTimeout { get; set; } = 43200; - public int MaxLobbies { get; set; } = -1; - public int HeartbeatInterval { get; set; } = 5; - } - -} \ No newline at end of file diff --git a/api/Patchbay/Lobby.cs b/api/Patchbay/Lobby.cs deleted file mode 100644 index 79a15ece81..0000000000 --- a/api/Patchbay/Lobby.cs +++ /dev/null @@ -1,95 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Net; -using System.Text; -using System.Threading; -using SynthesisServer.Proto; - -using PLobby = SynthesisServer.Proto.Lobby; - -namespace SynthesisServer { - public class Lobby { - // TODO: CATCH INDEX OUT OF BOUNDS - //public string? Password { get; set; } - public ClientData Host { get; private set; } - public List Clients { get { return _clients; } } - public string Name { get; private set; } - public int LobbySize { get; set; } - public bool IsStarted { get; private set; } - - private readonly List _clients; - - public Lobby(ClientData host, int lobbySize, string name) { - IsStarted = false; - _clients = new List(); - _clients.Add(host); - Host = host; - Name = name; - } - - public void Start() { - IsStarted = true; - } - - public bool Swap(int firstIndex, int secondIndex) { - try { - if (IsStarted) { - return false; - } - var x = _clients[firstIndex]; - _clients[firstIndex] = _clients[secondIndex]; - _clients[secondIndex] = x; - return true; - } catch (IndexOutOfRangeException) { - return false; - } - } - - public bool TryAddClient(ClientData client) { - // If no index is specified, it will try to add the client to an empty index so long as it does not already have a spot - - if (IsStarted || _clients.Count >= LobbySize || _clients.Contains(client)) { - return false; - } - if (_clients.Count == 0) { - Host = client; - } - _clients.Add(client); - return true; - } - - public bool TryRemoveClient(ClientData client) { - if (IsStarted) { - return false; - } - if (client.Equals(Host)) { - TryFindNewHost(); - } - if (_clients.Contains(client)) { - _clients.Remove(client); - } - return false; - } - - private bool TryFindNewHost() { - foreach (ClientData x in _clients) { - if (x != null && !x.Equals(Host)) { - Host = x; - return true; - } - } - return false; - } - - public PLobby ToProtobuf() { - var l = new PLobby(); - l.LobbyName = Name; - Clients.ForEach(c => { - l.Clients.Add(c.ID, c); - }); - return l; - } - - - } -} \ No newline at end of file diff --git a/api/Patchbay/Patchbay.csproj b/api/Patchbay/Patchbay.csproj deleted file mode 100644 index 255a3d3230..0000000000 --- a/api/Patchbay/Patchbay.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - - Exe - net7.0 - SynthesisServer - SynthesisServer.Program - - - - - - - - - - - - - - - - - diff --git a/api/Patchbay/Program.cs b/api/Patchbay/Program.cs deleted file mode 100644 index f9c9277225..0000000000 --- a/api/Patchbay/Program.cs +++ /dev/null @@ -1,54 +0,0 @@ -using CommandLine; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using System.Security.Cryptography; -using System.Text; -using Google.Protobuf; - -namespace SynthesisServer { - class Program { - public static void Main(string[] args) { - - // Default to start method - if (args.Length == 0) - args = new string[] { "start" }; - - string filePath = "appsettings.json"; - var builder = new HostBuilder(); - - builder.ConfigureAppConfiguration((hostingContext, config) => - { - config.AddEnvironmentVariables(); - config.AddJsonFile(filePath, true); - - }); - - builder.ConfigureServices((hostContext, services) => - { - services.AddOptions(); - - services.Configure(hostContext.Configuration.GetSection("Settings")); - services.Configure(config => { config.Arguments = args; }); - services.AddSingleton(); - }); - - builder.ConfigureLogging((hostingContext, logging) => - { - logging.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); - logging.AddConsole(); - }); - - var host = builder.Build(); - - - host.RunAsync().Wait(); - - } - } -} diff --git a/api/Patchbay/Properties/PublishProfiles/FolderProfile.pubxml b/api/Patchbay/Properties/PublishProfiles/FolderProfile.pubxml deleted file mode 100644 index 81cff9c7d5..0000000000 --- a/api/Patchbay/Properties/PublishProfiles/FolderProfile.pubxml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - Release - Any CPU - bin\Release\netcoreapp3.1\publish\ - FileSystem - netcoreapp3.1 - false - linux-x64 - False - - \ No newline at end of file diff --git a/api/Patchbay/Properties/PublishProfiles/FolderProfile.pubxml.user b/api/Patchbay/Properties/PublishProfiles/FolderProfile.pubxml.user deleted file mode 100644 index 43b963810e..0000000000 --- a/api/Patchbay/Properties/PublishProfiles/FolderProfile.pubxml.user +++ /dev/null @@ -1,9 +0,0 @@ - - - - - True|2022-06-19T21:46:36.8082485Z;True|2022-06-19T14:45:44.7138782-07:00;True|2022-06-19T01:04:43.8188795-07:00;True|2022-06-19T01:02:30.6427775-07:00;False|2022-06-19T01:02:20.6776655-07:00;True|2022-06-19T00:57:37.6293713-07:00;True|2022-06-19T00:52:48.3489355-07:00;True|2022-06-19T00:49:40.4008863-07:00;False|2022-06-19T00:48:59.4391777-07:00;False|2022-06-19T00:48:20.6954512-07:00;False|2022-06-19T00:45:19.5419099-07:00;True|2022-06-19T00:39:57.1317811-07:00;True|2022-06-17T15:31:50.9203548-07:00;True|2022-06-17T15:30:45.2485959-07:00;True|2022-06-17T15:28:55.9284144-07:00; - - \ No newline at end of file diff --git a/api/Patchbay/Server.cs b/api/Patchbay/Server.cs deleted file mode 100644 index 54e62832d5..0000000000 --- a/api/Patchbay/Server.cs +++ /dev/null @@ -1,797 +0,0 @@ -using Google.Protobuf; -using Google.Protobuf.WellKnownTypes; -using Microsoft.Extensions.Logging; -using Org.BouncyCastle.Asn1.Nist; -using Org.BouncyCastle.Asn1.X9; -using Org.BouncyCastle.Crypto; -using Org.BouncyCastle.Crypto.Generators; -using Org.BouncyCastle.Crypto.Parameters; -using Org.BouncyCastle.Math; -using Org.BouncyCastle.Security; -using SynthesisServer.Proto; -using SynthesisAPI.Aether; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading; -using System.Threading.Tasks; - -using PLobby = SynthesisServer.Proto.Lobby; - -namespace SynthesisServer { - public sealed class Server { - private const int LOBBY_SIZE = 6; - private const int BUFFER_SIZE = 16384; - - private Socket _tcpSocket; - private UdpClient _udpSocket; - private SymmetricEncryptor _encryptor; - - private ReaderWriterLockSlim _clientsLock; - private Dictionary _clients; - - private ReaderWriterLockSlim _lobbiesLock; - private Dictionary _lobbies; // Uses lobby name as key - - private ILogger _logger; - private bool _isRunning = false; - - private int _tcpPort; - private int _udpPort; - - private static readonly Lazy lazy = new Lazy(() => new Server()); - public static Server Instance { get { return lazy.Value; } } - private Server() { - } - - private struct ClientState { - public byte[] buffer; - public Socket socket; - public string id; - } - - public void Stop() { - _udpSocket.Close(); - _tcpSocket.Close(); - _clientsLock.EnterWriteLock(); - _clients.Clear(); - _clientsLock.ExitWriteLock(); - _lobbiesLock.EnterWriteLock(); - _lobbies.Clear(); - _lobbiesLock.ExitWriteLock(); - } - - public void Start(ILogger logger, int tcpPort = 18001, int udpPort = 18000) { - - _tcpPort = tcpPort; - _udpPort = udpPort; - - _logger = logger; - _isRunning = true; - - _tcpSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); - _udpSocket = new UdpClient(new IPEndPoint(IPAddress.Any, _udpPort)); - - _encryptor = new SymmetricEncryptor(); - - _clients = new Dictionary(); - _clientsLock = new ReaderWriterLockSlim(); - - _lobbies = new Dictionary(); - _lobbiesLock = new ReaderWriterLockSlim(); - - _tcpSocket.Bind(new IPEndPoint(IPAddress.Any, _tcpPort)); - _tcpSocket.Listen(5); - _tcpSocket.BeginAccept(new AsyncCallback(TCPAcceptCallback), null); - - _udpSocket.BeginReceive(new AsyncCallback(UDPReceiveCallback), null); - - _logger.LogInformation("Server is running"); - - Task.Run(() => { - while (_isRunning) { - CheckHeartbeats(5000); - CheckLobbies(); - Thread.Sleep(1000); - } - }); - } - - // TCP Callbacks - private void TCPAcceptCallback(IAsyncResult asyncResult) { - _logger.LogInformation("New client accepted"); - - ClientState state = new ClientState() { - buffer = new byte[BUFFER_SIZE], - socket = _tcpSocket.EndAccept(asyncResult), - id = Guid.NewGuid().ToString() - }; - - _logger.LogInformation($"Client ID: '{state.id}'"); - - if (_isRunning) { - state.socket.BeginReceive(state.buffer, 0, BUFFER_SIZE, SocketFlags.None, new AsyncCallback(TCPReceiveCallback), state); - _tcpSocket.BeginAccept(new AsyncCallback(TCPAcceptCallback), null); - } - } - /* - Data is send in this format: [4 byte int denoting header length] + [MessageHeader object] + [4 byte int denoting message body length] + [The actual message] - */ - private void TCPReceiveCallback(IAsyncResult asyncResult) { - _logger.LogInformation("Received Message"); - try { - ClientState state = (ClientState)asyncResult.AsyncState; - int received = state.socket.EndReceive(asyncResult); - if (received != 0) { - - byte[] data = new byte[received]; - Array.Copy(state.buffer, data, received); - if (BitConverter.IsLittleEndian) { Array.Reverse(data); } - - MessageHeader header; - Any message; - - try { - header = MessageHeader.Parser.ParseFrom(IO.GetNextMessage(ref data)); - if (header.IsEncrypted) { - byte[] decryptedData = _encryptor.Decrypt(data, _clients[header.ClientId].SymmetricKey); - message = Any.Parser.ParseFrom(IO.GetNextMessage(ref decryptedData)); - } else if (!header.IsEncrypted) { - message = Any.Parser.ParseFrom(IO.GetNextMessage(ref data)); - } else { - message = Any.Pack(new StatusMessage() { - LogLevel = StatusMessage.Types.LogLevel.Error, - Msg = "Invalid Message Received" - }); - } - } catch (Exception e) { - _logger.LogWarning("Error while parsing message"); - _logger.LogInformation($"{e.Message}\n{e.StackTrace}"); - _clientsLock.EnterReadLock(); - header = new MessageHeader() { - ClientId = state.id, - IsEncrypted = (_clients.ContainsKey(state.id) && _clients[state.id].SymmetricKey != null) - }; - _clientsLock.ExitReadLock(); - message = Any.Pack(new StatusMessage() { - LogLevel = StatusMessage.Types.LogLevel.Error, - Msg = "Invalid Message Received" - }); - } - - if (message.Is(KeyExchange.Descriptor)) { - HandleKeyExchange(message.Unpack(), state.id, state.socket); - } else if (message.Is(Heartbeat.Descriptor)) { - HandleHeartbeat(message.Unpack(), header.ClientId); - } else if (message.Is(CreateLobbyRequest.Descriptor)) { - HandleCreateLobbyRequest(message.Unpack(), header.ClientId); - } else if (message.Is(DeleteLobbyRequest.Descriptor)) { - HandleDeleteLobbyRequest(message.Unpack(), header.ClientId); - } else if (message.Is(JoinLobbyRequest.Descriptor)) { - HandleJoinLobbyRequest(message.Unpack(), header.ClientId); - } else if (message.Is(LeaveLobbyRequest.Descriptor)) { - HandleLeaveLobbyRequest(message.Unpack(), header.ClientId); - } else if (message.Is(StartLobbyRequest.Descriptor)) { - HandleStartLobbyRequest(message.Unpack(), header.ClientId); - } else if (message.Is(SwapRequest.Descriptor)) { - HandleSwapRequest(message.Unpack(), header.ClientId); - } else if (message.Is(ServerInfoRequest.Descriptor)) { - HandleServerInfoRequest(message.Unpack(), header.ClientId); - } else if (message.Is(ChangeNameRequest.Descriptor)) { - HandleChangeNameRequest(message.Unpack(), header.ClientId); - } else if (message.Is(DisconnectRequest.Descriptor)) { - HandleDisconnectRequest(message.Unpack(), header.ClientId); - } - } else { - HandleDisconnectRequest(new DisconnectRequest(), state.id); - } - - if (_isRunning && state.socket.Connected) { - state.socket.BeginReceive(state.buffer, 0, BUFFER_SIZE, SocketFlags.None, new AsyncCallback(TCPReceiveCallback), state); - } - } catch (Exception e) { - _logger.LogError(e.ToString()); - } - } - private void TCPSendCallback(IAsyncResult asyncResult) { - - } - - - // UDP Callbacks - private void UDPReceiveCallback(IAsyncResult asyncResult) { - IPEndPoint remoteEP = new IPEndPoint(IPAddress.Any, 0); - byte[] buffer = _udpSocket.EndReceive(asyncResult, ref remoteEP); - if (BitConverter.IsLittleEndian) { Array.Reverse(buffer); } // make sure to do while sending - - MessageHeader header = MessageHeader.Parser.ParseFrom(IO.GetNextMessage(ref buffer)); - - // TODO: make clients accessible through id not socket (socket can just be a property of the client) (Still check to make sure correct socket is being used for client) - - Any message; - - _clientsLock.EnterReadLock(); - if (header.IsEncrypted && _clients.ContainsKey(header.ClientId)) { - byte[] decryptedData = _encryptor.Decrypt(buffer, _clients[header.ClientId].SymmetricKey); - message = Any.Parser.ParseFrom(IO.GetNextMessage(ref decryptedData)); - } else { - message = Any.Pack(new StatusMessage() { - LogLevel = StatusMessage.Types.LogLevel.Error, - Msg = "Invalid Message" - }); - } - _clientsLock.ExitReadLock(); - - if (message.Is(MatchStartResponse.Descriptor)) { HandleMatchStartResponse(message.Unpack(), header.ClientId, remoteEP); } - if (_isRunning) { - _udpSocket.BeginReceive(new AsyncCallback(UDPReceiveCallback), null); - } - - } - private void UDPSendCallback(IAsyncResult asyncResult) { - - } - - - // UDP Handlers - private void HandleMatchStartResponse(MatchStartResponse matchStartResponse, string clientID, IPEndPoint remoteEP) { - _logger.LogInformation(clientID + " is starting a match"); - - - _clientsLock.EnterWriteLock(); - _clients[clientID].UDPEndPoint = remoteEP; - _clients.Remove(clientID); - _clientsLock.ExitWriteLock(); - } - - - // TCP Handlers - private void HandleKeyExchange(KeyExchange keyExchange, string clientID, Socket socket) { - _logger.LogInformation(clientID + " is performing a key exchange"); - - _clientsLock.EnterWriteLock(); - if (!_clients.ContainsKey(clientID)) { _clients.Add(clientID, new ClientData(socket, clientID)); } - _clients[clientID].GenerateSharedSecret(keyExchange.PublicKey, new DHParameters(new BigInteger(keyExchange.P), new BigInteger(keyExchange.G)), _encryptor); - _clientsLock.ExitWriteLock(); - - _clientsLock.EnterReadLock(); - IO.SendMessage - ( - new KeyExchange() { - ClientId = clientID, - PublicKey = _clients[clientID].GetPublicKey() - }, - clientID, - socket, - new AsyncCallback(TCPSendCallback) - ); - _clientsLock.ExitReadLock(); - } - private void HandleHeartbeat(Heartbeat heartbeat, string clientID) { - _logger.LogInformation(clientID + " has sent a heartbeat"); - _clientsLock.EnterWriteLock(); - _clients[clientID].UpdateHeartbeat(); - _clientsLock.ExitWriteLock(); - } - private void HandleCreateLobbyRequest(CreateLobbyRequest createLobbyRequest, string clientID) { - _logger.LogInformation(clientID + " has requested to create a lobby"); - _lobbiesLock.EnterUpgradeableReadLock(); - _clientsLock.EnterUpgradeableReadLock(); - - if (_lobbies.ContainsKey(createLobbyRequest.LobbyName)) { - IO.SendEncryptedMessage - ( - new CreateLobbyResponse() { - LobbyName = createLobbyRequest.LobbyName, - GenericResponse = new GenericResponse() { - Success = false, - LogMessage = "That lobby already exists" - } - }, - clientID, - _clients[clientID].SymmetricKey, - _clients[clientID].ClientSocket, - _encryptor, - new AsyncCallback(TCPSendCallback) - ); - } else { - _lobbiesLock.EnterWriteLock(); - _lobbies[createLobbyRequest.LobbyName] = new Lobby(_clients[clientID], LOBBY_SIZE, createLobbyRequest.LobbyName); - if (_clients[clientID].CurrentLobby != string.Empty && _lobbies.ContainsKey(_clients[clientID].CurrentLobby)) - { - _lobbies[_clients[clientID].CurrentLobby].TryRemoveClient(_clients[clientID]); - } - _lobbiesLock.ExitWriteLock(); - - _clientsLock.EnterWriteLock(); - _clients[clientID].CurrentLobby = createLobbyRequest.LobbyName; - _clientsLock.ExitWriteLock(); - - IO.SendEncryptedMessage - ( - new CreateLobbyResponse() { - LobbyName = createLobbyRequest.LobbyName, - GenericResponse = new GenericResponse() { - Success = true, - LogMessage = "Lobby created successfully" - } - }, - clientID, - _clients[clientID].SymmetricKey, - _clients[clientID].ClientSocket, - _encryptor, - new AsyncCallback(TCPSendCallback) - ); - } - - - _clientsLock.ExitUpgradeableReadLock(); - _lobbiesLock.ExitUpgradeableReadLock(); - } - private void HandleDeleteLobbyRequest(DeleteLobbyRequest deleteLobbyRequest, string clientID) { - _logger.LogInformation(clientID + " has requested to delete a lobby"); - _lobbiesLock.EnterUpgradeableReadLock(); - _clientsLock.EnterUpgradeableReadLock(); - - if (_lobbies.ContainsKey(deleteLobbyRequest.LobbyName)) { - if (_lobbies[deleteLobbyRequest.LobbyName].Host.Equals(_clients[clientID])) { - _lobbiesLock.EnterWriteLock(); - _lobbies.Remove(deleteLobbyRequest.LobbyName); - _lobbiesLock.ExitWriteLock(); - - _clientsLock.EnterWriteLock(); - _clients[clientID].CurrentLobby = string.Empty; - _clientsLock.ExitWriteLock(); - - IO.SendEncryptedMessage - ( - new DeleteLobbyResponse() { - LobbyName = deleteLobbyRequest.LobbyName, - GenericResponse = new GenericResponse() { - Success = true, - LogMessage = "Lobby successfully deleted" - } - }, - clientID, - _clients[clientID].SymmetricKey, - _clients[clientID].ClientSocket, - _encryptor, - new AsyncCallback(TCPSendCallback) - ); - } else { - IO.SendEncryptedMessage - ( - new DeleteLobbyResponse() { - LobbyName = deleteLobbyRequest.LobbyName, - GenericResponse = new GenericResponse() { - Success = false, - LogMessage = "You do not have permission to delete this lobby" - } - }, - clientID, - _clients[clientID].SymmetricKey, - _clients[clientID].ClientSocket, - _encryptor, - new AsyncCallback(TCPSendCallback) - ); - } - } else { - IO.SendEncryptedMessage - ( - new CreateLobbyResponse() { - LobbyName = deleteLobbyRequest.LobbyName, - GenericResponse = new GenericResponse() { - Success = false, - LogMessage = "Lobby does not exist" - } - }, - clientID, - _clients[clientID].SymmetricKey, - _clients[clientID].ClientSocket, - _encryptor, - new AsyncCallback(TCPSendCallback) - ); - } - - _clientsLock.ExitUpgradeableReadLock(); - _lobbiesLock.ExitUpgradeableReadLock(); - } - private void HandleJoinLobbyRequest(JoinLobbyRequest joinLobbyRequest, string clientID) { - _logger.LogInformation(clientID + " has requested to join a lobby"); - _clientsLock.EnterUpgradeableReadLock(); - _lobbiesLock.EnterWriteLock(); - - if (_lobbies.ContainsKey(joinLobbyRequest.LobbyName) && _clients[clientID].CurrentLobby == String.Empty && _lobbies[joinLobbyRequest.LobbyName].TryAddClient(_clients[clientID])) { - _lobbiesLock.ExitWriteLock(); - - _clientsLock.EnterWriteLock(); - _clients[clientID].CurrentLobby = joinLobbyRequest.LobbyName; - _clientsLock.ExitWriteLock(); - - IO.SendEncryptedMessage - ( - new CreateLobbyResponse() { - LobbyName = joinLobbyRequest.LobbyName, - GenericResponse = new GenericResponse() { - Success = true, - LogMessage = "Joined lobby successfully" - } - }, - clientID, - _clients[clientID].SymmetricKey, - _clients[clientID].ClientSocket, - _encryptor, - new AsyncCallback(TCPSendCallback) - ); - } else { - _lobbiesLock.ExitWriteLock(); - IO.SendEncryptedMessage - ( - new CreateLobbyResponse() { - LobbyName = joinLobbyRequest.LobbyName, - GenericResponse = new GenericResponse() { - Success = false, - LogMessage = "Could not join lobby" - } - }, - clientID, - _clients[clientID].SymmetricKey, - _clients[clientID].ClientSocket, - _encryptor, - new AsyncCallback(TCPSendCallback) - ); - } - - _clientsLock.ExitUpgradeableReadLock(); - } - private void HandleLeaveLobbyRequest(LeaveLobbyRequest leaveLobbyRequest, string clientID) { - _logger.LogInformation(clientID + " has requested to leave a lobby"); - _clientsLock.EnterUpgradeableReadLock(); - _lobbiesLock.EnterWriteLock(); - - if (_lobbies.ContainsKey(leaveLobbyRequest.LobbyName) && _lobbies[leaveLobbyRequest.LobbyName].TryRemoveClient(_clients[clientID])) { - _lobbiesLock.ExitWriteLock(); - - _clientsLock.EnterWriteLock(); - _clients[clientID].CurrentLobby = string.Empty; - _clientsLock.ExitWriteLock(); - - IO.SendEncryptedMessage - ( - new CreateLobbyResponse() { - LobbyName = leaveLobbyRequest.LobbyName, - GenericResponse = new GenericResponse() { - Success = true, - LogMessage = "Left lobby successfully" - } - }, - clientID, - _clients[clientID].SymmetricKey, - _clients[clientID].ClientSocket, - _encryptor, - new AsyncCallback(TCPSendCallback) - ); - } else { - _lobbiesLock.ExitWriteLock(); - IO.SendEncryptedMessage - ( - new CreateLobbyResponse() { - LobbyName = leaveLobbyRequest.LobbyName, - GenericResponse = new GenericResponse() { - Success = false, - LogMessage = "Could not leave lobby" - } - }, - clientID, - _clients[clientID].SymmetricKey, - _clients[clientID].ClientSocket, - _encryptor, - new AsyncCallback(TCPSendCallback) - ); - } - _clientsLock.ExitUpgradeableReadLock(); - } - private void HandleStartLobbyRequest(StartLobbyRequest startLobbyRequest, string clientID) { - _logger.LogInformation(clientID + " has requested to start a lobby"); - _lobbiesLock.EnterUpgradeableReadLock(); - if (_lobbies.ContainsKey(startLobbyRequest.LobbyName)) { - _clientsLock.EnterReadLock(); - if (_lobbies[startLobbyRequest.LobbyName].Host.Equals(_clients[clientID])) { - _lobbiesLock.EnterWriteLock(); - StartLobby(startLobbyRequest.LobbyName); - _lobbiesLock.ExitWriteLock(); - - IO.SendEncryptedMessage - ( - new StartLobbyResponse() { - LobbyName = startLobbyRequest.LobbyName, - GenericResponse = new GenericResponse() { - Success = true, - LogMessage = "Lobby successfully started" - } - }, - clientID, - _clients[clientID].SymmetricKey, - _clients[clientID].ClientSocket, - _encryptor, - new AsyncCallback(TCPSendCallback) - ); - } else { - IO.SendEncryptedMessage - ( - new StartLobbyResponse() { - LobbyName = startLobbyRequest.LobbyName, - GenericResponse = new GenericResponse() { - Success = false, - LogMessage = "You do not have permission to start this lobby" - } - }, - clientID, - _clients[clientID].SymmetricKey, - _clients[clientID].ClientSocket, - _encryptor, - new AsyncCallback(TCPSendCallback) - ); - } - } else { - IO.SendEncryptedMessage - ( - new StartLobbyResponse() { - LobbyName = startLobbyRequest.LobbyName, - GenericResponse = new GenericResponse() { - Success = false, - LogMessage = "Lobby does not exist" - } - }, - clientID, - _clients[clientID].SymmetricKey, - _clients[clientID].ClientSocket, - _encryptor, - new AsyncCallback(TCPSendCallback) - ); - } - _clientsLock.ExitReadLock(); - _lobbiesLock.ExitUpgradeableReadLock(); - } - private void HandleSwapRequest(SwapRequest swapRequest, string clientID) { - _logger.LogInformation(clientID + " has requested to swap positions in a lobby"); - _clientsLock.EnterReadLock(); - _lobbiesLock.EnterReadLock(); - - if (_lobbies.ContainsKey(swapRequest.LobbyName) && (_clients[clientID].Equals(_lobbies[swapRequest.LobbyName].Host)) && _lobbies[swapRequest.LobbyName].Swap(swapRequest.FirstPostion, swapRequest.SecondPostion)) { - IO.SendEncryptedMessage - ( - new SwapResponse() { - LobbyName = swapRequest.LobbyName, - GenericResponse = new GenericResponse() { - Success = true, - LogMessage = "Swap Successful" - } - }, - clientID, - _clients[clientID].SymmetricKey, - _clients[clientID].ClientSocket, - _encryptor, - new AsyncCallback(TCPSendCallback) - ); - } else { - IO.SendEncryptedMessage - ( - new SwapResponse() { - LobbyName = swapRequest.LobbyName, - GenericResponse = new GenericResponse() { - Success = false, - LogMessage = "Swap failed" - } - }, - clientID, - _clients[clientID].SymmetricKey, - _clients[clientID].ClientSocket, - _encryptor, - new AsyncCallback(TCPSendCallback) - ); - } - - _lobbiesLock.ExitUpgradeableReadLock(); - _clientsLock.ExitReadLock(); - } - - private void HandleServerInfoRequest(ServerInfoRequest request, string clientID) { - _logger.LogInformation(clientID + " has requested server info"); - - _clientsLock.EnterReadLock(); - _lobbiesLock.EnterReadLock(); - - if (_clients.ContainsKey(clientID)) { - var response = new ServerInfoResponse(); - response.GenericResponse = new GenericResponse() { Success = true }; - response.CurrentName = _clients[clientID].Name; - response.CurrentLobby = _clients[clientID].CurrentLobby; - foreach (var l in _lobbies) { - response.Lobbies.Add(l.Value.ToProtobuf()); - } - IO.SendEncryptedMessage( - response, - clientID, - _clients[clientID].SymmetricKey, - _clients[clientID].ClientSocket, - _encryptor, - new AsyncCallback(TCPSendCallback) - ); - } else { - _logger.LogError($"No client with ID '{clientID}'"); - } - - _lobbiesLock.ExitReadLock(); - _clientsLock.ExitReadLock(); - } - - private void HandleChangeNameRequest(ChangeNameRequest changeNameRequest, string clientID) - { - _logger.LogInformation(clientID + " has requested server info"); - - _clientsLock.EnterUpgradeableReadLock(); - if (_clients.ContainsKey(clientID)) - { - _clientsLock.EnterWriteLock(); - _clients[clientID].Name = changeNameRequest.Name; - if (_clients[clientID].Name == null) { _clients[clientID].Name = string.Empty; } - _clientsLock.ExitWriteLock(); - IO.SendEncryptedMessage( - new ChangeNameResponse() - { - Name = _clients[clientID].Name, - GenericResponse = new GenericResponse() - { - Success = true, - LogMessage = "Successfully renamed client" - } - }, - clientID, - _clients[clientID].SymmetricKey, - _clients[clientID].ClientSocket, - _encryptor, - new AsyncCallback(TCPSendCallback) - ); - - } - else - { - _logger.LogError($"No client with ID '{clientID}'"); - } - _clientsLock.ExitUpgradeableReadLock(); - } - - private void HandleDisconnectRequest(DisconnectRequest disconnectRequest, string clientID) - { - _logger.LogInformation(clientID + " has requested to disconnect"); - - _clientsLock.EnterUpgradeableReadLock(); - if (_clients.ContainsKey(clientID)) - { - _clientsLock.EnterWriteLock(); - if (!_clients[clientID].CurrentLobby.Equals(string.Empty)) - { - _lobbiesLock.EnterWriteLock(); - _lobbies[_clients[clientID].CurrentLobby].TryRemoveClient(_clients[clientID]); - _lobbiesLock.ExitWriteLock(); - _clients[clientID].CurrentLobby = string.Empty; - } - - _clients[clientID].ClientSocket.Disconnect(false); - _clients[clientID].ClientSocket.Close(); - _logger.LogInformation($"{clientID} is disconnected. Bye bye"); - _clients.Remove(clientID); - _clientsLock.ExitWriteLock(); - } - _clientsLock.ExitUpgradeableReadLock(); - } - - - - private void StartLobby(string lobbyName) { - _lobbiesLock.EnterWriteLock(); - _lobbies.Remove(lobbyName, out Lobby lobby); - _lobbies[lobbyName].Start(); - _lobbiesLock.ExitWriteLock(); - - MatchStart startMsg = new MatchStart() { - UdpPort = _udpPort - }; - - _clientsLock.EnterReadLock(); - for (int i = 0; i < lobby.Clients.Count; i++) { - IO.SendEncryptedMessage(startMsg, lobby.Clients[i].ID, lobby.Clients[i].SymmetricKey, lobby.Clients[i].ClientSocket, _encryptor, new AsyncCallback(TCPSendCallback)); - } - - // makes sure all clients are ready to start within the timeout window - long start = System.DateTimeOffset.Now.ToUnixTimeMilliseconds(); - bool allSet = true; - while (System.DateTimeOffset.Now.ToUnixTimeMilliseconds() - start <= 5000) { - _clientsLock.EnterReadLock(); - foreach (ClientData x in lobby.Clients) { - if (x.UDPEndPoint == null) { - allSet = false; - } - } - if (allSet) { - _clientsLock.ExitReadLock(); - break; - } - _clientsLock.ExitReadLock(); - Thread.Sleep(200); - } - - _clientsLock.EnterUpgradeableReadLock(); - if (allSet) - { - ConnectionDataHost hostMsg = new ConnectionDataHost(); - foreach (var client in lobby.Clients) - { - hostMsg.Clients.Add(client.ID, new IPEndpoint() { IpAddress = client.UDPEndPoint.Address.ToString(), Port = client.UDPEndPoint.Port }); - } - - ConnectionDataClient clientMsg = new ConnectionDataClient() - { - HostEp = new IPEndpoint() { IpAddress = lobby.Host.UDPEndPoint.Address.ToString(), Port = lobby.Host.UDPEndPoint.Port }, - HostId = lobby.Host.ID - }; - - foreach (ClientData client in lobby.Clients) - { - if (lobby.Host.Equals(client)) - { - IO.SendEncryptedMessage(hostMsg, client.ID, client.SymmetricKey, client.ClientSocket, _encryptor, new AsyncCallback(TCPSendCallback)); - } - else - { - IO.SendEncryptedMessage(clientMsg, client.ID, client.SymmetricKey, client.ClientSocket, _encryptor, new AsyncCallback(TCPSendCallback)); - } - _clientsLock.EnterWriteLock(); - _clients.Remove(client.ID); - _clientsLock.ExitWriteLock(); - } - } - else - { - MatchStartFailure msg = new MatchStartFailure(); - foreach (ClientData client in lobby.Clients) - { - IO.SendEncryptedMessage(msg, client.ID, client.SymmetricKey, client.ClientSocket, _encryptor, new AsyncCallback(TCPSendCallback)); - } - } - _clientsLock.ExitUpgradeableReadLock(); - } - - private void CheckHeartbeats(long clientTimeout) { - _clientsLock.EnterUpgradeableReadLock(); - foreach (string client in _clients.Keys) { - if (System.DateTimeOffset.Now.ToUnixTimeMilliseconds() - _clients[client].LastHeartbeat >= clientTimeout) { - _clientsLock.EnterWriteLock(); - _clients.Remove(client); - _clientsLock.ExitWriteLock(); - } - } - _clientsLock.ExitUpgradeableReadLock(); - } - - private void CheckLobbies() - { - _lobbiesLock.EnterUpgradeableReadLock(); - foreach (var lobby in _lobbies) - { - if (lobby.Value.Clients.Count <= 0) - { - _lobbiesLock.EnterWriteLock(); - _lobbies.Remove(lobby.Key); - _lobbiesLock.ExitWriteLock(); - } - } - _lobbiesLock.ExitUpgradeableReadLock(); - } - } -} \ No newline at end of file diff --git a/api/Patchbay/Server2.cs b/api/Patchbay/Server2.cs deleted file mode 100644 index 0b5cc14397..0000000000 --- a/api/Patchbay/Server2.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Net; -using System.Net.Sockets; -using Microsoft.Extensions.Logging; - -#nullable enable - -namespace Patchbay { - public class Server2 { - - private TcpListener _tcpListener; - private UdpClient _udpSocket; - - public Server2(ILogger logger, int udpPort, int tcpPort) { - - if (udpPort == tcpPort) { - logger.LogError("UDP and TCP can't operate on the same port"); - _udpSocket = null!; - _tcpListener = null!; - return; // TODO: Can I do this? Should I do this? - } - - // Create listeners and bind to ports - _udpSocket = new UdpClient(udpPort); - _tcpListener = new TcpListener(IPAddress.Parse("127.0.0.1"), tcpPort); - - // Setup listeners - _udpSocket.BeginReceive(new AsyncCallback(UdpReceiveCallback), null); - } - - private void UdpReceiveCallback(IAsyncResult result) { - if (!result.IsCompleted) { - // ? - return; - } - - IPEndPoint? ipep = null; - byte[] data = _udpSocket.EndReceive(result, ref ipep); - - - } - } -} \ No newline at end of file diff --git a/api/Patchbay/SynthesisService.cs b/api/Patchbay/SynthesisService.cs deleted file mode 100644 index adbd0a9c79..0000000000 --- a/api/Patchbay/SynthesisService.cs +++ /dev/null @@ -1,113 +0,0 @@ -using System; -using System.Diagnostics; -using System.Threading; -using System.Threading.Tasks; -using CommandLine; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; - -namespace SynthesisServer -{ - public enum Command - { - INVALID = -1, - START = 0, - STOP = 1, - RESTART = 2 - } - public class SynthesisService : IHostedService, IDisposable - { - - private readonly ILogger _logger; - private readonly IOptions _config; - - public SynthesisService(ILogger logger, IOptions config) - { - _logger = logger; - _config = config; - } - - public Task StartAsync(CancellationToken cancellationToken) - { - int status = Parser.Default.ParseArguments(_config.Value.Arguments).MapResult( - (StartCommand opts) => StartServer(opts), - (StopCommand opts) => StopServer(opts), - (RestartCommand opts) => RestartServer(opts), - errs => InvalidCommand()); - - return Task.CompletedTask; - } - - public Task StopAsync(CancellationToken cancellationToken) - { - Server.Instance.Stop(); - _logger.LogInformation("Stopping daemon."); - return Task.CompletedTask; - } - - public void Dispose() - { - _logger.LogInformation("Disposing..."); - } - - private int StartServer(StartCommand cmd) - { - - if (!cmd.Force && Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName).Length > 1) - { - _logger.LogInformation("An instance of: " + _config.Value.DaemonName + " is already running"); - Environment.Exit(0); - } else - { - Server.Instance.Start(_logger); - _logger.LogInformation("Starting Server"); - } - return (int)Command.START; - } - - private int StopServer(StopCommand cmd) - { - Process current = Process.GetCurrentProcess(); - Process[] processes = Process.GetProcessesByName(current.ProcessName); - - foreach (Process x in processes) - { - if (x.Id != current.Id) - { - x.Kill(); - } - } - - Environment.Exit(0); - return (int)Command.STOP; - } - - private int RestartServer(RestartCommand cmd) - { - Process current = Process.GetCurrentProcess(); - Process[] processes = Process.GetProcessesByName(current.ProcessName); - - foreach (Process x in processes) - { - if (x.Id != current.Id) - { - x.Kill(); - } - } - long time = System.DateTimeOffset.Now.ToUnixTimeMilliseconds(); - while (Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName).Length > 1 && System.DateTimeOffset.Now.ToUnixTimeMilliseconds() - time < cmd.Timeout) - { - Thread.Sleep(100); - } - return StartServer(new StartCommand() { Force = cmd.Force }); - } - - private int InvalidCommand() - { - _logger.LogError("Invalid command"); - Environment.Exit(0); - return (int)Command.INVALID; - } - } -} \ No newline at end of file diff --git a/api/Patchbay/Test/TestMessageHandling.cs b/api/Patchbay/Test/TestMessageHandling.cs deleted file mode 100644 index f1d7a2ec44..0000000000 --- a/api/Patchbay/Test/TestMessageHandling.cs +++ /dev/null @@ -1,23 +0,0 @@ -//using Google.Protobuf.WellKnownTypes; -//using NUnit.Framework; -//using SynthesisServer.Proto; -//using System; -//using System.Collections.Generic; -//using System.Text; - -//namespace SynthesisServer.Test { -// [TestFixture] -// public static class TestMessageHandling { -// [Test] -// public static void DoesThisWork() { -// var msg = new StatusMessage() { -// LogLevel = StatusMessage.Types.LogLevel.Error, -// Msg = "Invalid Message body" -// }; -// var any = Any.Pack(msg); -// // string a = any.; -// // string b = StatusMessage.Descriptor.FullName; -// Assert.True(true); -// } -// } -//} diff --git a/api/Patchbay/Test/TestMessages.cs b/api/Patchbay/Test/TestMessages.cs deleted file mode 100644 index eeac9c5065..0000000000 --- a/api/Patchbay/Test/TestMessages.cs +++ /dev/null @@ -1,273 +0,0 @@ -//using Google.Protobuf; -//using Google.Protobuf.WellKnownTypes; -//using NUnit.Framework; -//using Org.BouncyCastle.Crypto; -//using Org.BouncyCastle.Crypto.Digests; -//using Org.BouncyCastle.Crypto.Generators; -//using Org.BouncyCastle.Crypto.Parameters; -//using Org.BouncyCastle.Math; -//using Org.BouncyCastle.Security; -//using SynthesisServer.Proto; -//using SynthesisAPI.Aether; -//using System; -//using System.Collections.Generic; -//using System.Linq; -//using System.Net; -//using System.Net.Sockets; -//using System.Text; -//using System.Threading; -//using System.Threading.Tasks; - -//namespace SynthesisServer.Test -//{ -// // Run tests on a different machine from the server - -// [TestFixture] -// public static class TestMessages -// { -// // private static UdpClient _udpClient; -// private static Socket _tcpSocket; - -// private static int _tcpPort; -// // private static int _udpPort; -// private static IPAddress _serverIP; - -// // private static string _clientID; - -// private static SymmetricEncryptor _encryptor = default; -// private static AsymmetricCipherKeyPair _keyPair; -// private static DHParameters _dhParameters; -// private static byte[] _symmetricKey; - -// // private static bool _isRunning = false; - -// // private static Heartbeat _heartbeat; - -// private static void Init() -// { - - -// _tcpPort = 18001; -// // _udpPort = 18000; - -// _serverIP = IPAddress.Parse("76.144.67.63"); // Specify during actual test - -// _dhParameters = GenerateParameters(); -// _keyPair = GenerateKeys(_dhParameters); - -// _tcpSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); -// } - -// private static void GenerateSharedSecret(string importedPublicKey, DHParameters parameters) -// { -// _keyPair = GenerateKeys(parameters); - -// DHPublicKeyParameters importedPublicKeyParameters = new DHPublicKeyParameters(new BigInteger(importedPublicKey), parameters); -// IBasicAgreement internalKeyAgreement = AgreementUtilities.GetBasicAgreement("DH"); -// internalKeyAgreement.Init(_keyPair.Private); -// BigInteger sharedKey = internalKeyAgreement.CalculateAgreement(importedPublicKeyParameters); -// byte[] sharedKeyBytes = sharedKey.ToByteArray(); - -// IDigest digest = new Sha256Digest(); -// _symmetricKey = new byte[digest.GetDigestSize()]; -// digest.BlockUpdate(sharedKeyBytes, 0, sharedKeyBytes.Length); -// digest.DoFinal(_symmetricKey, 0); -// } - -// private static AsymmetricCipherKeyPair GenerateKeys(DHParameters parameters) -// { -// var keyGen = GeneratorUtilities.GetKeyPairGenerator("DH"); -// var kgp = new DHKeyGenerationParameters(new SecureRandom(), parameters); -// keyGen.Init(kgp); -// return keyGen.GenerateKeyPair(); -// } - -// private static DHParameters GenerateParameters() -// { -// DHParametersGenerator generator = new DHParametersGenerator(); -// generator.Init(1024, 80, new SecureRandom()); // not too sure about these numbers -// return generator.GenerateParameters(); -// } - -// private static void SendMessage(IMessage msg, Socket socket) -// { -// Any packedMsg = Any.Pack(msg); -// byte[] msgBytes = new byte[packedMsg.CalculateSize()]; -// packedMsg.WriteTo(msgBytes); - -// MessageHeader header = new MessageHeader() { IsEncrypted = false }; -// byte[] headerBytes = new byte[header.CalculateSize()]; -// header.WriteTo(headerBytes); - -// byte[] data = new byte[sizeof(int) + headerBytes.Length + sizeof(int) + msgBytes.Length]; - -// BitConverter.GetBytes(headerBytes.Length).CopyTo(data, 0); -// headerBytes.CopyTo(data, sizeof(int)); - -// BitConverter.GetBytes(msgBytes.Length).CopyTo(data, sizeof(int) + headerBytes.Length); -// msgBytes.CopyTo(data, sizeof(int) + headerBytes.Length + sizeof(int)); - -// if (BitConverter.IsLittleEndian) { Array.Reverse(data); } -// socket.Send(data); -// } - -// private static void SendEncryptedMessage(IMessage msg, Socket socket) -// { -// Any packedMsg = Any.Pack(msg); -// byte[] msgBytes = new byte[packedMsg.CalculateSize()]; -// packedMsg.WriteTo(msgBytes); - -// byte[] delimitedMessage = new byte[sizeof(int) + msgBytes.Length]; -// BitConverter.GetBytes(msgBytes.Length).CopyTo(delimitedMessage, 0); -// msgBytes.CopyTo(delimitedMessage, sizeof(int)); - -// byte[] encryptedMessage = _encryptor.Encrypt(delimitedMessage, _symmetricKey); - -// MessageHeader header = new MessageHeader() { IsEncrypted = true }; -// byte[] headerBytes = new byte[header.CalculateSize()]; -// header.WriteTo(headerBytes); - -// byte[] data = new byte[sizeof(int) + headerBytes.Length + encryptedMessage.Length]; - -// BitConverter.GetBytes(headerBytes.Length).CopyTo(data, 0); -// headerBytes.CopyTo(data, sizeof(int)); - -// encryptedMessage.CopyTo(data, sizeof(int) + headerBytes.Length); - -// if (BitConverter.IsLittleEndian) { Array.Reverse(data); } -// socket.Send(data); -// } - -// private static byte[] GetNextMessage(ref byte[] buffer) -// { -// byte[] msgLength = new byte[sizeof(int)]; -// Array.Copy(buffer, 0, msgLength, 0, msgLength.Length); - -// byte[] msg = new byte[BitConverter.ToInt32(msgLength)]; -// Array.Copy(buffer, sizeof(int), msg, 0, msg.Length); - -// buffer = buffer.Skip(msgLength.Length + msg.Length).ToArray(); -// return msg; -// } - -// [Test] -// public static void TestExchange() -// { -// Init(); -// while (!_tcpSocket.Connected) -// { -// try -// { -// _tcpSocket.Connect(_serverIP, _tcpPort); -// } -// catch (SocketException e) -// { -// System.Diagnostics.Debug.WriteLine(e); -// } -// } - -// // Connection to server established! -// Assert.IsTrue(_tcpSocket.Connected); - -// SendMessage -// ( -// new KeyExchange() -// { -// G = _dhParameters.G.ToString(), -// P = _dhParameters.P.ToString(), -// PublicKey = ((DHPublicKeyParameters)_keyPair.Public).Y.ToString() -// }, -// _tcpSocket -// ); - -// byte[] buffer = new byte[4096]; -// int rec = _tcpSocket.Receive(buffer); -// byte[] data = new byte[rec]; -// Array.Copy(buffer, data, rec); -// if (BitConverter.IsLittleEndian) { Array.Reverse(data); } - -// MessageHeader header = MessageHeader.Parser.ParseFrom(GetNextMessage(ref data)); - -// // Recieved a non-encrypted header -// Assert.IsTrue(!header.IsEncrypted); - -// if (!header.IsEncrypted) -// { -// Any message = Any.Parser.ParseFrom(GetNextMessage(ref data)); -// if (message.Is(KeyExchange.Descriptor)) -// { -// // Received a key exchange message! -// Assert.IsTrue(true); -// } -// } -// } - -// /* -// [Test] -// public static void TestAllHandshakes() -// { -// _isRunning = true; -// Init(); -// while (!_tcpSocket.Connected) -// { -// try -// { -// _tcpSocket.Connect(_serverIP, _tcpPort); -// } -// catch (SocketException e) -// { -// System.Diagnostics.Debug.WriteLine(e); -// } -// } - -// // Connection to server established! -// Assert.IsTrue(_tcpSocket.Connected); - -// SendMessage -// ( -// new KeyExchange() -// { -// G = _dhParameters.G.ToString(), -// P = _dhParameters.P.ToString(), -// PublicKey = ((DHPublicKeyParameters)_keyPair.Public).Y.ToString() -// }, -// _tcpSocket -// ); - -// byte[] buffer = new byte[4096]; -// int rec = _tcpSocket.Receive(buffer); -// byte[] data = new byte[rec]; -// Array.Copy(buffer, data, rec); -// if (BitConverter.IsLittleEndian) { Array.Reverse(data); } - -// MessageHeader header = MessageHeader.Parser.ParseFrom(GetNextMessage(ref data)); - -// Assert.IsFalse(header.IsEncrypted); -// Any message = Any.Parser.ParseFrom(GetNextMessage(ref data)); -// Assert.IsTrue(message.Is(KeyExchange.Descriptor)); - -// GenerateSharedSecret(message.Unpack().PublicKey, _dhParameters); -// _clientID = message.Unpack().ClientId; -// System.Diagnostics.Debug.WriteLine(BitConverter.ToString(_symmetricKey)); - -// _heartbeat = new Heartbeat() -// { -// ClientId = _clientID -// }; - - -// Task.Run(() => -// { -// while (_isRunning) -// { -// SendEncryptedMessage(_heartbeat, _tcpSocket); -// Thread.Sleep(500); -// } -// }); - - - -// } -// */ -// } -//} diff --git a/api/Patchbay/appsettings.json b/api/Patchbay/appsettings.json deleted file mode 100644 index 69619da482..0000000000 --- a/api/Patchbay/appsettings.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Settings": { - "Version": "1.0", - "DaemonName": "Synthesisd", - "Port": 10800, - "LobbyTimeout": 43200, - "MaxLobbies": -1, - "HeartbeatInterval": 5 - } -} \ No newline at end of file diff --git a/api/Patchbay/install.bat b/api/Patchbay/install.bat deleted file mode 100644 index 3dcef2ce33..0000000000 --- a/api/Patchbay/install.bat +++ /dev/null @@ -1,12 +0,0 @@ -@echo off -dotnet publish SynthesisServer.csproj --runtime win-x64 --framework netcoreapp3.1 --self-contained true --output bin/win -dotnet publish SynthesisServer.csproj --runtime osx-x64 --framework netcoreapp3.1 --self-contained true --output bin/osx -dotnet publish SynthesisServer.csproj --runtime linux-x64 --framework netcoreapp3.1 --self-contained true --output bin/linux/glibc -dotnet publish SynthesisServer.csproj --runtime linux-musl-x64 --framework netcoreapp3.1 --self-contained true --output bin/linux/musl -dotnet publish SynthesisServer.csproj --runtime linux-arm --framework netcoreapp3.1 --self-contained true --output bin/linux/arm - -copy appsettings.json bin\win\ -copy appsettings.json bin\osx\ -copy appsettings.json bin\linux\glibc -copy appsettings.json bin\linux\musl -copy appsettings.json bin\linux\arm \ No newline at end of file diff --git a/api/Patchbay/install.sh b/api/Patchbay/install.sh deleted file mode 100644 index ff424b4cf2..0000000000 --- a/api/Patchbay/install.sh +++ /dev/null @@ -1,13 +0,0 @@ -!#/bin/sh - -dotnet publish SynthesisServer.csproj --runtime win-x64 --framework netcoreapp3.1 --self-contained true --output bin/win -dotnet publish SynthesisServer.csproj --runtime osx-x64 --framework netcoreapp3.1 --self-contained true --output bin/osx -dotnet publish SynthesisServer.csproj --runtime linux-x64 --framework netcoreapp3.1 --self-contained true --output bin/linux/glibc -dotnet publish SynthesisServer.csproj --runtime linux-musl-x64 --framework netcoreapp3.1 --self-contained true --output bin/linux/musl -dotnet publish SynthesisServer.csproj --runtime linux-arm --framework netcoreapp3.1 --self-contained true --output bin/linux/arm - -cp appsettings.json bin/win -cp appsettings.json bin/osx -cp appsettings.json bin/linux/glibc -cp appsettings.json bin/linux/musl -cp appsettings.json bin/linux/arm \ No newline at end of file diff --git a/api/Patchbay/synthesis_server.service b/api/Patchbay/synthesis_server.service deleted file mode 100644 index 9def60f480..0000000000 --- a/api/Patchbay/synthesis_server.service +++ /dev/null @@ -1,16 +0,0 @@ -[Unit] -Description=Synthesis Server -After=network.target - -[Service] -Type=simple # might be forking except main process never dies -ExecStart=SynthesisServer --start --config /etc/synthesis/server/appsettings.json # directory subject to change -Restart=on-failure - -# The install section is needed to use -# `systemctl enable` to start on boot -# For a user service that you want to enable -# and start automatically, use `default.target` -# For system level services, use `multi-user.target` -[Install] -WantedBy=multi-user.target \ No newline at end of file diff --git a/api/README.md b/api/README.md deleted file mode 100644 index f104176ab0..0000000000 --- a/api/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# Synthesis API - -[![API](https://github.com/Autodesk/synthesis/actions/workflows/API.yml/badge.svg?branch=master)](https://github.com/Autodesk/synthesis/actions/workflows/API.yml) - -The Synthesis API contains parts of Synthesis that can remain mostly Unity abnostic. The end goal of this API is to extend Synthesis' functionality via a reliable set of tools that will be reused throughout future iterations of Synthesis, no matter where it may go. - -## Getting Started - -For more information on cloning this repository and the initial setup of the Synthesis codebase please visit the [Getting Started](/README.md#getting-started) section of the root *README*. - -### Dependencies - -Similar to the rest of Synthesis, the Synthesis API has the following dependencies that need to be satisfied before attempting to build Synthesis or the Synthesis API. - -- [.NET Standard 2.0](https://learn.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-1-0) -- [.NET 7.0](https://dotnet.microsoft.com/en-us/download/dotnet/7.0) -- [Protobuf 23.3](https://github.com/protocolbuffers/protobuf/releases/tag/v23.3) -- [Visual Studio 2017](https://visualstudio.microsoft.com/downloads/) or newer (recommended) - -You can either install these dependencies manually or use the *resolve dependencies* scripts (`scripts/win/resolve_deps.bat` & `scripts/osx/resolve_deps.sh` respectively) to install some of them for you. - -To automatically install .NET and Protobuf run the following script depending on your operating system: -- Windows: [`/scripts/win/resolve_deps.bat`](/scripts/win/resolve_deps.bat) -- MacOS & Linux: [`/scripts/osx/resolve_deps.sh`](/scripts/osx/resolve_deps.sh) - -Note that the windows script requires admin privileges to install .NET and Protobuf to the system PATH. For this reason it is not included by default in `init.bat` unlike how `init.sh` includes `resolve_deps.sh`. - -### How To Build The API With An `init` Script - -Synthesis comes with a robust build system that includes an `init` script that will automatically compile and link each part of Synthesis together. This is the recommended way to build Synthesis and the Synthesis API. - -To build the API with an `init` script first ensure that all dependencies are resolved. Then run the following command based on your operating system in the [root](../) of this repository: - -- Windows: `init.bat` -- MacOS & Linux: `init.sh` - -### How To Build The API With The API Build Scripts - -The Synthesis API comes with it's own build scripts to simplify the process of building the API from the command line. First ensure that all dependencies are resolved. Then run the following command based on your operating system in the [api](/api/) directory of this repository: - -- Windows: `build.bat` -- MacOS & Linux: `build.sh` - -### How To Build The API With Visual Studio - -1. Open Visual Studio 2017 or newer. -2. Select `Open Project or Solution`. -3. Choose `api.sln` from the [api](/api/) directory of this repository. - - For more information about cloning this repository please visit the [Getting Started](/README.md#getting-started) section of the root *README*. -4. Select `Build Solution` from the Visual Studio toolbar or hit `Ctrl + Shift + B` to build the API. diff --git a/api/TestApi/Program.cs b/api/TestApi/Program.cs deleted file mode 100644 index 0a55164805..0000000000 --- a/api/TestApi/Program.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; - -namespace TestApi -{ - public class Program - { - public static string TestModuleName = "TestModule"; - - public static void Main(string[] args) - { - - } - } -} diff --git a/api/TestApi/TestAnalytics.cs b/api/TestApi/TestAnalytics.cs deleted file mode 100644 index 8cd81fb312..0000000000 --- a/api/TestApi/TestAnalytics.cs +++ /dev/null @@ -1,102 +0,0 @@ -using System; -using SynthesisAPI.EventBus; -using NUnit.Framework; -using System.Threading; - -namespace TestApi -{ - [TestFixture] - public static class TestAnalytics - { - public class TestEvent : IEvent - { - public object[] GetArguments() => new object[] { }; - } - - [Test] - public static void TestSetUnityPrefs() - { - Analytics.SetUnityPrefs("testGUID", false); - Assert.AreEqual("testGUID", Analytics.GUID); - Assert.AreEqual(false, Analytics.DataCollection); - Analytics.SetUnityPrefs("testGUID", true); - Assert.AreEqual("testGUID", Analytics.GUID); - Assert.AreEqual(true, Analytics.DataCollection); - } - - [Test] - public static void TestLogTime() - { - Analytics.SetUnityPrefs("testGUID", true); - Analytics.LogTiming(Analytics.TimingCategory.Main, Analytics.TimingVariable.Viewing, Analytics.TimingLabel.MainSimMenu, 1000); - Analytics.UploadDump(); - } - - [Test] - public static void TestLogTimeAsync() - { - Analytics.SetUnityPrefs("testGUID", true); - var task = Analytics.LogTimingAsync(Analytics.TimingCategory.Main, Analytics.TimingVariable.Viewing, Analytics.TimingLabel.MainSimMenu, 100); - task.Wait(); - var task2 = Analytics.UploadDumpAsync(); - task2.Wait(); - } - - [Test] - public static void TestLogElapsedTime() - { - Analytics.SetUnityPrefs("testGUID", true); - Analytics.StartTime(Analytics.TimingLabel.MainSimMenu, Analytics.TimingVariable.Viewing, 0); - Analytics.LogElapsedTime(Analytics.TimingCategory.Main, Analytics.TimingVariable.Viewing, Analytics.TimingLabel.MainSimMenu, 100); - Analytics.UploadDump(); - } - - [Test] - public static void TestLogElapsedTimeAsync() - { - Analytics.SetUnityPrefs("testGUID", true); - Analytics.StartTime(Analytics.TimingLabel.MainSimMenu, Analytics.TimingVariable.Viewing, 0); - var task = Analytics.LogElapsedTimeAsync(Analytics.TimingCategory.Main, Analytics.TimingVariable.Viewing, Analytics.TimingLabel.MainSimMenu, 100); - task.Wait(); - var task2 = Analytics.UploadDumpAsync(); - task2.Wait(); - } - - [Test] - public static void TestLogEvent() - { - Analytics.SetUnityPrefs("testGUID", true); - Analytics.LogEvent(Analytics.EventCategory.AddRobot, Analytics.EventAction.Clicked, "testlabel", 10); - Analytics.UploadDump(); - } - - [Test] - public static void TestLogEventAsync() - { - Analytics.SetUnityPrefs("testGUID", true); - var task = Analytics.LogEventAsync(Analytics.EventCategory.AddRobot, Analytics.EventAction.Clicked, "testlabel", 10); - task.Wait(); - var task2 = Analytics.UploadDumpAsync(); - task2.Wait(); - } - - [Test] - public static void TestLogScreenview() - { - Analytics.SetUnityPrefs("testGUID", true); - Analytics.LogScreenView(Analytics.ScreenName.MainSimMenu); - Analytics.UploadDump(); - } - - [Test] - public static void TestLogScreenviewAsync() - { - Analytics.SetUnityPrefs("testGUID", true); - var task = Analytics.LogScreenViewAsync(Analytics.ScreenName.MainSimMenu); - task.Wait(); - var task2 = Analytics.UploadDumpAsync(); - task2.Wait(); - } - - } -} diff --git a/api/TestApi/TestApi.csproj b/api/TestApi/TestApi.csproj deleted file mode 100644 index b490408745..0000000000 --- a/api/TestApi/TestApi.csproj +++ /dev/null @@ -1,32 +0,0 @@ - - - - Exe - net7.0 - false - TestApi.Program - - - - - - - - - - - - - - - - - - - - - ..\libs\UnityEngine.dll - - - - diff --git a/api/TestApi/TestAssetManager.cs b/api/TestApi/TestAssetManager.cs deleted file mode 100644 index 6596636e37..0000000000 --- a/api/TestApi/TestAssetManager.cs +++ /dev/null @@ -1,177 +0,0 @@ -using System; -using System.IO; -using SynthesisAPI.AssetManager; -using SynthesisAPI.VirtualFileSystem; -using NUnit.Framework; -using SynthesisAPI.EventBus; -using System.Collections.Generic; -using SynthesisAPI.Modules.Attributes; - -namespace TestApi -{ - [TestFixture] - public static class TestAssetManager - { - - [OneTimeSetUp] - public static void Init() - { - if (!System.IO.Directory.Exists(FileSystem.TestPath)) - { - System.IO.Directory.CreateDirectory(FileSystem.TestPath); - } - - string text_string = "Hello World!"; - - if (!File.Exists(FileSystem.TestPath + "test.txt")) - { - File.WriteAllText(FileSystem.TestPath + "test.txt", text_string); - } - - string json_string = "{\n\t\"Text\": \"Hello world of JSON!\"\n}"; - - if (!File.Exists(FileSystem.TestPath + "test.json")) - { - File.WriteAllText(FileSystem.TestPath + "test.json", json_string); - } - - string xml_string = "\n\tHello world of XML!\n"; - - if (!File.Exists(FileSystem.TestPath + "test.xml")) - { - File.WriteAllText(FileSystem.TestPath + "test.xml", xml_string); - } - } - - [OneTimeTearDown] - public static void Teardown() - { - if (System.IO.Directory.Exists(FileSystem.TestPath)) - { - System.IO.Directory.Delete(FileSystem.TestPath, true); - } - } - - [Test] - public static void TestPlainText() - { - TextAsset testTxt = AssetManager.Import("text/plain", false, "/temp", "test2.txt", Permissions.PublicReadWrite, $"test{Path.DirectorySeparatorChar}test.txt"); - - TextAsset test = AssetManager.GetAsset("/temp/test2.txt"); - - Assert.AreSame(testTxt, test); - - Assert.AreEqual("Hello World!", testTxt?.ReadToEnd()); - } - - [Test] - public static void TestXml() - { - var testXml = AssetManager.Import("text/xml", false, "/temp", "test.xml", Permissions.PublicReadWrite, $"test{Path.DirectorySeparatorChar}test.xml"); - - var test = AssetManager.GetAsset("/temp/test.xml"); - - Assert.AreSame(testXml, test); - - var obj = testXml?.Deserialize(); - - Assert.AreEqual("Hello world of XML!", obj?.Text); - } - - [Test] - public static void TestJson() - { - var testJson = AssetManager.Import("text/json", false, "/temp", "test.json", Permissions.PublicReadWrite, $"test{Path.DirectorySeparatorChar}test.json"); - - var test = AssetManager.GetAsset("/temp/test.json"); - - Assert.AreSame(testJson, test); - - var obj = test?.Deserialize(); - - Assert.AreEqual("Hello world of JSON!", obj?.Text); - } - - [Test] - public static void TestLazyImport() - { - var testJson = AssetManager.ImportLazy("text/json", false, "/temp", "test_lazy.json", Permissions.PublicReadWrite, $"test{Path.DirectorySeparatorChar}test.json"); - - Assert.NotNull(testJson); - - var testLazy = AssetManager.GetAsset("/temp/test_lazy.json"); - - Assert.True(testLazy is LazyAsset); - - ((LazyAsset)testLazy).Load(); - - var testContents = AssetManager.GetAsset("/temp/test_lazy.json"); - - Assert.True(testContents is JsonAsset); - - var obj = ((JsonAsset)testContents).Deserialize(); - - Assert.AreEqual("Hello world of JSON!", obj?.Text); - } - - [Test] - public static void TestTypeFromFileExtension() - { - string source = $"test{Path.DirectorySeparatorChar}test.json"; - string type = AssetManager.GetTypeFromFileExtension(source); - var testJson = AssetManager.Import(type, false, "/temp", "test2.json", Permissions.PublicReadWrite, source); - - var test = AssetManager.GetAsset("/temp/test2.json"); - - Assert.AreSame(testJson, test); - } - - - [Test] - public static void TestCreatePathWithImport() - { - var testJson = AssetManager.Import("text/json", false, "/modules/module1", "test.json", Permissions.PublicReadWrite, $"test{Path.DirectorySeparatorChar}test.json"); - - var test = AssetManager.GetAsset("/modules/module1/test.json"); - - Assert.AreSame(testJson, test); - } - - private class AssetImportSubscriber - { - static public List Events { get; private set; } = new List(); - - [TaggedCallback(AssetImportEvent.Tag)] - public static void Handler(AssetImportEvent e) - { - Events.Add(e); - } - } - - [Test] - public static void TestAssetImportEvent() - { - string location = "/temp"; - string name = "test3.txt"; - string type = "text/plain"; - - AssetManager.Import(type, false, location, name, Permissions.PublicReadWrite, $"test{Path.DirectorySeparatorChar}test.txt"); - - Assert.AreEqual(1, AssetImportSubscriber.Events.Count); - Assert.AreEqual(3, AssetImportSubscriber.Events[0].GetArguments().Length); - Assert.AreEqual(name, AssetImportSubscriber.Events[0].GetArguments()[0]); - Assert.AreEqual(location, AssetImportSubscriber.Events[0].GetArguments()[1]); - Assert.AreEqual(type, AssetImportSubscriber.Events[0].GetArguments()[2]); - - EventBus.ResetAllListeners(); - } - - /* - [Test] - public static void TestGltf() - { - // TODO test GLTFAsset - } - */ - } -} diff --git a/api/TestApi/TestEnvironmentManager.cs b/api/TestApi/TestEnvironmentManager.cs deleted file mode 100644 index f6ba3dcef7..0000000000 --- a/api/TestApi/TestEnvironmentManager.cs +++ /dev/null @@ -1,140 +0,0 @@ -using SynthesisAPI.EnvironmentManager; -using NUnit.Framework; - -namespace TestApi -{ - [TestFixture] - public static class TestEnivornmentManager - { - - [SetUp] - public static void SetUp() - { - EnvironmentManager.Clear(); - } - - [Test] - public static void TestEntity() - { - uint aActual = 5; - uint bActual = 6; - Entity a = aActual; - Entity b = bActual; - - Assert.True(aActual == a); - Assert.True(a.Equals(aActual)); - Assert.True(aActual.Equals(a)); - - Assert.AreNotEqual(a, b); - - b = aActual; - Assert.AreEqual(a, b); - Assert.AreEqual(aActual.ToString(), a.ToString()); - } - - [Test] - public static void TestAddEntity() - { - Entity e1 = EnvironmentManager.AddEntity(); - Assert.True(EnvironmentManager.EntityExists(e1)); - Assert.True(e1.EntityExists()); - Assert.AreEqual(e1, (Entity)1); - Entity e2 = EnvironmentManager.AddEntity(); - Assert.True(EnvironmentManager.EntityExists(e2)); - Assert.True(e2.EntityExists()); - Assert.AreNotEqual(e1, e2); - } - - [Test] - public static void TestMultiComponents() - { - Entity e1 = EnvironmentManager.AddEntity(); - Assert.True(e1.EntityExists()); - Entity e2 = EnvironmentManager.AddEntity(); - Assert.True(e2.EntityExists()); - TestComponent t = e2.AddComponent(); //EnvironmentManager.SetComponent(e2,t) - AnotherTestComponent at = e2.AddComponent(); - Assert.Null(e1.GetComponent(typeof(TestComponent))); - Assert.Null(e1.GetComponent(typeof(AnotherTestComponent))); - Assert.Null(e1.GetComponent()); - Assert.Null(e1.GetComponent()); - Assert.AreSame(e2.GetComponent(typeof(TestComponent)), t); - Assert.AreSame(e2.GetComponent(typeof(AnotherTestComponent)), at); - Assert.AreSame(e2.GetComponent(), t); - Assert.AreSame(e2.GetComponent(), at); - TestComponent t2 = e2.AddComponent(); - Assert.AreSame(e2.GetComponent(), t2); - } - [Test] - public static void TestRemoveEntity() - { - Entity e1 = EnvironmentManager.AddEntity(); - Assert.True(e1.EntityExists()); - Assert.True(e1.RemoveEntity()); - Assert.False(e1.RemoveEntity()); - Assert.False(e1.EntityExists()); - } - - [Test] - public static void TestRemoveComponent() - { - Entity e1 = EnvironmentManager.AddEntity(); - Assert.True(e1.EntityExists()); - TestComponent t = e1.AddComponent(); - Assert.AreSame(e1.GetComponent(), t); - e1.RemoveComponent(); - Assert.Null(e1.GetComponent()); - } - - [Test] - public static void TestGenerationIndexes() - { - Entity e1 = EnvironmentManager.AddEntity(); - Assert.True(e1.EntityExists()); - TestComponent t = e1.AddComponent(); - Assert.AreEqual(e1.GetComponent(), t); - Assert.True(e1.RemoveEntity()); - Assert.False(e1.RemoveEntity()); - Assert.False(e1.EntityExists()); - Entity e2 = EnvironmentManager.AddEntity(); - Assert.True(e2.EntityExists()); - Assert.AreEqual(e1 >> 16, e2 >> 16); - Assert.AreNotEqual(e1 & 65535, e2 & 65535); - Assert.Null(e2.GetComponent()); - } - - [Test] - public static void TestBadEntity() - { - - Entity e1 = 1; - Assert.False(e1.EntityExists()); - Assert.False(e1.RemoveEntity()); - Assert.Null(e1.GetComponent()); - TestComponent t = e1.AddComponent(); - Assert.Null(e1.GetComponent()); - EnvironmentManager.AddEntity(); - Entity e2 = 2; - Assert.False(e2.EntityExists()); - Assert.False(e2.RemoveEntity()); - Assert.Null(e2.GetComponent()); - e2.AddComponent(); - Assert.Null(e2.GetComponent()); - } - } - - /// - /// Empty Component class for testing - /// - class TestComponent : Component - { - - } - /// - /// Another empty Component class for testing - /// - class AnotherTestComponent : Component - { - - } -} diff --git a/api/TestApi/TestEventBus.cs b/api/TestApi/TestEventBus.cs deleted file mode 100644 index ee96eccd12..0000000000 --- a/api/TestApi/TestEventBus.cs +++ /dev/null @@ -1,211 +0,0 @@ -using System; -using NUnit.Framework; -using SynthesisAPI.EventBus; -using SynthesisAPI.Utilities; - -namespace TestApi -{ - public class TestEvent : IEvent - { - public object[] GetArguments() => new object[] { }; - } - - public class OtherEvent : IEvent - { - public object[] GetArguments() => new object[] { }; - } - - public class ParameterizedEvent : IEvent - { - public readonly int NumberArg; - public readonly string StringArg; - - public ParameterizedEvent(int numberArg, string stringArg) - { - NumberArg = numberArg; - StringArg = stringArg; - } - } - - public class Subscriber - { - public int Count1; - public int Count2; - - public int Num; - public string String; - - public Subscriber() - { - Count1 = 0; - Count2 = 0; - } - - public void TestMethod(IEvent e) - { - Count1 += 1; - } - - public void TestMethod2(IEvent e) - { - Count2 += 1; - } - - public void TestMethod3(IEvent e) - { - Count1 -= 1; - } - - public void TestMethod4(IEvent e) - { - if (e is ParameterizedEvent paramEvent) - { - Num = paramEvent.NumberArg; - String = paramEvent.StringArg; - } - else - { - throw new Exception(); - } - } - } - - [TestFixture] - public static class TestEventBus - { - [Test] - public static void TestSingleSubscriber() - { - Subscriber s = new Subscriber(); - EventBus.NewTagListener("tag", s.TestMethod); - EventBus.NewTypeListener(s.TestMethod2); - Assert.IsTrue(EventBus.Push(new TestEvent())); - Assert.IsTrue(EventBus.Push(new TestEvent())); - Assert.IsTrue(EventBus.Push("tag", new TestEvent())); - Assert.AreEqual(3, s.Count2); - Assert.AreEqual(1, s.Count1); - EventBus.ResetAllListeners(); - } - - [Test] - public static void TestMultipleTagEvent() - { - Subscriber s = new Subscriber(); - EventBus.NewTagListener("tag1", s.TestMethod); - EventBus.NewTagListener("tag2", s.TestMethod2); - Assert.IsTrue(EventBus.Push(new[] { "tag1", "tag2" }, new TestEvent())); - Assert.AreEqual(1, s.Count2); - Assert.AreEqual(1, s.Count1); - EventBus.ResetAllListeners(); - } - - [Test] - public static void TestMultipleTypeSubscriber() - { - Subscriber s = new Subscriber(); - EventBus.NewTypeListener(s.TestMethod); - Assert.IsTrue(EventBus.Push(new TestEvent())); - Assert.AreEqual(1, s.Count1); - Assert.AreEqual(0, s.Count2); - EventBus.NewTypeListener(s.TestMethod2); - EventBus.NewTypeListener(s.TestMethod3); - Assert.IsTrue(EventBus.Push(new TestEvent())); - Assert.AreEqual(1, s.Count1); - Assert.AreEqual(1, s.Count2); - EventBus.ResetAllListeners(); - } - - [Test] - public static void TestMultipleTagSubscriber() - { - Subscriber s = new Subscriber(); - EventBus.NewTagListener("tag", s.TestMethod); - Assert.IsTrue(EventBus.Push("tag", new TestEvent())); - Assert.AreEqual(1, s.Count1); - Assert.AreEqual(0, s.Count2); - EventBus.NewTagListener("tag", s.TestMethod2); - EventBus.NewTagListener("tag", s.TestMethod3); - Assert.IsTrue(EventBus.Push("tag", new TestEvent())); - Assert.AreEqual(1, s.Count1); - Assert.AreEqual(1, s.Count2); - EventBus.ResetAllListeners(); - } - - [Test] - public static void TestVariedTypes() - { - Subscriber s = new Subscriber(); - EventBus.NewTypeListener(s.TestMethod); - EventBus.NewTypeListener(s.TestMethod2); - EventBus.NewTagListener("tag", s.TestMethod3); - Assert.IsTrue(EventBus.Push("tag", new TestEvent())); - Assert.IsTrue(EventBus.Push("tag", new TestEvent())); - Assert.IsTrue(EventBus.Push("tag", new OtherEvent())); - Assert.AreEqual(-1, s.Count1); - Assert.AreEqual(1, s.Count2); - EventBus.ResetAllListeners(); - } - - [Test] - public static void TestPushToNonexistentTag() - { - Assert.IsFalse(EventBus.Push("tag", new TestEvent())); - } - - [Test] - public static void TestPushToNonexistentType() - { - Assert.IsFalse(EventBus.Push(new TestEvent())); - } - - [Test] - public static void TestTagListenerRemoval() - { - Subscriber s = new Subscriber(); - Subscriber s2 = new Subscriber(); - Assert.IsFalse(EventBus.RemoveTagListener("tag", s.TestMethod)); - EventBus.NewTagListener("tag", s.TestMethod); - EventBus.NewTagListener("tag", s2.TestMethod); - Assert.IsTrue(EventBus.Push("tag", new TestEvent())); - Assert.AreEqual(1, s.Count1); - Assert.AreEqual(1, s2.Count1); - Assert.IsTrue(EventBus.RemoveTagListener("tag", s.TestMethod)); - Assert.IsTrue(EventBus.Push("tag", new TestEvent())); - Assert.AreEqual(1, s.Count1); - Assert.AreEqual(2, s2.Count1); - EventBus.RemoveTagListener("tag", s.TestMethod); - Assert.IsTrue(EventBus.Push("tag", new TestEvent())); - Assert.AreEqual(1, s.Count1); - Assert.AreEqual(3, s2.Count1); - EventBus.ResetAllListeners(); - } - - [Test] - public static void TestTypeListenerRemoval() - { - Subscriber s = new Subscriber(); - Assert.IsFalse(EventBus.RemoveTypeListener(s.TestMethod)); - EventBus.NewTypeListener(s.TestMethod); - Assert.IsTrue(EventBus.Push(new TestEvent())); - Assert.AreEqual(1, s.Count1); - Assert.IsTrue(EventBus.RemoveTypeListener(s.TestMethod)); - Assert.IsFalse(EventBus.Push("tag", new TestEvent())); - Assert.AreEqual(1, s.Count1); - Assert.IsFalse(EventBus.RemoveTypeListener(s.TestMethod)); - Assert.IsFalse(EventBus.Push("tag", new TestEvent())); - Assert.AreEqual(1, s.Count1); - EventBus.ResetAllListeners(); - } - - [Test] - public static void TestParameterizedListener() - { - Subscriber s = new Subscriber(); - EventBus.NewTypeListener(s.TestMethod4); - EventBus.Push(new ParameterizedEvent(1, "test")); - Assert.AreEqual(1, s.Num); - Assert.AreEqual("test", s.String); - EventBus.ResetAllListeners(); - } - } -} diff --git a/api/TestApi/TestJsonObject.cs b/api/TestApi/TestJsonObject.cs deleted file mode 100644 index 555f1d70a8..0000000000 --- a/api/TestApi/TestJsonObject.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Newtonsoft.Json; - -namespace TestApi -{ - [JsonObject("TestJsonObject")] - public class TestJsonObject - { - [JsonProperty("Text")] - public string Text { get; set; } - } -} \ No newline at end of file diff --git a/api/TestApi/TestJsonSerialization.cs b/api/TestApi/TestJsonSerialization.cs deleted file mode 100644 index 3ea322c2f1..0000000000 --- a/api/TestApi/TestJsonSerialization.cs +++ /dev/null @@ -1,63 +0,0 @@ -using Newtonsoft.Json; -using NUnit.Framework; -using System; -using System.Collections.Generic; -using System.Text; -using System.Linq; -using System.Collections; - -using SynthesisAPI.InputManager.Inputs; - -namespace TestApi { - [TestFixture] - public static class TestJsonSerialization { - [Test] - public static void TestAnalogSerialization() { - var original = new Analog("Joystick 1 Axis 1", true, true, (int)ModKey.LeftShift, 0.1f); - Assert.IsFalse(original.Equals(new Analog("Joystick 2 Axis 1", true, false, (int)ModKey.LeftShift, 0.1f))); - var serializedOrignal = JsonConvert.SerializeObject(original); - var copy = JsonConvert.DeserializeObject(serializedOrignal); - Assert.IsTrue(original.Equals(copy)); - } - - [Test] - public static void TestDigitalSerialization() { - var original = new Digital("H", (int)ModKey.RightAlt); - Assert.IsFalse(original.Equals(new Digital("A"))); - var serializedOrignal = JsonConvert.SerializeObject(original); - var copy = JsonConvert.DeserializeObject(serializedOrignal); - Assert.IsTrue(original.Equals(copy)); - } - - [Test] - public static void TestListOfInputsSerialization() { - var original = new List(); - original.Add(new Analog("Joystick 1 Axis 5", false)); - original.Add(new Digital("A", (int)ModKey.LeftControl)); - var data = new List(); - original.ForEach(x => { - data.Add(new InputData { - Type = x.GetType(), - Data = JsonConvert.SerializeObject(x) - }); - }); - var serializedOrignal = JsonConvert.SerializeObject(data); - var copy = JsonConvert.DeserializeObject>(serializedOrignal); - var corrected = new List(); - var deserializeMethod = typeof(JsonConvert).GetMethods().First(y => y.IsGenericMethod && y.Name.Equals("DeserializeObject")); - copy.ForEach(x => { - corrected.Add((Analog)deserializeMethod.MakeGenericMethod(x.Type).Invoke(null, new string[] { x.Data })); - }); - for (int i = 0; i < copy.Count; i++) { - Assert.IsTrue(corrected[i].Equals(original[i])); - Assert.IsTrue(corrected[i].GetType().FullName == original[i].GetType().FullName); - } - } - - [JsonObject] - public struct InputData { - public Type Type; - public string Data; - } - } -} diff --git a/api/TestApi/TestMathUtil.cs b/api/TestApi/TestMathUtil.cs deleted file mode 100644 index 85ce92d43f..0000000000 --- a/api/TestApi/TestMathUtil.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using NUnit.Framework; -using MathNet.Spatial.Euclidean; -using MathNet.Spatial.Units; -using SynthesisAPI.Utilities; - -namespace TestApi -{ - [TestFixture] - public static class TestMathUtil - { - public static double Delta = 0.001; - - public static void AssertApproxEquals(EulerAngles expected, EulerAngles actual) - { - //Assert.True(expected.Equals(actual, Delta)); - Assert.AreEqual(expected.Alpha.Degrees, actual.Alpha.Degrees, Delta); - Assert.AreEqual(expected.Beta.Degrees, actual.Beta.Degrees, Delta); - Assert.AreEqual(expected.Gamma.Degrees, actual.Gamma.Degrees, Delta); - } - - public static void AssertApproxEquals(Quaternion expected, Quaternion actual) - { - Assert.AreEqual(expected.Real, actual.Real, Delta); - Assert.AreEqual(expected.ImagX, actual.ImagX, Delta); - Assert.AreEqual(expected.ImagY, actual.ImagY, Delta); - Assert.AreEqual(expected.ImagZ, actual.ImagZ, Delta); - } - - private static double NormalizeAngle(double angle) - { - while (angle < 0) - angle += 2 * System.Math.PI; - - while (angle >= (2 * System.Math.PI - Delta)) - angle -= 2 * System.Math.PI; - - return angle; - } - - public static void AssertApproxEquals(Angle expected, Angle actual) - { - var e = NormalizeAngle(expected.Radians); - var a = NormalizeAngle(actual.Radians); - Assert.AreEqual(e, a, Delta); - } - - [Test] - public static void TestFromEuler() - { - var q1 = new Quaternion(1, 0, 0, 0); - var q2 = MathUtil.FromEuler(q1.ToEulerAngles()); - AssertApproxEquals(q1, q2); - - var e = new EulerAngles(Angle.FromDegrees(60), Angle.FromDegrees(40), Angle.FromDegrees(30)); - var q = MathUtil.FromEuler(e); - AssertApproxEquals(e, q.ToEulerAngles()); - } - } -} diff --git a/api/TestApi/TestPreferenceManager.cs b/api/TestApi/TestPreferenceManager.cs deleted file mode 100644 index 323bfa0256..0000000000 --- a/api/TestApi/TestPreferenceManager.cs +++ /dev/null @@ -1,68 +0,0 @@ -using Newtonsoft.Json; -using SynthesisAPI.PreferenceManager; -using System; -using NUnit.Framework; -using System.Threading.Tasks; - -namespace TestApi -{ - [TestFixture] - public static class TestPreferenceManager - { - [JsonObject("CustomStruct")] - public struct CustomStruct - { - [JsonProperty("Name")] - public string Name { get; set; } - } - - [Test] - public static void TestSavingLoading() - { - PreferenceManager.SetPreference(Program.TestModuleName, "name", "Nikola Tesla"); - PreferenceManager.SetPreference(Program.TestModuleName, "age", 163); - - if (!PreferenceManager.Save()) throw new Exception(); - if (!PreferenceManager.Load()) throw new Exception(); - - string name = PreferenceManager.GetPreference(Program.TestModuleName, "name"); - int age = PreferenceManager.GetPreference(Program.TestModuleName, "age"); - - Assert.AreEqual(name, "Nikola Tesla"); - Assert.AreEqual(age, 163); - } - - [Test] - public static void TestAsyncSaveLoad() - { - PreferenceManager.SetPreference(Program.TestModuleName, "name", "Nikola Tesla"); - PreferenceManager.SetPreference(Program.TestModuleName, "age", 163); - - Task saveTask = PreferenceManager.SaveAsync(); - if (!saveTask.Wait(1000)) throw new Exception(); - - Task loadTask = PreferenceManager.LoadAsync(); - if (!loadTask.Wait(1000)) throw new Exception(); - - string name = PreferenceManager.GetPreference(Program.TestModuleName, "name"); - int age = PreferenceManager.GetPreference(Program.TestModuleName, "age"); - - Assert.AreEqual(name, "Nikola Tesla"); - Assert.AreEqual(age, 163); - } - - [Test] - public static void TestCustomTypeSavingLoading() - { - CustomStruct customOriginal = new CustomStruct() { Name = "Thomas Edison" }; - PreferenceManager.SetPreference(Program.TestModuleName, "custom_type", customOriginal); - - if (!PreferenceManager.Save()) throw new Exception(); - if (!PreferenceManager.Load()) throw new Exception(); - - CustomStruct customCopy = PreferenceManager.GetPreference(Program.TestModuleName, "custom_type"); - - Assert.AreEqual(customOriginal, customCopy); - } - } -} \ No newline at end of file diff --git a/api/TestApi/TestServers.cs b/api/TestApi/TestServers.cs deleted file mode 100644 index d42bb79304..0000000000 --- a/api/TestApi/TestServers.cs +++ /dev/null @@ -1,278 +0,0 @@ -using System; -using System.IO; -using System.Net; -using System.Net.Sockets; -using System.Threading; -using NUnit.Framework; -using SynthesisAPI.Utilities; -using Google.Protobuf; -using Mirabuf.Signal; -using Mirabuf; -using Google.Protobuf.WellKnownTypes; -using SynthesisAPI.Simulation; - -namespace TestApi -{ - /* - [TestFixture] - public static class TestServers - { - private static Thread heartbeatThread = new Thread(() => - { - while (_isRunning) - { - Thread.Sleep(500); - SendData(heartbeat); - } - }); - private static ConnectionMessage heartbeat = new ConnectionMessage() - { - Heartbeat = new ConnectionMessage.Types.Heartbeat() { } - }; - private static ConnectionMessage connectionRequest = new ConnectionMessage() - { - ConnectionRequest = new ConnectionMessage.Types.ConnectionRequest() { } - }; - private static ConnectionMessage resourceOwnershipRequest = new ConnectionMessage() - { - ResourceOwnershipRequest = new ConnectionMessage.Types.ResourceOwnershipRequest() - { - ResourceName = "Robot" - } - }; - private static ConnectionMessage releaseResourceRequest = new ConnectionMessage() - { - ReleaseResourceRequest = new ConnectionMessage.Types.ReleaseResourceRequest() - { - ResourceName = "Robot" - } - }; - private static ConnectionMessage terminateConnectionRequest = new ConnectionMessage() - { - TerminateConnectionRequest = new ConnectionMessage.Types.TerminateConnectionRequest() - { - } - }; - private static Socket _client; - private static bool _isRunning; - - [Test] - public static void TestUpdating() - { - IPEndPoint remoteIpEndPoint = new IPEndPoint(IPAddress.Any, 13001); - UdpClient udpClient = new UdpClient(13001); - Socket updateSendSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); - IPEndPoint updateEndpoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 13000); - - Thread udpReceiveThread = new Thread(() => - { - udpClient.JoinMulticastGroup(IPAddress.Parse("224.100.0.1")); - System.Diagnostics.Debug.WriteLine("Start Udp stuff..."); - while (_isRunning) - { - try - { - var data = UpdateSignals.Parser.ParseDelimitedFrom(new MemoryStream(udpClient.Receive(ref remoteIpEndPoint))); - } - catch (SocketException e) - { - System.Diagnostics.Debug.WriteLine("Udp Connection Terminated"); - } - } - }); - - RegisterRobot(); - string guid = string.Empty; - int generation = 999; - _client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); - TcpServerManager.Start(); - int connectionAttempts = 0; - while (!_client.Connected) - { - try - { - connectionAttempts += 1; - _client.Connect(IPAddress.Loopback, 13000); - } - catch (SocketException e) - { - System.Diagnostics.Debug.WriteLine(connectionAttempts); - } - } - - // established connection - Assert.IsTrue(true); - _isRunning = true; - heartbeatThread.Start(); - - ConnectionMessage response = SendReceiveData(connectionRequest); - - Assert.IsTrue(response.ConnectionResonse.Confirm); - if (response.MessageTypeCase == ConnectionMessage.MessageTypeOneofCase.ConnectionResonse && response.ConnectionResonse.Confirm) - { - response = SendReceiveData(resourceOwnershipRequest); - } - - Assert.IsTrue(response.ResourceOwnershipResponse.Confirm); - if (response.MessageTypeCase == ConnectionMessage.MessageTypeOneofCase.ResourceOwnershipResponse && response.ResourceOwnershipResponse.Confirm) - { - guid = response.ResourceOwnershipResponse.Guid; - generation = response.ResourceOwnershipResponse.Generation; - } - - UpdateSignals update = new UpdateSignals() - { - Generation = generation, - Guid = ByteString.CopyFromUtf8(guid), - ResourceName = "Robot" - }; - update.SignalMap.Add("DigitalOutput", new UpdateSignal() - { - DeviceType = "Digital", - Io = UpdateIOType.Output, - Value = Value.ForNumber(4.2) - }); - - UdpServerManager.SimulationObjectsTarget = SimulationManager._simulationObject; - System.Diagnostics.Debug.WriteLine(UdpServerManager.SimulationObjectsTarget); - UdpServerManager.Start(); - udpReceiveThread.Start(); - - var ms = new MemoryStream(); - update.WriteDelimitedTo(ms); - System.Diagnostics.Debug.WriteLine("Sending update test"); - System.Diagnostics.Debug.WriteLine(update); - updateSendSocket.SendTo(ms.ToArray(), updateEndpoint); - - Thread.Sleep(1000); // need sleep to give it time to update - - Assert.IsTrue(!SimulationManager.SimulationObjects["Robot"].State.IsFree); - - System.Diagnostics.Debug.WriteLine(SimulationManager.SimulationObjects["Robot"].State.CurrentSignals["DigitalOutput"].Value); - Assert.IsTrue(SimulationManager.SimulationObjects["Robot"].State.CurrentSignals["DigitalOutput"].Value.NumberValue == 4.2); - - _isRunning = false; - heartbeatThread.Join(); - response = SendReceiveData(terminateConnectionRequest); - System.Diagnostics.Debug.WriteLine("THIS HAPPENED"); - Assert.IsTrue(response.TerminateConnectionResponse.Confirm); - - udpClient.Close(); - UdpServerManager.Stop(); - udpReceiveThread.Join(); - System.Diagnostics.Debug.WriteLine("Almost Finished"); - TcpServerManager.Stop(); - System.Diagnostics.Debug.WriteLine("Finished"); - Assert.IsTrue(true); - } - - [Test] - public static void TestConnecting() - { - - RegisterRobot(); - - string guid = string.Empty; - int generation; - _client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); - TcpServerManager.Start(); - int connectionAttempts = 0; - while (!_client.Connected) - { - try - { - connectionAttempts += 1; - _client.Connect(IPAddress.Loopback, 13000); - } - catch (SocketException e) - { - System.Diagnostics.Debug.WriteLine(connectionAttempts); - } - } - - // established connection - Assert.IsTrue(true); - - ConnectionMessage response; - - response = SendReceiveData(connectionRequest); - Assert.IsTrue(response.ConnectionResonse.Confirm); - if (response.MessageTypeCase == ConnectionMessage.MessageTypeOneofCase.ConnectionResonse && response.ConnectionResonse.Confirm) - { - response = SendReceiveData(resourceOwnershipRequest); - } - - Assert.IsTrue(response.ResourceOwnershipResponse.Confirm); - if (response.MessageTypeCase == ConnectionMessage.MessageTypeOneofCase.ResourceOwnershipResponse && response.ResourceOwnershipResponse.Confirm) - { - guid = response.ResourceOwnershipResponse.Guid; - generation = response.ResourceOwnershipResponse.Generation; - } - - response = SendReceiveData(releaseResourceRequest); - Assert.IsTrue(response.ReleaseResourceResponse.Confirm); - - response = SendReceiveData(terminateConnectionRequest); - if (response.MessageTypeCase == ConnectionMessage.MessageTypeOneofCase.TerminateConnectionResponse && response.TerminateConnectionResponse.Confirm) - { - System.Diagnostics.Debug.WriteLine("RECEIVED TERMINATE CONNECTION RESPONSE"); - Assert.IsTrue(true); - } - } - - // for sending message and recieving a response - public static ConnectionMessage SendReceiveData(ConnectionMessage msg) - { - byte[] receiveBuffer = new byte[256]; - byte[] buffer = new byte[msg.CalculateSize()]; - msg.WriteTo(buffer); - _client.Send(buffer); - int rec = _client.Receive(receiveBuffer); - byte[] data = new byte[rec]; - Array.Copy(receiveBuffer, data, rec); - return ConnectionMessage.Parser.ParseFrom(data); - } - // for just sending a message - public static void SendData(ConnectionMessage msg) - { - byte[] buffer = new byte[msg.CalculateSize()]; - msg.WriteTo(buffer); - _client.Send(buffer); - } - - public static void RegisterRobot() - { - try - { - Signals signals = new Signals() - { - Info = new Info() - { - Name = "Robot", - GUID = Guid.NewGuid().ToString() - } - }; - signals.SignalMap.Add("DigitalOutput", new Signal() - { - Info = new Info() - { - Name = "signal", - GUID = Guid.NewGuid().ToString() - }, - DeviceType = DeviceType.Digital, - Io = IOType.Output - }); - SimulationManager.RegisterSimObject(new SimObject("Robot", new ControllableState() - { - CurrentSignalLayout = signals, - IsFree = true - })); - } catch (Exception e) - { - System.Diagnostics.Debug.WriteLine(e); - } - - } - } - */ -} diff --git a/api/TestApi/TestTransform.cs b/api/TestApi/TestTransform.cs deleted file mode 100644 index 1cc4319382..0000000000 --- a/api/TestApi/TestTransform.cs +++ /dev/null @@ -1,46 +0,0 @@ -using NUnit.Framework; -using SynthesisAPI.EnvironmentManager.Components; -using MathNet.Spatial.Euclidean; -using MathNet.Spatial.Units; - -namespace TestApi -{ - [TestFixture] - public static class TestTransform - { - [Test] - public static void TestRotateQuaternion() - { - var a = new Transform(); - var rotation = new Quaternion(1, 1, 0.5, 0.2).Normalized; - a.Rotate(rotation); - TestMathUtil.AssertApproxEquals(rotation, a.Rotation); - } - - [Test] - public static void TestRotateAngleAxis() - { - var a = new Transform(); - var rotation = Angle.FromDegrees(30); - a.Rotate(UnitVector3D.XAxis, rotation); - Assert.AreEqual(rotation, a.Rotation.ToEulerAngles().Alpha); - - var b = new Transform(); - var rotation2 = Angle.FromDegrees(30); - for (var i = 1; i < 13; i++) - { - b.Rotate(UnitVector3D.XAxis, rotation2); - TestMathUtil.AssertApproxEquals(rotation2 * i, b.Rotation.ToEulerAngles().Alpha); - } - } - - [Test] - public static void TestRotateEulerAngles() - { - var a = new Transform(); - var rotation = new EulerAngles(Angle.FromDegrees(30), Angle.FromDegrees(40), Angle.FromDegrees(50)); - a.Rotate(rotation); - TestMathUtil.AssertApproxEquals(rotation, a.Rotation.ToEulerAngles()); - } - } -} diff --git a/api/TestApi/TestTranslator.cs b/api/TestApi/TestTranslator.cs deleted file mode 100644 index 0da3001c85..0000000000 --- a/api/TestApi/TestTranslator.cs +++ /dev/null @@ -1,121 +0,0 @@ -//using NUnit.Framework; -//using System; -//using System.IO; -//using System.Text; - -//namespace TestApi { -// [TestFixture] -// public static class TestTranslator { - -// private static string BaseRobotPath; -// private static string BaseFieldPath; - -// [OneTimeSetUp] -// public static void Setup() { - -// BaseRobotPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + Path.AltDirectorySeparatorChar -// + "Autodesk" + Path.AltDirectorySeparatorChar + "Synthesis" + Path.AltDirectorySeparatorChar -// + "Robots" + Path.AltDirectorySeparatorChar; -// BaseFieldPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + Path.AltDirectorySeparatorChar -// + "Autodesk" + Path.AltDirectorySeparatorChar + "Synthesis" + Path.AltDirectorySeparatorChar -// + "Fields" + Path.AltDirectorySeparatorChar; -// } - -// [Test] -// public static void TranslateDozerTest() { -// string path = BaseRobotPath + "Dozer"; -// if (!File.Exists(path)) { -// Assert.Warn("File doesn't exist"); -// return; -// } - -// Translator.Translate(path, Translator.TranslationType.BXDJ_TO_PROTO_ROBOT); - -// Assert.Pass(); -// } - -// [Test] -// public static void TranslateMeanMachineTest() { -// string path = BaseRobotPath + "2018 - 2471 Mean Machine"; -// if (!File.Exists(path)) { -// Assert.Warn("File doesn't exist"); -// return; -// } - -// Translator.Translate(path, Translator.TranslationType.BXDJ_TO_PROTO_ROBOT); - -// Assert.Pass(); -// } - -// [Test] -// public static void TranslateAerialAssistTest() { -// string path = BaseFieldPath + "2014 Aerial Assist"; -// if (!File.Exists(path)) { -// Assert.Warn("File doesn't exist"); -// return; -// } - -// Translator.Translate(path, Translator.TranslationType.BXDF_TO_PROTO_FIELD); - -// Assert.Pass(); -// } - -// [Test] -// public static void TranslateDestinationDeepSpaceTest() { -// string path = BaseFieldPath + "2019 Destination Deep Space"; -// if (!File.Exists(path)) { -// Assert.Warn("File doesn't exist"); -// return; -// } - -// Translator.Translate(path, Translator.TranslationType.BXDF_TO_PROTO_FIELD); - -// Assert.Pass(); -// } - -// [Test] -// public static void Vec3Tests() { -// Vec3 a = new Vec3() { X = 3, Y = 4, Z = 0 }; -// Assert.IsTrue(Math.Abs(a.Magnitude - 5f) < 0.005); -// a.Z = 7; -// a.Normalize(); -// Assert.IsTrue(Math.Abs(a.Magnitude - 1f) < 0.005); -// } - -// [Test] -// public static void MaterialTests() { -// Material mat1 = new Material() {Red = 100, Green = 50}; -// Material mat2 = new Material() {Red = 100, Green = 50}; -// Material mat3 = new Material() {Red = 20, Blue = 80}; - -// Assert.IsTrue(mat1.Equals(mat2)); -// Assert.IsFalse(mat1.Equals(mat3)); -// Assert.IsTrue(mat1.GetHashCode() == mat2.GetHashCode()); -// Assert.IsFalse(mat1.GetHashCode() == mat3.GetHashCode()); -// } - -// [Test] -// public static void ByteToHexTest() { -// byte[] buf = { -// 0x00, -// 0xa5, -// 0x0f, -// 0x9e -// }; - -// string singleByte = buf[1].ToHexString(); -// string fullBuffer = buf.ToHexString(); -// char nibble = buf[2].ToHexCharacter(); - -// Assert.IsTrue(singleByte == "a5"); -// Assert.IsTrue(fullBuffer == "00a50f9e"); -// Assert.IsTrue(nibble == 'f'); -// } - -// [Test] -// public static void TempFileHashTest() { -// byte[] buf = Encoding.ASCII.GetBytes("Hello World!"); -// Assert.IsTrue(Translator.TempFileHash(buf).ToHexString() == "7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069"); -// } -// } -//} \ No newline at end of file diff --git a/api/TestApi/TestUIParsing.cs b/api/TestApi/TestUIParsing.cs deleted file mode 100644 index e4180fb927..0000000000 --- a/api/TestApi/TestUIParsing.cs +++ /dev/null @@ -1,27 +0,0 @@ -using NUnit.Framework; -using SynthesisAPI.UIManager; -using UnityEngine.UIElements; - -namespace TestApi -{ - [TestFixture] - public class TestUIParsing - { - [TestCase] - public void TestLengthPercentParse() - { - StyleLength length = UIParser.ToStyleLength("100%"); - Assert.AreEqual(length.keyword, StyleKeyword.Undefined); - Assert.AreEqual(length.value.unit, LengthUnit.Percent); - Assert.AreEqual(length.value.value, 100.0f); - } - - [TestCase] - public void TestMapCssName() - { - Assert.AreEqual(UIParser.MapCssName("flex-direction"), "flexDirection"); - Assert.AreEqual(UIParser.MapCssName("height"), "height"); - Assert.AreEqual(UIParser.MapCssName("-unity-background-image-tint-color"), "unityBackgroundImageTintColor"); - } - } -} diff --git a/api/TestApi/TestVirtualFileSystem.cs b/api/TestApi/TestVirtualFileSystem.cs deleted file mode 100644 index fb1a795e74..0000000000 --- a/api/TestApi/TestVirtualFileSystem.cs +++ /dev/null @@ -1,160 +0,0 @@ -using System; -using SynthesisAPI.VirtualFileSystem; -using NUnit.Framework; - -namespace TestApi -{ - [TestFixture] - public static class TestVirtualFileSystem - { - public static string FilePrefix = typeof(TestVirtualFileSystem).Name; - - [Test] - public static void TestTraverse() - { - Assert.AreEqual("temp", FileSystem.Traverse("/temp")?.Name); - try - { - FileSystem.Traverse("temp"); - Assert.Fail(); - } - catch (DirectoryException e) - { - Assert.NotNull(e); - } - } - - [Test] - public static void TestAddEntry() - { - string dirLoc = "/temp"; - string dirName = FilePrefix + "directory1"; - - var dir = new Directory(dirName, Permissions.PublicReadWrite); - - FileSystem.AddEntry(dirLoc, dir); - var testDir = FileSystem.Traverse(dirLoc + Directory.DirectorySeparatorChar + dirName); - Assert.AreSame(dir, testDir); - } - - [Test] - public static void TestParent() - { - string dirLoc = "/temp"; - string dirName = FilePrefix + "directory2"; - - var dir = new Directory(dirName, Permissions.PublicReadWrite); - FileSystem.AddEntry(dirLoc, dir); - - var parent = (Directory)FileSystem.Traverse(dirLoc); - var testParent = (Directory)dir?.Traverse(".."); - Assert.AreSame(parent, testParent); - } - - [Test] - public static void TestDeleteEntry() - { - string dirLoc = "/temp"; - string dirName = FilePrefix + "directory3"; - - var dir = new Directory(dirName, Permissions.PublicReadWrite); - FileSystem.AddEntry(dirLoc, dir); - - Assert.True(FileSystem.EntryExists(dirLoc + Directory.DirectorySeparatorChar + dirName)); - Assert.NotNull(dir.Parent); - - FileSystem.DeleteEntry(dirLoc + Directory.DirectorySeparatorChar + dirName); - - Assert.False(FileSystem.EntryExists(dirLoc + Directory.DirectorySeparatorChar + dirName)); - Assert.Null(dir.Parent); - - string dirName2 = FilePrefix + "directory4"; - - var dir2 = new Directory(dirName2, Permissions.PublicReadWrite); - FileSystem.AddEntry(dirLoc, dir2); - - Assert.True(FileSystem.EntryExists(dirLoc + Directory.DirectorySeparatorChar + dirName2)); - Assert.NotNull(dir2.Parent); - - dir2.Delete(); - - Assert.False(FileSystem.EntryExists(dirLoc + Directory.DirectorySeparatorChar + dirName2)); - Assert.Null(dir2.Parent); - } - - [Test] - public static void TestDirectoryPermissions() - { - string dirLoc1 = "/temp"; - string dirName1 = FilePrefix + "directory4"; - try - { - var dir = new Directory(dirName1, Permissions.PublicReadWrite); - - FileSystem.AddEntry(dirLoc1, dir); - } - catch (PermissionsExpcetion) - { - Assert.Fail(); - } - Assert.True(FileSystem.EntryExists(dirLoc1, dirName1)); - - - string dirLoc2 = "/"; - string dirName2 = FilePrefix + "directory5"; - try - { - var dir = new Directory(dirName2, Permissions.PublicReadWrite); - - FileSystem.AddEntry(dirLoc2, dir); - Assert.Fail(); - } - catch (PermissionsExpcetion) - { - Assert.False(FileSystem.EntryExists(dirLoc2, dirName2)); - } - } - - [Test] - public static void TestMaxDepth() - { - string path = "/temp"; - try - { - Console.WriteLine(FileSystem.DepthOfPath(path)); - for (var i = FileSystem.DepthOfPath(path); i < FileSystem.MaxDirectoryDepth + 1; i++) - { - Directory dir = new Directory("TestMaxDepthDir" + i, Permissions.PublicReadWrite); - FileSystem.AddEntry(path, dir); - path += "/" + dir.Name; - } - Assert.Fail(); - } - catch (DirectroyDepthExpection) - { - Assert.Pass(); - } - } - - [Test] - public static void TestCreatePath() - { - string path = "/temp/TestCreatePath/new_dir/new_dir/new_dir"; - - Directory dir = new Directory("new_dir", Permissions.PrivateReadWrite); - - Assert.Null(FileSystem.Traverse(path)); - - Assert.NotNull(FileSystem.AddEntry(path, dir)); - } - - [Test] - public static void TestSearch() - { - var result = FileSystem.Search("THIS FILE DOES NOT EXIST"); - Assert.Null(result); - result = FileSystem.Search("temp"); - Assert.NotNull(result); - } - } -} diff --git a/api/TestApi/TestXmlObject.cs b/api/TestApi/TestXmlObject.cs deleted file mode 100644 index 454e09ced1..0000000000 --- a/api/TestApi/TestXmlObject.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Xml.Serialization; - -namespace TestApi -{ - [XmlRoot("TestXmlObject")] - public class TestXmlObject - { - [XmlElement("Text")] - public string Text { get; set; } - } -} diff --git a/api/TestApi/TestsSetupClass.cs b/api/TestApi/TestsSetupClass.cs deleted file mode 100644 index 1e57b9e6d0..0000000000 --- a/api/TestApi/TestsSetupClass.cs +++ /dev/null @@ -1,20 +0,0 @@ -using NUnit.Framework; - -namespace TestApi -{ - [SetUpFixture] - public class TestsSetupClass - { - [OneTimeSetUp] - public void GlobalSetup() - { - MockApi.MockApi.Init(); - } - - [OneTimeTearDown] - public void GlobalTeardown() - { - - } - } -} diff --git a/api/TestApi/Utility.cs b/api/TestApi/Utility.cs deleted file mode 100644 index 7f654a34f8..0000000000 --- a/api/TestApi/Utility.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace TestApi -{ - public static class Utility - { - public static void Each(this IEnumerable ie, Action action) - { - var i = 0; - foreach (var e in ie) action(e, i++); - } - } -} diff --git a/api/api.sln b/api/api.sln deleted file mode 100644 index 38a2f97292..0000000000 --- a/api/api.sln +++ /dev/null @@ -1,50 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.31410.357 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Api", "Api\Api.csproj", "{CDC52F8E-5BA0-486F-8182-9BFC5F35DDFA}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MockApi", "MockApi\MockApi.csproj", "{A599151F-AC67-4B38-BB0B-A5B66177EB67}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestApi", "TestApi\TestApi.csproj", "{853A5284-3F0C-45DC-BF70-92D0A67DC7F3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BenchmarkApi", "BenchmarkApi\BenchmarkApi.csproj", "{AC669A38-8C1C-4A3B-AFB8-368620018AA1}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Patchbay", "Patchbay\Patchbay.csproj", "{F936B4C1-1360-46AE-9F12-7A022C1E00D9}" -EndProject - -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {CDC52F8E-5BA0-486F-8182-9BFC5F35DDFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CDC52F8E-5BA0-486F-8182-9BFC5F35DDFA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CDC52F8E-5BA0-486F-8182-9BFC5F35DDFA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CDC52F8E-5BA0-486F-8182-9BFC5F35DDFA}.Release|Any CPU.Build.0 = Release|Any CPU - {A599151F-AC67-4B38-BB0B-A5B66177EB67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A599151F-AC67-4B38-BB0B-A5B66177EB67}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A599151F-AC67-4B38-BB0B-A5B66177EB67}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A599151F-AC67-4B38-BB0B-A5B66177EB67}.Release|Any CPU.Build.0 = Release|Any CPU - {853A5284-3F0C-45DC-BF70-92D0A67DC7F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {853A5284-3F0C-45DC-BF70-92D0A67DC7F3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {853A5284-3F0C-45DC-BF70-92D0A67DC7F3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {853A5284-3F0C-45DC-BF70-92D0A67DC7F3}.Release|Any CPU.Build.0 = Release|Any CPU - {AC669A38-8C1C-4A3B-AFB8-368620018AA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AC669A38-8C1C-4A3B-AFB8-368620018AA1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AC669A38-8C1C-4A3B-AFB8-368620018AA1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AC669A38-8C1C-4A3B-AFB8-368620018AA1}.Release|Any CPU.Build.0 = Release|Any CPU - {F936B4C1-1360-46AE-9F12-7A022C1E00D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F936B4C1-1360-46AE-9F12-7A022C1E00D9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F936B4C1-1360-46AE-9F12-7A022C1E00D9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F936B4C1-1360-46AE-9F12-7A022C1E00D9}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {A781181B-A288-442E-85C4-17066647FF59} - EndGlobalSection -EndGlobal diff --git a/api/api.sln.DotSettings.user b/api/api.sln.DotSettings.user deleted file mode 100644 index ac26a4bb8a..0000000000 --- a/api/api.sln.DotSettings.user +++ /dev/null @@ -1,9 +0,0 @@ - - True - True - True - True - True - <SessionState ContinuousTestingMode="0" IsActive="True" Name="All tests from Solution" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"> - <Solution /> -</SessionState> \ No newline at end of file diff --git a/api/build.bat b/api/build.bat deleted file mode 100644 index 7f1afad8f0..0000000000 --- a/api/build.bat +++ /dev/null @@ -1,5 +0,0 @@ -@echo off - -dotnet build -copy Api\\bin\\Debug\\netstandard2.0\\Api.dll ..\\engine\\Assets\\Packages\\Api.dll -del /f ..\\engine\\Assets\\Packages\\Api.dll.meta diff --git a/api/build.sh b/api/build.sh deleted file mode 100755 index 96eb0b3825..0000000000 --- a/api/build.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -dotnet build -cp -v Api/bin/Debug/netstandard2.0/Api.dll ../engine/Assets/Packages/Api.dll -rm -f ../engine/Assets/Packages/Api.dll.meta diff --git a/api/libs/UnityEngine.dll b/api/libs/UnityEngine.dll deleted file mode 100644 index 7f0650d0f9..0000000000 Binary files a/api/libs/UnityEngine.dll and /dev/null differ diff --git a/api/libs/UnityEngine.xml b/api/libs/UnityEngine.xml deleted file mode 100644 index 788732a1a8..0000000000 --- a/api/libs/UnityEngine.xml +++ /dev/null @@ -1,107689 +0,0 @@ - - - - - UnityEngine - - - - Structure describing acceleration status of the device. - - - - - Value of acceleration. - - - - - Amount of time passed since last accelerometer measurement. - - - - - A class containing methods to assist with accessibility for users with different vision capabilities. - - - - - Gets a palette of colors that should be distinguishable for normal vision, deuteranopia, protanopia, and tritanopia. - - An array of colors to populate with a palette. - Minimum allowable perceived luminance from 0 to 1. A value of 0.2 or greater is recommended for dark backgrounds. - Maximum allowable perceived luminance from 0 to 1. A value of 0.8 or less is recommended for light backgrounds. - - The number of unambiguous colors in the palette. - - - - - The AddComponentMenu attribute allows you to place a script anywhere in the "Component" menu, instead of just the "Component->Scripts" menu. - - - - - The order of the component in the component menu (lower is higher to the top). - - - - - Add an item in the Component menu. - - The path to the component. - Where in the component menu to add the new item. - - - - Add an item in the Component menu. - - The path to the component. - Where in the component menu to add the new item. - - - - Enum mask of possible shader channel properties that can also be included when the Canvas mesh is created. - - - - - No additional shader parameters are needed. - - - - - Include the normals on the mesh vertices. - - - - - Include the Tangent on the mesh vertices. - - - - - Include UV1 on the mesh vertices. - - - - - Include UV2 on the mesh vertices. - - - - - Include UV3 on the mesh vertices. - - - - - Singleton class to access the baked NavMesh. - - - - - Describes how far in the future the agents predict collisions for avoidance. - - - - - Set a function to be called before the NavMesh is updated during the frame update execution. - - - - - The maximum number of nodes processed for each frame during the asynchronous pathfinding process. - - - - - Adds a link to the NavMesh. The link is described by the NavMeshLinkData struct. - - Describing the properties of the link. - - Representing the added link. - - - - - Adds a link to the NavMesh. The link is described by the NavMeshLinkData struct. - - Describing the properties of the link. - Translate the link to this position. - Rotate the link to this orientation. - - Representing the added link. - - - - - Adds the specified NavMeshData to the game. - - Contains the data for the navmesh. - - Representing the added navmesh. - - - - - Adds the specified NavMeshData to the game. - - Contains the data for the navmesh. - Translate the navmesh to this position. - Rotate the navmesh to this orientation. - - Representing the added navmesh. - - - - - Area mask constant that includes all NavMesh areas. - - - - - Calculate a path between two points and store the resulting path. - - The initial position of the path requested. - The final position of the path requested. - A bitfield mask specifying which NavMesh areas can be passed when calculating a path. - The resulting path. - - True if either a complete or partial path is found. False otherwise. - - - - - Calculates a path between two positions mapped to the NavMesh, subject to the constraints and costs defined by the filter argument. - - The initial position of the path requested. - The final position of the path requested. - A filter specifying the cost of NavMesh areas that can be passed when calculating a path. - The resulting path. - - True if a either a complete or partial path is found and false otherwise. - - - - - Calculates triangulation of the current navmesh. - - - - - Creates and returns a new entry of NavMesh build settings available for runtime NavMesh building. - - - The created settings. - - - - - Locate the closest NavMesh edge from a point on the NavMesh. - - The origin of the distance query. - Holds the properties of the resulting location. - A bitfield mask specifying which NavMesh areas can be passed when finding the nearest edge. - - True if the nearest edge is found. - - - - - Locate the closest NavMesh edge from a point on the NavMesh, subject to the constraints of the filter argument. - - The origin of the distance query. - Holds the properties of the resulting location. - A filter specifying which NavMesh areas can be passed when finding the nearest edge. - - True if the nearest edge is found. - - - - - Gets the cost for path finding over geometry of the area type. - - Index of the area to get. - - - - Returns the area index for a named NavMesh area type. - - Name of the area to look up. - - Index if the specified are, or -1 if no area found. - - - - - Gets the cost for traversing over geometry of the layer type on all agents. - - - - - - Returns the layer index for a named layer. - - - - - - Returns an existing entry of NavMesh build settings. - - The ID to look for. - - The settings found. - - - - - Returns an existing entry of NavMesh build settings by its ordered index. - - The index to retrieve from. - - The found settings. - - - - - Returns the number of registered NavMesh build settings. - - - The number of registered entries. - - - - - Returns the name associated with the NavMesh build settings matching the provided agent type ID. - - The ID to look for. - - The name associated with the ID found. - - - - - A delegate which can be used to register callback methods to be invoked before the NavMesh system updates. - - - - - Trace a line between two points on the NavMesh. - - The origin of the ray. - The end of the ray. - Holds the properties of the ray cast resulting location. - A bitfield mask specifying which NavMesh areas can be passed when tracing the ray. - - True if the ray is terminated before reaching target position. Otherwise returns false. - - - - - Traces a line between two positions on the NavMesh, subject to the constraints defined by the filter argument. - - The origin of the ray. - The end of the ray. - Holds the properties of the ray cast resulting location. - A filter specifying which NavMesh areas can be passed when tracing the ray. - - True if the ray is terminated before reaching target position. Otherwise returns false. - - - - - Removes all NavMesh surfaces and links from the game. - - - - - Removes a link from the NavMesh. - - The instance of a link to remove. - - - - Removes the specified NavMeshDataInstance from the game, making it unavailable for agents and queries. - - The instance of a NavMesh to remove. - - - - Removes the build settings matching the agent type ID. - - The ID of the entry to remove. - - - - Finds the nearest point based on the NavMesh within a specified range. - - The origin of the sample query. - Holds the properties of the resulting location. The value of hit.normal is never computed. It is always (0,0,0). - Sample within this distance from sourcePosition. - A mask that specifies the NavMesh areas allowed when finding the nearest point. - - True if the nearest point is found. - - - - - Samples the position nearest the sourcePosition on any NavMesh built for the agent type specified by the filter. - - The origin of the sample query. - Holds the properties of the resulting location. The value of hit.normal is never computed. It is always (0,0,0). - Sample within this distance from sourcePosition. - A filter specifying which NavMesh areas are allowed when finding the nearest point. - - True if the nearest point is found. - - - - - Sets the cost for finding path over geometry of the area type on all agents. - - Index of the area to set. - New cost. - - - - Sets the cost for traversing over geometry of the layer type on all agents. - - - - - - - Navigation mesh agent. - - - - - The maximum acceleration of an agent as it follows a path, given in units / sec^2. - - - - - The type ID for the agent. - - - - - Maximum turning speed in (deg/s) while following a path. - - - - - Specifies which NavMesh areas are passable. Changing areaMask will make the path stale (see isPathStale). - - - - - Should the agent brake automatically to avoid overshooting the destination point? - - - - - Should the agent attempt to acquire a new path if the existing path becomes invalid? - - - - - Should the agent move across OffMeshLinks automatically? - - - - - The avoidance priority level. - - - - - The relative vertical displacement of the owning GameObject. - - - - - The current OffMeshLinkData. - - - - - The desired velocity of the agent including any potential contribution from avoidance. (Read Only) - - - - - Gets or attempts to set the destination of the agent in world-space units. - - - - - Does the agent currently have a path? (Read Only) - - - - - The height of the agent for purposes of passing under obstacles, etc. - - - - - Is the agent currently bound to the navmesh? (Read Only) - - - - - Is the agent currently positioned on an OffMeshLink? (Read Only) - - - - - Is the current path stale. (Read Only) - - - - - This property holds the stop or resume condition of the NavMesh agent. - - - - - Returns the owning object of the NavMesh the agent is currently placed on (Read Only). - - - - - The next OffMeshLinkData on the current path. - - - - - Gets or sets the simulation position of the navmesh agent. - - - - - The level of quality of avoidance. - - - - - Property to get and set the current path. - - - - - Is a path in the process of being computed but not yet ready? (Read Only) - - - - - The status of the current path (complete, partial or invalid). - - - - - The avoidance radius for the agent. - - - - - The distance between the agent's position and the destination on the current path. (Read Only) - - - - - Maximum movement speed when following a path. - - - - - Get the current steering target along the path. (Read Only) - - - - - Stop within this distance from the target position. - - - - - Gets or sets whether the transform position is synchronized with the simulated agent position. The default value is true. - - - - - Should the agent update the transform orientation? - - - - - Allows you to specify whether the agent should be aligned to the up-axis of the NavMesh or link that it is placed on. - - - - - Access the current velocity of the NavMeshAgent component, or set a velocity to control the agent manually. - - - - - Specifies which NavMesh layers are passable (bitfield). Changing walkableMask will make the path stale (see isPathStale). - - - - - Enables or disables the current off-mesh link. - - Is the link activated? - - - - Calculate a path to a specified point and store the resulting path. - - The final position of the path requested. - The resulting path. - - True if a path is found. - - - - - Completes the movement on the current OffMeshLink. - - - - - Locate the closest NavMesh edge. - - Holds the properties of the resulting location. - - True if a nearest edge is found. - - - - - Gets the cost for path calculation when crossing area of a particular type. - - Area Index. - - Current cost for specified area index. - - - - - Gets the cost for crossing ground of a particular type. - - Layer index. - - Current cost of specified layer. - - - - - Apply relative movement to current position. - - The relative movement vector. - - - - Trace a straight path towards a target postion in the NavMesh without moving the agent. - - The desired end position of movement. - Properties of the obstacle detected by the ray (if any). - - True if there is an obstacle between the agent and the target position, otherwise false. - - - - - Clears the current path. - - - - - Resumes the movement along the current path after a pause. - - - - - Sample a position along the current path. - - A bitfield mask specifying which NavMesh areas can be passed when tracing the path. - Terminate scanning the path at this distance. - Holds the properties of the resulting location. - - True if terminated before reaching the position at maxDistance, false otherwise. - - - - - Sets the cost for traversing over areas of the area type. - - Area cost. - New cost for the specified area index. - - - - Sets or updates the destination thus triggering the calculation for a new path. - - The target point to navigate to. - - True if the destination was requested successfully, otherwise false. - - - - - Sets the cost for traversing over geometry of the layer type. - - Layer index. - New cost for the specified layer. - - - - Assign a new path to this agent. - - New path to follow. - - True if the path is succesfully assigned. - - - - - Stop movement of this agent along its current path. - - - - - Warps agent to the provided position. - - New position to warp the agent to. - - True if agent is successfully warped, otherwise false. - - - - - Bitmask used for operating with debug data from the NavMesh build process. - - - - - All debug data from the NavMesh build process is taken into consideration. - - - - - The triangles of all the geometry that is used as a base for computing the new NavMesh. - - - - - No debug data from the NavMesh build process is taken into consideration. - - - - - Meshes of convex polygons constructed within the unified contours of adjacent regions. - - - - - The triangulated meshes with height details that better approximate the source geometry. - - - - - The contours that follow precisely the edges of each surface region. - - - - - The segmentation of the traversable surfaces into smaller areas necessary for producing simple polygons. - - - - - Contours bounding each of the surface regions, described through fewer vertices and straighter edges compared to RawContours. - - - - - The voxels produced by rasterizing the source geometry into walkable and unwalkable areas. - - - - - Specify which of the temporary data generated while building the NavMesh should be retained in memory after the process has completed. - - - - - Specify which types of debug data to collect when building the NavMesh. - - - - - Navigation mesh builder interface. - - - - - Builds a NavMesh data object from the provided input sources. (UnityEngine) - - Settings for the bake process, see NavMeshBuildSettings. - List of input geometry used for baking, they describe the surfaces to walk on or obstacles to avoid. - Bounding box relative to position and rotation which describes the volume where the NavMesh should be built. Empty bounds is treated as no bounds, i.e. the NavMesh will cover all the inputs. - Center of the NavMeshData. This specifies the origin for the NavMesh tiles (See Also: NavMeshBuildSettings.tileSize). - Orientation of the NavMeshData, you can use this to generate NavMesh with an arbitrary up-vector – e.g. for walkable vertical surfaces. - - Returns a newly built NavMeshData, or null if the NavMeshData was empty or an error occurred. -The newly built NavMeshData, or null if the NavMeshData was empty or an error occurred. - - - - - Cancel Navmesh construction. (UnityEditor) See Also: NavMeshBuilder.BuildNavMeshAsync - - - - - Cancels an asynchronous update of the specified NavMesh data. (UnityEngine) See Also: NavMeshBuilder.UpdateNavMeshDataAsync. - - The data associated with asynchronous updating. - - - - Collects renderers or physics colliders, and terrains within a volume. (UnityEngine) - - The queried objects must overlap these bounds to be included in the results. - Specifies which layers are included in the query. - Which type of geometry to collect - e.g. physics colliders. - Area type to assign to results, unless modified by NavMeshMarkup. - List of markups which allows finer control over how objects are collected. - List where results are stored, the list is cleared at the beginning of the call. - - - - Collects renderers or physics colliders, and terrains within a transform hierarchy. (UnityEngine) - - If not null, consider only root and its children in the query; if null, includes everything loaded. - Specifies which layers are included in the query. - Which type of geometry to collect - e.g. physics colliders. - Area type to assign to results, unless modified by NavMeshMarkup. - List of markups which allows finer control over how objects are collected. - List where results are stored, the list is cleared at the beginning of the call. - - - - Incrementally updates the NavMeshData based on the sources. (UnityEngine) - - The NavMeshData to update. - The build settings which is used to update the NavMeshData. The build settings is also hashed along with the data, so changing settings will cause a full rebuild. - List of input geometry used for baking, they describe the surfaces to walk on or obstacles to avoid. - Bounding box relative to position and rotation which describes the volume where the NavMesh should be built. - - Returns true if the update was successful. - - - - - Asynchronously and incrementally updates the NavMeshData based on the sources. (UnityEngine) - - The NavMeshData to update. - The build settings which is used to update the NavMeshData. The build settings is also hashed along with the data, so changing settings will likely to cause full rebuild. - List of input geometry used for baking, they describe the surfaces to walk on or obstacles to avoid. - Bounding box relative to position and rotation which describes to volume where the NavMesh should be built. - - Can be used to check the progress of the update. - - - - - The NavMesh build markup allows you to control how certain objects are treated during the NavMesh build process, specifically when collecting sources for building. - - - - - The area type to use when override area is enabled. - - - - - Use this to specify whether the GameObject and its children should be ignored. - - - - - Use this to specify whether the area type of the GameObject and its children should be overridden by the area type specified in this struct. - - - - - Use this to specify which GameObject (including the GameObject’s children) the markup should be applied to. - - - - - The NavMeshBuildSettings struct allows you to specify a collection of settings which describe the dimensions and limitations of a particular agent type. - - - - - The maximum vertical step size an agent can take. - - - - - The height of the agent for baking in world units. - - - - - The radius of the agent for baking in world units. - - - - - The maximum slope angle which is walkable (angle in degrees). - - - - - The agent type ID the NavMesh will be baked for. - - - - - Options for collecting debug data during the build process. - - - - - The maximum number of worker threads that the build process can utilize when building a NavMesh with these settings. - - - - - The approximate minimum area of individual NavMesh regions. - - - - - Enables overriding the default tile size. See Also: tileSize. - - - - - Enables overriding the default voxel size. See Also: voxelSize. - - - - - Sets the tile size in voxel units. - - - - - Sets the voxel size in world length units. - - - - - Validates the properties of NavMeshBuildSettings. - - Describes the volume to build NavMesh for. - - The list of violated constraints. - - - - - The input to the NavMesh builder is a list of NavMesh build sources. - - - - - Describes the area type of the NavMesh surface for this object. - - - - - Points to the owning component - if available, otherwise null. - - - - - The type of the shape this source describes. See Also: NavMeshBuildSourceShape. - - - - - Describes the dimensions of the shape. - - - - - Describes the object referenced for Mesh and Terrain types of input sources. - - - - - Describes the local to world transformation matrix of the build source. That is, position and orientation and scale of the shape. - - - - - Used with NavMeshBuildSource to define the shape for building NavMesh. - - - - - Describes a box primitive for use with NavMeshBuildSource. - - - - - Describes a capsule primitive for use with NavMeshBuildSource. - - - - - Describes a Mesh source for use with NavMeshBuildSource. - - - - - Describes a ModifierBox source for use with NavMeshBuildSource. - - - - - Describes a sphere primitive for use with NavMeshBuildSource. - - - - - Describes a TerrainData source for use with NavMeshBuildSource. - - - - - Used for specifying the type of geometry to collect. Used with NavMeshBuilder.CollectSources. - - - - - Collect geometry from the 3D physics collision representation. - - - - - Collect meshes form the rendered geometry. - - - - - Contains and represents NavMesh data. - - - - - Gets or sets the world space position of the NavMesh data. - - - - - Gets or sets the orientation of the NavMesh data. - - - - - Returns the bounding volume of the input geometry used to build this NavMesh (Read Only). - - - - - Constructs a new object for representing a NavMesh for the default agent type. - - - - - Constructs a new object representing a NavMesh for the specified agent type. - - The agent type ID to create a NavMesh for. - - - - The instance is returned when adding NavMesh data. - - - - - Get or set the owning Object. - - - - - True if the NavMesh data is added to the navigation system - otherwise false (Read Only). - - - - - Removes this instance from the NavMesh system. - - - - - Result information for NavMesh queries. - - - - - Distance to the point of hit. - - - - - Flag set when hit. - - - - - Mask specifying NavMesh area at point of hit. - - - - - Normal at the point of hit. - - - - - Position of hit. - - - - - Used for runtime manipulation of links connecting polygons of the NavMesh. - - - - - Specifies which agent type this link is available for. - - - - - Area type of the link. - - - - - If true, the link can be traversed in both directions, otherwise only from start to end position. - - - - - If positive, overrides the pathfinder cost to traverse the link. - - - - - End position of the link. - - - - - Start position of the link. - - - - - If positive, the link will be rectangle aligned along the line from start to end. - - - - - An instance representing a link available for pathfinding. - - - - - Get or set the owning Object. - - - - - True if the NavMesh link is added to the navigation system - otherwise false (Read Only). - - - - - Removes this instance from the game. - - - - - An obstacle for NavMeshAgents to avoid. - - - - - Should this obstacle be carved when it is constantly moving? - - - - - Should this obstacle make a cut-out in the navmesh. - - - - - Threshold distance for updating a moving carved hole (when carving is enabled). - - - - - Time to wait until obstacle is treated as stationary (when carving and carveOnlyStationary are enabled). - - - - - The center of the obstacle, measured in the object's local space. - - - - - Height of the obstacle's cylinder shape. - - - - - Radius of the obstacle's capsule shape. - - - - - The shape of the obstacle. - - - - - The size of the obstacle, measured in the object's local space. - - - - - Velocity at which the obstacle moves around the NavMesh. - - - - - Shape of the obstacle. - - - - - Box shaped obstacle. - - - - - Capsule shaped obstacle. - - - - - A path as calculated by the navigation system. - - - - - Corner points of the path. (Read Only) - - - - - Status of the path. (Read Only) - - - - - Erase all corner points from path. - - - - - NavMeshPath constructor. - - - - - Calculate the corners for the path. - - Array to store path corners. - - The number of corners along the path - including start and end points. - - - - - Status of path. - - - - - The path terminates at the destination. - - - - - The path is invalid. - - - - - The path cannot reach the destination. - - - - - Specifies which agent type and areas to consider when searching the NavMesh. - - - - - The agent type ID, specifying which navigation meshes to consider for the query functions. - - - - - A bitmask representing the traversable area types. - - - - - Returns the area cost multiplier for the given area type for this filter. - - Index to retreive the cost for. - - The cost multiplier for the supplied area index. - - - - - Sets the pathfinding cost multiplier for this filter for a given area type. - - The area index to set the cost for. - The cost for the supplied area index. - - - - Contains data describing a triangulation of a navmesh. - - - - - NavMesh area indices for the navmesh triangulation. - - - - - Triangle indices for the navmesh triangulation. - - - - - NavMeshLayer values for the navmesh triangulation. - - - - - Vertices for the navmesh triangulation. - - - - - Level of obstacle avoidance. - - - - - Good avoidance. High performance impact. - - - - - Enable highest precision. Highest performance impact. - - - - - Enable simple avoidance. Low performance impact. - - - - - Medium avoidance. Medium performance impact. - - - - - Disable avoidance. - - - - - Link allowing movement outside the planar navigation mesh. - - - - - Is link active. - - - - - NavMesh area index for this OffMeshLink component. - - - - - Automatically update endpoints. - - - - - Can link be traversed in both directions. - - - - - Modify pathfinding cost for the link. - - - - - The transform representing link end position. - - - - - NavMeshLayer for this OffMeshLink component. - - - - - Is link occupied. (Read Only) - - - - - The transform representing link start position. - - - - - Explicitly update the link endpoints. - - - - - State of OffMeshLink. - - - - - Is link active (Read Only). - - - - - Link end world position (Read Only). - - - - - Link type specifier (Read Only). - - - - - The OffMeshLink if the link type is a manually placed Offmeshlink (Read Only). - - - - - Link start world position (Read Only). - - - - - Is link valid (Read Only). - - - - - Link type specifier. - - - - - Vertical drop. - - - - - Horizontal jump. - - - - - Manually specified type of link. - - - - - Unity Analytics provides insight into your game users e.g. DAU, MAU. - - - - - Get the Analytics config endpoint. - - - - - Controls whether the sending of device stats at runtime is enabled. - - - - - Controls whether the Analytics service is enabled at runtime. - - - - - Get the Analytics event endpoint. - - - - - Reports whether Unity is set to initialize Analytics on startup. - - - - - Controls whether to limit user tracking at runtime. - - - - - Reports whether the player has opted out of data collection. - - - - - Custom Events (optional). - - Name of custom event. Name cannot include the prefix "unity." - This is a reserved keyword. - Additional parameters sent to Unity Analytics at the time the custom event was triggered. Dictionary key cannot include the prefix "unity." - This is a reserved keyword. - - - - Custom Events (optional). - - - - - - Custom Events (optional). - - - - - - - Use it to enable or disable a custom event. - - - - - - - Use it to enable or disable an event. - - - - - - - - - Attempts to flush immediately all queued analytics events to the network and filesystem cache if possible (optional). - - - - - Use it to check to custom event enable status. - - - - - - Use it to check to an event enable status. - - - - - - - - This API is used for registering a Runtime Analytics event. Note: This API is for internal use only and is likely change in the future. Do not use in user code. - - Name of the event. - Hourly limit for this event name. - Maximum number of items in this event. - Vendor key name. - Optional event name prefix value. - Event version number. - - - - This API is used for registering a Runtime Analytics event. Note: This API is for internal use only and is likely change in the future. Do not use in user code. - - Name of the event. - Hourly limit for this event name. - Maximum number of items in this event. - Vendor key name. - Optional event name prefix value. - Event version number. - - - - Resume Analytics initialization. - - - - - This API is used to send a Runtime Analytics event. Note: This API is for internal use only and is likely change in the future. Do not use in user code. - - Name of the event. - Event version number. - Optional event name prefix value. - Additional event data. - - - - Use this API to set the event end point URL. Note: This API is for internal use only and is likely change in the future. Do not use in user code. - - Name of the event. - Event version number. - Event end point URL. - Optional event name prefix value. - - - - Use this API to set the event priority. Note: This API is for internal use only and is likely change in the future. Do not use in user code. - - Name of the event. - Event version number. - Optional event name prefix value. - Event priority. - - - - User Demographics (optional). - - Birth year of user. Must be 4-digit year format, only. - - - - User Demographics (optional). - - Gender of user can be "Female", "Male", or "Unknown". - - - - User Demographics (optional). - - User id. - - - - Tracking Monetization (optional). - - The id of the purchased item. - The price of the item. - Abbreviation of the currency used for the transaction. For example “USD” (United States Dollars). See http:en.wikipedia.orgwikiISO_4217 for a standardized list of currency abbreviations. - Receipt data (iOS) receipt ID (android) for in-app purchases to verify purchases with Apple iTunes / Google Play. Use null in the absence of receipts. - Android receipt signature. If using native Android use the INAPP_DATA_SIGNATURE string containing the signature of the purchase data that was signed with the private key of the developer. The data signature uses the RSASSA-PKCS1-v1_5 scheme. Pass in null in absence of a signature. - Set to true when using UnityIAP. - - - - Tracking Monetization (optional). - - The id of the purchased item. - The price of the item. - Abbreviation of the currency used for the transaction. For example “USD” (United States Dollars). See http:en.wikipedia.orgwikiISO_4217 for a standardized list of currency abbreviations. - Receipt data (iOS) receipt ID (android) for in-app purchases to verify purchases with Apple iTunes / Google Play. Use null in the absence of receipts. - Android receipt signature. If using native Android use the INAPP_DATA_SIGNATURE string containing the signature of the purchase data that was signed with the private key of the developer. The data signature uses the RSASSA-PKCS1-v1_5 scheme. Pass in null in absence of a signature. - Set to true when using UnityIAP. - - - - Tracking Monetization (optional). - - The id of the purchased item. - The price of the item. - Abbreviation of the currency used for the transaction. For example “USD” (United States Dollars). See http:en.wikipedia.orgwikiISO_4217 for a standardized list of currency abbreviations. - Receipt data (iOS) receipt ID (android) for in-app purchases to verify purchases with Apple iTunes / Google Play. Use null in the absence of receipts. - Android receipt signature. If using native Android use the INAPP_DATA_SIGNATURE string containing the signature of the purchase data that was signed with the private key of the developer. The data signature uses the RSASSA-PKCS1-v1_5 scheme. Pass in null in absence of a signature. - Set to true when using UnityIAP. - - - - Analytics event priority. - - - - - Use this flag to send events while in the stop state. - - - - - Any current or previous events in the memory queue persist immediately to the filesystem. - - - - - Any current or previous events in the memory queue persist immediately to the filesystem and dispatcher service makes the events available to send to the server. It adds the events to the bottom of the dispatch queue and makes them available to send to the server. - - - - - This priority is similar to the Analytics.AnalyticsEventPriority.HighPriorityEvent, except these events are given a highest priority than other events in the disptach queue. It adds the events to the top of the dispatch queue and makes them available to send to the server. - - - - - This priority is similar to the Analytics.AnalyticsEventPriority.HighestPriorityEvent, except these events will be stored in the memory queue and will not persist in the file system. In case of failure to post the event to the server, it will not attempt to send them again. - - - - - Any current or previous events in the memory queue persist immediately to the filesystem. It adds the events to the bottom of the dispatch queue and makes them available to send to the server. - - - - - This priority lets you send events in the stop state, and makes any current or previous events in the memory queue persist immediately to the filesystem. It adds the events to the bottom of the dispatch queue and makes them available to send to the server. - - - - - Events will be stored in the memory queue, and will not persist in the file system. - - - - - In case of failure to post the event to the server, it will not attempt to send them again. - - - - - This priority queues events in-memory. - - - - - This priority is similar to the Analytics.AnalyticsEventPriority.NormalPriorityEvent, except these events will be stored in the memory queue and will not persist in the file system. In case of failure to post the event to the server, it will not attempt to send them again. - - - - - This priority queues events in-memory and writes them to the filesystem immediately. - - - - - Events with this flag are given higher priority compared to others while dispatching to the server. - - - - - Analytics API result. - - - - - Analytics API result: Analytics is disabled. - - - - - Analytics API result: Invalid argument value. - - - - - Analytics API result: Analytics not initialized. - - - - - Analytics API result: Success. - - - - - Analytics API result: Argument size limit. - - - - - Analytics API result: Too many parameters. - - - - - Analytics API result: Too many requests. - - - - - Analytics API result: This platform doesn't support Analytics. - - - - - Provides access to the Analytics session information for the current game instance. - - - - - Reports the current custom device ID. - - - - - Reports the current custom user ID. - - - - - The current user identity token that the Analytics server returns based on AnalyticsSessionInfo.userId. - - - - - Dispatched when AnalyticsSessionInfo.identityToken is updated by the server. - - - - - - The number of sessions played since the app was installed. - - - - - The time elapsed, in milliseconds, since the beginning of the current game session. - - - - - Reports whether the current session is the first session since the player installed the game or application. - - - - - A random, unique GUID identifying the current game or app session. - - - - - The current state of the session. - - - - - Dispatched when the Analytics session state changes. - - - - - - A random GUID uniquely identifying sessions played on the same instance of your game or app. - - - - - Defines the delegate signature to handle AnalyticsSettings.IdentityTokenChanged events. - - - - - - Dispatched when the Analytics session state changes. - - Current session state. - Current session id. - Length of the current session in milliseconds. - True, if the sessionId has changed; otherwise false. - - - - Session tracking states. - - - - - Session tracking has paused. - - - - - Session tracking has resumed. - - - - - Session tracking has started. - - - - - Session tracking has stopped. - - - - - User Demographics: Gender of a user. - - - - - User Demographics: Female Gender of a user. - - - - - User Demographics: Male Gender of a user. - - - - - User Demographics: Unknown Gender of a user. - - - - - Unity Performace provides insight into your game performace. - - - - - Controls whether the Performance Reporting service is enabled at runtime. - - - - - Time taken to initialize graphics in microseconds, measured from application startup. - - - - - Parent class for all joints that have anchor points. - - - - - The joint's anchor point on the object that has the joint component. - - - - - Should the connectedAnchor be calculated automatically? - - - - - The joint's anchor point on the second object (ie, the one which doesn't have the joint component). - - - - - Interface into Android specific functionality. - - - - - Set sustained performance mode. When enabled, sustained performance mode is intended to provide a consistent level of performance for a prolonged amount of time. - - - - - - Structure describing a permission that requires user authorization. - - - - - Used when requesting permission or checking if permission has been granted to use the camera. - - - - - Used when requesting permission or checking if permission has been granted to use the users location with coarse granularity. - - - - - Used when requesting permission or checking if permission has been granted to read from external storage such as a SD card. - - - - - Used when requesting permission or checking if permission has been granted to write to external storage such as a SD card. - - - - - Used when requesting permission or checking if permission has been granted to use the users location with high precision. - - - - - Check if the user has granted access to a device resource or information that requires authorization. - - A string representing the permission to request. For permissions which Unity has not predefined you may also manually provide the constant value obtained from the Android documentation here: https:developer.android.comguidetopicspermissionsoverview#permission-groups such as "android.permission.READ_CONTACTS". - - Whether the requested permission has been granted. - - - - - Used when requesting permission or checking if permission has been granted to use the microphone. - - - - - Request that the user grant access to a device resource or information that requires authorization. - - A string that describes the permission to request. For permissions which Unity has not predefined you may also manually provide the constant value obtained from the Android documentation here: https:developer.android.comguidetopicspermissionsoverview#permission-groups such as "android.permission.READ_CONTACTS". - An instance of callbacks invoked when permission request is executed. - - - - Request that the user grant access to a device resource or information that requires authorization. - - A string that describes the permission to request. For permissions which Unity has not predefined you may also manually provide the constant value obtained from the Android documentation here: https:developer.android.comguidetopicspermissionsoverview#permission-groups such as "android.permission.READ_CONTACTS". - An instance of callbacks invoked when permission request is executed. - - - - Request that the user grant access to a device resource or information that requires authorization. - - An instance of callbacks invoked when permission request is executed. - An array of strings that describe the permissions to request. - - - - Request that the user grant access to a device resource or information that requires authorization. - - An instance of callbacks invoked when permission request is executed. - An array of strings that describe the permissions to request. - - - - Contains callbacks invoked when permission request is executed using Permission.RequestUserPermission. - - - - - Executed when user chooses Deny when requesting permission. - - - - - - Executed when user chooses Deny And Don't Ask Again when requesting permission. - - - - - - Executed when user chooses Allow when requesting permission. - - - - - - ActivityIndicator Style (Android Specific). - - - - - Do not show ActivityIndicator. - - - - - Large Inversed (android.R.attr.progressBarStyleLargeInverse). - - - - - Small Inversed (android.R.attr.progressBarStyleSmallInverse). - - - - - Large (android.R.attr.progressBarStyleLarge). - - - - - Small (android.R.attr.progressBarStyleSmall). - - - - - AndroidInput provides support for off-screen touch input, such as a touchpad. - - - - - Property indicating whether the system provides secondary touch input. - - - - - Property indicating the height of the secondary touchpad. - - - - - Property indicating the width of the secondary touchpad. - - - - - Number of secondary touches. Guaranteed not to change throughout the frame. (Read Only). - - - - - Returns object representing status of a specific touch on a secondary touchpad (Does not allocate temporary variables). - - - - - - AndroidJavaClass is the Unity representation of a generic instance of java.lang.Class. - - - - - Construct an AndroidJavaClass from the class name. - - Specifies the Java class name (e.g. <tt>java.lang.String</tt>). - - - - AndroidJavaObject is the Unity representation of a generic instance of java.lang.Object. - - - - - Calls a Java method on an object (non-static). - - Specifies which method to call. - An array of parameters passed to the method. - - - - Call a Java method on an object. - - Specifies which method to call. - An array of parameters passed to the method. - - - - Call a static Java method on a class. - - Specifies which method to call. - An array of parameters passed to the method. - - - - Call a static Java method on a class. - - Specifies which method to call. - An array of parameters passed to the method. - - - - Construct an AndroidJavaObject based on the name of the class. - - Specifies the Java class name (e.g. "<tt>java.lang.String<tt>" or "<tt>javalangString<tt>"). - An array of parameters passed to the constructor. - - - - IDisposable callback. - - - - - Get the value of a field in an object (non-static). - - The name of the field (e.g. int counter; would have fieldName = "counter"). - - - - Retrieves the raw <tt>jclass</tt> pointer to the Java class. - -Note: Using raw JNI functions requires advanced knowledge of the Android Java Native Interface (JNI). Please take note. - - - - - Retrieves the raw <tt>jobject</tt> pointer to the Java object. - -Note: Using raw JNI functions requires advanced knowledge of the Android Java Native Interface (JNI). Please take note. - - - - - Get the value of a static field in an object type. - - The name of the field (e.g. <i>int counter;</i> would have fieldName = "counter"). - - - - Set the value of a field in an object (non-static). - - The name of the field (e.g. int counter; would have fieldName = "counter"). - The value to assign to the field. It has to match the field type. - - - - Set the value of a static field in an object type. - - The name of the field (e.g. int counter; would have fieldName = "counter"). - The value to assign to the field. It has to match the field type. - - - - This class can be used to implement any java interface. Any java vm method invocation matching the interface on the proxy object will automatically be passed to the c# implementation. - - - - - The equivalent of the java.lang.Object equals() method. - - - - Returns true when the objects are equal and false if otherwise. - - - - - The equivalent of the java.lang.Object hashCode() method. - - - Returns the hash code of the java proxy object. - - - - - Java interface implemented by the proxy. - - - - - The equivalent of the java.lang.Object toString() method. - - - Returns C# class name + " <c# proxy java object>". - - - - - - - Java interface to be implemented by the proxy. - - - - - - Java interface to be implemented by the proxy. - - - - Called by the java vm whenever a method is invoked on the java proxy interface. You can override this to run special code on method invokation, or you can leave the implementation as is, and leave the default behavior which is to look for c# methods matching the signature of the java method. - - Name of the invoked java method. - Arguments passed from the java vm - converted into AndroidJavaObject, AndroidJavaClass or a primitive. - Arguments passed from the java vm - all objects are represented by AndroidJavaObject, int for instance is represented by a java.lang.Integer object. - - - - Called by the java vm whenever a method is invoked on the java proxy interface. You can override this to run special code on method invokation, or you can leave the implementation as is, and leave the default behavior which is to look for c# methods matching the signature of the java method. - - Name of the invoked java method. - Arguments passed from the java vm - converted into AndroidJavaObject, AndroidJavaClass or a primitive. - Arguments passed from the java vm - all objects are represented by AndroidJavaObject, int for instance is represented by a java.lang.Integer object. - - - - AndroidJavaRunnable is the Unity representation of a java.lang.Runnable object. - - - - - 'Raw' JNI interface to Android Java VM from Unity scripting (C#). - -Note: Using raw JNI functions requires advanced knowledge of the Android Java Native Interface (JNI). Please take note. - - - - - Allocates a new Java object without invoking any of the constructors for the object. - - - - - - Attaches the current thread to a Java (Dalvik) VM. - - - - - Calls a Java instance method defined by <tt>methodID<tt>, optionally passing an array of arguments (<tt>args<tt>) to the method. - - - - - - - - Calls a Java instance method defined by <tt>methodID<tt>, optionally passing an array of arguments (<tt>args<tt>) to the method. - - - - - - - - Calls a Java instance method defined by <tt>methodID<tt>, optionally passing an array of arguments (<tt>args<tt>) to the method. - - - - - - - - Calls a Java instance method defined by <tt>methodID<tt>, optionally passing an array of arguments (<tt>args<tt>) to the method. - - - - - - - - Calls a Java instance method defined by <tt>methodID<tt>, optionally passing an array of arguments (<tt>args<tt>) to the method. - - - - - - - - Calls a Java instance method defined by <tt>methodID<tt>, optionally passing an array of arguments (<tt>args<tt>) to the method. - - - - - - - - Calls a Java instance method defined by <tt>methodID<tt>, optionally passing an array of arguments (<tt>args<tt>) to the method. - - - - - - - - Calls a Java instance method defined by <tt>methodID<tt>, optionally passing an array of arguments (<tt>args<tt>) to the method. - - - - - - - - Calls a Java instance method defined by <tt>methodID<tt>, optionally passing an array of arguments (<tt>args<tt>) to the method. - - - - - - - - Calls a Java instance method defined by <tt>methodID<tt>, optionally passing an array of arguments (<tt>args<tt>) to the method. - - - - - - - - Invokes the specified <tt>methodID<tt> static method on a Java object, optionally passing in an array of arguments (<tt>args<tt>). - - - - - - - - Invokes the specified <tt>methodID<tt> static method on a Java object, optionally passing in an array of arguments (<tt>args<tt>). - - - - - - - - Invokes the specified <tt>methodID<tt> static method on a Java object, optionally passing in an array of arguments (<tt>args<tt>). - - - - - - - - Invokes the specified <tt>methodID<tt> static method on a Java object, optionally passing in an array of arguments (<tt>args<tt>). - - - - - - - - Invokes the specified <tt>methodID<tt> static method on a Java object, optionally passing in an array of arguments (<tt>args<tt>). - - - - - - - - Invokes the specified <tt>methodID<tt> static method on a Java object, optionally passing in an array of arguments (<tt>args<tt>). - - - - - - - - Invokes the specified <tt>methodID<tt> static method on a Java object, optionally passing in an array of arguments (<tt>args<tt>). - - - - - - - - Invokes the specified <tt>methodID<tt> static method on a Java object, optionally passing in an array of arguments (<tt>args<tt>). - - - - - - - - Invokes the specified <tt>methodID<tt> static method on a Java object, optionally passing in an array of arguments (<tt>args<tt>). - - - - - - - - Invokes the specified <tt>methodID<tt> static method on a Java object, optionally passing in an array of arguments (<tt>args<tt>). - - - - - - - - Invokes the specified <tt>methodID<tt> static method on a Java object, optionally passing in an array of arguments (<tt>args<tt>). - - - - - - - - Invokes the specified <tt>methodID<tt> static method on a Java object, optionally passing in an array of arguments (<tt>args<tt>). - - - - - - - - Calls a Java instance method defined by <tt>methodID<tt>, optionally passing an array of arguments (<tt>args<tt>) to the method. - - - - - - - - Calls a Java instance method defined by <tt>methodID<tt>, optionally passing an array of arguments (<tt>args<tt>) to the method. - - - - - - - - Deletes the global reference pointed to by <tt>obj</tt>. - - - - - - Deletes the local reference pointed to by <tt>obj</tt>. - - - - - - Deletes the global weak reference pointed to by <tt>obj</tt>. - - - - - - Detaches the current thread from a Java (Dalvik) VM. - - - - - Ensures that at least a given number of local references can be created in the current thread. - - - - - - Clears any exception that is currently being thrown. - - - - - Prints an exception and a backtrace of the stack to the <tt>logcat</tt> - - - - - Determines if an exception is being thrown. - - - - - Raises a fatal error and does not expect the VM to recover. This function does not return. - - - - - - This function loads a locally-defined class. - - - - - - Converts a Java array of <tt>boolean</tt> to a managed array of System.Boolean. - - - - - - Converts a Java array of <tt>byte</tt> to a managed array of System.Byte. - - - - - - Converts a Java array of <tt>char</tt> to a managed array of System.Char. - - - - - - Converts a Java array of <tt>double</tt> to a managed array of System.Double. - - - - - - Converts a Java array of <tt>float</tt> to a managed array of System.Single. - - - - - - Converts a Java array of <tt>int</tt> to a managed array of System.Int32. - - - - - - Converts a Java array of <tt>long</tt> to a managed array of System.Int64. - - - - - - Converts a Java array of <tt>java.lang.Object</tt> to a managed array of System.IntPtr, representing Java objects. - - - - - - Converts a <tt>java.lang.reflect.Field</tt> to a field ID. - - - - - - Converts a <tt>java.lang.reflect.Method<tt> or <tt>java.lang.reflect.Constructor<tt> object to a method ID. - - - - - - Converts a Java array of <tt>byte</tt> to a managed array of System.SByte. - - - - - - Converts a Java array of <tt>short</tt> to a managed array of System.Int16. - - - - - - Returns the number of elements in the array. - - - - - - Returns the value of one element of a primitive array. - - - - - - - Returns the value of an instance (nonstatic) field of an object. - - - - - - - Returns the value of one element of a primitive array. - - - - - - - Returns the value of an instance (nonstatic) field of an object. - - - - - - - Returns the value of one element of a primitive array. - - - - - - - Returns the value of an instance (nonstatic) field of an object. - - - - - - - Returns the value of one element of a primitive array. - - - - - - - Returns the value of an instance (nonstatic) field of an object. - - - - - - - Returns the field ID for an instance (nonstatic) field of a class. - - - - - - - - Returns the value of one element of a primitive array. - - - - - - - Returns the value of an instance (nonstatic) field of an object. - - - - - - - Returns the value of one element of a primitive array. - - - - - - - Returns the value of an instance (nonstatic) field of an object. - - - - - - - Returns the value of one element of a primitive array. - - - - - - - Returns the value of an instance (nonstatic) field of an object. - - - - - - - Returns the method ID for an instance (nonstatic) method of a class or interface. - - - - - - - - Returns an element of an <tt>Object</tt> array. - - - - - - - Returns the class of an object. - - - - - - Returns the value of an instance (nonstatic) field of an object. - - - - - - - Returns the value of one element of a primitive array. - - - - - - - Returns the value of an instance (nonstatic) field of an object. - - - - - - - Returns the value of one element of a primitive array. - - - - - - - Returns the value of an instance (nonstatic) field of an object. - - - - - - - Returns the value of a static field of an object. - - - - - - - Returns the value of a static field of an object. - - - - - - - Returns the value of a static field of an object. - - - - - - - Returns the value of a static field of an object. - - - - - - - Returns the field ID for a static field of a class. - - - - - - - - Returns the value of a static field of an object. - - - - - - - Returns the value of a static field of an object. - - - - - - - Returns the value of a static field of an object. - - - - - - - Returns the method ID for a static method of a class. - - - - - - - - Returns the value of a static field of an object. - - - - - - - Returns the value of a static field of an object. - - - - - - - Returns the value of a static field of an object. - - - - - - - Returns the value of a static field of an object. - - - - - - - Returns a pointer to the array of Unicode characters of the string. This pointer is valid until ReleaseStringchars() is called. - - - - - - Returns the value of an instance (nonstatic) field of an object. - - - - - - - Returns the length (the count of Unicode characters) of a Java string. - - - - - - Returns a managed string object representing the string in modified UTF-8 encoding. - - - - - - Returns the length in bytes of the modified UTF-8 representation of a string. - - - - - - If <tt>clazz<tt> represents any class other than the class <tt>Object<tt>, then this function returns the object that represents the superclass of the class specified by <tt>clazz</tt>. - - - - - - Returns the version of the native method interface. - - - - - Determines whether an object of <tt>clazz1<tt> can be safely cast to <tt>clazz2<tt>. - - - - - - - Tests whether an object is an instance of a class. - - - - - - - Tests whether two references refer to the same Java object. - - - - - - - Constructs a new primitive array object. - - - - - - Constructs a new primitive array object. - - - - - - Constructs a new primitive array object. - - - - - - Constructs a new primitive array object. - - - - - - Constructs a new primitive array object. - - - - - - Creates a new global reference to the object referred to by the <tt>obj</tt> argument. - - - - - - Constructs a new primitive array object. - - - - - - Creates a new local reference that refers to the same object as <tt>obj</tt>. - - - - - - Constructs a new primitive array object. - - - - - - Constructs a new Java object. The method ID indicates which constructor method to invoke. This ID must be obtained by calling GetMethodID() with <init> as the method name and void (V) as the return type. - - - - - - - - Constructs a new array holding objects in class <tt>clazz<tt>. All elements are initially set to <tt>obj<tt>. - - - - - - - - Constructs a new primitive array object. - - - - - - Constructs a new primitive array object. - - - - - - Constructs a new <tt>java.lang.String</tt> object from an array of Unicode characters. - - - - - - Constructs a new <tt>java.lang.String</tt> object from an array of Unicode characters. - - - - - - Constructs a new <tt>java.lang.String</tt> object from an array of characters in modified UTF-8 encoding. - - - - - - Creates a new global weak reference to the object referred to by the <tt>obj</tt> argument. - - - - - - Pops off the current local reference frame, frees all the local references, and returns a local reference in the previous local reference frame for the given <tt>result</tt> object. - - - - - - Creates a new local reference frame, in which at least a given number of local references can be created. - - - - - - Sets the boolean value of one element in a primitive array. - - The array of native booleans. - Index of the array element to set. - The value to set. - - - - Sets the boolean value of one element in a primitive array. - - The array of native booleans. - Index of the array element to set. - The value to set - for 'true' use 1, for 'false' use 0. - - - - Sets the value of an instance field of the specified object. - - - - - - - - Sets the sbyte value of one element in a primitive array. - - - - - - - - Sets the value of an instance field of the specified object. - - - - - - - - Sets the char value of one element in a primitive array. - - - - - - - - Sets the value of an instance field of the specified object. - - - - - - - - Sets the double value of one element in a primitive array. - - - - - - - - Sets the value of an instance field of the specified object. - - - - - - - - Sets the float value of one element in a primitive array. - - - - - - - - Sets the value of an instance field of the specified object. - - - - - - - - Sets the int value of one element in a primitive array. - - - - - - - - Sets the value of an instance field of the specified object. - - - - - - - - Sets the long value of one element in a primitive array. - - - - - - - - Sets the value of an instance field of the specified object. - - - - - - - - Sets an element of an <tt>Object</tt> array. - - - - - - - - Sets the value of an instance field of the specified object. - - - - - - - - Sets the sbyte value of one element in a primitive array. - - - - - - - - Sets the value of an instance field of the specified object. - - - - - - - - Sets the short value of one element in a primitive array. - - - - - - - - Sets the value of an instance field of the specified object. - - - - - - - - Sets the value of a static field in the specified object. - - - - - - - - Sets the value of a static field in the specified object. - - - - - - - - Sets the value of a static field in the specified object. - - - - - - - - Sets the value of a static field in the specified object. - - - - - - - - Sets the value of a static field in the specified object. - - - - - - - - Sets the value of a static field in the specified object. - - - - - - - - Sets the value of a static field in the specified object. - - - - - - - - Sets the value of a static field in the specified object. - - - - - - - - Sets the value of a static field in the specified object. - - - - - - - - Sets the value of a static field in the specified object. - - - - - - - - Sets the value of a static field in the specified object. - - - - - - - - Sets the value of an instance field of the specified object. - - - - - - - - Causes a <tt>java.lang.Throwable</tt> object to be thrown. - - - - - - Constructs an exception object from the specified class with the <tt>message</tt> specified by message and causes that exception to be thrown. - - - - - - - Converts a managed array of System.Boolean to a Java array of <tt>boolean</tt>. - - - - - - Converts a managed array of System.Byte to a Java array of <tt>byte</tt>. - - - - - - Converts a managed array of System.Char to a Java array of <tt>char</tt>. - - - - - - Converts a managed array of System.Double to a Java array of <tt>double</tt>. - - - - - - Converts a managed array of System.Single to a Java array of <tt>float</tt>. - - - - - - Converts a managed array of System.Int32 to a Java array of <tt>int</tt>. - - - - - - Converts a managed array of System.Int64 to a Java array of <tt>long</tt>. - - - - - - Converts a managed array of System.IntPtr, representing Java objects, to a Java array of <tt>java.lang.Object</tt>. - - - - - - Converts a field ID derived from cls to a <tt>java.lang.reflect.Field</tt> object. - - - - - - - - Converts a method ID derived from clazz to a <tt>java.lang.reflect.Method<tt> or <tt>java.lang.reflect.Constructor<tt> object. - - - - - - - - Converts a managed array of System.SByte to a Java array of <tt>byte</tt>. - - - - - - Converts a managed array of System.Int16 to a Java array of <tt>short</tt>. - - - - - - Helper interface for JNI interaction; signature creation and method lookups. - -Note: Using raw JNI functions requires advanced knowledge of the Android Java Native Interface (JNI). Please take note. - - - - - Set debug to true to log calls through the AndroidJNIHelper. - - - - - Creates a managed array from a Java array. - - Java array object to be converted into a managed array. - - - - Creates a Java array from a managed array. - - Managed array to be converted into a Java array object. - - - - Creates a java proxy object which connects to the supplied proxy implementation. - - An implementatinon of a java interface in c#. - - - - Creates a UnityJavaRunnable object (implements java.lang.Runnable). - - A delegate representing the java.lang.Runnable. - - - - - Creates the parameter array to be used as argument list when invoking Java code through CallMethod() in AndroidJNI. - - An array of objects that should be converted to Call parameters. - - - - Deletes any local jni references previously allocated by CreateJNIArgArray(). - - The array of arguments used as a parameter to CreateJNIArgArray(). - The array returned by CreateJNIArgArray(). - - - - Scans a particular Java class for a constructor method matching a signature. - - Raw JNI Java class object (obtained by calling AndroidJNI.FindClass). - Constructor method signature (e.g. obtained by calling AndroidJNIHelper.GetSignature). - - - - Scans a particular Java class for a constructor method matching a signature. - - Raw JNI Java class object (obtained by calling AndroidJNI.FindClass). - Constructor method signature (e.g. obtained by calling AndroidJNIHelper.GetSignature). - - - - Get a JNI method ID for a constructor based on calling arguments. - - Raw JNI Java class object (obtained by calling AndroidJNI.FindClass). - Array with parameters to be passed to the constructor when invoked. - - - - - Scans a particular Java class for a field matching a name and a signature. - - Raw JNI Java class object (obtained by calling AndroidJNI.FindClass). - Name of the field as declared in Java. - Field signature (e.g. obtained by calling AndroidJNIHelper.GetSignature). - Set to <tt>true<tt> for static fields; <tt>false<tt> for instance (nonstatic) fields. - - - - Scans a particular Java class for a field matching a name and a signature. - - Raw JNI Java class object (obtained by calling AndroidJNI.FindClass). - Name of the field as declared in Java. - Field signature (e.g. obtained by calling AndroidJNIHelper.GetSignature). - Set to <tt>true<tt> for static fields; <tt>false<tt> for instance (nonstatic) fields. - - - - Scans a particular Java class for a field matching a name and a signature. - - Raw JNI Java class object (obtained by calling AndroidJNI.FindClass). - Name of the field as declared in Java. - Field signature (e.g. obtained by calling AndroidJNIHelper.GetSignature). - Set to <tt>true<tt> for static fields; <tt>false<tt> for instance (nonstatic) fields. - - - - Get a JNI field ID based on type detection. Generic parameter represents the field type. - - Raw JNI Java class object (obtained by calling AndroidJNI.FindClass). - Name of the field as declared in Java. - Set to <tt>true<tt> for static fields; <tt>false<tt> for instance (nonstatic) fields. - - - - - Scans a particular Java class for a method matching a name and a signature. - - Raw JNI Java class object (obtained by calling AndroidJNI.FindClass). - Name of the method as declared in Java. - Method signature (e.g. obtained by calling AndroidJNIHelper.GetSignature). - Set to <tt>true<tt> for static methods; <tt>false<tt> for instance (nonstatic) methods. - - - - Scans a particular Java class for a method matching a name and a signature. - - Raw JNI Java class object (obtained by calling AndroidJNI.FindClass). - Name of the method as declared in Java. - Method signature (e.g. obtained by calling AndroidJNIHelper.GetSignature). - Set to <tt>true<tt> for static methods; <tt>false<tt> for instance (nonstatic) methods. - - - - Scans a particular Java class for a method matching a name and a signature. - - Raw JNI Java class object (obtained by calling AndroidJNI.FindClass). - Name of the method as declared in Java. - Method signature (e.g. obtained by calling AndroidJNIHelper.GetSignature). - Set to <tt>true<tt> for static methods; <tt>false<tt> for instance (nonstatic) methods. - - - - Get a JNI method ID based on calling arguments. - - Raw JNI Java class object (obtained by calling AndroidJNI.FindClass). - Name of the method as declared in Java. - Array with parameters to be passed to the method when invoked. - Set to <tt>true<tt> for static methods; <tt>false<tt> for instance (nonstatic) methods. - - - - - Get a JNI method ID based on calling arguments. - - Raw JNI Java class object (obtained by calling AndroidJNI.FindClass). - Name of the method as declared in Java. - Array with parameters to be passed to the method when invoked. - Set to <tt>true<tt> for static methods; <tt>false<tt> for instance (nonstatic) methods. - - - - - Creates the JNI signature string for particular object type. - - Object for which a signature is to be produced. - - - - Creates the JNI signature string for an object parameter list. - - Array of object for which a signature is to be produced. - - - - Creates the JNI signature string for an object parameter list. - - Array of object for which a signature is to be produced. - - - - The animation component is used to play back animations. - - - - - When turned on, Unity might stop animating if it thinks that the results of the animation won't be visible to the user. - - - - - When turned on, animations will be executed in the physics loop. This is only useful in conjunction with kinematic rigidbodies. - - - - - The default animation. - - - - - Controls culling of this Animation component. - - - - - Is an animation currently being played? - - - - - AABB of this Animation animation component in local space. - - - - - Should the default animation clip (the Animation.clip property) automatically start playing on startup? - - - - - How should time beyond the playback range of the clip be treated? - - - - - Adds a clip to the animation with name newName. - - - - - - - Adds clip to the only play between firstFrame and lastFrame. The new clip will also be added to the animation with name newName. - - Should an extra frame be inserted at the end that matches the first frame? Turn this on if you are making a looping animation. - - - - - - - - Adds clip to the only play between firstFrame and lastFrame. The new clip will also be added to the animation with name newName. - - Should an extra frame be inserted at the end that matches the first frame? Turn this on if you are making a looping animation. - - - - - - - - Blends the animation named animation towards targetWeight over the next time seconds. - - - - - - - - Blends the animation named animation towards targetWeight over the next time seconds. - - - - - - - - Blends the animation named animation towards targetWeight over the next time seconds. - - - - - - - - Fades the animation with name animation in over a period of time seconds and fades other animations out. - - - - - - - - Fades the animation with name animation in over a period of time seconds and fades other animations out. - - - - - - - - Fades the animation with name animation in over a period of time seconds and fades other animations out. - - - - - - - - Cross fades an animation after previous animations has finished playing. - - - - - - - - - Cross fades an animation after previous animations has finished playing. - - - - - - - - - Cross fades an animation after previous animations has finished playing. - - - - - - - - - Cross fades an animation after previous animations has finished playing. - - - - - - - - - Get the number of clips currently assigned to this animation. - - - - - Is the animation named name playing? - - - - - - Plays an animation without blending. - - - - - - - Plays an animation without blending. - - - - - - - Plays an animation without blending. - - - - - - - Plays an animation without blending. - - - - - - - Plays an animation after previous animations has finished playing. - - - - - - - - Plays an animation after previous animations has finished playing. - - - - - - - - Plays an animation after previous animations has finished playing. - - - - - - - - Remove clip from the animation list. - - - - - - Remove clip from the animation list. - - - - - - Rewinds the animation named name. - - - - - - Rewinds all animations. - - - - - Samples animations at the current state. - - - - - Stops all playing animations that were started with this Animation. - - - - - Stops an animation named name. - - - - - - Returns the animation state named name. - - - - - Used by Animation.Play function. - - - - - Animations will be added. - - - - - Animations will be blended. - - - - - Stores keyframe based animations. - - - - - Returns true if the animation clip has no curves and no events. - - - - - Animation Events for this animation clip. - - - - - Frame rate at which keyframes are sampled. (Read Only) - - - - - Returns true if the Animation has animation on the root transform. - - - - - Returns true if the AnimationClip has root motion curves. - - - - - Returns true if the AnimationClip has editor curves for its root motion. - - - - - Returns true if the AnimationClip has root Curves. - - - - - Returns true if the animation contains curve that drives a humanoid rig. - - - - - Set to true if the AnimationClip will be used with the Legacy Animation component ( instead of the Animator ). - - - - - Animation length in seconds. (Read Only) - - - - - AABB of this Animation Clip in local space of Animation component that it is attached too. - - - - - Sets the default wrap mode used in the animation state. - - - - - Adds an animation event to the clip. - - AnimationEvent to add. - - - - Clears all curves from the clip. - - - - - Creates a new animation clip. - - - - - Realigns quaternion keys to ensure shortest interpolation paths. - - - - - Samples an animation at a given time for any animated properties. - - The animated game object. - The time to sample an animation. - - - - Assigns the curve to animate a specific property. - - Path to the game object this curve applies to. The relativePath - is formatted similar to a pathname, e.g. "rootspineleftArm". If relativePath - is empty it refers to the game object the animation clip is attached to. - The class type of the component that is animated. - The name or path to the property being animated. - The animation curve. - - - - This class defines a pair of clips used by AnimatorOverrideController. - - - - - The original clip from the controller. - - - - - The override animation clip. - - - - - This enum controlls culling of Animation component. - - - - - Animation culling is disabled - object is animated even when offscreen. - - - - - Animation is disabled when renderers are not visible. - - - - - Store a collection of Keyframes that can be evaluated over time. - - - - - All keys defined in the animation curve. - - - - - The number of keys in the curve. (Read Only) - - - - - The behaviour of the animation after the last keyframe. - - - - - The behaviour of the animation before the first keyframe. - - - - - Add a new key to the curve. - - The time at which to add the key (horizontal axis in the curve graph). - The value for the key (vertical axis in the curve graph). - - The index of the added key, or -1 if the key could not be added. - - - - - Add a new key to the curve. - - The key to add to the curve. - - The index of the added key, or -1 if the key could not be added. - - - - - Creates a constant "curve" starting at timeStart, ending at timeEnd and with the value value. - - The start time for the constant curve. - The start time for the constant curve. - The value for the constant curve. - - The constant curve created from the specified values. - - - - - Creates an animation curve from an arbitrary number of keyframes. - - An array of Keyframes used to define the curve. - - - - Creates an empty animation curve. - - - - - Creates an ease-in and out curve starting at timeStart, valueStart and ending at timeEnd, valueEnd. - - The start time for the ease curve. - The start value for the ease curve. - The end time for the ease curve. - The end value for the ease curve. - - The ease-in and out curve generated from the specified values. - - - - - Evaluate the curve at time. - - The time within the curve you want to evaluate (the horizontal axis in the curve graph). - - The value of the curve, at the point in time specified. - - - - - A straight Line starting at timeStart, valueStart and ending at timeEnd, valueEnd. - - The start time for the linear curve. - The start value for the linear curve. - The end time for the linear curve. - The end value for the linear curve. - - The linear curve created from the specified values. - - - - - Removes the keyframe at index and inserts key. - - The index of the key to move. - The key (with its new time) to insert. - - The index of the keyframe after moving it. - - - - - Removes a key. - - The index of the key to remove. - - - - Smooth the in and out tangents of the keyframe at index. - - The index of the keyframe to be smoothed. - The smoothing weight to apply to the keyframe's tangents. - - - - Retrieves the key at index. (Read Only) - - - - - AnimationEvent lets you call a script function similar to SendMessage as part of playing back an animation. - - - - - The animation state that fired this event (Read Only). - - - - - The animator clip info related to this event (Read Only). - - - - - The animator state info related to this event (Read Only). - - - - - Float parameter that is stored in the event and will be sent to the function. - - - - - The name of the function that will be called. - - - - - Int parameter that is stored in the event and will be sent to the function. - - - - - Returns true if this Animation event has been fired by an Animator component. - - - - - Returns true if this Animation event has been fired by an Animation component. - - - - - Function call options. - - - - - Object reference parameter that is stored in the event and will be sent to the function. - - - - - String parameter that is stored in the event and will be sent to the function. - - - - - The time at which the event will be fired off. - - - - - Creates a new animation event. - - - - - Information about what animation clips is played and its weight. - - - - - Animation clip that is played. - - - - - The weight of the animation clip. - - - - - Constrains the orientation of an object relative to the position of one or more source objects, such that the object is facing the average position of the sources. - - - - - The axis towards which the constrained object orients. - - - - - Activates or deactivates the constraint. - - - - - Locks the offset and rotation at rest. - - - - - The rotation used when the sources have a total weight of 0. - - - - - The axes affected by the AimConstraint. - - - - - Represents an offset from the constrained orientation. - - - - - The number of sources set on the component (read-only). - - - - - The up vector. - - - - - The weight of the constraint component. - - - - - The world up object, used to calculate the world up vector when the world up Type is AimConstraint.WorldUpType.ObjectUp or AimConstraint.WorldUpType.ObjectRotationUp. - - - - - The type of the world up vector. - - - - - The world up Vector used when the world up type is AimConstraint.WorldUpType.Vector or AimConstraint.WorldUpType.ObjectRotationUp. - - - - - Adds a constraint source. - - The source object and its weight. - - Returns the index of the added source. - - - - - Gets a constraint source by index. - - The index of the source. - - The source object and its weight. - - - - - Gets the list of sources. - - The list of sources to be filled by the component. - - - - Removes a source from the component. - - The index of the source to remove. - - - - Sets a source at a specified index. - - The index of the source to set. - The source object and its weight. - - - - Sets the list of sources on the component. - - The list of sources to set. - - - - Specifies how the world up vector used by the aim constraint is defined. - - - - - Neither defines nor uses a world up vector. - - - - - Uses and defines the world up vector as relative to the local space of the object. - - - - - Uses and defines the world up vector as a vector from the constrained object, in the direction of the up object. - - - - - Uses and defines the world up vector as the Unity Scene up vector (the Y axis). - - - - - Uses and defines the world up vector as a vector specified by the user. - - - - - A Playable that controls an AnimationClip. - - - - - Creates an AnimationClipPlayable in the PlayableGraph. - - The PlayableGraph object that will own the AnimationClipPlayable. - The AnimationClip that will be added in the PlayableGraph. - - A AnimationClipPlayable linked to the PlayableGraph. - - - - - Returns the AnimationClip stored in the AnimationClipPlayable. - - - - - Returns the state of the ApplyFootIK flag. - - - - - Returns the state of the ApplyPlayableIK flag. - - - - - Sets the value of the ApplyFootIK flag. - - The new value of the ApplyFootIK flag. - - - - Requests OnAnimatorIK to be called on the animated GameObject. - - - - - - The humanoid stream of animation data passed from one Playable to another. - - - - - The position of the body center of mass relative to the root. - - - - - The rotation of the body center of mass relative to the root. - - - - - The position of the body center of mass in world space. - - - - - The rotation of the body center of mass in world space. - - - - - The scale of the Avatar. (Read Only) - - - - - Returns true if the stream is valid; false otherwise. (Read Only) - - - - - The left foot height from the floor. (Read Only) - - - - - The left foot velocity from the last evaluated frame. (Read Only) - - - - - The right foot height from the floor. (Read Only) - - - - - The right foot velocity from the last evaluated frame. (Read Only) - - - - - Returns the position of this IK goal relative to the root. - - The AvatarIKGoal that is queried. - - The position of this IK goal. - - - - - Returns the rotation of this IK goal relative to the root. - - The AvatarIKGoal that is queried. - - The rotation of this IK goal. - - - - - Returns the position of this IK goal in world space. - - The AvatarIKGoal that is queried. - - The position of this IK goal. - - - - - Returns the position of this IK goal in world space computed from the stream current pose. - - The AvatarIKGoal that is queried. - - The position of this IK goal. - - - - - Returns the rotation of this IK goal in world space. - - The AvatarIKGoal that is queried. - - The rotation of this IK goal. - - - - - Returns the rotation of this IK goal in world space computed from the stream current pose. - - The AvatarIKGoal that is queried. - - The rotation of this IK goal. - - - - - Returns the position weight of the IK goal. - - The AvatarIKGoal that is queried. - - The position weight of the IK goal. - - - - - Returns the rotation weight of the IK goal. - - The AvatarIKGoal that is queried. - - The rotation weight of the IK goal. - - - - - Returns the position of this IK Hint in world space. - - The AvatarIKHint that is queried. - - The position of this IK Hint. - - - - - Returns the position weight of the IK Hint. - - The AvatarIKHint that is queried. - - The position weight of the IK Hint. - - - - - Returns the muscle value. - - The Muscle that is queried. - - The muscle value. - - - - - Reset the current pose to the stance pose (T Pose). - - - - - Sets the position of this IK goal relative to the root. - - The AvatarIKGoal that is queried. - The position of this IK goal. - - - - Sets the rotation of this IK goal relative to the root. - - The AvatarIKGoal that is queried. - The rotation of this IK goal. - - - - Sets the position of this IK goal in world space. - - The AvatarIKGoal that is queried. - The position of this IK goal. - - - - Sets the rotation of this IK goal in world space. - - The AvatarIKGoal that is queried. - The rotation of this IK goal. - - - - Sets the position weight of the IK goal. - - The AvatarIKGoal that is queried. - The position weight of the IK goal. - - - - Sets the rotation weight of the IK goal. - - The AvatarIKGoal that is queried. - The rotation weight of the IK goal. - - - - Sets the position of this IK hint in world space. - - The AvatarIKHint that is queried. - The position of this IK hint. - - - - Sets the position weight of the IK Hint. - - The AvatarIKHint that is queried. - The position weight of the IK Hint. - - - - Sets the LookAt body weight. - - The LookAt body weight. - - - - Sets the LookAt clamp weight. - - The LookAt clamp weight. - - - - Sets the LookAt eyes weight. - - The LookAt eyes weight. - - - - Sets the LookAt head weight. - - The LookAt head weight. - - - - Sets the look at position in world space. - - The look at position. - - - - Sets the muscle value. - - The Muscle that is queried. - The muscle value. - - - - Execute the IK solver. - - - - - An implementation of IPlayable that controls an animation layer mixer. - - - - - Creates an AnimationLayerMixerPlayable in the PlayableGraph. - - The PlayableGraph that will contain the new AnimationLayerMixerPlayable. - The number of layers. - - A new AnimationLayerMixerPlayable linked to the PlayableGraph. - - - - - Returns true if the layer is additive, false otherwise. - - The layer index. - - True if the layer is additive, false otherwise. - - - - - Returns an invalid AnimationLayerMixerPlayable. - - - - - Specifies whether a layer is additive or not. Additive layers blend with previous layers. - - The layer index. - Whether the layer is additive or not. Set to true for an additive blend, or false for a regular blend. - - - - Sets the mask for the current layer. - - The layer index. - The AvatarMask used to create the new LayerMask. - - - - An implementation of IPlayable that controls an animation mixer. - - - - - Creates an AnimationMixerPlayable in the PlayableGraph. - - The PlayableGraph that will contain the new AnimationMixerPlayable. - The number of inputs that the mixer will update. - True to force a weight normalization of the inputs. - - A new AnimationMixerPlayable linked to the PlayableGraph. - - - - - Returns an invalid AnimationMixerPlayable. - - - - - A PlayableBinding that contains information representing an AnimationPlayableOutput. - - - - - Creates a PlayableBinding that contains information representing an AnimationPlayableOutput. - - The name of the AnimationPlayableOutput. - A reference to a UnityEngine.Object that acts as a key for this binding. - - Returns a PlayableBinding that contains information that is used to create an AnimationPlayableOutput. - - - - - A IPlayableOutput implementation that connects the PlayableGraph to an Animator in the Scene. - - - - - Creates an AnimationPlayableOutput in the PlayableGraph. - - The PlayableGraph that will contain the AnimationPlayableOutput. - The name of the output. - The Animator that will process the PlayableGraph. - - A new AnimationPlayableOutput attached to the PlayableGraph. - - - - - Returns the Animator that plays the animation graph. - - - The targeted Animator. - - - - - Sets the Animator that plays the animation graph. - - The targeted Animator. - - - - Static class providing utility functions for animation scene handles. - - - - - Reads float properties from the PropertySceneHandle array (handles) and stores the floats in the provided buffer. The buffer must have enough allocated space to store all values. - - The animation stream. - The PropertySceneHandle array to read from. - The buffer that stores float values. - - - - Reads integer properties from the PropertySceneHandle array (handles) and stores the integers in the provided buffer. The buffer must have enough allocated space to store all values. - - The animation stream. - The PropertySceneHandle array to read from. - The buffer that stores integer values. - - - - A Playable that can run a custom, multi-threaded animation job. - - - - - Creates an AnimationScriptPlayable in the PlayableGraph. - - The PlayableGraph object that will own the AnimationScriptPlayable. - The IAnimationJob to execute when processing the playable. - The number of inputs on the playable. - - - A new AnimationScriptPlayable linked to the PlayableGraph. - - - - - Gets the job data contained in the playable. - - - Returns the IAnimationJob data contained in the playable. - - - - - Returns whether the playable inputs will be processed or not. - - - true if the inputs will be processed; false otherwise. - - - - - Sets a new job data in the playable. - - The new IAnimationJob data to set in the playable. - - - - Sets the new value for processing the inputs or not. - - The new value for processing the inputs or not. - - - - The stream of animation data passed from one Playable to another. - - - - - Gets or sets the avatar angular velocity for the evaluated frame. - - - - - Gets the delta time for the evaluated frame. (Read Only) - - - - - Gets the number of input streams. (Read Only) - - - - - Returns true if the stream is from a humanoid avatar; false otherwise. (Read Only) - - - - - Returns true if the stream is valid; false otherwise. (Read Only) - - - - - Gets the root motion position for the evaluated frame. (Read Only) - - - - - Gets the root motion rotation for the evaluated frame. (Read Only) - - - - - Gets or sets the avatar velocity for the evaluated frame. - - - - - Gets the same stream, but as an AnimationHumanStream. - - - Returns the same stream, but as an AnimationHumanStream. - - - - - Deep copies motion from a source animation stream to the current animation stream. - - The source animation stream with the motion to deep copy. - - - - Gets the AnimationStream of the playable input at index. - - The input index. - - Returns the AnimationStream of the playable input at index. Returns an invalid stream if the input is not an animation Playable. - - - - - Gets the weight of the Playable connected at a specific input index. - - The input index. - - Returns the weight of the Playable input as a float. - - - - - Static class providing utility functions for animation stream handles. - - - - - Reads float properties from the PropertyStreamHandle array (handles) and stores the floats in the provided buffer. The buffer must have enough allocated space to store all values. - - The animation stream. - The PropertyStreamHandle array to read from. - The buffer that stores float values. - - - - Reads integer properties from the PropertyStreamHandle array (handles) and stores the integers in the provided buffer. The buffer must have enough allocated space to store all values. - - The animation stream. - The PropertyStreamHandle array to read from. - The buffer that stores integer values. - - - - Writes float properties from the buffer to the PropertyStreamHandle array (handles). - - The animation stream. - The PropertyStreamHandle array to write to. - The buffer of float properties. - Set to true to write new values if the matching stream handles have not already been modified. - - - - Write integers from buffer to property stream handles. - - The animation stream. - The PropertyStreamHandle array to write to. - The buffer of integer properties. - Set to true to write new values if the matching stream handles have not already been modified. - - - - An implementation of IPlayable that controls an animation RuntimeAnimatorController. - - - - - Creates an AnimatorControllerPlayable in the PlayableGraph. - - The PlayableGraph object that will own the AnimatorControllerPlayable. - The RuntimeAnimatorController that will be added in the graph. - - A AnimatorControllerPlayable. - - - - - Creates a crossfade from the current state to any other state using normalized times. - - The name of the state. - The hash name of the state. - The duration of the transition (normalized). - The layer where the crossfade occurs. - The time of the state (normalized). - The time of the transition (normalized). - - - - Creates a crossfade from the current state to any other state using normalized times. - - The name of the state. - The hash name of the state. - The duration of the transition (normalized). - The layer where the crossfade occurs. - The time of the state (normalized). - The time of the transition (normalized). - - - - Creates a crossfade from the current state to any other state using times in seconds. - - The name of the state. - The hash name of the state. - The duration of the transition (in seconds). - The layer where the crossfade occurs. - The time of the state (in seconds). - The time of the transition (normalized). - - - - Creates a crossfade from the current state to any other state using times in seconds. - - The name of the state. - The hash name of the state. - The duration of the transition (in seconds). - The layer where the crossfade occurs. - The time of the state (in seconds). - The time of the transition (normalized). - - - - Returns an AnimatorTransitionInfo with the informations on the current transition. - - The layer's index. - - An AnimatorTransitionInfo with the informations on the current transition. - - - - - Returns the value of the given boolean parameter. - - The parameter name. - The parameter ID. - - The value of the parameter. - - - - - Returns the value of the given boolean parameter. - - The parameter name. - The parameter ID. - - The value of the parameter. - - - - - Returns an array of all the AnimatorClipInfo in the current state of the given layer. - - The layer index. - - An array of all the AnimatorClipInfo in the current state. - - - - - Returns the number of AnimatorClipInfo in the current state. - - The layer index. - - The number of AnimatorClipInfo in the current state. - - - - - Returns an AnimatorStateInfo with the information on the current state. - - The layer index. - - An AnimatorStateInfo with the information on the current state. - - - - - Returns the value of the given float parameter. - - The parameter name. - The parameter ID. - - The value of the parameter. - - - - - Returns the value of the given float parameter. - - The parameter name. - The parameter ID. - - The value of the parameter. - - - - - Returns the value of the given integer parameter. - - The parameter name. - The parameter ID. - - The value of the parameter. - - - - - Returns the value of the given integer parameter. - - The parameter name. - The parameter ID. - - The value of the parameter. - - - - - Returns the index of the layer with the given name. - - The layer name. - - The layer index. - - - - - Returns the layer name. - - The layer index. - - The layer name. - - - - - Returns the weight of the layer at the specified index. - - The layer index. - - The layer weight. - - - - - Returns an array of all the AnimatorClipInfo in the next state of the given layer. - - The layer index. - - An array of all the AnimatorClipInfo in the next state. - - - - - Returns the number of AnimatorClipInfo in the next state. - - The layer index. - - The number of AnimatorClipInfo in the next state. - - - - - Returns an AnimatorStateInfo with the information on the next state. - - The layer index. - - An AnimatorStateInfo with the information on the next state. - - - - - See AnimatorController.parameters. - - - - - - Returns true if the state exists in this layer, false otherwise. - - The layer index. - The state ID. - - True if the state exists in this layer, false otherwise. - - - - - Returns true if there is a transition on the given layer, false otherwise. - - The layer index. - - True if there is a transition on the given layer, false otherwise. - - - - - Returns true if the parameter is controlled by a curve, false otherwise. - - The parameter name. - The parameter ID. - - True if the parameter is controlled by a curve, false otherwise. - - - - - Returns true if the parameter is controlled by a curve, false otherwise. - - The parameter name. - The parameter ID. - - True if the parameter is controlled by a curve, false otherwise. - - - - - Returns an invalid AnimatorControllerPlayable. - - - - - Plays a state. - - The state name. - The state hash name. If stateNameHash is 0, it changes the current state time. - The layer index. If layer is -1, it plays the first state with the given state name or hash. - The time offset between zero and one. - - - - Plays a state. - - The state name. - The state hash name. If stateNameHash is 0, it changes the current state time. - The layer index. If layer is -1, it plays the first state with the given state name or hash. - The time offset between zero and one. - - - - Plays a state. - - The state name. - The state hash name. If stateNameHash is 0, it changes the current state time. - The layer index. If layer is -1, it plays the first state with the given state name or hash. - The time offset (in seconds). - - - - Plays a state. - - The state name. - The state hash name. If stateNameHash is 0, it changes the current state time. - The layer index. If layer is -1, it plays the first state with the given state name or hash. - The time offset (in seconds). - - - - Resets the value of the given trigger parameter. - - The parameter name. - The parameter ID. - - - - Resets the value of the given trigger parameter. - - The parameter name. - The parameter ID. - - - - Sets the value of the given boolean parameter. - - The parameter name. - The parameter ID. - The new parameter value. - - - - Sets the value of the given boolean parameter. - - The parameter name. - The parameter ID. - The new parameter value. - - - - Send float values to the AnimatorController to affect transitions. - - The parameter name. - The parameter ID. - The new parameter value. - The damper total time. - The delta time to give to the damper. - - - - Send float values to the AnimatorController to affect transitions. - - The parameter name. - The parameter ID. - The new parameter value. - The damper total time. - The delta time to give to the damper. - - - - Send float values to the AnimatorController to affect transitions. - - The parameter name. - The parameter ID. - The new parameter value. - The damper total time. - The delta time to give to the damper. - - - - Send float values to the AnimatorController to affect transitions. - - The parameter name. - The parameter ID. - The new parameter value. - The damper total time. - The delta time to give to the damper. - - - - Sets the value of the given integer parameter. - - The parameter name. - The parameter ID. - The new parameter value. - - - - Sets the value of the given integer parameter. - - The parameter name. - The parameter ID. - The new parameter value. - - - - Sets the weight of the layer at the given index. - - The layer index. - The new layer weight. - - - - Sets the value of the given trigger parameter. - - The parameter name. - The parameter ID. - - - - Sets the value of the given trigger parameter. - - The parameter name. - The parameter ID. - - - - Static class providing extension methods for Animator and the animation C# jobs. - - - - - Creates a dependency between animator jobs and the job represented by the supplied job handle. To add multiple job dependencies, call this method for each job that need to run before the Animator's jobs. - - The Animator instance that calls this method. - The JobHandle of the job that needs to run before animator jobs. - - - - Create a custom property in the AnimationStream to pass extra data to downstream animation jobs in your graph. Custom properties created in the AnimationStream do not exist in the scene. - - The Animator instance that calls this method. - The name of the property. - The type of property to create (float, integer or boolean). - - - Returns the PropertyStreamHandle that represents the new binding. - - - - - Create a PropertySceneHandle representing the new binding on the Component property of a Transform in the Scene. - - The Animator instance that calls this method. - The Transform to target. - The Component type. - The property to bind. - isObjectReference need to be set to true if the property to bind does access an Object like SpriteRenderer.sprite. - - Returns the PropertySceneHandle that represents the new binding. - - - - - Create a PropertySceneHandle representing the new binding on the Component property of a Transform in the Scene. - - The Animator instance that calls this method. - The Transform to target. - The Component type. - The property to bind. - isObjectReference need to be set to true if the property to bind does access an Object like SpriteRenderer.sprite. - - Returns the PropertySceneHandle that represents the new binding. - - - - - Create a TransformSceneHandle representing the new binding between the Animator and a Transform in the Scene. - - The Animator instance that calls this method. - The Transform to bind. - - Returns the TransformSceneHandle that represents the new binding. - - - - - Create a PropertyStreamHandle representing the new binding on the Component property of a Transform already bound to the Animator. - - The Animator instance that calls this method. - The Transform to target. - The Component type. - The property to bind. - isObjectReference need to be set to true if the property to bind does animate an Object like SpriteRenderer.sprite. - - Returns the PropertyStreamHandle that represents the new binding. - - - - - Create a PropertyStreamHandle representing the new binding on the Component property of a Transform already bound to the Animator. - - The Animator instance that calls this method. - The Transform to target. - The Component type. - The property to bind. - isObjectReference need to be set to true if the property to bind does animate an Object like SpriteRenderer.sprite. - - Returns the PropertyStreamHandle that represents the new binding. - - - - - Create a TransformStreamHandle representing the new binding between the Animator and a Transform already bound to the Animator. - - The Animator instance that calls this method. - The Transform to bind. - - Returns the TransformStreamHandle that represents the new binding. - - - - - Close a stream that has been opened using OpenAnimationStream. - - The Animator instance that calls this method. - The stream to close. - - - - Open a new stream on the Animator. - - The Animator instance that calls this method. - The new stream. - - Returns whether or not the stream has been opened. - - - - - Newly created handles are always resolved lazily on the next access when the jobs are run. To avoid a cpu spike while evaluating the jobs you can manually resolve all handles from the main thread. - - The Animator instance that calls this method. - - - - Newly created handles are always resolved lazily on the next access when the jobs are run. To avoid a cpu spike while evaluating the jobs you can manually resolve all handles from the main thread. - - The Animator instance that calls this method. - - - - Represents the axes used in 3D space. - - - - - Represents the case when no axis is specified. - - - - - Represents the X axis. - - - - - Represents the Y axis. - - - - - Represents the Z axis. - - - - - Represents a source for the constraint. - - - - - The transform component of the source object. - - - - - The weight of the source in the evaluation of the constraint. - - - - - The type of custom stream property to create using BindCustomStreamProperty - - - - - A boolean value. - - - - - A float value. - - - - - An integer value. - - - - - The interface defining an animation job to use with an IAnimationJobPlayable. - - - - - Defines what to do when processing the animation. - - The animation stream to work on. - - - - Defines what to do when processing the root motion. - - The animation stream to work on. - - - - The interface defining an animation playable that uses IAnimationJob. - - - - - Gets the job data contained in the playable. - - - Returns the IAnimationJob data contained in the playable. - - - - - Sets a new job data in the playable. - - The new IAnimationJob data to set in the playable. - - - - Allows a class to modify how an AnimationClip is sampled in the Animation window by providing its own Playable nodes to the Animation window PlayableGraph. The class must also inherit from MonoBehaviour. - - - - - Appends custom Playable nodes to the Animation window PlayableGraph. - - The Animation window PlayableGraph. - Current root of the PlayableGraph. - - Returns the new root of the PlayableGraph. - - - - - Notification callback when the Animation window starts previewing an AnimationClip. - - - - - Notification callback when the Animation window stops previewing an AnimationClip. - - - - - Notification callback when the Animation Window updates its PlayableGraph before sampling an AnimationClip. - - The Animation window PlayableGraph. - - - - The common interface for constraint components. - - - - - Activate or deactivate the constraint. - - - - - Lock or unlock the offset and position at rest. - - - - - Gets the number of sources currently set on the component. - - - - - The weight of the constraint component. - - - - - Add a constraint source. - - The source object and its weight. - - Returns the index of the added source. - - - - - Gets a constraint source by index. - - The index of the source. - - The source object and its weight. - - - - - Gets the list of sources. - - The list of sources to be filled by the component. - - - - Removes a source from the component. - - The index of the source to remove. - - - - Sets a source at a specified index. - - The index of the source to set. - The source object and its weight. - - - - Sets the list of sources on the component. - - The list of sources to set. - - - - - Constrains the orientation of an object relative to the position of one or more source objects, such that the object is facing the average position of the sources. - The LookAtConstraint is a simplified Animations.AimConstraint typically used with a Camera. - - - - - - Activates or deactivates the constraint. - - - - - Locks the offset and rotation at rest. - - - - - The rotation angle along the z axis of the object. The constraint uses this property to calculate the world up vector when Animations.LookAtConstraint.UseUpObject is false. - - - - - The rotation used when the sources have a total weight of 0. - - - - - Represents an offset from the constrained orientation. - - - - - The number of sources set on the component (Read Only). - - - - - Determines how the up vector is calculated. - - - - - The weight of the constraint component. - - - - - The world up object, used to calculate the world up vector when Animations.LookAtConstraint.UseUpObject is true. - - - - - Adds a constraint source. - - The source object and its weight. - - Returns the index of the added source. - - - - - Gets a constraint source by index. - - The index of the source. - - Returns the source object and its weight. - - - - - Gets the list of sources. - - The list of sources to be filled by the component. - - - - Removes a source from the component. - - The index of the source to remove. - - - - Sets a source at a specified index. - - The index of the source to set. - The source object and its weight. - - - - Sets the list of sources on the component. - - The list of sources to set. - - - - Handle for a muscle in the AnimationHumanStream. - - - - - The muscle human sub-part. (Read Only) - - - - - The muscle human part. (Read Only) - - - - - The total number of DoF parts in a humanoid. (Read Only) - - - - - The name of the muscle. (Read Only) - - - - - The different constructors that creates the muscle handle. - - The muscle body sub-part. - The muscle head sub-part. - The muscle human part. - The muscle leg sub-part. - The muscle arm sub-part. - The muscle finger sub-part. - - - - The different constructors that creates the muscle handle. - - The muscle body sub-part. - The muscle head sub-part. - The muscle human part. - The muscle leg sub-part. - The muscle arm sub-part. - The muscle finger sub-part. - - - - The different constructors that creates the muscle handle. - - The muscle body sub-part. - The muscle head sub-part. - The muscle human part. - The muscle leg sub-part. - The muscle arm sub-part. - The muscle finger sub-part. - - - - The different constructors that creates the muscle handle. - - The muscle body sub-part. - The muscle head sub-part. - The muscle human part. - The muscle leg sub-part. - The muscle arm sub-part. - The muscle finger sub-part. - - - - The different constructors that creates the muscle handle. - - The muscle body sub-part. - The muscle head sub-part. - The muscle human part. - The muscle leg sub-part. - The muscle arm sub-part. - The muscle finger sub-part. - - - - The different constructors that creates the muscle handle. - - The muscle body sub-part. - The muscle head sub-part. - The muscle human part. - The muscle leg sub-part. - The muscle arm sub-part. - The muscle finger sub-part. - - - - The different constructors that creates the muscle handle. - - The muscle body sub-part. - The muscle head sub-part. - The muscle human part. - The muscle leg sub-part. - The muscle arm sub-part. - The muscle finger sub-part. - - - - Fills the array with all the possible muscle handles on a humanoid. - - An array of MuscleHandle. - - - - Use this attribute in a script to mark a property as non-animatable. - - - - - Use this attribute in a script to mark a property as non-animatable. - - - - - Constrains the orientation and translation of an object to one or more source objects. The constrained object behaves as if it is in the hierarchy of the sources. - - - - - Activates or deactivates the constraint. - - - - - Locks the offsets and position (translation and rotation) at rest. - - - - - The rotation used when the sources have a total weight of 0. - - - - - The rotation axes affected by the ParentConstraint. - - - - - The rotation offsets from the constrained orientation. - - - - - The number of sources set on the component (read-only). - - - - - The position of the object in local space, used when the sources have a total weight of 0. - - - - - The translation axes affected by the ParentConstraint. - - - - - The translation offsets from the constrained orientation. - - - - - The weight of the constraint component. - - - - - Adds a constraint source. - - The source object and its weight. - - Returns the index of the added source. - - - - - Gets the rotation offset associated with a source by index. - - The index of the constraint source. - - The rotation offset, as Euler angles. - - - - - Gets a constraint source by index. - - The index of the source. - - The source object and its weight. - - - - - Gets the list of sources. - - The list of sources filled by the component. - - - - Gets the rotation offset associated with a source by index. - - The index of the constraint source. - - The translation offset. - - - - - Removes a source from the component. - - The index of the source to remove. - - - - Sets the rotation offset associated with a source by index. - - The index of the constraint source. - The new rotation offset. - - - - Sets a source at a specified index. - - The index of the source to set. - The source object and its weight. - - - - Sets the list of sources on the component. - - The list of sources to set. - - - - Sets the translation offset associated with a source by index. - - The index of the constraint source. - The new translation offset. - - - - Constrains the position of an object relative to the position of one or more source objects. - - - - - Activates or deactivates the constraint. - - - - - Locks the offset and position at rest. - - - - - The number of sources set on the component (read-only). - - - - - The translation used when the sources have a total weight of 0. - - - - - The axes affected by the PositionConstraint. - - - - - The offset from the constrained position. - - - - - The weight of the constraint component. - - - - - Adds a constraint source. - - The source object and its weight. - - Returns the index of the added source. - - - - - Gets a constraint source by index. - - The index of the source. - - The source object and its weight. - - - - - Gets the list of sources. - - The list of sources to be filled by the component. - - - - Removes a source from the component. - - The index of the source to remove. - - - - Sets a source at a specified index. - - The index of the source to set. - The source object and its weight. - - - - Sets the list of sources on the component. - - The list of sources to set. - - - - Handle to read a Component property on an object in the Scene. - - - - - Gets the boolean property value from an object in the Scene. - - The AnimationStream managing this handle. - - The boolean property value. - - - - - Gets the float property value from an object in the Scene. - - The AnimationStream managing this handle. - - The float property value. - - - - - Gets the integer property value from an object in the Scene. - - The AnimationStream managing this handle. - - The integer property value. - - - - - Returns whether or not the handle is resolved. - - The AnimationStream managing this handle. - - Returns true if the handle is resolved, false otherwise. - - - - - Returns whether or not the handle is valid. - - The AnimationStream managing this handle. - - Whether or not the handle is valid. - - - - - Resolves the handle. - - The AnimationStream managing this handle. - - - - Sets the boolean property value to an object in the Scene. - - The AnimationStream managing this handle. - The new boolean property value. - - - - Sets the float property value to an object in the Scene. - - The AnimationStream managing this handle. - The new float property value. - - - - Sets the integer property value to an object in the Scene. - - The AnimationStream managing this handle. - The new integer property value. - - - - Handle for a Component property on an object in the AnimationStream. - - - - - Gets the boolean property value from a stream. - - The AnimationStream that holds the animated values. - - The boolean property value. - - - - - Gets the float property value from a stream. - - The AnimationStream that holds the animated values. - - The float property value. - - - - - Gets the integer property value from a stream. - - The AnimationStream that holds the animated values. - - The integer property value. - - - - - Gets the read mask of the property. - - The AnimationStream that holds the animated values. - - Returns true if the property can be read. - - - - - Returns whether or not the handle is resolved. - - The AnimationStream that holds the animated values. - - Returns true if the handle is resolved, false otherwise. - - - - - Returns whether or not the handle is valid. - - The AnimationStream that holds the animated values. - - Whether or not the handle is valid. - - - - - Resolves the handle. - - The AnimationStream that holds the animated values. - - - - Sets the boolean property value into a stream. - - The AnimationStream that holds the animated values. - The new boolean property value. - - - - Sets the float property value into a stream. - - The AnimationStream that holds the animated values. - The new float property value. - - - - Sets the integer property value into a stream. - - The AnimationStream that holds the animated values. - The new integer property value. - - - - Constrains the rotation of an object relative to the rotation of one or more source objects. - - - - - Activates or deactivates the constraint. - - - - - Locks the offset and rotation at rest. - - - - - The rotation used when the sources have a total weight of 0. - - - - - The axes affected by the RotationConstraint. - - - - - The offset from the constrained rotation. - - - - - The number of sources set on the component (read-only). - - - - - The weight of the constraint component. - - - - - Adds a constraint source. - - The source object and its weight. - - Returns the index of the added source. - - - - - Gets a constraint source by index. - - The index of the source. - - The source object and its weight. - - - - - Gets the list of sources. - - The list of sources to be filled by the component. - - - - Removes a source from the component. - - The index of the source to remove. - - - - Sets a source at a specified index. - - The index of the source to set. - The source object and its weight. - - - - Sets the list of sources on the component. - - The list of sources to set. - - - - Constrains the scale of an object relative to the scale of one or more source objects. - - - - - Activates or deactivates the constraint. - - - - - Locks the offset and scale at rest. - - - - - The scale used when the sources have a total weight of 0. - - - - - The offset from the constrained scale. - - - - - The axes affected by the ScaleConstraint. - - - - - The number of sources set on the component (read-only). - - - - - The weight of the constraint component. - - - - - Adds a constraint source. - - The source object and its weight. - - Returns the index of the added source. - - - - - Gets a constraint source by index. - - The index of the source. - - The source object and its weight. - - - - - Gets the list of sources. - - The list of sources to be filled by the component. - - - - Removes a source from the component. - - The index of the source to remove. - - - - Sets a source at a specified index. - - The index of the source to set. - The source object and its weight. - - - - Sets the list of sources on the component. - - The list of sources to set. - - - - Handle to read position, rotation and scale of an object in the Scene. - - - - - Gets the position and scaled rotation of the transform in world space. - - The AnimationStream that manages this handle. - The position of the transform in world space. - The rotation of the transform in world space. - - - - Gets the position of the transform relative to the parent. - - The AnimationStream that manages this handle. - - The position of the transform relative to the parent. - - - - - Gets the rotation of the transform relative to the parent. - - The AnimationStream that manages this handle. - - The rotation of the transform relative to the parent. - - - - - Gets the scale of the transform relative to the parent. - - The AnimationStream that manages this handle. - - The scale of the transform relative to the parent. - - - - - Gets the position, rotation and scale of the transform relative to the parent. - - The AnimationStream that manages this handle. - The position of the transform relative to the parent. - The rotation of the transform relative to the parent. - The scale of the transform relative to the parent. - - - - Gets the position of the transform in world space. - - The AnimationStream that manages this handle. - - The position of the transform in world space. - - - - - Gets the rotation of the transform in world space. - - The AnimationStream that manages this handle. - - The rotation of the transform in world space. - - - - - Returns whether this is a valid handle. - - The AnimationStream that manages this handle. - - Whether this is a valid handle. - - - - - Sets the position of the transform relative to the parent. - - The AnimationStream that manages this handle. - The position of the transform relative to the parent. - - - - Sets the rotation of the transform relative to the parent. - - The AnimationStream that manages this handle. - The rotation of the transform relative to the parent. - - - - Sets the scale of the transform relative to the parent. - - The AnimationStream that manages this handle. - The scale of the transform relative to the parent. - - - - Sets the position of the transform in world space. - - The AnimationStream that manages this handle. - The position of the transform in world space. - - - - Sets the rotation of the transform in world space. - - The AnimationStream that manages this handle. - The rotation of the transform in world space. - - - - Position, rotation and scale of an object in the AnimationStream. - - - - - Gets the position and scaled rotation of the transform in world space. - - The AnimationStream that holds the animated values. - The position of the transform in world space. - The rotation of the transform in world space. - - - - Gets the position of the transform relative to the parent. - - The AnimationStream that holds the animated values. - - The position of the transform relative to the parent. - - - - - Gets the rotation of the transform relative to the parent. - - The AnimationStream that holds the animated values. - - The rotation of the transform relative to the parent. - - - - - Gets the scale of the transform relative to the parent. - - The AnimationStream that holds the animated values. - - The scale of the transform relative to the parent. - - - - - Gets the position, rotation and scale of the transform relative to the parent. - - The AnimationStream that holds the animated values. - The position of the transform relative to the parent. - The rotation of the transform relative to the parent. - The scale of the transform relative to the parent. - - - - Gets the position of the transform in world space. - - The AnimationStream that holds the animated values. - - The position of the transform in world space. - - - - - Gets the position read mask of the transform. - - The AnimationStream that holds the animated values. - - Returns true if the position can be read. - - - - - Gets the rotation of the transform in world space. - - The AnimationStream that holds the animated values. - - The rotation of the transform in world space. - - - - - Gets the rotation read mask of the transform. - - The AnimationStream that holds the animated values. - - Returns true if the rotation can be read. - - - - - Gets the scale read mask of the transform. - - The AnimationStream that holds the animated values. - - Returns true if the scale can be read. - - - - - Returns whether this handle is resolved. - - The AnimationStream that holds the animated values. - - Returns true if the handle is resolved, false otherwise. - - - - - Returns whether this is a valid handle. - - The AnimationStream that holds the animated values. - - Whether this is a valid handle. - - - - - Bind this handle with an animated values from the AnimationStream. - - The AnimationStream that holds the animated values. - - - - Sets the position and rotation of the transform in world space. - - The AnimationStream that holds the animated values. - The position of the transform in world space. - The rotation of the transform in world space. - Set to true to write the specified parameters if the matching stream parameters have not already been modified. - - - - Sets the position of the transform relative to the parent. - - The AnimationStream that holds the animated values. - The position of the transform relative to the parent. - - - - Sets the rotation of the transform relative to the parent. - - The AnimationStream that holds the animated values. - The rotation of the transform relative to the parent. - - - - Sets the scale of the transform relative to the parent. - - The scale of the transform relative to the parent. - The AnimationStream that holds the animated values. - - - - Sets the position, rotation and scale of the transform relative to the parent. - - The AnimationStream that holds the animated values. - The position of the transform relative to the parent. - The rotation of the transform relative to the parent. - The scale of the transform relative to the parent. - Set to true to write the specified parameters if the matching stream parameters have not already been modified. - - - - Sets the position of the transform in world space. - - The position of the transform in world space. - The AnimationStream that holds the animated values. - - - - Sets the rotation of the transform in world space. - - The AnimationStream that holds the animated values. - The rotation of the transform in world space. - - - - The AnimationState gives full control over animation blending. - - - - - Which blend mode should be used? - - - - - The clip that is being played by this animation state. - - - - - Enables / disables the animation. - - - - - The length of the animation clip in seconds. - - - - - The name of the animation. - - - - - The normalized playback speed. - - - - - The normalized time of the animation. - - - - - The playback speed of the animation. 1 is normal playback speed. - - - - - The current time of the animation. - - - - - The weight of animation. - - - - - Wrapping mode of the animation. - - - - - Adds a transform which should be animated. This allows you to reduce the number of animations you have to create. - - The transform to animate. - Whether to also animate all children of the specified transform. - - - - Adds a transform which should be animated. This allows you to reduce the number of animations you have to create. - - The transform to animate. - Whether to also animate all children of the specified transform. - - - - Removes a transform which should be animated. - - - - - - Interface to control the Mecanim animation system. - - - - - Gets the avatar angular velocity for the last evaluated frame. - - - - - When turned on, animations will be executed in the physics loop. This is only useful in conjunction with kinematic rigidbodies. - - - - - Should root motion be applied? - - - - - Gets/Sets the current Avatar. - - - - - The position of the body center of mass. - - - - - The rotation of the body center of mass. - - - - - Controls culling of this Animator component. - - - - - Gets the avatar delta position for the last evaluated frame. - - - - - Gets the avatar delta rotation for the last evaluated frame. - - - - - Blends pivot point between body center of mass and feet pivot. - - - - - Sets whether the Animator sends events of type AnimationEvent. - - - - - The current gravity weight based on current animations that are played. - - - - - Returns true if Animator has any playables assigned to it. - - - - - Returns true if the current rig has root motion. - - - - - Returns true if the object has a transform hierarchy. - - - - - Returns the scale of the current Avatar for a humanoid rig, (1 by default if the rig is generic). - - - - - Returns true if the current rig is humanoid, false if it is generic. - - - - - Returns whether the animator is initialized successfully. - - - - - If automatic matching is active. - - - - - Returns true if the current rig is optimizable with AnimatorUtility.OptimizeTransformHierarchy. - - - - - Controls the behaviour of the Animator component when a GameObject is disabled. - - - - - Returns the number of layers in the controller. - - - - - Additional layers affects the center of mass. - - - - - Get left foot bottom height. - - - - - When linearVelocityBlending is set to true, the root motion velocity and angular velocity will be blended linearly. - - - - - Returns the number of parameters in the controller. - - - - - The AnimatorControllerParameter list used by the animator. (Read Only) - - - - - Get the current position of the pivot. - - - - - Gets the pivot weight. - - - - - The PlayableGraph created by the Animator. - - - - - Sets the playback position in the recording buffer. - - - - - Gets the mode of the Animator recorder. - - - - - Start time of the first frame of the buffer relative to the frame at which StartRecording was called. - - - - - End time of the recorded clip relative to when StartRecording was called. - - - - - Get right foot bottom height. - - - - - The root position, the position of the game object. - - - - - The root rotation, the rotation of the game object. - - - - - The runtime representation of AnimatorController that controls the Animator. - - - - - The playback speed of the Animator. 1 is normal playback speed. - - - - - Automatic stabilization of feet during transition and blending. - - - - - Returns the position of the target specified by SetTarget. - - - - - Returns the rotation of the target specified by SetTarget. - - - - - Specifies the update mode of the Animator. - - - - - Gets the avatar velocity for the last evaluated frame. - - - - - Apply the default Root Motion. - - - - - Creates a crossfade from the current state to any other state using normalized times. - - The name of the state. - The hash name of the state. - The duration of the transition (normalized). - The layer where the crossfade occurs. - The time of the state (normalized). - The time of the transition (normalized). - - - - Creates a crossfade from the current state to any other state using normalized times. - - The name of the state. - The hash name of the state. - The duration of the transition (normalized). - The layer where the crossfade occurs. - The time of the state (normalized). - The time of the transition (normalized). - - - - Creates a crossfade from the current state to any other state using times in seconds. - - The name of the state. - The hash name of the state. - The duration of the transition (in seconds). - The layer where the crossfade occurs. - The time of the state (in seconds). - The time of the transition (normalized). - - - - Creates a crossfade from the current state to any other state using times in seconds. - - The name of the state. - The hash name of the state. - The duration of the transition (in seconds). - The layer where the crossfade occurs. - The time of the state (in seconds). - The time of the transition (normalized). - - - - Returns an AnimatorTransitionInfo with the informations on the current transition. - - The layer's index. - - An AnimatorTransitionInfo with the informations on the current transition. - - - - - Returns the first StateMachineBehaviour that matches type T or is derived from T. Returns null if none are found. - - - - - Returns all StateMachineBehaviour that match type T or are derived from T. Returns null if none are found. - - - - - Returns Transform mapped to this human bone id. - - The human bone that is queried, see enum HumanBodyBones for a list of possible values. - - - - Returns the value of the given boolean parameter. - - The parameter name. - The parameter ID. - - The value of the parameter. - - - - - Returns the value of the given boolean parameter. - - The parameter name. - The parameter ID. - - The value of the parameter. - - - - - Gets the list of AnimatorClipInfo currently played by the current state. - - The layer's index. - - - - Returns an array of all the AnimatorClipInfo in the current state of the given layer. - - The layer index. - - An array of all the AnimatorClipInfo in the current state. - - - - - Fills clips with the list of all the AnimatorClipInfo in the current state of the given layer. - - The layer index. - The list of AnimatorClipInfo to fill. - - - - Returns the number of AnimatorClipInfo in the current state. - - The layer index. - - The number of AnimatorClipInfo in the current state. - - - - - Returns an AnimatorStateInfo with the information on the current state. - - The layer index. - - An AnimatorStateInfo with the information on the current state. - - - - - Returns the value of the given float parameter. - - The parameter name. - The parameter ID. - - The value of the parameter. - - - - - Returns the value of the given float parameter. - - The parameter name. - The parameter ID. - - The value of the parameter. - - - - - Gets the position of an IK hint. - - The AvatarIKHint that is queried. - - Return the current position of this IK hint in world space. - - - - - Gets the translative weight of an IK Hint (0 = at the original animation before IK, 1 = at the hint). - - The AvatarIKHint that is queried. - - Return translative weight. - - - - - Gets the position of an IK goal. - - The AvatarIKGoal that is queried. - - Return the current position of this IK goal in world space. - - - - - Gets the translative weight of an IK goal (0 = at the original animation before IK, 1 = at the goal). - - The AvatarIKGoal that is queried. - - - - Gets the rotation of an IK goal. - - The AvatarIKGoal that is is queried. - - - - Gets the rotational weight of an IK goal (0 = rotation before IK, 1 = rotation at the IK goal). - - The AvatarIKGoal that is queried. - - - - Returns the value of the given integer parameter. - - The parameter name. - The parameter ID. - - The value of the parameter. - - - - - Returns the value of the given integer parameter. - - The parameter name. - The parameter ID. - - The value of the parameter. - - - - - Returns the index of the layer with the given name. - - The layer name. - - The layer index. - - - - - Returns the layer name. - - The layer index. - - The layer name. - - - - - Returns the weight of the layer at the specified index. - - The layer index. - - The layer weight. - - - - - Gets the list of AnimatorClipInfo currently played by the next state. - - The layer's index. - - - - Returns an array of all the AnimatorClipInfo in the next state of the given layer. - - The layer index. - - An array of all the AnimatorClipInfo in the next state. - - - - - Fills clips with the list of all the AnimatorClipInfo in the next state of the given layer. - - The layer index. - The list of AnimatorClipInfo to fill. - - - - Returns the number of AnimatorClipInfo in the next state. - - The layer index. - - The number of AnimatorClipInfo in the next state. - - - - - Returns an AnimatorStateInfo with the information on the next state. - - The layer index. - - An AnimatorStateInfo with the information on the next state. - - - - - See AnimatorController.parameters. - - - - - - Gets the value of a quaternion parameter. - - The name of the parameter. - - - - Gets the value of a quaternion parameter. - - The id of the parameter. The id is generated using Animator::StringToHash. - - - - Gets the value of a vector parameter. - - The name of the parameter. - - - - Gets the value of a vector parameter. - - The id of the parameter. The id is generated using Animator::StringToHash. - - - - Returns true if the state exists in this layer, false otherwise. - - The layer index. - The state ID. - - True if the state exists in this layer, false otherwise. - - - - - Interrupts the automatic target matching. - - - - - - Interrupts the automatic target matching. - - - - - - Returns true if the transform is controlled by the Animator\. - - The transform that is queried. - - - - Returns true if there is a transition on the given layer, false otherwise. - - The layer index. - - True if there is a transition on the given layer, false otherwise. - - - - - Returns true if the parameter is controlled by a curve, false otherwise. - - The parameter name. - The parameter ID. - - True if the parameter is controlled by a curve, false otherwise. - - - - - Returns true if the parameter is controlled by a curve, false otherwise. - - The parameter name. - The parameter ID. - - True if the parameter is controlled by a curve, false otherwise. - - - - - Automatically adjust the GameObject position and rotation. - - The position we want the body part to reach. - The rotation in which we want the body part to be. - The body part that is involved in the match. - Structure that contains weights for matching position and rotation. - Start time within the animation clip (0 - beginning of clip, 1 - end of clip). - End time within the animation clip (0 - beginning of clip, 1 - end of clip), values greater than 1 can be set to trigger a match after a certain number of loops. Ex: 2.3 means at 30% of 2nd loop. - Allows you to specify what should happen if the MatchTarget function is interrupted. A value of true causes the GameObject to immediately move to the matchPosition if interrupted. A value of false causes the GameObject to stay at its current position if interrupted. - - - - Plays a state. - - The state name. - The state hash name. If stateNameHash is 0, it changes the current state time. - The layer index. If layer is -1, it plays the first state with the given state name or hash. - The time offset between zero and one. - - - - Plays a state. - - The state name. - The state hash name. If stateNameHash is 0, it changes the current state time. - The layer index. If layer is -1, it plays the first state with the given state name or hash. - The time offset between zero and one. - - - - Plays a state. - - The state name. - The state hash name. If stateNameHash is 0, it changes the current state time. - The layer index. If layer is -1, it plays the first state with the given state name or hash. - The time offset (in seconds). - - - - Plays a state. - - The state name. - The state hash name. If stateNameHash is 0, it changes the current state time. - The layer index. If layer is -1, it plays the first state with the given state name or hash. - The time offset (in seconds). - - - - Rebind all the animated properties and mesh data with the Animator. - - - - - Resets the value of the given trigger parameter. - - The parameter name. - The parameter ID. - - - - Resets the value of the given trigger parameter. - - The parameter name. - The parameter ID. - - - - Sets local rotation of a human bone during a IK pass. - - The human bone Id. - The local rotation. - - - - Sets the value of the given boolean parameter. - - The parameter name. - The parameter ID. - The new parameter value. - - - - Sets the value of the given boolean parameter. - - The parameter name. - The parameter ID. - The new parameter value. - - - - Send float values to the Animator to affect transitions. - - The parameter name. - The parameter ID. - The new parameter value. - The damper total time. - The delta time to give to the damper. - - - - Send float values to the Animator to affect transitions. - - The parameter name. - The parameter ID. - The new parameter value. - The damper total time. - The delta time to give to the damper. - - - - Send float values to the Animator to affect transitions. - - The parameter name. - The parameter ID. - The new parameter value. - The damper total time. - The delta time to give to the damper. - - - - Send float values to the Animator to affect transitions. - - The parameter name. - The parameter ID. - The new parameter value. - The damper total time. - The delta time to give to the damper. - - - - Sets the position of an IK hint. - - The AvatarIKHint that is set. - The position in world space. - - - - Sets the translative weight of an IK hint (0 = at the original animation before IK, 1 = at the hint). - - The AvatarIKHint that is set. - The translative weight. - - - - Sets the position of an IK goal. - - The AvatarIKGoal that is set. - The position in world space. - - - - Sets the translative weight of an IK goal (0 = at the original animation before IK, 1 = at the goal). - - The AvatarIKGoal that is set. - The translative weight. - - - - Sets the rotation of an IK goal. - - The AvatarIKGoal that is set. - The rotation in world space. - - - - Sets the rotational weight of an IK goal (0 = rotation before IK, 1 = rotation at the IK goal). - - The AvatarIKGoal that is set. - The rotational weight. - - - - Sets the value of the given integer parameter. - - The parameter name. - The parameter ID. - The new parameter value. - - - - Sets the value of the given integer parameter. - - The parameter name. - The parameter ID. - The new parameter value. - - - - Sets the weight of the layer at the given index. - - The layer index. - The new layer weight. - - - - Sets the look at position. - - The position to lookAt. - - - - Set look at weights. - - (0-1) the global weight of the LookAt, multiplier for other parameters. - (0-1) determines how much the body is involved in the LookAt. - (0-1) determines how much the head is involved in the LookAt. - (0-1) determines how much the eyes are involved in the LookAt. - (0-1) 0.0 means the character is completely unrestrained in motion, 1.0 means he's completely clamped (look at becomes impossible), and 0.5 means he'll be able to move on half of the possible range (180 degrees). - - - - Set look at weights. - - (0-1) the global weight of the LookAt, multiplier for other parameters. - (0-1) determines how much the body is involved in the LookAt. - (0-1) determines how much the head is involved in the LookAt. - (0-1) determines how much the eyes are involved in the LookAt. - (0-1) 0.0 means the character is completely unrestrained in motion, 1.0 means he's completely clamped (look at becomes impossible), and 0.5 means he'll be able to move on half of the possible range (180 degrees). - - - - Set look at weights. - - (0-1) the global weight of the LookAt, multiplier for other parameters. - (0-1) determines how much the body is involved in the LookAt. - (0-1) determines how much the head is involved in the LookAt. - (0-1) determines how much the eyes are involved in the LookAt. - (0-1) 0.0 means the character is completely unrestrained in motion, 1.0 means he's completely clamped (look at becomes impossible), and 0.5 means he'll be able to move on half of the possible range (180 degrees). - - - - Set look at weights. - - (0-1) the global weight of the LookAt, multiplier for other parameters. - (0-1) determines how much the body is involved in the LookAt. - (0-1) determines how much the head is involved in the LookAt. - (0-1) determines how much the eyes are involved in the LookAt. - (0-1) 0.0 means the character is completely unrestrained in motion, 1.0 means he's completely clamped (look at becomes impossible), and 0.5 means he'll be able to move on half of the possible range (180 degrees). - - - - Set look at weights. - - (0-1) the global weight of the LookAt, multiplier for other parameters. - (0-1) determines how much the body is involved in the LookAt. - (0-1) determines how much the head is involved in the LookAt. - (0-1) determines how much the eyes are involved in the LookAt. - (0-1) 0.0 means the character is completely unrestrained in motion, 1.0 means he's completely clamped (look at becomes impossible), and 0.5 means he'll be able to move on half of the possible range (180 degrees). - - - - Sets the value of a quaternion parameter. - - The name of the parameter. - The new value for the parameter. - - - - Sets the value of a quaternion parameter. - - Of the parameter. The id is generated using Animator::StringToHash. - The new value for the parameter. - - - - Sets an AvatarTarget and a targetNormalizedTime for the current state. - - The avatar body part that is queried. - The current state Time that is queried. - - - - Sets the value of the given trigger parameter. - - The parameter name. - The parameter ID. - - - - Sets the value of the given trigger parameter. - - The parameter name. - The parameter ID. - - - - Sets the value of a vector parameter. - - The name of the parameter. - The new value for the parameter. - - - - Sets the value of a vector parameter. - - The id of the parameter. The id is generated using Animator::StringToHash. - The new value for the parameter. - - - - Sets the animator in playback mode. - - - - - Sets the animator in recording mode, and allocates a circular buffer of size frameCount. - - The number of frames (updates) that will be recorded. If frameCount is 0, the recording will continue until the user calls StopRecording. The maximum value for frameCount is 10000. - - - - Stops the animator playback mode. When playback stops, the avatar resumes getting control from game logic. - - - - - Stops animator record mode. - - - - - Generates an parameter id from a string. - - The string to convert to Id. - - - - Evaluates the animator based on deltaTime. - - The time delta. - - - - Forces a write of the default values stored in the animator. - - - - - Information about clip being played and blended by the Animator. - - - - - Returns the animation clip played by the Animator. - - - - - Returns the blending weight used by the Animator to blend this clip. - - - - - Used to communicate between scripting and the controller. Some parameters can be set in scripting and used by the controller, while other parameters are based on Custom Curves in Animation Clips and can be sampled using the scripting API. - - - - - The default bool value for the parameter. - - - - - The default float value for the parameter. - - - - - The default int value for the parameter. - - - - - The name of the parameter. - - - - - Returns the hash of the parameter based on its name. - - - - - The type of the parameter. - - - - - The type of the parameter. - - - - - Boolean type parameter. - - - - - Float type parameter. - - - - - Int type parameter. - - - - - Trigger type parameter. - - - - - Culling mode for the Animator. - - - - - Always animate the entire character. Object is animated even when offscreen. - - - - - Animation is completely disabled when renderers are not visible. - - - - - Retarget, IK and write of Transforms are disabled when renderers are not visible. - - - - - Interface to control Animator Override Controller. - - - - - Returns the list of orignal Animation Clip from the controller and their override Animation Clip. - - - - - Returns the count of overrides. - - - - - The Runtime Animator Controller that the Animator Override Controller overrides. - - - - - Applies the list of overrides on this Animator Override Controller. - - Overrides list to apply. - - - - Creates an empty Animator Override Controller. - - - - - Creates an Animator Override Controller that overrides controller. - - Runtime Animator Controller to override. - - - - Gets the list of Animation Clip overrides currently defined in this Animator Override Controller. - - Array to receive results. - - - - Returns either the overriding Animation Clip if set or the original Animation Clip named name. - - - - - Returns either the overriding Animation Clip if set or the original Animation Clip named name. - - - - - The mode of the Animator's recorder. - - - - - The Animator recorder is offline. - - - - - The Animator recorder is in Playback. - - - - - The Animator recorder is in Record. - - - - - Information about the current or next state. - - - - - The full path hash for this state. - - - - - Current duration of the state. - - - - - Is the state looping. - - - - - The hashed name of the State. - - - - - Normalized time of the State. - - - - - The hash is generated using Animator.StringToHash. The hash does not include the name of the parent layer. - - - - - The playback speed of the animation. 1 is the normal playback speed. - - - - - The speed multiplier for this state. - - - - - The Tag of the State. - - - - - Does name match the name of the active state in the statemachine? - - - - - - Does tag match the tag of the active state in the statemachine. - - - - - - Information about the current transition. - - - - - Returns true if the transition is from an AnyState node, or from Animator.CrossFade. - - - - - Duration of the transition. - - - - - The unit of the transition duration. - - - - - The hash name of the Transition. - - - - - The simplified name of the Transition. - - - - - Normalized time of the Transition. - - - - - The user-specified name of the Transition. - - - - - Does name match the name of the active Transition. - - - - - - Does userName match the name of the active Transition. - - - - - - The update mode of the Animator. - - - - - Updates the animator during the physic loop in order to have the animation system synchronized with the physics engine. - - - - - Normal update of the animator. - - - - - Animator updates independently of Time.timeScale. - - - - - Various utilities for animator manipulation. - - - - - This function will recreate all transform hierarchy under GameObject. - - GameObject to Deoptimize. - - - - This function will remove all transform hierarchy under GameObject, the animator will write directly transform matrices into the skin mesh matrices saving alot of CPU cycles. - - GameObject to Optimize. - List of transform name to expose. - - - - Anisotropic filtering mode. - - - - - Disable anisotropic filtering for all textures. - - - - - Enable anisotropic filtering, as set for each texture. - - - - - Enable anisotropic filtering for all textures. - - - - - Interface to control XCode Frame Capture. - - - - - Begin Capture to the specified file. - - - - - - Begin Capture in XCode frame debugger. - - - - - Begin capture to the specified file at the beginning of the next frame, and end it at the end of the next frame. - - - - - - Begin capture to Xcode at the beginning of the next frame, and end it at the end of the next frame. - - - - - End Capture. - - - - - Is Capture destination supported. - - - - - - Destination of Frame Capture -This is a wrapper for MTLCaptureDestination. - - - - - Capture in XCode itself. - - - - - Capture to a GPU Trace document. - - - - - ReplayKit is only available on certain iPhone, iPad and iPod Touch devices running iOS 9.0 or later. - - - - - A Boolean that indicates whether ReplayKit broadcasting API is available (true means available) (Read Only). -Check the value of this property before making ReplayKit broadcasting API calls. On iOS versions prior to iOS 10, this property will have a value of false. - - - - - A string property that contains an URL used to redirect the user to an on-going or completed broadcast (Read Only). - - - - - Camera enabled status. True, if camera enabled; false otherwise. - - - - - Boolean property that indicates whether a broadcast is currently in progress (Read Only). - - - - - Boolean property that indicates whether a broadcast is currently paused (Read Only). - - - - - A boolean that indicates whether ReplayKit is currently displaying a preview controller. (Read Only) - - - - - A boolean that indicates whether ReplayKit is making a recording (where True means a recording is in progress). (Read Only) - - - - - A string value of the last error incurred by the ReplayKit: Either 'Failed to get Screen Recorder' or 'No recording available'. (Read Only) - - - - - Microphone enabled status. True, if microphone enabled; false otherwise. - - - - - A boolean value that indicates that a new recording is available for preview (where True means available). (Read Only) - - - - - A boolean that indicates whether the ReplayKit API is available (where True means available). (Read Only) - - - - - Function called at the completion of broadcast startup. - - This parameter will be true if the broadcast started successfully and false in the event of an error. - In the event of failure to start a broadcast, this parameter contains the associated error message. - - - - Discard the current recording. - - - A boolean value of True if the recording was discarded successfully or False if an error occurred. - - - - - Hide the camera preview view. - - - - - Pauses current broadcast. -Will pause currently on-going broadcast. If no broadcast is in progress, does nothing. - - - - - Preview the current recording - - - A boolean value of True if the video preview window opened successfully or False if an error occurred. - - - - - Resumes current broadcast. -Will resume currently on-going broadcast. If no broadcast is in progress, does nothing. - - - - - Shows camera preview at coordinates posX and posY. The preview is width by height in size. - - - - - - - - - Initiates and starts a new broadcast -When StartBroadcast is called, user is presented with a broadcast provider selection screen, and then a broadcast setup screen. Once it is finished, a broadcast will be started, and the callback will be invoked. -It will also be invoked in case of any error. - - - A callback for getting the status of broadcast initiation. - Enable or disable the microphone while broadcasting. Enabling the microphone allows you to include user commentary while broadcasting. The default value is false. - Enable or disable the camera while broadcasting. Enabling camera allows you to include user camera footage while broadcasting. The default value is false. To actually include camera footage in your broadcast, you also have to call ShowCameraPreviewAt as well to position the preview view. - - - - Start a new recording. - - Enable or disable the microphone while making a recording. Enabling the microphone allows you to include user commentary while recording. The default value is false. - Enable or disable the camera while making a recording. Enabling camera allows you to include user camera footage while recording. The default value is false. To actually include camera footage in your recording, you also have to call ShowCameraPreviewAt as well to position the preview view. - - A boolean value of True if recording started successfully or False if an error occurred. - - - - - Stops current broadcast. -Will terminate currently on-going broadcast. If no broadcast is in progress, does nothing. - - - - - Stop the current recording. - - - A boolean value of True if recording stopped successfully or False if an error occurred. - - - - - Access to application run-time data. - - - - - The URL of the document. For WebGL, this a web URL. For Android, iOS, or Universal Windows Platform (UWP) this is a deep link URL. (Read Only) - - - - - Priority of background loading thread. - - - - - Returns a GUID for this build (Read Only). - - - - - A unique cloud project identifier. It is unique for every project (Read Only). - - - - - Return application company name (Read Only). - - - - - Returns the path to the console log file, or an empty string if the current platform does not support log files. - - - - - Contains the path to the game data folder on the target device (Read Only). - - - - - This event is raised when an application running on Android, iOS, or the Universal Windows Platform (UWP) is activated using a deep link URL. - - The deep link URL that activated the application. - - - - Defines the delegate to use to register for events in which the focus gained or lost. - - - - - - Returns false if application is altered in any way after it was built. - - - - - Returns true if application integrity can be confirmed. - - - - - Returns application identifier at runtime. On Apple platforms this is the 'bundleIdentifier' saved in the info.plist file, on Android it's the 'package' from the AndroidManifest.xml. - - - - - Returns the name of the store or package that installed the application (Read Only). - - - - - Returns application install mode (Read Only). - - - - - Returns the type of Internet reachability currently possible on the device. - - - - - Returns true when Unity is launched with the -batchmode flag from the command line (Read Only). - - - - - Is the current Runtime platform a known console platform. - - - - - Are we running inside the Unity editor? (Read Only) - - - - - Whether the player currently has focus. Read-only. - - - - - Is some level being loaded? (Read Only) (Obsolete). - - - - - Is the current Runtime platform a known mobile platform. - - - - - Returns true when called in any kind of built Player, or when called in the Editor in Play Mode (Read Only). - - - - - Checks whether splash screen is being shown. - - - - - The total number of levels available (Read Only). - - - - - Note: This is now obsolete. Use SceneManager.GetActiveScene instead. (Read Only). - - - - - The name of the level that was last loaded (Read Only). - - - - - Event that is fired if a log message is received. - - - - - - Event that is fired if a log message is received. - - - - - - This event occurs when your app receives a low-memory notification from the device it is running on. This only occurs when your app is running in the foreground. You can release non-critical assets from memory (such as, textures or audio clips) in response to this in order to avoid the app being terminated. You can also load smaller versions of such assets. Furthermore, you should serialize any transient data to permanent storage to avoid data loss if the app is terminated. - -This event is supported on iOS, Android, and Universal Windows Platform (UWP). - -This event corresponds to the following callbacks on the different platforms: - -- iOS: [UIApplicationDelegate applicationDidReceiveMemoryWarning] - -- Android: onLowMemory() and onTrimMemory(level == TRIM_MEMORY_RUNNING_CRITICAL) - -- UWP: MemoryManager.AppMemoryUsageIncreased (AppMemoryUsageLevel == OverLimit) - -Note: For UWP, this event will not occur on Desktop and only works on memory constrained devices, such as HoloLens and Xbox One. The OverLimit threshold specified by the OS in this case is so high it is not reasonably possible to reach it and trigger the event. - -Here is an example of handling the callback: - - - - - - Delegate method used to register for "Just Before Render" input updates for VR devices. - - - - - - (Read Only) Contains the path to a persistent data directory. - - - - - Returns the platform the game is running on (Read Only). - - - - - Returns application product name (Read Only). - - - - - Unity raises this event when the player application is qutting. - - - - - - Should the player be running when the application is in the background? - - - - - Returns application running in sandbox (Read Only). - - - - - Obsolete. Use Application.SetStackTraceLogType. - - - - - How many bytes have we downloaded from the main unity web stream (Read Only). - - - - - The path to the StreamingAssets folder (Read Only). - - - - - The language the user's operating system is running in. - - - - - Instructs the game to try to render at a specified frame rate. - - - - - Contains the path to a temporary data / cache directory (Read Only). - - - - - The version of the Unity runtime used to play the content. - - - - - Unity raises this event when Player is unloading. - - - - - - Returns application version number (Read Only). - - - - - Unity raises this event when the player application wants to quit. - - - - - - Indicates whether Unity's webplayer security model is enabled. - - - - - Delegate method for fetching advertising ID. - - Advertising ID. - Indicates whether user has chosen to limit ad tracking. - Error message. - - - - Cancels quitting the application. This is useful for showing a splash screen at the end of a game. - - - - - Can the streamed level be loaded? - - - - - - Can the streamed level be loaded? - - - - - - Captures a screenshot at path filename as a PNG file. - - Pathname to save the screenshot file to. - Factor by which to increase resolution. - - - - Captures a screenshot at path filename as a PNG file. - - Pathname to save the screenshot file to. - Factor by which to increase resolution. - - - - Calls a function in the web page that contains the WebGL Player. - - Name of the function to call. - Array of arguments passed in the call. - - - - Execution of a script function in the contained web page. - - The Javascript function to call. - - - - Returns an array of feature tags in use for this build. - - - - - Get stack trace logging options. The default value is StackTraceLogType.ScriptOnly. - - - - - - How far has the download progressed? [0...1]. - - - - - - How far has the download progressed? [0...1]. - - - - - - Is Unity activated with the Pro license? - - - - - Check if the user has authorized use of the webcam or microphone in the Web Player. - - - - - - Returns true if the given object is part of the playing world either in any kind of built Player or in Play Mode. - - The object to test. - - True if the object is part of the playing world. - - - - - Note: This is now obsolete. Use SceneManager.LoadScene instead. - - The level to load. - The name of the level to load. - - - - Note: This is now obsolete. Use SceneManager.LoadScene instead. - - The level to load. - The name of the level to load. - - - - Loads a level additively. - - - - - - - Loads a level additively. - - - - - - - Loads the level additively and asynchronously in the background. - - - - - - - Loads the level additively and asynchronously in the background. - - - - - - - Loads the level asynchronously in the background. - - - - - - - Loads the level asynchronously in the background. - - - - - - - Use this delegate type with Application.logMessageReceived or Application.logMessageReceivedThreaded to monitor what gets logged. - - - - - - - - This is the delegate function when a mobile device notifies of low memory. - - - - - Opens the URL specified, subject to the permissions and limitations of your app’s current platform and environment. This is handled in different ways depending on the nature of the URL, and with different security restrictions, depending on the runtime platform. - - The URL to open. - - - - Quits the player application. - - An optional exit code to return when the player application terminates on Windows, Mac and Linux. Defaults to 0. - - - - Request advertising ID for iOS and Windows Store. - - Delegate method. - - Returns true if successful, or false for platforms which do not support Advertising Identifiers. In this case, the delegate method is not invoked. - - - - - Request authorization to use the webcam or microphone on iOS. - - - - - - Set an array of feature tags for this build. - - - - - - Set stack trace logging options. The default value is StackTraceLogType.ScriptOnly. - - - - - - - Unloads the Unity Player. - - - - - Unloads all GameObject associated with the given Scene. Note that assets are currently not unloaded, in order to free up asset memory call Resources.UnloadAllUnusedAssets. - - Index of the Scene in the PlayerSettings to unload. - Name of the Scene to Unload. - - Return true if the Scene is unloaded. - - - - - Unloads all GameObject associated with the given Scene. Note that assets are currently not unloaded, in order to free up asset memory call Resources.UnloadAllUnusedAssets. - - Index of the Scene in the PlayerSettings to unload. - Name of the Scene to Unload. - - Return true if the Scene is unloaded. - - - - - Application installation mode (Read Only). - - - - - Application installed via ad hoc distribution. - - - - - Application installed via developer build. - - - - - Application running in editor. - - - - - Application installed via enterprise distribution. - - - - - Application installed via online store. - - - - - Application install mode unknown. - - - - - Application sandbox type. - - - - - Application not running in a sandbox. - - - - - Application is running in broken sandbox. - - - - - Application is running in a sandbox. - - - - - Application sandbox type is unknown. - - - - - Applies forces within an area. - - - - - The angular drag to apply to rigid-bodies. - - - - - The linear drag to apply to rigid-bodies. - - - - - The angle of the force to be applied. - - - - - The magnitude of the force to be applied. - - - - - The target for where the effector applies any force. - - - - - The variation of the magnitude of the force to be applied. - - - - - Should the forceAngle use global space? - - - - - Enumeration of all the muscles in an arm. - - - - - The arm down-up muscle. - - - - - The arm front-back muscle. - - - - - The arm roll in-out muscle. - - - - - The forearm close-open muscle. - - - - - The forearm roll in-out muscle. - - - - - The hand down-up muscle. - - - - - The hand in-out muscle. - - - - - The last value of the ArmDof enum. - - - - - The shoulder down-up muscle. - - - - - The shoulder front-back muscle. - - - - - A body that forms part of a Physics articulation. - - - - - Position of the anchor relative to this body. - - - - - Position of the anchor relative to this body. - - - - - Damping factor that affects how this body resists rotations. - - - - - The angular velocity of the body defined in world space. - - - - - The center of mass of the body defined in local space. - - - - - The amount of degrees of freedom of a body. - - - - - Allows you to specify that this body is not movable. - - - - - The index of the body in the hierarchy of articulation bodies. - - - - - The inertia tensor of this body. - - - - - The rotation of the inertia tensor. - - - - - Indicates whether this body is the root body of the articulation (Read Only). - - - - - The joint acceleration in reduced coordinates. - - - - - The joint force in reduced coordinates. - - - - - Allows you to specify the amount of friction that is applied as a result of connected bodies moving relative to this body. - - - - - The joint position in reduced coordinates. - - - - - The type of joint connecting this body to its parent body. - - - - - The joint velocity in reduced coordinates. - - - - - Damping factor that affects how this body resists linear motion. - - - - - The type of lock along X axis of movement. - - - - - The type of lock along Y axis of movement. - - - - - The type of lock along Z axis of movement. - - - - - The mass of this articulation body. - - - - - The maximimum angular velocity of the articulation body measured in radians per second. - - - - - The maximum velocity of an articulation body when moving out of penetrating state. - - - - - The maximum joint velocity of the articulation body joint in reduced coordinates. - - - - - The maximum linear velocity of the articulation body measured in meters per second. - - - - - Position of the anchor relative to this body's parent. - - - - - Position of the anchor relative to this body's parent. - - - - - The mass-normalized energy threshold, below which objects start going to sleep. - - - - - The solverIterations determines how accurately articulation body joints and collision contacts are resolved. - - - - - The solverVelocityIterations affects how accurately articulation body joints and collision contacts are resolved during bounce. - - - - - The magnitude of the conical swing angle relative to Y axis. - - - - - The magnitude of the conical swing angle relative to Z axis. - - - - - The type of lock for twist movement. - - - - - Controls whether gravity affects this articulation body. - - - - - Linear velocity of the body defined in world space. - - - - - The center of mass of the body defined in world space (Read Only). - - - - - The properties of drive along or around X. - - - - - The properties of drive along or around Y. - - - - - The properties of drive along or around Z. - - - - - Add force to the articulation body. - - The force vector to apply. - - - - Applies a force at a specific position, resulting in applying a torque and force on the object. - - Force vector in world coordinates. - Position in world coordinates. - - - - Applies a force to the articulation body, relative to its local coordinate system. - - Force vector in local coordinates. - - - - Applies a torque to the articulation body, relative to its local coordinate system. - - Torque vector in local coordinates. - - - - Add torque to the articulation body. - - The torque to apply. - - - - Return the point on the articulation body that is closest to a given one. - - The point of interest. - - The point on the surfaces of all Colliders attached to this articulation body that is closest to the given one. - - - - - Calculates and writes dense Jacobian matrix of the articulation body hierarchy to the supplied struct. - - Supplied struct to read back and store Jacobian matrix values. - - Number of elements in Jacobian matrix. - - - - - Calculates and reads back reduced coordinate data start indexes in reduced coordinate data buffer for every articulation body in the hierarchy. - - Supplied list of integers to read back and store the data. - - Total degrees of freedom for the entire hierarchy of articulation bodies. - - - - - Reads back articulation body joint drive targets of the entire hierarchy to the supplied list of floats. - - Supplied list of floats to read back and store the joint drive targets data. - - Total degrees of freedom for the entire hierarchy of articulation bodies. - - - - - Reads back articulation body joint drive target velocities of the entire hierarchy to the supplied list of floats . - - Supplied list of floats to read back and store the joint drive target velocities data. - - Total degrees of freedom for the entire hierarchy of articulation bodies. - - - - - Reads back articulation body joint accelerations of the entire hierarchy to the supplied list of floats . - - Supplied list of floats to read back and store the joint accelerations data. - - Total degrees of freedom for the entire hierarchy of articulation bodies. - - - - - Reads back articulation body joint forces of the entire hierarchy to the supplied list of floats . - - Supplied list of floats to read back and store the joint forces data. - - Total degrees of freedom for the entire hierarchy of articulation bodies. - - - - - Reads back articulation body joint positions of the entire hierarchy to the supplied list of floats . - - Supplied list of floats to read back and store the joint positions data. - - Total degrees of freedom for the entire hierarchy of articulation bodies. - - - - - Reads back articulation body joint velocities of the entire hierarchy to the supplied list of floats . - - Supplied list of floats to read back and store the joint velocities data. - - Total degrees of freedom for the entire hierarchy of articulation bodies. - - - - - Gets the velocity of the articulation body at the specified worldPoint in global space. - - - - - - The velocity relative to the articulation body at the point relativePoint. - - - - - - Indicates whether the articulation body is sleeping. - - - - - Resets the center of mass of the articulation body. - - - - - Resets the inertia tensor value and rotation. - - - - - Assigns articulation body joint drive targets for the entire hierarchy of bodies. - - Supplied list of floats used to set the joint drive targets. - - - - Assigns articulation body joint drive target velocities for the entire hierarchy of bodies. - - Supplied list of floats used to set the joint drive target velocities. - - - - Assigns articulation body joint accelerations for the entire hierarchy of bodies. - - Supplied list of floats used to set the joint accelerations. - - - - Assigns articulation body joint forces for the entire hierarchy of bodies. - - Supplied list of floats used to set the joint forces. - - - - Assigns articulation body joint positions for the entire hierarchy of bodies. - - Supplied list of floats used to set the joint positions. - - - - Assigns articulation body joint velocities for the entire hierarchy of bodies. - - Supplied list of floats used to set the joint velocities. - - - - Forces an articulation body to sleep. - - - - - Teleport the root body of the articulation to a new pose. - - The new position of the root articulation body. - The new orientation of the root articulation body. - - - - Forces an articulation body to wake up. - - - - - The lock type applied to a particular degree of freedom of an articulation body. - - - - - The relative motion of the two connected articulation bodies is unconstrained. - - - - - The relative motion of the two connected articulation bodies is limited to a certain range. - - - - - The relative motion of the two connected articulation bodies is not allowed. - - - - - Drive applies forces and torques to the connected bodies. - - - - - The damping of the spring attached to this drive. - - - - - The maximum force this drive can apply to a body. - - - - - The lower limit of motion for a particular degree of freedom. - - - - - The stiffness of the spring connected to this drive. - - - - - The target value the drive will try to reach. - - - - - The velocity of the body this drive will try to reach. - - - - - The upperlimit of motion for a particular degree of freedom. - - - - - The floating point dense Jacobian matrix of the articulation body hierarchy. - - - - - Number of columns of the matrix is equal to the total number of all joint degrees of freedom(DOF), plus 6 if ArticulationBody.immovable is false. - - - - - List of floats representing Jacobian matrix. - - - - - Number of rows of the matrix is equal to the number of articulation bodies in hierarchy times 6: 3 rows of linearpositional DOF and 3 rows of angularrotational DOF for each body. - - - - - Initializes nRows X nCols Jacobian matrix to zeroes. - - Number of matrix rows. - Number of matrix columns. - - - - Gets the [row, col] element of the matrix. - - The matrix row. - The matrix column. - - - - The type of the joint that restricts movement of the two connected articulation bodies. - - - - - Fixed joint doesn't allow any relative movement of the connected bodies. - - - - - Prismatic joint only allows relative translation of the connection bodies along one specified axis. - - - - - Revolute joint allows rotational movement around the X axis of the parent's anchor. - - - - - Spherical joint only allows relative rotations of the two connected bodies. - - - - - Coordinates in reduced space. - - - - - The number of degrees of freedom of a body. - - - - - Stores coordinates in reduced space. - - Coordinate of the first degree of freedom. - Coordinate of the second degree of freedom. - Coordinate of the third degree of freedom. - - - - Stores coordinates in reduced space. - - Coordinate of the first degree of freedom. - Coordinate of the second degree of freedom. - Coordinate of the third degree of freedom. - - - - Stores coordinates in reduced space. - - Coordinate of the first degree of freedom. - Coordinate of the second degree of freedom. - Coordinate of the third degree of freedom. - - - - Gets the coordinate along or about a specific degree of freedom. - - - - - Assembly level attribute. Any classes in an assembly with this attribute will be considered to be Editor Classes. - - - - - Constructor. - - - - - The Assert class contains assertion methods for setting invariants in the code. - - - - - Set to true to throw an exception when assertion methods fail and false if otherwise. This value defaults to true. - - - - - Assert the values are approximately equal. - - Tolerance of approximation. - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - - - - Assert the values are approximately equal. - - Tolerance of approximation. - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - - - - Assert the values are approximately equal. - - Tolerance of approximation. - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - - - - Assert the values are approximately equal. - - Tolerance of approximation. - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - - - - Assert that the values are equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Asserts that the values are approximately not equal. - - Tolerance of approximation. - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - - - - Asserts that the values are approximately not equal. - - Tolerance of approximation. - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - - - - Asserts that the values are approximately not equal. - - Tolerance of approximation. - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - - - - Asserts that the values are approximately not equal. - - Tolerance of approximation. - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - - - - Assert that the values are not equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are not equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are not equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are not equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are not equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are not equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are not equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are not equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are not equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are not equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are not equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are not equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are not equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are not equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are not equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are not equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are not equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are not equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are not equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are not equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are not equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Assert that the values are not equal. - - The assumed Assert value. - The exact Assert value. - The string used to describe the Assert. - Method to compare expected and actual arguments have the same value. - - - - Return true when the condition is false. Otherwise return false. - - true or false. - The string used to describe the result of the Assert. - - - - Return true when the condition is false. Otherwise return false. - - true or false. - The string used to describe the result of the Assert. - - - - Assert that the value is not null. - - The Object or type being checked for. - The string used to describe the Assert. - - - - Assert that the value is not null. - - The Object or type being checked for. - The string used to describe the Assert. - - - - Assert that the value is not null. - - The Object or type being checked for. - The string used to describe the Assert. - - - - Assert the value is null. - - The Object or type being checked for. - The string used to describe the Assert. - - - - Assert the value is null. - - The Object or type being checked for. - The string used to describe the Assert. - - - - Assert the value is null. - - The Object or type being checked for. - The string used to describe the Assert. - - - - Asserts that the condition is true. - - The string used to describe the Assert. - true or false. - - - - Asserts that the condition is true. - - The string used to describe the Assert. - true or false. - - - - An exception that is thrown on a failure. Assertions.Assert._raiseExceptions needs to be set to true. - - - - - A float comparer used by Assertions.Assert performing approximate comparison. - - - - - Default epsilon used by the comparer. - - - - - Default instance of a comparer class with deafult error epsilon and absolute error check. - - - - - Performs equality check with absolute error check. - - Expected value. - Actual value. - Comparison error. - - Result of the comparison. - - - - - Performs equality check with relative error check. - - Expected value. - Actual value. - Comparison error. - - Result of the comparison. - - - - - Creates an instance of the comparer. - - Should a relative check be used when comparing values? By default, an absolute check will be used. - Allowed comparison error. By default, the FloatComparer.kEpsilon is used. - - - - Creates an instance of the comparer. - - Should a relative check be used when comparing values? By default, an absolute check will be used. - Allowed comparison error. By default, the FloatComparer.kEpsilon is used. - - - - Creates an instance of the comparer. - - Should a relative check be used when comparing values? By default, an absolute check will be used. - Allowed comparison error. By default, the FloatComparer.kEpsilon is used. - - - - Creates an instance of the comparer. - - Should a relative check be used when comparing values? By default, an absolute check will be used. - Allowed comparison error. By default, the FloatComparer.kEpsilon is used. - - - - An extension class that serves as a wrapper for the Assert class. - - - - - An extension method for Assertions.Assert.AreApproximatelyEqual. - - - - - - - - - An extension method for Assertions.Assert.AreApproximatelyEqual. - - - - - - - - - An extension method for Assertions.Assert.AreApproximatelyEqual. - - - - - - - - - An extension method for Assertions.Assert.AreApproximatelyEqual. - - - - - - - - - An extension method for Assertions.Assert.AreEqual. - - - - - - - - An extension method for Assertions.Assert.AreEqual. - - - - - - - - An extension method for Assertions.Assert.IsFalse. - - - - - - - An extension method for Assertions.Assert.IsFalse. - - - - - - - An extension method for Assertions.Assert.IsNull. - - - - - - - An extension method for Assertions.Assert.IsNull. - - - - - - - An extension method for Assertions.Assert.IsTrue. - - - - - - - An extension method for Assertions.Assert.IsTrue. - - - - - - - An extension method for Assertions.Assert.AreNotApproximatelyEqual. - - - - - - - - - An extension method for Assertions.Assert.AreNotApproximatelyEqual. - - - - - - - - - An extension method for Assertions.Assert.AreNotApproximatelyEqual. - - - - - - - - - An extension method for Assertions.Assert.AreNotApproximatelyEqual. - - - - - - - - - An extension method for Assertions.Assert.AreNotEqual. - - - - - - - - An extension method for Assertions.Assert.AreNotEqual. - - - - - - - - An extension method for Assertions.Assert.AreNotNull. - - - - - - - An extension method for Assertions.Assert.AreNotNull. - - - - - - - AssetBundles let you stream additional assets via the UnityWebRequest class and instantiate them at runtime. AssetBundles are created via BuildPipeline.BuildAssetBundle. - - - - - Return true if the AssetBundle is a streamed Scene AssetBundle. - - - - - Check if an AssetBundle contains a specific object. - - - - - - Loads an asset bundle from a disk. - - Path of the file on disk - -See Also: UnityWebRequestAssetBundle.GetAssetBundle, DownloadHandlerAssetBundle. - - - - Asynchronously create an AssetBundle from a memory region. - - - - - - Synchronously create an AssetBundle from a memory region. - - Array of bytes with the AssetBundle data. - - - - Return all asset names in the AssetBundle. - - - - - To use when you need to get a list of all the currently loaded Asset Bundles. - - - Returns IEnumerable<AssetBundle> of all currently loaded Asset Bundles. - - - - - Return all the Scene asset paths (paths to *.unity assets) in the AssetBundle. - - - - - Loads all assets contained in the asset bundle that inherit from type. - - - - - - Loads all assets contained in the asset bundle. - - - - - Loads all assets contained in the asset bundle that inherit from type T. - - - - - Loads all assets contained in the asset bundle asynchronously. - - - - - Loads all assets contained in the asset bundle that inherit from T asynchronously. - - - - - Loads all assets contained in the asset bundle that inherit from type asynchronously. - - - - - - Loads asset with name from the bundle. - - - - - - Loads asset with name of a given type from the bundle. - - - - - - - Loads asset with name of type T from the bundle. - - - - - - Asynchronously loads asset with name from the bundle. - - - - - - Asynchronously loads asset with name of a given T from the bundle. - - - - - - Asynchronously loads asset with name of a given type from the bundle. - - - - - - - Loads asset and sub assets with name from the bundle. - - - - - - Loads asset and sub assets with name of a given type from the bundle. - - - - - - - Loads asset and sub assets with name of type T from the bundle. - - - - - - Loads asset with sub assets with name from the bundle asynchronously. - - - - - - Loads asset with sub assets with name of type T from the bundle asynchronously. - - - - - - Loads asset with sub assets with name of a given type from the bundle asynchronously. - - - - - - - Synchronously loads an AssetBundle from a file on disk. - - Path of the file on disk. - An optional CRC-32 checksum of the uncompressed content. If this is non-zero, then the content will be compared against the checksum before loading it, and give an error if it does not match. - An optional byte offset. This value specifies where to start reading the AssetBundle from. - - Loaded AssetBundle object or null if failed. - - - - - Synchronously loads an AssetBundle from a file on disk. - - Path of the file on disk. - An optional CRC-32 checksum of the uncompressed content. If this is non-zero, then the content will be compared against the checksum before loading it, and give an error if it does not match. - An optional byte offset. This value specifies where to start reading the AssetBundle from. - - Loaded AssetBundle object or null if failed. - - - - - Asynchronously loads an AssetBundle from a file on disk. - - Path of the file on disk. - An optional CRC-32 checksum of the uncompressed content. If this is non-zero, then the content will be compared against the checksum before loading it, and give an error if it does not match. - An optional byte offset. This value specifies where to start reading the AssetBundle from. - - Asynchronous create request for an AssetBundle. Use AssetBundleCreateRequest.assetBundle property to get an AssetBundle once it is loaded. - - - - - Synchronously create an AssetBundle from a memory region. - - Array of bytes with the AssetBundle data. - An optional CRC-32 checksum of the uncompressed content. If this is non-zero, then the content will be compared against the checksum before loading it, and give an error if it does not match. - - Loaded AssetBundle object or null if failed. - - - - - Asynchronously create an AssetBundle from a memory region. - - Array of bytes with the AssetBundle data. - An optional CRC-32 checksum of the uncompressed content. If this is non-zero, then the content will be compared against the checksum before loading it, and give an error if it does not match. - - Asynchronous create request for an AssetBundle. Use AssetBundleCreateRequest.assetBundle property to get an AssetBundle once it is loaded. - - - - - Synchronously loads an AssetBundle from a managed Stream. - - The managed Stream object. Unity calls Read(), Seek() and the Length property on this object to load the AssetBundle data. - An optional CRC-32 checksum of the uncompressed content. - You can use this to override the size of the read buffer Unity uses while loading data. The default size is 32KB. - - The loaded AssetBundle object or null when the object fails to load. - - - - - Asynchronously loads an AssetBundle from a managed Stream. - - The managed Stream object. Unity calls Read(), Seek() and the Length property on this object to load the AssetBundle data. - An optional CRC-32 checksum of the uncompressed content. - You can use this to override the size of the read buffer Unity uses while loading data. The default size is 32KB. - - Asynchronous create request for an AssetBundle. Use AssetBundleCreateRequest.assetBundle property to get an AssetBundle once it is loaded. - - - - - Asynchronously recompress a downloaded/stored AssetBundle from one BuildCompression to another. - - Path to the AssetBundle to recompress. - Path to the recompressed AssetBundle to be generated. Can be the same as inputPath. - The compression method, level and blocksize to use during recompression. Only some BuildCompression types are supported (see note). - CRC of the AssetBundle to test against. Testing this requires additional file reading and computation. Pass in 0 to skip this check. Unity does not compute a CRC when the source and destination BuildCompression are the same, so no CRC verification takes place (see note). - The priority at which the recompression operation should run. This sets thread priority during the operation and does not effect the order in which operations are performed. Recompression operations run on a background worker thread. - - - - Unloads an AssetBundle freeing its data. - - Determines whether the current instances of objects loaded from the AssetBundle will also be unloaded. - - - - Unloads all currently loaded AssetBundles. - - Determines whether the current instances of objects loaded from AssetBundles will also be unloaded. - - - - Asynchronous create request for an AssetBundle. - - - - - Asset object being loaded (Read Only). - - - - - The result of an Asset Bundle Load or Recompress Operation. - - - - - The Asset Bundle is already loaded. - - - - - The operation was cancelled. - - - - - The Asset Bundle was not successfully cached. - - - - - Failed to decompress the Asset Bundle. - - - - - The target path given for the Recompression operation could not be deleted for swap with recompressed bundle file. - - - - - Failed to read the Asset Bundle file. - - - - - Failed to write to the file system. - - - - - The Asset Bundle does not contain any serialized data. It may be empty, or corrupt. - - - - - The AssetBundle is incompatible with this version of Unity. - - - - - The decompressed Asset data did not match the precomputed CRC. This may suggest that the AssetBundle did not download correctly. - - - - - This does not appear to be a valid Asset Bundle. - - - - - The target path given for the Recompression operation exists but is not an Archive container. - - - - - The target path given for the Recompression operation is an Archive that is currently loaded. - - - - - The operation completed successfully. - - - - - Manifest for all the AssetBundles in the build. - - - - - Get all the AssetBundles in the manifest. - - - An array of asset bundle names. - - - - - Get all the AssetBundles with variant in the manifest. - - - An array of asset bundle names. - - - - - Get all the dependent AssetBundles for the given AssetBundle. - - Name of the asset bundle. - - - - Get the hash for the given AssetBundle. - - Name of the asset bundle. - - The 128-bit hash for the asset bundle. - - - - - Get the direct dependent AssetBundles for the given AssetBundle. - - Name of the asset bundle. - - Array of asset bundle names this asset bundle depends on. - - - - - Asynchronous AssetBundle recompression from one compression method and level to another. - - - - - A string describing the recompression operation result (Read Only). - - - - - Path of the AssetBundle being recompressed (Read Only). - - - - - Path of the resulting recompressed AssetBundle (Read Only). - - - - - Result of the recompression operation. - - - - - True if the recompress operation is complete and was successful, otherwise false (Read Only). - - - - - Asynchronous load request from an AssetBundle. - - - - - Asset objects with sub assets being loaded. (Read Only) - - - - - Asset object being loaded (Read Only). - - - - - Asynchronous operation coroutine. - - - - - Allow Scenes to be activated as soon as it is ready. - - - - - Event that is invoked upon operation completion. An event handler that is registered in the same frame as the call that creates it will be invoked next frame, even if the operation is able to complete synchronously. If a handler is registered after the operation has completed and has already invoked the complete event, the handler will be called synchronously. - - Action<AsyncOperation> handler - function signature for completion event handler. - - - - Has the operation finished? (Read Only) - - - - - Priority lets you tweak in which order async operation calls will be performed. - - - - - What's the operation's progress. (Read Only) - - - - - An implementation of IPlayable that controls an AudioClip. - - - - - Creates an AudioClipPlayable in the PlayableGraph. - - The PlayableGraph that will contain the new AnimationLayerMixerPlayable. - The AudioClip that will be added in the PlayableGraph. - True if the clip should loop, false otherwise. - - A AudioClipPlayable linked to the PlayableGraph. - - - - - AudioMixer asset. - - - - - Routing target. - - - - - How time should progress for this AudioMixer. Used during Snapshot transitions. - - - - - Resets an exposed parameter to its initial value. - - Exposed parameter. - - Returns false if the parameter was not found or could not be set. - - - - - Connected groups in the mixer form a path from the mixer's master group to the leaves. This path has the format "Master GroupChild of Master GroupGrandchild of Master Group", so to find the grandchild group in this example, a valid search string would be for instance "randchi" which would return exactly one group while "hild" or "oup/" would return 2 different groups. - - Sub-string of the paths to be matched. - - Groups in the mixer whose paths match the specified search path. - - - - - The name must be an exact match. - - Name of snapshot object to be returned. - - The snapshot identified by the name. - - - - - Returns the value of the exposed parameter specified. If the parameter doesn't exist the function returns false. Prior to calling SetFloat and after ClearFloat has been called on this parameter the value returned will be that of the current snapshot or snapshot transition. - - Name of exposed parameter. - Return value of exposed parameter. - - Returns false if the exposed parameter specified doesn't exist. - - - - - Sets the value of the exposed parameter specified. When a parameter is exposed, it is not controlled by mixer snapshots and can therefore only be changed via this function. - - Name of exposed parameter. - New value of exposed parameter. - - Returns false if the exposed parameter was not found or snapshots are currently being edited. - - - - - Transitions to a weighted mixture of the snapshots specified. This can be used for games that specify the game state as a continuum between states or for interpolating snapshots from a triangulated map location. - - The set of snapshots to be mixed. - The mix weights for the snapshots specified. - Relative time after which the mixture should be reached from any current state. - - - - Object representing a group in the mixer. - - - - - An implementation of IPlayable that controls an audio mixer. - - - - - Object representing a snapshot in the mixer. - - - - - Performs an interpolated transition towards this snapshot over the time interval specified. - - Relative time after which this snapshot should be reached from any current state. - - - - The mode in which an AudioMixer should update its time. - - - - - Update the AudioMixer with scaled game time. - - - - - Update the AudioMixer with unscaled realtime. - - - - - A PlayableBinding that contains information representing an AudioPlayableOutput. - - - - - Creates a PlayableBinding that contains information representing an AudioPlayableOutput. - - A reference to a UnityEngine.Object that acts as a key for this binding. - The name of the AudioPlayableOutput. - - Returns a PlayableBinding that contains information that is used to create an AudioPlayableOutput. - - - - - A IPlayableOutput implementation that will be used to play audio. - - - - - Creates an AudioPlayableOutput in the PlayableGraph. - - The PlayableGraph that will contain the AnimationPlayableOutput. - The name of the output. - The AudioSource that will play the AudioPlayableOutput source Playable. - - A new AudioPlayableOutput attached to the PlayableGraph. - - - - - Gets the state of output playback when seeking. - - - Returns true if the output plays when seeking. Returns false otherwise. - - - - - Returns an invalid AudioPlayableOutput. - - - - - Controls whether the output should play when seeking. - - Set to true to play the output when seeking. Set to false to disable audio scrubbing on this output. Default is true. - - - - The Audio Chorus Filter takes an Audio Clip and processes it creating a chorus effect. - - - - - Chorus delay in ms. 0.1 to 100.0. Default = 40.0 ms. - - - - - Chorus modulation depth. 0.0 to 1.0. Default = 0.03. - - - - - Volume of original signal to pass to output. 0.0 to 1.0. Default = 0.5. - - - - - Chorus feedback. Controls how much of the wet signal gets fed back into the chorus buffer. 0.0 to 1.0. Default = 0.0. - - - - - Chorus modulation rate in hz. 0.0 to 20.0. Default = 0.8 hz. - - - - - Volume of 1st chorus tap. 0.0 to 1.0. Default = 0.5. - - - - - Volume of 2nd chorus tap. This tap is 90 degrees out of phase of the first tap. 0.0 to 1.0. Default = 0.5. - - - - - Volume of 3rd chorus tap. This tap is 90 degrees out of phase of the second tap. 0.0 to 1.0. Default = 0.5. - - - - - A container for audio data. - - - - - Returns true if this audio clip is ambisonic (read-only). - - - - - The number of channels in the audio clip. (Read Only) - - - - - The sample frequency of the clip in Hertz. (Read Only) - - - - - Returns true if the AudioClip is ready to play (read-only). - - - - - The length of the audio clip in seconds. (Read Only) - - - - - Corresponding to the "Load In Background" flag in the inspector, when this flag is set, the loading will happen delayed without blocking the main thread. - - - - - Returns the current load state of the audio data associated with an AudioClip. - - - - - The load type of the clip (read-only). - - - - - Preloads audio data of the clip when the clip asset is loaded. When this flag is off, scripts have to call AudioClip.LoadAudioData() to load the data before the clip can be played. Properties like length, channels and format are available before the audio data has been loaded. - - - - - The length of the audio clip in samples. (Read Only) - - - - - Creates a user AudioClip with a name and with the given length in samples, channels and frequency. - - Name of clip. - Number of sample frames. - Number of channels per frame. - Sample frequency of clip. - Audio clip is played back in 3D. - True if clip is streamed, that is if the pcmreadercallback generates data on the fly. - This callback is invoked to generate a block of sample data. Non-streamed clips call this only once at creation time while streamed clips call this continuously. - This callback is invoked whenever the clip loops or changes playback position. - - A reference to the created AudioClip. - - - - - Creates a user AudioClip with a name and with the given length in samples, channels and frequency. - - Name of clip. - Number of sample frames. - Number of channels per frame. - Sample frequency of clip. - Audio clip is played back in 3D. - True if clip is streamed, that is if the pcmreadercallback generates data on the fly. - This callback is invoked to generate a block of sample data. Non-streamed clips call this only once at creation time while streamed clips call this continuously. - This callback is invoked whenever the clip loops or changes playback position. - - A reference to the created AudioClip. - - - - - Creates a user AudioClip with a name and with the given length in samples, channels and frequency. - - Name of clip. - Number of sample frames. - Number of channels per frame. - Sample frequency of clip. - Audio clip is played back in 3D. - True if clip is streamed, that is if the pcmreadercallback generates data on the fly. - This callback is invoked to generate a block of sample data. Non-streamed clips call this only once at creation time while streamed clips call this continuously. - This callback is invoked whenever the clip loops or changes playback position. - - A reference to the created AudioClip. - - - - - Creates a user AudioClip with a name and with the given length in samples, channels and frequency. - - Name of clip. - Number of sample frames. - Number of channels per frame. - Sample frequency of clip. - Audio clip is played back in 3D. - True if clip is streamed, that is if the pcmreadercallback generates data on the fly. - This callback is invoked to generate a block of sample data. Non-streamed clips call this only once at creation time while streamed clips call this continuously. - This callback is invoked whenever the clip loops or changes playback position. - - A reference to the created AudioClip. - - - - - Creates a user AudioClip with a name and with the given length in samples, channels and frequency. - - Name of clip. - Number of sample frames. - Number of channels per frame. - Sample frequency of clip. - Audio clip is played back in 3D. - True if clip is streamed, that is if the pcmreadercallback generates data on the fly. - This callback is invoked to generate a block of sample data. Non-streamed clips call this only once at creation time while streamed clips call this continuously. - This callback is invoked whenever the clip loops or changes playback position. - - A reference to the created AudioClip. - - - - - Creates a user AudioClip with a name and with the given length in samples, channels and frequency. - - Name of clip. - Number of sample frames. - Number of channels per frame. - Sample frequency of clip. - Audio clip is played back in 3D. - True if clip is streamed, that is if the pcmreadercallback generates data on the fly. - This callback is invoked to generate a block of sample data. Non-streamed clips call this only once at creation time while streamed clips call this continuously. - This callback is invoked whenever the clip loops or changes playback position. - - A reference to the created AudioClip. - - - - - Fills an array with sample data from the clip. - - - - - - - Loads the audio data of a clip. Clips that have "Preload Audio Data" set will load the audio data automatically. - - - Returns true if loading succeeded. - - - - - Delegate called each time AudioClip reads data. - - Array of floats containing data read from the clip. - - - - Delegate called each time AudioClip changes read position. - - New position in the audio clip. - - - - Set sample data in a clip. - - - - - - - Unloads the audio data associated with the clip. This works only for AudioClips that are based on actual sound file assets. - - - Returns false if unloading failed. - - - - - Determines how the audio clip is loaded in. - - - - - The audio data of the clip will be kept in memory in compressed form. - - - - - The audio data is decompressed when the audio clip is loaded. - - - - - Streams audio data from disk. - - - - - An enum containing different compression types. - - - - - AAC Audio Compression. - - - - - Adaptive differential pulse-code modulation. - - - - - Sony proprietary hardware format. - - - - - Nintendo ADPCM audio compression format. - - - - - Sony proprietory hardware codec. - - - - - MPEG Audio Layer III. - - - - - Uncompressed pulse-code modulation. - - - - - Sony proprietary hardware format. - - - - - Vorbis compression format. - - - - - Xbox One proprietary hardware format. - - - - - Specifies the current properties or desired properties to be set for the audio system. - - - - - The length of the DSP buffer in samples determining the latency of sounds by the audio output device. - - - - - The current maximum number of simultaneously audible sounds in the game. - - - - - The maximum number of managed sounds in the game. Beyond this limit sounds will simply stop playing. - - - - - The current sample rate of the audio output device used. - - - - - The current speaker mode used by the audio output device. - - - - - Value describing the current load state of the audio data associated with an AudioClip. - - - - - Value returned by AudioClip.loadState for an AudioClip that has failed loading its audio data. - - - - - Value returned by AudioClip.loadState for an AudioClip that has succeeded loading its audio data. - - - - - Value returned by AudioClip.loadState for an AudioClip that is currently loading audio data. - - - - - Value returned by AudioClip.loadState for an AudioClip that has no audio data loaded and where loading has not been initiated yet. - - - - - The Audio Distortion Filter distorts the sound from an AudioSource or sounds reaching the AudioListener. - - - - - Distortion value. 0.0 to 1.0. Default = 0.5. - - - - - The Audio Echo Filter repeats a sound after a given Delay, attenuating the repetitions based on the Decay Ratio. - - - - - Echo decay per delay. 0 to 1. 1.0 = No decay, 0.0 = total decay (i.e. simple 1 line delay). Default = 0.5. - - - - - Echo delay in ms. 10 to 5000. Default = 500. - - - - - Volume of original signal to pass to output. 0.0 to 1.0. Default = 1.0. - - - - - Volume of echo signal to pass to output. 0.0 to 1.0. Default = 1.0. - - - - - The Audio High Pass Filter passes high frequencies of an AudioSource, and cuts off signals with frequencies lower than the Cutoff Frequency. - - - - - Highpass cutoff frequency in hz. 10.0 to 22000.0. Default = 5000.0. - - - - - Determines how much the filter's self-resonance isdampened. - - - - - Representation of a listener in 3D space. - - - - - The paused state of the audio system. - - - - - This lets you set whether the Audio Listener should be updated in the fixed or dynamic update. - - - - - Controls the game sound volume (0.0 to 1.0). - - - - - Provides a block of the listener (master)'s output data. - - The array to populate with audio samples. Its length must be a power of 2. - The channel to sample from. - - - - Deprecated Version. Returns a block of the listener (master)'s output data. - - - - - - - Provides a block of the listener (master)'s spectrum data. - - The array to populate with audio samples. Its length must be a power of 2. - The channel to sample from. - The FFTWindow type to use when sampling. - - - - Deprecated Version. Returns a block of the listener (master)'s spectrum data. - - Number of values (the length of the samples array). Must be a power of 2. Min = 64. Max = 8192. - The channel to sample from. - The FFTWindow type to use when sampling. - - - - The Audio Low Pass Filter passes low frequencies of an AudioSource or all sounds reaching an AudioListener, while removing frequencies higher than the Cutoff Frequency. - - - - - Returns or sets the current custom frequency cutoff curve. - - - - - Lowpass cutoff frequency in hz. 10.0 to 22000.0. Default = 5000.0. - - - - - Determines how much the filter's self-resonance is dampened. - - - - - Allow recording the main output of the game or specific groups in the AudioMixer. - - - - - Returns the number of samples available since the last time AudioRenderer.Render was called. This is dependent on the frame capture rate. - - - Number of samples available since last recorded frame. - - - - - Performs the recording of the main output as well as any optional mixer groups that have been registered via AudioRenderer.AddMixerGroupSink. - - The buffer to write the sample data to. - - True if the recording succeeded. - - - - - Enters audio recording mode. After this Unity will output silence until AudioRenderer.Stop is called. - - - True if the engine was switched into output recording mode. False if it is already recording. - - - - - Exits audio recording mode. After this audio output will be audible again. - - - True if the engine was recording when this function was called. - - - - - The Audio Reverb Filter takes an Audio Clip and distorts it to create a custom reverb effect. - - - - - Decay HF Ratio : High-frequency to low-frequency decay time ratio. Ranges from 0.1 to 2.0. Default is 0.5. - - - - - Reverberation decay time at low-frequencies in seconds. Ranges from 0.1 to 20.0. Default is 1.0. - - - - - Reverberation density (modal density) in percent. Ranges from 0.0 to 100.0. Default is 100.0. - - - - - Reverberation diffusion (echo density) in percent. Ranges from 0.0 to 100.0. Default is 100.0. - - - - - Mix level of dry signal in output in millibels (mB). Ranges from -10000.0 to 0.0. Default is 0. - - - - - Reference high frequency in hertz (Hz). Ranges from 1000.0 to 20000.0. Default is 5000.0. - - - - - Reference low-frequency in hertz (Hz). Ranges from 20.0 to 1000.0. Default is 250.0. - - - - - Late reverberation level relative to room effect in millibels (mB). Ranges from -10000.0 to 2000.0. Default is 0.0. - - - - - Early reflections level relative to room effect in millibels (mB). Ranges from -10000.0 to 1000.0. Default is -10000.0. - - - - - Late reverberation delay time relative to first reflection in seconds. Ranges from 0.0 to 0.1. Default is 0.04. - - - - - Late reverberation level relative to room effect in millibels (mB). Ranges from -10000.0 to 2000.0. Default is 0.0. - - - - - Set/Get reverb preset properties. - - - - - Room effect level at low frequencies in millibels (mB). Ranges from -10000.0 to 0.0. Default is 0.0. - - - - - Room effect high-frequency level re. low frequency level in millibels (mB). Ranges from -10000.0 to 0.0. Default is 0.0. - - - - - Room effect low-frequency level in millibels (mB). Ranges from -10000.0 to 0.0. Default is 0.0. - - - - - Reverb presets used by the Reverb Zone class and the audio reverb filter. - - - - - Alley preset. - - - - - Arena preset. - - - - - Auditorium preset. - - - - - Bathroom preset. - - - - - Carpeted hallway preset. - - - - - Cave preset. - - - - - City preset. - - - - - Concert hall preset. - - - - - Dizzy preset. - - - - - Drugged preset. - - - - - Forest preset. - - - - - Generic preset. - - - - - Hallway preset. - - - - - Hangar preset. - - - - - Livingroom preset. - - - - - Mountains preset. - - - - - No reverb preset selected. - - - - - Padded cell preset. - - - - - Parking Lot preset. - - - - - Plain preset. - - - - - Psychotic preset. - - - - - Quarry preset. - - - - - Room preset. - - - - - Sewer pipe preset. - - - - - Stone corridor preset. - - - - - Stoneroom preset. - - - - - Underwater presset. - - - - - User defined preset. - - - - - Reverb Zones are used when you want to create location based ambient effects in the Scene. - - - - - High-frequency to mid-frequency decay time ratio. - - - - - Reverberation decay time at mid frequencies. - - - - - Value that controls the modal density in the late reverberation decay. - - - - - Value that controls the echo density in the late reverberation decay. - - - - - The distance from the centerpoint that the reverb will not have any effect. Default = 15.0. - - - - - The distance from the centerpoint that the reverb will have full effect at. Default = 10.0. - - - - - Early reflections level relative to room effect. - - - - - Initial reflection delay time. - - - - - Late reverberation level relative to room effect. - - - - - Late reverberation delay time relative to initial reflection. - - - - - Set/Get reverb preset properties. - - - - - Room effect level (at mid frequencies). - - - - - Relative room effect level at high frequencies. - - - - - Relative room effect level at low frequencies. - - - - - Like rolloffscale in global settings, but for reverb room size effect. - - - - - Reference high frequency (hz). - - - - - Reference low frequency (hz). - - - - - Rolloff modes that a 3D sound can have in an audio source. - - - - - Use this when you want to use a custom rolloff. - - - - - Use this mode when you want to lower the volume of your sound over the distance. - - - - - Use this mode when you want a real-world rolloff. - - - - - Controls the global audio settings from script. - - - - - Returns the speaker mode capability of the current audio driver. (Read Only) - - - - - Returns the current time of the audio system. - - - - - Get the mixer's current output rate. - - - - - Gets the current speaker mode. Default is 2 channel stereo. - - - - - A delegate called whenever the global audio settings are changed, either by AudioSettings.Reset or by an external device change such as the OS control panel changing the sample rate or because the default output device was changed, for example when plugging in an HDMI monitor or a USB headset. - - True if the change was caused by an device change. - - - - Returns the current configuration of the audio device and system. The values in the struct may then be modified and reapplied via AudioSettings.Reset. - - - The new configuration to be applied. - - - - - Get the mixer's buffer size in samples. - - Is the length of each buffer in the ringbuffer. - Is number of buffers. - - - - Returns the name of the spatializer selected on the currently-running platform. - - - The spatializer plugin name. - - - - - Returns an array with the names of all the available spatializer plugins. - - - An array of spatializer names. - - - - - This class encapsulates properties and methods to handle audio output thread on iOS/Android. - - - - - Returns true if audio output thread is working. - - - - - Returns true if current device media volume is 0. - - - - - Set this property to true to make audio output thread automatically stop when device media volume is set to 0 and to start it again when volume is not 0. - - - - - A delegate called whenever the device mute state is changed. - - True if current device media volume is 0, false otherwise. - - - - Starts audio output thread on Android/iOS. - - - - - Stops audio thread on Android/iOS. - - - - - A delegate called whenever the global audio settings are changed, either by AudioSettings.Reset or by an external factor such as the OS control panel changing the sample rate or because the default output device was changed, for example when plugging in an HDMI monitor or a USB headset. - - True if the change was caused by an device change. - - - - Performs a change of the device configuration. In response to this the AudioSettings.OnAudioConfigurationChanged delegate is invoked with the argument deviceWasChanged=false. It cannot be guaranteed that the exact settings specified can be used, but the an attempt is made to use the closest match supported by the system. - - The new configuration to be used. - - True if all settings could be successfully applied. - - - - - Sets the spatializer plugin for all platform groups. If a null or empty string is passed in, the existing spatializer plugin will be cleared. - - The spatializer plugin name. - - - - A representation of audio sources in 3D. - - - - - Bypass effects (Applied from filter components or global listener filters). - - - - - When set global effects on the AudioListener will not be applied to the audio signal generated by the AudioSource. Does not apply if the AudioSource is playing into a mixer group. - - - - - When set doesn't route the signal from an AudioSource into the global reverb associated with reverb zones. - - - - - The default AudioClip to play. - - - - - Sets the Doppler scale for this AudioSource. - - - - - Allows AudioSource to play even though AudioListener.pause is set to true. This is useful for the menu element sounds or background music in pause menus. - - - - - This makes the audio source not take into account the volume of the audio listener. - - - - - Is the clip playing right now (Read Only)? - - - - - True if all sounds played by the AudioSource (main sound started by Play() or playOnAwake as well as one-shots) are culled by the audio system. - - - - - Is the audio clip looping? - - - - - (Logarithmic rolloff) MaxDistance is the distance a sound stops attenuating at. - - - - - Within the Min distance the AudioSource will cease to grow louder in volume. - - - - - Un- / Mutes the AudioSource. Mute sets the volume=0, Un-Mute restore the original volume. - - - - - The target group to which the AudioSource should route its signal. - - - - - Pan has been deprecated. Use panStereo instead. - - - - - PanLevel has been deprecated. Use spatialBlend instead. - - - - - Pans a playing sound in a stereo way (left or right). This only applies to sounds that are Mono or Stereo. - - - - - The pitch of the audio source. - - - - - If set to true, the audio source will automatically start playing on awake. - - - - - Sets the priority of the AudioSource. - - - - - The amount by which the signal from the AudioSource will be mixed into the global reverb associated with the Reverb Zones. - - - - - Sets/Gets how the AudioSource attenuates over distance. - - - - - Sets how much this AudioSource is affected by 3D spatialisation calculations (attenuation, doppler etc). 0.0 makes the sound full 2D, 1.0 makes it full 3D. - - - - - Enables or disables spatialization. - - - - - Determines if the spatializer effect is inserted before or after the effect filters. - - - - - Sets the spread angle (in degrees) of a 3d stereo or multichannel sound in speaker space. - - - - - Playback position in seconds. - - - - - Playback position in PCM samples. - - - - - Whether the Audio Source should be updated in the fixed or dynamic update. - - - - - The volume of the audio source (0.0 to 1.0). - - - - - Reads a user-defined parameter of a custom ambisonic decoder effect that is attached to an AudioSource. - - Zero-based index of user-defined parameter to be read. - Return value of the user-defined parameter that is read. - - True, if the parameter could be read. - - - - - Get the current custom curve for the given AudioSourceCurveType. - - The curve type to get. - - The custom AnimationCurve corresponding to the given curve type. - - - - - Provides a block of the currently playing source's output data. - - The array to populate with audio samples. Its length must be a power of 2. - The channel to sample from. - - - - Deprecated Version. Returns a block of the currently playing source's output data. - - - - - - - Reads a user-defined parameter of a custom spatializer effect that is attached to an AudioSource. - - Zero-based index of user-defined parameter to be read. - Return value of the user-defined parameter that is read. - - True, if the parameter could be read. - - - - - Provides a block of the currently playing audio source's spectrum data. - - The array to populate with audio samples. Its length must be a power of 2. - The channel to sample from. - The FFTWindow type to use when sampling. - - - - Deprecated Version. Returns a block of the currently playing source's spectrum data. - - The number of samples to retrieve. Must be a power of 2. - The channel to sample from. - The FFTWindow type to use when sampling. - - - - Pauses playing the clip. - - - - - Plays the clip. - - Deprecated. Delay in number of samples, assuming a 44100Hz sample rate (meaning that Play(44100) will delay the playing by exactly 1 sec). - - - - Plays the clip. - - Deprecated. Delay in number of samples, assuming a 44100Hz sample rate (meaning that Play(44100) will delay the playing by exactly 1 sec). - - - - Plays an AudioClip at a given position in world space. - - Audio data to play. - Position in world space from which sound originates. - Playback volume. - - - - Plays an AudioClip at a given position in world space. - - Audio data to play. - Position in world space from which sound originates. - Playback volume. - - - - Plays the clip with a delay specified in seconds. Users are advised to use this function instead of the old Play(delay) function that took a delay specified in samples relative to a reference rate of 44.1 kHz as an argument. - - Delay time specified in seconds. - - - - Plays an AudioClip, and scales the AudioSource volume by volumeScale. - - The clip being played. - The scale of the volume (0-1). - - - - Plays an AudioClip, and scales the AudioSource volume by volumeScale. - - The clip being played. - The scale of the volume (0-1). - - - - Plays the clip at a specific time on the absolute time-line that AudioSettings.dspTime reads from. - - Time in seconds on the absolute time-line that AudioSettings.dspTime refers to for when the sound should start playing. - - - - Sets a user-defined parameter of a custom ambisonic decoder effect that is attached to an AudioSource. - - Zero-based index of user-defined parameter to be set. - New value of the user-defined parameter. - - True, if the parameter could be set. - - - - - Set the custom curve for the given AudioSourceCurveType. - - The curve type that should be set. - The curve that should be applied to the given curve type. - - - - Changes the time at which a sound that has already been scheduled to play will end. Notice that depending on the timing not all rescheduling requests can be fulfilled. - - Time in seconds. - - - - Changes the time at which a sound that has already been scheduled to play will start. - - Time in seconds. - - - - Sets a user-defined parameter of a custom spatializer effect that is attached to an AudioSource. - - Zero-based index of user-defined parameter to be set. - New value of the user-defined parameter. - - True, if the parameter could be set. - - - - - Stops playing the clip. - - - - - Unpause the paused playback of this AudioSource. - - - - - This defines the curve type of the different custom curves that can be queried and set within the AudioSource. - - - - - Custom Volume Rolloff. - - - - - Reverb Zone Mix. - - - - - The Spatial Blend. - - - - - The 3D Spread. - - - - - These are speaker types defined for use with AudioSettings.speakerMode. - - - - - Channel count is set to 6. 5.1 speaker setup. This includes front left, front right, center, rear left, rear right and a subwoofer. - - - - - Channel count is set to 8. 7.1 speaker setup. This includes front left, front right, center, rear left, rear right, side left, side right and a subwoofer. - - - - - Channel count is set to 1. The speakers are monaural. - - - - - Channel count is set to 2. Stereo output, but data is encoded in a way that is picked up by a Prologic/Prologic2 decoder and split into a 5.1 speaker setup. - - - - - Channel count is set to 4. 4 speaker setup. This includes front left, front right, rear left, rear right. - - - - - Channel count is unaffected. - - - - - Channel count is set to 2. The speakers are stereo. This is the editor default. - - - - - Channel count is set to 5. 5 speaker setup. This includes front left, front right, center, rear left, rear right. - - - - - Type of the imported(native) data. - - - - - Acc - not supported. - - - - - Aiff. - - - - - iPhone hardware decoder, supports AAC, ALAC and MP3. Extracodecdata is a pointer to an FMOD_AUDIOQUEUE_EXTRACODECDATA structure. - - - - - Impulse tracker. - - - - - Protracker / Fasttracker MOD. - - - - - MP2/MP3 MPEG. - - - - - Ogg vorbis. - - - - - ScreamTracker 3. - - - - - 3rd party / unknown plugin format. - - - - - VAG. - - - - - Microsoft WAV. - - - - - FastTracker 2 XM. - - - - - Xbox360 XMA. - - - - - Describes when an AudioSource or AudioListener is updated. - - - - - Updates the source or listener in the MonoBehaviour.FixedUpdate loop if it is attached to a Rigidbody, dynamic MonoBehaviour.Update otherwise. - - - - - Updates the source or listener in the dynamic MonoBehaviour.Update loop. - - - - - Updates the source or listener in the MonoBehaviour.FixedUpdate loop. - - - - - Avatar definition. - - - - - Returns the HumanDescription used to create this Avatar. - - - - - Return true if this avatar is a valid human avatar. - - - - - Return true if this avatar is a valid mecanim avatar. It can be a generic avatar or a human avatar. - - - - - Class to build avatars from user scripts. - - - - - Create a new generic avatar. - - Root object of your transform hierarchy. - Transform name of the root motion transform. If empty no root motion is defined and you must take care of avatar movement yourself. - - - - Create a humanoid avatar. - - Root object of your transform hierachy. It must be the top most gameobject when you create the avatar. - Humanoid description of the avatar. - - Returns the Avatar, you must always always check the avatar is valid before using it with Avatar.isValid. - - - - - IK Goal. - - - - - The left foot. - - - - - The left hand. - - - - - The right foot. - - - - - The right hand. - - - - - IK Hint. - - - - - The left elbow IK hint. - - - - - The left knee IK hint. - - - - - The right elbow IK hint. - - - - - The right knee IK hint. - - - - - AvatarMask is used to mask out humanoid body parts and transforms. - - - - - The number of humanoid body parts. - - - - - Number of transforms. - - - - - Adds a transform path into the AvatarMask. - - The transform to add into the AvatarMask. - Whether to also add all children of the specified transform. - - - - Creates a new AvatarMask. - - - - - Returns true if the humanoid body part at the given index is active. - - The index of the humanoid body part. - - - - Returns true if the transform at the given index is active. - - The index of the transform. - - - - Returns the path of the transform at the given index. - - The index of the transform. - - - - Removes a transform path from the AvatarMask. - - The Transform that should be removed from the AvatarMask. - Whether to also remove all children of the specified transform. - - - - Sets the humanoid body part at the given index to active or not. - - The index of the humanoid body part. - Active or not. - - - - Sets the tranform at the given index to active or not. - - The index of the transform. - Active or not. - - - - Sets the path of the transform at the given index. - - The index of the transform. - The path of the transform. - - - - Avatar body part. - - - - - The Body. - - - - - The Head. - - - - - Total number of body parts. - - - - - The Left Arm. - - - - - Left Fingers. - - - - - Left Foot IK. - - - - - Left Hand IK. - - - - - The Left Leg. - - - - - The Right Arm. - - - - - Right Fingers. - - - - - Right Foot IK. - - - - - Right Hand IK. - - - - - The Right Leg. - - - - - The Root. - - - - - Target. - - - - - The body, center of mass. - - - - - The left foot. - - - - - The left hand. - - - - - The right foot. - - - - - The right hand. - - - - - The root, the position of the game object. - - - - - Enumeration for SystemInfo.batteryStatus which represents the current status of the device's battery. - - - - - Device is plugged in and charging. - - - - - Device is unplugged and discharging. - - - - - Device is plugged in and the battery is full. - - - - - Device is plugged in, but is not charging. - - - - - The device's battery status cannot be determined. If battery status is not available on your target platform, SystemInfo.batteryStatus will return this value. - - - - - Use this BeforeRenderOrderAttribute when you need to specify a custom callback order for Application.onBeforeRender. - - - - - The order, lowest to highest, that the Application.onBeforeRender event recievers will be called in. - - - - - When applied to methods, specifies the order called during Application.onBeforeRender events. - - The sorting order, sorted lowest to highest. - - - - Behaviours are Components that can be enabled or disabled. - - - - - Enabled Behaviours are Updated, disabled Behaviours are not. - - - - - Has the Behaviour had active and enabled called? - - - - - BillboardAsset describes how a billboard is rendered. - - - - - Height of the billboard that is below ground. - - - - - Height of the billboard. - - - - - Number of pre-rendered images that can be switched when the billboard is viewed from different angles. - - - - - Number of indices in the billboard mesh. - - - - - The material used for rendering. - - - - - Number of vertices in the billboard mesh. - - - - - Width of the billboard. - - - - - Constructs a new BillboardAsset. - - - - - Get the array of billboard image texture coordinate data. - - The list that receives the array. - - - - Get the array of billboard image texture coordinate data. - - The list that receives the array. - - - - Get the indices of the billboard mesh. - - The list that receives the array. - - - - Get the indices of the billboard mesh. - - The list that receives the array. - - - - Get the vertices of the billboard mesh. - - The list that receives the array. - - - - Get the vertices of the billboard mesh. - - The list that receives the array. - - - - Set the array of billboard image texture coordinate data. - - The array of data to set. - - - - Set the array of billboard image texture coordinate data. - - The array of data to set. - - - - Set the indices of the billboard mesh. - - The array of data to set. - - - - Set the indices of the billboard mesh. - - The array of data to set. - - - - Set the vertices of the billboard mesh. - - The array of data to set. - - - - Set the vertices of the billboard mesh. - - The array of data to set. - - - - Renders a billboard from a BillboardAsset. - - - - - The BillboardAsset to render. - - - - - Constructor. - - - - - The BitStream class represents seralized variables, packed into a stream. - - - - - Is the BitStream currently being read? (Read Only) - - - - - Is the BitStream currently being written? (Read Only) - - - - - Serializes different types of variables. - - - - - - - - Serializes different types of variables. - - - - - - - - Serializes different types of variables. - - - - - - - - Serializes different types of variables. - - - - - - - - Serializes different types of variables. - - - - - - - - Serializes different types of variables. - - - - - - - - Serializes different types of variables. - - - - - - - - Serializes different types of variables. - - - - - - - - Serializes different types of variables. - - - - - - - - Serializes different types of variables. - - - - - - - - Serializes different types of variables. - - - - - - - - Serializes different types of variables. - - - - - - - - Enumeration of all the muscles in the body. - - - - - The chest front-back muscle. - - - - - The chest left-right muscle. - - - - - The chest roll left-right muscle. - - - - - The last value of the BodyDof enum. - - - - - The spine front-back muscle. - - - - - The spine left-right muscle. - - - - - The spine roll left-right muscle. - - - - - The upper chest front-back muscle. - - - - - The upper chest left-right muscle. - - - - - The upper chest roll left-right muscle. - - - - - Describes 4 skinning bone weights that affect a vertex in a mesh. - - - - - Index of first bone. - - - - - Index of second bone. - - - - - Index of third bone. - - - - - Index of fourth bone. - - - - - Skinning weight for first bone. - - - - - Skinning weight for second bone. - - - - - Skinning weight for third bone. - - - - - Skinning weight for fourth bone. - - - - - Describes a bone weight that affects a vertex in a mesh. - - - - - Index of bone. - - - - - Skinning weight for bone. - - - - - Describes a single bounding sphere for use by a CullingGroup. - - - - - The position of the center of the BoundingSphere. - - - - - The radius of the BoundingSphere. - - - - - Initializes a BoundingSphere. - - The center of the sphere. - The radius of the sphere. - A four-component vector containing the position (packed into the XYZ components) and radius (packed into the W component). - - - - Initializes a BoundingSphere. - - The center of the sphere. - The radius of the sphere. - A four-component vector containing the position (packed into the XYZ components) and radius (packed into the W component). - - - - Represents an axis aligned bounding box. - - - - - The center of the bounding box. - - - - - The extents of the Bounding Box. This is always half of the size of the Bounds. - - - - - The maximal point of the box. This is always equal to center+extents. - - - - - The minimal point of the box. This is always equal to center-extents. - - - - - The total size of the box. This is always twice as large as the extents. - - - - - The closest point on the bounding box. - - Arbitrary point. - - The point on the bounding box or inside the bounding box. - - - - - Is point contained in the bounding box? - - - - - - Creates a new Bounds. - - The location of the origin of the Bounds. - The dimensions of the Bounds. - - - - Grows the Bounds to include the point. - - - - - - Grow the bounds to encapsulate the bounds. - - - - - - Expand the bounds by increasing its size by amount along each side. - - - - - - Expand the bounds by increasing its size by amount along each side. - - - - - - Does ray intersect this bounding box? - - - - - - Does ray intersect this bounding box? - - - - - - - Does another bounding box intersect with this bounding box? - - - - - - Sets the bounds to the min and max value of the box. - - - - - - - The smallest squared distance between the point and this bounding box. - - - - - - Returns a formatted string for the bounds. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Returns a formatted string for the bounds. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Returns a formatted string for the bounds. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Represents an axis aligned bounding box with all values as integers. - - - - - A BoundsInt.PositionCollection that contains all positions within the BoundsInt. - - - - - The center of the bounding box. - - - - - The maximal point of the box. - - - - - The minimal point of the box. - - - - - The position of the bounding box. - - - - - The total size of the box. - - - - - X value of the minimal point of the box. - - - - - The maximal x point of the box. - - - - - The minimal x point of the box. - - - - - Y value of the minimal point of the box. - - - - - The maximal y point of the box. - - - - - The minimal y point of the box. - - - - - Z value of the minimal point of the box. - - - - - The maximal z point of the box. - - - - - The minimal z point of the box. - - - - - Clamps the position and size of this bounding box to the given bounds. - - Bounds to clamp to. - - - - Is point contained in the bounding box? - - Point to check. - Whether the max limits are included in the check. - - Is point contained in the bounding box? - - - - - Is point contained in the bounding box? - - Point to check. - Whether the max limits are included in the check. - - Is point contained in the bounding box? - - - - - An iterator that allows you to iterate over all positions within the BoundsInt. - - - - - Current position of the enumerator. - - - - - Returns this as an iterator that allows you to iterate over all positions within the BoundsInt. - - - This BoundsInt.PositionEnumerator. - - - - - Moves the enumerator to the next position. - - - Whether the enumerator has successfully moved to the next position. - - - - - Resets this enumerator to its starting state. - - - - - Sets the bounds to the min and max value of the box. - - - - - - - Returns a formatted string for the bounds. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Returns a formatted string for the bounds. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Returns a formatted string for the bounds. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Use this struct to set up a box cast command to be performed asynchronously during a job. - - - - - Center of the box. - - - - - The direction in which to sweep the box. - - - - - The maximum distance of the sweep. - - - - - Half the size of the box in each dimension. - - - - - A LayerMask that is used to selectively ignore Colliders when casting a box. - - - - - Rotation of the box. - - - - - Creates a BoxcastCommand. - - Center of the box. - Half the size of the box in each dimension. - Rotation of the box. - The direction in which to sweep the box. - The maximum length of the cast. - A that is used to selectively ignore colliders when casting a box. - - - - - Schedules a batch of boxcasts to be performed in a job. - - A NativeArray of the BoxcastCommand to perform. - A NativeArray of RaycastHit where the result of commands are stored. - The minimum number of jobs which should be performed in a single job. - A JobHandle of a job that must be completed before performing the box casts. - - Returns a JobHandle of the job that will perform the box casts. - - - - - A box-shaped primitive collider. - - - - - The center of the box, measured in the object's local space. - - - - - The size of the box, measured in the object's local space. - - - - - Collider for 2D physics representing an axis-aligned rectangle. - - - - - Determines whether the BoxCollider2D's shape is automatically updated based on a SpriteRenderer's tiling properties. - - - - - The center point of the collider in local space. - - - - - Controls the radius of all edges created by the collider. - - - - - The width and height of the rectangle. - - - - - Contains information about compression methods, compression levels and block sizes that are supported by Asset Bundle compression at build time and recompression at runtime. - - - - - LZ4HC "Chunk Based" Compression. - - - - - LZ4 Compression for runtime recompression. - - - - - LZMA Compression. - - - - - Uncompressed Asset Bundle. - - - - - Uncompressed Asset Bundle. - - - - - Applies forces to simulate buoyancy, fluid-flow and fluid drag. - - - - - A force applied to slow angular movement of any Collider2D in contact with the effector. - - - - - The density of the fluid used to calculate the buoyancy forces. - - - - - The angle of the force used to similate fluid flow. - - - - - The magnitude of the force used to similate fluid flow. - - - - - The random variation of the force used to similate fluid flow. - - - - - A force applied to slow linear movement of any Collider2D in contact with the effector. - - - - - Defines an arbitrary horizontal line that represents the fluid surface level. - - - - - Data structure for cache. Please refer to See Also:Caching.AddCache for more information. - - - - - The number of seconds that an AssetBundle may remain unused in the cache before it is automatically deleted. - - - - - Returns the index of the cache in the cache list. - - - - - Allows you to specify the total number of bytes that can be allocated for the cache. - - - - - Returns the path of the cache. - - - - - Returns true if the cache is readonly. - - - - - Returns true if the cache is ready. - - - - - Returns the number of currently unused bytes in the cache. - - - - - Returns the used disk space in bytes. - - - - - Returns true if the cache is valid. - - - - - Removes all cached content in the cache that has been cached by the current application. - - The number of seconds that AssetBundles may remain unused in the cache. - - Returns True when cache clearing succeeded. - - - - - Removes all cached content in the cache that has been cached by the current application. - - The number of seconds that AssetBundles may remain unused in the cache. - - Returns True when cache clearing succeeded. - - - - - Data structure for downloading AssetBundles to a customized cache path. See Also:UnityWebRequestAssetBundle.GetAssetBundle for more information. - - - - - Hash128 which is used as the version of the AssetBundle. - - - - - AssetBundle name which is used as the customized cache path. - - - - - The Caching class lets you manage cached AssetBundles, downloaded using UnityWebRequestAssetBundle.GetAssetBundle(). - - - - - Returns the cache count in the cache list. - - - - - Controls compression of cache data. Enabled by default. - - - - - Gets or sets the current cache in which AssetBundles should be cached. - - - - - Returns the default cache which is added by Unity internally. - - - - - Returns true if Caching system is ready for use. - - - - - Add a cache with the given path. - - Path to the cache folder. - - - - Removes all the cached versions of the given AssetBundle from the cache. - - The AssetBundle name. - - Returns true when cache clearing succeeded. - - - - - Removes all AssetBundle content that has been cached by the current application. - - The number of seconds that AssetBundles may remain unused in the cache. - - True when cache clearing succeeded, false if cache was in use. - - - - - Removes all AssetBundle content that has been cached by the current application. - - The number of seconds that AssetBundles may remain unused in the cache. - - True when cache clearing succeeded, false if cache was in use. - - - - - Removes the given version of the AssetBundle. - - The AssetBundle name. - Version needs to be cleaned. - - Returns true when cache clearing succeeded. Can return false if any cached bundle is in use. - - - - - Removes all the cached versions of the AssetBundle from the cache, except for the specified version. - - The AssetBundle name. - Version needs to be kept. - - Returns true when cache clearing succeeded. - - - - - Returns all paths of the cache in the cache list. - - List of all the cache paths. - - - - Returns the Cache at the given position in the cache list. - - Index of the cache to get. - - A reference to the Cache at the index specified. - - - - - Returns the Cache that has the given cache path. - - The cache path. - - A reference to the Cache with the given path. - - - - - Returns all cached versions of the given AssetBundle. - - The AssetBundle name. - List of all the cached version. - - - - Checks if an AssetBundle is cached. - - Url The filename of the AssetBundle. Domain and path information are stripped from this string automatically. - Version The version number of the AssetBundle to check for. Negative values are not allowed. - - - - True if an AssetBundle matching the url and version parameters has previously been loaded using UnityWebRequestAssetBundle.GetAssetBundle() and is currently stored in the cache. Returns false if the AssetBundle is not in cache, either because it has been flushed from the cache or was never loaded using the Caching API. - - - - - Bumps the timestamp of a cached file to be the current time. - - - - - - - Moves the source Cache after the destination Cache in the cache list. - - The Cache to move. - The Cache which should come before the source Cache in the cache list. - - - - Moves the source Cache before the destination Cache in the cache list. - - The Cache to move. - The Cache which should come after the source Cache in the cache list. - - - - Removes the Cache from cache list. - - The Cache to be removed. - - Returns true if the Cache is removed. - - - - - A Camera is a device through which the player views the world. - - - - - Gets the temporary RenderTexture target for this Camera. - - - - - The rendering path that is currently being used (Read Only). - - - - - Returns all enabled cameras in the Scene. - - - - - The number of cameras in the current Scene. - - - - - Dynamic Resolution Scaling. - - - - - High dynamic range rendering. - - - - - MSAA rendering. - - - - - Determines whether the stereo view matrices are suitable to allow for a single pass cull. - - - - - The aspect ratio (width divided by height). - - - - - The color with which the screen will be cleared. - - - - - Matrix that transforms from camera space to world space (Read Only). - - - - - Identifies what kind of camera this is, using the CameraType enum. - - - - - How the camera clears the background. - - - - - Should the camera clear the stencil buffer after the deferred light pass? - - - - - Number of command buffers set up on this camera (Read Only). - - - - - This is used to render parts of the Scene selectively. - - - - - Sets a custom matrix for the camera to use for all culling queries. - - - - - The camera we are currently rendering with, for low-level render control only (Read Only). - - - - - Camera's depth in the camera rendering order. - - - - - How and if camera generates a depth texture. - - - - - Mask to select which layers can trigger events on the camera. - - - - - The distance of the far clipping plane from the Camera, in world units. - - - - - The field of view of the camera in degrees. - - - - - The camera focal length, expressed in millimeters. To use this property, enable UsePhysicalProperties. - - - - - Should camera rendering be forced into a RenderTexture. - - - - - There are two gates for a camera, the sensor gate and the resolution gate. The physical camera sensor gate is defined by the sensorSize property, the resolution gate is defined by the render target area. - - - - - High dynamic range rendering. - - - - - Per-layer culling distances. - - - - - How to perform per-layer culling for a Camera. - - - - - The lens offset of the camera. The lens shift is relative to the sensor size. For example, a lens shift of 0.5 offsets the sensor by half its horizontal size. - - - - - The first enabled Camera component that is tagged "MainCamera" (Read Only). - - - - - The distance of the near clipping plane from the the Camera, in world units. - - - - - Get or set the raw projection matrix with no camera offset (no jittering). - - - - - Delegate that you can use to execute custom code after a Camera renders the scene. - - - - - Delegate that you can use to execute custom code before a Camera culls the scene. - - - - - Delegate that you can use to execute custom code before a Camera renders the scene. - - - - - Opaque object sorting mode. - - - - - Is the camera orthographic (true) or perspective (false)? - - - - - Camera's half-size when in orthographic mode. - - - - - Sets the culling maks used to determine which objects from which Scenes to draw. -See EditorSceneManager.SetSceneCullingMask. - - - - - How tall is the camera in pixels (not accounting for dynamic resolution scaling) (Read Only). - - - - - Where on the screen is the camera rendered in pixel coordinates. - - - - - How wide is the camera in pixels (not accounting for dynamic resolution scaling) (Read Only). - - - - - Get the view projection matrix used on the last frame. - - - - - Set a custom projection matrix. - - - - - Where on the screen is the camera rendered in normalized coordinates. - - - - - The rendering path that should be used, if possible. - - - - - How tall is the camera in pixels (accounting for dynamic resolution scaling) (Read Only). - - - - - How wide is the camera in pixels (accounting for dynamic resolution scaling) (Read Only). - - - - - If not null, the camera will only render the contents of the specified Scene. - - - - - The size of the camera sensor, expressed in millimeters. - - - - - Returns the eye that is currently rendering. -If called when stereo is not enabled it will return Camera.MonoOrStereoscopicEye.Mono. - -If called during a camera rendering callback such as OnRenderImage it will return the currently rendering eye. - -If called outside of a rendering callback and stereo is enabled, it will return the default eye which is Camera.MonoOrStereoscopicEye.Left. - - - - - Distance to a point where virtual eyes converge. - - - - - Stereoscopic rendering. - - - - - Render only once and use resulting image for both eyes. - - - - - The distance between the virtual eyes. Use this to query or set the current eye separation. Note that most VR devices provide this value, in which case setting the value will have no effect. - - - - - Defines which eye of a VR display the Camera renders into. - - - - - Set the target display for this Camera. - - - - - Destination render texture. - - - - - An axis that describes the direction along which the distances of objects are measured for the purpose of sorting. - - - - - Transparent object sorting mode. - - - - - Should the jittered matrix be used for transparency rendering? - - - - - Whether or not the Camera will use occlusion culling during rendering. - - - - - Enable [UsePhysicalProperties] to use physical camera properties to compute the field of view and the frustum. - - - - - Get the world-space speed of the camera (Read Only). - - - - - Matrix that transforms from world to camera space. - - - - - Add a command buffer to be executed at a specified place. - - When to execute the command buffer during rendering. - The buffer to execute. - - - - Adds a command buffer to the GPU's async compute queues and executes that command buffer when graphics processing reaches a given point. - - The point during the graphics processing at which this command buffer should commence on the GPU. - The buffer to execute. - The desired async compute queue type to execute the buffer on. - - - - Given viewport coordinates, calculates the view space vectors pointing to the four frustum corners at the specified camera depth. - - Normalized viewport coordinates to use for the frustum calculation. - Z-depth from the camera origin at which the corners will be calculated. - Camera eye projection matrix to use. - Output array for the frustum corner vectors. Cannot be null and length must be >= 4. - - - - Calculates and returns oblique near-plane projection matrix. - - Vector4 that describes a clip plane. - - Oblique near-plane projection matrix. - - - - - - Calculates the projection matrix from focal length, sensor size, lens shift, near plane distance, far plane distance, and Gate fit parameters. - To calculate the projection matrix without taking Gate fit into account, use Camera.GateFitMode.None . See Also: Camera.GateFitParameters - - - The calculated matrix. - Focal length in millimeters. - Sensor dimensions in Millimeters. - Lens offset relative to the sensor size. - Near plane distance. - Far plane distance. - Gate fit parameters to use. See Camera.GateFitParameters. - - - - Delegate type for camera callbacks. - - - - - - Makes this camera's settings match other camera. - - Copy camera settings to the other camera. - - - - Sets the non-jittered projection matrix, sourced from the VR SDK. - - Specifies the stereoscopic eye whose non-jittered projection matrix will be sourced from the VR SDK. - - - - - Enumerates which axis to use when expressing the value for the field of view. - The default value is Camera.FieldOfViewAxis.Vertical. - - - - - Specifies the field of view as horizontal. - - - - - Specifies the field of view as vertical. - - - - - Converts field of view to focal length. Use either sensor height and vertical field of view or sensor width and horizontal field of view. - - field of view in degrees. - Sensor size in millimeters. - - Focal length in millimeters. - - - - - Converts focal length to field of view. - - Focal length in millimeters. - Sensor size in millimeters. Use the sensor height to get the vertical field of view. Use the sensor width to get the horizontal field of view. - - field of view in degrees. - - - - - Enum used to specify how the sensor gate (sensor frame) defined by Camera.sensorSize fits into the resolution gate (render frame). - - - - - - Automatically selects a horizontal or vertical fit so that the sensor gate fits completely inside the resolution gate. - - - - - - - Fit the resolution gate horizontally within the sensor gate. - - - - - - - Stretch the sensor gate to fit exactly into the resolution gate. - - - - - - - Automatically selects a horizontal or vertical fit so that the render frame fits completely inside the resolution gate. - - - - - - - Fit the resolution gate vertically within the sensor gate. - - - - - - Wrapper for gate fit parameters - - - - - Aspect ratio of the resolution gate. - - - - - GateFitMode to use. See Camera.GateFitMode. - - - - - Wrapper for gate fit parameters. - - - - - - - Fills an array of Camera with the current cameras in the Scene, without allocating a new array. - - An array to be filled up with cameras currently in the Scene. - - - - Get command buffers to be executed at a specified place. - - When to execute the command buffer during rendering. - - Array of command buffers. - - - - - - Retrieves the effective vertical field of view of the camera, including GateFit. - Fitting the sensor gate and the resolution gate has an impact on the final field of view. If the sensor gate aspect ratio is the same as the resolution gate aspect ratio or if the camera is not in physical mode, then this method returns the same value as the fieldofview property. - - - - Returns the effective vertical field of view. - - - - - - Retrieves the effective lens offset of the camera, including GateFit. - Fitting the sensor gate and the resolution gate has an impact on the final obliqueness of the projection. If the sensor gate aspect ratio is the same as the resolution gate aspect ratio, then this method returns the same value as the lenshift property. If the camera is not in physical mode, then this methods returns Vector2.zero. - - - - Returns the effective lens shift value. - - - - - Gets the non-jittered projection matrix of a specific left or right stereoscopic eye. - - Specifies the stereoscopic eye whose non-jittered projection matrix needs to be returned. - - The non-jittered projection matrix of the specified stereoscopic eye. - - - - - Gets the projection matrix of a specific left or right stereoscopic eye. - - Specifies the stereoscopic eye whose projection matrix needs to be returned. - - The projection matrix of the specified stereoscopic eye. - - - - - Gets the left or right view matrix of a specific stereoscopic eye. - - Specifies the stereoscopic eye whose view matrix needs to be returned. - - The view matrix of the specified stereoscopic eye. - - - - - Converts the horizontal field of view (FOV) to the vertical FOV, based on the value of the aspect ratio parameter. - - The horizontal FOV value in degrees. - The aspect ratio value used for the conversion - - - - - A Camera eye corresponding to the left or right human eye for stereoscopic rendering, or neither for non-stereoscopic rendering. - -A single Camera can render both left and right views in a single frame. Therefore, this enum describes which eye the Camera is currently rendering when returned by Camera.stereoActiveEye during a rendering callback (such as Camera.OnRenderImage), or which eye to act on when passed into a function. - -The default value is Camera.MonoOrStereoscopicEye.Left, so Camera.MonoOrStereoscopicEye.Left may be returned by some methods or properties when called outside of rendering if stereoscopic rendering is enabled. - - - - - Camera eye corresponding to stereoscopic rendering of the left eye. - - - - - Camera eye corresponding to non-stereoscopic rendering. - - - - - Camera eye corresponding to stereoscopic rendering of the right eye. - - - - - Remove all command buffers set on this camera. - - - - - Remove command buffer from execution at a specified place. - - When to execute the command buffer during rendering. - The buffer to execute. - - - - Remove command buffers from execution at a specified place. - - When to execute the command buffer during rendering. - - - - Render the camera manually. - - - - - A request that can be used for making specific rendering requests. - - - - - Is this request properly formed. - - - - - The type of request. - - - - - Defines in which space render requests will be be outputted. - - - - - The result of the request. - - - - - Modes available for submitting when making a render request. - - - - - The render request outputs the materials albedo / base color. - - - - - The render request outputs a depth value. - - - - - The render request outputs the materials diffuse color. - - - - - The render request outputs the materials emission value. - - - - - The render request outputs an entity id. - - - - - The render outputs the materials metal value. - - - - - Default value for a request. - - - - - The render request outputs the per pixel normal. - - - - - The render request outputs an object InstanceID buffer. - - - - - The render request returns the material ambient occlusion buffer. - - - - - The render request returns the materials smoothness buffer. - - - - - The render request returns the materials specular color buffer. - - - - - The render request outputs the interpolated vertex normal. - - - - - The render request outputs a world position buffer. - - - - - Defines in which space render requests will be be outputted. - - - - - RenderRequests will be rendered in screenspace from the perspective of the camera. - - - - - RenderRequests will be outputted in UV 0 space of the rendered mesh. - - - - - RenderRequests will be outputted in UV 1 space of the rendered mesh. - - - - - RenderRequests will be outputted in UV 2 space of the rendered mesh. - - - - - RenderRequests will be outputted in UV 3 space of the rendered mesh. - - - - - RenderRequests will be outputted in UV 4 space of the rendered mesh. - - - - - RenderRequests will be outputted in UV 5 space of the rendered mesh. - - - - - RenderRequests will be outputted in UV 6 space of the rendered mesh. - - - - - RenderRequests will be outputted in UV 7 space of the rendered mesh. - - - - - RenderRequests will be outputted in UV 8 space of the rendered mesh. - - - - - Render into a static cubemap from this camera. - - The cube map to render to. - A bitmask which determines which of the six faces are rendered to. - - False if rendering fails, else true. - - - - - Render into a cubemap from this camera. - - A bitfield indicating which cubemap faces should be rendered into. - The texture to render to. - - False if rendering fails, else true. - - - - - Render one side of a stereoscopic 360-degree image into a cubemap from this camera. - - The texture to render to. - A bitfield indicating which cubemap faces should be rendered into. Set to the integer value 63 to render all faces. - A Camera eye corresponding to the left or right eye for stereoscopic rendering, or neither for non-stereoscopic rendering. - - False if rendering fails, else true. - - - - - Render the camera with shader replacement. - - - - - - - Revert all camera parameters to default. - - - - - Revert the aspect ratio to the screen's aspect ratio. - - - - - Make culling queries reflect the camera's built in parameters. - - - - - Reset to the default field of view. - - - - - Make the projection reflect normal camera's parameters. - - - - - Remove shader replacement from camera. - - - - - Reset the camera to using the Unity computed projection matrices for all stereoscopic eyes. - - - - - Reset the camera to using the Unity computed view matrices for all stereoscopic eyes. - - - - - Resets this Camera's transparency sort settings to the default. Default transparency settings are taken from GraphicsSettings instead of directly from this Camera. - - - - - Make the rendering position reflect the camera's position in the Scene. - - - - - Returns a ray going from camera through a screen point. - - Optional argument that can be used to specify which eye transform to use. Default is Mono. - - - - - Returns a ray going from camera through a screen point. - - Optional argument that can be used to specify which eye transform to use. Default is Mono. - - - - - Transforms position from screen space into viewport space. - - - - - - Transforms a point from screen space into world space, where world space is defined as the coordinate system at the very top of your game's hierarchy. - - A screen space position (often mouse x, y), plus a z position for depth (for example, a camera clipping plane). - By default, Camera.MonoOrStereoscopicEye.Mono. Can be set to Camera.MonoOrStereoscopicEye.Left or Camera.MonoOrStereoscopicEye.Right for use in stereoscopic rendering (e.g., for VR). - - The worldspace point created by converting the screen space point at the provided distance z from the camera plane. - - - - - Transforms a point from screen space into world space, where world space is defined as the coordinate system at the very top of your game's hierarchy. - - A screen space position (often mouse x, y), plus a z position for depth (for example, a camera clipping plane). - By default, Camera.MonoOrStereoscopicEye.Mono. Can be set to Camera.MonoOrStereoscopicEye.Left or Camera.MonoOrStereoscopicEye.Right for use in stereoscopic rendering (e.g., for VR). - - The worldspace point created by converting the screen space point at the provided distance z from the camera plane. - - - - - Make the camera render with shader replacement. - - - - - - - Sets custom projection matrices for both the left and right stereoscopic eyes. - - Projection matrix for the stereoscopic left eye. - Projection matrix for the stereoscopic right eye. - - - - Sets a custom projection matrix for a specific stereoscopic eye. - - Specifies the stereoscopic eye whose projection matrix needs to be set. - The matrix to be set. - - - - Set custom view matrices for both eyes. - - View matrix for the stereo left eye. - View matrix for the stereo right eye. - - - - Sets a custom view matrix for a specific stereoscopic eye. - - Specifies the stereoscopic view matrix to set. - The matrix to be set. - - - - Sets the Camera to render to the chosen buffers of one or more RenderTextures. - - The RenderBuffer(s) to which color information will be rendered. - The RenderBuffer to which depth information will be rendered. - - - - Sets the Camera to render to the chosen buffers of one or more RenderTextures. - - The RenderBuffer(s) to which color information will be rendered. - The RenderBuffer to which depth information will be rendered. - - - - Enum used to specify either the left or the right eye of a stereoscopic camera. - - - - - Specifies the target to be the left eye. - - - - - Specifies the target to be the right eye. - - - - - Submit a number of Camera.RenderRequests. - - Requests. - - - - Get culling parameters for a camera. - - Resultant culling parameters. - Generate single-pass stereo aware culling parameters. - - Flag indicating whether culling parameters are valid. - - - - - Get culling parameters for a camera. - - Resultant culling parameters. - Generate single-pass stereo aware culling parameters. - - Flag indicating whether culling parameters are valid. - - - - - Converts the vertical field of view (FOV) to the horizontal FOV, based on the value of the aspect ratio parameter. - - The vertical FOV value in degrees. - The aspect ratio value used for the conversion - - - - Returns a ray going from camera through a viewport point. - - Optional argument that can be used to specify which eye transform to use. Default is Mono. - - - - - Returns a ray going from camera through a viewport point. - - Optional argument that can be used to specify which eye transform to use. Default is Mono. - - - - - Transforms position from viewport space into screen space. - - - - - - Transforms position from viewport space into world space. - - The 3d vector in Viewport space. - - The 3d vector in World space. - - - - - Transforms position from world space into screen space. - - Optional argument that can be used to specify which eye transform to use. Default is Mono. - - - - - Transforms position from world space into screen space. - - Optional argument that can be used to specify which eye transform to use. Default is Mono. - - - - - Transforms position from world space into viewport space. - - Optional argument that can be used to specify which eye transform to use. Default is Mono. - - - - - Transforms position from world space into viewport space. - - Optional argument that can be used to specify which eye transform to use. Default is Mono. - - - - - Values for Camera.clearFlags, determining what to clear when rendering a Camera. - - - - - Clear only the depth buffer. - - - - - Don't clear anything. - - - - - Clear with the skybox. - - - - - Clear with a background color. - - - - - Describes different types of camera. - - - - - Used to indicate a regular in-game camera. - - - - - Used to indicate a camera that is used for rendering previews in the Editor. - - - - - Used to indicate a camera that is used for rendering reflection probes. - - - - - Used to indicate that a camera is used for rendering the Scene View in the Editor. - - - - - Used to indicate that a camera is used for rendering VR (in edit mode) in the Editor. - - - - - Element that can be used for screen rendering. - - - - - Get or set the mask of additional shader channels to be used when creating the Canvas mesh. - - - - - Cached calculated value based upon SortingLayerID. - - - - - Is this the root Canvas? - - - - - The normalized grid size that the canvas will split the renderable area into. - - - - - Allows for nested canvases to override pixelPerfect settings inherited from parent canvases. - - - - - Override the sorting of canvas. - - - - - Force elements in the canvas to be aligned with pixels. Only applies with renderMode is Screen Space. - - - - - Get the render rect for the Canvas. - - - - - How far away from the camera is the Canvas generated. - - - - - Event that is called just before Canvas rendering happens. - - - - - - The number of pixels per unit that is considered the default. - - - - - Returns the canvas display size based on the selected render mode and target display. - - - - - Is the Canvas in World or Overlay mode? - - - - - The render order in which the canvas is being emitted to the Scene. (Read Only) - - - - - Returns the Canvas closest to root, by checking through each parent and returning the last canvas found. If no other canvas is found then the canvas will return itself. - - - - - Used to scale the entire canvas, while still making it fit the screen. Only applies with renderMode is Screen Space. - - - - - The normalized grid size that the canvas will split the renderable area into. - - - - - Unique ID of the Canvas' sorting layer. - - - - - Name of the Canvas' sorting layer. - - - - - Canvas' order within a sorting layer. - - - - - For Overlay mode, display index on which the UI canvas will appear. - - - - - Event that is called just before Canvas rendering happens. - - - - - - Camera used for sizing the Canvas when in Screen Space - Camera. Also used as the Camera that events will be sent through for a World Space [[Canvas]. - - - - - Force all canvases to update their content. - - - - - Returns the default material that can be used for rendering normal elements on the Canvas. - - - - - Returns the default material that can be used for rendering text elements on the Canvas. - - - - - Gets or generates the ETC1 Material. - - - The generated ETC1 Material from the Canvas. - - - - - A Canvas placable element that can be used to modify children Alpha, Raycasting, Enabled state. - - - - - Set the alpha of the group. - - - - - Does this group block raycasting (allow collision). - - - - - Should the group ignore parent groups? - - - - - Is the group interactable (are the elements beneath the group enabled). - - - - - Returns true if the Group allows raycasts. - - - - - - - A component that will render to the screen after all normal rendering has completed when attached to a Canvas. Designed for GUI application. - - - - - Depth of the renderer relative to the root canvas. - - - - - The clipping softness to apply to the renderer. - - - - - Indicates whether geometry emitted by this renderer is ignored. - - - - - Indicates whether geometry emitted by this renderer can be ignored when the vertex color alpha is close to zero for every vertex of the mesh. - - - - - True if any change has occured that would invalidate the positions of generated geometry. - - - - - Enable 'render stack' pop draw call. - - - - - True if rect clipping has been enabled on this renderer. -See Also: CanvasRenderer.EnableRectClipping, CanvasRenderer.DisableRectClipping. - - - - - Is the UIRenderer a mask component. - - - - - The number of materials usable by this renderer. - - - - - (Editor Only) Event that gets fired whenever the data in the CanvasRenderer gets invalidated and needs to be rebuilt. - - - - - - The number of materials usable by this renderer. Used internally for masking. - - - - - Depth of the renderer realative to the parent canvas. - - - - - Take the Vertex steam and split it corrisponding arrays (positions, colors, uv0s, uv1s, normals and tangents). - - The UIVertex list to split. - The destination list for the verts positions. - The destination list for the verts colors. - The destination list for the verts uv0s. - The destination list for the verts uv1s. - The destination list for the verts normals. - The destination list for the verts tangents. - - - - Remove all cached vertices. - - - - - Convert a set of vertex components into a stream of UIVertex. - - - - - Disables rectangle clipping for this CanvasRenderer. - - - - - Enables rect clipping on the CanvasRendered. Geometry outside of the specified rect will be clipped (not rendered). - - - - - - Get the current alpha of the renderer. - - - - - Get the current color of the renderer. - - - - - Get the final inherited alpha calculated by including all the parent alphas from included parent CanvasGroups. - - - The calculated inherited alpha. - - - - - Gets the current Material assigned to the CanvasRenderer. - - The material index to retrieve (0 if this parameter is omitted). - - Result. - - - - - Gets the current Material assigned to the CanvasRenderer. - - The material index to retrieve (0 if this parameter is omitted). - - Result. - - - - - Gets the current Material assigned to the CanvasRenderer. Used internally for masking. - - - - - - Set the alpha of the renderer. Will be multiplied with the UIVertex alpha and the Canvas alpha. - - Alpha. - - - - The Alpha Texture that will be passed to the Shader under the _AlphaTex property. - - The Texture to be passed. - - - - Set the color of the renderer. Will be multiplied with the UIVertex color and the Canvas color. - - Renderer multiply color. - - - - Set the material for the canvas renderer. If a texture is specified then it will be used as the 'MainTex' instead of the material's 'MainTex'. -See Also: CanvasRenderer.SetMaterialCount, CanvasRenderer.SetTexture. - - Material for rendering. - Material texture overide. - Material index. - - - - Set the material for the canvas renderer. If a texture is specified then it will be used as the 'MainTex' instead of the material's 'MainTex'. -See Also: CanvasRenderer.SetMaterialCount, CanvasRenderer.SetTexture. - - Material for rendering. - Material texture overide. - Material index. - - - - Sets the Mesh used by this renderer. Note the Mesh must be read/write enabled. - - - - - - Set the material for the canvas renderer. Used internally for masking. - - - - - - - Sets the texture used by this renderer's material. - - - - - - Set the vertices for the UIRenderer. - - Array of vertices to set. - Number of vertices to set. - - - - Set the vertices for the UIRenderer. - - Array of vertices to set. - Number of vertices to set. - - - - Given a list of UIVertex, split the stream into it's component types. - - - - - Use this struct to set up a capsule cast command that is performed asynchronously during a job. - - - - - The direction of the capsule cast. - - - - - The maximum distance the capsule cast checks for collision. - - - - - A LayerMask that selectively ignores Colliders when casting a capsule. - - - - - The center of the sphere at the start of the capsule. - - - - - The center of the sphere at the end of the capsule. - - - - - The radius of the capsule. - - - - - Creates a CapsulecastCommand. - - The center of the sphere at the start of the capsule. - The center of the sphere at the end of the capsule. - The radius of the capsule. - The direction of the capsule cast - The maximum length of the sweep. - The LayerMask that selectively ignores Colliders when casting a capsule. - - - - Schedules a batch of capsule casts which are performed in a job. - - A NaviveArray of CapsulecastCommands to perform. - A NavtiveArray of RaycastHit where the result of commands are stored. - The minimum number of jobs which should be performed in a single job. - A jobHandle of a job that must be completed before performing capsule casts. - - Returns a JobHandle of the job that will performs the capsule casts. - - - - - A capsule-shaped primitive collider. - - - - - The center of the capsule, measured in the object's local space. - - - - - The direction of the capsule. - - - - - The height of the capsule measured in the object's local space. - - - - - The radius of the sphere, measured in the object's local space. - - - - - A capsule-shaped primitive collider. - - - - - The direction that the capsule sides can extend. - - - - - The width and height of the capsule area. - - - - - The direction that the capsule sides can extend. - - - - - The capsule sides extend horizontally. - - - - - The capsule sides extend vertically. - - - - - A CharacterController allows you to easily do movement constrained by collisions without having to deal with a rigidbody. - - - - - The center of the character's capsule relative to the transform's position. - - - - - What part of the capsule collided with the environment during the last CharacterController.Move call. - - - - - Determines whether other rigidbodies or character controllers collide with this character controller (by default this is always enabled). - - - - - Enables or disables overlap recovery. - Enables or disables overlap recovery. Used to depenetrate character controllers from static objects when an overlap is detected. - - - - - The height of the character's capsule. - - - - - Was the CharacterController touching the ground during the last move? - - - - - Gets or sets the minimum move distance of the character controller. - - - - - The radius of the character's capsule. - - - - - The character's collision skin width. - - - - - The character controllers slope limit in degrees. - - - - - The character controllers step offset in meters. - - - - - The current relative velocity of the Character (see notes). - - - - - Supplies the movement of a GameObject with an attached CharacterController component. - - - - - - Moves the character with speed. - - - - - - Specification for how to render a character from the font texture. See Font.characterInfo. - - - - - The horizontal distance, rounded to the nearest integer, from the origin of this character to the origin of the next character. - - - - - The horizontal distance from the origin of this glyph to the begining of the glyph image. - - - - - Is the character flipped? - - - - - The height of the glyph image. - - - - - The width of the glyph image. - - - - - Unicode value of the character. - - - - - The maximum extend of the glyph image in the x-axis. - - - - - The maximum extend of the glyph image in the y-axis. - - - - - The minium extend of the glyph image in the x-axis. - - - - - The minimum extend of the glyph image in the y-axis. - - - - - The size of the character or 0 if it is the default font size. - - - - - The style of the character. - - - - - UV coordinates for the character in the texture. - - - - - The uv coordinate matching the bottom left of the glyph image in the font texture. - - - - - The uv coordinate matching the bottom right of the glyph image in the font texture. - - - - - The uv coordinate matching the top left of the glyph image in the font texture. - - - - - The uv coordinate matching the top right of the glyph image in the font texture. - - - - - Screen coordinates for the character in generated text meshes. - - - - - How far to advance between the beginning of this charcater and the next. - - - - - Character Joints are mainly used for Ragdoll effects. - - - - - Brings violated constraints back into alignment even when the solver fails. - - - - - The upper limit around the primary axis of the character joint. - - - - - The lower limit around the primary axis of the character joint. - - - - - Set the angular tolerance threshold (in degrees) for projection. - - - - - Set the linear tolerance threshold for projection. - - - - - The angular limit of rotation (in degrees) around the primary axis of the character joint. - - - - - The angular limit of rotation (in degrees) around the primary axis of the character joint. - - - - - The secondary axis around which the joint can rotate. - - - - - The configuration of the spring attached to the swing limits of the joint. - - - - - The configuration of the spring attached to the twist limits of the joint. - - - - - Collider for 2D physics representing an circle. - - - - - The center point of the collider in local space. - - - - - Radius of the circle. - - - - - The Cloth class provides an interface to cloth simulation physics. - - - - - Bending stiffness of the cloth. - - - - - An array of CapsuleColliders which this Cloth instance should collide with. - - - - - Number of cloth solver iterations per second. - - - - - The cloth skinning coefficients used to set up how the cloth interacts with the skinned mesh. - - - - - How much to increase mass of colliding particles. - - - - - Damp cloth motion. - - - - - Enable continuous collision to improve collision stability. - - - - - Is this cloth enabled? - - - - - A constant, external acceleration applied to the cloth. - - - - - The friction of the cloth when colliding with the character. - - - - - The current normals of the cloth object. - - - - - A random, external acceleration applied to the cloth. - - - - - Minimum distance at which two cloth particles repel each other (default: 0.0). - - - - - Self-collision stiffness defines how strong the separating impulse should be for colliding particles. - - - - - Cloth's sleep threshold. - - - - - An array of ClothSphereColliderPairs which this Cloth instance should collide with. - - - - - Sets the stiffness frequency parameter. - - - - - Stretching stiffness of the cloth. - - - - - Should gravity affect the cloth simulation? - - - - - Use Tether Anchors. - - - - - Add one virtual particle per triangle to improve collision stability. - - - - - The current vertex positions of the cloth object. - - - - - How much world-space acceleration of the character will affect cloth vertices. - - - - - How much world-space movement of the character will affect cloth vertices. - - - - - Clear the pending transform changes from affecting the cloth simulation. - - - - - Get list of particles to be used for self and inter collision. - - List to be populated with cloth particle indices that are used for self and/or inter collision. - - - - Get list of indices to be used when generating virtual particles. - - List to be populated with virtual particle indices. - - - - - Get weights to be used when generating virtual particles for cloth. - - List to populate with virtual particle weights. - - - - - Fade the cloth simulation in or out. - - Fading enabled or not. - - - - - This allows you to set the cloth indices used for self and inter collision. - - List of cloth particles indices to use for cloth self and/or inter collision. - - - - Set indices to use when generating virtual particles. - - List of cloth particle indices to use when generating virtual particles. - - - - - Sets weights to be used when generating virtual particles for cloth. - - List of weights to be used when setting virutal particles for cloth. - - - - The ClothSkinningCoefficient struct is used to set up how a Cloth component is allowed to move with respect to the SkinnedMeshRenderer it is attached to. - - - - - Definition of a sphere a vertex is not allowed to enter. This allows collision against the animated cloth. - - - - - Distance a vertex is allowed to travel from the skinned mesh vertex position. - - - - - A pair of SphereColliders used to define shapes for Cloth objects to collide against. - - - - - The first SphereCollider of a ClothSphereColliderPair. - - - - - The second SphereCollider of a ClothSphereColliderPair. - - - - - Creates a ClothSphereColliderPair. If only one SphereCollider is given, the ClothSphereColliderPair will define a simple sphere. If two SphereColliders are given, the ClothSphereColliderPair defines a conic capsule shape, composed of the two spheres and the cone connecting the two. - - The first SphereCollider of a ClothSphereColliderPair. - The second SphereCollider of a ClothSphereColliderPair. - - - - Creates a ClothSphereColliderPair. If only one SphereCollider is given, the ClothSphereColliderPair will define a simple sphere. If two SphereColliders are given, the ClothSphereColliderPair defines a conic capsule shape, composed of the two spheres and the cone connecting the two. - - The first SphereCollider of a ClothSphereColliderPair. - The second SphereCollider of a ClothSphereColliderPair. - - - - Interface for reading and writing inputs in a Unity Cluster. - - - - - Add a new VRPN input entry. - - Name of the input entry. This has to be unique. - Device name registered to VRPN server. - URL to the vrpn server. - Index of the Input entry, refer to vrpn.cfg if unsure. - Type of the input. - - True if the operation succeed. - - - - - Check the connection status of the device to the VRPN server it connected to. - - Name of the input entry. - - - - Edit an input entry which added via ClusterInput.AddInput. - - Name of the input entry. This has to be unique. - Device name registered to VRPN server. - URL to the vrpn server. - Index of the Input entry, refer to vrpn.cfg if unsure. - Type of the ClusterInputType as follow. - - - - Returns the axis value as a continous float. - - Name of input to poll.c. - - - - Returns the binary value of a button. - - Name of input to poll. - - - - Return the position of a tracker as a Vector3. - - Name of input to poll. - - - - Returns the rotation of a tracker as a Quaternion. - - Name of input to poll. - - - - Sets the axis value for this input. Only works for input typed Custom. - - Name of input to modify. - Value to set. - - - - Sets the button value for this input. Only works for input typed Custom. - - Name of input to modify. - Value to set. - - - - Sets the tracker position for this input. Only works for input typed Custom. - - Name of input to modify. - Value to set. - - - - Sets the tracker rotation for this input. Only works for input typed Custom. - - Name of input to modify. - Value to set. - - - - Values to determine the type of input value to be expect from one entry of ClusterInput. - - - - - Device is an analog axis that provides continuous value represented by a float. - - - - - Device that return a binary result of pressed or not pressed. - - - - - A user customized input. - - - - - Device that provide position and orientation values. - - - - - A helper class that contains static method to inquire status of Unity Cluster. - - - - - Check whether the current instance is disconnected from the cluster network. - - - - - Check whether the current instance is a master node in the cluster network. - - - - - To acquire or set the node index of the current machine from the cluster network. - - - - - A base class of all colliders. - - - - - The articulation body the collider is attached to. - - - - - The rigidbody the collider is attached to. - - - - - The world space bounding volume of the collider (Read Only). - - - - - Contact offset value of this collider. - - - - - Enabled Colliders will collide with other Colliders, disabled Colliders won't. - - - - - Is the collider a trigger? - - - - - The material used by the collider. - - - - - The shared physic material of this collider. - - - - - Returns a point on the collider that is closest to a given location. - - Location you want to find the closest point to. - - The point on the collider that is closest to the specified location. - - - - - The closest point to the bounding box of the attached collider. - - - - - - Casts a Ray that ignores all Colliders except this one. - - The starting point and direction of the ray. - If true is returned, hitInfo will contain more information about where the collider was hit. - The max length of the ray. - - True when the ray intersects the collider, otherwise false. - - - - - Parent class for collider types used with 2D gameplay. - - - - - The Rigidbody2D attached to the Collider2D. - - - - - Get the bounciness used by the collider. - - - - - The world space bounding area of the collider. - - - - - Get the CompositeCollider2D that is available to be attached to the collider. - - - - - The density of the collider used to calculate its mass (when auto mass is enabled). - - - - - Get the friction used by the collider. - - - - - Is this collider configured as a trigger? - - - - - The local offset of the collider geometry. - - - - - The number of separate shaped regions in the collider. - - - - - The PhysicsMaterial2D that is applied to this collider. - - - - - Sets whether the Collider will be used or not used by a CompositeCollider2D. - - - - - Whether the collider is used by an attached effector or not. - - - - - Casts the Collider shape into the Scene starting at the Collider position ignoring the Collider itself. - - Vector representing the direction to cast the shape. - Array to receive results. - Maximum distance over which to cast the shape. - Determines whether the cast should ignore Colliders attached to the same Rigidbody2D (known as sibling Colliders). - - The number of results returned. - - - - - Casts the Collider shape into the Scene starting at the Collider position ignoring the Collider itself. - - Vector representing the direction to cast the shape. - Filter results defined by the contact filter. - Array to receive results. - Maximum distance over which to cast the shape. - Determines whether the cast should ignore Colliders attached to the same Rigidbody2D (known as sibling Colliders). - - The number of results returned. - - - - - Casts the Collider shape into the Scene starting at the Collider position ignoring the Collider itself. - - Vector representing the direction to cast the shape. - Filter results defined by the contact filter. - List to receive results. - Maximum distance over which to cast the shape. - Determines whether the cast should ignore Colliders attached to the same Rigidbody2D (known as sibling Colliders). - - The number of results returned. - - - - - Returns a point on the perimeter of this Collider that is closest to the specified position. - - The position from which to find the closest point on this Collider. - - A point on the perimeter of this Collider that is closest to the specified position. - - - - - Creates a planar Mesh that is identical to the area defined by the Collider2D geometry. - - Should the mesh be transformed by the position of the attached Rigidbody2D? - Should the mesh be transformed by the rotation of the attached Rigidbody2D? - - The planar Mesh created that matches the collider geometry or NULL if no Mesh could be created. - - - - - Calculates the minimum separation of this collider against another collider. - - A collider used to calculate the minimum separation against this collider. - - The minimum separation of collider and this collider. - - - - - Retrieves all contact points for this Collider. - - An array of ContactPoint2D used to receive the results. - - Returns the number of contacts placed in the contacts array. - - - - - Retrieves all colliders in contact with this Collider. - - An array of Collider2D used to receive the results. - - Returns the number of contacts placed in the colliders array. - - - - - Retrieves all contact points for this Collider, with the results filtered by the contactFilter. - - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - An array of ContactPoint2D used to receive the results. - - Returns the number of contacts placed in the contacts array. - - - - - Retrieves all colliders in contact with this Collider, with the results filtered by the contactFilter. - - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - An array of Collider2D used to receive the results. - - Returns the number of colliders placed in the colliders array. - - - - - Retrieves all contact points for this Collider. - - A list of ContactPoint2D used to receive the results. - - Returns the number of contacts placed in the contacts list. - - - - - Retrieves all colliders in contact with this Collider. - - A list of Collider2D used to receive the results. - - Returns the number of contacts placed in the colliders list. - - - - - Retrieves all contact points for this Collider, with the results filtered by the contactFilter. - - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - A list of ContactPoint2D used to receive the results. - - Returns the number of contacts placed in the contacts list. - - - - - Retrieves all colliders in contact with this Collider, with the results filtered by the contactFilter. - - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - A list of Collider2D used to receive the results. - - Returns the number of contacts placed in the colliders list. - - - - - Generates a simple hash value based upon the geometry of the Collider2D. - - - A hash value that uniquely identifies the configured geometry of the Collider2D. - - - - - Check whether this collider is touching the collider or not. - - The collider to check if it is touching this collider. - - Whether this collider is touching the collider or not. - - - - - Check whether this collider is touching the collider or not with the results filtered by the contactFilter. - - The collider to check if it is touching this collider. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - - Whether this collider is touching the collider or not. - - - - - Check whether this collider is touching other colliders or not with the results filtered by the contactFilter. - - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - - Whether this collider is touching the collider or not. - - - - - Checks whether this collider is touching any colliders on the specified layerMask or not. - - Any colliders on any of these layers count as touching. - - Whether this collider is touching any collider on the specified layerMask or not. - - - - - Get a list of all colliders that overlap this collider. - - The contact filter used to filter the results differently, such as by layer mask, Z depth. Note that normal angle is not used for overlap testing. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - - Returns the number of results placed in the results array. - - - - - Get a list of all Colliders that overlap this Collider. - - The contact filter used to filter the results differently, such as by layer mask, Z depth. Note that normal angle is not used for overlap testing. - The list to receive results. - - Returns the number of results placed in the results list. - - - - - Check if a collider overlaps a point in space. - - A point in world space. - - Does point overlap the collider? - - - - - Casts a ray into the Scene that starts at the Collider position and ignores the Collider itself. - - Vector representing the direction of the ray. - Array to receive results. - Maximum distance over which to cast the ray. - Filter to check objects only on specific layers. - Only include objects with a Z coordinate (depth) greater than this value. - Only include objects with a Z coordinate (depth) less than this value. - Filter results defined by the contact filter. - - The number of results returned. - - - - - Casts a ray into the Scene that starts at the Collider position and ignores the Collider itself. - - Vector representing the direction of the ray. - Array to receive results. - Maximum distance over which to cast the ray. - Filter to check objects only on specific layers. - Only include objects with a Z coordinate (depth) greater than this value. - Only include objects with a Z coordinate (depth) less than this value. - Filter results defined by the contact filter. - - The number of results returned. - - - - - Casts a ray into the Scene that starts at the Collider position and ignores the Collider itself. - - Vector representing the direction of the ray. - Filter results defined by the contact filter. - List to receive results. - Maximum distance over which to cast the ray. - - The number of results returned. - - - - - Represents the separation or overlap of two Collider2D. - - - - - Gets the distance between two colliders. - - - - - Gets whether the distance represents an overlap or not. - - - - - Gets whether the distance is valid or not. - - - - - A normalized vector that points from pointB to pointA. - - - - - A point on a Collider2D that is a specific distance away from pointB. - - - - - A point on a Collider2D that is a specific distance away from pointA. - - - - - Describes a collision. - - - - - The Collider we hit (Read Only). - - - - - Gets the number of contacts for this collision. - - - - - The contact points generated by the physics engine. You should avoid using this as it produces memory garbage. Use GetContact or GetContacts instead. - - - - - The GameObject whose collider you are colliding with. (Read Only). - - - - - The total impulse applied to this contact pair to resolve the collision. - - - - - The relative linear velocity of the two colliding objects (Read Only). - - - - - The Rigidbody we hit (Read Only). This is null if the object we hit is a collider with no rigidbody attached. - - - - - The Transform of the object we hit (Read Only). - - - - - Gets the contact point at the specified index. - - The index of the contact to retrieve. - - The contact at the specified index. - - - - - Retrieves all contact points for this collision. - - An array of ContactPoint used to receive the results. - - Returns the number of contacts placed in the contacts array. - - - - - Retrieves all contact points for this collision. - - A list of ContactPoint used to receive the results. - - Returns the number of contacts placed in the contacts list. - - - - - Collision details returned by 2D physics callback functions. - - - - - The incoming Collider2D involved in the collision with the otherCollider. - - - - - Gets the number of contacts for this collision. - - - - - The specific points of contact with the incoming Collider2D. You should avoid using this as it produces memory garbage. Use GetContact or GetContacts instead. - - - - - Indicates whether the collision response or reaction is enabled or disabled. - - - - - The incoming GameObject involved in the collision. - - - - - The other Collider2D involved in the collision with the collider. - - - - - The other Rigidbody2D involved in the collision with the rigidbody. - - - - - The relative linear velocity of the two colliding objects (Read Only). - - - - - The incoming Rigidbody2D involved in the collision with the otherRigidbody. - - - - - The Transform of the incoming object involved in the collision. - - - - - Gets the contact point at the specified index. - - The index of the contact to retrieve. - - The contact at the specified index. - - - - - Retrieves all contact points for contacts between collider and otherCollider. - - An array of ContactPoint2D used to receive the results. - - Returns the number of contacts placed in the contacts array. - - - - - Retrieves all contact points for contacts between collider and otherCollider. - - A list of ContactPoint2D used to receive the results. - - Returns the number of contacts placed in the contacts list. - - - - - The collision detection mode constants used for Rigidbody.collisionDetectionMode. - - - - - Continuous collision detection is on for colliding with static mesh geometry. - - - - - Continuous collision detection is on for colliding with static and dynamic geometry. - - - - - Speculative continuous collision detection is on for static and dynamic geometries - - - - - Continuous collision detection is off for this Rigidbody. - - - - - Controls how collisions are detected when a Rigidbody2D moves. - - - - - Ensures that all collisions are detected when a Rigidbody2D moves. - - - - - When a Rigidbody2D moves, only collisions at the new position are detected. - - - - - This mode is obsolete. You should use Discrete mode. - - - - - CollisionFlags is a bitmask returned by CharacterController.Move. - - - - - CollisionFlags is a bitmask returned by CharacterController.Move. - - - - - CollisionFlags is a bitmask returned by CharacterController.Move. - - - - - CollisionFlags is a bitmask returned by CharacterController.Move. - - - - - CollisionFlags is a bitmask returned by CharacterController.Move. - - - - - Representation of RGBA colors. - - - - - Alpha component of the color (0 is transparent, 1 is opaque). - - - - - Blue component of the color. - - - - - Solid black. RGBA is (0, 0, 0, 1). - - - - - Solid blue. RGBA is (0, 0, 1, 1). - - - - - Completely transparent. RGBA is (0, 0, 0, 0). - - - - - Cyan. RGBA is (0, 1, 1, 1). - - - - - Green component of the color. - - - - - A version of the color that has had the gamma curve applied. - - - - - Gray. RGBA is (0.5, 0.5, 0.5, 1). - - - - - The grayscale value of the color. (Read Only) - - - - - Solid green. RGBA is (0, 1, 0, 1). - - - - - English spelling for gray. RGBA is the same (0.5, 0.5, 0.5, 1). - - - - - A linear value of an sRGB color. - - - - - Magenta. RGBA is (1, 0, 1, 1). - - - - - Returns the maximum color component value: Max(r,g,b). - - - - - Red component of the color. - - - - - Solid red. RGBA is (1, 0, 0, 1). - - - - - Solid white. RGBA is (1, 1, 1, 1). - - - - - Yellow. RGBA is (1, 0.92, 0.016, 1), but the color is nice to look at! - - - - - Constructs a new Color with given r,g,b,a components. - - Red component. - Green component. - Blue component. - Alpha component. - - - - Constructs a new Color with given r,g,b components and sets a to 1. - - Red component. - Green component. - Blue component. - - - - Creates an RGB colour from HSV input. - - Hue [0..1]. - Saturation [0..1]. - Brightness value [0..1]. - Output HDR colours. If true, the returned colour will not be clamped to [0..1]. - - An opaque colour with HSV matching the input. - - - - - Creates an RGB colour from HSV input. - - Hue [0..1]. - Saturation [0..1]. - Brightness value [0..1]. - Output HDR colours. If true, the returned colour will not be clamped to [0..1]. - - An opaque colour with HSV matching the input. - - - - - Colors can be implicitly converted to and from Vector4. - - - - - - Colors can be implicitly converted to and from Vector4. - - - - - - Linearly interpolates between colors a and b by t. - - Color a. - Color b. - Float for combining a and b. - - - - Linearly interpolates between colors a and b by t. - - - - - - - - Divides color a by the float b. Each color component is scaled separately. - - - - - - - Subtracts color b from color a. Each component is subtracted separately. - - - - - - - Multiplies two colors together. Each component is multiplied separately. - - - - - - - Multiplies color a by the float b. Each color component is scaled separately. - - - - - - - Multiplies color a by the float b. Each color component is scaled separately. - - - - - - - Adds two colors together. Each component is added separately. - - - - - - - Calculates the hue, saturation and value of an RGB input color. - - An input color. - Output variable for hue. - Output variable for saturation. - Output variable for value. - - - - Access the r, g, b,a components using [0], [1], [2], [3] respectively. - - - - - Returns a formatted string of this color. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Returns a formatted string of this color. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Returns a formatted string of this color. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Representation of RGBA colors in 32 bit format. - - - - - Alpha component of the color. - - - - - Blue component of the color. - - - - - Green component of the color. - - - - - Red component of the color. - - - - - Constructs a new Color32 with given r, g, b, a components. - - - - - - - - - Color32 can be implicitly converted to and from Color. - - - - - - Color32 can be implicitly converted to and from Color. - - - - - - Linearly interpolates between colors a and b by t. - - - - - - - - Linearly interpolates between colors a and b by t. - - - - - - - - Access the red (r), green (g), blue (b), and alpha (a) color components using [0], [1], [2], [3] respectively. - - - - - Returns a formatted string for this color. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Returns a formatted string for this color. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Returns a formatted string for this color. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Represents a color gamut. - - - - - sRGB color gamut. - - - - - Display-P3 color gamut. - - - - - DolbyHDR high dynamic range color gamut. - - - - - HDR10 high dynamic range color gamut. - - - - - Rec. 2020 color gamut. - - - - - Rec. 709 color gamut. - - - - - Color space for player settings. - - - - - Gamma color space. - - - - - Linear color space. - - - - - Uninitialized color space. - - - - - Attribute used to configure the usage of the ColorField and Color Picker for a color. - - - - - If set to true the Color is treated as a HDR color. - - - - - Maximum allowed HDR color component value when using the HDR Color Picker. - - - - - Maximum exposure value allowed in the HDR Color Picker. - - - - - Minimum allowed HDR color component value when using the Color Picker. - - - - - Minimum exposure value allowed in the HDR Color Picker. - - - - - If false then the alpha bar is hidden in the ColorField and the alpha value is not shown in the Color Picker. - - - - - Attribute for Color fields. Used for configuring the GUI for the color. - - If false then the alpha channel info is hidden both in the ColorField and in the Color Picker. - Set to true if the color should be treated as a HDR color (default value: false). - Minimum allowed HDR color component value when using the HDR Color Picker (default value: 0). - Maximum allowed HDR color component value when using the HDR Color Picker (default value: 8). - Minimum exposure value allowed in the HDR Color Picker (default value: 1/8 = 0.125). - Maximum exposure value allowed in the HDR Color Picker (default value: 3). - - - - Attribute for Color fields. Used for configuring the GUI for the color. - - If false then the alpha channel info is hidden both in the ColorField and in the Color Picker. - Set to true if the color should be treated as a HDR color (default value: false). - Minimum allowed HDR color component value when using the HDR Color Picker (default value: 0). - Maximum allowed HDR color component value when using the HDR Color Picker (default value: 8). - Minimum exposure value allowed in the HDR Color Picker (default value: 1/8 = 0.125). - Maximum exposure value allowed in the HDR Color Picker (default value: 3). - - - - Attribute for Color fields. Used for configuring the GUI for the color. - - If false then the alpha channel info is hidden both in the ColorField and in the Color Picker. - Set to true if the color should be treated as a HDR color (default value: false). - Minimum allowed HDR color component value when using the HDR Color Picker (default value: 0). - Maximum allowed HDR color component value when using the HDR Color Picker (default value: 8). - Minimum exposure value allowed in the HDR Color Picker (default value: 1/8 = 0.125). - Maximum exposure value allowed in the HDR Color Picker (default value: 3). - - - - A collection of common color functions. - - - - - Returns the color as a hexadecimal string in the format "RRGGBB". - - The color to be converted. - - Hexadecimal string representing the color. - - - - - Returns the color as a hexadecimal string in the format "RRGGBBAA". - - The color to be converted. - - Hexadecimal string representing the color. - - - - - Attempts to convert a html color string. - - Case insensitive html string to be converted into a color. - The converted color. - - True if the string was successfully converted else false. - - - - - Struct used to describe meshes to be combined using Mesh.CombineMeshes. - - - - - The baked lightmap UV scale and offset applied to the Mesh. - - - - - Mesh to combine. - - - - - The realtime lightmap UV scale and offset applied to the Mesh. - - - - - Sub-Mesh index of the Mesh. - - - - - Matrix to transform the Mesh with before combining. - - - - - Interface into compass functionality. - - - - - Used to enable or disable compass. Note, that if you want Input.compass.trueHeading property to contain a valid value, you must also enable location updates by calling Input.location.Start(). - - - - - Accuracy of heading reading in degrees. - - - - - The heading in degrees relative to the magnetic North Pole. (Read Only) - - - - - The raw geomagnetic data measured in microteslas. (Read Only) - - - - - Timestamp (in seconds since 1970) when the heading was last time updated. (Read Only) - - - - - The heading in degrees relative to the geographic North Pole. (Read Only) - - - - - Base class for everything attached to GameObjects. - - - - - The Animation attached to this GameObject. (Null if there is none attached). - - - - - The AudioSource attached to this GameObject. (Null if there is none attached). - - - - - The Camera attached to this GameObject. (Null if there is none attached). - - - - - The Collider attached to this GameObject. (Null if there is none attached). - - - - - The Collider2D component attached to the object. - - - - - The ConstantForce attached to this GameObject. (Null if there is none attached). - - - - - The game object this component is attached to. A component is always attached to a game object. - - - - - The HingeJoint attached to this GameObject. (Null if there is none attached). - - - - - The Light attached to this GameObject. (Null if there is none attached). - - - - - The NetworkView attached to this GameObject (Read Only). (null if there is none attached). - - - - - The ParticleSystem attached to this GameObject. (Null if there is none attached). - - - - - The Renderer attached to this GameObject. (Null if there is none attached). - - - - - The Rigidbody attached to this GameObject. (Null if there is none attached). - - - - - The Rigidbody2D that is attached to the Component's GameObject. - - - - - The tag of this game object. - - - - - The Transform attached to this GameObject. - - - - - Calls the method named methodName on every MonoBehaviour in this game object or any of its children. - - Name of the method to call. - Optional parameter to pass to the method (can be any value). - Should an error be raised if the method does not exist for a given target object? - - - - Calls the method named methodName on every MonoBehaviour in this game object or any of its children. - - Name of the method to call. - Optional parameter to pass to the method (can be any value). - Should an error be raised if the method does not exist for a given target object? - - - - Calls the method named methodName on every MonoBehaviour in this game object or any of its children. - - Name of the method to call. - Optional parameter to pass to the method (can be any value). - Should an error be raised if the method does not exist for a given target object? - - - - Calls the method named methodName on every MonoBehaviour in this game object or any of its children. - - Name of the method to call. - Optional parameter to pass to the method (can be any value). - Should an error be raised if the method does not exist for a given target object? - - - - Is this game object tagged with tag ? - - The tag to compare. - - - - Returns the component of Type type if the GameObject has one attached, null if it doesn't. Will also return disabled components. - - The type of Component to retrieve. - - - - Generic version of this method. - - - - - Returns the component with name type if the GameObject has one attached, null if it doesn't. - - - - - - Returns the component of Type type in the GameObject or any of its children using depth first search. - - The type of Component to retrieve. - - A component of the matching type, if found. - - - - - Generic version of this method. - - - - A component of the matching type, if found. - - - - - Returns the component of Type type in the GameObject or any of its parents. - - The type of Component to retrieve. - - A component of the matching type, if found. - - - - - Generic version of this method. - - - A component of the matching type, if found. - - - - - Returns all components of Type type in the GameObject. - - The type of Component to retrieve. - - - - Generic version of this method. - - - - - Returns all components of Type type in the GameObject or any of its children. - - The type of Component to retrieve. - Should Components on inactive GameObjects be included in the found set? includeInactive decides which children of the GameObject will be searched. The GameObject that you call GetComponentsInChildren on is always searched regardless. - - - - Returns all components of Type type in the GameObject or any of its children. - - The type of Component to retrieve. - Should Components on inactive GameObjects be included in the found set? includeInactive decides which children of the GameObject will be searched. The GameObject that you call GetComponentsInChildren on is always searched regardless. - - - - Generic version of this method. - - Should Components on inactive GameObjects be included in the found set? includeInactive decides which children of the GameObject will be searched. The GameObject that you call GetComponentsInChildren on is always searched regardless. - - A list of all found components matching the specified type. - - - - - Generic version of this method. - - - A list of all found components matching the specified type. - - - - - Returns all components of Type type in the GameObject or any of its parents. - - The type of Component to retrieve. - Should inactive Components be included in the found set? - - - - Generic version of this method. - - Should inactive Components be included in the found set? - - - - Generic version of this method. - - Should inactive Components be included in the found set? - - - - Calls the method named methodName on every MonoBehaviour in this game object. - - Name of the method to call. - Optional parameter for the method. - Should an error be raised if the target object doesn't implement the method for the message? - - - - Calls the method named methodName on every MonoBehaviour in this game object. - - Name of the method to call. - Optional parameter for the method. - Should an error be raised if the target object doesn't implement the method for the message? - - - - Calls the method named methodName on every MonoBehaviour in this game object. - - Name of the method to call. - Optional parameter for the method. - Should an error be raised if the target object doesn't implement the method for the message? - - - - Calls the method named methodName on every MonoBehaviour in this game object. - - Name of the method to call. - Optional parameter for the method. - Should an error be raised if the target object doesn't implement the method for the message? - - - - Calls the method named methodName on every MonoBehaviour in this game object and on every ancestor of the behaviour. - - Name of method to call. - Optional parameter value for the method. - Should an error be raised if the method does not exist on the target object? - - - - Calls the method named methodName on every MonoBehaviour in this game object and on every ancestor of the behaviour. - - Name of method to call. - Optional parameter value for the method. - Should an error be raised if the method does not exist on the target object? - - - - Calls the method named methodName on every MonoBehaviour in this game object and on every ancestor of the behaviour. - - Name of method to call. - Optional parameter value for the method. - Should an error be raised if the method does not exist on the target object? - - - - Calls the method named methodName on every MonoBehaviour in this game object and on every ancestor of the behaviour. - - Name of method to call. - Optional parameter value for the method. - Should an error be raised if the method does not exist on the target object? - - - - Gets the component of the specified type, if it exists. - - The type of the component to retrieve. - The output argument that will contain the component or null. - - Returns true if the component is found, false otherwise. - - - - - Gets the component of the specified type, if it exists. - - The type of the component to retrieve. - The output argument that will contain the component or null. - - Returns true if the component is found, false otherwise. - - - - - A Collider that can merge other Colliders together. - - - - - Controls the radius of all edges created by the Collider. - - - - - Specifies when to generate the Composite Collider geometry. - - - - - Specifies the type of geometry the Composite Collider should generate. - - - - - Vertices are offset by this distance when compositing multiple physic shapes. Any vertices between shapes within this distance are combined. - - - - - The number of paths in the Collider. - - - - - Gets the total number of points in all the paths within the Collider. - - - - - Controls the minimum distance allowed between generated vertices. - - - - - Regenerates the Composite Collider geometry. - - - - - Specifies when to generate the Composite Collider geometry. - - - - - Sets the Composite Collider geometry to not automatically update when a Collider used by the Composite Collider changes. - - - - - Sets the Composite Collider geometry to update synchronously immediately when a Collider used by the Composite Collider changes. - - - - - Specifies the type of geometry the Composite Collider generates. - - - - - Sets the Composite Collider to generate closed outlines for the merged Collider geometry consisting of only edges. - - - - - Sets the Composite Collider to generate closed outlines for the merged Collider geometry consisting of convex polygon shapes. - - - - - Gets a path from the Collider by its index. - - The index of the path from 0 to pathCount minus 1. - An ordered array of the vertices (points) in the selected path. - - Returns the number of points placed in the points array. - - - - - Gets a path from the Collider by its index. - - The index of the path from 0 to pathCount minus 1. - An ordered list of the vertices (points) in the selected path. - - Returns the number of points placed in the points list. - - - - - Gets the number of points in the specified path from the Collider by its index. - - The index of the path from 0 to pathCount minus 1. - - Returns the number of points in the path specified by index. - - - - - Compression Levels relate to how much time should be spent compressing Assets into an Asset Bundle. - - - - - No compression. - - - - - Compression Method for Asset Bundles. - - - - - LZ4 compression results in larger compressed files than LZMA, but does not require the entire bundle to be decompressed before use. - - - - - LZ4HC is a high compression variant of LZ4. LZ4HC compression results in larger compressed files than LZMA, but does not require the entire bundle to be decompressed before use. - - - - - LZMA compression results in smaller compressed Asset Bundles but they must be entirely decompressed before use. - - - - - Uncompressed Asset Bundles are larger than compressed Asset Bundles, but they are the fastest to access once downloaded. - - - - - GPU data buffer, mostly for use with compute shaders. - - - - - Number of elements in the buffer (Read Only). - - - - - The debug label for the ComputeBuffer. This name shows up in profiling and frame debugger tools, wherever supported. - - - - - Size of one element in the buffer (Read Only). - - - - - Begins a write operation to the buffer - - Offset in number of elements to which the write operation will occur - Maximum number of elements which will be written - - A NativeArray of size count - - - - - Copy counter value of append/consume buffer into another buffer. - - Append/consume buffer to copy the counter from. - A buffer to copy the counter to. - Target byte offset in dst. - - - - Create a Compute Buffer. - - Number of elements in the buffer. - Size of one element in the buffer. Has to match size of buffer type in the shader. See for cross-platform compatibility information. - Type of the buffer, default is ComputeBufferType.Default (structured buffer). - - - - Create a Compute Buffer. - - Number of elements in the buffer. - Size of one element in the buffer. Has to match size of buffer type in the shader. See for cross-platform compatibility information. - Type of the buffer, default is ComputeBufferType.Default (structured buffer). - - - - Ends a write operation to the buffer - - Number of elements written to the buffer. Counted from the first element. - - - - Read data values from the buffer into an array. The array can only use <a href="https:docs.microsoft.comen-usdotnetframeworkinteropblittable-and-non-blittable-types">blittable<a> types. - - An array to receive the data. - - - - Partial read of data values from the buffer into an array. - - An array to receive the data. - The first element index in data where retrieved elements are copied. - The first element index of the compute buffer from which elements are read. - The number of elements to retrieve. - - - - Retrieve a native (underlying graphics API) pointer to the buffer. - - - Pointer to the underlying graphics API buffer. - - - - - Returns true if this compute buffer is valid and false otherwise. - - - - - Release a Compute Buffer. - - - - - Sets counter value of append/consume buffer. - - Value of the append/consume counter. - - - - Set the buffer with values from an array. - - Array of values to fill the buffer. - - - - Set the buffer with values from an array. - - Array of values to fill the buffer. - - - - Set the buffer with values from an array. - - Array of values to fill the buffer. - - - - Partial copy of data values from an array into the buffer. - - Array of values to fill the buffer. - The first element index in data to copy to the compute buffer. - The first element index in compute buffer to receive the data. - The number of elements to copy. - - - - - Partial copy of data values from an array into the buffer. - - Array of values to fill the buffer. - The first element index in data to copy to the compute buffer. - The first element index in compute buffer to receive the data. - The number of elements to copy. - - - - - Partial copy of data values from an array into the buffer. - - Array of values to fill the buffer. - The first element index in data to copy to the compute buffer. - The first element index in compute buffer to receive the data. - The number of elements to copy. - - - - - Intended usage of the buffer. - - - - - Legacy mode, do not use. - - - - - Dynamic buffer. - - - - - Static buffer, only initial upload allowed by the CPU - - - - - Stream Out / Transform Feedback output buffer. Internal use only. - - - - - Dynamic, unsynchronized access to the buffer. - - - - - ComputeBuffer type. - - - - - Append-consume ComputeBuffer type. - - - - - ComputeBuffer that you can use as a constant buffer (uniform buffer). - - - - - ComputeBuffer with a counter. - - - - - Default ComputeBuffer type (structured buffer). - - - - - ComputeBuffer used for Graphics.DrawProceduralIndirect, ComputeShader.DispatchIndirect or Graphics.DrawMeshInstancedIndirect arguments. - - - - - Raw ComputeBuffer type (byte address buffer). - - - - - ComputeBuffer that you can use as a structured buffer. - - - - - Compute Shader asset. - - - - - Array of locally enabled shader keywords. - - - - - Disables a locally set Shader keyword. - - - - - - Execute a compute shader. - - Which kernel to execute. A single compute shader asset can have multiple kernel entry points. - Number of work groups in the X dimension. - Number of work groups in the Y dimension. - Number of work groups in the Z dimension. - - - - Execute a compute shader. - - Which kernel to execute. A single compute shader asset can have multiple kernel entry points. - Buffer with dispatch arguments. - The byte offset into the buffer, where the draw arguments start. - - - - Execute a compute shader. - - Which kernel to execute. A single compute shader asset can have multiple kernel entry points. - Buffer with dispatch arguments. - The byte offset into the buffer, where the draw arguments start. - - - - Sets a Shader keyword locally for this Compute Shader. - - - - - - Find ComputeShader kernel index. - - Name of kernel function. - - The Kernel index, or logs a "FindKernel failed" error message if the kernel is not found. - - - - - Get kernel thread group sizes. - - Which kernel to query. A single compute shader asset can have multiple kernel entry points. - Thread group size in the X dimension. - Thread group size in the Y dimension. - Thread group size in the Z dimension. - - - - Checks whether a shader contains a given kernel. - - The name of the kernel to look for. - - True if the kernel is found, false otherwise. - - - - - Specifies whether the Shader keyword is enabled in this Compute Shader. - - - - - - Set a bool parameter. - - Variable name in shader code. - Property name ID, use Shader.PropertyToID to get it. - Value to set. - - - - Set a bool parameter. - - Variable name in shader code. - Property name ID, use Shader.PropertyToID to get it. - Value to set. - - - - Sets an input or output compute buffer. - - For which kernel the buffer is being set. See FindKernel. - Property name ID, use Shader.PropertyToID to get it. - Name of the buffer variable in shader code. - Buffer to set. - - - - Sets an input or output compute buffer. - - For which kernel the buffer is being set. See FindKernel. - Property name ID, use Shader.PropertyToID to get it. - Name of the buffer variable in shader code. - Buffer to set. - - - - Sets an input or output compute buffer. - - For which kernel the buffer is being set. See FindKernel. - Property name ID, use Shader.PropertyToID to get it. - Name of the buffer variable in shader code. - Buffer to set. - - - - Sets an input or output compute buffer. - - For which kernel the buffer is being set. See FindKernel. - Property name ID, use Shader.PropertyToID to get it. - Name of the buffer variable in shader code. - Buffer to set. - - - - Sets a ComputeBuffer or a GraphicsBuffer as a named constant buffer for the ComputeShader. - - The ID of the property name for the constant buffer in shader code. Use Shader.PropertyToID to get this ID. - The name of the buffer to bind as constant buffer. - The buffer to bind as constant buffer. - The offset in bytes from the beginning of the ComputeBuffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0. - The number of bytes to bind. - - - - Sets a ComputeBuffer or a GraphicsBuffer as a named constant buffer for the ComputeShader. - - The ID of the property name for the constant buffer in shader code. Use Shader.PropertyToID to get this ID. - The name of the buffer to bind as constant buffer. - The buffer to bind as constant buffer. - The offset in bytes from the beginning of the ComputeBuffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0. - The number of bytes to bind. - - - - Sets a ComputeBuffer or a GraphicsBuffer as a named constant buffer for the ComputeShader. - - The ID of the property name for the constant buffer in shader code. Use Shader.PropertyToID to get this ID. - The name of the buffer to bind as constant buffer. - The buffer to bind as constant buffer. - The offset in bytes from the beginning of the ComputeBuffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0. - The number of bytes to bind. - - - - Sets a ComputeBuffer or a GraphicsBuffer as a named constant buffer for the ComputeShader. - - The ID of the property name for the constant buffer in shader code. Use Shader.PropertyToID to get this ID. - The name of the buffer to bind as constant buffer. - The buffer to bind as constant buffer. - The offset in bytes from the beginning of the ComputeBuffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0. - The number of bytes to bind. - - - - Set a float parameter. - - Variable name in shader code. - Property name ID, use Shader.PropertyToID to get it. - Value to set. - - - - Set a float parameter. - - Variable name in shader code. - Property name ID, use Shader.PropertyToID to get it. - Value to set. - - - - Set multiple consecutive float parameters at once. - - Array variable name in the shader code. - Property name ID, use Shader.PropertyToID to get it. - Value array to set. - - - - Set multiple consecutive float parameters at once. - - Array variable name in the shader code. - Property name ID, use Shader.PropertyToID to get it. - Value array to set. - - - - Set an integer parameter. - - Variable name in shader code. - Property name ID, use Shader.PropertyToID to get it. - Value to set. - - - - Set an integer parameter. - - Variable name in shader code. - Property name ID, use Shader.PropertyToID to get it. - Value to set. - - - - Set multiple consecutive integer parameters at once. - - Array variable name in the shader code. - Property name ID, use Shader.PropertyToID to get it. - Value array to set. - - - - Set multiple consecutive integer parameters at once. - - Array variable name in the shader code. - Property name ID, use Shader.PropertyToID to get it. - Value array to set. - - - - Set a Matrix parameter. - - Variable name in shader code. - Property name ID, use Shader.PropertyToID to get it. - Value to set. - - - - Set a Matrix parameter. - - Variable name in shader code. - Property name ID, use Shader.PropertyToID to get it. - Value to set. - - - - Set a Matrix array parameter. - - Variable name in shader code. - Property name ID, use Shader.PropertyToID to get it. - Value to set. - - - - Set a Matrix array parameter. - - Variable name in shader code. - Property name ID, use Shader.PropertyToID to get it. - Value to set. - - - - Set a texture parameter. - - For which kernel the texture is being set. See FindKernel. - Property name ID, use Shader.PropertyToID to get it. - Name of the buffer variable in shader code. - Texture to set. - Optional mipmap level of the read-write texture. - Optional parameter that specifies the type of data to set from the RenderTexture. - - - - Set a texture parameter. - - For which kernel the texture is being set. See FindKernel. - Property name ID, use Shader.PropertyToID to get it. - Name of the buffer variable in shader code. - Texture to set. - Optional mipmap level of the read-write texture. - Optional parameter that specifies the type of data to set from the RenderTexture. - - - - Set a texture parameter. - - For which kernel the texture is being set. See FindKernel. - Property name ID, use Shader.PropertyToID to get it. - Name of the buffer variable in shader code. - Texture to set. - Optional mipmap level of the read-write texture. - Optional parameter that specifies the type of data to set from the RenderTexture. - - - - Set a texture parameter. - - For which kernel the texture is being set. See FindKernel. - Property name ID, use Shader.PropertyToID to get it. - Name of the buffer variable in shader code. - Texture to set. - Optional mipmap level of the read-write texture. - Optional parameter that specifies the type of data to set from the RenderTexture. - - - - Set a texture parameter. - - For which kernel the texture is being set. See FindKernel. - Property name ID, use Shader.PropertyToID to get it. - Name of the buffer variable in shader code. - Texture to set. - Optional mipmap level of the read-write texture. - Optional parameter that specifies the type of data to set from the RenderTexture. - - - - Set a texture parameter. - - For which kernel the texture is being set. See FindKernel. - Property name ID, use Shader.PropertyToID to get it. - Name of the buffer variable in shader code. - Texture to set. - Optional mipmap level of the read-write texture. - Optional parameter that specifies the type of data to set from the RenderTexture. - - - - Set a texture parameter from a global texture property. - - For which kernel the texture is being set. See FindKernel. - Property name ID, use Shader.PropertyToID to get it. - Name of the buffer variable in shader code. - Global texture property to assign to shader. - Property name ID, use Shader.PropertyToID to get it. - - - - Set a texture parameter from a global texture property. - - For which kernel the texture is being set. See FindKernel. - Property name ID, use Shader.PropertyToID to get it. - Name of the buffer variable in shader code. - Global texture property to assign to shader. - Property name ID, use Shader.PropertyToID to get it. - - - - Set a vector parameter. - - Variable name in shader code. - Property name ID, use Shader.PropertyToID to get it. - Value to set. - - - - Set a vector parameter. - - Variable name in shader code. - Property name ID, use Shader.PropertyToID to get it. - Value to set. - - - - Set a vector array parameter. - - Variable name in shader code. - Property name ID, use Shader.PropertyToID to get it. - Value to set. - - - - Set a vector array parameter. - - Variable name in shader code. - Property name ID, use Shader.PropertyToID to get it. - Value to set. - - - - The configurable joint is an extremely flexible joint giving you complete control over rotation and linear motion. - - - - - Definition of how the joint's rotation will behave around its local X axis. Only used if Rotation Drive Mode is Swing & Twist. - - - - - The configuration of the spring attached to the angular X limit of the joint. - - - - - Allow rotation around the X axis to be Free, completely Locked, or Limited according to Low and High Angular XLimit. - - - - - Boundary defining rotation restriction, based on delta from original rotation. - - - - - Allow rotation around the Y axis to be Free, completely Locked, or Limited according to Angular YLimit. - - - - - Definition of how the joint's rotation will behave around its local Y and Z axes. Only used if Rotation Drive Mode is Swing & Twist. - - - - - The configuration of the spring attached to the angular Y and angular Z limits of the joint. - - - - - Boundary defining rotation restriction, based on delta from original rotation. - - - - - Allow rotation around the Z axis to be Free, completely Locked, or Limited according to Angular ZLimit. - - - - - If enabled, all Target values will be calculated in world space instead of the object's local space. - - - - - Boundary defining upper rotation restriction, based on delta from original rotation. - - - - - Boundary defining movement restriction, based on distance from the joint's origin. - - - - - The configuration of the spring attached to the linear limit of the joint. - - - - - Boundary defining lower rotation restriction, based on delta from original rotation. - - - - - Set the angular tolerance threshold (in degrees) for projection. - -If the joint deviates by more than this angle around its locked angular degrees of freedom, -the solver will move the bodies to close the angle. - -Setting a very small tolerance may result in simulation jitter or other artifacts. - -Sometimes it is not possible to project (for example when the joints form a cycle). - - - - - Set the linear tolerance threshold for projection. - -If the joint separates by more than this distance along its locked degrees of freedom, the solver -will move the bodies to close the distance. - -Setting a very small tolerance may result in simulation jitter or other artifacts. - -Sometimes it is not possible to project (for example when the joints form a cycle). - - - - - Brings violated constraints back into alignment even when the solver fails. Projection is not a physical process and does not preserve momentum or respect collision geometry. It is best avoided if practical, but can be useful in improving simulation quality where joint separation results in unacceptable artifacts. - - - - - Control the object's rotation with either X & YZ or Slerp Drive by itself. - - - - - The joint's secondary axis. - - - - - Definition of how the joint's rotation will behave around all local axes. Only used if Rotation Drive Mode is Slerp Only. - - - - - Enable this property to swap the order in which the physics engine processes the Rigidbodies involved in the joint. This results in different joint motion but has no impact on Rigidbodies and anchors. - - - - - This is a Vector3. It defines the desired angular velocity that the joint should rotate into. - - - - - The desired position that the joint should move into. - - - - - This is a Quaternion. It defines the desired rotation that the joint should rotate into. - - - - - The desired velocity that the joint should move along. - - - - - Definition of how the joint's movement will behave along its local X axis. - - - - - Allow movement along the X axis to be Free, completely Locked, or Limited according to Linear Limit. - - - - - Definition of how the joint's movement will behave along its local Y axis. - - - - - Allow movement along the Y axis to be Free, completely Locked, or Limited according to Linear Limit. - - - - - Definition of how the joint's movement will behave along its local Z axis. - - - - - Allow movement along the Z axis to be Free, completely Locked, or Limited according to Linear Limit. - - - - - Constrains movement for a ConfigurableJoint along the 6 axes. - - - - - Motion along the axis will be completely free and completely unconstrained. - - - - - Motion along the axis will be limited by the respective limit. - - - - - Motion along the axis will be locked. - - - - - The various test results the connection tester may return with. - - - - - A force applied constantly. - - - - - The force applied to the rigidbody every frame. - - - - - The force - relative to the rigid bodies coordinate system - applied every frame. - - - - - The torque - relative to the rigid bodies coordinate system - applied every frame. - - - - - The torque applied to the rigidbody every frame. - - - - - Applies both linear and angular (torque) forces continuously to the rigidbody each physics update. - - - - - The linear force applied to the rigidbody each physics update. - - - - - The linear force, relative to the rigid-body coordinate system, applied each physics update. - - - - - The torque applied to the rigidbody each physics update. - - - - - A set of parameters for filtering contact results. Define the angle by referring to their position in world space, where 0 degrees is parallel to the positive x-axis, 90 degrees is parallel to the positive y-axis, 180 degrees is parallel to the negative x-axis, and 270 degrees is parallel to the negative y-axis. - - - - - Given the current state of the contact filter, determine whether it would filter anything. - - - - - Sets the contact filter to filter the results that only include Collider2D on the layers defined by the layer mask. - - - - - Sets the contact filter to filter the results to only include Collider2D with a Z coordinate (depth) less than this value. - - - - - Sets the contact filter to filter the results to only include contacts with collision normal angles that are less than this angle. - - - - - Sets the contact filter to filter the results to only include Collider2D with a Z coordinate (depth) greater than this value. - - - - - Sets the contact filter to filter the results to only include contacts with collision normal angles that are greater than this angle. - - - - - Sets the contact filter to filter the results by depth using minDepth and maxDepth. - - - - - Sets the contact filter to filter results by layer mask. - - - - - Sets the contact filter to filter the results by the collision's normal angle using minNormalAngle and maxNormalAngle. - - - - - Sets the contact filter to filter within the minDepth and maxDepth range, or outside that range. - - - - - Sets the contact filter to filter within the minNormalAngle and maxNormalAngle range, or outside that range. - - - - - Sets to filter contact results based on trigger collider involvement. - - - - - Turns off depth filtering by setting useDepth to false. The associated values of minDepth and maxDepth are not changed. - - - - - Turns off layer mask filtering by setting useLayerMask to false. The associated value of layerMask is not changed. - - - - - Turns off normal angle filtering by setting useNormalAngle to false. The associated values of minNormalAngle and maxNormalAngle are not changed. - - - - - Checks if the Transform for obj is within the depth range to be filtered. - - The GameObject used to check the z-position (depth) of Transform.position. - - Returns true when obj is excluded by the filter and false if otherwise. - - - - - Checks if the GameObject.layer for obj is included in the layerMask to be filtered. - - The GameObject used to check the GameObject.layer. - - Returns true when obj is excluded by the filter and false if otherwise. - - - - - Checks if the angle of normal is within the normal angle range to be filtered. - - The normal used to calculate an angle. - - Returns true when normal is excluded by the filter and false if otherwise. - - - - - Checks if the angle is within the normal angle range to be filtered. - - The angle used for comparison in the filter. - - Returns true when angle is excluded by the filter and false if otherwise. - - - - - Checks if the collider is a trigger and should be filtered by the useTriggers to be filtered. - - The Collider2D used to check for a trigger. - - Returns true when collider is excluded by the filter and false if otherwise. - - - - - Sets the contact filter to not filter any ContactPoint2D. - - - A copy of the contact filter set to not filter any ContactPoint2D. - - - - - Sets the minDepth and maxDepth filter properties and turns on depth filtering by setting useDepth to true. - - The value used to set minDepth. - The value used to set maxDepth. - - - - Sets the layerMask filter property using the layerMask parameter provided and also enables layer mask filtering by setting useLayerMask to true. - - The value used to set the layerMask. - - - - Sets the minNormalAngle and maxNormalAngle filter properties and turns on normal angle filtering by setting useNormalAngle to true. - - The value used to set the minNormalAngle. - The value used to set the maxNormalAngle. - - - - Describes a contact point where the collision occurs. - - - - - Normal of the contact point. - - - - - The other collider in contact at the point. - - - - - The point of contact. - - - - - The distance between the colliders at the contact point. - - - - - The first collider in contact at the point. - - - - - Details about a specific point of contact involved in a 2D physics collision. - - - - - The incoming Collider2D involved in the collision with the otherCollider. - - - - - Indicates whether the collision response or reaction is enabled or disabled. - - - - - Surface normal at the contact point. - - - - - Gets the impulse applied at the contact point along the ContactPoint2D.normal. - - - - - The other Collider2D involved in the collision with the collider. - - - - - The other Rigidbody2D involved in the collision with the rigidbody. - - - - - The point of contact between the two colliders in world space. - - - - - Gets the relative velocity of the two colliders at the contact point (Read Only). - - - - - The incoming Rigidbody2D involved in the collision with the otherRigidbody. - - - - - Gets the distance between the colliders at the contact point. - - - - - Gets the impulse applied at the contact point which is perpendicular to the ContactPoint2D.normal. - - - - - The ContextMenu attribute allows you to add commands to the context menu. - - - - - Adds the function to the context menu of the component. - - The name of the context menu item. - Whether this is a validate function (defaults to false). - Priority used to override the ordering of the menu items (defaults to 1000000). The lower the number the earlier in the menu it will appear. - - - - Adds the function to the context menu of the component. - - The name of the context menu item. - Whether this is a validate function (defaults to false). - Priority used to override the ordering of the menu items (defaults to 1000000). The lower the number the earlier in the menu it will appear. - - - - Adds the function to the context menu of the component. - - The name of the context menu item. - Whether this is a validate function (defaults to false). - Priority used to override the ordering of the menu items (defaults to 1000000). The lower the number the earlier in the menu it will appear. - - - - Use this attribute to add a context menu to a field that calls a named method. - - - - - The name of the function that should be called. - - - - - The name of the context menu item. - - - - - Use this attribute to add a context menu to a field that calls a named method. - - The name of the context menu item. - The name of the function that should be called. - - - - ControllerColliderHit is used by CharacterController.OnControllerColliderHit to give detailed information about the collision and how to deal with it. - - - - - The collider that was hit by the controller. - - - - - The controller that hit the collider. - - - - - The game object that was hit by the controller. - - - - - The direction the CharacterController was moving in when the collision occured. - - - - - How far the character has travelled until it hit the collider. - - - - - The normal of the surface we collided with in world space. - - - - - The impact point in world space. - - - - - The rigidbody that was hit by the controller. - - - - - The transform that was hit by the controller. - - - - - MonoBehaviour.StartCoroutine returns a Coroutine. Instances of this class are only used to reference these coroutines, and do not hold any exposed properties or functions. - - - - - Holds data for a single application crash event and provides access to all gathered crash reports. - - - - - Returns last crash report, or null if no reports are available. - - - - - Returns all currently available reports in a new array. - - - - - Crash report data as formatted text. - - - - - Time, when the crash occured. - - - - - Remove report from available reports list. - - - - - Remove all reports from available reports list. - - - - - Engine API for CrashReporting Service. - - - - - This Boolean field will cause CrashReportHandler to capture exceptions when set to true. By default enable capture exceptions is true. - - - - - The Performance Reporting service will keep a buffer of up to the last X log messages (Debug.Log, etc) to send along with crash reports. The default is 10 log messages, the max is 50. Set this to 0 to disable capture of logs with your crash reports. - - - - - Get a custom crash report metadata field that has been set. - - - - Value that was previously set for the key, or null if no value was found. - - - - - Set a custom metadata key-value pair to be included with crash reports. - - - - - - - Mark a ScriptableObject-derived type to be automatically listed in the Assets/Create submenu, so that instances of the type can be easily created and stored in the project as ".asset" files. - - - - - The default file name used by newly created instances of this type. - - - - - The display name for this type shown in the Assets/Create menu. - - - - - The position of the menu item within the Assets/Create menu. - - - - - Class for handling cube maps, Use this to create or modify existing. - - - - - The mipmap level that the streaming system would load before memory budgets are applied. - - - - - The format of the pixel data in the texture (Read Only). - - - - - The mipmap level that is currently loaded by the streaming system. - - - - - The mipmap level that the mipmap streaming system is in the process of loading. - - - - - The mipmap level to load. - - - - - Determines whether mipmap streaming is enabled for this Texture. - - - - - Sets the relative priority for this Texture when reducing memory size to fit within the memory budget. - - - - - Actually apply all previous SetPixel and SetPixels changes. - - When set to true, mipmap levels are recalculated. - When set to true, system memory copy of a texture is released. - - - - Resets the requestedMipmapLevel field. - - - - - Creates a Unity cubemap out of externally created native cubemap object. - - The width and height of each face of the cubemap should be the same. - Format of underlying cubemap object. - Does the cubemap have mipmaps? - Native cubemap texture object. - - - - - Create a new empty cubemap texture. - - Width/height of a cube face in pixels. - Pixel data format to be used for the Cubemap. - Should mipmaps be created? - - - - - - - Returns pixel color at coordinates (face, x, y). - - - - - - - - Gets raw data from a Texture for reading or writing. - - The mip level to reference. - The Cubemap face to reference. - - - - Returns pixel colors of a cubemap face. - - The face from which pixel data is taken. - Mipmap level for the chosen face. - - - - Checks to see whether the mipmap level set by requestedMipmapLevel has finished loading. - - - True if the mipmap level requested by requestedMipmapLevel has finished loading. - - - - - Sets pixel color at coordinates (face, x, y). - - - - - - - - - Set pixel values from raw preformatted data. - - Mip level to fill. - Cubemap face to fill. - Index in the source array to start copying from (default 0). - Data array to initialize texture pixels with. - - - - Set pixel values from raw preformatted data. - - Mip level to fill. - Cubemap face to fill. - Index in the source array to start copying from (default 0). - Data array to initialize texture pixels with. - - - - Sets pixel colors of a cubemap face. - - Pixel data for the Cubemap face. - The face to which the new data should be applied. - The mipmap level for the face. - - - - Performs smoothing of near edge regions. - - Pixel distance at edges over which to apply smoothing. - - - - Updates Unity cubemap to use different native cubemap texture object. - - Native cubemap texture object. - - - - Class for handling Cubemap arrays. - - - - - Number of cubemaps in the array (Read Only). - - - - - Texture format (Read Only). - - - - - Actually apply all previous SetPixels changes. - - When set to true, mipmap levels are recalculated. - When set to true, system memory copy of a texture is released. - - - - Create a new cubemap array. - - Cubemap face size in pixels. - Number of elements in the cubemap array. - Format of the pixel data. - Should mipmaps be created? - Does the texture contain non-color data (i.e. don't do any color space conversions when sampling)? Default is false. - - - - - - - Create a new cubemap array. - - Cubemap face size in pixels. - Number of elements in the cubemap array. - Format of the pixel data. - Should mipmaps be created? - Does the texture contain non-color data (i.e. don't do any color space conversions when sampling)? Default is false. - - - - - - - Gets raw data from a Texture for reading or writing. - - The mip level to reference. - The Cubemap face to reference. - The array slice to reference. - - - - Returns pixel colors of a single array slice/face. - - Cubemap face to read pixels from. - Array slice to read pixels from. - Mipmap level to read pixels from. - - Array of pixel colors. - - - - - Returns pixel colors of a single array slice/face. - - Cubemap face to read pixels from. - Array slice to read pixels from. - Mipmap level to read pixels from. - - Array of pixel colors in low precision (8 bits/channel) format. - - - - - Set pixel values from raw preformatted data. - - Mip level to fill. - Array slice to copy pixels to. - Index in the source array to start copying from (default 0). - Cubemap face to fill. - Data array to initialize texture pixels with. - - - - Set pixel values from raw preformatted data. - - Mip level to fill. - Array slice to copy pixels to. - Index in the source array to start copying from (default 0). - Cubemap face to fill. - Data array to initialize texture pixels with. - - - - Set pixel colors for a single array slice/face. - - An array of pixel colors. - Cubemap face to set pixels for. - Array element index to set pixels for. - Mipmap level to set pixels for. - - - - Set pixel colors for a single array slice/face. - - An array of pixel colors in low precision (8 bits/channel) format. - Cubemap face to set pixels for. - Array element index to set pixels for. - Mipmap level to set pixels for. - - - - Cubemap face. - - - - - Left facing side (-x). - - - - - Downward facing side (-y). - - - - - Backward facing side (-z). - - - - - Right facing side (+x). - - - - - Upwards facing side (+y). - - - - - Forward facing side (+z). - - - - - Cubemap face is unknown or unspecified. - - - - - Describes a set of bounding spheres that should have their visibility and distances maintained. - - - - - Pauses culling group execution. - - - - - Sets the callback that will be called when a sphere's visibility and/or distance state has changed. - - - - - Locks the CullingGroup to a specific camera. - - - - - Create a CullingGroup. - - - - - Clean up all memory used by the CullingGroup immediately. - - - - - Erase a given bounding sphere by moving the final sphere on top of it. - - The index of the entry to erase. - - - - Erase a given entry in an arbitrary array by copying the final entry on top of it, then decrementing the number of entries used by one. - - The index of the entry to erase. - An array of entries. - The number of entries in the array that are actually used. - - - - Get the current distance band index of a given sphere. - - The index of the sphere. - - The sphere's current distance band index. - - - - - Returns true if the bounding sphere at index is currently visible from any of the contributing cameras. - - The index of the bounding sphere. - - True if the sphere is visible; false if it is invisible. - - - - - Retrieve the indices of spheres that have particular visibility and/or distance states. - - True if only visible spheres should be retrieved; false if only invisible spheres should be retrieved. - The distance band that retrieved spheres must be in. - An array that will be filled with the retrieved sphere indices. - The index of the sphere to begin searching at. - - The number of sphere indices found and written into the result array. - - - - - Retrieve the indices of spheres that have particular visibility and/or distance states. - - True if only visible spheres should be retrieved; false if only invisible spheres should be retrieved. - The distance band that retrieved spheres must be in. - An array that will be filled with the retrieved sphere indices. - The index of the sphere to begin searching at. - - The number of sphere indices found and written into the result array. - - - - - Retrieve the indices of spheres that have particular visibility and/or distance states. - - True if only visible spheres should be retrieved; false if only invisible spheres should be retrieved. - The distance band that retrieved spheres must be in. - An array that will be filled with the retrieved sphere indices. - The index of the sphere to begin searching at. - - The number of sphere indices found and written into the result array. - - - - - Set bounding distances for 'distance bands' the group should compute, as well as options for how spheres falling into each distance band should be treated. - - An array of bounding distances. The distances should be sorted in increasing order. - - - - Sets the number of bounding spheres in the bounding spheres array that are actually being used. - - The number of bounding spheres being used. - - - - Sets the array of bounding sphere definitions that the CullingGroup should compute culling for. - - The BoundingSpheres to cull. - - - - Set the reference point from which distance bands are measured. - - A fixed point to measure the distance from. - A transform to measure the distance from. The transform's position will be automatically tracked. - - - - Set the reference point from which distance bands are measured. - - A fixed point to measure the distance from. - A transform to measure the distance from. The transform's position will be automatically tracked. - - - - This delegate is used for recieving a callback when a sphere's distance or visibility state has changed. - - A CullingGroupEvent that provides information about the sphere that has changed. - - - - Provides information about the current and previous states of one sphere in a CullingGroup. - - - - - The current distance band index of the sphere, after the most recent culling pass. - - - - - Did this sphere change from being visible to being invisible in the most recent culling pass? - - - - - Did this sphere change from being invisible to being visible in the most recent culling pass? - - - - - The index of the sphere that has changed. - - - - - Was the sphere considered visible by the most recent culling pass? - - - - - The distance band index of the sphere before the most recent culling pass. - - - - - Was the sphere visible before the most recent culling pass? - - - - - Cursor API for setting the cursor (mouse pointer). - - - - - Determines whether the hardware pointer is locked to the center of the view, constrained to the window, or not constrained at all. - - - - - Determines whether the hardware pointer is visible or not. - - - - - Sets the mouse cursor to the given texture. - - - - - Specify a custom cursor that you wish to use as a cursor. - - The texture to use for the cursor. To use a texture, you must first import it with `Read/Write`enabled. Alternatively, you can use the default cursor import setting. If you created your cursor texture from code, it must be in RGBA32 format, have alphaIsTransparency enabled, and have no mip chain. To use the default cursor, set the texture to `Null`. - The offset from the top left of the texture to use as the target point (must be within the bounds of the cursor). - Allow this cursor to render as a hardware cursor on supported platforms, or force software cursor. - - - - How the cursor should behave. - - - - - Confine cursor to the game window. - - - - - Lock cursor to the center of the game window. - - - - - Cursor behavior is unmodified. - - - - - Determines whether the mouse cursor is rendered using software rendering or, on supported platforms, hardware rendering. - - - - - Use hardware cursors on supported platforms. - - - - - Force the use of software cursors. - - - - - Attribute to define the class as a grid brush and to make it available in the palette window. - - - - - If set to true, brush will replace Unity built-in brush as the default brush in palette window. - -Only one class at any one time should set defaultBrush to true. - - - - - Name of the default instance of this brush. - - - - - Hide all asset instances of this brush in the tile palette window. - - - - - Hide the default instance of brush in the tile palette window. - - - - - Attribute to define the class as a grid brush and to make it available in the palette window. - - If set to true, brush will replace Unity built-in brush as the default brush in palette window. - Name of the default instance of this brush. - Hide all asset instances of this brush in the tile palette window. - Hide the default instance of brush in the tile palette window. - - - - - Attribute to define the class as a grid brush and to make it available in the palette window. - - If set to true, brush will replace Unity built-in brush as the default brush in palette window. - Name of the default instance of this brush. - Hide all asset instances of this brush in the tile palette window. - Hide the default instance of brush in the tile palette window. - - - - - Custom Render Textures are an extension to Render Textures that allow you to render directly to the Texture using a Shader. - - - - - The bit field that you can use to enable or disable update on each of the cubemap faces. The bit order from least to most significant bit is as follows: +X, -X, +Y, -Y, +Z, -Z. - - - - - When this parameter is set to true, Unity double-buffers the Custom Render Texture so that you can access it during its own update. - - - - - The color that Unity uses to initialize a Custom Render Texture. Unity ignores this parameter if an initializationMaterial is set. - - - - - The Material that Unity uses to initialize a Custom Render Texture. Initialization texture and color are ignored if you have set this parameter. - - - - - Determine how Unity initializes a texture. - - - - - Determine if Unity initializes the Custom Render Texture with a Texture and a Color or a Material. - - - - - The Texture that Unity uses to initialize a Custom Render Texture, multiplied by the initialization color. Unity ignores this parameter if an initializationMaterial is set. - - - - - The Material that Unity uses to initialize the content of a Custom Render Texture. - - - - - The Shader Pass Unity uses to update the Custom Render Texture. - - - - - Determine how Unity updates the Custom Render Texture. - - - - - The period in seconds that Unity updates real-time Custom Render Textures. A value of 0.0 means Unity updates real-time Custom Render Textures every frame. - - - - - The space in which Unity expresses update zones. You can set this to Normalized or Pixel space. - - - - - When this parameter is set to true, Unity wraps Update zones around the border of the Custom Render Texture. Otherwise, Unity clamps Update zones at the border of the Custom Render Texture. - - - - - Clear all Update Zones. - - - - - Create a new Custom Render Texture. - - - - - - - - - Create a new Custom Render Texture. - - - - - - - - - Create a new Custom Render Texture. - - - - - - - - - Updates the internal Render Texture that a Custom Render Texture uses for double buffering, so that it matches the size and format of the Custom Render Texture. - - - - - Gets the Render Texture that this Custom Render Texture uses for double buffering. - - - If CustomRenderTexture. doubleBuffered is true, this returns the Render Texture that this Custom Render Texture uses for double buffering. If CustomRenderTexture. doubleBuffered is false, this returns null. - - - - - Returns the list of Update Zones. - - Output list of Update Zones. - - - - Initializes the Custom Render Texture at the start of the next frame. Unity calls Initialise() before CustomRenderTexture.Update. - - - - - Setup the list of Update Zones for the Custom Render Texture. - - - - - - Triggers an update of the Custom Render Texture. - - Number of upate pass to perform. The default value of this count parameter is 1. - - - - Specify the source of a Custom Render Texture initialization. - - - - - Custom Render Texture is initalized with a Material. - - - - - Custom Render Texture is initialized by a Texture multiplied by a Color. - - - - - Custom Render Texture Manager. - - - - - Unity raises this event when CustomRenderTexture.Initialize is called. - - - - - - Unity raises this event when it loads a CustomRenderTexture. - - - - - - Unity raises this event when it unloads a CustomRenderTexture. - - - - - - Unity raises this event when CustomRenderTexture.Update is called. - - - - - - Populate the list in parameter with all currently loaded custom render textures. - - - - - - Frequency of update or initialization of a Custom Render Texture. - - - - - Initialization/Update will only occur when triggered by the script. - - - - - Initialization/Update will occur once at load time and then can be triggered again by script. - - - - - Initialization/Update will occur at every frame. - - - - - Structure describing an Update Zone. - - - - - If true, and if the texture is double buffered, a request is made to swap the buffers before the next update. Otherwise, the buffers will not be swapped. - - - - - Shader Pass used to update the Custom Render Texture for this Update Zone. - - - - - Rotation of the Update Zone. - - - - - Position of the center of the Update Zone within the Custom Render Texture. - - - - - Size of the Update Zone. - - - - - Space in which coordinates are provided for Update Zones. - - - - - Coordinates are normalized. (0, 0) is top left and (1, 1) is bottom right. - - - - - Coordinates are expressed in pixels. (0, 0) is top left (width, height) is bottom right. - - - - - Base class for custom yield instructions to suspend coroutines. - - - - - Indicates if coroutine should be kept suspended. - - - - - The type for the number of bits to be used when an HDR display is active in each color channel of swap chain buffers. The bit count also defines the method Unity uses to render content to the display. - - - - - Unity will use R10G10B10A2 buffer format and Rec2020 primaries with ST2084 PQ encoding. - - - - - Unity will use R16G16B16A16 buffer format and Rec709 primaries with linear color (no encoding). - - - - - Class containing methods to ease debugging while developing a game. - - - - - Reports whether the development console is visible. The development console cannot be made to appear using: - - - - - In the Build Settings dialog there is a check box called "Development Build". - - - - - Get default debug logger. - - - - - Assert a condition and logs an error message to the Unity console on failure. - - Condition you expect to be true. - Object to which the message applies. - String or object to be converted to string representation for display. - - - - Assert a condition and logs an error message to the Unity console on failure. - - Condition you expect to be true. - Object to which the message applies. - String or object to be converted to string representation for display. - - - - Assert a condition and logs an error message to the Unity console on failure. - - Condition you expect to be true. - Object to which the message applies. - String or object to be converted to string representation for display. - - - - Assert a condition and logs an error message to the Unity console on failure. - - Condition you expect to be true. - Object to which the message applies. - String or object to be converted to string representation for display. - - - - Assert a condition and logs a formatted error message to the Unity console on failure. - - Condition you expect to be true. - A composite format string. - Format arguments. - Object to which the message applies. - - - - Assert a condition and logs a formatted error message to the Unity console on failure. - - Condition you expect to be true. - A composite format string. - Format arguments. - Object to which the message applies. - - - - Pauses the editor. - - - - - Clears errors from the developer console. - - - - - Draws a line between specified start and end points. - - Point in world space where the line should start. - Point in world space where the line should end. - Color of the line. - How long the line should be visible for. - Should the line be obscured by objects closer to the camera? - - - - Draws a line between specified start and end points. - - Point in world space where the line should start. - Point in world space where the line should end. - Color of the line. - How long the line should be visible for. - Should the line be obscured by objects closer to the camera? - - - - Draws a line between specified start and end points. - - Point in world space where the line should start. - Point in world space where the line should end. - Color of the line. - How long the line should be visible for. - Should the line be obscured by objects closer to the camera? - - - - Draws a line between specified start and end points. - - Point in world space where the line should start. - Point in world space where the line should end. - Color of the line. - How long the line should be visible for. - Should the line be obscured by objects closer to the camera? - - - - Draws a line from start to start + dir in world coordinates. - - Point in world space where the ray should start. - Direction and length of the ray. - Color of the drawn line. - How long the line will be visible for (in seconds). - Should the line be obscured by other objects closer to the camera? - - - - Draws a line from start to start + dir in world coordinates. - - Point in world space where the ray should start. - Direction and length of the ray. - Color of the drawn line. - How long the line will be visible for (in seconds). - Should the line be obscured by other objects closer to the camera? - - - - Draws a line from start to start + dir in world coordinates. - - Point in world space where the ray should start. - Direction and length of the ray. - Color of the drawn line. - How long the line will be visible for (in seconds). - Should the line be obscured by other objects closer to the camera? - - - - Draws a line from start to start + dir in world coordinates. - - Point in world space where the ray should start. - Direction and length of the ray. - Color of the drawn line. - How long the line will be visible for (in seconds). - Should the line be obscured by other objects closer to the camera? - - - - Populate an unmanaged buffer with the current managed call stack as a sequence of UTF-8 bytes, without allocating GC memory. Returns the number of bytes written into the buffer. - - Target buffer to receive the callstack text - Max number of bytes to write - Project folder path, to clean up path names - - - - Logs a message to the Unity Console. - - String or object to be converted to string representation for display. - Object to which the message applies. - - - - Logs a message to the Unity Console. - - String or object to be converted to string representation for display. - Object to which the message applies. - - - - A variant of Debug.Log that logs an assertion message to the console. - - String or object to be converted to string representation for display. - Object to which the message applies. - - - - A variant of Debug.Log that logs an assertion message to the console. - - String or object to be converted to string representation for display. - Object to which the message applies. - - - - Logs a formatted assertion message to the Unity console. - - A composite format string. - Format arguments. - Object to which the message applies. - - - - Logs a formatted assertion message to the Unity console. - - A composite format string. - Format arguments. - Object to which the message applies. - - - - A variant of Debug.Log that logs an error message to the console. - - String or object to be converted to string representation for display. - Object to which the message applies. - - - - A variant of Debug.Log that logs an error message to the console. - - String or object to be converted to string representation for display. - Object to which the message applies. - - - - Logs a formatted error message to the Unity console. - - A composite format string. - Format arguments. - Object to which the message applies. - - - - Logs a formatted error message to the Unity console. - - A composite format string. - Format arguments. - Object to which the message applies. - - - - A variant of Debug.Log that logs an error message to the console. - - Object to which the message applies. - Runtime Exception. - - - - A variant of Debug.Log that logs an error message to the console. - - Object to which the message applies. - Runtime Exception. - - - - Logs a formatted message to the Unity Console. - - A composite format string. - Format arguments. - Object to which the message applies. - Type of message e.g. warn or error etc. - Option flags to treat the log message special. - - - - Logs a formatted message to the Unity Console. - - A composite format string. - Format arguments. - Object to which the message applies. - Type of message e.g. warn or error etc. - Option flags to treat the log message special. - - - - Logs a formatted message to the Unity Console. - - A composite format string. - Format arguments. - Object to which the message applies. - Type of message e.g. warn or error etc. - Option flags to treat the log message special. - - - - A variant of Debug.Log that logs a warning message to the console. - - String or object to be converted to string representation for display. - Object to which the message applies. - - - - A variant of Debug.Log that logs a warning message to the console. - - String or object to be converted to string representation for display. - Object to which the message applies. - - - - Logs a formatted warning message to the Unity Console. - - A composite format string. - Format arguments. - Object to which the message applies. - - - - Logs a formatted warning message to the Unity Console. - - A composite format string. - Format arguments. - Object to which the message applies. - - - - Attribute used to make a float, int, or string variable in a script be delayed. - - - - - Attribute used to make a float, int, or string variable in a script be delayed. - - - - - Depth texture generation mode for Camera. - - - - - Generate a depth texture. - - - - - Generate a depth + normals texture. - - - - - Specifies whether motion vectors should be rendered (if possible). - - - - - Do not generate depth texture (Default). - - - - - Detail prototype used by the Terrain GameObject. - - - - - Bend factor of the detailPrototype. - - - - - Color when the DetailPrototypes are "dry". - - - - - Color when the DetailPrototypes are "healthy". - - - - - Controls how far away detail objects are from the edge of the hole area. - - - - - Maximum height of the grass billboards (if render mode is GrassBillboard). - - - - - Maximum width of the grass billboards (if render mode is GrassBillboard). - - - - - Minimum height of the grass billboards (if render mode is GrassBillboard). - - - - - Minimum width of the grass billboards (if render mode is GrassBillboard). - - - - - How spread out is the noise for the DetailPrototype. - - - - - GameObject used by the DetailPrototype. - - - - - Texture used by the DetailPrototype. - - - - - Render mode for the DetailPrototype. - - - - - Indicates whether this detail prototype uses the Mesh object from the GameObject specified by prototype. - - - - - Returns true if the detail prototype is valid and the Terrain can accept it. - - Returns a message that indicates the cause of failed validation. - - - - Returns true if the detail prototype is valid and the Terrain can accept it. - - Returns a message that indicates the cause of failed validation. - - - - Render mode for detail prototypes. - - - - - The detail prototype will use the grass shader. - - - - - The detail prototype will be rendered as billboards that are always facing the camera. - - - - - Will show the prototype using diffuse shading. - - - - - Describes physical orientation of the device as determined by the OS. - - - - - The device is held parallel to the ground with the screen facing downwards. - - - - - The device is held parallel to the ground with the screen facing upwards. - - - - - The device is in landscape mode, with the device held upright and the home button on the right side. - - - - - The device is in landscape mode, with the device held upright and the home button on the left side. - - - - - The device is in portrait mode, with the device held upright and the home button at the bottom. - - - - - The device is in portrait mode but upside down, with the device held upright and the home button at the top. - - - - - The orientation of the device cannot be determined. - - - - - Enumeration for SystemInfo.deviceType, denotes a coarse grouping of kinds of devices. - - - - - A stationary gaming console. - - - - - Desktop or laptop computer. - - - - - A handheld device like mobile phone or a tablet. - - - - - Device type is unknown. You should never see this in practice. - - - - - Specifies the category of crash to cause when calling ForceCrash(). - - - - - Cause a crash by calling the abort() function. - - - - - Cause a crash by performing an invalid memory access. - -The invalid memory access is performed on each platform as follows: - - - - - Cause a crash using Unity's native fatal error implementation. - - - - - Cause a crash by calling the abort() function within the Mono dynamic library. - - - - - Cause a crash by calling a pure virtual function to raise an exception. - - - - - A utility class that you can use for diagnostic purposes. - - - - - Manually causes an application crash in the specified category. - - - - - - Manually causes an assert that outputs the specified message to the log and registers an error. - - - - - - Manually causes a native error that outputs the specified message to the log and registers an error. - - - - - - Manually causes a warning that outputs the specified message to the log and registers an error. - - - - - - Prevents MonoBehaviour of same type (or subtype) to be added more than once to a GameObject. - - - - - Provides access to a display / screen for rendering operations. - - - - - Gets the state of the display and returns true if the display is active and false if otherwise. - - - - - Color RenderBuffer. - - - - - Depth RenderBuffer. - - - - - The list of currently connected displays. - - - - - Main Display. - - - - - Vertical resolution that the display is rendering at. - - - - - Horizontal resolution that the display is rendering at. - - - - - True when the back buffer requires an intermediate texture to render. - - - - - True when doing a blit to the back buffer requires manual color space conversion. - - - - - Vertical native display resolution. - - - - - Horizontal native display resolution. - - - - - Activate an external display. Eg. Secondary Monitors connected to the System. - - - - - This overloaded function available for Windows allows specifying desired Window Width, Height and Refresh Rate. - - Desired Width of the Window (for Windows only. On Linux and Mac uses Screen Width). - Desired Height of the Window (for Windows only. On Linux and Mac uses Screen Height). - Desired Refresh Rate. - - - - Query relative mouse coordinates. - - Mouse Input Position as Coordinates. - - - - Set rendering size and position on screen (Windows only). - - Change Window Width (Windows Only). - Change Window Height (Windows Only). - Change Window Position X (Windows Only). - Change Window Position Y (Windows Only). - - - - Sets rendering resolution for the display. - - Rendering width in pixels. - Rendering height in pixels. - - - - Joint that keeps two Rigidbody2D objects a fixed distance apart. - - - - - Should the distance be calculated automatically? - - - - - The distance separating the two ends of the joint. - - - - - Whether to maintain a maximum distance only or not. If not then the absolute distance will be maintained instead. - - - - - A component can be designed to drive a RectTransform. The DrivenRectTransformTracker struct is used to specify which RectTransforms it is driving. - - - - - Add a RectTransform to be driven. - - The object to drive properties. - The RectTransform to be driven. - The properties to be driven. - - - - Clear the list of RectTransforms being driven. - - - - - Resume recording undo of driven RectTransforms. - - - - - Stop recording undo actions from driven RectTransforms. - - - - - An enumeration of transform properties that can be driven on a RectTransform by an object. - - - - - Selects all driven properties. - - - - - Selects driven property RectTransform.anchoredPosition. - - - - - Selects driven property RectTransform.anchoredPosition3D. - - - - - Selects driven property RectTransform.anchoredPosition.x. - - - - - Selects driven property RectTransform.anchoredPosition.y. - - - - - Selects driven property RectTransform.anchoredPosition3D.z. - - - - - Selects driven property combining AnchorMaxX and AnchorMaxY. - - - - - Selects driven property RectTransform.anchorMax.x. - - - - - Selects driven property RectTransform.anchorMax.y. - - - - - Selects driven property combining AnchorMinX and AnchorMinY. - - - - - Selects driven property RectTransform.anchorMin.x. - - - - - Selects driven property RectTransform.anchorMin.y. - - - - - Selects driven property combining AnchorMinX, AnchorMinY, AnchorMaxX and AnchorMaxY. - - - - - Deselects all driven properties. - - - - - Selects driven property combining PivotX and PivotY. - - - - - Selects driven property RectTransform.pivot.x. - - - - - Selects driven property RectTransform.pivot.y. - - - - - Selects driven property Transform.localRotation. - - - - - Selects driven property combining ScaleX, ScaleY && ScaleZ. - - - - - Selects driven property Transform.localScale.x. - - - - - Selects driven property Transform.localScale.y. - - - - - Selects driven property Transform.localScale.z. - - - - - Selects driven property combining SizeDeltaX and SizeDeltaY. - - - - - Selects driven property RectTransform.sizeDelta.x. - - - - - Selects driven property RectTransform.sizeDelta.y. - - - - - Describe the unit of a duration. - - - - - A fixed duration is a duration expressed in seconds. - - - - - A normalized duration is a duration expressed in percentage. - - - - - Allows to control the dynamic Global Illumination. - - - - - Allows for scaling the contribution coming from realtime & baked lightmaps. - -Note: this value can be set in the Lighting Window UI and it is serialized, that is not the case for other properties in this class. - - - - - Is precomputed realtime Global Illumination output converged? - - - - - The number of milliseconds that can be spent on material updates. - - - - - When enabled, new dynamic Global Illumination output is shown in each frame. - - - - - Threshold for limiting updates of realtime GI. The unit of measurement is "percentage intensity change". - - - - - Allows to set an emissive color for a given renderer quickly, without the need to render the emissive input for the entire system. - - The Renderer that should get a new color. - The emissive Color. - - - - Allows overriding the distant environment lighting for Realtime GI, without changing the Skybox Material. - - Array of float values to be used for Realtime GI environment lighting. - - - - Schedules an update of the environment texture. - - - - - Schedules an update of the albedo and emissive textures of a system that contains the renderer or the terrain. - - The Renderer to use when searching for a system to update. - The Terrain to use when searching for systems to update. - - - - Schedules an update of the albedo and emissive textures of a system that contains the renderer or the terrain. - - The Renderer to use when searching for a system to update. - The Terrain to use when searching for systems to update. - - - - Schedules an update of the albedo and emissive textures of a system that contains the renderer or the terrain. - - The Renderer to use when searching for a system to update. - The Terrain to use when searching for systems to update. - - - - Collider for 2D physics representing an arbitrary set of connected edges (lines) defined by its vertices. - - - - - Defines the position of a virtual point adjacent to the end point of the EdgeCollider2D. - - - - - Defines the position of a virtual point adjacent to the start point of the EdgeCollider2D. - - - - - Gets the number of edges. - - - - - Controls the radius of all edges created by the collider. - - - - - Gets the number of points. - - - - - Get or set the points defining multiple continuous edges. - - - - - Set this to true to use the adjacentEndPoint to form the collision normal that is used to calculate the collision response when a collision occurs at the Edge Collider's end point. Set this to false to not use the adjacentEndPoint, and the collision normal becomes the direction of motion of the collision. - - - - - Set this to true to use the adjacentStartPoint to form the collision normal that is used to calculate the collision response when a collision occurs at the Edge Collider's start point. Set this to false to not use the adjacentStartPoint, and the collision normal becomes the direction of motion of the collision. - - - - - Gets all the points that define a set of continuous edges. - - A list of Vector2 used to receive the points. - - Returns the number of points placed in the points list. - - - - - Reset to a single edge consisting of two points. - - - - - Sets all the points that define a set of continuous edges. - - A list of Vector2 used to set the points. This list must contain at least two points. - - Returns true if the list contains two or more points and the points are correctly set. Returns false otherwise. - - - - - A base class for all 2D effectors. - - - - - The mask used to select specific layers allowed to interact with the effector. - - - - - Should the collider-mask be used or the global collision matrix? - - - - - The mode used to apply Effector2D forces. - - - - - The force is applied at a constant rate. - - - - - The force is applied inverse-linear relative to a point. - - - - - The force is applied inverse-squared relative to a point. - - - - - Selects the source and/or target to be used by an Effector2D. - - - - - The source/target is defined by the Collider2D. - - - - - The source/target is defined by the Rigidbody2D. - - - - - A UnityGUI event. - - - - - Is Alt/Option key held down? (Read Only) - - - - - Which mouse button was pressed. - - - - - Is Caps Lock on? (Read Only) - - - - - The character typed. - - - - - How many consecutive mouse clicks have we received. - - - - - Is Command/Windows key held down? (Read Only) - - - - - The name of an ExecuteCommand or ValidateCommand Event. - - - - - Is Control key held down? (Read Only) - - - - - The current event that's being processed right now. - - - - - The relative movement of the mouse compared to last event. - - - - - Index of display that the event belongs to. - - - - - Is the current keypress a function key? (Read Only) - - - - - Is this event a keyboard event? (Read Only) - - - - - Is this event a mouse event? (Read Only) - - - - - The raw key code for keyboard events. - - - - - Which modifier keys are held down. - - - - - The mouse position. - - - - - Is the current keypress on the numeric keyboard? (Read Only) - - - - - The type of pointer that created this event (for example, mouse, touch screen, pen). - - - - - How hard stylus pressure is applied. - - - - - Is Shift held down? (Read Only) - - - - - The type of event. - - - - - Returns the current number of events that are stored in the event queue. - - - Current number of events currently in the event queue. - - - - - Get a filtered event type for a given control ID. - - The ID of the control you are querying from. - - - - Create a keyboard event. - - - - - - Get the next queued [Event] from the event system. - - Next Event. - - - - Use this event. - - - - - Types of modifier key that can be active during a keystroke event. - - - - - Alt key. - - - - - Caps lock key. - - - - - Command key (Mac). - - - - - Control key. - - - - - Function key. - - - - - No modifier key pressed during a keystroke event. - - - - - Num lock key. - - - - - Shift key. - - - - - THe mode that a listener is operating in. - - - - - The listener will bind to one argument bool functions. - - - - - The listener will use the function binding specified by the even. - - - - - The listener will bind to one argument float functions. - - - - - The listener will bind to one argument int functions. - - - - - The listener will bind to one argument Object functions. - - - - - The listener will bind to one argument string functions. - - - - - The listener will bind to zero argument functions. - - - - - Zero argument delegate used by UnityEvents. - - - - - One argument delegate used by UnityEvents. - - - - - - Two argument delegate used by UnityEvents. - - - - - - - Three argument delegate used by UnityEvents. - - - - - - - - Four argument delegate used by UnityEvents. - - - - - - - - - A zero argument persistent callback that can be saved with the Scene. - - - - - Add a non persistent listener to the UnityEvent. - - Callback function. - - - - Constructor. - - - - - Invoke all registered callbacks (runtime and persistent). - - - - - Remove a non persistent listener from the UnityEvent. - - Callback function. - - - - One argument version of UnityEvent. - - - - - Two argument version of UnityEvent. - - - - - Three argument version of UnityEvent. - - - - - Four argument version of UnityEvent. - - - - - Abstract base class for UnityEvents. - - - - - Get the number of registered persistent listeners. - - - - - Get the target method name of the listener at index index. - - Index of the listener to query. - - - - Get the target component of the listener at index index. - - Index of the listener to query. - - - - Given an object, function name, and a list of argument types; find the method that matches. - - Object to search for the method. - Function name to search for. - Argument types for the function. - - - - Given an object type, function name, and a list of argument types; find the method that matches. - - Object type to search for the method. - Function name to search for. - Argument types for the function. - - - - Remove all non-persisent (ie created from script) listeners from the event. - - - - - Modify the execution state of a persistent listener. - - Index of the listener to query. - State to set. - - - - Controls the scope of UnityEvent callbacks. - - - - - Callback is always issued. - - - - - Callback is not issued. - - - - - Callback is only issued in the Runtime and Editor playmode. - - - - - Types of UnityGUI input and processing events. - - - - - An event that is called when the mouse is clicked. - - - - - An event that is called when the mouse is clicked and dragged. - - - - - An event that is called when the mouse is no longer being clicked. - - - - - User has right-clicked (or control-clicked on the mac). - - - - - Editor only: drag & drop operation exited. - - - - - Editor only: drag & drop operation performed. - - - - - Editor only: drag & drop operation updated. - - - - - Execute a special command (eg. copy & paste). - - - - - Event should be ignored. - - - - - A keyboard key was pressed. - - - - - A keyboard key was released. - - - - - A layout event. - - - - - Mouse button was pressed. - - - - - Mouse was dragged. - - - - - Mouse entered a window (Editor views only). - - - - - Mouse left a window (Editor views only). - - - - - Mouse was moved (Editor views only). - - - - - Mouse button was released. - - - - - A repaint event. One is sent every frame. - - - - - The scroll wheel was moved. - - - - - Direct manipulation device (finger, pen) touched the screen. - - - - - Direct manipulation device (finger, pen) moving into the window (drag). - - - - - Direct manipulation device (finger, pen) moved out of the window (drag). - - - - - Direct manipulation device (finger, pen) moved on the screen (drag). - - - - - Direct manipulation device (finger, pen) stationary event (long touch down). - - - - - Direct manipulation device (finger, pen) left the screen. - - - - - Already processed event. - - - - - Validates a special command (e.g. copy & paste). - - - - - Add this attribute to a class to prevent the class and its inherited classes from being created with ObjectFactory methods. - - - - - Default constructor. - - - - - Add this attribute to a class to prevent creating a Preset from the instances of the class. - - - - - Makes instances of a script always execute, both as part of Play Mode and when editing. - - - - - Makes all instances of a script execute in Edit Mode. - - - - - An exception that will prevent all subsequent immediate mode GUI functions from evaluating for the remainder of the GUI loop. - - - - - A world position that is guaranteed to be on the surface of the NavMesh. - - - - - Unique identifier for the node in the NavMesh to which the world position has been mapped. - - - - - A world position that sits precisely on the surface of the NavMesh or along its links. - - - - - The types of nodes in the navigation data. - - - - - Type of node in the NavMesh representing one surface polygon. - - - - - Type of node in the NavMesh representing a point-to-point connection between two positions on the NavMesh surface. - - - - - Object used for doing navigation operations in a NavMeshWorld. - - - - - Initiates a pathfinding operation between two locations on the NavMesh. - - Array of custom cost values for all of the 32 possible area types. Each value must be at least 1.0f. This parameter is optional and defaults to the area costs configured in the project settings. See Also: NavMesh.GetAreaCost. - Bitmask with values of 1 set at the indices for areas that can be traversed, and values of 0 for areas that are not traversable. This parameter is optional and defaults to NavMesh.AllAreas, if omitted. See Also:. - The start location on the NavMesh for the path. - The location on the NavMesh where the path ends. - - InProgress if the operation was successful and the query is ready to search for a path. - -Failure if the query's NavMeshWorld or any of the received parameters are no longer valid. - - - - - Returns a valid NavMeshLocation for a position and a polygon provided by the user. - - World position of the NavMeshLocation to be created. - Valid identifier for the NavMesh node. - - Object containing the desired position and NavMesh node. - - - - - Creates the NavMeshQuery object and allocates memory to store NavMesh node information, if required. - - NavMeshWorld object used as an entry point to the collection of NavMesh objects. This object that can be used by query operations. - Label indicating the desired life time of the object. (Known issue: Currently allocator has no effect). - The number of nodes that can be temporarily stored in the query during search operations. This value defaults to 0 if no other value is specified. - - - - Destroys the NavMeshQuery and deallocates all memory used by it. - - - - - Obtains the number of nodes in the path that has been computed during a successful NavMeshQuery.UpdateFindPath operation. - - A reference to an int which will be set to the number of NavMesh nodes in the found path. - - Success when the number of nodes in the path was retrieved correctly. - -PartialPath when a path was found but it falls short of the desired end location. - -Failure when the path size can not be evaluated because the preceding call to UpdateFindPath was not successful. - - - - - Returns the identifier of the agent type the NavMesh was baked for or for which the link has been configured. - - Identifier of a node from a NavMesh surface or link. - - Agent type identifier. - - - - - Retrieves the vertices of a given node and the PolygonId|identifiers of all the navigation nodes to which it connects. - - Identifier of a node from a NavMesh surface, for which the vertices and neighbors need to be retrieved. - The result buffer that contains the world positions describing the geometry of the input navigation node. It can have zero capacity. - -NavMeshPolyTypes.Ground|Polygonal nodes of the NavMesh have a minimum of 3 and a maximum of 6 vertices. - -NavMeshPolyTypes.OffMeshConnection|OffMeshConnection nodes are always represented by 4 vertices, regardless of their width. - The result buffer that holds the identifiers of all the navigation nodes immediately reachable from the given node. It can have zero capacity. - The helper result buffer that maps each neighbor node to an edge of the given node. It can have zero capacity. - -The index of an element in edgeIndices is also an index in the neighbors array and the value of that edgeIndices element is an index in the edgeVertices array. - The total number of vertices that describe the geometry of the input node. This is independent of the capacity of the vertices result buffer. - The total number of navigation nodes the input node connects to. This is independent of the capacity of the result buffers (neighbors and edgeIndices). - - Success if Unity can evaluate the neighbors and vertices of the specified node, regardless of the result. The verticesCount and neighborsCount are always valid in this case. - -Failure if Unity can not use the node identifier to retrieve the neighbors or geometry information. Unity does not modify any of the five result parameters (edgeVertices, neighbors, edgeIndices, verticesCount or neighborsCount) in this case. - -InvalidParam is part of the returned flags if the specified navigation node is not NavMeshQuery.IsValid|valid in the query's NavMeshWorld. - -BufferTooSmall is part of the PathQueryStatus flags, that Unity returns from this function, when any of the result buffers you provide are not large enough to hold all the neighbor nodes the input node connects to or all of its edge vertices. - - - - - Copies into the provided array the list of NavMesh nodes that form the path found by the NavMeshQuery operation. - - Data array to be filled with the sequence of NavMesh nodes that comprises the found path. - - Number of path nodes successfully copied into the provided array. - - - - - Returns whether the NavMesh node is a polygon or a link. - - Identifier of a node from a NavMesh surface or link. - - Ground when the node is a polygon on a NavMesh surface. - -OffMeshConnection when the node is a. - - - - - Obtains the end points of the line segment common to two adjacent NavMesh nodes. - - First NavMesh node. - Second NavMesh node. - One of the world points for the resulting separation edge which must be passed through when traversing between the two specified nodes. This point is the left side of the edge when traversing from the first node to the second. - One of the world points for the resulting separation edge which must be passed through when traversing between the two specified nodes. This point is the right side of the edge when traversing from the first node to the second. - - True if a connection exists between the two NavMesh nodes. -False if no connection exists between the two NavMesh nodes. - - - - - Returns true if the node referenced by the specified PolygonId is active in the NavMesh. - - Identifier of the NavMesh node to be checked. - - - - Returns true if the node referenced by the PolygonId contained in the NavMeshLocation is active in the NavMesh. - - Location on the NavMesh to be checked. Same as checking location.polygon directly. - - - - Finds the closest point and PolygonId on the NavMesh for a given world position. - - World position for which the closest point on the NavMesh needs to be found. - Maximum distance, from the specified position, expanding along all three axes, within which NavMesh surfaces are searched. - Identifier for the agent type whose NavMesh surfaces should be selected for this operation. The Humanoid agent type exists for all NavMeshes and has an ID of 0. Other agent types can be defined manually through the Editor. A separate NavMesh surface needs to be baked for each agent type. - Bitmask used to represent areas of the NavMesh that should (value of 1) or shouldn't (values of 0) be sampled. This parameter is optional and defaults to NavMesh.AllAreas if unspecified. See Also:. - - An object with position and valid PolygonId - when a point on the NavMesh has been found. - -An invalid object - when no NavMesh surface with the desired features has been found within the search area. See Also: NavMeshQuery.IsValid. - - - - - Translates a NavMesh location to another position without losing contact with the surface. - - Position to be moved across the NavMesh surface. - World position you require the agent to move to. - Bitmask with values of 1 set at the indices corresponding to areas that can be traversed, and with values of 0 for areas that should not be traversed. This parameter can be omitted, in which case it defaults to NavMesh.AllAreas. See Also:. - - A new location on the NavMesh placed as closely as possible to the specified target position. - -The start location is returned when that start is inside an area which is not allowed by the areaMask. - - - - - Translates a series of NavMesh locations to other positions without losing contact with the surface. - - Array of positions to be moved across the NavMesh surface. At the end of the method call this array contains the resulting locations. - World positions to be used as movement targets by the agent. - Filters for the areas which can be traversed during the movement to each of the locations. - - - - Translates a series of NavMesh locations to other positions without losing contact with the surface, given one common area filter for all of them. - - Array of positions to be moved across the NavMesh surface. At the end of the method call this array contains the resulting locations. - World positions you want the agent to reach when moving to each of the locations. - Filters for the areas which can be traversed during the movement to each of the locations. - - - - Returns the transformation matrix of the NavMesh surface that contains the specified NavMesh node (Read Only). - - NavMesh node for which its owner's transform must be determined. - - Transformation matrix for the surface owning the specified polygon. - -Matrix4x4.identity when the NavMesh node is a. - - - - - Returns the inverse transformation matrix of the NavMesh surface that contains the specified NavMesh node (Read Only). - - NavMesh node for which its owner's inverse transform must be determined. - - Inverse transformation matrix of the surface owning the specified polygon. - -Matrix4x4.identity when the NavMesh node is a. - - - - - Trace a line between two points on the NavMesh. - - Holds the properties of the raycast resulting location. - The start location of the ray on the NavMesh. start.polygon must be of the type NavMeshPolyTypes.Ground. - The desired end of the ray, in world coordinates. - Bitmask that correlates index positions with area types. The index goes from 0 to 31. In each relevant index position, you have to set the value to either 1 or 0. 1 indicates area types that the ray can pass through. 0 indicates area types that block the ray. This parameter is optional. If you leave out this parameter, it defaults to NavMesh.AllAreas. To learn more, see:. - Array of custom cost values for all of the 32 possible area types. They act as multipliers to the distance reported by the ray when crossing various areas. This parameter is optional. If you omit it, it defaults to the area costs that you configured in the Project settings. To learn more, see NavMesh.GetAreaCost. - - Success if the ray can be correctly traced using the provided arguments. - -Failure if the start location is not valid in the query's NavMeshWorld, or if it is inside an area not permitted by the areaMask argument, or when it is on a. - - - - - Trace a line between two points on the NavMesh, and return the list of polygons through which it passed. - - Holds the properties of the raycast resulting location. - A buffer that will be filled with the sequence of polygons through which the ray passes. - The reported number of polygons through which the ray has passed, all stored in the path buffer. It will not be greater than path.Length. - The start location of the ray on the NavMesh. start.polygon must be of the type NavMeshPolyTypes.Ground. - The desired end of the ray, in world coordinates. - A bitfield that specifies which NavMesh areas can be traversed when the ray is traced. This parameter is optional. If you do not fill out this parameter, it defaults to NavMesh.AllAreas. - Cost multipliers that affect the distance reported by the ray over different area types. This parameter is optional. If you omit it, it defaults to the area costs that you configured in the Project settings. - - Success if the ray can be correctly traced using the provided arguments. - -Failure if the start location is not valid in the query's NavMeshWorld, or if it is inside an area not permitted by the areaMask argument, or when it is on a. - -BufferTooSmall is part of the returned flags when the provided path buffer is not large enough to hold all the polygons that the ray passed through. - - - - - Continues a path search that is in progress. - - Maximum number of nodes to be traversed by the search algorithm during this call. - Outputs the actual number of nodes that have been traversed during this call. - - InProgress if the search needs to continue further by calling UpdateFindPath again. - -Success if the search is completed and a path has been found or not. - -Failure if the search for the desired position could not be completed because the NavMesh has changed significantly since the search was initiated. - -Additionally the returned value can contain the OutOfNodes flag when the pathNodePoolSize parameter for the NavMeshQuery initialization was not large enough to accommodate the search space. - - - - - Assembles together a collection of NavMesh surfaces and links that are used as a whole for performing navigation operations. - - - - - Tells the NavMesh world to halt any changes until the specified job is completed. - - The job that needs to be completed before the NavMesh world can be modified in any way. - - - - Returns a reference to the single NavMeshWorld that can currently exist and be used in Unity. - - - - - Returns true if the NavMeshWorld has been properly initialized. - - - - - Bit flags representing the resulting state of NavMeshQuery operations. - - - - - The node buffer of the query was too small to store all results. - - - - - The operation has failed. - - - - - The operation is in progress. - - - - - A parameter did not contain valid information, useful for carring out the NavMesh query. - - - - - Operation ran out of memory. - - - - - Query ran out of node stack space during a search. - - - - - Query did not reach the end location, returning best guess. - - - - - Bitmask that has 0 set for the Success, Failure and InProgress bits and 1 set for all the other flags. - - - - - The operation was successful. - - - - - Data in the NavMesh cannot be recognized and used. - - - - - Data in the NavMesh world has a wrong version. - - - - - Represents a compact identifier for the data of a NavMesh node. - - - - - Returns true if two PolygonId objects refer to the same NavMesh node. - - - - - - - Returns true if two PolygonId objects refer to the same NavMesh node. - - - - - - - Returns the hash code for use in collections. - - - - - Returns true if the PolygonId has been created empty and has never pointed to any node in the NavMesh. - - - - - Returns true if two PolygonId objects refer to the same NavMesh node or if they are both null. - - - - - - - Returns true if two PolygonId objects refer to different NavMesh nodes or if only one of them is null. - - - - - - - Static class providing experimental extension methods for AnimationPlayableOutput . - - - - - Gets the stream source of the specified AnimationPlayableOutput. - - The AnimationPlayableOutput instance that calls this method. - - Returns the AnimationStreamSource of the output. - - - - - Gets the priority index of the specified AnimationPlayableOutput. - - The AnimationPlayableOutput instance that calls this method. - - Returns the sorting order of the output. - - - - - Sets the stream source for the specified AnimationPlayableOutput. - - The AnimationPlayableOutput instance that calls this method. - The AnimationStreamSource to apply on this output. - - - - Sets the sorting order for the specified AnimationPlayableOutput. - - The AnimationPlayableOutput instance that calls this method. - The sorting order to apply to this output. - - - - Describes how an AnimationStream is initialized - - - - - AnimationStream will be initialized with the default values from the Animator. - - - - - AnimationStream will be initialized with the values from the previous AnimationPlayableOutput connected to the same Animator. - - - - - Provides access to the audio samples generated by Unity objects such as VideoPlayer. - - - - - Number of sample frames available for consuming with Experimental.Audio.AudioSampleProvider.ConsumeSampleFrames. - - - - - The number of audio channels per sample frame. - - - - - Pointer to the native function that provides access to audio sample frames. - - - - - Enables the Experimental.Audio.AudioSampleProvider.sampleFramesAvailable events. - - - - - If true, buffers produced by ConsumeSampleFrames will get padded when silence if there are less available than asked for. Otherwise, the extra sample frames in the buffer will be left unchanged. - - - - - Number of sample frames that can still be written to by the sample producer before overflowing. - - - - - Then the free sample count falls below this threshold, the Experimental.Audio.AudioSampleProvider.sampleFramesAvailable event and associated native is emitted. - - - - - Unique identifier for this instance. - - - - - The maximum number of sample frames that can be accumulated inside the internal buffer before an overflow event is emitted. - - - - - Object where this provider came from. - - - - - Invoked when the number of available sample frames goes beyond the threshold set with Experimental.Audio.AudioSampleProvider.freeSampleFrameCountLowThreshold. - - Number of available sample frames. - - - - Invoked when the number of available sample frames goes beyond the maximum that fits in the internal buffer. - - The number of sample frames that were dropped due to the overflow. - - - - The expected playback rate for the sample frames produced by this class. - - - - - Index of the track in the object that created this provider. - - - - - True if the object is valid. - - - - - Clear the native handler set with Experimental.Audio.AudioSampleProvider.SetSampleFramesAvailableNativeHandler. - - - - - Clear the native handler set with Experimental.Audio.AudioSampleProvider.SetSampleFramesOverflowNativeHandler. - - - - - Consume sample frames from the internal buffer. - - Buffer where the consumed samples will be transferred. - - How many sample frames were written into the buffer passed in. - - - - - Type that represents the native function pointer for consuming sample frames. - - Id of the provider. See Experimental.Audio.AudioSampleProvider.id. - Pointer to the sample frames buffer to fill. The actual C type is float*. - Number of sample frames that can be written into interleavedSampleFrames. - - - - Release internal resources. Inherited from IDisposable. - - - - - Type that represents the native function pointer for handling sample frame events. - - User data specified when the handler was set. The actual C type is void*. - Id of the provider. See Experimental.Audio.AudioSampleProvider.id. - Number of sample frames available or overflowed, depending on event type. - - - - Delegate for sample frame events. - - Provider emitting the event. - How many sample frames are available, or were dropped, depending on the event. - - - - Set the native event handler for events emitted when the number of available sample frames crosses the threshold. - - Pointer to the function to invoke when the event is emitted. - User data to be passed to the handler when invoked. The actual C type is void*. - - - - Set the native event handler for events emitted when the internal sample frame buffer overflows. - - Pointer to the function to invoke when the event is emitted. - User data to be passed to the handler when invoked. The actual C type is void*. - - - - Sets the method to use to compute the angular attenuation of spot lights. - - - - - No falloff inside inner angle then compute falloff using analytic formula. - - - - - Uses a lookup table to calculate falloff and does not support the inner angle. - - - - - A helper structure used to initialize a LightDataGI structure with cookie information. - - - - - The cookie texture's instance id projected by the light. - - - - - The uniform scale factor for downscaling cookies during lightmapping. Can be used as an optimization when full resolution cookies are not needed for indirect lighting. - - - - - The scale factors controlling how the directional light's cookie is projected into the scene. This parameter should be set to 1 for all other light types. - - - - - Returns a default initialized cookie helper struct. - - - - - A helper structure used to initialize a LightDataGI structure as a directional light. - - - - - The direct light color. - - - - - The indirect light color. - - - - - The light's instanceID. - - - - - The lightmode. - - - - - The light's orientation. Only relevant for cookie placement. - - - - - The penumbra width for soft shadows in radians. - - - - - The light's position. Only relevant for cookie placement. - - - - - True if the light casts shadows, otherwise False. - - - - - A helper structure used to initialize a LightDataGI structure as a disc light. - - - - - The direct light color. - - - - - The falloff model to use for baking the disc light. - - - - - The indirect light color. - - - - - The light's instanceID. - - - - - The lightmode. - - - - - The light's orientation. - - - - - The light's position. - - - - - The radius of the disc light. - - - - - The light's range. - - - - - True if the light casts shadows, otherwise False. - - - - - Available falloff models for baking. - - - - - Inverse squared distance falloff model. - - - - - Inverse squared distance falloff model (without smooth range attenuation). - - - - - Quadratic falloff model. - - - - - Linear falloff model. - - - - - Falloff model is undefined. - - - - - The interop structure to pass light information to the light baking backends. There are helper structures for Directional, Point, Spot and Rectangle lights to correctly initialize this structure. - - - - - The color of the light. - - - - - The cone angle for spot lights. - - - - - The cookie texture's instance id projected by the light. - - - - - The uniform scale factor for downscaling cookies during lightmapping. Can be used as an optimization when full resolution cookies are not needed for indirect lighting. - - - - - The falloff model to use for baking point and spot lights. - - - - - The indirect color of the light. - - - - - The inner cone angle for spot lights. - - - - - The light's instanceID. - - - - - The lightmap mode for the light. - - - - - The orientation of the light. - - - - - The position of the light. - - - - - The range of the light. Unused for directional lights. - - - - - Set to 1 for shadow casting lights, 0 otherwise. - - - - - The light's sphere radius for point and spot lights, or the width for rectangle lights. - - - - - The height for rectangle lights. - - - - - The type of the light. - - - - - Initialize the struct with the parameters from the given light type. - - - - - - Initialize the struct with the parameters from the given light type. - - - - - - Initialize the struct with the parameters from the given light type. - - - - - - Initialize the struct with the parameters from the given light type. - - - - - - Initialize the struct with the parameters from the given light type. - - - - - - Initialize the struct with the parameters from the given light type. - - - - - - Initialize a light so that the baking backends ignore it. - - - - - - Utility class for converting Unity Lights to light types recognized by the baking backends. - - - - - Extracts informations from Lights. - - The lights baketype. - - Returns the light's light mode. - - - - - Extract type specific information from Lights. - - The input light. - Extracts directional light information. - Extracts point light information. - Extracts spot light information. - Extracts rectangle light information. - - - - Extract type specific information from Lights. - - The input light. - Extracts directional light information. - Extracts point light information. - Extracts spot light information. - Extracts rectangle light information. - - - - Extract type specific information from Lights. - - The input light. - Extracts directional light information. - Extracts point light information. - Extracts spot light information. - Extracts rectangle light information. - - - - Extract type specific information from Lights. - - The input light. - Extracts directional light information. - Extracts point light information. - Extracts spot light information. - Extracts rectangle light information. - - - - Extracts the indirect color from a light. - - - - - - Extracts the inner cone angle of spot lights. - - - - - - Interface to the light baking backends. - - - - - Get the currently set conversion delegate. - - - Returns the currently set conversion delegate. - - - - - Delegate called when converting lights into a form that the baking backends understand. - - The list of lights to be converted. - The output generated by the delegate function. Lights that should be skipped must be added to the output, initialized with InitNoBake on the LightDataGI structure. - - - - Resets the light conversion delegate to Unity's default conversion function. - - - - - Set a delegate that converts a list of lights to a list of LightDataGI structures that are passed to the baking backends. Must be reset by calling ResetDelegate again. - - - - - - The lightmode. A light can be realtime, mixed, baked or unknown. Unknown lights will be ignored by the baking backends. - - - - - The light is fully baked and has no realtime component. - - - - - The light is mixed. Mixed lights are interpreted based on the global light mode setting in the lighting window. - - - - - The light is realtime. No contribution will be baked in lightmaps or light probes. - - - - - The light should be ignored by the baking backends. - - - - - The light type. - - - - - An infinite directional light. - - - - - A light shaped like a disc emitting light into the hemisphere that it is facing. - - - - - A point light emitting light in all directions. - - - - - A light shaped like a rectangle emitting light into the hemisphere that it is facing. - - - - - A spot light emitting light in a direction with a cone shaped opening angle. - - - - - A box-shaped spot light. This type is only compatible with Scriptable Render Pipelines; it is not compatible with the built-in render pipeline. - - - - - A pyramid-shaped spot light. This type is only compatible with Scriptable Render Pipelines; it is not compatible with the built-in render pipeline. - - - - - Contains normalized linear color values for red, green, blue in the range of 0 to 1, and an additional intensity value. - - - - - The blue color value in the range of 0.0 to 1.0. - - - - - The green color value in the range of 0.0 to 1.0. - - - - - The intensity value used to scale the red, green and blue values. - - - - - The red color value in the range of 0.0 to 1.0. - - - - - Returns a black color. - - - Returns a black color. - - - - - Converts a Light's color value to a normalized linear color value, automatically handling gamma conversion if necessary. - - Light color. - Light intensity. - - Returns the normalized linear color value. - - - - - A helper structure used to initialize a LightDataGI structure as a point light. - - - - - The direct light color. - - - - - The falloff model to use for baking the point light. - - - - - The indirect light color. - - - - - The light's instanceID. - - - - - The lightmode. - - - - - The light's position. - - - - - The light's range. - - - - - True if the light casts shadows, otherwise False. - - - - - The light's sphere radius, influencing soft shadows. - - - - - A helper structure used to initialize a LightDataGI structure as a rectangle light. - - - - - The direct light color. - - - - - The falloff model to use for baking the rectangular light. - - - - - The height of the rectangle light. - - - - - The indirect light color. - - - - - The light's instanceID. - - - - - The lightmode. - - - - - The light's orientation. - - - - - The light's position. - - - - - The light's range. - - - - - True if the light casts shadows, otherwise False. - - - - - The width of the rectangle light. - - - - - Experimental render settings features. - - - - - If enabled, ambient trilight will be sampled using the old radiance sampling method. - - - - - A helper structure used to initialize a LightDataGI structure as a spot light. - - - - - The angular falloff model to use for baking the spot light. - - - - - The direct light color. - - - - - The outer angle for the spot light. - - - - - The falloff model to use for baking the spot light. - - - - - The indirect light color. - - - - - The inner angle for the spot light. - - - - - The light's instanceID. - - - - - The lightmode. - - - - - The light's orientation. - - - - - The light's position. - - - - - The light's range. - - - - - True if the light casts shadows, otherwise False. - - - - - The light's sphere radius, influencing soft shadows. - - - - - Use this Struct to help initialize a LightDataGI structure as a box-shaped spot light. - - - - - The direct light color. - - - - - The height of the box light. - - - - - The indirect light color. - - - - - The light's instanceID. - - - - - The lightmode. - - - - - The light's orientation. - - - - - The light's position. - - - - - The light's range. - - - - - Specifies whether the light casts shadows or not. This is true if the light does cast shadows and false otherwise. - - - - - The width of the box light. - - - - - Use this Struct to help initialize a LightDataGI structure as a pyramid-shaped spot light. - - - - - The opening angle of the shorter side of the pyramid light. - - - - - The aspect ratio for the pyramid shape. Values larger than 1 extend the width and values between 0 and 1 extend the height. - - - - - The direct light color. - - - - - The falloff model to use for baking the pyramid light. - - - - - The indirect light color. - - - - - The light's instanceID. - - - - - The lightmode. - - - - - The light's orientation. - - - - - The light's position. - - - - - The light's range. - - - - - Specifies whether the light casts shadows or not. This is true if the light does cast shadows and false otherwise. - - - - - An implementation of IPlayable that produces a Camera texture. - - - - - Creates a CameraPlayable in the PlayableGraph. - - The PlayableGraph object that will own the CameraPlayable. - Camera used to produce a texture in the PlayableGraph. - - A CameraPlayable linked to the PlayableGraph. - - - - - An implementation of IPlayable that allows application of a Material shader to one or many texture inputs to produce a texture output. - - - - - Creates a MaterialEffectPlayable in the PlayableGraph. - - The PlayableGraph object that will own the MaterialEffectPlayable. - Material used to modify linked texture playable inputs. - Shader pass index.(Note: -1 for all passes). - - A MaterialEffectPlayable linked to the PlayableGraph. - - - - - An implementation of IPlayable that allows mixing two textures. - - - - - Creates a TextureMixerPlayable in the PlayableGraph. - - The PlayableGraph object that will own the TextureMixerPlayable. - - A TextureMixerPlayable linked to the PlayableGraph. - - - - - A PlayableBinding that contains information representing a TexturePlayableOutput. - - - - - Creates a PlayableBinding that contains information representing a TexturePlayableOutput. - - A reference to a UnityEngine.Object that acts as a key for this binding. - The name of the TexturePlayableOutput. - - Returns a PlayableBinding that contains information that is used to create a TexturePlayableOutput. - - - - - An IPlayableOutput implementation that will be used to manipulate textures. - - - - - Returns an invalid TexturePlayableOutput. - - - - - - Use a default format to create either Textures or RenderTextures from scripts based on platform specific capability. - - - - - - Represents the default platform specific HDR format. - - - - - Represents the default platform-specific LDR format. If the project uses the linear rendering mode, the actual format is sRGB. If the project uses the gamma rendering mode, the actual format is UNorm. - - - - - The ExternalGPUProfiler API allows developers to programatically take GPU frame captures in conjunction with supported external GPU profilers. - -GPU frame captures can be used to both analyze performance and debug graphics related issues. - - - - - Begins the current GPU frame capture in the external GPU profiler. - - - - - Ends the current GPU frame capture in the external GPU profiler. - - - - - Returns true when a development build is launched by an external GPU profiler. - - - - - Use this format usages to figure out the capabilities of specific GraphicsFormat - - - - - Use this to blend on a rendertexture. - - - - - Use this to get pixel data from a texture. - - - - - Use this to sample textures with a linear filter - - - - - Use this to perform resource load and store on a texture - - - - - Use this to create and render to a MSAA 2X rendertexture. - - - - - Use this to create and render to a MSAA 4X rendertexture. - - - - - Use this to create and render to a MSAA 8X rendertexture. - - - - - Use this to read back pixels data from a rendertexture. - - - - - Use this to create and render to a rendertexture. - - - - - Use this to create and sample textures. - - - - - Use this to set pixel data to a texture. - - - - - Use this to set pixel data to a texture using `SetPixels32`. - - - - - Use this to create sparse textures - - - - - Use this enumeration to create and render to the Stencil sub element of a RenderTexture. - - - - - Use this format to create either Textures or RenderTextures from scripts. - - - - - A four-component, 64-bit packed unsigned normalized format that has a 10-bit A component in bits 30..39, a 10-bit R component in bits 20..29, a 10-bit G component in bits 10..19, and a 10-bit B component in bits 0..9. The components are gamma encoded and their values range from -0.5271 to 1.66894. The alpha component is clamped to either 0.0 or 1.0 on sampling, rendering, and writing operations. - - - - - A four-component, 64-bit packed unsigned normalized format that has a 10-bit A component in bits 30..39, a 10-bit R component in bits 20..29, a 10-bit G component in bits 10..19, and a 10-bit B component in bits 0..9. The components are linearly encoded and their values range from -0.752941 to 1.25098 (pre-expansion). The alpha component is clamped to either 0.0 or 1.0 on sampling, rendering, and writing operations. - - - - - A four-component, 16-bit packed unsigned normalized format that has a 1-bit A component in bit 15, a 5-bit R component in bits 10..14, a 5-bit G component in bits 5..9, and a 5-bit B component in bits 0..4. - - - - - A four-component, 32-bit packed signed integer format that has a 2-bit A component in bits 30..31, a 10-bit B component in bits 20..29, a 10-bit G component in bits 10..19, and a 10-bit R component in bits 0..9. - - - - - A four-component, 32-bit packed unsigned integer format that has a 2-bit A component in bits 30..31, a 10-bit B component in bits 20..29, a 10-bit G component in bits 10..19, and a 10-bit R component in bits 0..9. - - - - - A four-component, 32-bit packed unsigned normalized format that has a 2-bit A component in bits 30..31, a 10-bit B component in bits 20..29, a 10-bit G component in bits 10..19, and a 10-bit R component in bits 0..9. - - - - - A four-component, 32-bit packed signed integer format that has a 2-bit A component in bits 30..31, a 10-bit R component in bits 20..29, a 10-bit G component in bits 10..19, and a 10-bit B component in bits 0..9. - - - - - A four-component, 32-bit packed unsigned integer format that has a 2-bit A component in bits 30..31, a 10-bit R component in bits 20..29, a 10-bit G component in bits 10..19, and a 10-bit B component in bits 0..9. - - - - - A four-component, 32-bit packed unsigned normalized format that has a 2-bit A component in bits 30..31, a 10-bit R component in bits 20..29, a 10-bit G component in bits 10..19, and a 10-bit B component in bits 0..9. - - - - - A four-component, 32-bit packed unsigned normalized format that has a 2-bit A component in bits 30..31, a 10-bit R component in bits 20..29, a 10-bit G component in bits 10..19, and a 10-bit B component in bits 0..9. The components are gamma encoded and their values range from -0.5271 to 1.66894. The alpha component is clamped to either 0.0 or 1.0 on sampling, rendering, and writing operations. - - - - - A four-component, 32-bit packed unsigned normalized format that has a 2-bit A component in bits 30..31, a 10-bit R component in bits 20..29, a 10-bit G component in bits 10..19, and a 10-bit B component in bits 0..9. The components are linearly encoded and their values range from -0.752941 to 1.25098 (pre-expansion). The alpha component is clamped to either 0.0 or 1.0 on sampling, rendering, and writing operations. - - - - - A three-component, 32-bit packed unsigned floating-point format that has a 10-bit B component in bits 22..31, an 11-bit G component in bits 11..21, an 11-bit R component in bits 0..10. - - - - - A four-component, 16-bit packed unsigned normalized format that has a 4-bit B component in bits 12..15, a 4-bit G component in bits 8..11, a 4-bit R component in bits 4..7, and a 4-bit A component in bits 0..3. - - - - - A four-component, 16-bit packed unsigned normalized format that has a 5-bit B component in bits 11..15, a 5-bit G component in bits 6..10, a 5-bit R component in bits 1..5, and a 1-bit A component in bit 0. - - - - - A three-component, 16-bit packed unsigned normalized format that has a 5-bit B component in bits 11..15, a 6-bit G component in bits 5..10, and a 5-bit R component in bits 0..4. - - - - - A three-component, 24-bit signed integer format that has an 8-bit B component in byte 0, an 8-bit G component in byte 1, and an 8-bit R component in byte 2. - - - - - A three-component, 24-bit signed normalized format that has an 8-bit B component in byte 0, an 8-bit G component in byte 1, and an 8-bit R component in byte 2. - - - - - A three-component, 24-bit unsigned normalized format that has an 8-bit R component stored with sRGB nonlinear encoding in byte 0, an 8-bit G component stored with sRGB nonlinear encoding in byte 1, and an 8-bit B component stored with sRGB nonlinear encoding in byte 2. - - - - - A three-component, 24-bit unsigned integer format that has an 8-bit B component in byte 0, an 8-bit G component in byte 1, and an 8-bit R component in byte 2 - - - - - A three-component, 24-bit unsigned normalized format that has an 8-bit B component in byte 0, an 8-bit G component in byte 1, and an 8-bit R component in byte 2. - - - - - A four-component, 32-bit signed integer format that has an 8-bit B component in byte 0, an 8-bit G component in byte 1, an 8-bit R component in byte 2, and an 8-bit A component in byte 3. - - - - - A four-component, 32-bit signed normalized format that has an 8-bit B component in byte 0, an 8-bit G component in byte 1, an 8-bit R component in byte 2, and an 8-bit A component in byte 3. - - - - - A four-component, 32-bit unsigned normalized format that has an 8-bit B component stored with sRGB nonlinear encoding in byte 0, an 8-bit G component stored with sRGB nonlinear encoding in byte 1, an 8-bit R component stored with sRGB nonlinear encoding in byte 2, and an 8-bit A component in byte 3. - - - - - A four-component, 32-bit unsigned integer format that has an 8-bit B component in byte 0, an 8-bit G component in byte 1, an 8-bit R component in byte 2, and an 8-bit A component in byte 3. - - - - - A four-component, 32-bit unsigned normalized format that has an 8-bit B component in byte 0, an 8-bit G component in byte 1, an 8-bit R component in byte 2, and an 8-bit A component in byte 3. - - - - - A three-component, 32-bit packed unsigned floating-point format that has a 5-bit shared exponent in bits 27..31, a 9-bit B component mantissa in bits 18..26, a 9-bit G component mantissa in bits 9..17, and a 9-bit R component mantissa in bits 0..8. - - - - - The format is not specified. - - - - - A one-component, block-compressed format where each 64-bit compressed texel block encodes a 4×4 rectangle of signed normalized red texel data. - - - - - A one-component, block-compressed format where each 64-bit compressed texel block encodes a 4×4 rectangle of unsigned normalized red texel data. - - - - - A one-component, ETC2 compressed format where each 64-bit compressed texel block encodes a 4×4 rectangle of signed normalized red texel data. - - - - - A one-component, ETC2 compressed format where each 64-bit compressed texel block encodes a 4×4 rectangle of unsigned normalized red texel data. - - - - - A four-component, 32-bit packed unsigned normalized format that has a 10-bit R component in bits 20..29, a 10-bit G component in bits 10..19, and a 10-bit B component in bits 0..9. The components are gamma encoded and their values range from -0.5271 to 1.66894. The alpha component is clamped to either 0.0 or 1.0 on sampling, rendering, and writing operations. - - - - - A four-component, 32-bit packed unsigned normalized format that has a 10-bit R component in bits 20..29, a 10-bit G component in bits 10..19, and a 10-bit B component in bits 0..9. The components are linearly encoded and their values range from -0.752941 to 1.25098 (pre-expansion). - - - - - A one-component, 16-bit signed floating-point format that has a single 16-bit R component. - - - - - A one-component, 16-bit signed integer format that has a single 16-bit R component. - - - - - A one-component, 16-bit signed normalized format that has a single 16-bit R component. - - - - - A one-component, 16-bit unsigned integer format that has a single 16-bit R component. - - - - - A one-component, 16-bit unsigned normalized format that has a single 16-bit R component. - - - - - A two-component, 32-bit signed floating-point format that has a 16-bit R component in bytes 0..1, and a 16-bit G component in bytes 2..3. - - - - - A two-component, 32-bit signed integer format that has a 16-bit R component in bytes 0..1, and a 16-bit G component in bytes 2..3. - - - - - A two-component, 32-bit signed normalized format that has a 16-bit R component in bytes 0..1, and a 16-bit G component in bytes 2..3. - - - - - A two-component, 32-bit unsigned integer format that has a 16-bit R component in bytes 0..1, and a 16-bit G component in bytes 2..3. - - - - - A two-component, 32-bit unsigned normalized format that has a 16-bit R component in bytes 0..1, and a 16-bit G component in bytes 2..3. - - - - - A three-component, 48-bit signed floating-point format that has a 16-bit R component in bytes 0..1, a 16-bit G component in bytes 2..3, and a 16-bit B component in bytes 4..5. - - - - - A three-component, 48-bit signed integer format that has a 16-bit R component in bytes 0..1, a 16-bit G component in bytes 2..3, and a 16-bit B component in bytes 4..5. - - - - - A three-component, 48-bit signed normalized format that has a 16-bit R component in bytes 0..1, a 16-bit G component in bytes 2..3, and a 16-bit B component in bytes 4..5. - - - - - A three-component, 48-bit unsigned integer format that has a 16-bit R component in bytes 0..1, a 16-bit G component in bytes 2..3, and a 16-bit B component in bytes 4..5. - - - - - A three-component, 48-bit unsigned normalized format that has a 16-bit R component in bytes 0..1, a 16-bit G component in bytes 2..3, and a 16-bit B component in bytes 4..5. - - - - - A four-component, 64-bit signed floating-point format that has a 16-bit R component in bytes 0..1, a 16-bit G component in bytes 2..3, a 16-bit B component in bytes 4..5, and a 16-bit A component in bytes 6..7. - - - - - A four-component, 64-bit signed integer format that has a 16-bit R component in bytes 0..1, a 16-bit G component in bytes 2..3, a 16-bit B component in bytes 4..5, and a 16-bit A component in bytes 6..7. - - - - - A four-component, 64-bit signed normalized format that has a 16-bit R component in bytes 0..1, a 16-bit G component in bytes 2..3, a 16-bit B component in bytes 4..5, and a 16-bit A component in bytes 6..7. - - - - - A four-component, 64-bit unsigned integer format that has a 16-bit R component in bytes 0..1, a 16-bit G component in bytes 2..3, a 16-bit B component in bytes 4..5, and a 16-bit A component in bytes 6..7. - - - - - A four-component, 64-bit unsigned normalized format that has a 16-bit R component in bytes 0..1, a 16-bit G component in bytes 2..3, a 16-bit B component in bytes 4..5, and a 16-bit A component in bytes 6..7. - - - - - A one-component, 32-bit signed floating-point format that has a single 32-bit R component. - - - - - A one-component, 32-bit signed integer format that has a single 32-bit R component. - - - - - A one-component, 32-bit unsigned integer format that has a single 32-bit R component. - - - - - A two-component, 64-bit signed floating-point format that has a 32-bit R component in bytes 0..3, and a 32-bit G component in bytes 4..7. - - - - - A two-component, 64-bit signed integer format that has a 32-bit R component in bytes 0..3, and a 32-bit G component in bytes 4..7. - - - - - A two-component, 64-bit unsigned integer format that has a 32-bit R component in bytes 0..3, and a 32-bit G component in bytes 4..7. - - - - - A three-component, 96-bit signed floating-point format that has a 32-bit R component in bytes 0..3, a 32-bit G component in bytes 4..7, and a 32-bit B component in bytes 8..11. - - - - - A three-component, 96-bit signed integer format that has a 32-bit R component in bytes 0..3, a 32-bit G component in bytes 4..7, and a 32-bit B component in bytes 8..11. - - - - - A three-component, 96-bit unsigned integer format that has a 32-bit R component in bytes 0..3, a 32-bit G component in bytes 4..7, and a 32-bit B component in bytes 8..11. - - - - - A four-component, 128-bit signed floating-point format that has a 32-bit R component in bytes 0..3, a 32-bit G component in bytes 4..7, a 32-bit B component in bytes 8..11, and a 32-bit A component in bytes 12..15. - - - - - A four-component, 128-bit signed integer format that has a 32-bit R component in bytes 0..3, a 32-bit G component in bytes 4..7, a 32-bit B component in bytes 8..11, and a 32-bit A component in bytes 12..15. - - - - - A four-component, 128-bit unsigned integer format that has a 32-bit R component in bytes 0..3, a 32-bit G component in bytes 4..7, a 32-bit B component in bytes 8..11, and a 32-bit A component in bytes 12..15. - - - - - A four-component, 16-bit packed unsigned normalized format that has a 4-bit R component in bits 12..15, a 4-bit G component in bits 8..11, a 4-bit B component in bits 4..7, and a 4-bit A component in bits 0..3. - - - - - A four-component, 16-bit packed unsigned normalized format that has a 5-bit R component in bits 11..15, a 5-bit G component in bits 6..10, a 5-bit B component in bits 1..5, and a 1-bit A component in bit 0. - - - - - A three-component, 16-bit packed unsigned normalized format that has a 5-bit R component in bits 11..15, a 6-bit G component in bits 5..10, and a 5-bit B component in bits 0..4. - - - - - A one-component, 8-bit signed integer format that has a single 8-bit R component. - - - - - A one-component, 8-bit signed normalized format that has a single 8-bit R component. - - - - - A one-component, 8-bit unsigned normalized format that has a single 8-bit R component stored with sRGB nonlinear encoding. - - - - - A one-component, 8-bit unsigned integer format that has a single 8-bit R component. - - - - - A one-component, 8-bit unsigned normalized format that has a single 8-bit R component. - - - - - A two-component, 16-bit signed integer format that has an 8-bit R component in byte 0, and an 8-bit G component in byte 1. - - - - - A two-component, 16-bit signed normalized format that has an 8-bit R component stored with sRGB nonlinear encoding in byte 0, and an 8-bit G component stored with sRGB nonlinear encoding in byte 1. - - - - - A two-component, 16-bit unsigned normalized format that has an 8-bit R component stored with sRGB nonlinear encoding in byte 0, and an 8-bit G component stored with sRGB nonlinear encoding in byte 1. - - - - - A two-component, 16-bit unsigned integer format that has an 8-bit R component in byte 0, and an 8-bit G component in byte 1. - - - - - A two-component, 16-bit unsigned normalized format that has an 8-bit R component stored with sRGB nonlinear encoding in byte 0, and an 8-bit G component stored with sRGB nonlinear encoding in byte 1. - - - - - A three-component, 24-bit signed integer format that has an 8-bit R component in byte 0, an 8-bit G component in byte 1, and an 8-bit B component in byte 2. - - - - - A three-component, 24-bit signed normalized format that has an 8-bit R component in byte 0, an 8-bit G component in byte 1, and an 8-bit B component in byte 2. - - - - - A three-component, 24-bit unsigned normalized format that has an 8-bit R component stored with sRGB nonlinear encoding in byte 0, an 8-bit G component stored with sRGB nonlinear encoding in byte 1, and an 8-bit B component stored with sRGB nonlinear encoding in byte 2. - - - - - A three-component, 24-bit unsigned integer format that has an 8-bit R component in byte 0, an 8-bit G component in byte 1, and an 8-bit B component in byte 2. - - - - - A three-component, 24-bit unsigned normalized format that has an 8-bit R component in byte 0, an 8-bit G component in byte 1, and an 8-bit B component in byte 2. - - - - - A four-component, 32-bit signed integer format that has an 8-bit R component in byte 0, an 8-bit G component in byte 1, an 8-bit B component in byte 2, and an 8-bit A component in byte 3. - - - - - A four-component, 32-bit signed normalized format that has an 8-bit R component in byte 0, an 8-bit G component in byte 1, an 8-bit B component in byte 2, and an 8-bit A component in byte 3. - - - - - A four-component, 32-bit unsigned normalized format that has an 8-bit R component stored with sRGB nonlinear encoding in byte 0, an 8-bit G component stored with sRGB nonlinear encoding in byte 1, an 8-bit B component stored with sRGB nonlinear encoding in byte 2, and an 8-bit A component in byte 3. - - - - - A four-component, 32-bit unsigned integer format that has an 8-bit R component in byte 0, an 8-bit G component in byte 1, an 8-bit B component in byte 2, and an 8-bit A component in byte 3. - - - - - A four-component, 32-bit unsigned normalized format that has an 8-bit R component in byte 0, an 8-bit G component in byte 1, an 8-bit B component in byte 2, and an 8-bit A component in byte 3. - - - - - A two-component, block-compressed format where each 128-bit compressed texel block encodes a 4×4 rectangle of signed normalized RG texel data with the first 64 bits encoding red values followed by 64 bits encoding green values. - - - - - A two-component, block-compressed format where each 128-bit compressed texel block encodes a 4×4 rectangle of unsigned normalized RG texel data with the first 64 bits encoding red values followed by 64 bits encoding green values. - - - - - A two-component, ETC2 compressed format where each 128-bit compressed texel block encodes a 4×4 rectangle of signed normalized RG texel data with the first 64 bits encoding red values followed by 64 bits encoding green values. - - - - - A two-component, ETC2 compressed format where each 128-bit compressed texel block encodes a 4×4 rectangle of unsigned normalized RG texel data with the first 64 bits encoding red values followed by 64 bits encoding green values. - - - - - A four-component, ETC2 compressed format where each 64-bit compressed texel block encodes a 4×4 rectangle of unsigned normalized RGB texel data with sRGB nonlinear encoding, and provides 1 bit of alpha. - - - - - A four-component, ETC2 compressed format where each 64-bit compressed texel block encodes a 4×4 rectangle of unsigned normalized RGB texel data, and provides 1 bit of alpha. - - - - - A three-component, block-compressed format where each 128-bit compressed texel block encodes a 4×4 rectangle of signed floating-point RGB texel data. - - - - - A three-component, block-compressed format where each 128-bit compressed texel block encodes a 4×4 rectangle of unsigned floating-point RGB texel data. - - - - - A three-component, ETC compressed format where each 64-bit compressed texel block encodes a 4×4 rectangle of unsigned normalized RGB texel data. This format has no alpha and is considered opaque. - - - - - A three-component, ETC2 compressed format where each 64-bit compressed texel block encodes a 4×4 rectangle of unsigned normalized RGB texel data with sRGB nonlinear encoding. This format has no alpha and is considered opaque. - - - - - A three-component, ETC2 compressed format where each 64-bit compressed texel block encodes a 4×4 rectangle of unsigned normalized RGB texel data. This format has no alpha and is considered opaque. - - - - - A three-component, PVRTC compressed format where each 64-bit compressed texel block encodes a 8×4 rectangle of unsigned normalized RGB texel data with sRGB nonlinear encoding. This format has no alpha and is considered opaque. - - - - - A three-component, PVRTC compressed format where each 64-bit compressed texel block encodes a 8×4 rectangle of unsigned normalized RGB texel data. This format has no alpha and is considered opaque. - - - - - A three-component, PVRTC compressed format where each 64-bit compressed texel block encodes a 4×4 rectangle of unsigned normalized RGB texel data with sRGB nonlinear encoding. This format has no alpha and is considered opaque. - - - - - A three-component, PVRTC compressed format where each 64-bit compressed texel block encodes a 4×4 rectangle of unsigned normalized RGB texel data. This format has no alpha and is considered opaque. - - - - - A four-component, ASTC compressed format where each 128-bit compressed texel block encodes a 10×10 rectangle of unsigned normalized RGBA texel data with sRGB nonlinear encoding applied to the RGB components. - - - - - A four-component, ASTC compressed format where each 128-bit compressed texel block encodes a 10×10 rectangle of float RGBA texel data. - - - - - A four-component, ASTC compressed format where each 128-bit compressed texel block encodes a 10×10 rectangle of unsigned normalized RGBA texel data. - - - - - A four-component, ASTC compressed format where each 128-bit compressed texel block encodes a 12×12 rectangle of unsigned normalized RGBA texel data with sRGB nonlinear encoding applied to the RGB components. - - - - - A four-component, ASTC compressed format where each 128-bit compressed texel block encodes a 12×12 rectangle of float RGBA texel data. - - - - - A four-component, ASTC compressed format where each 128-bit compressed texel block encodes a 12×12 rectangle of unsigned normalized RGBA texel data. - - - - - A four-component, ASTC compressed format where each 128-bit compressed texel block encodes a 4×4 rectangle of unsigned normalized RGBA texel data with sRGB nonlinear encoding applied to the RGB components. - - - - - A four-component, ASTC compressed format where each 128-bit compressed texel block encodes a 4×4 rectangle of float RGBA texel data. - - - - - A four-component, ASTC compressed format where each 128-bit compressed texel block encodes a 4×4 rectangle of unsigned normalized RGBA texel data. - - - - - A four-component, ASTC compressed format where each 128-bit compressed texel block encodes a 5×5 rectangle of unsigned normalized RGBA texel data with sRGB nonlinear encoding applied to the RGB components. - - - - - A four-component, ASTC compressed format where each 128-bit compressed texel block encodes a 5×5 rectangle of float RGBA texel data. - - - - - A four-component, ASTC compressed format where each 128-bit compressed texel block encodes a 5×5 rectangle of unsigned normalized RGBA texel data. - - - - - A four-component, ASTC compressed format where each 128-bit compressed texel block encodes a 6×6 rectangle of unsigned normalized RGBA texel data with sRGB nonlinear encoding applied to the RGB components. - - - - - A four-component, ASTC compressed format where each 128-bit compressed texel block encodes a 6×6 rectangle of float RGBA texel data. - - - - - A four-component, ASTC compressed format where each 128-bit compressed texel block encodes a 6×6 rectangle of unsigned normalized RGBA texel data. - - - - - A four-component, ASTC compressed format where each 128-bit compressed texel block encodes an 8×8 rectangle of unsigned normalized RGBA texel data with sRGB nonlinear encoding applied to the RGB components. - - - - - A four-component, ASTC compressed format where each 128-bit compressed texel block encodes an 8×8 rectangle of float RGBA texel data. - - - - - A four-component, ASTC compressed format where each 128-bit compressed texel block encodes an 8×8 rectangle of unsigned normalized RGBA texel data. - - - - - A four-component, block-compressed format where each 128-bit compressed texel block encodes a 4×4 rectangle of unsigned normalized RGBA texel data with sRGB nonlinear encoding applied to the RGB components. - - - - - A four-component, block-compressed format where each 128-bit compressed texel block encodes a 4×4 rectangle of unsigned normalized RGBA texel data. - - - - - A three-component, block-compressed format. Each 64-bit compressed texel block encodes a 4×4 rectangle of unsigned normalized RGB texel data with sRGB nonlinear encoding. This format has a 1 bit alpha channel. - - - - - A three-component, block-compressed format. Each 64-bit compressed texel block encodes a 4×4 rectangle of unsigned normalized RGB texel data. This format has a 1 bit alpha channel. - - - - - A four-component, block-compressed format where each 128-bit compressed texel block encodes a 4×4 rectangle of unsigned normalized RGBA texel data with the first 64 bits encoding alpha values followed by 64 bits encoding RGB values with sRGB nonlinear encoding. - - - - - A four-component, block-compressed format where each 128-bit compressed texel block encodes a 4×4 rectangle of unsigned normalized RGBA texel data with the first 64 bits encoding alpha values followed by 64 bits encoding RGB values. - - - - - A four-component, block-compressed format where each 128-bit compressed texel block encodes a 4×4 rectangle of unsigned normalized RGBA texel data with the first 64 bits encoding alpha values followed by 64 bits encoding RGB values with sRGB nonlinear encoding. - - - - - A four-component, block-compressed format where each 128-bit compressed texel block encodes a 4×4 rectangle of unsigned normalized RGBA texel data with the first 64 bits encoding alpha values followed by 64 bits encoding RGB values. - - - - - A four-component, ETC2 compressed format where each 128-bit compressed texel block encodes a 4×4 rectangle of unsigned normalized RGBA texel data with the first 64 bits encoding alpha values followed by 64 bits encoding RGB values with sRGB nonlinear encoding applied. - - - - - A four-component, ETC2 compressed format where each 128-bit compressed texel block encodes a 4×4 rectangle of unsigned normalized RGBA texel data with the first 64 bits encoding alpha values followed by 64 bits encoding RGB values. - - - - - A four-component, PVRTC compressed format where each 64-bit compressed texel block encodes a 8×4 rectangle of unsigned normalized RGBA texel data with the first 32 bits encoding alpha values followed by 32 bits encoding RGB values with sRGB nonlinear encoding applied. - - - - - A four-component, PVRTC compressed format where each 64-bit compressed texel block encodes a 8×4 rectangle of unsigned normalized RGBA texel data with the first 32 bits encoding alpha values followed by 32 bits encoding RGB values. - - - - - A four-component, PVRTC compressed format where each 64-bit compressed texel block encodes a 4×4 rectangle of unsigned normalized RGBA texel data with the first 32 bits encoding alpha values followed by 32 bits encoding RGB values with sRGB nonlinear encoding applied. - - - - - A four-component, PVRTC compressed format where each 64-bit compressed texel block encodes a 4×4 rectangle of unsigned normalized RGBA texel data with the first 32 bits encoding alpha values followed by 32 bits encoding RGB values. - - - - - Defines the required members for a Runtime Reflection Systems. - - - - - Update the reflection probes. - - - Whether a reflection probe was updated. - - - - - A data structure used to represent the Renderers in the Scene for GPU ray tracing. - - - - - Add an instance to this RayTracingAccelerationStructure. Instance geometry can be either a Renderer or a GraphicsBuffer that includes a number of axis-aligned bounding boxes. - - The renderer to be added to RayTracingAccelerationStructure. - A bit mask of any size that indicates whether or not to add a submesh to the RayTracingAccelerationStructure. For a Renderer with multiple submeshes, if subMeshMask[i] = true, the submesh is added to the RayTracingAccelerationStructure. For a Renderer with only one submesh, you may pass an uninitialized array as a default value. - A bit array of any size that indicates whether a given submesh is transparent. For a Renderer with multiple submeshes, if subMeshTransparencyFlag[i] = true, that submesh is marked as transparent. For a Renderer with only one submesh, pass an array with a single initialized entry, and indicate whether or not the one submesh is transparent. - A bool that indicates whether the GPU driver-level culling passes (such as front-face culling or back-face culling) should cull this Renderer. Culling is enabled (true) by default. - A bool that indicates whether to flip the way triangles face in this renderer. If this is set to true, front-facing triangles will become back-facing and vice versa. Set to false by default. - An 8-bit mask you can use to selectively intersect this renderer with rays that only pass the mask. All rays are enabled (0xff) by default. - A GraphicsBuffer that defines a number of axis-aligned bounding boxes (AABBs). An AABB is defined by a list of bounds, written as floats in the following order: minX, minY, minZ, maxX, maxY, maxZ. - The number of axis-aligned bounding boxes defined in the given GraphicsBuffer. - The Material to apply to an instance defined by axis-aligned bounding boxes in a GraphicsBuffer. - The object to world matrix to apply to an instance defined by axis-aligned bounding boxes in a GraphicsBuffer. This is optional, and takes the value of a Matrix4x4.identity by default. - A bool that indicates whether the Material applied to a GraphicsBuffer instance has cutoff transparency. - A bool that indicates whether Unity reuses the AABBs defined in the GraphicsBuffer without change. If the exact same bounds can be used across multiple acceleration structures or multiple frames, set this to true. This is false by default. - - - - Add an instance to this RayTracingAccelerationStructure. Instance geometry can be either a Renderer or a GraphicsBuffer that includes a number of axis-aligned bounding boxes. - - The renderer to be added to RayTracingAccelerationStructure. - A bit mask of any size that indicates whether or not to add a submesh to the RayTracingAccelerationStructure. For a Renderer with multiple submeshes, if subMeshMask[i] = true, the submesh is added to the RayTracingAccelerationStructure. For a Renderer with only one submesh, you may pass an uninitialized array as a default value. - A bit array of any size that indicates whether a given submesh is transparent. For a Renderer with multiple submeshes, if subMeshTransparencyFlag[i] = true, that submesh is marked as transparent. For a Renderer with only one submesh, pass an array with a single initialized entry, and indicate whether or not the one submesh is transparent. - A bool that indicates whether the GPU driver-level culling passes (such as front-face culling or back-face culling) should cull this Renderer. Culling is enabled (true) by default. - A bool that indicates whether to flip the way triangles face in this renderer. If this is set to true, front-facing triangles will become back-facing and vice versa. Set to false by default. - An 8-bit mask you can use to selectively intersect this renderer with rays that only pass the mask. All rays are enabled (0xff) by default. - A GraphicsBuffer that defines a number of axis-aligned bounding boxes (AABBs). An AABB is defined by a list of bounds, written as floats in the following order: minX, minY, minZ, maxX, maxY, maxZ. - The number of axis-aligned bounding boxes defined in the given GraphicsBuffer. - The Material to apply to an instance defined by axis-aligned bounding boxes in a GraphicsBuffer. - The object to world matrix to apply to an instance defined by axis-aligned bounding boxes in a GraphicsBuffer. This is optional, and takes the value of a Matrix4x4.identity by default. - A bool that indicates whether the Material applied to a GraphicsBuffer instance has cutoff transparency. - A bool that indicates whether Unity reuses the AABBs defined in the GraphicsBuffer without change. If the exact same bounds can be used across multiple acceleration structures or multiple frames, set this to true. This is false by default. - - - - Add an instance to this RayTracingAccelerationStructure. Instance geometry can be either a Renderer or a GraphicsBuffer that includes a number of axis-aligned bounding boxes. - - The renderer to be added to RayTracingAccelerationStructure. - A bit mask of any size that indicates whether or not to add a submesh to the RayTracingAccelerationStructure. For a Renderer with multiple submeshes, if subMeshMask[i] = true, the submesh is added to the RayTracingAccelerationStructure. For a Renderer with only one submesh, you may pass an uninitialized array as a default value. - A bit array of any size that indicates whether a given submesh is transparent. For a Renderer with multiple submeshes, if subMeshTransparencyFlag[i] = true, that submesh is marked as transparent. For a Renderer with only one submesh, pass an array with a single initialized entry, and indicate whether or not the one submesh is transparent. - A bool that indicates whether the GPU driver-level culling passes (such as front-face culling or back-face culling) should cull this Renderer. Culling is enabled (true) by default. - A bool that indicates whether to flip the way triangles face in this renderer. If this is set to true, front-facing triangles will become back-facing and vice versa. Set to false by default. - An 8-bit mask you can use to selectively intersect this renderer with rays that only pass the mask. All rays are enabled (0xff) by default. - A GraphicsBuffer that defines a number of axis-aligned bounding boxes (AABBs). An AABB is defined by a list of bounds, written as floats in the following order: minX, minY, minZ, maxX, maxY, maxZ. - The number of axis-aligned bounding boxes defined in the given GraphicsBuffer. - The Material to apply to an instance defined by axis-aligned bounding boxes in a GraphicsBuffer. - The object to world matrix to apply to an instance defined by axis-aligned bounding boxes in a GraphicsBuffer. This is optional, and takes the value of a Matrix4x4.identity by default. - A bool that indicates whether the Material applied to a GraphicsBuffer instance has cutoff transparency. - A bool that indicates whether Unity reuses the AABBs defined in the GraphicsBuffer without change. If the exact same bounds can be used across multiple acceleration structures or multiple frames, set this to true. This is false by default. - - - - Builds this RayTracingAccelerationStructure on the GPU. - - - - - Creates a RayTracingAccelerationStructure with the given RayTracingAccelerationStructure.RASSettings. - - Defines whether a RayTracingAccelerationStructure is updated by the user or the Engine, and whether to mask certain object layers or RayTracingModes. - - - - Creates a RayTracingAccelerationStructure with the given RayTracingAccelerationStructure.RASSettings. - - Defines whether a RayTracingAccelerationStructure is updated by the user or the Engine, and whether to mask certain object layers or RayTracingModes. - - - - Destroys this RayTracingAccelerationStructure. - - - - - Returns the total size of this RayTracingAccelerationStructure on the GPU in bytes. - - - - - Defines whether Unity updates a RayTracingAccelerationStructure automatically, or if the user updates it manually via API. - - - - - Automatically populates and updates the RayTracingAccelerationStructure. - - - - - Gives user control over populating and updating the RayTracingAccelerationStructure. - - - - - Defines whether a RayTracingAccelerationStructure is updated by the user or by the Engine, and whether to mask certain object layers or RayTracingModes. - - - - - A 32-bit mask that controls which layers a GameObject must be on in order to be added to the RayTracingAccelerationStructure. - - - - - An enum that selects whether a RayTracingAccelerationStructure is automatically or manually updated. - - - - - An enum controlling which RayTracingModes a Renderer must have in order to be added to the RayTracingAccelerationStructure. - - - - - Creates a RayTracingAccelerationStructure.RASSettings from the given configuration. - - Chooses whether a RayTracingAccelerationStructure will be managed by the user or Unity Engine. - Filters Renderers to add to the RayTracingAccelerationStructure based on their RayTracingAccelerationStructure.RayTracingMode. - - - - - An enum controlling which RayTracingAccelerationStructure.RayTracingModes a Renderer must have in order to be added to the RayTracingAccelerationStructure. - - - - - Only add Renderers with RayTracingMode.DynamicGeometry set to the RayTracingAccelerationStructure. - - - - - Only add Renderers with RayTracingMode.DynamicTransform set to the RayTracingAccelerationStructure. - - - - - Add all Renderers to the RayTracingAccelerationStructure except for those with that have RayTracingMode.Off. - - - - - Disable adding Renderers to this RayTracingAccelerationStructure. - - - - - Only add Renderers with RayTracingMode.Static set to the RayTracingAccelerationStructure. - - - - - See Also: RayTracingAccelerationStructure.Dispose. - - - - - Updates the transforms of all instances in this RayTracingAccelerationStructure. - - - - - Updates the transform of the instance associated with the given Renderer for this RayTracingAccelerationStructure. - - - - - - Indicates how a Renderer is updated. - - - - - Renderers with this mode have animated geometry and update their Mesh and Transform. - - - - - Renderers with this mode update their Transform, but not their Mesh. - - - - - Renderers with this mode are not ray traced. - - - - - Renderers with this mode never update. - - - - - A shader for GPU ray tracing. - - - - - The maximum number of ray bounces this shader can trace (Read Only). - - - - - Dispatches this RayTracingShader. - - The name of the ray generation shader. - The width of the ray generation shader thread grid. - The height of the ray generation shader thread grid. - The depth of the ray generation shader thread grid. - Optional parameter used to setup camera-related built-in shader variables. - - - - Sets the value for RayTracingAccelerationStructure property of this RayTracingShader. - - The name of the RayTracingAccelerationStructure being set. - The ID of the RayTracingAccelerationStructure as given by Shader.PropertyToID. - The value to set the RayTracingAccelerationStructure to. - - - - Sets the value for RayTracingAccelerationStructure property of this RayTracingShader. - - The name of the RayTracingAccelerationStructure being set. - The ID of the RayTracingAccelerationStructure as given by Shader.PropertyToID. - The value to set the RayTracingAccelerationStructure to. - - - - Sets the value of a boolean uniform. - - The name of the property being set. - The ID of the property as given by Shader.PropertyToID. - The boolean value to set. - - - - Sets the value of a boolean uniform. - - The name of the property being set. - The ID of the property as given by Shader.PropertyToID. - The boolean value to set. - - - - Binds a ComputeBuffer or GraphicsBuffer to a RayTracingShader. - - The ID of the buffer name in shader code. Use Shader.PropertyToID to get this ID. - The name of the buffer in shader code. - The buffer to bind the named local resource to. - - - - Binds a ComputeBuffer or GraphicsBuffer to a RayTracingShader. - - The ID of the buffer name in shader code. Use Shader.PropertyToID to get this ID. - The name of the buffer in shader code. - The buffer to bind the named local resource to. - - - - Binds a ComputeBuffer or GraphicsBuffer to a RayTracingShader. - - The ID of the buffer name in shader code. Use Shader.PropertyToID to get this ID. - The name of the buffer in shader code. - The buffer to bind the named local resource to. - - - - Binds a ComputeBuffer or GraphicsBuffer to a RayTracingShader. - - The ID of the buffer name in shader code. Use Shader.PropertyToID to get this ID. - The name of the buffer in shader code. - The buffer to bind the named local resource to. - - - - Binds a constant buffer created through a ComputeBuffer or a GraphicsBuffer. - - The ID of the property name for the constant buffer in shader code. Use Shader.PropertyToID to get this ID. - The name of the constant buffer in shader code. - The buffer to bind as constant buffer. - The offset in bytes from the beginning of the ComputeBuffer or GraphicsBuffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0. - The number of bytes to bind. - - - - Binds a constant buffer created through a ComputeBuffer or a GraphicsBuffer. - - The ID of the property name for the constant buffer in shader code. Use Shader.PropertyToID to get this ID. - The name of the constant buffer in shader code. - The buffer to bind as constant buffer. - The offset in bytes from the beginning of the ComputeBuffer or GraphicsBuffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0. - The number of bytes to bind. - - - - Binds a constant buffer created through a ComputeBuffer or a GraphicsBuffer. - - The ID of the property name for the constant buffer in shader code. Use Shader.PropertyToID to get this ID. - The name of the constant buffer in shader code. - The buffer to bind as constant buffer. - The offset in bytes from the beginning of the ComputeBuffer or GraphicsBuffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0. - The number of bytes to bind. - - - - Binds a constant buffer created through a ComputeBuffer or a GraphicsBuffer. - - The ID of the property name for the constant buffer in shader code. Use Shader.PropertyToID to get this ID. - The name of the constant buffer in shader code. - The buffer to bind as constant buffer. - The offset in bytes from the beginning of the ComputeBuffer or GraphicsBuffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0. - The number of bytes to bind. - - - - Sets the value of a float uniform. - - The name of the property being set. - The ID of the property as given by Shader.PropertyToID. - The float value to set. - - - - Sets the value of a float uniform. - - The name of the property being set. - The ID of the property as given by Shader.PropertyToID. - The float value to set. - - - - Sets the values for a float array uniform. - - The name of the property being set. - The ID of the property as given by Shader.PropertyToID. - The float array to set. - - - - Sets the values for a float array uniform. - - The name of the property being set. - The ID of the property as given by Shader.PropertyToID. - The float array to set. - - - - Sets the value of a int uniform. - - The name of the property being set. - The ID of the property as given by Shader.PropertyToID. - The int value to set. - - - - Sets the value of a int uniform. - - The name of the property being set. - The ID of the property as given by Shader.PropertyToID. - The int value to set. - - - - Sets the values for a int array uniform. - - The name of the property being set. - The ID of the property as given by Shader.PropertyToID. - The int array to set. - - - - Sets the values for a int array uniform. - - The name of the property being set. - The ID of the property as given by Shader.PropertyToID. - The int array to set. - - - - Sets the value of a matrix uniform. - - The name of the property being set. - The ID of the property as given by Shader.PropertyToID. - The matrix to set. - - - - Sets the value of a matrix uniform. - - The name of the property being set. - The ID of the property as given by Shader.PropertyToID. - The matrix to set. - - - - Sets a matrix array uniform. - - The name of the property being set. - The ID of the property as given by Shader.PropertyToID. - The matrix array to set. - - - - Sets a matrix array uniform. - - The name of the property being set. - The ID of the property as given by Shader.PropertyToID. - The matrix array to set. - - - - Selects which Shader Pass to use when executing ray/geometry intersection shaders. - - The Shader Pass to use when executing ray tracing shaders. - - - - Binds a texture resource. This can be a input or an output texture (UAV). - - The ID of the resource as given by Shader.PropertyToID. - The name of the texture being set. - The texture to bind the named local resource to. - - - - Binds a texture resource. This can be a input or an output texture (UAV). - - The ID of the resource as given by Shader.PropertyToID. - The name of the texture being set. - The texture to bind the named local resource to. - - - - Binds a global texture to a RayTracingShader. - - The ID of the texture as given by Shader.PropertyToID. - The name of the texture to bind. - The name of the global resource to bind to the RayTracingShader. - The ID of the global resource as given by Shader.PropertyToID. - - - - Binds a global texture to a RayTracingShader. - - The ID of the texture as given by Shader.PropertyToID. - The name of the texture to bind. - The name of the global resource to bind to the RayTracingShader. - The ID of the global resource as given by Shader.PropertyToID. - - - - Sets the value for a vector uniform. - - The name of the property being set. - The ID of the property as given by Shader.PropertyToID. - The vector to set. - - - - Sets the value for a vector uniform. - - The name of the property being set. - The ID of the property as given by Shader.PropertyToID. - The vector to set. - - - - Sets a vector array uniform. - - The name of the property being set. - The ID of the property as given by Shader.PropertyToID. - The array of vectors to set. - - - - Sets a vector array uniform. - - The name of the property being set. - The ID of the property as given by Shader.PropertyToID. - The array of vectors to set. - - - - Empty implementation of IScriptableRuntimeReflectionSystem. - - - - - Update the reflection probes. - - - Whether a reflection probe was updated. - - - - - Global settings for the scriptable runtime reflection system. - - - - - The current scriptable runtime reflection system instance. - - - - - Temporary place to new shader warmup api that will provide more/better control. - - - - - Prepares one shader with given rendering setup. - - - - - - - Prepares one shader with given rendering setup and variants saved in collection. - - - - - - - - Rendering setup to use when warming up shader. - - - - - Vertex Format to be used with shader. - - - - - Experimental render settings features. - - - - - UseRadianceAmbientProbe has been deprecated, please use UnityEngine.Experimental.GlobalIllumination.useRadianceAmbientProbe. - - - - - Represents a linear 2D transformation between brush UV space and a target XY space (typically this is a Terrain-local object space.) - - - - - (Read Only) Brush UV origin, in XY space. - - - - - (Read Only) Brush U vector, in XY space. - - - - - (Read Only) Brush V vector, in XY space. - - - - - (Read Only) Target XY origin, in Brush UV space. - - - - - (Read Only) Target X vector, in Brush UV space. - - - - - (Read Only) Target Y vector, in Brush UV space. - - - - - Creates a BrushTransform. - - Origin of the brush, in target XY space. - Brush U vector, in target XY space. - Brush V vector, in target XY space. - - - - Applies the transform to convert a Brush UV coordinate to the target XY space. - - Brush UV coordinate to transform. - - Target XY coordinate. - - - - - Creates an axis-aligned BrushTransform from a rectangle. - - Brush rectangle, in target XY coordinates. - - BrushTransform describing the brush. - - - - - Get the axis-aligned bounding rectangle of the brush, in target XY space. - - - Bounding rectangle in target XY space. - - - - - Applies the transform to convert a target XY coordinate to Brush UV space. - - Point in target XY space. - - Point transformed to Brush UV space. - - - - - The context for a paint operation that may span multiple connected Terrain tiles. - - - - - (Read Only) RenderTexture that an edit operation writes to modify the data. - - - - - The minimum height of all Terrain tiles that this PaintContext touches in world space. - - - - - The height range (from Min to Max) of all Terrain tiles that this PaintContext touches in world space. - - - - - Unity uses this value internally to transform a [0, 1] height value to a texel value, which is stored in TerrainData.heightmapTexture. - - - - - (Read Only) The value of RenderTexture.active at the time CreateRenderTargets is called. - - - - - (Read Only) The Terrain used to build the PaintContext. - - - - - (Read Only) The pixel rectangle that this PaintContext represents. - - - - - (Read Only) The size of a PaintContext pixel in terrain units (as defined by originTerrain.) - - - - - (Read Only) Render target that stores the original data from the Terrain tiles. - - - - - (Read Only) The height of the target terrain texture. This is the resolution for a single Terrain. - - - - - (Read Only) The width of the target terrain texture. This is the resolution for a single Terrain. - - - - - (Read Only) The number of Terrain tiles in this PaintContext. - - - - - Flushes the delayed actions created by PaintContext heightmap and alphamap modifications. - - - - - Releases the allocated resources of this PaintContext. - - When true, indicates that this function restores RenderTexture.active - - - - Constructs a PaintContext that you can use to edit a texture on a Terrain, in the region defined by boundsInTerrainSpace and extraBorderPixels. - - Terrain that defines terrain space for this PaintContext. - Terrain space bounds to edit in the target terrain texture. - Width of the target terrain texture (per Terrain). - Height of the target terrain texture (per Terrain). - Number of extra border pixels required. - - - - - - - Creates the sourceRenderTexture and destinationRenderTexture. - - Render Texture format. - - - - Creates a new PaintContext, to edit a target texture on a Terrain, in a region defined by pixelRect. - - Terrain that defines terrain space for this PaintContext. - Pixel rectangle to edit in the target terrain texture. - Width of the target terrain texture (per Terrain). - Height of the target terrain texture (per Terrain). - - - - - Gathers user-specified Texture data into sourceRenderTexture. - - A function that returns the Texture data to collect from each Terrain. - The default color for sourceRenderTexture. - The material used to copy the data. If null, the default blit material is used. - The material pass used to copy the data. - An optional action to call before copying from each Terrain. The default is null. - An optional action to call after copying from each Terrain. The default is null. - - - - Gathers the alphamap information into sourceRenderTexture. - - TerrainLayer used for painting. - Set to true to specify that the inputLayer is added to the terrain if it does not already exist. Set to false to specify that terrain layers are not added to the terrain. - - - - Gathers the heightmap information into sourceRenderTexture. - - - - - Gathers the Terrain holes information into sourceRenderTexture. - - - - - Gathers the normal information into sourceRenderTexture. - - - - - Retrieves the clipped pixel rectangle for a Terrain, relative to the PaintContext render textures. - - Index of the Terrain. - - Returns the clipped pixel rectangle. - - - - - Retrieves the clipped pixel rectangle for a Terrain. - - Index of the Terrain. - - Returns the clipped pixel rectangle. - - - - - Retrieves a Terrain from the PaintContext. - - Index of the terrain. - - Returns the Terrain object. - - - - - Interface that conveys information about a Terrain within the PaintContext area. - - - - - Read only. PaintContext.pixelRect, clipped to this Terrain, in PaintContext pixel coordinates. - - - - - Read only. PaintContext.pixelRect, clipped to this Terrain, in Terrain pixel coordinates. - - - - - Controls gathering from this Terrain within the PaintContext. The default is true. - - - - - Controls scattering to this Terrain within the PaintContext. The default is true. - - - - - Read only. The Terrain represented by this context. - - - - - Modify this value, if required, to store and retrieve values relevant to the PaintContext operation. - - - - - Applies an edited PaintContext by copying modifications back to user-specified RenderTextures for the source Terrain tiles. - - Function returning the RenderTexture to be written for each Terrain. - The material used to copy the data. If null, the default blit material is used. - The material pass used to copy the data. Its default value is 0. - An optional action to call before copying to each Terrain. - An optional action to call after copying to each Terrain. - - - - Applies an edited alphamap PaintContext by copying modifications back to the source Terrain tiles. - - Unique name used for the undo stack. - - - - Applies an edited heightmap PaintContext by copying modifications back to the source Terrain tiles. - - Unique name used for the undo stack. - - - - Applies an edited Terrain holes PaintContext by copying modifications back to the source Terrain tiles. - - Unique name used for the undo stack. - - - - This static class provides events that Unity triggers when Terrain data changes. - - - - - This event is triggered after there are changes to Terrain height data. - - - - - - This event is triggered after there are changes to Terrain textures. - - - - - - Use this delegate type with heightmapChanged to monitor all changes to the Terrain heightmap. - - The Terrain object that references a changed TerrainData asset. - The heightmap region that changed, in samples. - Indicates whether the changes were fully synchronized back to CPU memory. - - - - Use this delegate type with textureChanged to monitor all the changes to Terrain textures. - - The Terrain object that references a changed TerrainData asset. - The name of the texture that changed. - The region of the Terrain texture that changed, in texel coordinates. - Indicates whether the changes were fully synchronized back to CPU memory. - - - - A set of utility functions for custom terrain paint tools. - - - - - Helper function to set up a PaintContext for modifying the heightmap of one or more Terrain tiles. - - Reference Terrain tile. - The region in terrain space to edit. - Number of extra border pixels required. - - PaintContext containing the combined heightmap data for the specified region. - - - - - Helper function to set up a PaintContext for modifying the heightmap of one or more Terrain tiles. - - Reference Terrain tile. - The region in terrain space to edit. - Number of extra border pixels required. - - PaintContext containing the combined heightmap data for the specified region. - - - - - Helper function to set up a PaintContext for modifying the Terrain holes of one or more Terrain tiles. - - Reference Terrain tile. - The region in Terrain space to edit. - Number of extra border pixels required. - - PaintContext that contains the combined Terrain holes data for the specified region. - - - - - Helper function to set up a PaintContext for modifying the Terrain holes of one or more Terrain tiles. - - Reference Terrain tile. - The region in Terrain space to edit. - Number of extra border pixels required. - - PaintContext that contains the combined Terrain holes data for the specified region. - - - - - Helper function to set up a PaintContext for modifying the alphamap of one or more Terrain tiles. - - Reference Terrain tile. - Selects the alphamap to paint. - The region in terrain space to edit. - Number of extra border pixels required. - - PaintContext containing the combined alphamap data for the specified region. - - - - - Helper function to set up a PaintContext for modifying the alphamap of one or more Terrain tiles. - - Reference Terrain tile. - Selects the alphamap to paint. - The region in terrain space to edit. - Number of extra border pixels required. - - PaintContext containing the combined alphamap data for the specified region. - - - - - Builds a Scale & Offset transform to convert between one PaintContext's UV space and another PaintContext's UV space. - - Source PaintContext. - Destination PaintContext. - ScaleOffset transform. - - - - Enumeration of the render passes in the built-in paint material. - - - - - Built-in render pass for painting Terrain holes. - - - - - Built-in render pass for painting the splatmap texture. - - - - - Built-in render pass for raising and lowering Terrain height. - - - - - Built-in render pass for setting Terrain height. - - - - - Built-in render pass for smoothing the Terrain height. - - - - - Built-in render pass for stamping heights on the Terrain. - - - - - Creates a BrushTransform from the input parameters. - - Reference terrain, defines terrain UV and object space. - Center point of the brush, in terrain UV space (0-1 across the terrain tile). - Size of the brush, in terrain space. - Brush rotation in degrees (clockwise). - - Transform from terrain space to Brush UVs. - - - - - Helper function to set up a PaintContext that collects mesh normal data from one or more Terrain tiles. - - Reference Terrain tile. - The region in terrain space from which to collect normals. - Number of extra border pixels required. - - PaintContext containing the combined normalmap data for the specified region. - - - - - Helper function to set up a PaintContext that collects mesh normal data from one or more Terrain tiles. - - Reference Terrain tile. - The region in terrain space from which to collect normals. - Number of extra border pixels required. - - PaintContext containing the combined normalmap data for the specified region. - - - - - Helper function to complete a heightmap modification. - - The heightmap paint context to complete. - Unique name used for the undo stack. - - - - Helper function to complete a Terrain holes modification. - - The Terrain holes PaintContext to complete. - Unique name used for the undo stack. - - - - Helper function to complete a texture alphamap modification. - - The texture paint context to complete. - Unique name used for the undo stack. - - - - Finds the index of a TerrainLayer in a Terrain tile. - - Terrain tile. - Terrain layer to search for. - - Returns the index of the terrain layer if it exists or -1 if it doesn't exist. - - - - - Returns the default material for blitting operations. - - - Built in "Hidden/BlitCopy" material. - - - - - Calculates the minimum and maximum Brush size limits, in world space. - - Returns the minimum Brush size, in world space units. - Returns the maximum Brush size, in world space units. - The size of a Terrain tile, in world space units. - The resolution of the Terrain tile texture the Brush edits, in pixels. - The minimum Brush resolution, in pixels. Default is 1 pixel. - The maximum Brush resolution, in pixels. Default is 8192 pixels. - - - - Returns the built-in in paint material used by the built-in tools. - - - Built-in terrain paint material. - - - - - Returns the default copy terrain layer material. - - - Built in "HiddenTerrainTerrainLayerUtils" material. - - - - - Returns the Material to use when copying the Terrain heightmap. - - - Built in "HiddenTerrainEngineHeightBlitCopy" material. - - - - - Returns the alphamap texture at mapIndex. - - Terrain tile. - Index to retrieve. - - Alphamap texture at mapIndex. - - - - - Releases the allocated resources of the specified PaintContext. - - The PaintContext containing the resources to release. - - - - Sets up all of the material properties used by functions in TerrainTool.cginc. - - PaintContext describing the area we are editing, and the terrain space. - BrushTransform from terrain space to Brush UVs. - Material to populate with transform properties. - - - - Provides a set of utility functions that are used by the terrain tools. - - - - - Automatically connects neighboring terrains. - - - - - Type for mapping Terrain.groupingID coordinates to TerrainMap. - - - - - Type for mapping 2D (X,Z) tile coordinates to a Terrain object. - - - - - Indicates the error status of the TerrainMap. - - - - - Mapping from TileCoord to Terrain. - - - - - Creates a TerrainMap from the neighbors connected to the origin Terrain. - - Terrain that is given tile coordinate (0,0). - Filter to apply when populating the map. See Also: TerrainFilter. If null, no filter is applied. - Validate the Terrain map. Default is true. - - The resulting Terrain map. Can return null when no Terrain objects pass the filter. - - - - - Creates a TerrainMap from the positions of all active Terrains. - - Defines the grid origin and size, as well as group id if no filter is specified. - Origin of the grid. - Size of the grid. Typically takes the terrain size.x and size.z. - Filter to be applied when populating the map. See Also: TerrainFilter. If null, the filter will fall back to matching terrains in the same group as the origin. - Validate the Terrain map. Default is true. - - The resulting Terrain map. Can return null when no Terrain objects pass the filter. - - - - - Creates a TerrainMap from the positions of all active Terrains. - - Defines the grid origin and size, as well as group id if no filter is specified. - Origin of the grid. - Size of the grid. Typically takes the terrain size.x and size.z. - Filter to be applied when populating the map. See Also: TerrainFilter. If null, the filter will fall back to matching terrains in the same group as the origin. - Validate the Terrain map. Default is true. - - The resulting Terrain map. Can return null when no Terrain objects pass the filter. - - - - - Retrieves the Terrain object corresponding to the tile coordinates (tileX,tileZ). - - Tile X coordinate. - Tile Z coordinate. - - Returns a valid Terrain object if successful, null otherwise. - - - - - An implementation of IPlayable that controls playback of a VideoClip. - - - - - Creates a VideoClipPlayable in the PlayableGraph. - - The PlayableGraph object that will own the VideoClipPlayable. - Indicates if VideoClip loops when it reaches the end. - VideoClip used to produce textures in the PlayableGraph. - - A VideoClipPlayable linked to the PlayableGraph. - - - - - Extension methods for the Video.VideoPlayer class. - - - - - Return the Experimental.Audio.AudioSampleProvider for the specified track, used to receive audio samples during playback. - - The "this" pointer for the extension method. - The audio track index for which the sample provider is queried. - - The sample provider for the specified track. - - - - - Object that is used to resolve references to an ExposedReference field. - - - - - Creates a type whos value is resolvable at runtime. - - - - - The default value, in case the value cannot be resolved. - - - - - The name of the ExposedReference. - - - - - Gets the value of the reference by resolving it given the ExposedPropertyResolver context object. - - The ExposedPropertyResolver context object. - - The resolved reference value. - - - - - Spectrum analysis windowing types. - - - - - W[n] = 0.42 - (0.5 * COS(nN) ) + (0.08 * COS(2.0 * nN) ). - - - - - W[n] = 0.35875 - (0.48829 * COS(1.0 * nN)) + (0.14128 * COS(2.0 * nN)) - (0.01168 * COS(3.0 * n/N)). - - - - - W[n] = 0.54 - (0.46 * COS(n/N) ). - - - - - W[n] = 0.5 * (1.0 - COS(n/N) ). - - - - - W[n] = 1.0. - - - - - W[n] = TRI(2n/N). - - - - - Filtering mode for textures. Corresponds to the settings in a. - - - - - Bilinear filtering - texture samples are averaged. - - - - - Point filtering - texture pixels become blocky up close. - - - - - Trilinear filtering - texture samples are averaged and also blended between mipmap levels. - - - - - Enumeration of all the muscles in a finger. - - - - - The distal close-open muscle. - - - - - The intermediate close-open muscle. - - - - - The last value of the FingerDof enum. - - - - - The proximal down-up muscle. - - - - - The proximal in-out muscle. - - - - - The Fixed joint groups together 2 rigidbodies, making them stick together in their bound position. - - - - - Connects two Rigidbody2D together at their anchor points using a configurable spring. - - - - - The amount by which the spring force is reduced in proportion to the movement speed. - - - - - The frequency at which the spring oscillates around the distance between the objects. - - - - - The angle referenced between the two bodies used as the constraint for the joint. - - - - - A flare asset. Read more about flares in the. - - - - - FlareLayer component. - - - - - Used by GUIUtility.GetControlID to inform the IMGUI system if a given control can get keyboard focus. This allows the IMGUI system to give focus appropriately when a user presses tab for cycling between controls. - - - - - This control can receive keyboard focus. - - - - - This control can not receive keyboard focus. - - - - - Fog mode to use. - - - - - Exponential fog. - - - - - Exponential squared fog (default). - - - - - Linear fog. - - - - - Script interface for. - - - - - The ascent of the font. - - - - - Access an array of all characters contained in the font texture. - - - - - Is the font a dynamic font. - - - - - The default size of the font. - - - - - The line height of the font. - - - - - The material used for the font display. - - - - - Set a function to be called when the dynamic font texture is rebuilt. - - - - - - Creates a Font object which lets you render a font installed on the user machine. - - The name of the OS font to use for this font object. - The default character size of the generated font. - Am array of names of OS fonts to use for this font object. When rendering characters using this font object, the first font which is installed on the machine, which contains the requested character will be used. - - The generate Font object. - - - - - Creates a Font object which lets you render a font installed on the user machine. - - The name of the OS font to use for this font object. - The default character size of the generated font. - Am array of names of OS fonts to use for this font object. When rendering characters using this font object, the first font which is installed on the machine, which contains the requested character will be used. - - The generate Font object. - - - - - Create a new Font. - - The name of the created Font object. - - - - Create a new Font. - - The name of the created Font object. - - - - Get rendering info for a specific character. - - The character you need rendering information for. - Returns the CharacterInfo struct with the rendering information for the character (if available). - The size of the character (default value of zero will use font default size). - The style of the character. - - - - Get rendering info for a specific character. - - The character you need rendering information for. - Returns the CharacterInfo struct with the rendering information for the character (if available). - The size of the character (default value of zero will use font default size). - The style of the character. - - - - Get rendering info for a specific character. - - The character you need rendering information for. - Returns the CharacterInfo struct with the rendering information for the character (if available). - The size of the character (default value of zero will use font default size). - The style of the character. - - - - Returns the maximum number of verts that the text generator may return for a given string. - - Input string. - - - - Get names of fonts installed on the machine. - - - An array of the names of all fonts installed on the machine. - - - - - Gets the file paths of the fonts that are installed on the operating system. - - - An array of the file paths of all fonts installed on the machine. - - - - - Does this font have a specific character? - - The character to check for. - - Whether or not the font has the character specified. - - - - - Request characters to be added to the font texture (dynamic fonts only). - - The characters which are needed to be in the font texture. - The size of the requested characters (the default value of zero will use the font's default size). - The style of the requested characters. - - - - Font Style applied to GUI Texts, Text Meshes or GUIStyles. - - - - - Bold style applied to your texts. - - - - - Bold and Italic styles applied to your texts. - - - - - Italic style applied to your texts. - - - - - No special style is applied. - - - - - Use ForceMode to specify how to apply a force using Rigidbody.AddForce. - - - - - Add a continuous acceleration to the rigidbody, ignoring its mass. - - - - - Add a continuous force to the rigidbody, using its mass. - - - - - Add an instant force impulse to the rigidbody, using its mass. - - - - - Add an instant velocity change to the rigidbody, ignoring its mass. - - - - - Option for how to apply a force using Rigidbody2D.AddForce. - - - - - Add a force to the Rigidbody2D, using its mass. - - - - - Add an instant force impulse to the rigidbody2D, using its mass. - - - - - Struct containing basic FrameTimings and accompanying relevant data. - - - - - The CPU time for a given frame, in ms. - - - - - This is the CPU clock time at the point GPU finished rendering the frame and interrupted the CPU. - - - - - This is the CPU clock time at the point Present was called for the current frame. - - - - - The GPU time for a given frame, in ms. - - - - - This was the height scale factor of the Dynamic Resolution system(if used) for the given frame and the linked frame timings. - - - - - This was the vsync mode for the given frame and the linked frame timings. - - - - - This was the width scale factor of the Dynamic Resolution system(if used) for the given frame and the linked frame timings. - - - - - The FrameTimingManager allows the user to capture and access FrameTiming data for multple frames. - - - - - This function triggers the FrameTimingManager to capture a snapshot of FrameTiming's data, that can then be accessed by the user. - - - - - This returns the frequency of CPU timer on the current platform, used to interpret timing results. If the platform does not support returning this value it will return 0. - - - CPU timer frequency for current platform. - - - - - This returns the frequency of GPU timer on the current platform, used to interpret timing results. If the platform does not support returning this value it will return 0. - - - GPU timer frequency for current platform. - - - - - Allows the user to access the currently captured FrameTimings. - - User supplies a desired number of frames they would like FrameTimings for. This should be equal to or less than the maximum FrameTimings the platform can capture. - An array of FrameTiming structs that is passed in by the user and will be filled with data as requested. It is the users job to make sure the array that is passed is large enough to hold the requested number of FrameTimings. - - Returns the number of FrameTimings it actually was able to get. This will always be equal to or less than the requested numFrames depending on availability of captured FrameTimings. - - - - - This returns the number of vsyncs per second on the current platform, used to interpret timing results. If the platform does not support returning this value it will return 0. - - - Number of vsyncs per second of the current platform. - - - - - Applies both force and torque to reduce both the linear and angular velocities to zero. - - - - - The maximum force that can be generated when trying to maintain the friction joint constraint. - - - - - The maximum torque that can be generated when trying to maintain the friction joint constraint. - - - - - This struct contains the view space coordinates of the near projection plane. - - - - - Position in view space of the bottom side of the near projection plane. - - - - - Position in view space of the left side of the near projection plane. - - - - - Position in view space of the right side of the near projection plane. - - - - - Position in view space of the top side of the near projection plane. - - - - - Z distance from the origin of view space to the far projection plane. - - - - - Z distance from the origin of view space to the near projection plane. - - - - - Platform agnostic fullscreen mode. Not all platforms support all modes. - - - - - Exclusive Mode. - - - - - Fullscreen window. - - - - - Maximized window. - - - - - Windowed. - - - - - Describes options for displaying movie playback controls. - - - - - Do not display any controls, but cancel movie playback if input occurs. - - - - - Display the standard controls for controlling movie playback. - - - - - Do not display any controls. - - - - - Display minimal set of controls controlling movie playback. - - - - - Describes scaling modes for displaying movies. - - - - - Scale the movie until the movie fills the entire screen. - - - - - Scale the movie until one dimension fits on the screen exactly. - - - - - Scale the movie until both dimensions fit the screen exactly. - - - - - Do not scale the movie. - - - - - Base class for all entities in Unity Scenes. - - - - - Defines whether the GameObject is active in the Scene. - - - - - The local active state of this GameObject. (Read Only) - - - - - The Animation attached to this GameObject (Read Only). (Null if there is none attached). - - - - - The AudioSource attached to this GameObject (Read Only). (Null if there is none attached). - - - - - The Camera attached to this GameObject (Read Only). (Null if there is none attached). - - - - - The Collider attached to this GameObject (Read Only). (Null if there is none attached). - - - - - The Collider2D component attached to this object. - - - - - The ConstantForce attached to this GameObject (Read Only). (Null if there is none attached). - - - - - The HingeJoint attached to this GameObject (Read Only). (Null if there is none attached). - - - - - Gets and sets the GameObject's StaticEditorFlags. - - - - - The layer the game object is in. - - - - - The Light attached to this GameObject (Read Only). (Null if there is none attached). - - - - - The NetworkView attached to this GameObject (Read Only). (Null if there is none attached). - - - - - The ParticleSystem attached to this GameObject (Read Only). (Null if there is none attached). - - - - - The Renderer attached to this GameObject (Read Only). (Null if there is none attached). - - - - - The Rigidbody attached to this GameObject (Read Only). (Null if there is none attached). - - - - - The Rigidbody2D component attached to this GameObject. (Read Only) - - - - - Scene that the GameObject is part of. - - - - - Scene culling mask Unity uses to determine which scene to render the GameObject in. - - - - - The tag of this game object. - - - - - The Transform attached to this GameObject. - - - - - Adds a component class named className to the game object. - - - - - - Adds a component class of type componentType to the game object. C# Users can use a generic version. - - - - - - Generic version of this method. - - - - - Calls the method named methodName on every MonoBehaviour in this game object or any of its children. - - - - - - - - Calls the method named methodName on every MonoBehaviour in this game object or any of its children. - - - - - - - - Calls the method named methodName on every MonoBehaviour in this game object or any of its children. - - - - - - - - - - - - - - - Is this game object tagged with tag ? - - The tag to compare. - - - - Creates a game object with a primitive mesh renderer and appropriate collider. - - The type of primitive object to create. - - - - Creates a new game object, named name. - - The name that the GameObject is created with. - A list of Components to add to the GameObject on creation. - - - - Creates a new game object, named name. - - The name that the GameObject is created with. - A list of Components to add to the GameObject on creation. - - - - Creates a new game object, named name. - - The name that the GameObject is created with. - A list of Components to add to the GameObject on creation. - - - - Finds a GameObject by name and returns it. - - - - - - Returns an array of active GameObjects tagged tag. Returns empty array if no GameObject was found. - - The name of the tag to search GameObjects for. - - - - Returns one active GameObject tagged tag. Returns null if no GameObject was found. - - The tag to search for. - - - - Returns the component of Type type if the game object has one attached, null if it doesn't. - - The type of Component to retrieve. - - - - Generic version of this method. - - - - - Returns the component with name type if the game object has one attached, null if it doesn't. - - The type of Component to retrieve. - - - - Returns the component of Type type in the GameObject or any of its children using depth first search. - - The type of Component to retrieve. - - - A component of the matching type, if found. - - - - - Returns the component of Type type in the GameObject or any of its children using depth first search. - - The type of Component to retrieve. - - - A component of the matching type, if found. - - - - - Generic version of this method. - - - - A component of the matching type, if found. - - - - - Generic version of this method. - - - - A component of the matching type, if found. - - - - - Retrieves the component of Type type in the GameObject or any of its parents. - - Type of component to find. - - - Returns a component if a component matching the type is found. Returns null otherwise. - - - - - Retrieves the component of Type type in the GameObject or any of its parents. - - Type of component to find. - - - Returns a component if a component matching the type is found. Returns null otherwise. - - - - - Generic version of this method. - - - - Returns a component if a component matching the type is found. Returns null otherwise. - - - - - Generic version of this method. - - - - Returns a component if a component matching the type is found. Returns null otherwise. - - - - - Returns all components of Type type in the GameObject. - - The type of component to retrieve. - - - - Generic version of this method. - - - - - Returns all components of Type type in the GameObject into List results. Note that results is of type Component, not the type of the component retrieved. - - The type of Component to retrieve. - List to receive the results. - - - - Returns all components of Type type in the GameObject into List results. - - List of type T to receive the results. - - - - Returns all components of Type type in the GameObject or any of its children. - - The type of Component to retrieve. - Should Components on inactive GameObjects be included in the found set? - - - - Returns all components of Type type in the GameObject or any of its children. - - The type of Component to retrieve. - Should Components on inactive GameObjects be included in the found set? - - - - Generic version of this method. - - Should inactive GameObjects be included in the found set? - - A list of all found components matching the specified type. - - - - - Generic version of this method. - - Should inactive GameObjects be included in the found set? - - A list of all found components matching the specified type. - - - - - Return all found Components into List results. - - List to receive found Components. - Should inactive GameObjects be included in the found set? - - - - Return all found Components into List results. - - List to receive found Components. - Should inactive GameObjects be included in the found set? - - - - Returns all components of Type type in the GameObject or any of its parents. - - The type of Component to retrieve. - Should inactive Components be included in the found set? - - - - Generic version of this method. - - Determines whether to include inactive components in the found set. - - - - Generic version of this method. - - Determines whether to include inactive components in the found set. - - - - Find Components in GameObject or parents, and return them in List results. - - Should inactive Components be included in the found set? - List holding the found Components. - - - - Calls the method named methodName on every MonoBehaviour in this game object. - - The name of the method to call. - An optional parameter value to pass to the called method. - Should an error be raised if the method doesn't exist on the target object? - - - - Calls the method named methodName on every MonoBehaviour in this game object. - - The name of the method to call. - An optional parameter value to pass to the called method. - Should an error be raised if the method doesn't exist on the target object? - - - - Calls the method named methodName on every MonoBehaviour in this game object. - - The name of the method to call. - An optional parameter value to pass to the called method. - Should an error be raised if the method doesn't exist on the target object? - - - - - - - - - - - Calls the method named methodName on every MonoBehaviour in this game object and on every ancestor of the behaviour. - - The name of the method to call. - An optional parameter value to pass to the called method. - Should an error be raised if the method doesn't exist on the target object? - - - - Calls the method named methodName on every MonoBehaviour in this game object and on every ancestor of the behaviour. - - The name of the method to call. - An optional parameter value to pass to the called method. - Should an error be raised if the method doesn't exist on the target object? - - - - Calls the method named methodName on every MonoBehaviour in this game object and on every ancestor of the behaviour. - - The name of the method to call. - An optional parameter value to pass to the called method. - Should an error be raised if the method doesn't exist on the target object? - - - - - - - - - - - ActivatesDeactivates the GameObject, depending on the given true or false/ value. - - Activate or deactivate the object, where true activates the GameObject and false deactivates the GameObject. - - - - Gets the component of the specified type, if it exists. - - The type of component to retrieve. - The output argument that will contain the component or null. - - Returns true if the component is found, false otherwise. - - - - - Generic version of this method. - - The output argument that will contain the component or null. - - Returns true if the component is found, false otherwise. - - - - - Utility class for common geometric functions. - - - - - Calculates the bounding box from the given array of positions and the transformation matrix. - - An array that stores the location of 3d positions. - A matrix that changes the position, rotation and size of the bounds calculation. - - Calculates the axis-aligned bounding box. - - - - - Calculates frustum planes. - - The camera with the view frustum that you want to calculate planes from. - - The planes that form the camera's view frustum. - - - - - Calculates frustum planes. - - The camera with the view frustum that you want to calculate planes from. - An array of 6 Planes that will be overwritten with the calculated plane values. - - - - Calculates frustum planes. - - A matrix that transforms from world space to projection space, from which the planes will be calculated. - - The planes that enclose the projection space described by the matrix. - - - - - Calculates frustum planes. - - A matrix that transforms from world space to projection space, from which the planes will be calculated. - An array of 6 Planes that will be overwritten with the calculated plane values. - - - - Returns true if bounds are inside the plane array. - - - - - - - GeometryUtility.TryCreatePlaneFromPolygon creates a plane from the given list of vertices that define the polygon, as long as they do not characterize a straight line or zero area. - - An array of vertex positions that define the shape of a polygon. - A valid plane that goes through the vertices. - - Returns true on success, false if Unity did not create a plane from the vertices. - - - - - Gizmos are used to give visual debugging or setup aids in the Scene view. - - - - - Sets the color for the gizmos that will be drawn next. - - - - - Set a texture that contains the exposure correction for LightProbe gizmos. The value is sampled from the red channel in the middle of the texture. - - - - - Sets the Matrix4x4 that the Unity Editor uses to draw Gizmos. - - - - - Set a scale for Light Probe gizmos. This scale will be used to render the spherical harmonic preview spheres. - - - - - Draw a solid box with center and size. - - - - - - - Draw a camera frustum using the currently set Gizmos.matrix for it's location and rotation. - - The apex of the truncated pyramid. - Vertical field of view (ie, the angle at the apex in degrees). - Distance of the frustum's far plane. - Distance of the frustum's near plane. - Width/height ratio. - - - - Draw a texture in the Scene. - - The size and position of the texture on the "screen" defined by the XY plane. - The texture to be displayed. - An optional material to apply the texture. - Inset from the rectangle's left edge. - Inset from the rectangle's right edge. - Inset from the rectangle's top edge. - Inset from the rectangle's bottom edge. - - - - Draw a texture in the Scene. - - The size and position of the texture on the "screen" defined by the XY plane. - The texture to be displayed. - An optional material to apply the texture. - Inset from the rectangle's left edge. - Inset from the rectangle's right edge. - Inset from the rectangle's top edge. - Inset from the rectangle's bottom edge. - - - - Draw a texture in the Scene. - - The size and position of the texture on the "screen" defined by the XY plane. - The texture to be displayed. - An optional material to apply the texture. - Inset from the rectangle's left edge. - Inset from the rectangle's right edge. - Inset from the rectangle's top edge. - Inset from the rectangle's bottom edge. - - - - Draw a texture in the Scene. - - The size and position of the texture on the "screen" defined by the XY plane. - The texture to be displayed. - An optional material to apply the texture. - Inset from the rectangle's left edge. - Inset from the rectangle's right edge. - Inset from the rectangle's top edge. - Inset from the rectangle's bottom edge. - - - - Draw an icon at a position in the Scene view. - - - - - - - - Draw an icon at a position in the Scene view. - - - - - - - - Draws a line starting at from towards to. - - - - - - - Draws a mesh. - - Mesh to draw as a gizmo. - Position (default is zero). - Rotation (default is no rotation). - Scale (default is no scale). - Submesh to draw (default is -1, which draws whole mesh). - - - - Draws a mesh. - - Mesh to draw as a gizmo. - Position (default is zero). - Rotation (default is no rotation). - Scale (default is no scale). - Submesh to draw (default is -1, which draws whole mesh). - - - - Draws a ray starting at from to from + direction. - - - - - - - - Draws a ray starting at from to from + direction. - - - - - - - - Draws a solid sphere with center and radius. - - - - - - - Draw a wireframe box with center and size. - - - - - - - Draws a wireframe mesh. - - Mesh to draw as a gizmo. - Position (default is zero). - Rotation (default is no rotation). - Scale (default is no scale). - Submesh to draw (default is -1, which draws whole mesh). - - - - Draws a wireframe mesh. - - Mesh to draw as a gizmo. - Position (default is zero). - Rotation (default is no rotation). - Scale (default is no scale). - Submesh to draw (default is -1, which draws whole mesh). - - - - Draws a wireframe sphere with center and radius. - - - - - - - Low-level graphics library. - - - - - Select whether to invert the backface culling (true) or not (false). - - - - - Gets or sets the modelview matrix. - - - - - Controls whether Linear-to-sRGB color conversion is performed while rendering. - - - - - Should rendering be done in wireframe? - - - - - Begin drawing 3D primitives. - - Primitives to draw: can be TRIANGLES, TRIANGLE_STRIP, QUADS or LINES. - - - - Clear the current render buffer. - - Should the depth buffer be cleared? - Should the color buffer be cleared? - The color to clear with, used only if clearColor is true. - The depth to clear the z-buffer with, used only if clearDepth is true. The valid -range is from 0 (near plane) to 1 (far plane). The value is graphics API agnostic: the abstraction layer will convert -the value to match the convention of the current graphics API. - - - - Clear the current render buffer with camera's skybox. - - Should the depth buffer be cleared? - Camera to get projection parameters and skybox from. - - - - Sets current vertex color. - - - - - - End drawing 3D primitives. - - - - - Sends queued-up commands in the driver's command buffer to the GPU. - - - - - Compute GPU projection matrix from camera's projection matrix. - - Source projection matrix. - Will this projection be used for rendering into a RenderTexture? - - Adjusted projection matrix for the current graphics API. - - - - - Invalidate the internally cached render state. - - - - - Send a user-defined event to a native code plugin. - - User defined id to send to the callback. - Native code callback to queue for Unity's renderer to invoke. - - - - Send a user-defined event to a native code plugin. - - User defined id to send to the callback. - Native code callback to queue for Unity's renderer to invoke. - - - - Mode for Begin: draw line strip. - - - - - Mode for Begin: draw lines. - - - - - Load an identity into the current model and view matrices. - - - - - Helper function to set up an orthograhic projection. - - - - - Setup a matrix for pixel-correct rendering. - - - - - Setup a matrix for pixel-correct rendering. - - - - - - - - - Load an arbitrary matrix to the current projection matrix. - - - - - - Sets current texture coordinate (v.x,v.y,v.z) to the actual texture unit. - - - - - - - Sets current texture coordinate (x,y) for the actual texture unit. - - - - - - - - Sets current texture coordinate (x,y,z) to the actual texture unit. - - - - - - - - - Sets the current model matrix to the one specified. - - - - - - Restores the model, view and projection matrices off the top of the matrix stack. - - - - - Saves the model, view and projection matrices to the top of the matrix stack. - - - - - Mode for Begin: draw quads. - - - - - Resolves the render target for subsequent operations sampling from it. - - - - - Sets current texture coordinate (v.x,v.y,v.z) for all texture units. - - - - - - Sets current texture coordinate (x,y) for all texture units. - - - - - - - Sets current texture coordinate (x,y,z) for all texture units. - - - - - - - - Mode for Begin: draw triangle strip. - - - - - Mode for Begin: draw triangles. - - - - - Submit a vertex. - - - - - - Submit a vertex. - - - - - - - - Set the rendering viewport. - - - - - - Gradient used for animating colors. - - - - - All alpha keys defined in the gradient. - - - - - All color keys defined in the gradient. - - - - - Control how the gradient is evaluated. - - - - - Create a new Gradient object. - - - - - Calculate color at a given time. - - Time of the key (0 - 1). - - - - Setup Gradient with an array of color keys and alpha keys. - - Color keys of the gradient (maximum 8 color keys). - Alpha keys of the gradient (maximum 8 alpha keys). - - - - Alpha key used by Gradient. - - - - - Alpha channel of key. - - - - - Time of the key (0 - 1). - - - - - Gradient alpha key. - - Alpha of key (0 - 1). - Time of the key (0 - 1). - - - - Color key used by Gradient. - - - - - Color of key. - - - - - Time of the key (0 - 1). - - - - - Gradient color key. - - Color of key. - Time of the key (0 - 1). - - - - - Select how gradients will be evaluated. - - - - - Find the 2 keys adjacent to the requested evaluation time, and linearly interpolate between them to obtain a blended color. - - - - - Return a fixed color, by finding the first key whose time value is greater than the requested evaluation time. - - - - - Attribute used to configure the usage of the GradientField and Gradient Editor for a gradient. - - - - - The color space the Gradient uses. - - - - - If set to true the Gradient uses HDR colors. - - - - - Attribute for gradient fields. Used to configure the GUI for the Gradient Editor. - - Set to true if the colors should be treated as HDR colors (default value: false). - The colors should be treated as from this color space (default value: ColorSpace.Gamma). - - - - Raw interface to Unity's drawing functions. - - - - - Currently active color buffer (Read Only). - - - - - Returns the currently active color gamut. - - - - - Currently active depth/stencil buffer (Read Only). - - - - - Graphics Tier classification for current device. -Changing this value affects any subsequently loaded shaders. Initially this value is auto-detected from the hardware in use. - - - - - The minimum OpenGL ES version. The value is specified in PlayerSettings. - - - - - True when rendering over native UI is enabled in Player Settings (readonly). - - - - - Copies source texture into destination render texture with a shader. - - Source texture. - The destination RenderTexture. Set this to null to blit directly to screen. See description for more information. - Material to use. Material's shader could do some post-processing effect, for example. - If -1 (default), draws all passes in the material. Otherwise, draws given pass only. - Offset applied to the source texture coordinate. - Scale applied to the source texture coordinate. - The texture array source slice to perform the blit from. - The texture array destination slice to perform the blit to. - - - - Copies source texture into destination render texture with a shader. - - Source texture. - The destination RenderTexture. Set this to null to blit directly to screen. See description for more information. - Material to use. Material's shader could do some post-processing effect, for example. - If -1 (default), draws all passes in the material. Otherwise, draws given pass only. - Offset applied to the source texture coordinate. - Scale applied to the source texture coordinate. - The texture array source slice to perform the blit from. - The texture array destination slice to perform the blit to. - - - - Copies source texture into destination render texture with a shader. - - Source texture. - The destination RenderTexture. Set this to null to blit directly to screen. See description for more information. - Material to use. Material's shader could do some post-processing effect, for example. - If -1 (default), draws all passes in the material. Otherwise, draws given pass only. - Offset applied to the source texture coordinate. - Scale applied to the source texture coordinate. - The texture array source slice to perform the blit from. - The texture array destination slice to perform the blit to. - - - - Copies source texture into destination render texture with a shader. - - Source texture. - The destination RenderTexture. Set this to null to blit directly to screen. See description for more information. - Material to use. Material's shader could do some post-processing effect, for example. - If -1 (default), draws all passes in the material. Otherwise, draws given pass only. - Offset applied to the source texture coordinate. - Scale applied to the source texture coordinate. - The texture array source slice to perform the blit from. - The texture array destination slice to perform the blit to. - - - - Copies source texture into destination render texture with a shader. - - Source texture. - The destination RenderTexture. Set this to null to blit directly to screen. See description for more information. - Material to use. Material's shader could do some post-processing effect, for example. - If -1 (default), draws all passes in the material. Otherwise, draws given pass only. - Offset applied to the source texture coordinate. - Scale applied to the source texture coordinate. - The texture array source slice to perform the blit from. - The texture array destination slice to perform the blit to. - - - - Copies source texture into destination render texture with a shader. - - Source texture. - The destination RenderTexture. Set this to null to blit directly to screen. See description for more information. - Material to use. Material's shader could do some post-processing effect, for example. - If -1 (default), draws all passes in the material. Otherwise, draws given pass only. - Offset applied to the source texture coordinate. - Scale applied to the source texture coordinate. - The texture array source slice to perform the blit from. - The texture array destination slice to perform the blit to. - - - - Copies source texture into destination render texture with a shader. - - Source texture. - The destination RenderTexture. Set this to null to blit directly to screen. See description for more information. - Material to use. Material's shader could do some post-processing effect, for example. - If -1 (default), draws all passes in the material. Otherwise, draws given pass only. - Offset applied to the source texture coordinate. - Scale applied to the source texture coordinate. - The texture array source slice to perform the blit from. - The texture array destination slice to perform the blit to. - - - - Copies source texture into destination, for multi-tap shader. - - Source texture. - Destination RenderTexture, or null to blit directly to screen. - Material to use for copying. Material's shader should do some post-processing effect. - Variable number of filtering offsets. Offsets are given in pixels. - The texture array destination slice to blit to. - - - - Copies source texture into destination, for multi-tap shader. - - Source texture. - Destination RenderTexture, or null to blit directly to screen. - Material to use for copying. Material's shader should do some post-processing effect. - Variable number of filtering offsets. Offsets are given in pixels. - The texture array destination slice to blit to. - - - - Clear random write targets for level pixel shaders. - - - - - This function provides an efficient way to convert between textures of different formats and dimensions. -The destination texture format should be uncompressed and correspond to a supported RenderTextureFormat. - - Source texture. - Destination texture. - Source element (e.g. cubemap face). Set this to 0 for 2D source textures. - Destination element (e.g. cubemap face or texture array element). - - True if the call succeeded. - - - - - This function provides an efficient way to convert between textures of different formats and dimensions. -The destination texture format should be uncompressed and correspond to a supported RenderTextureFormat. - - Source texture. - Destination texture. - Source element (e.g. cubemap face). Set this to 0 for 2D source textures. - Destination element (e.g. cubemap face or texture array element). - - True if the call succeeded. - - - - - Copy texture contents. - - Source texture. - Destination texture. - Source texture element (cubemap face, texture array layer or 3D texture depth slice). - Source texture mipmap level. - Destination texture element (cubemap face, texture array layer or 3D texture depth slice). - Destination texture mipmap level. - X coordinate of source texture region to copy (left side is zero). - Y coordinate of source texture region to copy (bottom is zero). - Width of source texture region to copy. - Height of source texture region to copy. - X coordinate of where to copy region in destination texture (left side is zero). - Y coordinate of where to copy region in destination texture (bottom is zero). - - - - Copy texture contents. - - Source texture. - Destination texture. - Source texture element (cubemap face, texture array layer or 3D texture depth slice). - Source texture mipmap level. - Destination texture element (cubemap face, texture array layer or 3D texture depth slice). - Destination texture mipmap level. - X coordinate of source texture region to copy (left side is zero). - Y coordinate of source texture region to copy (bottom is zero). - Width of source texture region to copy. - Height of source texture region to copy. - X coordinate of where to copy region in destination texture (left side is zero). - Y coordinate of where to copy region in destination texture (bottom is zero). - - - - Copy texture contents. - - Source texture. - Destination texture. - Source texture element (cubemap face, texture array layer or 3D texture depth slice). - Source texture mipmap level. - Destination texture element (cubemap face, texture array layer or 3D texture depth slice). - Destination texture mipmap level. - X coordinate of source texture region to copy (left side is zero). - Y coordinate of source texture region to copy (bottom is zero). - Width of source texture region to copy. - Height of source texture region to copy. - X coordinate of where to copy region in destination texture (left side is zero). - Y coordinate of where to copy region in destination texture (bottom is zero). - - - - Shortcut for calling Graphics.CreateGraphicsFence with GraphicsFenceType.AsyncQueueSynchronization as the first parameter. - - The synchronization stage. See Graphics.CreateGraphicsFence. - - Returns a new GraphicsFence. - - - - - Shortcut for calling Graphics.CreateGraphicsFence with GraphicsFenceType.AsyncQueueSynchronization as the first parameter. - - The synchronization stage. See Graphics.CreateGraphicsFence. - - Returns a new GraphicsFence. - - - - - This functionality is deprecated, and should no longer be used. Please use Graphics.CreateGraphicsFence. - - - - - - Creates a GraphicsFence which will be passed after the last Blit, Clear, Draw, Dispatch or Texture Copy command prior to this call has been completed on the GPU. - - The type of GraphicsFence to create. Currently the only supported value is GraphicsFenceType.AsyncQueueSynchronization. - On some platforms there is a significant gap between the vertex processing completing and the pixel processing begining for a given draw call. This parameter allows for the fence to be passed after either the vertex or pixel processing for the proceeding draw has completed. If a compute shader dispatch was the last task submitted then this parameter is ignored. - - Returns a new GraphicsFence. - - - - - Draw a mesh. - - The Mesh to draw. - Position of the mesh. - Rotation of the mesh. - Transformation matrix of the mesh (combines position, rotation and other transformations). - Material to use. - to use. - If null (default), the mesh will be drawn in all cameras. Otherwise it will be rendered in the given Camera only. - Which subset of the mesh to draw. This applies only to meshes that are composed of several materials. - Additional material properties to apply onto material just before this mesh will be drawn. See MaterialPropertyBlock. - Determines whether the mesh can cast shadows. - Determines whether the mesh can receive shadows. - Should the mesh use light probes? - If used, the mesh will use this Transform's position to sample light probes and find the matching reflection probe. - LightProbeUsage for the mesh. - - - - - Draw a mesh. - - The Mesh to draw. - Position of the mesh. - Rotation of the mesh. - Transformation matrix of the mesh (combines position, rotation and other transformations). - Material to use. - to use. - If null (default), the mesh will be drawn in all cameras. Otherwise it will be rendered in the given Camera only. - Which subset of the mesh to draw. This applies only to meshes that are composed of several materials. - Additional material properties to apply onto material just before this mesh will be drawn. See MaterialPropertyBlock. - Determines whether the mesh can cast shadows. - Determines whether the mesh can receive shadows. - Should the mesh use light probes? - If used, the mesh will use this Transform's position to sample light probes and find the matching reflection probe. - LightProbeUsage for the mesh. - - - - - Draw a mesh. - - The Mesh to draw. - Position of the mesh. - Rotation of the mesh. - Transformation matrix of the mesh (combines position, rotation and other transformations). - Material to use. - to use. - If null (default), the mesh will be drawn in all cameras. Otherwise it will be rendered in the given Camera only. - Which subset of the mesh to draw. This applies only to meshes that are composed of several materials. - Additional material properties to apply onto material just before this mesh will be drawn. See MaterialPropertyBlock. - Determines whether the mesh can cast shadows. - Determines whether the mesh can receive shadows. - Should the mesh use light probes? - If used, the mesh will use this Transform's position to sample light probes and find the matching reflection probe. - LightProbeUsage for the mesh. - - - - - Draw a mesh. - - The Mesh to draw. - Position of the mesh. - Rotation of the mesh. - Transformation matrix of the mesh (combines position, rotation and other transformations). - Material to use. - to use. - If null (default), the mesh will be drawn in all cameras. Otherwise it will be rendered in the given Camera only. - Which subset of the mesh to draw. This applies only to meshes that are composed of several materials. - Additional material properties to apply onto material just before this mesh will be drawn. See MaterialPropertyBlock. - Determines whether the mesh can cast shadows. - Determines whether the mesh can receive shadows. - Should the mesh use light probes? - If used, the mesh will use this Transform's position to sample light probes and find the matching reflection probe. - LightProbeUsage for the mesh. - - - - - Draw a mesh. - - The Mesh to draw. - Position of the mesh. - Rotation of the mesh. - Transformation matrix of the mesh (combines position, rotation and other transformations). - Material to use. - to use. - If null (default), the mesh will be drawn in all cameras. Otherwise it will be rendered in the given Camera only. - Which subset of the mesh to draw. This applies only to meshes that are composed of several materials. - Additional material properties to apply onto material just before this mesh will be drawn. See MaterialPropertyBlock. - Determines whether the mesh can cast shadows. - Determines whether the mesh can receive shadows. - Should the mesh use light probes? - If used, the mesh will use this Transform's position to sample light probes and find the matching reflection probe. - LightProbeUsage for the mesh. - - - - - Draw a mesh. - - The Mesh to draw. - Position of the mesh. - Rotation of the mesh. - Transformation matrix of the mesh (combines position, rotation and other transformations). - Material to use. - to use. - If null (default), the mesh will be drawn in all cameras. Otherwise it will be rendered in the given Camera only. - Which subset of the mesh to draw. This applies only to meshes that are composed of several materials. - Additional material properties to apply onto material just before this mesh will be drawn. See MaterialPropertyBlock. - Determines whether the mesh can cast shadows. - Determines whether the mesh can receive shadows. - Should the mesh use light probes? - If used, the mesh will use this Transform's position to sample light probes and find the matching reflection probe. - LightProbeUsage for the mesh. - - - - - Draws the same mesh multiple times using GPU instancing. - - The Mesh to draw. - Which subset of the mesh to draw. This applies only to meshes that are composed of several materials. - Material to use. - The array of object transformation matrices. - The number of instances to be drawn. - Additional material properties to apply. See MaterialPropertyBlock. - Determines whether the Meshes should cast shadows. - Determines whether the Meshes should receive shadows. - to use. - If null (default), the mesh will be drawn in all cameras. Otherwise it will be drawn in the given Camera only. - LightProbeUsage for the instances. - - - - - Draws the same mesh multiple times using GPU instancing. - - The Mesh to draw. - Which subset of the mesh to draw. This applies only to meshes that are composed of several materials. - Material to use. - The array of object transformation matrices. - The number of instances to be drawn. - Additional material properties to apply. See MaterialPropertyBlock. - Determines whether the Meshes should cast shadows. - Determines whether the Meshes should receive shadows. - to use. - If null (default), the mesh will be drawn in all cameras. Otherwise it will be drawn in the given Camera only. - LightProbeUsage for the instances. - - - - - Draws the same mesh multiple times using GPU instancing. - - The Mesh to draw. - Which subset of the mesh to draw. This applies only to meshes that are composed of several materials. - Material to use. - The bounding volume surrounding the instances you intend to draw. - The GPU buffer containing the arguments for how many instances of this mesh to draw. - The byte offset into the buffer, where the draw arguments start. - Additional material properties to apply. See MaterialPropertyBlock. - Determines whether the mesh can cast shadows. - Determines whether the mesh can receive shadows. - to use. - If null (default), the mesh will be drawn in all cameras. Otherwise it will be drawn in the given Camera only. - LightProbeUsage for the instances. - - - - - Draws the same mesh multiple times using GPU instancing. - - The Mesh to draw. - Which subset of the mesh to draw. This applies only to meshes that are composed of several materials. - Material to use. - The bounding volume surrounding the instances you intend to draw. - The GPU buffer containing the arguments for how many instances of this mesh to draw. - The byte offset into the buffer, where the draw arguments start. - Additional material properties to apply. See MaterialPropertyBlock. - Determines whether the mesh can cast shadows. - Determines whether the mesh can receive shadows. - to use. - If null (default), the mesh will be drawn in all cameras. Otherwise it will be drawn in the given Camera only. - LightProbeUsage for the instances. - - - - - Draws the same mesh multiple times using GPU instancing. -This is similar to Graphics.DrawMeshInstancedIndirect, except that when the instance count is known from script, it can be supplied directly using this method, rather than via a ComputeBuffer. - - The Mesh to draw. - Which subset of the mesh to draw. This applies only to meshes that are composed of several materials. - Material to use. - The bounding volume surrounding the instances you intend to draw. - The number of instances to be drawn. - Additional material properties to apply. See MaterialPropertyBlock. - Determines whether the Meshes should cast shadows. - Determines whether the Meshes should receive shadows. - to use. - If null (default), the mesh will be drawn in all cameras. Otherwise it will be drawn in the given Camera only. - LightProbeUsage for the instances. - - - - - Draw a mesh immediately. - - The Mesh to draw. - Position of the mesh. - Rotation of the mesh. - The transformation matrix of the mesh (combines position, rotation and other transformations). - Subset of the mesh to draw. - - - - Draw a mesh immediately. - - The Mesh to draw. - Position of the mesh. - Rotation of the mesh. - The transformation matrix of the mesh (combines position, rotation and other transformations). - Subset of the mesh to draw. - - - - Draw a mesh immediately. - - The Mesh to draw. - Position of the mesh. - Rotation of the mesh. - The transformation matrix of the mesh (combines position, rotation and other transformations). - Subset of the mesh to draw. - - - - Draw a mesh immediately. - - The Mesh to draw. - Position of the mesh. - Rotation of the mesh. - The transformation matrix of the mesh (combines position, rotation and other transformations). - Subset of the mesh to draw. - - - - Draws procedural geometry on the GPU. - - Material to use. - The bounding volume surrounding the instances you intend to draw. - Topology of the procedural geometry. - Instance count to render. - Vertex count to render. - If null (default), the mesh will be drawn in all cameras. Otherwise it will be rendered in the given Camera only. - Additional material properties to apply onto material just before this mesh will be drawn. See MaterialPropertyBlock. - Determines whether the mesh can cast shadows. - Determines whether the mesh can receive shadows. - to use. - - - - Draws procedural geometry on the GPU. - - Material to use. - The bounding volume surrounding the instances you intend to draw. - Topology of the procedural geometry. - Instance count to render. - Vertex count to render. - If null (default), the mesh will be drawn in all cameras. Otherwise it will be rendered in the given Camera only. - Additional material properties to apply onto material just before this mesh will be drawn. See MaterialPropertyBlock. - Determines whether the mesh can cast shadows. - Determines whether the mesh can receive shadows. - to use. - - - - Draws procedural geometry on the GPU. - - Material to use. - The bounding volume surrounding the instances you intend to draw. - Topology of the procedural geometry. - Instance count to render. - Vertex count to render. - If null (default), the mesh will be drawn in all cameras. Otherwise it will be rendered in the given Camera only. - Additional material properties to apply onto material just before this mesh will be drawn. See MaterialPropertyBlock. - Determines whether the mesh can cast shadows. - Determines whether the mesh can receive shadows. - to use. - - - - Draws procedural geometry on the GPU. - - Material to use. - The bounding volume surrounding the instances you intend to draw. - Topology of the procedural geometry. - Index buffer used to submit vertices to the GPU. - Instance count to render. - Index count to render. - If null (default), the mesh will be drawn in all cameras. Otherwise it will be rendered in the given Camera only. - Additional material properties to apply onto material just before this mesh will be drawn. See MaterialPropertyBlock. - Determines whether the mesh can cast shadows. - Determines whether the mesh can receive shadows. - to use. - - - - Draws procedural geometry on the GPU. - - Material to use. - The bounding volume surrounding the instances you intend to draw. - Topology of the procedural geometry. - If null (default), the mesh will be drawn in all cameras. Otherwise it will be rendered in the given Camera only. - Buffer with draw arguments. - Byte offset where in the buffer the draw arguments are. - Additional material properties to apply onto material just before this mesh will be drawn. See MaterialPropertyBlock. - Determines whether the mesh can cast shadows. - Determines whether the mesh can receive shadows. - to use. - - - - Draws procedural geometry on the GPU. - - Material to use. - The bounding volume surrounding the instances you intend to draw. - Topology of the procedural geometry. - If null (default), the mesh will be drawn in all cameras. Otherwise it will be rendered in the given Camera only. - Buffer with draw arguments. - Byte offset where in the buffer the draw arguments are. - Additional material properties to apply onto material just before this mesh will be drawn. See MaterialPropertyBlock. - Determines whether the mesh can cast shadows. - Determines whether the mesh can receive shadows. - to use. - - - - Draws procedural geometry on the GPU. - - Material to use. - The bounding volume surrounding the instances you intend to draw. - Topology of the procedural geometry. - If null (default), the mesh will be drawn in all cameras. Otherwise it will be rendered in the given Camera only. - Buffer with draw arguments. - Byte offset where in the buffer the draw arguments are. - Additional material properties to apply onto material just before this mesh will be drawn. See MaterialPropertyBlock. - Determines whether the mesh can cast shadows. - Determines whether the mesh can receive shadows. - to use. - - - - Draws procedural geometry on the GPU. - - Material to use. - The bounding volume surrounding the instances you intend to draw. - Topology of the procedural geometry. - Index buffer used to submit vertices to the GPU. - If null (default), the mesh will be drawn in all cameras. Otherwise it will be rendered in the given Camera only. - Buffer with draw arguments. - Byte offset where in the buffer the draw arguments are. - Additional material properties to apply onto material just before this mesh will be drawn. See MaterialPropertyBlock. - Determines whether the mesh can cast shadows. - Determines whether the mesh can receive shadows. - to use. - - - - Draws procedural geometry on the GPU. - - Topology of the procedural geometry. - Buffer with draw arguments. - Byte offset where in the buffer the draw arguments are. - - - - Draws procedural geometry on the GPU. - - Topology of the procedural geometry. - Buffer with draw arguments. - Byte offset where in the buffer the draw arguments are. - - - - Draws procedural geometry on the GPU. - - Topology of the procedural geometry. - Index buffer used to submit vertices to the GPU. - Buffer with draw arguments. - Byte offset where in the buffer the draw arguments are. - - - - Draws procedural geometry on the GPU. - - Topology of the procedural geometry. - Index buffer used to submit vertices to the GPU. - Buffer with draw arguments. - Byte offset where in the buffer the draw arguments are. - - - - Draws procedural geometry on the GPU. - - Topology of the procedural geometry. - Vertex count to render. - Instance count to render. - - - - Draws procedural geometry on the GPU. - - Topology of the procedural geometry. - Index count to render. - Instance count to render. - Index buffer used to submit vertices to the GPU. - - - - Draw a texture in screen coordinates. - - Rectangle on the screen to use for the texture. In pixel coordinates with (0,0) in the upper-left corner. - Texture to draw. - Region of the texture to use. In normalized coordinates with (0,0) in the bottom-left corner. - Number of pixels from the left that are not affected by scale. - Number of pixels from the right that are not affected by scale. - Number of pixels from the top that are not affected by scale. - Number of pixels from the bottom that are not affected by scale. - Color that modulates the output. The neutral value is (0.5, 0.5, 0.5, 0.5). Set as vertex color for the shader. - Custom Material that can be used to draw the texture. If null is passed, a default material with the Internal-GUITexture.shader is used. - If -1 (default), draws all passes in the material. Otherwise, draws given pass only. - - - - Draw a texture in screen coordinates. - - Rectangle on the screen to use for the texture. In pixel coordinates with (0,0) in the upper-left corner. - Texture to draw. - Region of the texture to use. In normalized coordinates with (0,0) in the bottom-left corner. - Number of pixels from the left that are not affected by scale. - Number of pixels from the right that are not affected by scale. - Number of pixels from the top that are not affected by scale. - Number of pixels from the bottom that are not affected by scale. - Color that modulates the output. The neutral value is (0.5, 0.5, 0.5, 0.5). Set as vertex color for the shader. - Custom Material that can be used to draw the texture. If null is passed, a default material with the Internal-GUITexture.shader is used. - If -1 (default), draws all passes in the material. Otherwise, draws given pass only. - - - - Draw a texture in screen coordinates. - - Rectangle on the screen to use for the texture. In pixel coordinates with (0,0) in the upper-left corner. - Texture to draw. - Region of the texture to use. In normalized coordinates with (0,0) in the bottom-left corner. - Number of pixels from the left that are not affected by scale. - Number of pixels from the right that are not affected by scale. - Number of pixels from the top that are not affected by scale. - Number of pixels from the bottom that are not affected by scale. - Color that modulates the output. The neutral value is (0.5, 0.5, 0.5, 0.5). Set as vertex color for the shader. - Custom Material that can be used to draw the texture. If null is passed, a default material with the Internal-GUITexture.shader is used. - If -1 (default), draws all passes in the material. Otherwise, draws given pass only. - - - - Draw a texture in screen coordinates. - - Rectangle on the screen to use for the texture. In pixel coordinates with (0,0) in the upper-left corner. - Texture to draw. - Region of the texture to use. In normalized coordinates with (0,0) in the bottom-left corner. - Number of pixels from the left that are not affected by scale. - Number of pixels from the right that are not affected by scale. - Number of pixels from the top that are not affected by scale. - Number of pixels from the bottom that are not affected by scale. - Color that modulates the output. The neutral value is (0.5, 0.5, 0.5, 0.5). Set as vertex color for the shader. - Custom Material that can be used to draw the texture. If null is passed, a default material with the Internal-GUITexture.shader is used. - If -1 (default), draws all passes in the material. Otherwise, draws given pass only. - - - - Draw a texture in screen coordinates. - - Rectangle on the screen to use for the texture. In pixel coordinates with (0,0) in the upper-left corner. - Texture to draw. - Region of the texture to use. In normalized coordinates with (0,0) in the bottom-left corner. - Number of pixels from the left that are not affected by scale. - Number of pixels from the right that are not affected by scale. - Number of pixels from the top that are not affected by scale. - Number of pixels from the bottom that are not affected by scale. - Color that modulates the output. The neutral value is (0.5, 0.5, 0.5, 0.5). Set as vertex color for the shader. - Custom Material that can be used to draw the texture. If null is passed, a default material with the Internal-GUITexture.shader is used. - If -1 (default), draws all passes in the material. Otherwise, draws given pass only. - - - - Draw a texture in screen coordinates. - - Rectangle on the screen to use for the texture. In pixel coordinates with (0,0) in the upper-left corner. - Texture to draw. - Region of the texture to use. In normalized coordinates with (0,0) in the bottom-left corner. - Number of pixels from the left that are not affected by scale. - Number of pixels from the right that are not affected by scale. - Number of pixels from the top that are not affected by scale. - Number of pixels from the bottom that are not affected by scale. - Color that modulates the output. The neutral value is (0.5, 0.5, 0.5, 0.5). Set as vertex color for the shader. - Custom Material that can be used to draw the texture. If null is passed, a default material with the Internal-GUITexture.shader is used. - If -1 (default), draws all passes in the material. Otherwise, draws given pass only. - - - - Draw a texture in screen coordinates. - - Rectangle on the screen to use for the texture. In pixel coordinates with (0,0) in the upper-left corner. - Texture to draw. - Region of the texture to use. In normalized coordinates with (0,0) in the bottom-left corner. - Number of pixels from the left that are not affected by scale. - Number of pixels from the right that are not affected by scale. - Number of pixels from the top that are not affected by scale. - Number of pixels from the bottom that are not affected by scale. - Color that modulates the output. The neutral value is (0.5, 0.5, 0.5, 0.5). Set as vertex color for the shader. - Custom Material that can be used to draw the texture. If null is passed, a default material with the Internal-GUITexture.shader is used. - If -1 (default), draws all passes in the material. Otherwise, draws given pass only. - - - - Draw a texture in screen coordinates. - - Rectangle on the screen to use for the texture. In pixel coordinates with (0,0) in the upper-left corner. - Texture to draw. - Region of the texture to use. In normalized coordinates with (0,0) in the bottom-left corner. - Number of pixels from the left that are not affected by scale. - Number of pixels from the right that are not affected by scale. - Number of pixels from the top that are not affected by scale. - Number of pixels from the bottom that are not affected by scale. - Color that modulates the output. The neutral value is (0.5, 0.5, 0.5, 0.5). Set as vertex color for the shader. - Custom Material that can be used to draw the texture. If null is passed, a default material with the Internal-GUITexture.shader is used. - If -1 (default), draws all passes in the material. Otherwise, draws given pass only. - - - - Execute a command buffer. - - The buffer to execute. - - - - Executes a command buffer on an async compute queue with the queue selected based on the ComputeQueueType parameter passed. - - The CommandBuffer to be executed. - Describes the desired async compute queue the supplied CommandBuffer should be executed on. - - - - Set random write target for level pixel shaders. - - Index of the random write target in the shader. - Buffer or texture to set as the write target. - Whether to leave the append/consume counter value unchanged. - - - - Set random write target for level pixel shaders. - - Index of the random write target in the shader. - Buffer or texture to set as the write target. - Whether to leave the append/consume counter value unchanged. - - - - Set random write target for level pixel shaders. - - Index of the random write target in the shader. - Buffer or texture to set as the write target. - Whether to leave the append/consume counter value unchanged. - - - - Sets current render target. - - RenderTexture to set as active render target. - Mipmap level to render into (use 0 if not mipmapped). - Cubemap face to render into (use Unknown if not a cubemap). - Depth slice to render into (use 0 if not a 3D or 2DArray render target). - Color buffer to render into. - Depth buffer to render into. - Color buffers to render into (for multiple render target effects). - Full render target setup information. - - - - Sets current render target. - - RenderTexture to set as active render target. - Mipmap level to render into (use 0 if not mipmapped). - Cubemap face to render into (use Unknown if not a cubemap). - Depth slice to render into (use 0 if not a 3D or 2DArray render target). - Color buffer to render into. - Depth buffer to render into. - Color buffers to render into (for multiple render target effects). - Full render target setup information. - - - - Sets current render target. - - RenderTexture to set as active render target. - Mipmap level to render into (use 0 if not mipmapped). - Cubemap face to render into (use Unknown if not a cubemap). - Depth slice to render into (use 0 if not a 3D or 2DArray render target). - Color buffer to render into. - Depth buffer to render into. - Color buffers to render into (for multiple render target effects). - Full render target setup information. - - - - Sets current render target. - - RenderTexture to set as active render target. - Mipmap level to render into (use 0 if not mipmapped). - Cubemap face to render into (use Unknown if not a cubemap). - Depth slice to render into (use 0 if not a 3D or 2DArray render target). - Color buffer to render into. - Depth buffer to render into. - Color buffers to render into (for multiple render target effects). - Full render target setup information. - - - - Instructs the GPU's processing of the graphics queue to wait until the given GraphicsFence is passed. - - The GraphicsFence that the GPU will be instructed to wait upon before proceeding with its processing of the graphics queue. - On some platforms there is a significant gap between the vertex processing completing and the pixel processing begining for a given draw call. This parameter allows for requested wait to be before the next items vertex or pixel processing begins. If a compute shader dispatch is the next item to be submitted then this parameter is ignored. - - - - Instructs the GPU's processing of the graphics queue to wait until the given GraphicsFence is passed. - - The GraphicsFence that the GPU will be instructed to wait upon before proceeding with its processing of the graphics queue. - On some platforms there is a significant gap between the vertex processing completing and the pixel processing begining for a given draw call. This parameter allows for requested wait to be before the next items vertex or pixel processing begins. If a compute shader dispatch is the next item to be submitted then this parameter is ignored. - - - - This functionality is deprecated, and should no longer be used. Please use Graphics.WaitOnAsyncGraphicsFence. - - - - - - - GPU graphics data buffer, for working with data such as vertex and index buffers. - - - - - Number of elements in the buffer (Read Only). - - - - - Size of one element in the buffer (Read Only). - - - - - Copy counter value of append/consume buffer into another buffer. - - - - - - - - Copy counter value of append/consume buffer into another buffer. - - - - - - - - Copy counter value of append/consume buffer into another buffer. - - - - - - - - Copy counter value of append/consume buffer into another buffer. - - - - - - - - Create a Graphics Buffer. - - Select whether this buffer can be used as a vertex or index buffer. - Number of elements in the buffer. - Size of one element in the buffer. For index buffers, this must be either 2 or 4 bytes. - - - - Read data values from the buffer into an array. The array can only use <a href="https:docs.microsoft.comen-usdotnetframeworkinteropblittable-and-non-blittable-types">blittable<a> types. - - An array to receive the data. - The first element index in data where retrieved elements are copied. - The first element index of the buffer from which elements are read. - The number of elements to retrieve. - - - - Read data values from the buffer into an array. The array can only use <a href="https:docs.microsoft.comen-usdotnetframeworkinteropblittable-and-non-blittable-types">blittable<a> types. - - An array to receive the data. - The first element index in data where retrieved elements are copied. - The first element index of the buffer from which elements are read. - The number of elements to retrieve. - - - - Retrieve a native (underlying graphics API) pointer to the buffer. - - - Pointer to the underlying graphics API buffer. - - - - - Returns true if this graphics buffer is valid, or false otherwise. - - - - - Release a Graphics Buffer. - - - - - Sets counter value of append/consume buffer. - - Value of the append/consume counter. - - - - Set the buffer with values from an array. - - Array of values to fill the buffer. - - - - Set the buffer with values from an array. - - Array of values to fill the buffer. - - - - Set the buffer with values from an array. - - Array of values to fill the buffer. - - - - Partial copy of data values from an array into the buffer. - - Array of values to fill the buffer. - The first element index in data to copy to the graphics buffer. - The number of elements to copy. - The first element index in the graphics buffer to receive the data. - - - - - Partial copy of data values from an array into the buffer. - - Array of values to fill the buffer. - The first element index in data to copy to the graphics buffer. - The number of elements to copy. - The first element index in the graphics buffer to receive the data. - - - - - Partial copy of data values from an array into the buffer. - - Array of values to fill the buffer. - The first element index in data to copy to the graphics buffer. - The number of elements to copy. - The first element index in the graphics buffer to receive the data. - - - - - The type of graphics buffer. - - - - - GraphicsBuffer can be used as an append-consume buffer. - - - - - GraphicsBuffer can be used as a constant buffer. - - - - - GraphicsBuffer with an internal counter. See Also: GraphicsBuffer.SetCounterValue and GraphicsBuffer.CopyCount. - - - - - GraphicsBuffer can be used as an index buffer. - - - - - GraphicsBuffer can be used as an indirect argument buffer for indirect draws and dispatches. - - - - - GraphicsBuffer can be used as a raw buffer (ByteAddressBuffer). - - - - - GraphicsBuffer can be used as a structured buffer. - - - - - GraphicsBuffer can be used to store vertex data. - - - - - Grid is the base class for plotting a layout of uniformly spaced points and lines. - - - - - The size of the gap between each cell in the Grid. - - - - - The layout of the cells in the Grid. - - - - - The size of each cell in the Grid. - - - - - The cell swizzle for the Grid. - - - - - Get the logical center coordinate of a grid cell in local space. - - Grid cell position. - - Center of the cell transformed into local space coordinates. - - - - - Get the logical center coordinate of a grid cell in world space. - - Grid cell position. - - Center of the cell transformed into world space coordinates. - - - - - Does the inverse swizzle of the given position for given swizzle order. - - Determines the rearrangement order for the inverse swizzle. - Position to inverse swizzle. - - The inversed swizzled position. - - - - - Swizzles the given position with the given swizzle order. - - Determines the rearrangement order for the swizzle. - Position to swizzle. - - The swizzled position. - - - - - Base class for authoring data on a grid with grid painting tools like paint, erase, pick, select and fill. - - - - - Erases data on a grid within the given bounds. - - Grid used for layout. - Target of the erase operation. By default the currently selected GameObject. - The bounds to erase data from. - - - - Box fills tiles and GameObjects into given bounds within the selected layers. - - Grid used for layout. - Target of box fill operation. By default the currently selected GameObject. - The bounds to box fill data to. - - - - Changes the Z position of the GridBrushBase. - - Modify the Z position of GridBrushBase by this value. - - - - Erases data on a grid within the given bounds. - - Grid used for layout. - Target of the erase operation. By default the currently selected GameObject. - The coordinates of the cell to erase data from. - - - - - Flips the grid brush in the given FlipAxis. - - Axis to flip by. - CellLayout for flipping. - - - - Axis to flip tiles in the GridBrushBase by. - - - - - Flip the brush in the X Axis. - - - - - Flip the brush in the Y Axis. - - - - - Flood fills data onto a grid given the starting coordinates of the cell. - - Grid used for layout. - Targets of flood fill operation. By default the currently selected GameObject. - Starting position of the flood fill. - - - - Move is called when user moves the area previously selected with the selection marquee. - - Grid used for layout. - Target of the move operation. By default the currently selected GameObject. - Source bounds of the move. - Target bounds of the move. - - - - - MoveEnd is called when user has ended the move of the area previously selected with the selection marquee. - - Layers affected by the move operation. - Target of the move operation. By default the currently selected GameObject. - Grid used for layout. - - - - - MoveEnd is called when user starts moving the area previously selected with the selection marquee. - - Grid used for layout. - Target of the move operation. By default the currently selected GameObject. - Position where the move operation has started. - - - - - Paints data into a grid within the given bounds. - - Grid used for layout. - Target of the paint operation. By default the currently selected GameObject. - The coordinates of the cell to paint data to. - - - - - Picks data from a grid given the coordinates of the cells. - - Grid used for layout. - Target of the paint operation. By default the currently selected GameObject. - The coordinates of the cells to paint data from. - Pivot of the picking brush. - - - - - Resets Z position changes of the GridBrushBase. - - - - - Rotates all tiles on the grid brush with the given RotationDirection. - - Direction to rotate by. - CellLayout for rotating. - - - - Rotate tiles in the GridBrushBase in this direction. - - - - - Rotates tiles clockwise. - - - - - Rotates tiles counter-clockwise. - - - - - Select an area of a grid. - - Grid used for layout. - Targets of paint operation. By default the currently selected GameObject. - Area to get selected. - - - - - Tool mode for the GridBrushBase. - - - - - Box Fill. - - - - - Erase. - - - - - Flood Fill. - - - - - Move. - - - - - Paint. - - - - - Pick. - - - - - Select. - - - - - An abstract class that defines a grid layout. - - - - - The size of the gap between each cell in the layout. - - - - - The layout of the cells. - - - - - The size of each cell in the layout. - - - - - The cell swizzle for the layout. - - - - - The layout of the GridLayout. - - - - - Hexagonal layout for cells in the GridLayout. - - - - - Isometric layout for cells in the GridLayout. - - - - - Isometric layout for cells in the GridLayout where any Z cell value set will be added as a Y value. - - - - - Rectangular layout for cells in the GridLayout. - - - - - Swizzles cell positions to other positions. - - - - - Keeps the cell positions at XYZ. - - - - - Swizzles the cell positions from XYZ to XZY. - - - - - Swizzles the cell positions from XYZ to YXZ. - - - - - Swizzles the cell positions from XYZ to YZX. - - - - - Swizzles the cell positions from XYZ to ZXY. - - - - - Swizzles the cell positions from XYZ to ZYX. - - - - - Converts a cell position to local position space. - - Cell position to convert. - - Local position of the cell position. - - - - - Converts an interpolated cell position in floats to local position space. - - Interpolated cell position to convert. - - Local position of the cell position. - - - - - Converts a cell position to world position space. - - Cell position to convert. - - World position of the cell position. - - - - - Returns the local bounds for a cell at the location. - - Location of the cell. - - Local bounds of cell at the location. - - - - - Returns the local bounds for the groups of cells at the location. - - Origin of the group of cells. - Size of the group of cells. - - Local bounds of the group of cells at the location. - - - - - Get the default center coordinate of a cell for the set layout of the Grid. - - - Cell Center coordinate. - - - - - Converts a local position to cell position. - - Local Position to convert. - - Cell position of the local position. - - - - - Converts a local position to cell position. - - Local Position to convert. - - Interpolated cell position of the local position. - - - - - Converts a local position to world position. - - Local Position to convert. - - World position of the local position. - - - - - Converts a world position to cell position. - - World Position to convert. - - Cell position of the world position. - - - - - Converts a world position to local position. - - World Position to convert. - - Local position of the world position. - - - - - The GUI class is the interface for Unity's GUI with manual positioning. - - - - - Global tinting color for all background elements rendered by the GUI. - - - - - Returns true if any controls changed the value of the input data. - - - - - Global tinting color for the GUI. - - - - - Tinting color for all text rendered by the GUI. - - - - - The sorting depth of the currently executing GUI behaviour. - - - - - Is the GUI enabled? - - - - - The GUI transform matrix. - - - - - The global skin to use. - - - - - The tooltip of the control the mouse is currently over, or which has keyboard focus. (Read Only). - - - - - Begin a group. Must be matched with a call to EndGroup. - - Rectangle on the screen to use for the group. - Text to display on the group. - Texture to display on the group. - Text, image and tooltip for this group. If supplied, any mouse clicks are "captured" by the group and not If left out, no background is rendered, and mouse clicks are passed. - The style to use for the background. - - - - Begin a group. Must be matched with a call to EndGroup. - - Rectangle on the screen to use for the group. - Text to display on the group. - Texture to display on the group. - Text, image and tooltip for this group. If supplied, any mouse clicks are "captured" by the group and not If left out, no background is rendered, and mouse clicks are passed. - The style to use for the background. - - - - Begin a group. Must be matched with a call to EndGroup. - - Rectangle on the screen to use for the group. - Text to display on the group. - Texture to display on the group. - Text, image and tooltip for this group. If supplied, any mouse clicks are "captured" by the group and not If left out, no background is rendered, and mouse clicks are passed. - The style to use for the background. - - - - Begin a group. Must be matched with a call to EndGroup. - - Rectangle on the screen to use for the group. - Text to display on the group. - Texture to display on the group. - Text, image and tooltip for this group. If supplied, any mouse clicks are "captured" by the group and not If left out, no background is rendered, and mouse clicks are passed. - The style to use for the background. - - - - Begin a group. Must be matched with a call to EndGroup. - - Rectangle on the screen to use for the group. - Text to display on the group. - Texture to display on the group. - Text, image and tooltip for this group. If supplied, any mouse clicks are "captured" by the group and not If left out, no background is rendered, and mouse clicks are passed. - The style to use for the background. - - - - Begin a group. Must be matched with a call to EndGroup. - - Rectangle on the screen to use for the group. - Text to display on the group. - Texture to display on the group. - Text, image and tooltip for this group. If supplied, any mouse clicks are "captured" by the group and not If left out, no background is rendered, and mouse clicks are passed. - The style to use for the background. - - - - Begin a group. Must be matched with a call to EndGroup. - - Rectangle on the screen to use for the group. - Text to display on the group. - Texture to display on the group. - Text, image and tooltip for this group. If supplied, any mouse clicks are "captured" by the group and not If left out, no background is rendered, and mouse clicks are passed. - The style to use for the background. - - - - Begin a group. Must be matched with a call to EndGroup. - - Rectangle on the screen to use for the group. - Text to display on the group. - Texture to display on the group. - Text, image and tooltip for this group. If supplied, any mouse clicks are "captured" by the group and not If left out, no background is rendered, and mouse clicks are passed. - The style to use for the background. - - - - Begin a scrolling view inside your GUI. - - Rectangle on the screen to use for the ScrollView. - The pixel distance that the view is scrolled in the X and Y directions. - The rectangle used inside the scrollview. - Optional GUIStyle to use for the horizontal scrollbar. If left out, the horizontalScrollbar style from the current GUISkin is used. - Optional GUIStyle to use for the vertical scrollbar. If left out, the verticalScrollbar style from the current GUISkin is used. - Optional parameter to always show the horizontal scrollbar. If false or left out, it is only shown when viewRect is wider than position. - Optional parameter to always show the vertical scrollbar. If false or left out, it is only shown when viewRect is taller than position. - - The modified scrollPosition. Feed this back into the variable you pass in, as shown in the example. - - - - - Begin a scrolling view inside your GUI. - - Rectangle on the screen to use for the ScrollView. - The pixel distance that the view is scrolled in the X and Y directions. - The rectangle used inside the scrollview. - Optional GUIStyle to use for the horizontal scrollbar. If left out, the horizontalScrollbar style from the current GUISkin is used. - Optional GUIStyle to use for the vertical scrollbar. If left out, the verticalScrollbar style from the current GUISkin is used. - Optional parameter to always show the horizontal scrollbar. If false or left out, it is only shown when viewRect is wider than position. - Optional parameter to always show the vertical scrollbar. If false or left out, it is only shown when viewRect is taller than position. - - The modified scrollPosition. Feed this back into the variable you pass in, as shown in the example. - - - - - Begin a scrolling view inside your GUI. - - Rectangle on the screen to use for the ScrollView. - The pixel distance that the view is scrolled in the X and Y directions. - The rectangle used inside the scrollview. - Optional GUIStyle to use for the horizontal scrollbar. If left out, the horizontalScrollbar style from the current GUISkin is used. - Optional GUIStyle to use for the vertical scrollbar. If left out, the verticalScrollbar style from the current GUISkin is used. - Optional parameter to always show the horizontal scrollbar. If false or left out, it is only shown when viewRect is wider than position. - Optional parameter to always show the vertical scrollbar. If false or left out, it is only shown when viewRect is taller than position. - - The modified scrollPosition. Feed this back into the variable you pass in, as shown in the example. - - - - - Begin a scrolling view inside your GUI. - - Rectangle on the screen to use for the ScrollView. - The pixel distance that the view is scrolled in the X and Y directions. - The rectangle used inside the scrollview. - Optional GUIStyle to use for the horizontal scrollbar. If left out, the horizontalScrollbar style from the current GUISkin is used. - Optional GUIStyle to use for the vertical scrollbar. If left out, the verticalScrollbar style from the current GUISkin is used. - Optional parameter to always show the horizontal scrollbar. If false or left out, it is only shown when viewRect is wider than position. - Optional parameter to always show the vertical scrollbar. If false or left out, it is only shown when viewRect is taller than position. - - The modified scrollPosition. Feed this back into the variable you pass in, as shown in the example. - - - - - Create a Box on the GUI Layer. - - Rectangle on the screen to use for the box. - Text to display on the box. - Texture to display on the box. - Text, image and tooltip for this box. - The style to use. If left out, the box style from the current GUISkin is used. - - - - Create a Box on the GUI Layer. - - Rectangle on the screen to use for the box. - Text to display on the box. - Texture to display on the box. - Text, image and tooltip for this box. - The style to use. If left out, the box style from the current GUISkin is used. - - - - Create a Box on the GUI Layer. - - Rectangle on the screen to use for the box. - Text to display on the box. - Texture to display on the box. - Text, image and tooltip for this box. - The style to use. If left out, the box style from the current GUISkin is used. - - - - Create a Box on the GUI Layer. - - Rectangle on the screen to use for the box. - Text to display on the box. - Texture to display on the box. - Text, image and tooltip for this box. - The style to use. If left out, the box style from the current GUISkin is used. - - - - Create a Box on the GUI Layer. - - Rectangle on the screen to use for the box. - Text to display on the box. - Texture to display on the box. - Text, image and tooltip for this box. - The style to use. If left out, the box style from the current GUISkin is used. - - - - Create a Box on the GUI Layer. - - Rectangle on the screen to use for the box. - Text to display on the box. - Texture to display on the box. - Text, image and tooltip for this box. - The style to use. If left out, the box style from the current GUISkin is used. - - - - Bring a specific window to back of the floating windows. - - The identifier used when you created the window in the Window call. - - - - Bring a specific window to front of the floating windows. - - The identifier used when you created the window in the Window call. - - - - Make a single press button. The user clicks them and something happens immediately. - - Rectangle on the screen to use for the button. - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the button style from the current GUISkin is used. - - true when the users clicks the button. - - - - - Make a single press button. The user clicks them and something happens immediately. - - Rectangle on the screen to use for the button. - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the button style from the current GUISkin is used. - - true when the users clicks the button. - - - - - Make a single press button. The user clicks them and something happens immediately. - - Rectangle on the screen to use for the button. - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the button style from the current GUISkin is used. - - true when the users clicks the button. - - - - - Make a single press button. The user clicks them and something happens immediately. - - Rectangle on the screen to use for the button. - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the button style from the current GUISkin is used. - - true when the users clicks the button. - - - - - Make a single press button. The user clicks them and something happens immediately. - - Rectangle on the screen to use for the button. - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the button style from the current GUISkin is used. - - true when the users clicks the button. - - - - - Make a single press button. The user clicks them and something happens immediately. - - Rectangle on the screen to use for the button. - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the button style from the current GUISkin is used. - - true when the users clicks the button. - - - - - Make a window draggable. - - The part of the window that can be dragged. This is clipped to the actual window. - - - - If you want to have the entire window background to act as a drag area, use the version of DragWindow that takes no parameters and put it at the end of the window function. - - - - - Draw a texture within a rectangle. - - Rectangle on the screen to draw the texture within. - Texture to display. - How to scale the image when the aspect ratio of it doesn't fit the aspect ratio to be drawn within. - Whether to apply alpha blending when drawing the image (enabled by default). - Aspect ratio to use for the source image. If 0 (the default), the aspect ratio from the image is used. Pass in w/h for the desired aspect ratio. This allows the aspect ratio of the source image to be adjusted without changing the pixel width and height. - - - - Draw a texture within a rectangle. - - Rectangle on the screen to draw the texture within. - Texture to display. - How to scale the image when the aspect ratio of it doesn't fit the aspect ratio to be drawn within. - Whether to apply alpha blending when drawing the image (enabled by default). - Aspect ratio to use for the source image. If 0 (the default), the aspect ratio from the image is used. Pass in w/h for the desired aspect ratio. This allows the aspect ratio of the source image to be adjusted without changing the pixel width and height. - - - - Draw a texture within a rectangle. - - Rectangle on the screen to draw the texture within. - Texture to display. - How to scale the image when the aspect ratio of it doesn't fit the aspect ratio to be drawn within. - Whether to apply alpha blending when drawing the image (enabled by default). - Aspect ratio to use for the source image. If 0 (the default), the aspect ratio from the image is used. Pass in w/h for the desired aspect ratio. This allows the aspect ratio of the source image to be adjusted without changing the pixel width and height. - - - - Draw a texture within a rectangle. - - Rectangle on the screen to draw the texture within. - Texture to display. - How to scale the image when the aspect ratio of it doesn't fit the aspect ratio to be drawn within. - Whether to apply alpha blending when drawing the image (enabled by default). - Aspect ratio to use for the source image. If 0 (the default), the aspect ratio from the image is used. Pass in w/h for the desired aspect ratio. This allows the aspect ratio of the source image to be adjusted without changing the pixel width and height. - - - - Draws a border with rounded corners within a rectangle. The texture is used to pattern the border. Note that this method only works on shader model 2.5 and above. - - Rectangle on the screen to draw the texture within. - Texture to display. - How to scale the image when the aspect ratio of it doesn't fit the aspect ratio to be drawn within. - Whether to apply alpha blending when drawing the image (enabled by default). - Aspect ratio to use for the source image. If 0 (the default), the aspect ratio from the image is used. Pass in w/h for the desired aspect ratio. This allows the aspect ratio of the source image to be adjusted without changing the pixel width and height. - A tint color to apply on the texture. - The width of the border. If 0, the full texture is drawn. - The width of the borders (left, top, right and bottom). If Vector4.zero, the full texture is drawn. - The radius for rounded corners. If 0, corners will not be rounded. - The radiuses for rounded corners (top-left, top-right, bottom-right and bottom-left). If Vector4.zero, corners will not be rounded. - - - - Draws a border with rounded corners within a rectangle. The texture is used to pattern the border. Note that this method only works on shader model 2.5 and above. - - Rectangle on the screen to draw the texture within. - Texture to display. - How to scale the image when the aspect ratio of it doesn't fit the aspect ratio to be drawn within. - Whether to apply alpha blending when drawing the image (enabled by default). - Aspect ratio to use for the source image. If 0 (the default), the aspect ratio from the image is used. Pass in w/h for the desired aspect ratio. This allows the aspect ratio of the source image to be adjusted without changing the pixel width and height. - A tint color to apply on the texture. - The width of the border. If 0, the full texture is drawn. - The width of the borders (left, top, right and bottom). If Vector4.zero, the full texture is drawn. - The radius for rounded corners. If 0, corners will not be rounded. - The radiuses for rounded corners (top-left, top-right, bottom-right and bottom-left). If Vector4.zero, corners will not be rounded. - - - - Draw a texture within a rectangle with the given texture coordinates. - - Rectangle on the screen to draw the texture within. - Texture to display. - How to scale the image when the aspect ratio of it doesn't fit the aspect ratio to be drawn within. - Whether to alpha blend the image on to the display (the default). If false, the picture is drawn on to the display. - - - - Draw a texture within a rectangle with the given texture coordinates. - - Rectangle on the screen to draw the texture within. - Texture to display. - How to scale the image when the aspect ratio of it doesn't fit the aspect ratio to be drawn within. - Whether to alpha blend the image on to the display (the default). If false, the picture is drawn on to the display. - - - - End a group. - - - - - Ends a scrollview started with a call to BeginScrollView. - - - - - - Ends a scrollview started with a call to BeginScrollView. - - - - - - Move keyboard focus to a named control. - - Name set using SetNextControlName. - - - - Make a window become the active window. - - The identifier used when you created the window in the Window call. - - - - Get the name of named control that has focus. - - - - - Disposable helper class for managing BeginGroup / EndGroup. - - - - - Create a new GroupScope and begin the corresponding group. - - Rectangle on the screen to use for the group. - Text to display on the group. - Texture to display on the group. - Text, image and tooltip for this group. If supplied, any mouse clicks are "captured" by the group and not If left out, no background is rendered, and mouse clicks are passed. - The style to use for the background. - - - - Create a new GroupScope and begin the corresponding group. - - Rectangle on the screen to use for the group. - Text to display on the group. - Texture to display on the group. - Text, image and tooltip for this group. If supplied, any mouse clicks are "captured" by the group and not If left out, no background is rendered, and mouse clicks are passed. - The style to use for the background. - - - - Create a new GroupScope and begin the corresponding group. - - Rectangle on the screen to use for the group. - Text to display on the group. - Texture to display on the group. - Text, image and tooltip for this group. If supplied, any mouse clicks are "captured" by the group and not If left out, no background is rendered, and mouse clicks are passed. - The style to use for the background. - - - - Create a new GroupScope and begin the corresponding group. - - Rectangle on the screen to use for the group. - Text to display on the group. - Texture to display on the group. - Text, image and tooltip for this group. If supplied, any mouse clicks are "captured" by the group and not If left out, no background is rendered, and mouse clicks are passed. - The style to use for the background. - - - - Create a new GroupScope and begin the corresponding group. - - Rectangle on the screen to use for the group. - Text to display on the group. - Texture to display on the group. - Text, image and tooltip for this group. If supplied, any mouse clicks are "captured" by the group and not If left out, no background is rendered, and mouse clicks are passed. - The style to use for the background. - - - - Create a new GroupScope and begin the corresponding group. - - Rectangle on the screen to use for the group. - Text to display on the group. - Texture to display on the group. - Text, image and tooltip for this group. If supplied, any mouse clicks are "captured" by the group and not If left out, no background is rendered, and mouse clicks are passed. - The style to use for the background. - - - - Create a new GroupScope and begin the corresponding group. - - Rectangle on the screen to use for the group. - Text to display on the group. - Texture to display on the group. - Text, image and tooltip for this group. If supplied, any mouse clicks are "captured" by the group and not If left out, no background is rendered, and mouse clicks are passed. - The style to use for the background. - - - - Make a horizontal scrollbar. Scrollbars are what you use to scroll through a document. Most likely, you want to use scrollViews instead. - - Rectangle on the screen to use for the scrollbar. - The position between min and max. - How much can we see? - The value at the left end of the scrollbar. - The value at the right end of the scrollbar. - The style to use for the scrollbar background. If left out, the horizontalScrollbar style from the current GUISkin is used. - - The modified value. This can be changed by the user by dragging the scrollbar, or clicking the arrows at the end. - - - - - Make a horizontal scrollbar. Scrollbars are what you use to scroll through a document. Most likely, you want to use scrollViews instead. - - Rectangle on the screen to use for the scrollbar. - The position between min and max. - How much can we see? - The value at the left end of the scrollbar. - The value at the right end of the scrollbar. - The style to use for the scrollbar background. If left out, the horizontalScrollbar style from the current GUISkin is used. - - The modified value. This can be changed by the user by dragging the scrollbar, or clicking the arrows at the end. - - - - - A horizontal slider the user can drag to change a value between a min and a max. - - Rectangle on the screen to use for the slider. - The value the slider shows. This determines the position of the draggable thumb. - The value at the left end of the slider. - The value at the right end of the slider. - The GUIStyle to use for displaying the dragging area. If left out, the horizontalSlider style from the current GUISkin is used. - The GUIStyle to use for displaying draggable thumb. If left out, the horizontalSliderThumb style from the current GUISkin is used. - - The value that has been set by the user. - - - - - A horizontal slider the user can drag to change a value between a min and a max. - - Rectangle on the screen to use for the slider. - The value the slider shows. This determines the position of the draggable thumb. - The value at the left end of the slider. - The value at the right end of the slider. - The GUIStyle to use for displaying the dragging area. If left out, the horizontalSlider style from the current GUISkin is used. - The GUIStyle to use for displaying draggable thumb. If left out, the horizontalSliderThumb style from the current GUISkin is used. - - The value that has been set by the user. - - - - - Make a text or texture label on screen. - - Rectangle on the screen to use for the label. - Text to display on the label. - Texture to display on the label. - Text, image and tooltip for this label. - The style to use. If left out, the label style from the current GUISkin is used. - - - - Make a text or texture label on screen. - - Rectangle on the screen to use for the label. - Text to display on the label. - Texture to display on the label. - Text, image and tooltip for this label. - The style to use. If left out, the label style from the current GUISkin is used. - - - - Make a text or texture label on screen. - - Rectangle on the screen to use for the label. - Text to display on the label. - Texture to display on the label. - Text, image and tooltip for this label. - The style to use. If left out, the label style from the current GUISkin is used. - - - - Make a text or texture label on screen. - - Rectangle on the screen to use for the label. - Text to display on the label. - Texture to display on the label. - Text, image and tooltip for this label. - The style to use. If left out, the label style from the current GUISkin is used. - - - - Make a text or texture label on screen. - - Rectangle on the screen to use for the label. - Text to display on the label. - Texture to display on the label. - Text, image and tooltip for this label. - The style to use. If left out, the label style from the current GUISkin is used. - - - - Make a text or texture label on screen. - - Rectangle on the screen to use for the label. - Text to display on the label. - Texture to display on the label. - Text, image and tooltip for this label. - The style to use. If left out, the label style from the current GUISkin is used. - - - - Show a Modal Window. - - A unique id number. - Position and size of the window. - A function which contains the immediate mode GUI code to draw the contents of your window. - Text to appear in the title-bar area of the window, if any. - An image to appear in the title bar of the window, if any. - GUIContent to appear in the title bar of the window, if any. - Style to apply to the window. - - - - Show a Modal Window. - - A unique id number. - Position and size of the window. - A function which contains the immediate mode GUI code to draw the contents of your window. - Text to appear in the title-bar area of the window, if any. - An image to appear in the title bar of the window, if any. - GUIContent to appear in the title bar of the window, if any. - Style to apply to the window. - - - - Show a Modal Window. - - A unique id number. - Position and size of the window. - A function which contains the immediate mode GUI code to draw the contents of your window. - Text to appear in the title-bar area of the window, if any. - An image to appear in the title bar of the window, if any. - GUIContent to appear in the title bar of the window, if any. - Style to apply to the window. - - - - Show a Modal Window. - - A unique id number. - Position and size of the window. - A function which contains the immediate mode GUI code to draw the contents of your window. - Text to appear in the title-bar area of the window, if any. - An image to appear in the title bar of the window, if any. - GUIContent to appear in the title bar of the window, if any. - Style to apply to the window. - - - - Show a Modal Window. - - A unique id number. - Position and size of the window. - A function which contains the immediate mode GUI code to draw the contents of your window. - Text to appear in the title-bar area of the window, if any. - An image to appear in the title bar of the window, if any. - GUIContent to appear in the title bar of the window, if any. - Style to apply to the window. - - - - Show a Modal Window. - - A unique id number. - Position and size of the window. - A function which contains the immediate mode GUI code to draw the contents of your window. - Text to appear in the title-bar area of the window, if any. - An image to appear in the title bar of the window, if any. - GUIContent to appear in the title bar of the window, if any. - Style to apply to the window. - - - - Show a Modal Window. - - A unique id number. - Position and size of the window. - A function which contains the immediate mode GUI code to draw the contents of your window. - Text to appear in the title-bar area of the window, if any. - An image to appear in the title bar of the window, if any. - GUIContent to appear in the title bar of the window, if any. - Style to apply to the window. - - - - Show a Modal Window. - - A unique id number. - Position and size of the window. - A function which contains the immediate mode GUI code to draw the contents of your window. - Text to appear in the title-bar area of the window, if any. - An image to appear in the title bar of the window, if any. - GUIContent to appear in the title bar of the window, if any. - Style to apply to the window. - - - - Make a text field where the user can enter a password. - - Rectangle on the screen to use for the text field. - Password to edit. The return value of this function should be assigned back to the string as shown in the example. - Character to mask the password with. - The maximum length of the string. If left out, the user can type for ever and ever. - The style to use. If left out, the textField style from the current GUISkin is used. - - The edited password. - - - - - Make a text field where the user can enter a password. - - Rectangle on the screen to use for the text field. - Password to edit. The return value of this function should be assigned back to the string as shown in the example. - Character to mask the password with. - The maximum length of the string. If left out, the user can type for ever and ever. - The style to use. If left out, the textField style from the current GUISkin is used. - - The edited password. - - - - - Make a text field where the user can enter a password. - - Rectangle on the screen to use for the text field. - Password to edit. The return value of this function should be assigned back to the string as shown in the example. - Character to mask the password with. - The maximum length of the string. If left out, the user can type for ever and ever. - The style to use. If left out, the textField style from the current GUISkin is used. - - The edited password. - - - - - Make a text field where the user can enter a password. - - Rectangle on the screen to use for the text field. - Password to edit. The return value of this function should be assigned back to the string as shown in the example. - Character to mask the password with. - The maximum length of the string. If left out, the user can type for ever and ever. - The style to use. If left out, the textField style from the current GUISkin is used. - - The edited password. - - - - - Make a button that is active as long as the user holds it down. - - Rectangle on the screen to use for the button. - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the button style from the current GUISkin is used. - - True when the users clicks the button. - - - - - Make a button that is active as long as the user holds it down. - - Rectangle on the screen to use for the button. - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the button style from the current GUISkin is used. - - True when the users clicks the button. - - - - - Make a button that is active as long as the user holds it down. - - Rectangle on the screen to use for the button. - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the button style from the current GUISkin is used. - - True when the users clicks the button. - - - - - Make a button that is active as long as the user holds it down. - - Rectangle on the screen to use for the button. - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the button style from the current GUISkin is used. - - True when the users clicks the button. - - - - - Make a button that is active as long as the user holds it down. - - Rectangle on the screen to use for the button. - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the button style from the current GUISkin is used. - - True when the users clicks the button. - - - - - Make a button that is active as long as the user holds it down. - - Rectangle on the screen to use for the button. - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the button style from the current GUISkin is used. - - True when the users clicks the button. - - - - - Scrolls all enclosing scrollviews so they try to make position visible. - - - - - - Disposable helper class for managing BeginScrollView / EndScrollView. - - - - - Whether this ScrollView should handle scroll wheel events. (default: true). - - - - - The modified scrollPosition. Feed this back into the variable you pass in, as shown in the example. - - - - - Create a new ScrollViewScope and begin the corresponding ScrollView. - - Rectangle on the screen to use for the ScrollView. - The pixel distance that the view is scrolled in the X and Y directions. - The rectangle used inside the scrollview. - Optional parameter to always show the horizontal scrollbar. If false or left out, it is only shown when clientRect is wider than position. - Optional parameter to always show the vertical scrollbar. If false or left out, it is only shown when clientRect is taller than position. - Optional GUIStyle to use for the horizontal scrollbar. If left out, the horizontalScrollbar style from the current GUISkin is used. - Optional GUIStyle to use for the vertical scrollbar. If left out, the verticalScrollbar style from the current GUISkin is used. - - - - Create a new ScrollViewScope and begin the corresponding ScrollView. - - Rectangle on the screen to use for the ScrollView. - The pixel distance that the view is scrolled in the X and Y directions. - The rectangle used inside the scrollview. - Optional parameter to always show the horizontal scrollbar. If false or left out, it is only shown when clientRect is wider than position. - Optional parameter to always show the vertical scrollbar. If false or left out, it is only shown when clientRect is taller than position. - Optional GUIStyle to use for the horizontal scrollbar. If left out, the horizontalScrollbar style from the current GUISkin is used. - Optional GUIStyle to use for the vertical scrollbar. If left out, the verticalScrollbar style from the current GUISkin is used. - - - - Create a new ScrollViewScope and begin the corresponding ScrollView. - - Rectangle on the screen to use for the ScrollView. - The pixel distance that the view is scrolled in the X and Y directions. - The rectangle used inside the scrollview. - Optional parameter to always show the horizontal scrollbar. If false or left out, it is only shown when clientRect is wider than position. - Optional parameter to always show the vertical scrollbar. If false or left out, it is only shown when clientRect is taller than position. - Optional GUIStyle to use for the horizontal scrollbar. If left out, the horizontalScrollbar style from the current GUISkin is used. - Optional GUIStyle to use for the vertical scrollbar. If left out, the verticalScrollbar style from the current GUISkin is used. - - - - Create a new ScrollViewScope and begin the corresponding ScrollView. - - Rectangle on the screen to use for the ScrollView. - The pixel distance that the view is scrolled in the X and Y directions. - The rectangle used inside the scrollview. - Optional parameter to always show the horizontal scrollbar. If false or left out, it is only shown when clientRect is wider than position. - Optional parameter to always show the vertical scrollbar. If false or left out, it is only shown when clientRect is taller than position. - Optional GUIStyle to use for the horizontal scrollbar. If left out, the horizontalScrollbar style from the current GUISkin is used. - Optional GUIStyle to use for the vertical scrollbar. If left out, the verticalScrollbar style from the current GUISkin is used. - - - - Make a grid of buttons. - - Rectangle on the screen to use for the grid. - The index of the selected grid button. - An array of strings to show on the grid buttons. - An array of textures on the grid buttons. - An array of text, image and tooltips for the grid button. - How many elements to fit in the horizontal direction. The controls will be scaled to fit unless the style defines a fixedWidth to use. - The style to use. If left out, the button style from the current GUISkin is used. - - - The index of the selected button. - - - - - Make a grid of buttons. - - Rectangle on the screen to use for the grid. - The index of the selected grid button. - An array of strings to show on the grid buttons. - An array of textures on the grid buttons. - An array of text, image and tooltips for the grid button. - How many elements to fit in the horizontal direction. The controls will be scaled to fit unless the style defines a fixedWidth to use. - The style to use. If left out, the button style from the current GUISkin is used. - - - The index of the selected button. - - - - - Make a grid of buttons. - - Rectangle on the screen to use for the grid. - The index of the selected grid button. - An array of strings to show on the grid buttons. - An array of textures on the grid buttons. - An array of text, image and tooltips for the grid button. - How many elements to fit in the horizontal direction. The controls will be scaled to fit unless the style defines a fixedWidth to use. - The style to use. If left out, the button style from the current GUISkin is used. - - - The index of the selected button. - - - - - Make a grid of buttons. - - Rectangle on the screen to use for the grid. - The index of the selected grid button. - An array of strings to show on the grid buttons. - An array of textures on the grid buttons. - An array of text, image and tooltips for the grid button. - How many elements to fit in the horizontal direction. The controls will be scaled to fit unless the style defines a fixedWidth to use. - The style to use. If left out, the button style from the current GUISkin is used. - - - The index of the selected button. - - - - - Make a grid of buttons. - - Rectangle on the screen to use for the grid. - The index of the selected grid button. - An array of strings to show on the grid buttons. - An array of textures on the grid buttons. - An array of text, image and tooltips for the grid button. - How many elements to fit in the horizontal direction. The controls will be scaled to fit unless the style defines a fixedWidth to use. - The style to use. If left out, the button style from the current GUISkin is used. - - - The index of the selected button. - - - - - Make a grid of buttons. - - Rectangle on the screen to use for the grid. - The index of the selected grid button. - An array of strings to show on the grid buttons. - An array of textures on the grid buttons. - An array of text, image and tooltips for the grid button. - How many elements to fit in the horizontal direction. The controls will be scaled to fit unless the style defines a fixedWidth to use. - The style to use. If left out, the button style from the current GUISkin is used. - - - The index of the selected button. - - - - - Set the name of the next control. - - - - - - Make a Multi-line text area where the user can edit a string. - - Rectangle on the screen to use for the text field. - Text to edit. The return value of this function should be assigned back to the string as shown in the example. - The maximum length of the string. If left out, the user can type for ever and ever. - The style to use. If left out, the textArea style from the current GUISkin is used. - - The edited string. - - - - - Make a Multi-line text area where the user can edit a string. - - Rectangle on the screen to use for the text field. - Text to edit. The return value of this function should be assigned back to the string as shown in the example. - The maximum length of the string. If left out, the user can type for ever and ever. - The style to use. If left out, the textArea style from the current GUISkin is used. - - The edited string. - - - - - Make a Multi-line text area where the user can edit a string. - - Rectangle on the screen to use for the text field. - Text to edit. The return value of this function should be assigned back to the string as shown in the example. - The maximum length of the string. If left out, the user can type for ever and ever. - The style to use. If left out, the textArea style from the current GUISkin is used. - - The edited string. - - - - - Make a Multi-line text area where the user can edit a string. - - Rectangle on the screen to use for the text field. - Text to edit. The return value of this function should be assigned back to the string as shown in the example. - The maximum length of the string. If left out, the user can type for ever and ever. - The style to use. If left out, the textArea style from the current GUISkin is used. - - The edited string. - - - - - Make a single-line text field where the user can edit a string. - - Rectangle on the screen to use for the text field. - Text to edit. The return value of this function should be assigned back to the string as shown in the example. - The maximum length of the string. If left out, the user can type for ever and ever. - The style to use. If left out, the textField style from the current GUISkin is used. - - The edited string. - - - - - Make a single-line text field where the user can edit a string. - - Rectangle on the screen to use for the text field. - Text to edit. The return value of this function should be assigned back to the string as shown in the example. - The maximum length of the string. If left out, the user can type for ever and ever. - The style to use. If left out, the textField style from the current GUISkin is used. - - The edited string. - - - - - Make a single-line text field where the user can edit a string. - - Rectangle on the screen to use for the text field. - Text to edit. The return value of this function should be assigned back to the string as shown in the example. - The maximum length of the string. If left out, the user can type for ever and ever. - The style to use. If left out, the textField style from the current GUISkin is used. - - The edited string. - - - - - Make a single-line text field where the user can edit a string. - - Rectangle on the screen to use for the text field. - Text to edit. The return value of this function should be assigned back to the string as shown in the example. - The maximum length of the string. If left out, the user can type for ever and ever. - The style to use. If left out, the textField style from the current GUISkin is used. - - The edited string. - - - - - Make an on/off toggle button. - - Rectangle on the screen to use for the button. - Is this button on or off? - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the toggle style from the current GUISkin is used. - - The new value of the button. - - - - - Make an on/off toggle button. - - Rectangle on the screen to use for the button. - Is this button on or off? - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the toggle style from the current GUISkin is used. - - The new value of the button. - - - - - Make an on/off toggle button. - - Rectangle on the screen to use for the button. - Is this button on or off? - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the toggle style from the current GUISkin is used. - - The new value of the button. - - - - - Make an on/off toggle button. - - Rectangle on the screen to use for the button. - Is this button on or off? - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the toggle style from the current GUISkin is used. - - The new value of the button. - - - - - Make an on/off toggle button. - - Rectangle on the screen to use for the button. - Is this button on or off? - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the toggle style from the current GUISkin is used. - - The new value of the button. - - - - - Make an on/off toggle button. - - Rectangle on the screen to use for the button. - Is this button on or off? - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the toggle style from the current GUISkin is used. - - The new value of the button. - - - - - Make a toolbar. - - Rectangle on the screen to use for the toolbar. - The index of the selected button. - An array of strings to show on the toolbar buttons. - An array of textures on the toolbar buttons. - An array of text, image and tooltips for the toolbar buttons. - The style to use. If left out, the button style from the current GUISkin is used. - Determines how toolbar button size is calculated. - - The index of the selected button. - - - - - Make a toolbar. - - Rectangle on the screen to use for the toolbar. - The index of the selected button. - An array of strings to show on the toolbar buttons. - An array of textures on the toolbar buttons. - An array of text, image and tooltips for the toolbar buttons. - The style to use. If left out, the button style from the current GUISkin is used. - Determines how toolbar button size is calculated. - - The index of the selected button. - - - - - Make a toolbar. - - Rectangle on the screen to use for the toolbar. - The index of the selected button. - An array of strings to show on the toolbar buttons. - An array of textures on the toolbar buttons. - An array of text, image and tooltips for the toolbar buttons. - The style to use. If left out, the button style from the current GUISkin is used. - Determines how toolbar button size is calculated. - - The index of the selected button. - - - - - Make a toolbar. - - Rectangle on the screen to use for the toolbar. - The index of the selected button. - An array of strings to show on the toolbar buttons. - An array of textures on the toolbar buttons. - An array of text, image and tooltips for the toolbar buttons. - The style to use. If left out, the button style from the current GUISkin is used. - Determines how toolbar button size is calculated. - - The index of the selected button. - - - - - Make a toolbar. - - Rectangle on the screen to use for the toolbar. - The index of the selected button. - An array of strings to show on the toolbar buttons. - An array of textures on the toolbar buttons. - An array of text, image and tooltips for the toolbar buttons. - The style to use. If left out, the button style from the current GUISkin is used. - Determines how toolbar button size is calculated. - - The index of the selected button. - - - - - Make a toolbar. - - Rectangle on the screen to use for the toolbar. - The index of the selected button. - An array of strings to show on the toolbar buttons. - An array of textures on the toolbar buttons. - An array of text, image and tooltips for the toolbar buttons. - The style to use. If left out, the button style from the current GUISkin is used. - Determines how toolbar button size is calculated. - - The index of the selected button. - - - - - Make a toolbar. - - Rectangle on the screen to use for the toolbar. - The index of the selected button. - An array of strings to show on the toolbar buttons. - An array of textures on the toolbar buttons. - An array of text, image and tooltips for the toolbar buttons. - The style to use. If left out, the button style from the current GUISkin is used. - Determines how toolbar button size is calculated. - - The index of the selected button. - - - - - Determines how toolbar button size is calculated. - - - - - The width of each toolbar button is calculated based on the width of its content. - - - - - Calculates the button size by dividing the available width by the number of buttons. The minimum size is the maximum content width. - - - - - Remove focus from all windows. - - - - - Make a vertical scrollbar. Scrollbars are what you use to scroll through a document. Most likely, you want to use scrollViews instead. - - Rectangle on the screen to use for the scrollbar. - The position between min and max. - How much can we see? - The value at the top of the scrollbar. - The value at the bottom of the scrollbar. - The style to use for the scrollbar background. If left out, the horizontalScrollbar style from the current GUISkin is used. - - The modified value. This can be changed by the user by dragging the scrollbar, or clicking the arrows at the end. - - - - - Make a vertical scrollbar. Scrollbars are what you use to scroll through a document. Most likely, you want to use scrollViews instead. - - Rectangle on the screen to use for the scrollbar. - The position between min and max. - How much can we see? - The value at the top of the scrollbar. - The value at the bottom of the scrollbar. - The style to use for the scrollbar background. If left out, the horizontalScrollbar style from the current GUISkin is used. - - The modified value. This can be changed by the user by dragging the scrollbar, or clicking the arrows at the end. - - - - - A vertical slider the user can drag to change a value between a min and a max. - - Rectangle on the screen to use for the slider. - The value the slider shows. This determines the position of the draggable thumb. - The value at the top end of the slider. - The value at the bottom end of the slider. - The GUIStyle to use for displaying the dragging area. If left out, the horizontalSlider style from the current GUISkin is used. - The GUIStyle to use for displaying draggable thumb. If left out, the horizontalSliderThumb style from the current GUISkin is used. - - The value that has been set by the user. - - - - - A vertical slider the user can drag to change a value between a min and a max. - - Rectangle on the screen to use for the slider. - The value the slider shows. This determines the position of the draggable thumb. - The value at the top end of the slider. - The value at the bottom end of the slider. - The GUIStyle to use for displaying the dragging area. If left out, the horizontalSlider style from the current GUISkin is used. - The GUIStyle to use for displaying draggable thumb. If left out, the horizontalSliderThumb style from the current GUISkin is used. - - The value that has been set by the user. - - - - - Make a popup window. - - An optional style to use for the window. If left out, the window style from the current GUISkin is used. - ID number for the window (can be any value as long as it is unique). - Onscreen rectangle denoting the window's position and size. - Script function to display the window's contents. - Text to render inside the window. - Image to render inside the window. - GUIContent to render inside the window. - Style information for the window. - Text displayed in the window's title bar. - - Onscreen rectangle denoting the window's position and size. - - - - - Make a popup window. - - An optional style to use for the window. If left out, the window style from the current GUISkin is used. - ID number for the window (can be any value as long as it is unique). - Onscreen rectangle denoting the window's position and size. - Script function to display the window's contents. - Text to render inside the window. - Image to render inside the window. - GUIContent to render inside the window. - Style information for the window. - Text displayed in the window's title bar. - - Onscreen rectangle denoting the window's position and size. - - - - - Make a popup window. - - An optional style to use for the window. If left out, the window style from the current GUISkin is used. - ID number for the window (can be any value as long as it is unique). - Onscreen rectangle denoting the window's position and size. - Script function to display the window's contents. - Text to render inside the window. - Image to render inside the window. - GUIContent to render inside the window. - Style information for the window. - Text displayed in the window's title bar. - - Onscreen rectangle denoting the window's position and size. - - - - - Make a popup window. - - An optional style to use for the window. If left out, the window style from the current GUISkin is used. - ID number for the window (can be any value as long as it is unique). - Onscreen rectangle denoting the window's position and size. - Script function to display the window's contents. - Text to render inside the window. - Image to render inside the window. - GUIContent to render inside the window. - Style information for the window. - Text displayed in the window's title bar. - - Onscreen rectangle denoting the window's position and size. - - - - - Make a popup window. - - An optional style to use for the window. If left out, the window style from the current GUISkin is used. - ID number for the window (can be any value as long as it is unique). - Onscreen rectangle denoting the window's position and size. - Script function to display the window's contents. - Text to render inside the window. - Image to render inside the window. - GUIContent to render inside the window. - Style information for the window. - Text displayed in the window's title bar. - - Onscreen rectangle denoting the window's position and size. - - - - - Make a popup window. - - An optional style to use for the window. If left out, the window style from the current GUISkin is used. - ID number for the window (can be any value as long as it is unique). - Onscreen rectangle denoting the window's position and size. - Script function to display the window's contents. - Text to render inside the window. - Image to render inside the window. - GUIContent to render inside the window. - Style information for the window. - Text displayed in the window's title bar. - - Onscreen rectangle denoting the window's position and size. - - - - - Callback to draw GUI within a window (used with GUI.Window). - - - - - - The contents of a GUI element. - - - - - The icon image contained. - - - - - Shorthand for empty content. - - - - - The text contained. - - - - - The tooltip of this element. - - - - - Constructor for GUIContent in all shapes and sizes. - - - - - Build a GUIContent object containing only text. - - - - - - Build a GUIContent object containing only an image. - - - - - - Build a GUIContent object containing both text and an image. - - - - - - - Build a GUIContent containing some text. When the user hovers the mouse over it, the global GUI.tooltip is set to the tooltip. - - - - - - - Build a GUIContent containing an image. When the user hovers the mouse over it, the global GUI.tooltip is set to the tooltip. - - - - - - - Build a GUIContent that contains both text, an image and has a tooltip defined. When the user hovers the mouse over it, the global GUI.tooltip is set to the tooltip. - - - - - - - - Build a GUIContent as a copy of another GUIContent. - - - - - - Base class for images & text strings displayed in a GUI. - - - - - Returns bounding rectangle of GUIElement in screen coordinates. - - - - - - Returns bounding rectangle of GUIElement in screen coordinates. - - - - - - Is a point on screen inside the element? - - - - - - - Is a point on screen inside the element? - - - - - - - The GUILayout class is the interface for Unity gui with automatic layout. - - - - - Disposable helper class for managing BeginArea / EndArea. - - - - - Create a new AreaScope and begin the corresponding Area. - - Optional text to display in the area. - Optional texture to display in the area. - Optional text, image and tooltip top display for this area. - The style to use. If left out, the empty GUIStyle (GUIStyle.none) is used, giving a transparent background. - - - - - Create a new AreaScope and begin the corresponding Area. - - Optional text to display in the area. - Optional texture to display in the area. - Optional text, image and tooltip top display for this area. - The style to use. If left out, the empty GUIStyle (GUIStyle.none) is used, giving a transparent background. - - - - - Create a new AreaScope and begin the corresponding Area. - - Optional text to display in the area. - Optional texture to display in the area. - Optional text, image and tooltip top display for this area. - The style to use. If left out, the empty GUIStyle (GUIStyle.none) is used, giving a transparent background. - - - - - Create a new AreaScope and begin the corresponding Area. - - Optional text to display in the area. - Optional texture to display in the area. - Optional text, image and tooltip top display for this area. - The style to use. If left out, the empty GUIStyle (GUIStyle.none) is used, giving a transparent background. - - - - - Create a new AreaScope and begin the corresponding Area. - - Optional text to display in the area. - Optional texture to display in the area. - Optional text, image and tooltip top display for this area. - The style to use. If left out, the empty GUIStyle (GUIStyle.none) is used, giving a transparent background. - - - - - Create a new AreaScope and begin the corresponding Area. - - Optional text to display in the area. - Optional texture to display in the area. - Optional text, image and tooltip top display for this area. - The style to use. If left out, the empty GUIStyle (GUIStyle.none) is used, giving a transparent background. - - - - - Create a new AreaScope and begin the corresponding Area. - - Optional text to display in the area. - Optional texture to display in the area. - Optional text, image and tooltip top display for this area. - The style to use. If left out, the empty GUIStyle (GUIStyle.none) is used, giving a transparent background. - - - - - Begin a GUILayout block of GUI controls in a fixed screen area. - - Optional text to display in the area. - Optional texture to display in the area. - Optional text, image and tooltip top display for this area. - The style to use. If left out, the empty GUIStyle (GUIStyle.none) is used, giving a transparent background. - - - - - Begin a GUILayout block of GUI controls in a fixed screen area. - - Optional text to display in the area. - Optional texture to display in the area. - Optional text, image and tooltip top display for this area. - The style to use. If left out, the empty GUIStyle (GUIStyle.none) is used, giving a transparent background. - - - - - Begin a GUILayout block of GUI controls in a fixed screen area. - - Optional text to display in the area. - Optional texture to display in the area. - Optional text, image and tooltip top display for this area. - The style to use. If left out, the empty GUIStyle (GUIStyle.none) is used, giving a transparent background. - - - - - Begin a GUILayout block of GUI controls in a fixed screen area. - - Optional text to display in the area. - Optional texture to display in the area. - Optional text, image and tooltip top display for this area. - The style to use. If left out, the empty GUIStyle (GUIStyle.none) is used, giving a transparent background. - - - - - Begin a GUILayout block of GUI controls in a fixed screen area. - - Optional text to display in the area. - Optional texture to display in the area. - Optional text, image and tooltip top display for this area. - The style to use. If left out, the empty GUIStyle (GUIStyle.none) is used, giving a transparent background. - - - - - Begin a GUILayout block of GUI controls in a fixed screen area. - - Optional text to display in the area. - Optional texture to display in the area. - Optional text, image and tooltip top display for this area. - The style to use. If left out, the empty GUIStyle (GUIStyle.none) is used, giving a transparent background. - - - - - Begin a GUILayout block of GUI controls in a fixed screen area. - - Optional text to display in the area. - Optional texture to display in the area. - Optional text, image and tooltip top display for this area. - The style to use. If left out, the empty GUIStyle (GUIStyle.none) is used, giving a transparent background. - - - - - Begin a GUILayout block of GUI controls in a fixed screen area. - - Optional text to display in the area. - Optional texture to display in the area. - Optional text, image and tooltip top display for this area. - The style to use. If left out, the empty GUIStyle (GUIStyle.none) is used, giving a transparent background. - - - - - Begin a Horizontal control group. - - Text to display on group. - Texture to display on group. - Text, image, and tooltip for this group. - The style to use for background image and padding values. If left out, the background is transparent. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - - Begin a Horizontal control group. - - Text to display on group. - Texture to display on group. - Text, image, and tooltip for this group. - The style to use for background image and padding values. If left out, the background is transparent. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - - Begin a Horizontal control group. - - Text to display on group. - Texture to display on group. - Text, image, and tooltip for this group. - The style to use for background image and padding values. If left out, the background is transparent. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - - Begin a Horizontal control group. - - Text to display on group. - Texture to display on group. - Text, image, and tooltip for this group. - The style to use for background image and padding values. If left out, the background is transparent. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - - Begin a Horizontal control group. - - Text to display on group. - Texture to display on group. - Text, image, and tooltip for this group. - The style to use for background image and padding values. If left out, the background is transparent. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - - Begin an automatically laid out scrollview. - - The position to use display. - Optional parameter to always show the horizontal scrollbar. If false or left out, it is only shown when the content inside the ScrollView is wider than the scrollview itself. - Optional parameter to always show the vertical scrollbar. If false or left out, it is only shown when content inside the ScrollView is taller than the scrollview itself. - Optional GUIStyle to use for the horizontal scrollbar. If left out, the horizontalScrollbar style from the current GUISkin is used. - Optional GUIStyle to use for the vertical scrollbar. If left out, the verticalScrollbar style from the current GUISkin is used. - - - - - - - The modified scrollPosition. Feed this back into the variable you pass in, as shown in the example. - - - - - Begin an automatically laid out scrollview. - - The position to use display. - Optional parameter to always show the horizontal scrollbar. If false or left out, it is only shown when the content inside the ScrollView is wider than the scrollview itself. - Optional parameter to always show the vertical scrollbar. If false or left out, it is only shown when content inside the ScrollView is taller than the scrollview itself. - Optional GUIStyle to use for the horizontal scrollbar. If left out, the horizontalScrollbar style from the current GUISkin is used. - Optional GUIStyle to use for the vertical scrollbar. If left out, the verticalScrollbar style from the current GUISkin is used. - - - - - - - The modified scrollPosition. Feed this back into the variable you pass in, as shown in the example. - - - - - Begin an automatically laid out scrollview. - - The position to use display. - Optional parameter to always show the horizontal scrollbar. If false or left out, it is only shown when the content inside the ScrollView is wider than the scrollview itself. - Optional parameter to always show the vertical scrollbar. If false or left out, it is only shown when content inside the ScrollView is taller than the scrollview itself. - Optional GUIStyle to use for the horizontal scrollbar. If left out, the horizontalScrollbar style from the current GUISkin is used. - Optional GUIStyle to use for the vertical scrollbar. If left out, the verticalScrollbar style from the current GUISkin is used. - - - - - - - The modified scrollPosition. Feed this back into the variable you pass in, as shown in the example. - - - - - Begin an automatically laid out scrollview. - - The position to use display. - Optional parameter to always show the horizontal scrollbar. If false or left out, it is only shown when the content inside the ScrollView is wider than the scrollview itself. - Optional parameter to always show the vertical scrollbar. If false or left out, it is only shown when content inside the ScrollView is taller than the scrollview itself. - Optional GUIStyle to use for the horizontal scrollbar. If left out, the horizontalScrollbar style from the current GUISkin is used. - Optional GUIStyle to use for the vertical scrollbar. If left out, the verticalScrollbar style from the current GUISkin is used. - - - - - - - The modified scrollPosition. Feed this back into the variable you pass in, as shown in the example. - - - - - Begin an automatically laid out scrollview. - - The position to use display. - Optional parameter to always show the horizontal scrollbar. If false or left out, it is only shown when the content inside the ScrollView is wider than the scrollview itself. - Optional parameter to always show the vertical scrollbar. If false or left out, it is only shown when content inside the ScrollView is taller than the scrollview itself. - Optional GUIStyle to use for the horizontal scrollbar. If left out, the horizontalScrollbar style from the current GUISkin is used. - Optional GUIStyle to use for the vertical scrollbar. If left out, the verticalScrollbar style from the current GUISkin is used. - - - - - - - The modified scrollPosition. Feed this back into the variable you pass in, as shown in the example. - - - - - Begin an automatically laid out scrollview. - - The position to use display. - Optional parameter to always show the horizontal scrollbar. If false or left out, it is only shown when the content inside the ScrollView is wider than the scrollview itself. - Optional parameter to always show the vertical scrollbar. If false or left out, it is only shown when content inside the ScrollView is taller than the scrollview itself. - Optional GUIStyle to use for the horizontal scrollbar. If left out, the horizontalScrollbar style from the current GUISkin is used. - Optional GUIStyle to use for the vertical scrollbar. If left out, the verticalScrollbar style from the current GUISkin is used. - - - - - - - The modified scrollPosition. Feed this back into the variable you pass in, as shown in the example. - - - - - Begin an automatically laid out scrollview. - - The position to use display. - Optional parameter to always show the horizontal scrollbar. If false or left out, it is only shown when the content inside the ScrollView is wider than the scrollview itself. - Optional parameter to always show the vertical scrollbar. If false or left out, it is only shown when content inside the ScrollView is taller than the scrollview itself. - Optional GUIStyle to use for the horizontal scrollbar. If left out, the horizontalScrollbar style from the current GUISkin is used. - Optional GUIStyle to use for the vertical scrollbar. If left out, the verticalScrollbar style from the current GUISkin is used. - - - - - - - The modified scrollPosition. Feed this back into the variable you pass in, as shown in the example. - - - - - Begin a vertical control group. - - Text to display on group. - Texture to display on group. - Text, image, and tooltip for this group. - The style to use for background image and padding values. If left out, the background is transparent. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - - Begin a vertical control group. - - Text to display on group. - Texture to display on group. - Text, image, and tooltip for this group. - The style to use for background image and padding values. If left out, the background is transparent. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - - Begin a vertical control group. - - Text to display on group. - Texture to display on group. - Text, image, and tooltip for this group. - The style to use for background image and padding values. If left out, the background is transparent. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - - Begin a vertical control group. - - Text to display on group. - Texture to display on group. - Text, image, and tooltip for this group. - The style to use for background image and padding values. If left out, the background is transparent. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - - Begin a vertical control group. - - Text to display on group. - Texture to display on group. - Text, image, and tooltip for this group. - The style to use for background image and padding values. If left out, the background is transparent. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - - Make an auto-layout box. - - Text to display on the box. - Texture to display on the box. - Text, image and tooltip for this box. - The style to use. If left out, the box style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - - Make an auto-layout box. - - Text to display on the box. - Texture to display on the box. - Text, image and tooltip for this box. - The style to use. If left out, the box style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - - Make an auto-layout box. - - Text to display on the box. - Texture to display on the box. - Text, image and tooltip for this box. - The style to use. If left out, the box style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - - Make an auto-layout box. - - Text to display on the box. - Texture to display on the box. - Text, image and tooltip for this box. - The style to use. If left out, the box style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - - Make an auto-layout box. - - Text to display on the box. - Texture to display on the box. - Text, image and tooltip for this box. - The style to use. If left out, the box style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - - Make an auto-layout box. - - Text to display on the box. - Texture to display on the box. - Text, image and tooltip for this box. - The style to use. If left out, the box style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - - Make a single press button. - - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the button style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - true when the users clicks the button. - - - - - Make a single press button. - - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the button style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - true when the users clicks the button. - - - - - Make a single press button. - - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the button style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - true when the users clicks the button. - - - - - Make a single press button. - - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the button style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - true when the users clicks the button. - - - - - Make a single press button. - - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the button style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - true when the users clicks the button. - - - - - Make a single press button. - - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the button style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - true when the users clicks the button. - - - - - Close a GUILayout block started with BeginArea. - - - - - Close a group started with BeginHorizontal. - - - - - End a scroll view begun with a call to BeginScrollView. - - - - - Close a group started with BeginVertical. - - - - - Option passed to a control to allow or disallow vertical expansion. - - - - - - Option passed to a control to allow or disallow horizontal expansion. - - - - - - Insert a flexible space element. - - - - - Option passed to a control to give it an absolute height. - - - - - - Disposable helper class for managing BeginHorizontal / EndHorizontal. - - - - - Create a new HorizontalScope and begin the corresponding horizontal group. - - Text to display on group. - Texture to display on group. - Text, image, and tooltip for this group. - The style to use for background image and padding values. If left out, the background is transparent. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - - Create a new HorizontalScope and begin the corresponding horizontal group. - - Text to display on group. - Texture to display on group. - Text, image, and tooltip for this group. - The style to use for background image and padding values. If left out, the background is transparent. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - - Create a new HorizontalScope and begin the corresponding horizontal group. - - Text to display on group. - Texture to display on group. - Text, image, and tooltip for this group. - The style to use for background image and padding values. If left out, the background is transparent. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - - Create a new HorizontalScope and begin the corresponding horizontal group. - - Text to display on group. - Texture to display on group. - Text, image, and tooltip for this group. - The style to use for background image and padding values. If left out, the background is transparent. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - - Create a new HorizontalScope and begin the corresponding horizontal group. - - Text to display on group. - Texture to display on group. - Text, image, and tooltip for this group. - The style to use for background image and padding values. If left out, the background is transparent. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - - Make a horizontal scrollbar. - - The position between min and max. - How much can we see? - The value at the left end of the scrollbar. - The value at the right end of the scrollbar. - The style to use for the scrollbar background. If left out, the horizontalScrollbar style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style. - - The modified value. This can be changed by the user by dragging the scrollbar, or clicking the arrows at the end. - - - - - Make a horizontal scrollbar. - - The position between min and max. - How much can we see? - The value at the left end of the scrollbar. - The value at the right end of the scrollbar. - The style to use for the scrollbar background. If left out, the horizontalScrollbar style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style. - - The modified value. This can be changed by the user by dragging the scrollbar, or clicking the arrows at the end. - - - - - A horizontal slider the user can drag to change a value between a min and a max. - - The value the slider shows. This determines the position of the draggable thumb. - The value at the left end of the slider. - The value at the right end of the slider. - The GUIStyle to use for displaying the dragging area. If left out, the horizontalSlider style from the current GUISkin is used. - The GUIStyle to use for displaying draggable thumb. If left out, the horizontalSliderThumb style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style. - - The value that has been set by the user. - - - - - A horizontal slider the user can drag to change a value between a min and a max. - - The value the slider shows. This determines the position of the draggable thumb. - The value at the left end of the slider. - The value at the right end of the slider. - The GUIStyle to use for displaying the dragging area. If left out, the horizontalSlider style from the current GUISkin is used. - The GUIStyle to use for displaying draggable thumb. If left out, the horizontalSliderThumb style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style. - - The value that has been set by the user. - - - - - Make an auto-layout label. - - Text to display on the label. - Texture to display on the label. - Text, image and tooltip for this label. - The style to use. If left out, the label style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - - Make an auto-layout label. - - Text to display on the label. - Texture to display on the label. - Text, image and tooltip for this label. - The style to use. If left out, the label style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - - Make an auto-layout label. - - Text to display on the label. - Texture to display on the label. - Text, image and tooltip for this label. - The style to use. If left out, the label style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - - Make an auto-layout label. - - Text to display on the label. - Texture to display on the label. - Text, image and tooltip for this label. - The style to use. If left out, the label style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - - Make an auto-layout label. - - Text to display on the label. - Texture to display on the label. - Text, image and tooltip for this label. - The style to use. If left out, the label style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - - Make an auto-layout label. - - Text to display on the label. - Texture to display on the label. - Text, image and tooltip for this label. - The style to use. If left out, the label style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - - Option passed to a control to specify a maximum height. - - - - - - Option passed to a control to specify a maximum width. - - - - - - Option passed to a control to specify a minimum height. - - - - - - Option passed to a control to specify a minimum width. - - - - - - - Make a text field where the user can enter a password. - - Password to edit. The return value of this function should be assigned back to the string as shown in the example. - Character to mask the password with. - The maximum length of the string. If left out, the user can type for ever and ever. - The style to use. If left out, the textField style from the current GUISkin is used. - - - The edited password. - - - - - Make a text field where the user can enter a password. - - Password to edit. The return value of this function should be assigned back to the string as shown in the example. - Character to mask the password with. - The maximum length of the string. If left out, the user can type for ever and ever. - The style to use. If left out, the textField style from the current GUISkin is used. - - - The edited password. - - - - - Make a text field where the user can enter a password. - - Password to edit. The return value of this function should be assigned back to the string as shown in the example. - Character to mask the password with. - The maximum length of the string. If left out, the user can type for ever and ever. - The style to use. If left out, the textField style from the current GUISkin is used. - - - The edited password. - - - - - Make a text field where the user can enter a password. - - Password to edit. The return value of this function should be assigned back to the string as shown in the example. - Character to mask the password with. - The maximum length of the string. If left out, the user can type for ever and ever. - The style to use. If left out, the textField style from the current GUISkin is used. - - - The edited password. - - - - - Make a repeating button. The button returns true as long as the user holds down the mouse. - - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the button style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - true when the holds down the mouse. - - - - - Make a repeating button. The button returns true as long as the user holds down the mouse. - - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the button style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - true when the holds down the mouse. - - - - - Make a repeating button. The button returns true as long as the user holds down the mouse. - - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the button style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - true when the holds down the mouse. - - - - - Make a repeating button. The button returns true as long as the user holds down the mouse. - - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the button style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - true when the holds down the mouse. - - - - - Make a repeating button. The button returns true as long as the user holds down the mouse. - - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the button style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - true when the holds down the mouse. - - - - - Make a repeating button. The button returns true as long as the user holds down the mouse. - - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the button style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - true when the holds down the mouse. - - - - - Disposable helper class for managing BeginScrollView / EndScrollView. - - - - - Whether this ScrollView should handle scroll wheel events. (default: true). - - - - - The modified scrollPosition. Feed this back into the variable you pass in, as shown in the example. - - - - - Create a new ScrollViewScope and begin the corresponding ScrollView. - - The position to use display. - Optional parameter to always show the horizontal scrollbar. If false or left out, it is only shown when the content inside the ScrollView is wider than the scrollview itself. - Optional parameter to always show the vertical scrollbar. If false or left out, it is only shown when content inside the ScrollView is taller than the scrollview itself. - Optional GUIStyle to use for the horizontal scrollbar. If left out, the horizontalScrollbar style from the current GUISkin is used. - Optional GUIStyle to use for the vertical scrollbar. If left out, the verticalScrollbar style from the current GUISkin is used. - - - - - - - Create a new ScrollViewScope and begin the corresponding ScrollView. - - The position to use display. - Optional parameter to always show the horizontal scrollbar. If false or left out, it is only shown when the content inside the ScrollView is wider than the scrollview itself. - Optional parameter to always show the vertical scrollbar. If false or left out, it is only shown when content inside the ScrollView is taller than the scrollview itself. - Optional GUIStyle to use for the horizontal scrollbar. If left out, the horizontalScrollbar style from the current GUISkin is used. - Optional GUIStyle to use for the vertical scrollbar. If left out, the verticalScrollbar style from the current GUISkin is used. - - - - - - - Create a new ScrollViewScope and begin the corresponding ScrollView. - - The position to use display. - Optional parameter to always show the horizontal scrollbar. If false or left out, it is only shown when the content inside the ScrollView is wider than the scrollview itself. - Optional parameter to always show the vertical scrollbar. If false or left out, it is only shown when content inside the ScrollView is taller than the scrollview itself. - Optional GUIStyle to use for the horizontal scrollbar. If left out, the horizontalScrollbar style from the current GUISkin is used. - Optional GUIStyle to use for the vertical scrollbar. If left out, the verticalScrollbar style from the current GUISkin is used. - - - - - - - Create a new ScrollViewScope and begin the corresponding ScrollView. - - The position to use display. - Optional parameter to always show the horizontal scrollbar. If false or left out, it is only shown when the content inside the ScrollView is wider than the scrollview itself. - Optional parameter to always show the vertical scrollbar. If false or left out, it is only shown when content inside the ScrollView is taller than the scrollview itself. - Optional GUIStyle to use for the horizontal scrollbar. If left out, the horizontalScrollbar style from the current GUISkin is used. - Optional GUIStyle to use for the vertical scrollbar. If left out, the verticalScrollbar style from the current GUISkin is used. - - - - - - - Create a new ScrollViewScope and begin the corresponding ScrollView. - - The position to use display. - Optional parameter to always show the horizontal scrollbar. If false or left out, it is only shown when the content inside the ScrollView is wider than the scrollview itself. - Optional parameter to always show the vertical scrollbar. If false or left out, it is only shown when content inside the ScrollView is taller than the scrollview itself. - Optional GUIStyle to use for the horizontal scrollbar. If left out, the horizontalScrollbar style from the current GUISkin is used. - Optional GUIStyle to use for the vertical scrollbar. If left out, the verticalScrollbar style from the current GUISkin is used. - - - - - - - Create a new ScrollViewScope and begin the corresponding ScrollView. - - The position to use display. - Optional parameter to always show the horizontal scrollbar. If false or left out, it is only shown when the content inside the ScrollView is wider than the scrollview itself. - Optional parameter to always show the vertical scrollbar. If false or left out, it is only shown when content inside the ScrollView is taller than the scrollview itself. - Optional GUIStyle to use for the horizontal scrollbar. If left out, the horizontalScrollbar style from the current GUISkin is used. - Optional GUIStyle to use for the vertical scrollbar. If left out, the verticalScrollbar style from the current GUISkin is used. - - - - - - - Make a Selection Grid. - - The index of the selected button. - An array of strings to show on the buttons. - An array of textures on the buttons. - An array of text, image and tooltips for the button. - How many elements to fit in the horizontal direction. The elements will be scaled to fit unless the style defines a fixedWidth to use. The height of the control will be determined from the number of elements. - The style to use. If left out, the button style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - The index of the selected button. - - - - - Make a Selection Grid. - - The index of the selected button. - An array of strings to show on the buttons. - An array of textures on the buttons. - An array of text, image and tooltips for the button. - How many elements to fit in the horizontal direction. The elements will be scaled to fit unless the style defines a fixedWidth to use. The height of the control will be determined from the number of elements. - The style to use. If left out, the button style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - The index of the selected button. - - - - - Make a Selection Grid. - - The index of the selected button. - An array of strings to show on the buttons. - An array of textures on the buttons. - An array of text, image and tooltips for the button. - How many elements to fit in the horizontal direction. The elements will be scaled to fit unless the style defines a fixedWidth to use. The height of the control will be determined from the number of elements. - The style to use. If left out, the button style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - The index of the selected button. - - - - - Make a Selection Grid. - - The index of the selected button. - An array of strings to show on the buttons. - An array of textures on the buttons. - An array of text, image and tooltips for the button. - How many elements to fit in the horizontal direction. The elements will be scaled to fit unless the style defines a fixedWidth to use. The height of the control will be determined from the number of elements. - The style to use. If left out, the button style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - The index of the selected button. - - - - - Make a Selection Grid. - - The index of the selected button. - An array of strings to show on the buttons. - An array of textures on the buttons. - An array of text, image and tooltips for the button. - How many elements to fit in the horizontal direction. The elements will be scaled to fit unless the style defines a fixedWidth to use. The height of the control will be determined from the number of elements. - The style to use. If left out, the button style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - The index of the selected button. - - - - - Make a Selection Grid. - - The index of the selected button. - An array of strings to show on the buttons. - An array of textures on the buttons. - An array of text, image and tooltips for the button. - How many elements to fit in the horizontal direction. The elements will be scaled to fit unless the style defines a fixedWidth to use. The height of the control will be determined from the number of elements. - The style to use. If left out, the button style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - The index of the selected button. - - - - - Insert a space in the current layout group. - - - - - - Make a multi-line text field where the user can edit a string. - - Text to edit. The return value of this function should be assigned back to the string as shown in the example. - The maximum length of the string. If left out, the user can type for ever and ever. - The style to use. If left out, the textField style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.&amp;lt;br&amp;gt; -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - The edited string. - - - - - Make a multi-line text field where the user can edit a string. - - Text to edit. The return value of this function should be assigned back to the string as shown in the example. - The maximum length of the string. If left out, the user can type for ever and ever. - The style to use. If left out, the textField style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.&amp;lt;br&amp;gt; -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - The edited string. - - - - - Make a multi-line text field where the user can edit a string. - - Text to edit. The return value of this function should be assigned back to the string as shown in the example. - The maximum length of the string. If left out, the user can type for ever and ever. - The style to use. If left out, the textField style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.&amp;lt;br&amp;gt; -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - The edited string. - - - - - Make a multi-line text field where the user can edit a string. - - Text to edit. The return value of this function should be assigned back to the string as shown in the example. - The maximum length of the string. If left out, the user can type for ever and ever. - The style to use. If left out, the textField style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.&amp;lt;br&amp;gt; -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - The edited string. - - - - - Make a single-line text field where the user can edit a string. - - Text to edit. The return value of this function should be assigned back to the string as shown in the example. - The maximum length of the string. If left out, the user can type for ever and ever. - The style to use. If left out, the textArea style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - The edited string. - - - - - Make a single-line text field where the user can edit a string. - - Text to edit. The return value of this function should be assigned back to the string as shown in the example. - The maximum length of the string. If left out, the user can type for ever and ever. - The style to use. If left out, the textArea style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - The edited string. - - - - - Make a single-line text field where the user can edit a string. - - Text to edit. The return value of this function should be assigned back to the string as shown in the example. - The maximum length of the string. If left out, the user can type for ever and ever. - The style to use. If left out, the textArea style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - The edited string. - - - - - Make a single-line text field where the user can edit a string. - - Text to edit. The return value of this function should be assigned back to the string as shown in the example. - The maximum length of the string. If left out, the user can type for ever and ever. - The style to use. If left out, the textArea style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - The edited string. - - - - - Make an on/off toggle button. - - Is the button on or off? - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the button style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - The new value of the button. - - - - - Make an on/off toggle button. - - Is the button on or off? - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the button style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - The new value of the button. - - - - - Make an on/off toggle button. - - Is the button on or off? - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the button style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - The new value of the button. - - - - - Make an on/off toggle button. - - Is the button on or off? - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the button style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - The new value of the button. - - - - - Make an on/off toggle button. - - Is the button on or off? - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the button style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - The new value of the button. - - - - - Make an on/off toggle button. - - Is the button on or off? - Text to display on the button. - Texture to display on the button. - Text, image and tooltip for this button. - The style to use. If left out, the button style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - The new value of the button. - - - - - Make a toolbar. - - The index of the selected button. - An array of strings to show on the buttons. - An array of textures on the buttons. - An array of text, image and tooltips for the button. - The style to use. If left out, the button style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - Determines how toolbar button size is calculated. - - The index of the selected button. - - - - - Make a toolbar. - - The index of the selected button. - An array of strings to show on the buttons. - An array of textures on the buttons. - An array of text, image and tooltips for the button. - The style to use. If left out, the button style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - Determines how toolbar button size is calculated. - - The index of the selected button. - - - - - Make a toolbar. - - The index of the selected button. - An array of strings to show on the buttons. - An array of textures on the buttons. - An array of text, image and tooltips for the button. - The style to use. If left out, the button style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - Determines how toolbar button size is calculated. - - The index of the selected button. - - - - - Make a toolbar. - - The index of the selected button. - An array of strings to show on the buttons. - An array of textures on the buttons. - An array of text, image and tooltips for the button. - The style to use. If left out, the button style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - Determines how toolbar button size is calculated. - - The index of the selected button. - - - - - Make a toolbar. - - The index of the selected button. - An array of strings to show on the buttons. - An array of textures on the buttons. - An array of text, image and tooltips for the button. - The style to use. If left out, the button style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - Determines how toolbar button size is calculated. - - The index of the selected button. - - - - - Make a toolbar. - - The index of the selected button. - An array of strings to show on the buttons. - An array of textures on the buttons. - An array of text, image and tooltips for the button. - The style to use. If left out, the button style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - Determines how toolbar button size is calculated. - - The index of the selected button. - - - - - Make a toolbar. - - The index of the selected button. - An array of strings to show on the buttons. - An array of textures on the buttons. - An array of text, image and tooltips for the button. - The style to use. If left out, the button style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - Determines how toolbar button size is calculated. - - The index of the selected button. - - - - - Make a toolbar. - - The index of the selected button. - An array of strings to show on the buttons. - An array of textures on the buttons. - An array of text, image and tooltips for the button. - The style to use. If left out, the button style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - Determines how toolbar button size is calculated. - - The index of the selected button. - - - - - Make a toolbar. - - The index of the selected button. - An array of strings to show on the buttons. - An array of textures on the buttons. - An array of text, image and tooltips for the button. - The style to use. If left out, the button style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - Determines how toolbar button size is calculated. - - The index of the selected button. - - - - - Disposable helper class for managing BeginVertical / EndVertical. - - - - - Create a new VerticalScope and begin the corresponding vertical group. - - Text to display on group. - Texture to display on group. - Text, image, and tooltip for this group. - The style to use for background image and padding values. If left out, the background is transparent. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - - Create a new VerticalScope and begin the corresponding vertical group. - - Text to display on group. - Texture to display on group. - Text, image, and tooltip for this group. - The style to use for background image and padding values. If left out, the background is transparent. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - - Create a new VerticalScope and begin the corresponding vertical group. - - Text to display on group. - Texture to display on group. - Text, image, and tooltip for this group. - The style to use for background image and padding values. If left out, the background is transparent. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - - Create a new VerticalScope and begin the corresponding vertical group. - - Text to display on group. - Texture to display on group. - Text, image, and tooltip for this group. - The style to use for background image and padding values. If left out, the background is transparent. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - - Create a new VerticalScope and begin the corresponding vertical group. - - Text to display on group. - Texture to display on group. - Text, image, and tooltip for this group. - The style to use for background image and padding values. If left out, the background is transparent. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - - - Make a vertical scrollbar. - - The position between min and max. - How much can we see? - The value at the top end of the scrollbar. - The value at the bottom end of the scrollbar. - The style to use for the scrollbar background. If left out, the horizontalScrollbar style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style. - - The modified value. This can be changed by the user by dragging the scrollbar, or clicking the arrows at the end. - - - - - Make a vertical scrollbar. - - The position between min and max. - How much can we see? - The value at the top end of the scrollbar. - The value at the bottom end of the scrollbar. - The style to use for the scrollbar background. If left out, the horizontalScrollbar style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style. - - The modified value. This can be changed by the user by dragging the scrollbar, or clicking the arrows at the end. - - - - - A vertical slider the user can drag to change a value between a min and a max. - - The value the slider shows. This determines the position of the draggable thumb. - The value at the top end of the slider. - The value at the bottom end of the slider. - The GUIStyle to use for displaying the dragging area. If left out, the horizontalSlider style from the current GUISkin is used. - The GUIStyle to use for displaying draggable thumb. If left out, the horizontalSliderThumb style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style. - - - - The value that has been set by the user. - - - - - A vertical slider the user can drag to change a value between a min and a max. - - The value the slider shows. This determines the position of the draggable thumb. - The value at the top end of the slider. - The value at the bottom end of the slider. - The GUIStyle to use for displaying the dragging area. If left out, the horizontalSlider style from the current GUISkin is used. - The GUIStyle to use for displaying draggable thumb. If left out, the horizontalSliderThumb style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style. - - - - The value that has been set by the user. - - - - - Option passed to a control to give it an absolute width. - - - - - - Make a popup window that layouts its contents automatically. - - A unique ID to use for each window. This is the ID you'll use to interface to it. - Rectangle on the screen to use for the window. The layouting system will attempt to fit the window inside it - if that cannot be done, it will adjust the rectangle to fit. - The function that creates the GUI inside the window. This function must take one parameter - the id of the window it's currently making GUI for. - Text to display as a title for the window. - Texture to display an image in the titlebar. - Text, image and tooltip for this window. - An optional style to use for the window. If left out, the window style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style or the screenRect you pass in.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - The rectangle the window is at. This can be in a different position and have a different size than the one you passed in. - - - - - Make a popup window that layouts its contents automatically. - - A unique ID to use for each window. This is the ID you'll use to interface to it. - Rectangle on the screen to use for the window. The layouting system will attempt to fit the window inside it - if that cannot be done, it will adjust the rectangle to fit. - The function that creates the GUI inside the window. This function must take one parameter - the id of the window it's currently making GUI for. - Text to display as a title for the window. - Texture to display an image in the titlebar. - Text, image and tooltip for this window. - An optional style to use for the window. If left out, the window style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style or the screenRect you pass in.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - The rectangle the window is at. This can be in a different position and have a different size than the one you passed in. - - - - - Make a popup window that layouts its contents automatically. - - A unique ID to use for each window. This is the ID you'll use to interface to it. - Rectangle on the screen to use for the window. The layouting system will attempt to fit the window inside it - if that cannot be done, it will adjust the rectangle to fit. - The function that creates the GUI inside the window. This function must take one parameter - the id of the window it's currently making GUI for. - Text to display as a title for the window. - Texture to display an image in the titlebar. - Text, image and tooltip for this window. - An optional style to use for the window. If left out, the window style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style or the screenRect you pass in.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - The rectangle the window is at. This can be in a different position and have a different size than the one you passed in. - - - - - Make a popup window that layouts its contents automatically. - - A unique ID to use for each window. This is the ID you'll use to interface to it. - Rectangle on the screen to use for the window. The layouting system will attempt to fit the window inside it - if that cannot be done, it will adjust the rectangle to fit. - The function that creates the GUI inside the window. This function must take one parameter - the id of the window it's currently making GUI for. - Text to display as a title for the window. - Texture to display an image in the titlebar. - Text, image and tooltip for this window. - An optional style to use for the window. If left out, the window style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style or the screenRect you pass in.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - The rectangle the window is at. This can be in a different position and have a different size than the one you passed in. - - - - - Make a popup window that layouts its contents automatically. - - A unique ID to use for each window. This is the ID you'll use to interface to it. - Rectangle on the screen to use for the window. The layouting system will attempt to fit the window inside it - if that cannot be done, it will adjust the rectangle to fit. - The function that creates the GUI inside the window. This function must take one parameter - the id of the window it's currently making GUI for. - Text to display as a title for the window. - Texture to display an image in the titlebar. - Text, image and tooltip for this window. - An optional style to use for the window. If left out, the window style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style or the screenRect you pass in.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - The rectangle the window is at. This can be in a different position and have a different size than the one you passed in. - - - - - Make a popup window that layouts its contents automatically. - - A unique ID to use for each window. This is the ID you'll use to interface to it. - Rectangle on the screen to use for the window. The layouting system will attempt to fit the window inside it - if that cannot be done, it will adjust the rectangle to fit. - The function that creates the GUI inside the window. This function must take one parameter - the id of the window it's currently making GUI for. - Text to display as a title for the window. - Texture to display an image in the titlebar. - Text, image and tooltip for this window. - An optional style to use for the window. If left out, the window style from the current GUISkin is used. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style or the screenRect you pass in.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - The rectangle the window is at. This can be in a different position and have a different size than the one you passed in. - - - - - Class internally used to pass layout options into GUILayout functions. You don't use these directly, but construct them with the layouting functions in the GUILayout class. - - - - - Utility functions for implementing and extending the GUILayout class. - - - - - Reserve layout space for a rectangle with a specific aspect ratio. - - The aspect ratio of the element (width / height). - An optional style. If specified, the style's padding value will be added to the sizes of the returned rectangle & the style's margin values will be used for spacing. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - The rect for the control. - - - - - Reserve layout space for a rectangle with a specific aspect ratio. - - The aspect ratio of the element (width / height). - An optional style. If specified, the style's padding value will be added to the sizes of the returned rectangle & the style's margin values will be used for spacing. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - The rect for the control. - - - - - Reserve layout space for a rectangle with a specific aspect ratio. - - The aspect ratio of the element (width / height). - An optional style. If specified, the style's padding value will be added to the sizes of the returned rectangle & the style's margin values will be used for spacing. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - The rect for the control. - - - - - Reserve layout space for a rectangle with a specific aspect ratio. - - The aspect ratio of the element (width / height). - An optional style. If specified, the style's padding value will be added to the sizes of the returned rectangle & the style's margin values will be used for spacing. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - The rect for the control. - - - - - Get the rectangle last used by GUILayout for a control. - - - The last used rectangle. - - - - - Reserve layout space for a rectangle for displaying some contents with a specific style. - - The content to make room for displaying. - The GUIStyle to layout for. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - A rectangle that is large enough to contain content when rendered in style. - - - - - Reserve layout space for a rectangle for displaying some contents with a specific style. - - The content to make room for displaying. - The GUIStyle to layout for. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - A rectangle that is large enough to contain content when rendered in style. - - - - - Reserve layout space for a rectangle with a fixed content area. - - The width of the area you want. - The height of the area you want. - An optional GUIStyle to layout for. If specified, the style's padding value will be added to your sizes & its margin value will be used for spacing. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - The rectanlge to put your control in. - - - - - Reserve layout space for a rectangle with a fixed content area. - - The width of the area you want. - The height of the area you want. - An optional GUIStyle to layout for. If specified, the style's padding value will be added to your sizes & its margin value will be used for spacing. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - The rectanlge to put your control in. - - - - - Reserve layout space for a rectangle with a fixed content area. - - The width of the area you want. - The height of the area you want. - An optional GUIStyle to layout for. If specified, the style's padding value will be added to your sizes & its margin value will be used for spacing. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - The rectanlge to put your control in. - - - - - Reserve layout space for a rectangle with a fixed content area. - - The width of the area you want. - The height of the area you want. - An optional GUIStyle to layout for. If specified, the style's padding value will be added to your sizes & its margin value will be used for spacing. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - The rectanlge to put your control in. - - - - - Reserve layout space for a flexible rect. - - The minimum width of the area passed back. - The maximum width of the area passed back. - The minimum width of the area passed back. - The maximum width of the area passed back. - An optional style. If specified, the style's padding value will be added to the sizes requested & the style's margin values will be used for spacing. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - A rectangle with size between minWidth & maxWidth on both axes. - - - - - Reserve layout space for a flexible rect. - - The minimum width of the area passed back. - The maximum width of the area passed back. - The minimum width of the area passed back. - The maximum width of the area passed back. - An optional style. If specified, the style's padding value will be added to the sizes requested & the style's margin values will be used for spacing. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - A rectangle with size between minWidth & maxWidth on both axes. - - - - - Reserve layout space for a flexible rect. - - The minimum width of the area passed back. - The maximum width of the area passed back. - The minimum width of the area passed back. - The maximum width of the area passed back. - An optional style. If specified, the style's padding value will be added to the sizes requested & the style's margin values will be used for spacing. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - A rectangle with size between minWidth & maxWidth on both axes. - - - - - Reserve layout space for a flexible rect. - - The minimum width of the area passed back. - The maximum width of the area passed back. - The minimum width of the area passed back. - The maximum width of the area passed back. - An optional style. If specified, the style's padding value will be added to the sizes requested & the style's margin values will be used for spacing. - An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.<br> -See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, -GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. - - A rectangle with size between minWidth & maxWidth on both axes. - - - - - General settings for how the GUI behaves. - - - - - The color of the cursor in text fields. - - - - - The speed of text field cursor flashes. - - - - - Should double-clicking select words in text fields. - - - - - The color of the selection rect in text fields. - - - - - Should triple-clicking select whole text in text fields. - - - - - Defines how GUI looks and behaves. - - - - - Style used by default for GUI.Box controls. - - - - - Style used by default for GUI.Button controls. - - - - - Array of GUI styles for specific needs. - - - - - The default font to use for all styles. - - - - - Style used by default for the background part of GUI.HorizontalScrollbar controls. - - - - - Style used by default for the left button on GUI.HorizontalScrollbar controls. - - - - - Style used by default for the right button on GUI.HorizontalScrollbar controls. - - - - - Style used by default for the thumb that is dragged in GUI.HorizontalScrollbar controls. - - - - - Style used by default for the background part of GUI.HorizontalSlider controls. - - - - - Style used by default for the thumb that is dragged in GUI.HorizontalSlider controls. - - - - - Style used by default for GUI.Label controls. - - - - - Style used by default for the background of ScrollView controls (see GUI.BeginScrollView). - - - - - Generic settings for how controls should behave with this skin. - - - - - Style used by default for GUI.TextArea controls. - - - - - Style used by default for GUI.TextField controls. - - - - - Style used by default for GUI.Toggle controls. - - - - - Style used by default for the background part of GUI.VerticalScrollbar controls. - - - - - Style used by default for the down button on GUI.VerticalScrollbar controls. - - - - - Style used by default for the thumb that is dragged in GUI.VerticalScrollbar controls. - - - - - Style used by default for the up button on GUI.VerticalScrollbar controls. - - - - - Style used by default for the background part of GUI.VerticalSlider controls. - - - - - Style used by default for the thumb that is dragged in GUI.VerticalSlider controls. - - - - - Style used by default for Window controls (See Also: GUI.Window). - - - - - Try to search for a GUIStyle. This functions returns NULL and does not give an error. - - - - - - Get a named GUIStyle. - - - - - - Styling information for GUI elements. - - - - - Rendering settings for when the control is pressed down. - - - - - Text alignment. - - - - - The borders of all background images. - - - - - What to do when the contents to be rendered is too large to fit within the area given. - - - - - Pixel offset to apply to the content of this GUIstyle. - - - - - If non-0, any GUI elements rendered with this style will have the height specified here. - - - - - If non-0, any GUI elements rendered with this style will have the width specified here. - - - - - Rendering settings for when the element has keyboard focus. - - - - - The font to use for rendering. If null, the default font for the current GUISkin is used instead. - - - - - The font size to use (for dynamic fonts). - - - - - The font style to use (for dynamic fonts). - - - - - Rendering settings for when the mouse is hovering over the control. - - - - - How image and text of the GUIContent is combined. - - - - - The height of one line of text with this style, measured in pixels. (Read Only) - - - - - The margins between elements rendered in this style and any other GUI elements. - - - - - The name of this GUIStyle. Used for getting them based on name. - - - - - Shortcut for an empty GUIStyle. - - - - - Rendering settings for when the component is displayed normally. - - - - - Rendering settings for when the element is turned on and pressed down. - - - - - Rendering settings for when the element has keyboard and is turned on. - - - - - Rendering settings for when the control is turned on and the mouse is hovering it. - - - - - Rendering settings for when the control is turned on. - - - - - Extra space to be added to the background image. - - - - - Space from the edge of GUIStyle to the start of the contents. - - - - - Enable HTML-style tags for Text Formatting Markup. - - - - - Can GUI elements of this style be stretched vertically for better layout? - - - - - Can GUI elements of this style be stretched horizontally for better layouting? - - - - - Should the text be wordwrapped? - - - - - How tall this element will be when rendered with content and a specific width. - - - - - - - Calculate the minimum and maximum widths for this style rendered with content. - - - - - - - - Calculate the size of an element formatted with this style, and a given space to content. - - - - - - Calculate the size of some content if it is rendered with this style. - - - - - - Constructor for empty GUIStyle. - - - - - Constructs GUIStyle identical to given other GUIStyle. - - - - - - Draw this GUIStyle on to the screen, internal version. - - - - - - - - - - Draw the GUIStyle with a text string inside. - - - - - - - - - - - Draw the GUIStyle with an image inside. If the image is too large to fit within the content area of the style it is scaled down. - - - - - - - - - - - Draw the GUIStyle with text and an image inside. If the image is too large to fit within the content area of the style it is scaled down. - - - - - - - - - - - - Draw the GUIStyle with text and an image inside. If the image is too large to fit within the content area of the style it is scaled down. - - - - - - - - - - - - Draw the GUIStyle with text and an image inside. If the image is too large to fit within the content area of the style it is scaled down. - - - - - - - - - - - - Draw this GUIStyle with selected content. - - - - - - - - - Draw this GUIStyle with selected content. - - - - - - - - - - Get the pixel position of a given string index. - - - - - - - - Get the cursor position (indexing into contents.text) when the user clicked at cursorPixelPosition. - - - - - - - - Get a named GUI style from the current skin. - - - - - - Specialized values for the given states used by GUIStyle objects. - - - - - The background image used by GUI elements in this given state. - - - - - Background images used by this state when on a high-resolution screen. It should either be left empty, or contain a single image that is exactly twice the resolution of background. This is only used by the editor. The field is not copied to player data, and is not accessible from player code. - - - - - The text color used by GUI elements in this state. - - - - - Allows to control for which display the OnGUI is called. - - - - - Default constructor initializes the attribute for OnGUI to be called for all available displays. - - Display index. - Display index. - Display index list. - - - - Default constructor initializes the attribute for OnGUI to be called for all available displays. - - Display index. - Display index. - Display index list. - - - - Default constructor initializes the attribute for OnGUI to be called for all available displays. - - Display index. - Display index. - Display index list. - - - - Default constructor initializes the attribute for OnGUI to be called for all available displays. - - Display index. - Display index. - Display index list. - - - - Utility class for making new GUI controls. - - - - - A global property, which is true if a ModalWindow is being displayed, false otherwise. - - - - - The controlID of the current hot control. - - - - - The controlID of the control that has keyboard focus. - - - - - Get access to the system-wide clipboard. - - - - - Align a local space rectangle to the pixel grid. - - The local space rectangle that needs to be processed. - Width, in pixel units, of the axis-aligned bounding box that encompasses the aligned points. - Height, in pixel units, of the axis-aligned bounding box that encompasses the aligned points. - - - The aligned rectangle in local space. - - - - - Align a local space rectangle to the pixel grid. - - The local space rectangle that needs to be processed. - Width, in pixel units, of the axis-aligned bounding box that encompasses the aligned points. - Height, in pixel units, of the axis-aligned bounding box that encompasses the aligned points. - - - The aligned rectangle in local space. - - - - - Puts the GUI in a state that will prevent all subsequent immediate mode GUI functions from evaluating for the remainder of the GUI loop by throwing an ExitGUIException. - - - - - Get a unique ID for a control. - - - - - - - Get a unique ID for a control. - - - - - - - Get a unique ID for a control, using an integer as a hint to help ensure correct matching of IDs to controls. - - - - - - - - - Get a unique ID for a control, using an integer as a hint to help ensure correct matching of IDs to controls. - - - - - - - - - Get a unique ID for a control, using a the label content as a hint to help ensure correct matching of IDs to controls. - - - - - - - - Get a unique ID for a control, using a the label content as a hint to help ensure correct matching of IDs to controls. - - - - - - - - Get a state object from a controlID. - - - - - - - Convert a point from GUI position to screen space. - - - - - - Convert a rect from GUI position to screen space. - - - - - - Get an existing state object from a controlID. - - - - - - - Helper function to rotate the GUI around a point. - - - - - - - Helper function to scale the GUI around a point. - - - - - - - Convert a point from screen space to GUI position. - - - - - - Convert a rect from screen space to GUI position. - - - - - - Interface into the Gyroscope. - - - - - Returns the attitude (ie, orientation in space) of the device. - - - - - Sets or retrieves the enabled status of this gyroscope. - - - - - Returns the gravity acceleration vector expressed in the device's reference frame. - - - - - Returns rotation rate as measured by the device's gyroscope. - - - - - Returns unbiased rotation rate as measured by the device's gyroscope. - - - - - Sets or retrieves gyroscope interval in seconds. - - - - - Returns the acceleration that the user is giving to the device. - - - - - Interface into functionality unique to handheld devices. - - - - - Determines whether or not a 32-bit display buffer will be used. - - - - - Gets the current activity indicator style. - - - - - Plays a full-screen movie. - - Filesystem path to the movie file. - Background color. - How the playback controls are to be displayed. - How the movie is to be scaled to fit the screen. - - - - Plays a full-screen movie. - - Filesystem path to the movie file. - Background color. - How the playback controls are to be displayed. - How the movie is to be scaled to fit the screen. - - - - Plays a full-screen movie. - - Filesystem path to the movie file. - Background color. - How the playback controls are to be displayed. - How the movie is to be scaled to fit the screen. - - - - Plays a full-screen movie. - - Filesystem path to the movie file. - Background color. - How the playback controls are to be displayed. - How the movie is to be scaled to fit the screen. - - - - Sets the desired activity indicator style. - - - - - - Sets the desired activity indicator style. - - - - - - Starts os activity indicator. - - - - - Stops os activity indicator. - - - - - Triggers device vibration. - - - - - Represents a 128-bit hash value. - - - - - Returns true is the hash value is valid. (Read Only) - - - - - Hash new input data and combine with the current hash value. - - Input value. - - - - Hash new input data and combine with the current hash value. - - Input value. - - - - Hash new input data and combine with the current hash value. - - Input value. - - - - Hash new input string and combine with the current hash value. - - Input data string. Note that Unity interprets the string as UTF-8 data, even if internally in C# strings are UTF-16. - - - - Hash new input data array and combine with the current hash value. - - Input data array. - - - - Hash new input data array and combine with the current hash value. - - Input data array. - - - - Hash new input data array and combine with the current hash value. - - Input data array. - - - - Hash a slice of new input data array and combine with the current hash value. - - Input data array. - The first element in the data to start hashing from. - Number of array elements to hash. - - - - Hash a slice of new input data array and combine with the current hash value. - - Input data array. - The first element in the data to start hashing from. - Number of array elements to hash. - - - - Hash a slice of new input data array and combine with the current hash value. - - Input data array. - The first element in the data to start hashing from. - Number of array elements to hash. - - - - Hash new input data and combine with the current hash value. - - Raw data pointer, usually used with C# stackalloc data. - Data size in bytes. - - - - Compute a hash of input data. - - Input value. - - The 128-bit hash. - - - - - Compute a hash of input data. - - Input value. - - The 128-bit hash. - - - - - Compute a hash of input data. - - Input value. - - The 128-bit hash. - - - - - Compute a hash of input data string. - - Input data string. Note that Unity interprets the string as UTF-8 data, even if internally in C# strings are UTF-16. - - The 128-bit hash. - - - - - Compute a hash of input data. - - Input data array. - - The 128-bit hash. - - - - - Compute a hash of input data. - - Input data array. - - The 128-bit hash. - - - - - Compute a hash of input data. - - Input data array. - - The 128-bit hash. - - - - - Compute a hash of a slice of input data. - - Input data array. - The first element in the data to start hashing from. - Number of array elements to hash. - - The 128-bit hash. - - - - - Compute a hash of a slice of input data. - - Input data array. - The first element in the data to start hashing from. - Number of array elements to hash. - - The 128-bit hash. - - - - - Compute a hash of a slice of input data. - - Input data array. - The first element in the data to start hashing from. - Number of array elements to hash. - - The 128-bit hash. - - - - - Compute a hash of input data. - - Raw data pointer, usually used with C# stackalloc data. - Data size in bytes. - - The 128-bit hash. - - - - - Directly initialize a Hash128 with a 128-bit value. - - First 32 bits of hash value. - Second 32 bits of hash value. - Third 32 bits of hash value. - Fourth 32 bits of hash value. - First 64 bits of hash value. - Second 64 bits of hash value. - - - - Directly initialize a Hash128 with a 128-bit value. - - First 32 bits of hash value. - Second 32 bits of hash value. - Third 32 bits of hash value. - Fourth 32 bits of hash value. - First 64 bits of hash value. - Second 64 bits of hash value. - - - - Convert a hex-encoded string into Hash128 value. - - A hexadecimal-encoded hash string. - - The 128-bit hash. - - - - - Convert a Hash128 to string. - - - - - Utilities to compute hashes with unsafe code. - - - - - Compute a 128 bit hash based on a data. - - Pointer to the data to hash. - The number of bytes to hash. - A pointer to store the low 64 bits of the computed hash. - A pointer to store the high 64 bits of the computed hash. - A pointer to the Hash128 to updated with the computed hash. - - - - Compute a 128 bit hash based on a data. - - Pointer to the data to hash. - The number of bytes to hash. - A pointer to store the low 64 bits of the computed hash. - A pointer to store the high 64 bits of the computed hash. - A pointer to the Hash128 to updated with the computed hash. - - - - Utilities to compute hashes. - - - - - Append inHash in outHash. - - Hash to append. - Hash that will be updated. - - - - Compute a 128 bit hash based on a value. the type of the value must be a value type. - - A reference to the value to hash. - A reference to the Hash128 to updated with the computed hash. - - - - Compute a 128 bit hash based on a value. the type of the value must be a value type. - - A reference to the value to hash. - A reference to the Hash128 to updated with the computed hash. - - - - Compute a Hash128 of a Matrix4x4. - - The Matrix4x4 to hash. - The computed hash. - - - - Compute a Hash128 of a Vector3. - - The Vector3 to hash. - The computed hash. - - - - A set of flags that describe the level of HDR display support available on the system. - - - - - Flag used to denote if the system supports automatic tonemapping to HDR displays. - - - - - Flag used to denote that support for HDR displays is not available on the system. - - - - - Flag used to denote that the system can change whether output is performed in HDR or SDR ranges at runtime when connected to an HDR display. - - - - - Flag used to denote that support for HDR displays is available on the system. - - - - - Provides access to HDR display settings and information. - - - - - Describes whether HDR output is currently active on the display. It is true if this is the case, and @@false@ otherwise. - - - - - Describes whether Unity performs HDR tonemapping automatically. - - - - - Describes whether HDR is currently available on your primary display and that you have HDR enabled in your Unity Project. It is true if this is the case, and false otherwise. - - - - - The ColorGamut used to output to the active HDR display. - - - - - The list of currently connected displays with possible HDR availability. - - - - - The RenderTextureFormat of the display buffer for the active HDR display. - - - - - The Experimental.Rendering.GraphicsFormat of the display buffer for the active HDR display. - - - - - The HDROutputSettings for the main display. - - - - - Maximum input luminance at which gradation is preserved even when the entire screen is bright. - - - - - Maximum input luminance at which gradation is preserved when 10% of the screen is bright. - - - - - Minimum input luminance at which gradation is identifiable. - - - - - The base luminance of a white paper surface in nits or candela per square meter (cd/m2). - - - - - Describes whether the user has requested to change the HDR Output Mode. It is true if this is the case, and false otherwise. - - - - - Use this function to request a change in the HDR Output Mode and in the value of HDROutputSettings.active. - - Indicates whether HDR should be enabled. - - - - Sets the base luminance of a white paper surface in nits or candela per square meter (cd/m2). - - The brightness of paper white in nits. - - - - Enumeration of all the muscles in the head. - - - - - The head front-back muscle. - - - - - The head left-right muscle. - - - - - The head roll left-right muscle. - - - - - The jaw down-up muscle. - - - - - The jaw left-right muscle. - - - - - The last value of the HeadDof enum. - - - - - The left eye down-up muscle. - - - - - The left eye in-out muscle. - - - - - The neck front-back muscle. - - - - - The neck left-right muscle. - - - - - The neck roll left-right muscle. - - - - - The right eye down-up muscle. - - - - - The right eye in-out muscle. - - - - - Use this PropertyAttribute to add a header above some fields in the Inspector. - - - - - The header text. - - - - - Add a header above some fields in the Inspector. - - The header text. - - - - Provide a custom documentation URL for a class. - - - - - Initialize the HelpURL attribute with a documentation url. - - The custom documentation URL for this class. - - - - The documentation URL specified for this class. - - - - - Bit mask that controls object destruction, saving and visibility in inspectors. - - - - - The object will not be saved to the Scene. It will not be destroyed when a new Scene is loaded. It is a shortcut for HideFlags.DontSaveInBuild | HideFlags.DontSaveInEditor | HideFlags.DontUnloadUnusedAsset. - - - - - The object will not be saved when building a player. - - - - - The object will not be saved to the Scene in the editor. - - - - - The object will not be unloaded by Resources.UnloadUnusedAssets. - - - - - The GameObject is not shown in the Hierarchy, not saved to to Scenes, and not unloaded by Resources.UnloadUnusedAssets. - - - - - The object will not appear in the hierarchy. - - - - - It is not possible to view it in the inspector. - - - - - A normal, visible object. This is the default. - - - - - The object will not be editable in the inspector. - - - - - Makes a variable not show up in the inspector but be serialized. - - - - - The HingeJoint groups together 2 rigid bodies, constraining them to move like connected by a hinge. - - - - - The current angle in degrees of the joint relative to its rest position. (Read Only) - - - - - Limit of angular rotation (in degrees) on the hinge joint. - - - - - The motor will apply a force up to a maximum force to achieve the target velocity in degrees per second. - - - - - The spring attempts to reach a target angle by adding spring and damping forces. - - - - - Enables the joint's limits. Disabled by default. - - - - - Enables the joint's motor. Disabled by default. - - - - - Enables the joint's spring. Disabled by default. - - - - - The angular velocity of the joint in degrees per second. (Read Only) - - - - - Joint that allows a Rigidbody2D object to rotate around a point in space or a point on another object. - - - - - The current joint angle (in degrees) with respect to the reference angle. - - - - - The current joint speed. - - - - - Limit of angular rotation (in degrees) on the joint. - - - - - Gets the state of the joint limit. - - - - - Parameters for the motor force applied to the joint. - - - - - The angle (in degrees) referenced between the two bodies used as the constraint for the joint. - - - - - Should limits be placed on the range of rotation? - - - - - Should the joint be rotated automatically by a motor torque? - - - - - Gets the motor torque of the joint given the specified timestep. - - The time to calculate the motor torque for. - - - - Wrapping modes for text that reaches the horizontal boundary. - - - - - Text can exceed the horizontal boundary. - - - - - Text will word-wrap when reaching the horizontal boundary. - - - - - This is the data structure for holding individual host information. - - - - - A miscellaneous comment (can hold data). - - - - - Currently connected players. - - - - - The name of the game (like John Doe's Game). - - - - - The type of the game (like "MyUniqueGameType"). - - - - - The GUID of the host, needed when connecting with NAT punchthrough. - - - - - Server IP address. - - - - - Does the server require a password? - - - - - Maximum players limit. - - - - - Server port. - - - - - Does this server require NAT punchthrough? - - - - - Human Body Bones. - - - - - This is the Chest bone. - - - - - This is the Head bone. - - - - - This is the Hips bone. - - - - - This is the Jaw bone. - - - - - This is the Last bone index delimiter. - - - - - This is the Left Eye bone. - - - - - This is the Left Ankle bone. - - - - - This is the Left Wrist bone. - - - - - This is the left index 3rd phalange. - - - - - This is the left index 2nd phalange. - - - - - This is the left index 1st phalange. - - - - - This is the left little 3rd phalange. - - - - - This is the left little 2nd phalange. - - - - - This is the left little 1st phalange. - - - - - This is the Left Elbow bone. - - - - - This is the Left Knee bone. - - - - - This is the left middle 3rd phalange. - - - - - This is the left middle 2nd phalange. - - - - - This is the left middle 1st phalange. - - - - - This is the left ring 3rd phalange. - - - - - This is the left ring 2nd phalange. - - - - - This is the left ring 1st phalange. - - - - - This is the Left Shoulder bone. - - - - - This is the left thumb 3rd phalange. - - - - - This is the left thumb 2nd phalange. - - - - - This is the left thumb 1st phalange. - - - - - This is the Left Toes bone. - - - - - This is the Left Upper Arm bone. - - - - - This is the Left Upper Leg bone. - - - - - This is the Neck bone. - - - - - This is the Right Eye bone. - - - - - This is the Right Ankle bone. - - - - - This is the Right Wrist bone. - - - - - This is the right index 3rd phalange. - - - - - This is the right index 2nd phalange. - - - - - This is the right index 1st phalange. - - - - - This is the right little 3rd phalange. - - - - - This is the right little 2nd phalange. - - - - - This is the right little 1st phalange. - - - - - This is the Right Elbow bone. - - - - - This is the Right Knee bone. - - - - - This is the right middle 3rd phalange. - - - - - This is the right middle 2nd phalange. - - - - - This is the right middle 1st phalange. - - - - - This is the right ring 3rd phalange. - - - - - This is the right ring 2nd phalange. - - - - - This is the right ring 1st phalange. - - - - - This is the Right Shoulder bone. - - - - - This is the right thumb 3rd phalange. - - - - - This is the right thumb 2nd phalange. - - - - - This is the right thumb 1st phalange. - - - - - This is the Right Toes bone. - - - - - This is the Right Upper Arm bone. - - - - - This is the Right Upper Leg bone. - - - - - This is the first Spine bone. - - - - - This is the Upper Chest bone. - - - - - The mapping between a bone in the model and the conceptual bone in the Mecanim human anatomy. - - - - - The name of the bone to which the Mecanim human bone is mapped. - - - - - The name of the Mecanim human bone to which the bone from the model is mapped. - - - - - The rotation limits that define the muscle for this bone. - - - - - Class that holds humanoid avatar parameters to pass to the AvatarBuilder.BuildHumanAvatar function. - - - - - Amount by which the arm's length is allowed to stretch when using IK. - - - - - Modification to the minimum distance between the feet of a humanoid model. - - - - - True for any human that has a translation Degree of Freedom (DoF). It is set to false by default. - - - - - Mapping between Mecanim bone names and bone names in the rig. - - - - - Amount by which the leg's length is allowed to stretch when using IK. - - - - - Defines how the lower arm's roll/twisting is distributed between the elbow and wrist joints. - - - - - Defines how the lower leg's roll/twisting is distributed between the knee and ankle. - - - - - List of bone Transforms to include in the model. - - - - - Defines how the upper arm's roll/twisting is distributed between the shoulder and elbow joints. - - - - - Defines how the upper leg's roll/twisting is distributed between the thigh and knee joints. - - - - - This class stores the rotation limits that define the muscle for a single human bone. - - - - - Length of the bone to which the limit is applied. - - - - - The default orientation of a bone when no muscle action is applied. - - - - - The maximum rotation away from the initial value that this muscle can apply. - - - - - The maximum negative rotation away from the initial value that this muscle can apply. - - - - - Should this limit use the default values? - - - - - Enumeration of all the parts in a human. - - - - - The human body part. - - - - - The human head part. - - - - - The human left arm part. - - - - - The human left index finger part. - - - - - The human left leg part. - - - - - The human left little finger part. - - - - - The human left middle finger part. - - - - - The human left ring finger part. - - - - - The human left thumb finger part. - - - - - The human right arm part. - - - - - The human right index finger part. - - - - - The human right leg part. - - - - - The human right little finger part. - - - - - The human right middle finger part. - - - - - The human right ring finger part. - - - - - The human right thumb finger part. - - - - - Retargetable humanoid pose. - - - - - The human body position for that pose. - - - - - The human body orientation for that pose. - - - - - The array of muscle values for that pose. - - - - - Use this class to create, read, and write the HumanPose for a humanoid avatar skeleton hierarchy or an avatar pose. - - - - - Creates a human pose handler from an avatar and a root transform and either a list of joint paths. - - The avatar from which HumanPose will be read or written. The avatar must be a humanoid. - The top most parent of the skeleton hierarchy defined in the humanoid avatar. This must match the avatar definition. - A list that defines the avatar joint paths. Each joint path starts from the node after the root transform and continues down the avatar skeleton hierarchy. The root transform joint path is an empty string. - - - - Creates a human pose handler from an avatar and a root transform and either a list of joint paths. - - The avatar from which HumanPose will be read or written. The avatar must be a humanoid. - The top most parent of the skeleton hierarchy defined in the humanoid avatar. This must match the avatar definition. - A list that defines the avatar joint paths. Each joint path starts from the node after the root transform and continues down the avatar skeleton hierarchy. The root transform joint path is an empty string. - - - - Computes a human pose from the avatar skeleton, stores the pose in the human pose handler, and returns the human pose. - - The output human pose. In the human pose, the bodyPosition and bodyRotation are the position and rotation of the approximate center of mass of the humanoid in world space. bodyPosition is normalized: the position is divided by avatar human scale. - - - - Gets the internal human pose stored in the human pose handler and converts it to an avatar pose. - - The output avatar pose. The avatar pose is expressed as an array of floats. The floats represent the translation and rotation of the joints as local transforms. -Each joint local transform is represented by 3 floats for the translation and 4 floats for the rotation (expressed as a quaternion). The joint transform is stored in the array in the same order as the joint paths in the jointPaths parameter used to construct the human pose handler. For example, if the human pose handler was constructed with 20 joint paths, the avatarPose parameter should be an array of 140 floats. - - - - Gets the internal human pose stored in the human pose handler. - - The output human pose. In the human pose, the bodyPosition and bodyRotation are the position and rotation of the approximate center of mass of the humanoid in world space. bodyPosition is normalized: the position is divided by avatar human scale. - - - - Stores the specified human pose inside the human pose handler. - - The human pose to set. In the human pose, the bodyPosition and bodyRotation are the position and rotation of the approximate center of mass of the humanoid. This is relative to the humanoid root transform and it is normalized: the local position is divided by avatar human scale. - - - - Converts an avatar pose to a human pose and stores it as the internal human pose inside the human pose handler. - - The input avatar pose. The avatar pose is expressed as an array of floats. The floats represent the translation and rotation of the joints as local transforms. -Each joint local transform is represented by 3 floats for the translation and 4 floats for the rotation (expressed as a quaternion). The joint transform is stored in the array in the same order as the joint paths in the jointPaths parameter used to construct the human pose handler. For example, if the human pose handler was constructed with 20 joint paths, the avatarPose parameter should be an array of 140 floats. - - - - Stores the specified human pose as the internal human pose inside the human pose handler. - - The human pose to set. In the human pose, the bodyPosition and bodyRotation are the position and rotation of the approximate center of mass of the humanoid. This is relative to the humanoid root transform and it is normalized: the local position is divided by avatar human scale. - - - - Details of all the human bone and muscle types defined by Mecanim. - - - - - The number of human bone types defined by Mecanim. - - - - - Return the bone to which a particular muscle is connected. - - Muscle index. - - - - Array of the names of all human bone types defined by Mecanim. - - - - - Gets the bone hierarchy mass. - - The humanoid bone index. - - The bone hierarchy mass. - - - - - Get the default maximum value of rotation for a muscle in degrees. - - Muscle index. - - - - Get the default minimum value of rotation for a muscle in degrees. - - Muscle index. - - - - Returns parent humanoid bone index of a bone. - - Humanoid bone index to get parent from. - - Humanoid bone index of parent. - - - - - The number of human muscle types defined by Mecanim. - - - - - Obtain the muscle index for a particular bone index and "degree of freedom". - - Bone index. - Number representing a "degree of freedom": 0 for X-Axis, 1 for Y-Axis, 2 for Z-Axis. - - - - Array of the names of all human muscle types defined by Mecanim. - - - - - Is the bone a member of the minimal set of bones that Mecanim requires for a human model? - - Index of the bone to test. - - - - The number of bone types that are required by Mecanim for any human model. - - - - - Use this interface to have a class provide its own list of Animation Clips to the Animation Window. The class must inherit from MonoBehaviour. - - - - - Returns a list of Animation Clips. - - - - - - This element can filter raycasts. If the top level element is hit it can further 'check' if the location is valid. - - - - - Given a point and a camera is the raycast valid. - - Screen position. - Raycast camera. - - Valid. - - - - - Interface for objects used as resolvers on ExposedReferences. - - - - - Remove a value for the given reference. - - Identifier of the ExposedReference. - - - - Retrieves a value for the given identifier. - - Identifier of the ExposedReference. - Is the identifier valid? - - The value stored in the table. - - - - - Assigns a value for an ExposedReference. - - Identifier of the ExposedReference. - The value to assigned to the ExposedReference. - - - - Interface for custom logger implementation. - - - - - To selective enable debug log message. - - - - - To runtime toggle debug logging [ON/OFF]. - - - - - Set Logger.ILogHandler. - - - - - Check logging is enabled based on the LogType. - - - - Retrun true in case logs of LogType will be logged otherwise returns false. - - - - - Logs message to the Unity Console using default logger. - - - - - - - - - Logs message to the Unity Console using default logger. - - - - - - - - - Logs message to the Unity Console using default logger. - - - - - - - - - Logs message to the Unity Console using default logger. - - - - - - - - - Logs message to the Unity Console using default logger. - - - - - - - - - Logs message to the Unity Console using default logger. - - - - - - - - - Logs message to the Unity Console using default logger. - - - - - - - - - A variant of ILogger.Log that logs an error message. - - - - - - - - A variant of ILogger.Log that logs an error message. - - - - - - - - A variant of ILogger.Log that logs an exception message. - - - - - - Logs a formatted message. - - - - - - - - A variant of Logger.Log that logs an warning message. - - - - - - - - A variant of Logger.Log that logs an warning message. - - - - - - - - Interface for custom log handler implementation. - - - - - A variant of ILogHandler.LogFormat that logs an exception message. - - Runtime Exception. - Object to which the message applies. - - - - Logs a formatted message. - - The type of the log message. - Object to which the message applies. - A composite format string. - Format arguments. - - - - This class provides utility and extension methods to convert image data from or to PNG, EXR, TGA, and JPEG formats. - - - - - Enables legacy PNG runtime import behavior. - - - - - Encodes this array into the EXR format. - - The byte array to convert. - The pixel format of the image data. - The width of the image data in pixels. - The height of the image data in pixels. - The length of a single row in bytes. - Flags used to control compression and the output format. - - - - Encodes this array into JPG format. - - The byte array to convert. - The pixel format of the image data. - The width of the image data in pixels. - The height of the image data in pixels. - The length of a single row in bytes. - JPG quality to encode with, 1..100 (default 75). - - - - Encodes this array into PNG format. - - The byte array to convert. - The pixel format of the image data. - The width of the image data in pixels. - The height of the image data in pixels. - The length of a single row in bytes. - - - - Encodes this array into TGA format. - - The byte array to convert. - The pixel format of the image data. - The width of the image data in pixels. - The height of the image data in pixels. - The length of a single row in bytes. - - - - Encodes this native array into the EXR format. - - The native array to convert. - The pixel format of the image data. - The width of the image data in pixels. - The height of the image data in pixels. - The length of a single row in bytes. - Flags used to control compression and the output format. - - - - - Encodes this native array into JPG format. - - The native array to convert. - The pixel format of the image data. - The width of the image data in pixels. - The height of the image data in pixels. - The length of a single row in bytes. - JPG quality to encode with, 1..100 (default 75). - - - - - Encodes this native array into PNG format. - - The native array to convert. - The pixel format of the image data. - The width of the image data in pixels. - The height of the image data in pixels. - The length of a single row in bytes. - - - - - Encodes this native array into TGA format. - - The native array to convert. - The pixel format of the image data. - The width of the image data in pixels. - The height of the image data in pixels. - The length of a single row in bytes. - - - - - Encodes this texture into the EXR format. - - The texture to convert. - Flags used to control compression and the output format. - - - - Encodes this texture into JPG format. - - Text texture to convert. - JPG quality to encode with, 1..100 (default 75). - - - - Encodes this texture into JPG format. - - Text texture to convert. - JPG quality to encode with, 1..100 (default 75). - - - - Encodes this texture into PNG format. - - The texture to convert. - - - - Encodes the specified texture in TGA format. - - The texture to encode. - - - - Loads PNG/JPG (or supported format) image byte array into a texture. - - The byte array containing the image data to load. - Set to false by default, pass true to optionally mark the texture as non-readable. - The texture to load the image into. - - Returns true if the data can be loaded, false otherwise. - - - - - Any Image Effect with this attribute will be rendered after Dynamic Resolution stage. - - - - - Any Image Effect with this attribute can be rendered into the Scene view camera. - - - - - Any Image Effect with this attribute will be rendered after opaque geometry but before transparent geometry. - - - - - When using HDR rendering it can sometime be desirable to switch to LDR rendering during ImageEffect rendering. - - - - - Use this attribute when image effects are implemented using Command Buffers. - - - - - How image and text is placed inside GUIStyle. - - - - - Image is above the text. - - - - - Image is to the left of the text. - - - - - Only the image is displayed. - - - - - Only the text is displayed. - - - - - Controls IME input. - - - - - Enable IME input only when a text field is selected (default). - - - - - Disable IME input. - - - - - Enable IME input. - - - - - Interface into the Input system. - - - - - Last measured linear acceleration of a device in three-dimensional space. (Read Only) - - - - - Number of acceleration measurements which occurred during last frame. - - - - - Returns list of acceleration measurements which occurred during the last frame. (Read Only) (Allocates temporary variables). - - - - - Is any key or mouse button currently held down? (Read Only) - - - - - Returns true the first frame the user hits any key or mouse button. (Read Only) - - - - - Should Back button quit the application? - -Only usable on Android, Windows Phone or Windows Tablets. - - - - - Property for accessing compass (handheld devices only). (Read Only) - - - - - This property controls if input sensors should be compensated for screen orientation. - - - - - The current text input position used by IMEs to open windows. - - - - - The current IME composition string being typed by the user. - - - - - Device physical orientation as reported by OS. (Read Only) - - - - - Property indicating whether keypresses are eaten by a textinput if it has focus (default true). - - - - - Returns default gyroscope. - - - - - Controls enabling and disabling of IME input composition. - - - - - Does the user have an IME keyboard input source selected? - - - - - Returns the keyboard input entered this frame. (Read Only) - - - - - Property for accessing device location (handheld devices only). (Read Only) - - - - - The current mouse position in pixel coordinates. (Read Only). - - - - - Indicates if a mouse device is detected. - - - - - The current mouse scroll delta. (Read Only) - - - - - Property indicating whether the system handles multiple touches. - - - - - Enables/Disables mouse simulation with touches. By default this option is enabled. - - - - - Returns true when Stylus Touch is supported by a device or platform. - - - - - Number of touches. Guaranteed not to change throughout the frame. (Read Only) - - - - - Returns list of objects representing status of all touches during last frame. (Read Only) (Allocates temporary variables). - - - - - Bool value which let's users check if touch pressure is supported. - - - - - Returns whether the device on which application is currently running supports touch input. - - - - - Returns specific acceleration measurement which occurred during last frame. (Does not allocate temporary variables). - - - - - - Returns the value of the virtual axis identified by axisName. - - - - - - Returns the value of the virtual axis identified by axisName with no smoothing filtering applied. - - - - - - Returns true while the virtual button identified by buttonName is held down. - - The name of the button such as Jump. - - True when an axis has been pressed and not released. - - - - - Returns true during the frame the user pressed down the virtual button identified by buttonName. - - - - - - Returns true the first frame the user releases the virtual button identified by buttonName. - - - - - - Retrieves a list of input device names corresponding to the index of an Axis configured within Input Manager. - - - Returns an array of joystick and gamepad device names. - - - - - Returns true while the user holds down the key identified by name. - - - - - - Returns true while the user holds down the key identified by the key KeyCode enum parameter. - - - - - - Returns true during the frame the user starts pressing down the key identified by name. - - - - - - Returns true during the frame the user starts pressing down the key identified by the key KeyCode enum parameter. - - - - - - Returns true during the frame the user releases the key identified by name. - - - - - - Returns true during the frame the user releases the key identified by the key KeyCode enum parameter. - - - - - - Returns whether the given mouse button is held down. - - - - - - Returns true during the frame the user pressed the given mouse button. - - - - - - Returns true during the frame the user releases the given mouse button. - - - - - - Call Input.GetTouch to obtain a Touch struct. - - The touch input on the device screen. - - Touch details in the struct. - - - - - Determine whether a particular joystick model has been preconfigured by Unity. (Linux-only). - - The name of the joystick to check (returned by Input.GetJoystickNames). - - True if the joystick layout has been preconfigured; false otherwise. - - - - - Resets all input. After ResetInputAxes all axes return to 0 and all buttons return to 0 for one frame. - - - - - Use this attribute on enum value declarations to change the display name shown in the Inspector. - - - - - Name to display in the Inspector. - - - - - Specify a display name for an enum value. - - The name to display. - - - - An IntegratedSubsystem is initialized from an IntegratedSubsystemDescriptor for a given Subsystem (Example, Input, Environment, Display, etc.) and provides an interface to interact with that given IntegratedSubsystem until it is Destroyed. After an IntegratedSubsystem is created it can be Started or Stopped to turn on and off functionality (and preserve performance). The base type for IntegratedSubsystem only exposes this functionality; this class is designed to be a base class for derived classes that expose more functionality specific to a given IntegratedSubsystem. - - Note: initializing a second IntegratedSubsystem from the same IntegratedSubsystemDescriptor will return a reference to the existing IntegratedSubsystem as only one IntegratedSubsystem is currently allowed for a single IntegratedSubsystem provider. - - - - - - Whether or not the subsystem is running. - - - - - Destroys this instance of a subsystem. - - - - - Starts an instance of a subsystem. - - - - - Stops an instance of a subsystem. - - - - - Information about a subsystem that can be queried before creating a subsystem instance. - - - - - A unique string that identifies the subsystem that this Descriptor can create. - - - - - ActivityIndicator Style (iOS Specific). - - - - - Do not show ActivityIndicator. - - - - - The standard gray style of indicator (UIActivityIndicatorViewStyleGray). - - - - - The standard white style of indicator (UIActivityIndicatorViewStyleWhite). - - - - - The large white style of indicator (UIActivityIndicatorViewStyleWhiteLarge). - - - - - ADBannerView is a wrapper around the ADBannerView class found in the Apple iAd framework and is only available on iOS. - - - - - Banner layout. - - - - - Checks if banner contents are loaded. - - - - - The position of the banner view. - - - - - The size of the banner view. - - - - - Banner visibility. Initially banner is not visible. - - - - - Will be fired when banner ad failed to load. - - - - - Will be fired when banner was clicked. - - - - - Will be fired when banner loaded new ad. - - - - - Creates a banner view with given type and auto-layout params. - - - - - - - Checks if the banner type is available (e.g. MediumRect is available only starting with ios6). - - - - - - Specifies how banner should be layed out on screen. - - - - - Traditional Banner: align to screen bottom. - - - - - Rect Banner: align to screen bottom, placing at the center. - - - - - Rect Banner: place in bottom-left corner. - - - - - Rect Banner: place in bottom-right corner. - - - - - Rect Banner: place exactly at screen center. - - - - - Rect Banner: align to screen left, placing at the center. - - - - - Rect Banner: align to screen right, placing at the center. - - - - - Completely manual positioning. - - - - - Traditional Banner: align to screen top. - - - - - Rect Banner: align to screen top, placing at the center. - - - - - Rect Banner: place in top-left corner. - - - - - Rect Banner: place in top-right corner. - - - - - The type of the banner view. - - - - - Traditional Banner (it takes full screen width). - - - - - Rect Banner (300x250). - - - - - ADInterstitialAd is a wrapper around the ADInterstitialAd class found in the Apple iAd framework and is only available on iPad. - - - - - Checks if InterstitialAd is available (it is available on iPad since iOS 4.3, and on iPhone since iOS 7.0). - - - - - Has the interstitial ad object downloaded an advertisement? (Read Only) - - - - - Creates an interstitial ad. - - - - - - Creates an interstitial ad. - - - - - - Will be called when ad is ready to be shown. - - - - - Will be called when user viewed ad contents: i.e. they went past the initial screen. Please note that it is impossible to determine if they clicked on any links in ad sequences that follows the initial screen. - - - - - Reload advertisement. - - - - - Shows full-screen advertisement to user. - - - - - Specify calendar types. - - - - - Identifies the Buddhist calendar. - - - - - Identifies the Chinese calendar. - - - - - Identifies the Gregorian calendar. - - - - - Identifies the Hebrew calendar. - - - - - Identifies the Indian calendar. - - - - - Identifies the Islamic calendar. - - - - - Identifies the Islamic civil calendar. - - - - - Identifies the ISO8601. - - - - - Identifies the Japanese calendar. - - - - - Identifies the Persian calendar. - - - - - Identifies the Republic of China (Taiwan) calendar. - - - - - Specify calendrical units. - - - - - Specifies the day unit. - - - - - Specifies the era unit. - - - - - Specifies the hour unit. - - - - - Specifies the minute unit. - - - - - Specifies the month unit. - - - - - Specifies the quarter of the calendar. - - - - - Specifies the second unit. - - - - - Specifies the week unit. - - - - - Specifies the weekday unit. - - - - - Specifies the ordinal weekday unit. - - - - - Specifies the year unit. - - - - - Interface into iOS specific functionality. - - - - - Advertising ID. - - - - - Is advertising tracking enabled. - - - - - Defer system gestures until the second swipe on specific edges. - - - - - The generation of the device. (Read Only) - - - - - Specifies whether the home button should be hidden in the iOS build of this application. - - - - - Indicates whether Low Power Mode is enabled on the device. - - - - - iOS version. - - - - - Vendor ID. - - - - - Indicates whether the screen may be dimmed lower than the hardware is normally capable of by emulating it in software. - - - - - Request App Store rating and review from the user. - - - Value indicating whether the underlying API is available or not. False indicates that the iOS version isn't recent enough or that the StoreKit framework is not linked with the app. - - - - - Reset "no backup" file flag: file will be synced with iCloud/iTunes backup and can be deleted by OS in low storage situations. - - - - - - Set file flag to be excluded from iCloud/iTunes backup. - - - - - - iOS device generation. - - - - - iPad, first generation. - - - - - iPad, second generation. - - - - - iPad, third generation. - - - - - iPad, fourth generation. - - - - - iPad, fifth generation. - - - - - iPad, sixth generation. - - - - - iPad, seventh generation. - - - - - iPad, eighth generation. - - - - - iPad Air. - - - - - iPad Air 2. - - - - - iPad Air, third generation. - - - - - iPad Air, fourth generation. - - - - - iPad Mini, first generation. - - - - - iPad Mini, second generation. - - - - - iPad Mini, third generation. - - - - - iPad Mini, fourth generation. - - - - - iPad Mini, fifth generation. - - - - - iPad Pro 9.7", first generation. - - - - - iPad Pro 10.5", second generation 10" iPad. - - - - - iPad Pro 11", first generation. - - - - - iPad Pro 11", second generation. - - - - - iPad Pro 12.9", first generation. - - - - - iPad Pro 12.9", second generation. - - - - - iPad Pro 12.9", third generation. - - - - - iPad Pro 12.9", fourth generation. - - - - - Yet unknown iPad. - - - - - iPhone, first generation. - - - - - iPhone 11. - - - - - iPhone 11 Pro. - - - - - iPhone 11 Pro Max. - - - - - iPhone 12. - - - - - iPhone 12 Mini. - - - - - iPhone 12 Pro. - - - - - iPhone 12 Pro Max. - - - - - iPhone, second generation. - - - - - iPhone, third generation. - - - - - iPhone, fourth generation. - - - - - iPhone, fifth generation. - - - - - iPhone5. - - - - - iPhone 5C. - - - - - iPhone 5S. - - - - - iPhone 6. - - - - - iPhone 6 plus. - - - - - iPhone 6S. - - - - - iPhone 6S Plus. - - - - - iPhone 7. - - - - - iPhone 7 Plus. - - - - - iPhone 8. - - - - - iPhone 8 Plus. - - - - - iPhone SE, first generation. - - - - - iPhone SE, second generation. - - - - - Yet unknown iPhone. - - - - - iPhone X. - - - - - iPhone XR. - - - - - iPhone XS. - - - - - iPhone XSMax. - - - - - iPod Touch, first generation. - - - - - iPod Touch, second generation. - - - - - iPod Touch, third generation. - - - - - iPod Touch, fourth generation. - - - - - iPod Touch, fifth generation. - - - - - iPod Touch, sixth generation. - - - - - iPod Touch, seventh generation. - - - - - Yet unknown iPod Touch. - - - - - iOS.LocalNotification is a wrapper around the UILocalNotification class found in the Apple UIKit framework and is only available on iPhoneiPadiPod Touch. - - - - - The title of the action button or slider. - - - - - The message displayed in the notification alert. - - - - - Identifies the image used as the launch image when the user taps the action button. - - - - - A short description of the reason for the alert. - - - - - The number to display as the application's icon badge. - - - - - The default system sound. (Read Only) - - - - - The date and time when the system should deliver the notification. - - - - - A boolean value that controls whether the alert action is visible or not. - - - - - The calendar type (Gregorian, Chinese, etc) to use for rescheduling the notification. - - - - - The calendar interval at which to reschedule the notification. - - - - - The name of the sound file to play when an alert is displayed. - - - - - The time zone of the notification's fire date. - - - - - A dictionary for passing custom information to the notified application. - - - - - Creates a new local notification. - - - - - NotificationServices is only available on iPhoneiPadiPod Touch. - - - - - Device token received from Apple Push Service after calling NotificationServices.RegisterForRemoteNotificationTypes. (Read Only) - - - - - Enabled local and remote notification types. - - - - - The number of received local notifications. (Read Only) - - - - - The list of objects representing received local notifications. (Read Only) - - - - - Returns an error that might occur on registration for remote notifications via NotificationServices.RegisterForRemoteNotificationTypes. (Read Only) - - - - - The number of received remote notifications. (Read Only) - - - - - The list of objects representing received remote notifications. (Read Only) - - - - - All currently scheduled local notifications. - - - - - Cancels the delivery of all scheduled local notifications. - - - - - Cancels the delivery of the specified scheduled local notification. - - - - - - Discards of all received local notifications. - - - - - Discards of all received remote notifications. - - - - - Returns an object representing a specific local notification. (Read Only) - - - - - - Returns an object representing a specific remote notification. (Read Only) - - - - - - Presents a local notification immediately. - - - - - - Register to receive local and remote notifications of the specified types from a provider via Apple Push Service. - - Notification types to register for. - Specify true to also register for remote notifications. - - - - Register to receive local and remote notifications of the specified types from a provider via Apple Push Service. - - Notification types to register for. - Specify true to also register for remote notifications. - - - - Schedules a local notification. - - - - - - Unregister for remote notifications. - - - - - Specifies local and remote notification types. - - - - - Notification is an alert message. - - - - - Notification is a badge shown above the application's icon. - - - - - No notification types specified. - - - - - Notification is an alert sound. - - - - - On Demand Resources API. - - - - - Indicates whether player was built with "Use On Demand Resources" player setting enabled. - - - - - Creates an On Demand Resources (ODR) request. - - Tags for On Demand Resources that should be included in the request. - - Object representing ODR request. - - - - - Represents a request for On Demand Resources (ODR). It's an AsyncOperation and can be yielded in a coroutine. - - - - - Returns an error after operation is complete. - - - - - Sets the priority for request. - - - - - Release all resources kept alive by On Demand Resources (ODR) request. - - - - - Gets file system's path to the resource available in On Demand Resources (ODR) request. - - Resource name. - - - - RemoteNotification is only available on iPhoneiPadiPod Touch. - - - - - The message displayed in the notification alert. (Read Only) - - - - - A short description of the reason for the alert. (Read Only) - - - - - The number to display as the application's icon badge. (Read Only) - - - - - A boolean value that controls whether the alert action is visible or not. (Read Only) - - - - - The name of the sound file to play when an alert is displayed. (Read Only) - - - - - A dictionary for passing custom information to the notified application. (Read Only) - - - - - Bit-mask used to control the deferring of system gestures on iOS. - - - - - Identifies all screen edges. - - - - - Identifies bottom screen edge. - - - - - Identifies left screen edge. - - - - - Disables gesture deferring on all edges. - - - - - Identifies right screen edge. - - - - - Identifies top screen edge. - - - - - Interface to receive callbacks upon serialization and deserialization. - - - - - Implement this method to receive a callback after Unity deserializes your object. - - - - - Implement this method to receive a callback before Unity serializes your object. - - - - - Interface implemented by both Subsystem and IntegratedSubsystem which provides control over the state of either. - - - - - - Will be true if asking the subsytem to start was successful. False in the case that the subsystem has stopped, was asked to stop or has not been started yet. - - - - - Destroys this instance of a subsystem. - - - - - Starts an instance of a subsystem. - - - - - Stops an instance of a subsystem. - - - - - A subsystem descriptor is metadata about a subsystem which can be inspected before loading / initializing a subsystem. - - - - - - A unique string that identifies the subsystem that this Descriptor can create. - - - - - Creates an ISubsystem from this descriptor. - - - An instance of ISubsystem. - - - - - IJobParallelForTransform. - - - - - Execute. - - Index. - TransformAccessArray. - - - - Extension methods for IJobParallelForTransform. - - - - - Run an IJobParallelForTransform job with read-only access to the transform data. This method makes the job run on the calling thread instead of spreading it out over multiple threads. - - The TransformAccessArray to run this job on. - The job to run. - - - - Schedule an IJobParallelForTransform job with read-write access to the transform data. This method parallelizes access to transforms in different hierarchies. Transforms with a shared root object are always processed on the same thread. - - The job to schedule. - The TransformAccessArray to run this job on. - A JobHandle containing any jobs that must finish executing before this job begins. (Combine multiple jobs with JobHandle.CombineDependencies). Use dependencies to ensure that two jobs reading or writing to the same data do not run in parallel. - - The handle identifying the scheduled job. Can be used as a dependency for a later job or ensure completion on the main thread. - - - - - Schedule an IJobParallelForTransform job with read-only access to the transform data. This method provides better parallelization because it can read all transforms in parallel instead of just parallelizing over different hierarchies. - - The job to schedule. - The TransformAccessArray to run this job on. - Granularity in which workstealing is performed. A value of 32 means the job queue will steal 32 iterations and then perform them in an efficient inner loop. - A JobHandle containing any jobs that must finish executing before this job begins. (Combine multiple jobs with JobHandle.CombineDependencies). Use dependencies to ensure that two jobs reading or writing to the same data do not run in parallel. - - The handle identifying the scheduled job. Can be used as a dependency for a later job or ensure completion on the main thread. - - - - - Position, rotation and scale of an object. - - - - - Use this to determine whether this instance refers to a valid Transform. - - - - - The position of the transform relative to the parent. - - - - - The rotation of the transform relative to the parent transform's rotation. - - - - - The scale of the transform relative to the parent. - - - - - Matrix that transforms a point from local space into world space (Read Only). - - - - - The position of the transform in world space. - - - - - The rotation of the transform in world space stored as a Quaternion. - - - - - Matrix that transforms a point from world space into local space (Read Only). - - - - - TransformAccessArray. - - - - - Returns array capacity. - - - - - isCreated. - - - - - Length. - - - - - Add. - - Transform. - - - - Allocate. - - Capacity. - Desired job count. - TransformAccessArray. - - - - Constructor. - - Transforms. - Desired job count. - Capacity. - - - - Constructor. - - Transforms. - Desired job count. - Capacity. - - - - Dispose. - - - - - Remove item at index. - - Index. - - - - Set transforms. - - Transforms. - - - - Array indexer. - - - - - Joint is the base class for all joints. - - - - - The Position of the anchor around which the joints motion is constrained. - - - - - Should the connectedAnchor be calculated automatically? - - - - - The Direction of the axis around which the body is constrained. - - - - - The force that needs to be applied for this joint to break. - - - - - The torque that needs to be applied for this joint to break. To be able to break, a joint must be _Locked_ or _Limited_ on the axis of rotation where the torque is being applied. This means that some joints cannot break, such as an unconstrained Configurable Joint. - - - - - Position of the anchor relative to the connected Rigidbody. - - - - - A reference to an articulation body this joint connects to. - - - - - A reference to another rigidbody this joint connects to. - - - - - The scale to apply to the inverse mass and inertia tensor of the connected body prior to solving the constraints. - - - - - The force applied by the solver to satisfy all constraints. - - - - - The torque applied by the solver to satisfy all constraints. - - - - - Enable collision between bodies connected with the joint. - - - - - Toggle preprocessing for this joint. - - - - - The scale to apply to the inverse mass and inertia tensor of the body prior to solving the constraints. - - - - - Parent class for joints to connect Rigidbody2D objects. - - - - - The Rigidbody2D attached to the Joint2D. - - - - - The force that needs to be applied for this joint to break. - - - - - The torque that needs to be applied for this joint to break. - - - - - Can the joint collide with the other Rigidbody2D object to which it is attached? - - - - - The Rigidbody2D object to which the other end of the joint is attached (ie, the object without the joint component). - - - - - Should the two rigid bodies connected with this joint collide with each other? - - - - - Gets the reaction force of the joint. - - - - - Gets the reaction torque of the joint. - - - - - Gets the reaction force of the joint given the specified timeStep. - - The time to calculate the reaction force for. - - The reaction force of the joint in the specified timeStep. - - - - - Gets the reaction torque of the joint given the specified timeStep. - - The time to calculate the reaction torque for. - - The reaction torque of the joint in the specified timeStep. - - - - - Angular limits on the rotation of a Rigidbody2D object around a HingeJoint2D. - - - - - Upper angular limit of rotation. - - - - - Lower angular limit of rotation. - - - - - How the joint's movement will behave along its local X axis. - - - - - Amount of force applied to push the object toward the defined direction. - - - - - Whether the drive should attempt to reach position, velocity, both or nothing. - - - - - Resistance strength against the Position Spring. Only used if mode includes Position. - - - - - Strength of a rubber-band pull toward the defined direction. Only used if mode includes Position. - - - - - The ConfigurableJoint attempts to attain position / velocity targets based on this flag. - - - - - Don't apply any forces to reach the target. - - - - - Try to reach the specified target position. - - - - - Try to reach the specified target position and velocity. - - - - - Try to reach the specified target velocity. - - - - - JointLimits is used by the HingeJoint to limit the joints angle. - - - - - The minimum impact velocity which will cause the joint to bounce. - - - - - Determines the size of the bounce when the joint hits it's limit. Also known as restitution. - - - - - Distance inside the limit value at which the limit will be considered to be active by the solver. - - - - - The upper angular limit (in degrees) of the joint. - - - - - The lower angular limit (in degrees) of the joint. - - - - - Represents the state of a joint limit. - - - - - Represents a state where the joint limit is at the specified lower and upper limits (they are identical). - - - - - Represents a state where the joint limit is inactive. - - - - - Represents a state where the joint limit is at the specified lower limit. - - - - - Represents a state where the joint limit is at the specified upper limit. - - - - - The JointMotor is used to motorize a joint. - - - - - The motor will apply a force. - - - - - If freeSpin is enabled the motor will only accelerate but never slow down. - - - - - The motor will apply a force up to force to achieve targetVelocity. - - - - - Parameters for the optional motor force applied to a Joint2D. - - - - - The maximum force that can be applied to the Rigidbody2D at the joint to attain the target speed. - - - - - The desired speed for the Rigidbody2D to reach as it moves with the joint. - - - - - Determines how to snap physics joints back to its constrained position when it drifts off too much. - - - - - Don't snap at all. - - - - - Snap both position and rotation. - - - - - Snap Position only. - - - - - JointSpring is used add a spring force to HingeJoint and PhysicMaterial. - - - - - The damper force uses to dampen the spring. - - - - - The spring forces used to reach the target position. - - - - - The target position the joint attempts to reach. - - - - - Joint suspension is used to define how suspension works on a WheelJoint2D. - - - - - The world angle (in degrees) along which the suspension will move. - - - - - The amount by which the suspension spring force is reduced in proportion to the movement speed. - - - - - The frequency at which the suspension spring oscillates. - - - - - Motion limits of a Rigidbody2D object along a SliderJoint2D. - - - - - Maximum distance the Rigidbody2D object can move from the Slider Joint's anchor. - - - - - Minimum distance the Rigidbody2D object can move from the Slider Joint's anchor. - - - - - Utility functions for working with JSON data. - - - - - Create an object from its JSON representation. - - The JSON representation of the object. - - An instance of the object. - - - - - Create an object from its JSON representation. - - The JSON representation of the object. - The type of object represented by the Json. - - An instance of the object. - - - - - Overwrite data in an object by reading from its JSON representation. - - The JSON representation of the object. - The object that should be overwritten. - - - - Generate a JSON representation of the public fields of an object. - - The object to convert to JSON form. - If true, format the output for readability. If false, format the output for minimum size. Default is false. - - The object's data in JSON format. - - - - - Generate a JSON representation of the public fields of an object. - - The object to convert to JSON form. - If true, format the output for readability. If false, format the output for minimum size. Default is false. - - The object's data in JSON format. - - - - - Key codes returned by Event.keyCode. These map directly to a physical key on the keyboard. - - - - - 'a' key. - - - - - The '0' key on the top of the alphanumeric keyboard. - - - - - The '1' key on the top of the alphanumeric keyboard. - - - - - The '2' key on the top of the alphanumeric keyboard. - - - - - The '3' key on the top of the alphanumeric keyboard. - - - - - The '4' key on the top of the alphanumeric keyboard. - - - - - The '5' key on the top of the alphanumeric keyboard. - - - - - The '6' key on the top of the alphanumeric keyboard. - - - - - The '7' key on the top of the alphanumeric keyboard. - - - - - The '8' key on the top of the alphanumeric keyboard. - - - - - The '9' key on the top of the alphanumeric keyboard. - - - - - Alt Gr key. - - - - - Ampersand key '&'. - - - - - Asterisk key '*'. - - - - - At key '@'. - - - - - 'b' key. - - - - - Back quote key '`'. - - - - - Backslash key '\'. - - - - - The backspace key. - - - - - Break key. - - - - - 'c' key. - - - - - Capslock key. - - - - - Caret key '^'. - - - - - The Clear key. - - - - - Colon ':' key. - - - - - Comma ',' key. - - - - - 'd' key. - - - - - The forward delete key. - - - - - Dollar sign key '$'. - - - - - Double quote key '"'. - - - - - Down arrow key. - - - - - 'e' key. - - - - - End key. - - - - - Equals '=' key. - - - - - Escape key. - - - - - Exclamation mark key '!'. - - - - - 'f' key. - - - - - F1 function key. - - - - - F10 function key. - - - - - F11 function key. - - - - - F12 function key. - - - - - F13 function key. - - - - - F14 function key. - - - - - F15 function key. - - - - - F2 function key. - - - - - F3 function key. - - - - - F4 function key. - - - - - F5 function key. - - - - - F6 function key. - - - - - F7 function key. - - - - - F8 function key. - - - - - F9 function key. - - - - - 'g' key. - - - - - Greater than '>' key. - - - - - 'h' key. - - - - - Hash key '#'. - - - - - Help key. - - - - - Home key. - - - - - 'i' key. - - - - - Insert key key. - - - - - 'j' key. - - - - - Button 0 on first joystick. - - - - - Button 1 on first joystick. - - - - - Button 10 on first joystick. - - - - - Button 11 on first joystick. - - - - - Button 12 on first joystick. - - - - - Button 13 on first joystick. - - - - - Button 14 on first joystick. - - - - - Button 15 on first joystick. - - - - - Button 16 on first joystick. - - - - - Button 17 on first joystick. - - - - - Button 18 on first joystick. - - - - - Button 19 on first joystick. - - - - - Button 2 on first joystick. - - - - - Button 3 on first joystick. - - - - - Button 4 on first joystick. - - - - - Button 5 on first joystick. - - - - - Button 6 on first joystick. - - - - - Button 7 on first joystick. - - - - - Button 8 on first joystick. - - - - - Button 9 on first joystick. - - - - - Button 0 on second joystick. - - - - - Button 1 on second joystick. - - - - - Button 10 on second joystick. - - - - - Button 11 on second joystick. - - - - - Button 12 on second joystick. - - - - - Button 13 on second joystick. - - - - - Button 14 on second joystick. - - - - - Button 15 on second joystick. - - - - - Button 16 on second joystick. - - - - - Button 17 on second joystick. - - - - - Button 18 on second joystick. - - - - - Button 19 on second joystick. - - - - - Button 2 on second joystick. - - - - - Button 3 on second joystick. - - - - - Button 4 on second joystick. - - - - - Button 5 on second joystick. - - - - - Button 6 on second joystick. - - - - - Button 7 on second joystick. - - - - - Button 8 on second joystick. - - - - - Button 9 on second joystick. - - - - - Button 0 on third joystick. - - - - - Button 1 on third joystick. - - - - - Button 10 on third joystick. - - - - - Button 11 on third joystick. - - - - - Button 12 on third joystick. - - - - - Button 13 on third joystick. - - - - - Button 14 on third joystick. - - - - - Button 15 on third joystick. - - - - - Button 16 on third joystick. - - - - - Button 17 on third joystick. - - - - - Button 18 on third joystick. - - - - - Button 19 on third joystick. - - - - - Button 2 on third joystick. - - - - - Button 3 on third joystick. - - - - - Button 4 on third joystick. - - - - - Button 5 on third joystick. - - - - - Button 6 on third joystick. - - - - - Button 7 on third joystick. - - - - - Button 8 on third joystick. - - - - - Button 9 on third joystick. - - - - - Button 0 on forth joystick. - - - - - Button 1 on forth joystick. - - - - - Button 10 on forth joystick. - - - - - Button 11 on forth joystick. - - - - - Button 12 on forth joystick. - - - - - Button 13 on forth joystick. - - - - - Button 14 on forth joystick. - - - - - Button 15 on forth joystick. - - - - - Button 16 on forth joystick. - - - - - Button 17 on forth joystick. - - - - - Button 18 on forth joystick. - - - - - Button 19 on forth joystick. - - - - - Button 2 on forth joystick. - - - - - Button 3 on forth joystick. - - - - - Button 4 on forth joystick. - - - - - Button 5 on forth joystick. - - - - - Button 6 on forth joystick. - - - - - Button 7 on forth joystick. - - - - - Button 8 on forth joystick. - - - - - Button 9 on forth joystick. - - - - - Button 0 on fifth joystick. - - - - - Button 1 on fifth joystick. - - - - - Button 10 on fifth joystick. - - - - - Button 11 on fifth joystick. - - - - - Button 12 on fifth joystick. - - - - - Button 13 on fifth joystick. - - - - - Button 14 on fifth joystick. - - - - - Button 15 on fifth joystick. - - - - - Button 16 on fifth joystick. - - - - - Button 17 on fifth joystick. - - - - - Button 18 on fifth joystick. - - - - - Button 19 on fifth joystick. - - - - - Button 2 on fifth joystick. - - - - - Button 3 on fifth joystick. - - - - - Button 4 on fifth joystick. - - - - - Button 5 on fifth joystick. - - - - - Button 6 on fifth joystick. - - - - - Button 7 on fifth joystick. - - - - - Button 8 on fifth joystick. - - - - - Button 9 on fifth joystick. - - - - - Button 0 on sixth joystick. - - - - - Button 1 on sixth joystick. - - - - - Button 10 on sixth joystick. - - - - - Button 11 on sixth joystick. - - - - - Button 12 on sixth joystick. - - - - - Button 13 on sixth joystick. - - - - - Button 14 on sixth joystick. - - - - - Button 15 on sixth joystick. - - - - - Button 16 on sixth joystick. - - - - - Button 17 on sixth joystick. - - - - - Button 18 on sixth joystick. - - - - - Button 19 on sixth joystick. - - - - - Button 2 on sixth joystick. - - - - - Button 3 on sixth joystick. - - - - - Button 4 on sixth joystick. - - - - - Button 5 on sixth joystick. - - - - - Button 6 on sixth joystick. - - - - - Button 7 on sixth joystick. - - - - - Button 8 on sixth joystick. - - - - - Button 9 on sixth joystick. - - - - - Button 0 on seventh joystick. - - - - - Button 1 on seventh joystick. - - - - - Button 10 on seventh joystick. - - - - - Button 11 on seventh joystick. - - - - - Button 12 on seventh joystick. - - - - - Button 13 on seventh joystick. - - - - - Button 14 on seventh joystick. - - - - - Button 15 on seventh joystick. - - - - - Button 16 on seventh joystick. - - - - - Button 17 on seventh joystick. - - - - - Button 18 on seventh joystick. - - - - - Button 19 on seventh joystick. - - - - - Button 2 on seventh joystick. - - - - - Button 3 on seventh joystick. - - - - - Button 4 on seventh joystick. - - - - - Button 5 on seventh joystick. - - - - - Button 6 on seventh joystick. - - - - - Button 7 on seventh joystick. - - - - - Button 8 on seventh joystick. - - - - - Button 9 on seventh joystick. - - - - - Button 0 on eighth joystick. - - - - - Button 1 on eighth joystick. - - - - - Button 10 on eighth joystick. - - - - - Button 11 on eighth joystick. - - - - - Button 12 on eighth joystick. - - - - - Button 13 on eighth joystick. - - - - - Button 14 on eighth joystick. - - - - - Button 15 on eighth joystick. - - - - - Button 16 on eighth joystick. - - - - - Button 17 on eighth joystick. - - - - - Button 18 on eighth joystick. - - - - - Button 19 on eighth joystick. - - - - - Button 2 on eighth joystick. - - - - - Button 3 on eighth joystick. - - - - - Button 4 on eighth joystick. - - - - - Button 5 on eighth joystick. - - - - - Button 6 on eighth joystick. - - - - - Button 7 on eighth joystick. - - - - - Button 8 on eighth joystick. - - - - - Button 9 on eighth joystick. - - - - - Button 0 on any joystick. - - - - - Button 1 on any joystick. - - - - - Button 10 on any joystick. - - - - - Button 11 on any joystick. - - - - - Button 12 on any joystick. - - - - - Button 13 on any joystick. - - - - - Button 14 on any joystick. - - - - - Button 15 on any joystick. - - - - - Button 16 on any joystick. - - - - - Button 17 on any joystick. - - - - - Button 18 on any joystick. - - - - - Button 19 on any joystick. - - - - - Button 2 on any joystick. - - - - - Button 3 on any joystick. - - - - - Button 4 on any joystick. - - - - - Button 5 on any joystick. - - - - - Button 6 on any joystick. - - - - - Button 7 on any joystick. - - - - - Button 8 on any joystick. - - - - - Button 9 on any joystick. - - - - - 'k' key. - - - - - Numeric keypad 0. - - - - - Numeric keypad 1. - - - - - Numeric keypad 2. - - - - - Numeric keypad 3. - - - - - Numeric keypad 4. - - - - - Numeric keypad 5. - - - - - Numeric keypad 6. - - - - - Numeric keypad 7. - - - - - Numeric keypad 8. - - - - - Numeric keypad 9. - - - - - Numeric keypad '/'. - - - - - Numeric keypad Enter. - - - - - Numeric keypad '='. - - - - - Numeric keypad '-'. - - - - - Numeric keypad '*'. - - - - - Numeric keypad '.'. - - - - - Numeric keypad '+'. - - - - - 'l' key. - - - - - Left Alt key. - - - - - Left Command key. - - - - - Left arrow key. - - - - - Left square bracket key '['. - - - - - Left Command key. - - - - - Left Control key. - - - - - Left curly bracket key '{'. - - - - - Left Parenthesis key '('. - - - - - Left shift key. - - - - - Left Windows key. - - - - - Less than '<' key. - - - - - 'm' key. - - - - - Menu key. - - - - - Minus '-' key. - - - - - The Left (or primary) mouse button. - - - - - Right mouse button (or secondary mouse button). - - - - - Middle mouse button (or third button). - - - - - Additional (fourth) mouse button. - - - - - Additional (fifth) mouse button. - - - - - Additional (or sixth) mouse button. - - - - - Additional (or seventh) mouse button. - - - - - 'n' key. - - - - - Not assigned (never returned as the result of a keystroke). - - - - - Numlock key. - - - - - 'o' key. - - - - - 'p' key. - - - - - Page down. - - - - - Page up. - - - - - Pause on PC machines. - - - - - Percent '%' key. - - - - - Period '.' key. - - - - - Pipe '|' key. - - - - - Plus key '+'. - - - - - Print key. - - - - - 'q' key. - - - - - Question mark '?' key. - - - - - Quote key '. - - - - - 'r' key. - - - - - Return key. - - - - - Right Alt key. - - - - - Right Command key. - - - - - Right arrow key. - - - - - Right square bracket key ']'. - - - - - Right Command key. - - - - - Right Control key. - - - - - Right curly bracket key '}'. - - - - - Right Parenthesis key ')'. - - - - - Right shift key. - - - - - Right Windows key. - - - - - 's' key. - - - - - Scroll lock key. - - - - - Semicolon ';' key. - - - - - Slash '/' key. - - - - - Space key. - - - - - Sys Req key. - - - - - 't' key. - - - - - The tab key. - - - - - Tilde '~' key. - - - - - 'u' key. - - - - - Underscore '_' key. - - - - - Up arrow key. - - - - - 'v' key. - - - - - 'w' key. - - - - - 'x' key. - - - - - 'y' key. - - - - - 'z' key. - - - - - A single keyframe that can be injected into an animation curve. - - - - - Sets the incoming tangent for this key. The incoming tangent affects the slope of the curve from the previous key to this key. - - - - - Sets the incoming weight for this key. The incoming weight affects the slope of the curve from the previous key to this key. - - - - - Sets the outgoing tangent for this key. The outgoing tangent affects the slope of the curve from this key to the next key. - - - - - Sets the outgoing weight for this key. The outgoing weight affects the slope of the curve from this key to the next key. - - - - - TangentMode is deprecated. Use AnimationUtility.SetKeyLeftTangentMode or AnimationUtility.SetKeyRightTangentMode instead. - - - - - The time of the keyframe. - - - - - The value of the curve at keyframe. - - - - - Weighted mode for the keyframe. - - - - - Create a keyframe. - - - - - - - Create a keyframe. - - - - - - - - - Create a keyframe. - - - - - - - - - - - Specifies Layers to use in a Physics.Raycast. - - - - - Converts a layer mask value to an integer value. - - - - - Given a set of layer names as defined by either a Builtin or a User Layer in the, returns the equivalent layer mask for all of them. - - List of layer names to convert to a layer mask. - - The layer mask created from the layerNames. - - - - - Implicitly converts an integer to a LayerMask. - - - - - - Given a layer number, returns the name of the layer as defined in either a Builtin or a User Layer in the. - - - - - - Given a layer name, returns the layer index as defined by either a Builtin or a User Layer in the. - - - - - - Serializable lazy reference to a UnityEngine.Object contained in an asset file. - - - - - Accessor to the referenced asset. - - - - - Returns the instance id to the referenced asset. - - - - - Convenience property that checks whether the reference is broken: refers to an object that is either not available or not loadable. - - - - - Determines if an asset is being targeted, regardless of whether the asset is available for loading. - - - - - Construct a new LazyLoadReference. - - The asset reference. - The asset instance ID. - - - - Construct a new LazyLoadReference. - - The asset reference. - The asset instance ID. - - - - Implicit conversion from instance ID to LazyLoadReference. - - The asset instance ID. - - - - Implicit conversion from asset reference to LazyLoadReference. - - The asset reference. - - - - Enumeration of all the muscles in a leg. - - - - - The foot close-open muscle. - - - - - The foot in-out muscle. - - - - - The last value of the LegDof enum. - - - - - The leg close-open muscle. - - - - - The leg roll in-out muscle. - - - - - The toes up-down muscle. - - - - - The upper leg front-back muscle. - - - - - The upper leg in-out muscle. - - - - - The upper leg roll in-out muscle. - - - - - Script interface for a. - - - - - The strength of the flare. - - - - - The color of the flare. - - - - - The fade speed of the flare. - - - - - The to use. - - - - - Script interface for. - - - - - The size of the area light (Editor only). - - - - - This property describes the output of the last Global Illumination bake. - - - - - The multiplier that defines the strength of the bounce lighting. - - - - - Bounding sphere used to override the regular light bounding sphere during culling. - - - - - The color of the light. - - - - - - The color temperature of the light. - Correlated Color Temperature (abbreviated as CCT) is multiplied with the color filter when calculating the final color of a light source. The color temperature of the electromagnetic radiation emitted from an ideal black body is defined as its surface temperature in Kelvin. White is 6500K according to the D65 standard. A candle light is 1800K and a soft warm light bulb is 2700K. - If you want to use colorTemperature, GraphicsSettings.lightsUseLinearIntensity and Light.useColorTemperature has to be enabled. - See Also: GraphicsSettings.lightsUseLinearIntensity, GraphicsSettings.useColorTemperature. - - - - - - Number of command buffers set up on this light (Read Only). - - - - - The cookie texture projected by the light. - - - - - The size of a directional light's cookie. - - - - - This is used to light certain objects in the Scene selectively. - - - - - The to use for this light. - - - - - The angle of the light's spotlight inner cone in degrees. - - - - - The Intensity of a light is multiplied with the Light color. - - - - - Is the light contribution already stored in lightmaps and/or lightprobes (Read Only). Obsolete; replaced by Light-lightmapBakeType. - - - - - Per-light, per-layer shadow culling distances. Directional lights only. - - - - - This property describes what part of a light's contribution can be baked (Editor only). - - - - - Allows you to override the global Shadowmask Mode per light. Only use this with render pipelines that can handle per light Shadowmask modes. Incompatible with the legacy renderers. - - - - - The range of the light. - - - - - Determines which rendering LayerMask this Light affects. - - - - - How to render the light. - - - - - Controls the amount of artificial softening applied to the edges of shadows cast by directional lights. - - - - - Shadow mapping constant bias. - - - - - The custom resolution of the shadow map. - - - - - Projection matrix used to override the regular light matrix during shadow culling. - - - - - Near plane value to use for shadow frustums. - - - - - Shadow mapping normal-based bias. - - - - - Controls the amount of artificial softening applied to the edges of shadows cast by the Point or Spot light. - - - - - The resolution of the shadow map. - - - - - How this light casts shadows - - - - - Strength of light's shadows. - - - - - This property describes the shape of the spot light. Only Scriptable Render Pipelines use this property; the built-in renderer does not support it. - - - - - The angle of the light's spotlight cone in degrees. - - - - - The type of the light. - - - - - Set to true to override light bounding sphere for culling. - - - - - Set to true to use the color temperature. - - - - - Set to true to enable custom matrix for culling during shadows. - - - - - Whether to cull shadows for this Light when the Light is outside of the view frustum. - - - - - Add a command buffer to be executed at a specified place. - - When to execute the command buffer during rendering. - The buffer to execute. - A mask specifying which shadow passes to execute the buffer for. - - - - Add a command buffer to be executed at a specified place. - - When to execute the command buffer during rendering. - The buffer to execute. - A mask specifying which shadow passes to execute the buffer for. - - - - Adds a command buffer to the GPU's async compute queues and executes that command buffer when graphics processing reaches a given point. - - The point during the graphics processing at which this command buffer should commence on the GPU. - The buffer to execute. - The desired async compute queue type to execute the buffer on. - A mask specifying which shadow passes to execute the buffer for. - - - - Adds a command buffer to the GPU's async compute queues and executes that command buffer when graphics processing reaches a given point. - - The point during the graphics processing at which this command buffer should commence on the GPU. - The buffer to execute. - The desired async compute queue type to execute the buffer on. - A mask specifying which shadow passes to execute the buffer for. - - - - Get command buffers to be executed at a specified place. - - When to execute the command buffer during rendering. - - Array of command buffers. - - - - - Remove all command buffers set on this light. - - - - - Remove command buffer from execution at a specified place. - - When to execute the command buffer during rendering. - The buffer to execute. - - - - Remove command buffers from execution at a specified place. - - When to execute the command buffer during rendering. - - - - Revert all light parameters to default. - - - - - Sets a light dirty to notify the light baking backends to update their internal light representation (Editor only). - - - - - Struct describing the result of a Global Illumination bake for a given light. - - - - - Is the light contribution already stored in lightmaps and/or lightprobes? - - - - - This property describes what part of a light's contribution was baked. - - - - - In case of a LightmapBakeType.Mixed light, describes what Mixed mode was used to bake the light, irrelevant otherwise. - - - - - In case of a LightmapBakeType.Mixed light, contains the index of the occlusion mask channel to use if any, otherwise -1. - - - - - In case of a LightmapBakeType.Mixed light, contains the index of the light as seen from the occlusion probes point of view if any, otherwise -1. - - - - - An object containing settings for precomputing lighting data, that Unity can serialize as a. - - - - - The intensity of surface albedo throughout the Scene when considered in lighting calculations. This value influences the energy of light at each bounce. (Editor only). - - - - - Whether to apply ambient occlusion to lightmaps. (Editor only). - - - - - Determines the degree to which direct lighting is considered when calculating ambient occlusion in lightmaps. (Editor only). - - - - - Sets the contrast of ambient occlusion that Unity applies to indirect lighting in lightmaps. (Editor only). - - - - - The distance that a ray travels before Unity considers it to be unoccluded when calculating ambient occlusion in lightmaps. (Editor only). - - - - - Whether the Unity Editor automatically precomputes lighting data when the Scene data changes. (Editor only). - - - - - Whether to enable the Baked Global Illumination system for this Scene. - - - - - This property is now obsolete. Use LightingSettings.maxBounces. - - - - - Whether to compress the lightmap textures that the Progressive Lightmapper generates. (Editor only) - - - - - Determines the type of denoising that the Progressive Lightmapper applies to ambient occlusion in lightmaps. (Editor only). - - - - - Determines the denoiser that the Progressive Lightmapper applies to direct lighting. (Editor only). - - - - - Determines the denoiser that the Progressive Lightmapper applies to indirect lighting. (Editor only). - - - - - Determines whether the lightmapper should generate directional or non-directional lightmaps. (Editor only). - - - - - Specifies the number of samples the Progressive Lightmapper uses for direct lighting calculations. (Editor only). - - - - - Specifies the number of samples the Progressive Lightmapper uses when sampling indirect lighting from the skybox. (Editor only). - - - - - Whether the Progressive Lightmapper exports machine learning training data to the Project folder when it performs the bake. ( Editor only). - - - - - Whether the Progressive Lightmapper extracts Ambient Occlusion to a separate lightmap. (Editor only). - - - - - Specifies the threshold the Progressive Lightmapper uses to filter direct light stored in the lightmap when using the A-Trous filter. (Editor only). - - - - - Specifies the threshold the Progressive Lightmapper uses to filter the indirect lighting component of the lightmap when using the A-Trous filter. (Editor only). - - - - - Specifies the radius the Progressive Lightmapper uses to filter the ambient occlusion component in the lightmap when using Gaussian filter. (Editor only). - - - - - Specifies the radius the Progressive Lightmapper uses to filter the direct lighting component of the lightmap when using Gaussian filter. (Editor only). - - - - - Specifies the radius the Progressive Lightmapper used to filter the indirect lighting component of the lightmap when using Gaussian filter. (Editor only). - - - - - Specifies the method used by the Progressive Lightmapper to reduce noise in lightmaps. (Editor only). - - - - - Specifies the filter type that the Progressive Lightmapper uses for ambient occlusion. (Editor only). - - - - - Specifies the filter kernel that the Progressive Lightmapper uses for ambient occlusion. (Editor only). - - - - - Specifies the filter kernel that the Progressive Lightmapper uses for the direct lighting. (Editor only). - - - - - Specifies the filter kernel that the Progressive Lightmapper uses for indirect lighting. (Editor only). - - - - - Specifies whether the final light bounce of the global illumination calculation is calculated at the same resolution as the baked lightmap. (Editor only). - - - - - Controls whether a denoising filter is applied to the final gather output. - - - - - Controls the number of rays emitted for every final gather point. A final gather point is a lightmap texel in the final, composited lightmap. (Editor only). - - - - - Defines the number of texels that Enlighten uses per world unit when calculating indirect lighting. (Editor only). - - - - - Specifies the number of samples the Progressive Lightmapper uses for indirect lighting calculations. (Editor only). - - - - - Multiplies the intensity of of indirect lighting in lightmaps. (Editor only). - - - - - The maximum size in pixels of an individual lightmap texture. (Editor only). - - - - - Sets the distance (in texels) between separate UV tiles in lightmaps. (Editor only). - - - - - Determines which backend to use for baking lightmaps in the Baked Global Illumination system. (Editor only). - - - - - Defines the number of texels to use per world unit when generating lightmaps. - - - - - Specifies the number of samples to use for Light Probes relative to the number of samples for lightmap texels. (Editor only). - - - - - Stores the maximum number of bounces the Progressive Lightmapper computes for indirect lighting. (Editor only) - - - - - Stores the minimum number of bounces the Progressive Lightmapper computes for indirect lighting. (Editor only) - - - - - Sets the MixedLightingMode that Unity uses for all Mixed Lights in the Scene. (Editor only). - - - - - Whether the Progressive Lightmapper prioritizes baking visible texels within the frustum of the Scene view. (Editor only). - - - - - Determines the lightmap that Unity stores environment lighting in. - - - - - Whether to enable the Realtime Global Illumination system for this Scene. - - - - - This property is now obsolete. Use LightingSettings.minBounces. - - - - - Determines the name of the destination folder for the exported textures. (Editor only). - - - - - The available denoisers for the Progressive Lightmapper. - - - - - Use this to disable denoising for the lightmap. - - - - - Intel Open Image Denoiser. - - - - - NVIDIA Optix Denoiser. - - - - - RadeonPro Denoiser. - - - - - The available filtering modes for the Progressive Lightmapper. - - - - - When enabled, you can configure the filtering settings for the Progressive Lightmapper. When disabled, the default filtering settings apply. - - - - - The filtering is configured automatically. - - - - - No filtering. - - - - - The available filter kernels for the Progressive Lightmapper. - - - - - When enabled, the lightmap uses an A-Trous filter. - - - - - When enabled, the lightmap uses a Gaussian filter. - - - - - When enabled, the lightmap uses no filtering. - - - - - Backends available for baking lighting. - - - - - Backend for baking lighting with the Enlighten radiosity middleware. - - - - - Backend for baking lighting using the CPU. Uses a progressive path tracing algorithm. - - - - - Backend for baking lighting using the GPU. Uses a progressive path tracing algorithm. - - - - - Enum describing what part of a light contribution can be baked. - - - - - Baked lights cannot move or change in any way during run time. All lighting for static objects gets baked into lightmaps. Lighting and shadows for dynamic objects gets baked into Light Probes. - - - - - Mixed lights allow a mix of realtime and baked lighting, based on the Mixed Lighting Mode used. These lights cannot move, but can change color and intensity at run time. Changes to color and intensity only affect direct lighting as indirect lighting gets baked. If using Subtractive mode, changes to color or intensity are not calculated at run time on static objects. - - - - - Realtime lights cast run time light and shadows. They can change position, orientation, color, brightness, and many other properties at run time. No lighting gets baked into lightmaps or light probes.. - - - - - Data of a lightmap. - - - - - Lightmap storing color of incoming light. - - - - - Lightmap storing dominant direction of incoming light. - - - - - Texture storing occlusion mask per light (ShadowMask, up to four lights). - - - - - Stores lightmaps of the Scene. - - - - - Lightmap array. - - - - - NonDirectional or CombinedDirectional Specular lightmaps rendering mode. - - - - - Baked Light Probe data. - - - - - Lightmap (and lighting) configuration mode, controls how lightmaps interact with lighting and what kind of information they store. - - - - - Directional information for direct light is combined with directional information for indirect light, encoded as 2 lightmaps. - - - - - Light intensity (no directional information), encoded as 1 lightmap. - - - - - Directional information for direct light is stored separately from directional information for indirect light, encoded as 4 lightmaps. - - - - - Single, dual, or directional lightmaps rendering mode, used only in GIWorkflowMode.Legacy - - - - - Directional rendering mode. - - - - - Dual lightmap rendering mode. - - - - - Single, traditional lightmap rendering mode. - - - - - Light Probe Group. - - - - - Removes ringing from probes if enabled. - - - - - Editor only function to access and modify probe positions. - - - - - The Light Probe Proxy Volume component offers the possibility to use higher resolution lighting for large non-static GameObjects. - - - - - The bounding box mode for generating the 3D grid of interpolated Light Probes. - - - - - The world-space bounding box in which the 3D grid of interpolated Light Probes is generated. - - - - - The texture data format used by the Light Probe Proxy Volume 3D texture. - - - - - The 3D grid resolution on the x-axis. - - - - - The 3D grid resolution on the y-axis. - - - - - The 3D grid resolution on the z-axis. - - - - - Checks if Light Probe Proxy Volumes are supported. - - - - - The local-space origin of the bounding box in which the 3D grid of interpolated Light Probes is generated. - - - - - Interpolated Light Probe density. - - - - - The mode in which the interpolated Light Probe positions are generated. - - - - - Determines how many Spherical Harmonics bands will be evaluated to compute the ambient color. - - - - - Sets the way the Light Probe Proxy Volume refreshes. - - - - - The resolution mode for generating the grid of interpolated Light Probes. - - - - - The size of the bounding box in which the 3D grid of interpolated Light Probes is generated. - - - - - The bounding box mode for generating a grid of interpolated Light Probes. - - - - - The bounding box encloses the current Renderer and all the relevant Renderers down the hierarchy, in local space. - - - - - The bounding box encloses the current Renderer and all the relevant Renderers down the hierarchy, in world space. - - - - - A custom local-space bounding box is used. The user is able to edit the bounding box. - - - - - The texture data format used by the Light Probe Proxy Volume 3D texture. - - - - - A 32-bit floating-point format is used for the Light Probe Proxy Volume 3D texture. - - - - - A 16-bit half floating-point format is used for the Light Probe Proxy Volume 3D texture. - - - - - The mode in which the interpolated Light Probe positions are generated. - - - - - Divide the volume in cells based on resolution, and generate interpolated Light Probe positions in the center of the cells. - - - - - Divide the volume in cells based on resolution, and generate interpolated Light Probes positions in the corner/edge of the cells. - - - - - An enum describing the Quality option used by the Light Probe Proxy Volume component. - - - - - This option will use only two SH coefficients bands: L0 and L1. The coefficients are sampled from the Light Probe Proxy Volume 3D Texture. Using this option might increase the draw call batch sizes by not having to change the L2 coefficients per Renderer. - - - - - This option will use L0 and L1 SH coefficients from the Light Probe Proxy Volume 3D Texture. The L2 coefficients are constant per Renderer. By having to provide the L2 coefficients, draw call batches might be broken. - - - - - An enum describing the way a Light Probe Proxy Volume refreshes in the Player. - - - - - Automatically detects updates in Light Probes and triggers an update of the Light Probe volume. - - - - - Causes Unity to update the Light Probe Proxy Volume every frame. - - - - - Use this option to indicate that the Light Probe Proxy Volume is never to be automatically updated by Unity. - - - - - The resolution mode for generating a grid of interpolated Light Probes. - - - - - The automatic mode uses a number of interpolated Light Probes per unit area, and uses the bounding volume size to compute the resolution. The final resolution value is a power of 2. - - - - - The custom mode allows you to specify the 3D grid resolution. - - - - - Triggers an update of the Light Probe Proxy Volume. - - - - - Stores light probe data for all currently loaded Scenes. - - - - - Coefficients of baked light probes. - - - - - The number of cells space is divided into (Read Only). - - - - - The number of light probes (Read Only). - - - - - An event which is called when the number of currently loaded light probes changes due to additive scene loading or unloading. - - - - - - Positions of the baked light probes (Read Only). - - - - - Event which is called after LightProbes.Tetrahedralize or LightProbes.TetrahedralizeAsync has finished computing a tetrahedralization. - - - - - - Calculate light probes and occlusion probes at the given world space positions. - - The array of world space positions used to evaluate the probes. - The array where the resulting light probes are written to. - The array where the resulting occlusion probes are written to. - - - - Calculate light probes and occlusion probes at the given world space positions. - - The array of world space positions used to evaluate the probes. - The array where the resulting light probes are written to. - The array where the resulting occlusion probes are written to. - - - - Returns an interpolated probe for the given position for both realtime and baked light probes combined. - - - - - - - - Synchronously tetrahedralize the currently loaded LightProbe positions. - - - Returns true if the tetrahedralization finished successfully. - - - - - Asynchronously tetrahedralize the currently loaded LightProbe positions. - - - - - Asynchronously tetrahedralize the currently loaded LightProbe positions. - - - - - How the Light is rendered. - - - - - Automatically choose the render mode. - - - - - Force the Light to be a pixel light. - - - - - Force the Light to be a vertex light. - - - - - Allows mixed lights to control shadow caster culling when Shadowmasks are present. - - - - - Use the global Shadowmask Mode from the quality settings. - - - - - Render all shadow casters into the shadow map. This corresponds with the distance Shadowmask mode. - - - - - Render only non-lightmapped objects into the shadow map. This corresponds with the Shadowmask mode. - - - - - Shadow casting options for a Light. - - - - - Cast "hard" shadows (with no shadow filtering). - - - - - Do not cast shadows (default). - - - - - Cast "soft" shadows (with 4x PCF filtering). - - - - - Describes the shape of a spot light. - - - - - The shape of the spot light resembles a box oriented along the ray direction. - - - - - The shape of the spot light resembles a cone. This is the default shape for spot lights. - - - - - The shape of the spotlight resembles a pyramid or frustum. You can use this to simulate a screening or barn door effect on a normal spotlight. - - - - - The type of a Light. - - - - - The light is a directional light. - - - - - The light is a disc shaped area light. It affects only baked lightmaps and lightprobes. - - - - - The light is a point light. - - - - - The light is a rectangle shaped area light. It affects only baked lightmaps and lightprobes. - - - - - The light is a spot light. - - - - - Control the direction lines face, when using the LineRenderer or TrailRenderer. - - - - - Lines face the direction of the Transform Component. - - - - - Lines face the Z axis of the Transform Component. - - - - - Lines face the camera. - - - - - The line renderer is used to draw free-floating lines in 3D space. - - - - - Select whether the line will face the camera, or the orientation of the Transform Component. - - - - - Set the color gradient describing the color of the line at various points along its length. - - - - - Set the color at the end of the line. - - - - - Set the width at the end of the line. - - - - - Configures a line to generate Normals and Tangents. With this data, Scene lighting can affect the line via Normal Maps and the Unity Standard Shader, or your own custom-built Shaders. - - - - - Connect the start and end positions of the line together to form a continuous loop. - - - - - Set this to a value greater than 0, to get rounded corners on each end of the line. - - - - - Set this to a value greater than 0, to get rounded corners between each segment of the line. - - - - - Set the number of line segments. - - - - - Set/get the number of vertices. - - - - - Apply a shadow bias to prevent self-shadowing artifacts. The specified value is the proportion of the line width at each segment. - - - - - Set the color at the start of the line. - - - - - Set the width at the start of the line. - - - - - Choose whether the U coordinate of the line texture is tiled or stretched. - - - - - If enabled, the lines are defined in world space. - - - - - Set the curve describing the width of the line at various points along its length. - - - - - Set an overall multiplier that is applied to the LineRenderer.widthCurve to get the final width of the line. - - - - - Creates a snapshot of LineRenderer and stores it in mesh. - - A static mesh that will receive the snapshot of the line. - The camera used for determining which way camera-space lines will face. - Include the rotation and scale of the Transform in the baked mesh. - - - - Creates a snapshot of LineRenderer and stores it in mesh. - - A static mesh that will receive the snapshot of the line. - The camera used for determining which way camera-space lines will face. - Include the rotation and scale of the Transform in the baked mesh. - - - - Creates a snapshot of LineRenderer and stores it in mesh. - - A static mesh that will receive the snapshot of the line. - The camera used for determining which way camera-space lines will face. - Include the rotation and scale of the Transform in the baked mesh. - - - - Creates a snapshot of LineRenderer and stores it in mesh. - - A static mesh that will receive the snapshot of the line. - The camera used for determining which way camera-space lines will face. - Include the rotation and scale of the Transform in the baked mesh. - - - - Get the position of a vertex in the line. - - The index of the position to retrieve. - - The position at the specified index in the array. - - - - - Get the positions of all vertices in the line. - - The array of positions to retrieve. The array passed should be of at least positionCount in size. - - How many positions were actually stored in the output array. - - - - - Get the positions of all vertices in the line. - - The array of positions to retrieve. The array passed should be of at least positionCount in size. - - How many positions were actually stored in the output array. - - - - - Get the positions of all vertices in the line. - - The array of positions to retrieve. The array passed should be of at least positionCount in size. - - How many positions were actually stored in the output array. - - - - - Set the line color at the start and at the end. - - - - - - - Set the position of a vertex in the line. - - Which position to set. - The new position. - - - - Set the positions of all vertices in the line. - - The array of positions to set. - - - - Set the positions of all vertices in the line. - - The array of positions to set. - - - - Set the positions of all vertices in the line. - - The array of positions to set. - - - - Set the number of line segments. - - - - - - Set the line width at the start and at the end. - - - - - - - Generates a simplified version of the original line by removing points that fall within the specified tolerance. - - This value is used to evaluate which points should be removed from the line. A higher value results in a simpler line (less points). A positive value close to zero results in a line with little to no reduction. A value of zero or less has no effect. - - - - Choose how textures are applied to Lines and Trails. - - - - - Map the texture once along the entire length of the line, assuming all vertices are evenly spaced. - - - - - Repeat the texture along the line, repeating at a rate of once per line segment. To adjust the tiling rate, use Material.SetTextureScale. - - - - - Map the texture once along the entire length of the line. - - - - - Repeat the texture along the line, based on its length in world units. To set the tiling rate, use Material.SetTextureScale. - - - - - A collection of common line functions. - - - - - Generates a simplified version of the original line by removing points that fall within the specified tolerance. - - The points that make up the original line. - This value is used to evaluate which points should be removed from the line. A higher value results in a simpler line (less points). A positive value close to zero results in a line with little to no reduction. A value of zero or less has no effect. - Populated by this function. Contains the indexes of the points that should be generate a simplified version.. - Populated by this function. Contains the points that form the simplified line. - - - - Generates a simplified version of the original line by removing points that fall within the specified tolerance. - - The points that make up the original line. - This value is used to evaluate which points should be removed from the line. A higher value results in a simpler line (less points). A positive value close to zero results in a line with little to no reduction. A value of zero or less has no effect. - Populated by this function. Contains the indexes of the points that should be generate a simplified version.. - Populated by this function. Contains the points that form the simplified line. - - - - Generates a simplified version of the original line by removing points that fall within the specified tolerance. - - The points that make up the original line. - This value is used to evaluate which points should be removed from the line. A higher value results in a simpler line (less points). A positive value close to zero results in a line with little to no reduction. A value of zero or less has no effect. - Populated by this function. Contains the indexes of the points that should be generate a simplified version.. - Populated by this function. Contains the points that form the simplified line. - - - - Generates a simplified version of the original line by removing points that fall within the specified tolerance. - - The points that make up the original line. - This value is used to evaluate which points should be removed from the line. A higher value results in a simpler line (less points). A positive value close to zero results in a line with little to no reduction. A value of zero or less has no effect. - Populated by this function. Contains the indexes of the points that should be generate a simplified version.. - Populated by this function. Contains the points that form the simplified line. - - - - An asset to represent a table of localized strings for one specific locale. - - - - - Is this asset used to localize UI components of the Unity Editor - - - - - ISO Code used to identify the locale. ex: en-uk, zh-hans, ja - - - - - Creates a new empty LocalizationAsset object. - - - - - Get the localized string for the specified key. - - Original string acting as key. - - Localized string matching the original in the LocalizationAsset locale - - - - - Set the localized string for the specified key - - Original string acting as key. - Localized string matching the original in the LocalizationAsset locale - - - - Structure describing device location. - - - - - Geographical device location altitude. - - - - - Horizontal accuracy of the location. - - - - - Geographical device location latitude. - - - - - Geographical device location latitude. - - - - - Timestamp (in seconds since 1970) when location was last time updated. - - - - - Vertical accuracy of the location. - - - - - Interface into location functionality. - - - - - Specifies whether location service is enabled in user settings. - - - - - Last measured device geographical location. - - - - - Returns location service status. - - - - - Starts location service updates. Last location coordinates could be. - - - - - - - Starts location service updates. Last location coordinates could be. - - - - - - - Starts location service updates. Last location coordinates could be. - - - - - - - Stops location service updates. This could be useful for saving battery life. - - - - - Describes location service status. - - - - - Location service failed (user denied access to location service). - - - - - Location service is initializing, some time later it will switch to. - - - - - Location service is running and locations could be queried. - - - - - Location service is stopped. - - - - - Structure for building a LOD for passing to the SetLODs function. - - - - - Width of the cross-fade transition zone (proportion to the current LOD's whole length) [0-1]. Only used if it's not animated. - - - - - List of renderers for this LOD level. - - - - - The screen relative height to use for the transition [0-1]. - - - - - Construct a LOD. - - The screen relative height to use for the transition [0-1]. - An array of renderers to use for this LOD level. - - - - The LOD fade modes. Modes other than LODFadeMode.None will result in Unity calculating a blend factor for blending/interpolating between two neighbouring LODs and pass it to your shader. - - - - - Perform cross-fade style blending between the current LOD and the next LOD if the distance to camera falls in the range specified by the LOD.fadeTransitionWidth of each LOD. - - - - - Indicates the LOD fading is turned off. - - - - - By specifying this mode, your LODGroup will perform a SpeedTree-style LOD fading scheme: - - -* For all the mesh LODs other than the last (most crude) mesh LOD, the fade factor is calculated as the percentage of the object's current screen height, compared to the whole range of the LOD. It is 1, if the camera is right at the position where the previous LOD switches out and 0, if the next LOD is just about to switch in. - - -* For the last mesh LOD and the billboard LOD, the cross-fade mode is used. - - - - - LODGroup lets you group multiple Renderers into LOD levels. - - - - - Specify if the cross-fading should be animated by time. The animation duration is specified globally as crossFadeAnimationDuration. - - - - - The cross-fading animation duration in seconds. ArgumentException will be thrown if it is set to zero or a negative value. - - - - - Allows you to enable or disable the LODGroup. - - - - - The LOD fade mode used. - - - - - The local reference point against which the LOD distance is calculated. - - - - - The number of LOD levels. - - - - - The size of the LOD object in local space. - - - - - - - The LOD level to use. Passing index < 0 will return to standard LOD processing. - - - - Returns the array of LODs. - - - The LOD array. - - - - - Recalculate the bounding region for the LODGroup (Relatively slow, do not call often). - - - - - Set the LODs for the LOD group. This will remove any existing LODs configured on the LODGroup. - - The LODs to use for this group. - - - - Initializes a new instance of the Logger. - - - - - To selective enable debug log message. - - - - - To runtime toggle debug logging [ON/OFF]. - - - - - Set Logger.ILogHandler. - - - - - Create a custom Logger. - - Pass in default log handler or custom log handler. - - - - Check logging is enabled based on the LogType. - - The type of the log message. - - Retrun true in case logs of LogType will be logged otherwise returns false. - - - - - Logs message to the Unity Console using default logger. - - The type of the log message. - Used to identify the source of a log message. It usually identifies the class where the log call occurs. - String or object to be converted to string representation for display. - Object to which the message applies. - - - - Logs message to the Unity Console using default logger. - - The type of the log message. - Used to identify the source of a log message. It usually identifies the class where the log call occurs. - String or object to be converted to string representation for display. - Object to which the message applies. - - - - Logs message to the Unity Console using default logger. - - The type of the log message. - Used to identify the source of a log message. It usually identifies the class where the log call occurs. - String or object to be converted to string representation for display. - Object to which the message applies. - - - - Logs message to the Unity Console using default logger. - - The type of the log message. - Used to identify the source of a log message. It usually identifies the class where the log call occurs. - String or object to be converted to string representation for display. - Object to which the message applies. - - - - Logs message to the Unity Console using default logger. - - The type of the log message. - Used to identify the source of a log message. It usually identifies the class where the log call occurs. - String or object to be converted to string representation for display. - Object to which the message applies. - - - - Logs message to the Unity Console using default logger. - - The type of the log message. - Used to identify the source of a log message. It usually identifies the class where the log call occurs. - String or object to be converted to string representation for display. - Object to which the message applies. - - - - Logs message to the Unity Console using default logger. - - The type of the log message. - Used to identify the source of a log message. It usually identifies the class where the log call occurs. - String or object to be converted to string representation for display. - Object to which the message applies. - - - - A variant of Logger.Log that logs an error message. - - Used to identify the source of a log message. It usually identifies the class where the log call occurs. - String or object to be converted to string representation for display. - Object to which the message applies. - - - - A variant of Logger.Log that logs an error message. - - Used to identify the source of a log message. It usually identifies the class where the log call occurs. - String or object to be converted to string representation for display. - Object to which the message applies. - - - - A variant of Logger.Log that logs an exception message. - - Runtime Exception. - Object to which the message applies. - - - - A variant of Logger.Log that logs an exception message. - - Runtime Exception. - Object to which the message applies. - - - - Logs a formatted message. - - The type of the log message. - Object to which the message applies. - A composite format string. - Format arguments. - - - - Logs a formatted message. - - The type of the log message. - Object to which the message applies. - A composite format string. - Format arguments. - - - - A variant of Logger.Log that logs an warning message. - - Used to identify the source of a log message. It usually identifies the class where the log call occurs. - String or object to be converted to string representation for display. - Object to which the message applies. - - - - A variant of Logger.Log that logs an warning message. - - Used to identify the source of a log message. It usually identifies the class where the log call occurs. - String or object to be converted to string representation for display. - Object to which the message applies. - - - - Option flags for specifying special treatment of a log message. - - - - - Normal log message. - - - - - The log message will not have a stacktrace appended automatically. - - - - - The type of the log message in Debug.unityLogger.Log or delegate registered with Application.RegisterLogCallback. - - - - - LogType used for Asserts. (These could also indicate an error inside Unity itself.) - - - - - LogType used for Errors. - - - - - LogType used for Exceptions. - - - - - LogType used for regular log messages. - - - - - LogType used for Warnings. - - - - - The class representing the player loop in Unity. - - - - - Returns the current update order of all engine systems in Unity. - - - - - Returns the default update order of all engine systems in Unity. - - - - - Set a new custom update order of all engine systems in Unity. - - - - - - The representation of a single system being updated by the player loop in Unity. - - - - - The loop condition for a native engine system. To get a valid value for this, you must copy it from one of the PlayerLoopSystems returned by PlayerLoop.GetDefaultPlayerLoop. - - - - - A list of sub systems which run as part of this item in the player loop. - - - - - This property is used to identify which native system this belongs to, or to get the name of the managed system to show in the profiler. - - - - - A managed delegate. You can set this to create a new C# entrypoint in the player loop. - - - - - A native engine system. To get a valid value for this, you must copy it from one of the PlayerLoopSystems returned by PlayerLoop.GetDefaultPlayerLoop. - - - - - This attribute provides a way to declaratively define a Lumin platform level requirement that is automatically added to the manifest at build time. - - - - - Minimum platform level that is required. - - - - - - This attribute provides a way to declaratively define a Lumin privilege requirement that is automatically added to the manifest at build time. - - - - - Privilege identifer to request - - - - - - The Master Server is used to make matchmaking between servers and clients easy. - - - - - Report this machine as a dedicated server. - - - - - The IP address of the master server. - - - - - The connection port of the master server. - - - - - Set the minimum update rate for master server host information update. - - - - - Clear the host list which was received by MasterServer.PollHostList. - - - - - Check for the latest host list received by using MasterServer.RequestHostList. - - - - - Register this server on the master server. - - - - - - - - Register this server on the master server. - - - - - - - - Request a host list from the master server. - - - - - - Unregister this server from the master server. - - - - - Describes status messages from the master server as returned in MonoBehaviour.OnMasterServerEvent|OnMasterServerEvent. - - - - - Use this struct to specify the position and rotation weight mask for Animator.MatchTarget. - - - - - Position XYZ weight. - - - - - Rotation weight. - - - - - MatchTargetWeightMask contructor. - - Position XYZ weight. - Rotation weight. - - - - The material class. - - - - - The main color of the Material. - - - - - Gets and sets whether the Double Sided Global Illumination setting is enabled for this material. - - - - - Gets and sets whether GPU instancing is enabled for this material. - - - - - Defines how the material should interact with lightmaps and lightprobes. - - - - - The main texture. - - - - - The offset of the main texture. - - - - - The scale of the main texture. - - - - - How many passes are in this material (Read Only). - - - - - Render queue of this material. - - - - - The shader used by the material. - - - - - Additional shader keywords set by this material. - - - - - Computes a CRC hash value from the content of the material. - - - - - Copy properties from other material into this material. - - - - - - - - - - - - Create a temporary Material. - - Create a material with a given Shader. - Create a material by copying all properties from another material. - - - - Create a temporary Material. - - Create a material with a given Shader. - Create a material by copying all properties from another material. - - - - Unset a shader keyword. - - - - - - Sets a shader keyword that is enabled by this material. - - - - - - Returns the index of the pass passName. - - - - - - Get a named color value. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Get a named color value. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Get a named color array. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Get a named color array. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Fetch a named color array into a list. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - The list to hold the returned array. - - - - Fetch a named color array into a list. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - The list to hold the returned array. - - - - Get a named float value. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Get a named float value. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Get a named float array. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - - - - Get a named float array. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - - - - Fetch a named float array into a list. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - The list to hold the returned array. - - - - Fetch a named float array into a list. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - The list to hold the returned array. - - - - Get a named integer value. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Get a named integer value. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Get a named matrix value from the shader. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Get a named matrix value from the shader. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Get a named matrix array. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - - - - Get a named matrix array. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - - - - Fetch a named matrix array into a list. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - The list to hold the returned array. - - - - Fetch a named matrix array into a list. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - The list to hold the returned array. - - - - Returns the name of the shader pass at index pass. - - - - - - Checks whether a given Shader pass is enabled on this Material. - - Shader pass name (case insensitive). - - True if the Shader pass is enabled. - - - - - Get the value of material's shader tag. - - - - - - - - Get the value of material's shader tag. - - - - - - - - Get a named texture. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Get a named texture. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Gets the placement offset of texture propertyName. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Gets the placement offset of texture propertyName. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Return the name IDs of all texture properties exposed on this material. - - IDs of all texture properties exposed on this material. - - IDs of all texture properties exposed on this material. - - - - - Return the name IDs of all texture properties exposed on this material. - - IDs of all texture properties exposed on this material. - - IDs of all texture properties exposed on this material. - - - - - Returns the names of all texture properties exposed on this material. - - Names of all texture properties exposed on this material. - - Names of all texture properties exposed on this material. - - - - - Returns the names of all texture properties exposed on this material. - - Names of all texture properties exposed on this material. - - Names of all texture properties exposed on this material. - - - - - Gets the placement scale of texture propertyName. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Gets the placement scale of texture propertyName. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Get a named vector value. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Get a named vector value. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Get a named vector array. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - - - - Get a named vector array. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - - - - Fetch a named vector array into a list. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - The list to hold the returned array. - - - - Fetch a named vector array into a list. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - The list to hold the returned array. - - - - Checks if material's shader has a property of a given name. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Checks if material's shader has a property of a given name. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Is the shader keyword enabled on this material? - - - - - - Interpolate properties between two materials. - - - - - - - - Sets a named buffer value. - - Property name ID, use Shader.PropertyToID to get it. - Property name. - The ComputeBuffer or GraphicsBuffer value to set. - - - - Sets a named buffer value. - - Property name ID, use Shader.PropertyToID to get it. - Property name. - The ComputeBuffer or GraphicsBuffer value to set. - - - - Sets a named buffer value. - - Property name ID, use Shader.PropertyToID to get it. - Property name. - The ComputeBuffer or GraphicsBuffer value to set. - - - - Sets a named buffer value. - - Property name ID, use Shader.PropertyToID to get it. - Property name. - The ComputeBuffer or GraphicsBuffer value to set. - - - - Sets a named color value. - - Property name ID, use Shader.PropertyToID to get it. - Property name, e.g. "_Color". - Color value to set. - - - - Sets a named color value. - - Property name ID, use Shader.PropertyToID to get it. - Property name, e.g. "_Color". - Color value to set. - - - - Sets a color array property. - - Property name. - Property name ID, use Shader.PropertyToID to get it. - Array of values to set. - - - - Sets a color array property. - - Property name. - Property name ID, use Shader.PropertyToID to get it. - Array of values to set. - - - - Sets a color array property. - - Property name. - Property name ID, use Shader.PropertyToID to get it. - Array of values to set. - - - - Sets a color array property. - - Property name. - Property name ID, use Shader.PropertyToID to get it. - Array of values to set. - - - - Sets a ComputeBuffer or GraphicsBuffer as a named constant buffer for the material. - - The name of the constant buffer to override. - The ComputeBuffer to override the constant buffer values with, or null to remove binding. - Offset in bytes from the beginning of the buffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0. - The number of bytes to bind. - The shader property ID of the constant buffer to override. - - - - Sets a ComputeBuffer or GraphicsBuffer as a named constant buffer for the material. - - The name of the constant buffer to override. - The ComputeBuffer to override the constant buffer values with, or null to remove binding. - Offset in bytes from the beginning of the buffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0. - The number of bytes to bind. - The shader property ID of the constant buffer to override. - - - - Sets a ComputeBuffer or GraphicsBuffer as a named constant buffer for the material. - - The name of the constant buffer to override. - The ComputeBuffer to override the constant buffer values with, or null to remove binding. - Offset in bytes from the beginning of the buffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0. - The number of bytes to bind. - The shader property ID of the constant buffer to override. - - - - Sets a ComputeBuffer or GraphicsBuffer as a named constant buffer for the material. - - The name of the constant buffer to override. - The ComputeBuffer to override the constant buffer values with, or null to remove binding. - Offset in bytes from the beginning of the buffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0. - The number of bytes to bind. - The shader property ID of the constant buffer to override. - - - - Sets a named float value. - - Property name ID, use Shader.PropertyToID to get it. - Float value to set. - Property name, e.g. "_Glossiness". - - - - Sets a named float value. - - Property name ID, use Shader.PropertyToID to get it. - Float value to set. - Property name, e.g. "_Glossiness". - - - - Sets a float array property. - - Property name. - Property name ID. Use Shader.PropertyToID to get this ID. - Array of values to set. - - - - Sets a float array property. - - Property name. - Property name ID. Use Shader.PropertyToID to get this ID. - Array of values to set. - - - - Sets a float array property. - - Property name. - Property name ID. Use Shader.PropertyToID to get this ID. - Array of values to set. - - - - Sets a float array property. - - Property name. - Property name ID. Use Shader.PropertyToID to get this ID. - Array of values to set. - - - - Sets a named integer value. - - Property name ID, use Shader.PropertyToID to get it. - Integer value to set. - Property name, e.g. "_SrcBlend". - - - - Sets a named integer value. - - Property name ID, use Shader.PropertyToID to get it. - Integer value to set. - Property name, e.g. "_SrcBlend". - - - - Sets a named matrix for the shader. - - Property name ID, use Shader.PropertyToID to get it. - Property name, e.g. "_CubemapRotation". - Matrix value to set. - - - - Sets a named matrix for the shader. - - Property name ID, use Shader.PropertyToID to get it. - Property name, e.g. "_CubemapRotation". - Matrix value to set. - - - - Sets a matrix array property. - - Property name. - Array of values to set. - Property name ID, use Shader.PropertyToID to get it. - - - - Sets a matrix array property. - - Property name. - Array of values to set. - Property name ID, use Shader.PropertyToID to get it. - - - - Sets a matrix array property. - - Property name. - Array of values to set. - Property name ID, use Shader.PropertyToID to get it. - - - - Sets a matrix array property. - - Property name. - Array of values to set. - Property name ID, use Shader.PropertyToID to get it. - - - - Sets an override tag/value on the material. - - Name of the tag to set. - Name of the value to set. Empty string to clear the override flag. - - - - Activate the given pass for rendering. - - Shader pass number to setup. - - If false is returned, no rendering should be done. - - - - - Enables or disables a Shader pass on a per-Material level. - - Shader pass name (case insensitive). - Flag indicating whether this Shader pass should be enabled. - - - - Sets a named texture. - - Property name ID, use Shader.PropertyToID to get it. - Property name, e.g. "_MainTex". - Texture to set. - Optional parameter that specifies the type of data to set from the RenderTexture. - - - - Sets a named texture. - - Property name ID, use Shader.PropertyToID to get it. - Property name, e.g. "_MainTex". - Texture to set. - Optional parameter that specifies the type of data to set from the RenderTexture. - - - - Sets a named texture. - - Property name ID, use Shader.PropertyToID to get it. - Property name, e.g. "_MainTex". - Texture to set. - Optional parameter that specifies the type of data to set from the RenderTexture. - - - - Sets a named texture. - - Property name ID, use Shader.PropertyToID to get it. - Property name, e.g. "_MainTex". - Texture to set. - Optional parameter that specifies the type of data to set from the RenderTexture. - - - - Sets the placement offset of texture propertyName. - - Property name ID, use Shader.PropertyToID to get it. - Property name, for example: "_MainTex". - Texture placement offset. - - - - Sets the placement offset of texture propertyName. - - Property name ID, use Shader.PropertyToID to get it. - Property name, for example: "_MainTex". - Texture placement offset. - - - - Sets the placement scale of texture propertyName. - - Property name ID, use Shader.PropertyToID to get it. - Property name, e.g. "_MainTex". - Texture placement scale. - - - - Sets the placement scale of texture propertyName. - - Property name ID, use Shader.PropertyToID to get it. - Property name, e.g. "_MainTex". - Texture placement scale. - - - - Sets a named vector value. - - Property name ID, use Shader.PropertyToID to get it. - Property name, e.g. "_WaveAndDistance". - Vector value to set. - - - - Sets a named vector value. - - Property name ID, use Shader.PropertyToID to get it. - Property name, e.g. "_WaveAndDistance". - Vector value to set. - - - - Sets a vector array property. - - Property name. - Array of values to set. - Property name ID, use Shader.PropertyToID to get it. - - - - Sets a vector array property. - - Property name. - Array of values to set. - Property name ID, use Shader.PropertyToID to get it. - - - - Sets a vector array property. - - Property name. - Array of values to set. - Property name ID, use Shader.PropertyToID to get it. - - - - Sets a vector array property. - - Property name. - Array of values to set. - Property name ID, use Shader.PropertyToID to get it. - - - - How the material interacts with lightmaps and lightprobes. - - - - - Helper Mask to be used to query the enum only based on whether realtime GI or baked GI is set, ignoring all other bits. - - - - - The emissive lighting affects baked Global Illumination. It emits lighting into baked lightmaps and baked lightprobes. - - - - - The emissive lighting is guaranteed to be black. This lets the lightmapping system know that it doesn't have to extract emissive lighting information from the material and can simply assume it is completely black. - - - - - The emissive lighting does not affect Global Illumination at all. - - - - - The emissive lighting will affect realtime Global Illumination. It emits lighting into realtime lightmaps and realtime lightprobes. - - - - - A block of material values to apply. - - - - - Is the material property block empty? (Read Only) - - - - - Clear material property values. - - - - - This function copies the entire source array into a Vector4 property array named unity_ProbesOcclusion for use with instanced rendering. - - The array of probe occlusion values to copy from. - - - - This function copies the entire source array into a Vector4 property array named unity_ProbesOcclusion for use with instanced rendering. - - The array of probe occlusion values to copy from. - - - - This function copies the source array into a Vector4 property array named unity_ProbesOcclusion with the specified source and destination range for use with instanced rendering. - - The array of probe occlusion values to copy from. - The index of the first element in the source array to copy from. - The index of the first element in the destination MaterialPropertyBlock array to copy to. - The number of elements to copy. - - - - This function copies the source array into a Vector4 property array named unity_ProbesOcclusion with the specified source and destination range for use with instanced rendering. - - The array of probe occlusion values to copy from. - The index of the first element in the source array to copy from. - The index of the first element in the destination MaterialPropertyBlock array to copy to. - The number of elements to copy. - - - - This function converts and copies the entire source array into 7 Vector4 property arrays named unity_SHAr, unity_SHAg, unity_SHAb, unity_SHBr, unity_SHBg, unity_SHBb and unity_SHC for use with instanced rendering. - - The array of SH values to copy from. - - - - This function converts and copies the entire source array into 7 Vector4 property arrays named unity_SHAr, unity_SHAg, unity_SHAb, unity_SHBr, unity_SHBg, unity_SHBb and unity_SHC for use with instanced rendering. - - The array of SH values to copy from. - - - - This function converts and copies the source array into 7 Vector4 property arrays named unity_SHAr, unity_SHAg, unity_SHAb, unity_SHBr, unity_SHBg, unity_SHBb and unity_SHC with the specified source and destination range for use with instanced rendering. - - The array of SH values to copy from. - The index of the first element in the source array to copy from. - The index of the first element in the destination MaterialPropertyBlock array to copy to. - The number of elements to copy. - - - - This function converts and copies the source array into 7 Vector4 property arrays named unity_SHAr, unity_SHAg, unity_SHAb, unity_SHBr, unity_SHBg, unity_SHBb and unity_SHC with the specified source and destination range for use with instanced rendering. - - The array of SH values to copy from. - The index of the first element in the source array to copy from. - The index of the first element in the destination MaterialPropertyBlock array to copy to. - The number of elements to copy. - - - - Get a color from the property block. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Get a color from the property block. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Get a float from the property block. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Get a float from the property block. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Get a float array from the property block. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Get a float array from the property block. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Fetch a float array from the property block into a list. - - The list to hold the returned array. - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Fetch a float array from the property block into a list. - - The list to hold the returned array. - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Get an int from the property block. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Get an int from the property block. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Get a matrix from the property block. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Get a matrix from the property block. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Get a matrix array from the property block. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Get a matrix array from the property block. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Fetch a matrix array from the property block into a list. - - The list to hold the returned array. - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Fetch a matrix array from the property block into a list. - - The list to hold the returned array. - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Get a texture from the property block. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Get a texture from the property block. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Get a vector from the property block. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Get a vector from the property block. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Get a vector array from the property block. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Get a vector array from the property block. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Fetch a vector array from the property block into a list. - - The list to hold the returned array. - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Fetch a vector array from the property block into a list. - - The list to hold the returned array. - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Set a buffer property. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - The ComputeBuffer or GraphicsBuffer to set. - - - - Set a buffer property. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - The ComputeBuffer or GraphicsBuffer to set. - - - - Set a buffer property. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - The ComputeBuffer or GraphicsBuffer to set. - - - - Set a buffer property. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - The ComputeBuffer or GraphicsBuffer to set. - - - - Set a color property. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - The Color value to set. - - - - Set a color property. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - The Color value to set. - - - - Sets a ComputeBuffer or GraphicsBuffer as a named constant buffer for the MaterialPropertyBlock. - - The name of the constant buffer to override. - The buffer to override the constant buffer values with. - Offset in bytes from the beginning of the buffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0. - The number of bytes to bind. - The shader property ID of the constant buffer to override. - - - - Sets a ComputeBuffer or GraphicsBuffer as a named constant buffer for the MaterialPropertyBlock. - - The name of the constant buffer to override. - The buffer to override the constant buffer values with. - Offset in bytes from the beginning of the buffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0. - The number of bytes to bind. - The shader property ID of the constant buffer to override. - - - - Sets a ComputeBuffer or GraphicsBuffer as a named constant buffer for the MaterialPropertyBlock. - - The name of the constant buffer to override. - The buffer to override the constant buffer values with. - Offset in bytes from the beginning of the buffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0. - The number of bytes to bind. - The shader property ID of the constant buffer to override. - - - - Sets a ComputeBuffer or GraphicsBuffer as a named constant buffer for the MaterialPropertyBlock. - - The name of the constant buffer to override. - The buffer to override the constant buffer values with. - Offset in bytes from the beginning of the buffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0. - The number of bytes to bind. - The shader property ID of the constant buffer to override. - - - - Set a float property. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - The float value to set. - - - - Set a float property. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - The float value to set. - - - - Set a float array property. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - The array to set. - - - - Set a float array property. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - The array to set. - - - - Set a float array property. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - The array to set. - - - - Set a float array property. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - The array to set. - - - - Adds a property to the block. If an int property with the given name already exists, the old value is replaced. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - The int value to set. - - - - Adds a property to the block. If an int property with the given name already exists, the old value is replaced. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - The int value to set. - - - - Set a matrix property. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - The matrix value to set. - - - - Set a matrix property. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - The matrix value to set. - - - - Set a matrix array property. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - The array to set. - - - - Set a matrix array property. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - The array to set. - - - - Set a matrix array property. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - The array to set. - - - - Set a matrix array property. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - The array to set. - - - - Set a texture property. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - The Texture to set. - Optional parameter that specifies the type of data to set from the RenderTexture. - - - - Set a texture property. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - The Texture to set. - Optional parameter that specifies the type of data to set from the RenderTexture. - - - - Set a texture property. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - The Texture to set. - Optional parameter that specifies the type of data to set from the RenderTexture. - - - - Set a texture property. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - The Texture to set. - Optional parameter that specifies the type of data to set from the RenderTexture. - - - - Set a vector property. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - The Vector4 value to set. - - - - Set a vector property. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - The Vector4 value to set. - - - - Set a vector array property. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - The array to set. - - - - Set a vector array property. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - The array to set. - - - - Set a vector array property. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - The array to set. - - - - Set a vector array property. - - The name of the property. - The name ID of the property retrieved by Shader.PropertyToID. - The array to set. - - - - A collection of common math functions. - - - - - Returns the absolute value of f. - - - - - - Returns the absolute value of value. - - - - - - Returns the arc-cosine of f - the angle in radians whose cosine is f. - - - - - - Compares two floating point values and returns true if they are similar. - - - - - - - Returns the arc-sine of f - the angle in radians whose sine is f. - - - - - - Returns the arc-tangent of f - the angle in radians whose tangent is f. - - - - - - Returns the angle in radians whose Tan is y/x. - - - - - - - Returns the smallest integer greater to or equal to f. - - - - - - Returns the smallest integer greater to or equal to f. - - - - - - Clamps the given value between the given minimum float and maximum float values. Returns the given value if it is within the min and max range. - - The floating point value to restrict inside the range defined by the min and max values. - The minimum floating point value to compare against. - The maximum floating point value to compare against. - - The float result between the min and max values. - - - - - Clamps the given value between a range defined by the given minimum integer and maximum integer values. Returns the given value if it is within min and max. - - The integer point value to restrict inside the min-to-max range - The minimum integer point value to compare against. - The maximum integer point value to compare against. - - The int result between min and max values. - - - - - Clamps value between 0 and 1 and returns value. - - - - - - Returns the closest power of two value. - - - - - - Convert a color temperature in Kelvin to RGB color. - - Temperature in Kelvin. Range 1000 to 40000 Kelvin. - - Correlated Color Temperature as floating point RGB color. - - - - - Returns the cosine of angle f. - - The input angle, in radians. - - The return value between -1 and 1. - - - - - Degrees-to-radians conversion constant (Read Only). - - - - - Calculates the shortest difference between two given angles given in degrees. - - - - - - - A tiny floating point value (Read Only). - - - - - Returns e raised to the specified power. - - - - - - Encode a floating point value into a 16-bit representation. - - The floating point value to convert. - - The converted half-precision float, stored in a 16-bit unsigned integer. - - - - - Returns the largest integer smaller than or equal to f. - - - - - - Returns the largest integer smaller to or equal to f. - - - - - - Converts the given value from gamma (sRGB) to linear color space. - - - - - - Convert a half precision float to a 32-bit floating point value. - - The half precision value to convert. - - The decoded 32-bit float. - - - - - A representation of positive infinity (Read Only). - - - - - Calculates the linear parameter t that produces the interpolant value within the range [a, b]. - - Start value. - End value. - Value between start and end. - - Percentage of value between start and end. - - - - - Returns true if the value is power of two. - - - - - - Linearly interpolates between a and b by t. - - The start value. - The end value. - The interpolation value between the two floats. - - The interpolated float result between the two float values. - - - - - Same as Lerp but makes sure the values interpolate correctly when they wrap around 360 degrees. - - - - - - - - Linearly interpolates between a and b by t with no limit to t. - - The start value. - The end value. - The interpolation between the two floats. - - The float value as a result from the linear interpolation. - - - - - Converts the given value from linear to gamma (sRGB) color space. - - - - - - Returns the logarithm of a specified number in a specified base. - - - - - - - Returns the natural (base e) logarithm of a specified number. - - - - - - Returns the base 10 logarithm of a specified number. - - - - - - Returns largest of two or more values. - - - - - - - - Returns largest of two or more values. - - - - - - - - Returns the largest of two or more values. - - - - - - - - Returns the largest of two or more values. - - - - - - - - Returns the smallest of two or more values. - - - - - - - - Returns the smallest of two or more values. - - - - - - - - Returns the smallest of two or more values. - - - - - - - - Returns the smallest of two or more values. - - - - - - - - Moves a value current towards target. - - The current value. - The value to move towards. - The maximum change that should be applied to the value. - - - - Same as MoveTowards but makes sure the values interpolate correctly when they wrap around 360 degrees. - - - - - - - - A representation of negative infinity (Read Only). - - - - - Returns the next power of two that is equal to, or greater than, the argument. - - - - - - Generate 2D Perlin noise. - - X-coordinate of sample point. - Y-coordinate of sample point. - - Value between 0.0 and 1.0. (Return value might be slightly below 0.0 or beyond 1.0.) - - - - - The well-known 3.14159265358979... value (Read Only). - - - - - PingPong returns a value that will increment and decrement between the value 0 and length. - - - - - - - Returns f raised to power p. - - - - - - - Radians-to-degrees conversion constant (Read Only). - - - - - Loops the value t, so that it is never larger than length and never smaller than 0. - - - - - - - Returns f rounded to the nearest integer. - - - - - - Returns f rounded to the nearest integer. - - - - - - Returns the sign of f. - - - - - - Returns the sine of angle f. - - The input angle, in radians. - - The return value between -1 and +1. - - - - - Gradually changes a value towards a desired goal over time. - - The current position. - The position we are trying to reach. - The current velocity, this value is modified by the function every time you call it. - Approximately the time it will take to reach the target. A smaller value will reach the target faster. - Optionally allows you to clamp the maximum speed. - The time since the last call to this function. By default Time.deltaTime. - - - - Gradually changes a value towards a desired goal over time. - - The current position. - The position we are trying to reach. - The current velocity, this value is modified by the function every time you call it. - Approximately the time it will take to reach the target. A smaller value will reach the target faster. - Optionally allows you to clamp the maximum speed. - The time since the last call to this function. By default Time.deltaTime. - - - - Gradually changes a value towards a desired goal over time. - - The current position. - The position we are trying to reach. - The current velocity, this value is modified by the function every time you call it. - Approximately the time it will take to reach the target. A smaller value will reach the target faster. - Optionally allows you to clamp the maximum speed. - The time since the last call to this function. By default Time.deltaTime. - - - - Gradually changes an angle given in degrees towards a desired goal angle over time. - - The current position. - The position we are trying to reach. - The current velocity, this value is modified by the function every time you call it. - Approximately the time it will take to reach the target. A smaller value will reach the target faster. - Optionally allows you to clamp the maximum speed. - The time since the last call to this function. By default Time.deltaTime. - - - - Gradually changes an angle given in degrees towards a desired goal angle over time. - - The current position. - The position we are trying to reach. - The current velocity, this value is modified by the function every time you call it. - Approximately the time it will take to reach the target. A smaller value will reach the target faster. - Optionally allows you to clamp the maximum speed. - The time since the last call to this function. By default Time.deltaTime. - - - - Gradually changes an angle given in degrees towards a desired goal angle over time. - - The current position. - The position we are trying to reach. - The current velocity, this value is modified by the function every time you call it. - Approximately the time it will take to reach the target. A smaller value will reach the target faster. - Optionally allows you to clamp the maximum speed. - The time since the last call to this function. By default Time.deltaTime. - - - - Interpolates between min and max with smoothing at the limits. - - - - - - - - Returns square root of f. - - - - - - Returns the tangent of angle f in radians. - - - - - - A standard 4x4 transformation matrix. - - - - - This property takes a projection matrix and returns the six plane coordinates that define a projection frustum. - - - - - The determinant of the matrix. (Read Only) - - - - - Returns the identity matrix (Read Only). - - - - - The inverse of this matrix. (Read Only) - - - - - Checks whether this is an identity matrix. (Read Only) - - - - - Attempts to get a scale value from the matrix. (Read Only) - - - - - Attempts to get a rotation quaternion from this matrix. - - - - - Returns the transpose of this matrix (Read Only). - - - - - Returns a matrix with all elements set to zero (Read Only). - - - - - This function returns a projection matrix with viewing frustum that has a near plane defined by the coordinates that were passed in. - - The X coordinate of the left side of the near projection plane in view space. - The X coordinate of the right side of the near projection plane in view space. - The Y coordinate of the bottom side of the near projection plane in view space. - The Y coordinate of the top side of the near projection plane in view space. - Z distance to the near plane from the origin in view space. - Z distance to the far plane from the origin in view space. - Frustum planes struct that contains the view space coordinates of that define a viewing frustum. - - - A projection matrix with a viewing frustum defined by the plane coordinates passed in. - - - - - This function returns a projection matrix with viewing frustum that has a near plane defined by the coordinates that were passed in. - - The X coordinate of the left side of the near projection plane in view space. - The X coordinate of the right side of the near projection plane in view space. - The Y coordinate of the bottom side of the near projection plane in view space. - The Y coordinate of the top side of the near projection plane in view space. - Z distance to the near plane from the origin in view space. - Z distance to the far plane from the origin in view space. - Frustum planes struct that contains the view space coordinates of that define a viewing frustum. - - - A projection matrix with a viewing frustum defined by the plane coordinates passed in. - - - - - Get a column of the matrix. - - - - - - Returns a row of the matrix. - - - - - - Computes the inverse of a 3D affine matrix. - - Input matrix to invert. - The result of the inversion. Equal to the input matrix if the function fails. - - Returns true and a valid result if the function succeeds, false and a copy of the input matrix if the function fails. - - - - - Create a "look at" matrix. - - The source point. - The target point. - The vector describing the up direction (typically Vector3.up). - - The resulting transformation matrix. - - - - - Transforms a position by this matrix (generic). - - - - - - Transforms a position by this matrix (fast). - - - - - - Transforms a direction by this matrix. - - - - - - Multiplies two matrices. - - - - - - - Transforms a Vector4 by a matrix. - - - - - - - Create an orthogonal projection matrix. - - Left-side x-coordinate. - Right-side x-coordinate. - Bottom y-coordinate. - Top y-coordinate. - Near depth clipping plane value. - Far depth clipping plane value. - - The projection matrix. - - - - - Create a perspective projection matrix. - - Vertical field-of-view in degrees. - Aspect ratio (width divided by height). - Near depth clipping plane value. - Far depth clipping plane value. - - The projection matrix. - - - - - Creates a rotation matrix. - - - - - - Creates a scaling matrix. - - - - - - Sets a column of the matrix. - - - - - - - Sets a row of the matrix. - - - - - - - Sets this matrix to a translation, rotation and scaling matrix. - - - - - - - - Access element at [row, column]. - - - - - Access element at sequential index (0..15 inclusive). - - - - - Returns a formatted string for this matrix. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Returns a formatted string for this matrix. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Returns a formatted string for this matrix. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Returns a plane that is transformed in space. - - - - - - Creates a translation matrix. - - - - - - Creates a translation, rotation and scaling matrix. - - - - - - - - Checks if this matrix is a valid transform matrix. - - - - - A class that allows creating or modifying meshes from scripts. - - - - - The bind poses. The bind pose at each index refers to the bone with the same index. - - - - - Returns BlendShape count on this mesh. - - - - - The BoneWeight for each vertex in the Mesh, which represents 4 bones per vertex. - - - - - The bounding volume of the Mesh. - - - - - Vertex colors of the Mesh. - - - - - Vertex colors of the Mesh. - - - - - Format of the mesh index buffer data. - - - - - Returns true if the Mesh is read/write enabled, or false if it is not. - - - - - The normals of the Mesh. - - - - - The number of sub-meshes inside the Mesh object. - - - - - The tangents of the Mesh. - - - - - An array containing all triangles in the Mesh. - - - - - The base texture coordinates of the Mesh. - - - - - The second texture coordinate set of the mesh, if present. - - - - - The third texture coordinate set of the mesh, if present. - - - - - The fourth texture coordinate set of the mesh, if present. - - - - - The fifth texture coordinate set of the mesh, if present. - - - - - The sixth texture coordinate set of the mesh, if present. - - - - - The seventh texture coordinate set of the mesh, if present. - - - - - The eighth texture coordinate set of the mesh, if present. - - - - - Returns the number of vertex attributes that the mesh has. (Read Only) - - - - - Gets the number of vertex buffers present in the Mesh. (Read Only) - - - - - Returns the number of vertices in the Mesh (Read Only). - - - - - Returns a copy of the vertex positions or assigns a new vertex positions array. - - - - - Gets a snapshot of Mesh data for read-only access. - - The input mesh. - The input meshes. - - Returns a MeshDataArray containing read-only MeshData structs. See Mesh.MeshDataArray and Mesh.MeshData. - - - - - Gets a snapshot of Mesh data for read-only access. - - The input mesh. - The input meshes. - - Returns a MeshDataArray containing read-only MeshData structs. See Mesh.MeshDataArray and Mesh.MeshData. - - - - - Gets a snapshot of Mesh data for read-only access. - - The input mesh. - The input meshes. - - Returns a MeshDataArray containing read-only MeshData structs. See Mesh.MeshDataArray and Mesh.MeshData. - - - - - Adds a new blend shape frame. - - Name of the blend shape to add a frame to. - Weight for the frame being added. - Delta vertices for the frame being added. - Delta normals for the frame being added. - Delta tangents for the frame being added. - - - - Allocates data structures for Mesh creation using C# Jobs. - - The amount of meshes that will be created. - - Returns a MeshDataArray containing writeable MeshData structs. See Mesh.MeshDataArray and Mesh.MeshData. - - - - - Applies data defined in MeshData structs to Mesh objects. - - The mesh data array, see Mesh.MeshDataArray. - The destination Mesh. Mesh data array must be of size 1. - The destination Meshes. Must match the size of mesh data array. - The mesh data update flags, see MeshUpdateFlags. - - - - Applies data defined in MeshData structs to Mesh objects. - - The mesh data array, see Mesh.MeshDataArray. - The destination Mesh. Mesh data array must be of size 1. - The destination Meshes. Must match the size of mesh data array. - The mesh data update flags, see MeshUpdateFlags. - - - - Applies data defined in MeshData structs to Mesh objects. - - The mesh data array, see Mesh.MeshDataArray. - The destination Mesh. Mesh data array must be of size 1. - The destination Meshes. Must match the size of mesh data array. - The mesh data update flags, see MeshUpdateFlags. - - - - Clears all vertex data and all triangle indices. - - True if the existing Mesh data layout should be preserved. - - - - Clears all vertex data and all triangle indices. - - True if the existing Mesh data layout should be preserved. - - - - Clears all blend shapes from Mesh. - - - - - Combines several Meshes into this Mesh. - - Descriptions of the Meshes to combine. - Defines whether Meshes should be combined into a single sub-mesh. - Defines whether the transforms supplied in the CombineInstance array should be used or ignored. - - - - - Combines several Meshes into this Mesh. - - Descriptions of the Meshes to combine. - Defines whether Meshes should be combined into a single sub-mesh. - Defines whether the transforms supplied in the CombineInstance array should be used or ignored. - - - - - Combines several Meshes into this Mesh. - - Descriptions of the Meshes to combine. - Defines whether Meshes should be combined into a single sub-mesh. - Defines whether the transforms supplied in the CombineInstance array should be used or ignored. - - - - - Combines several Meshes into this Mesh. - - Descriptions of the Meshes to combine. - Defines whether Meshes should be combined into a single sub-mesh. - Defines whether the transforms supplied in the CombineInstance array should be used or ignored. - - - - - Creates an empty Mesh. - - - - - Gets the bone weights for the Mesh. - - - Returns all non-zero bone weights for the Mesh, in vertex index order. - - - - - Gets the base vertex index of the given sub-mesh. - - The sub-mesh index. See subMeshCount. - - The offset applied to all vertex indices of this sub-mesh. - - - - - Gets the bind poses of the Mesh. - - A list of bind poses to populate. - - - - Returns the frame count for a blend shape. - - The shape index to get frame count from. - - - - Retreives deltaVertices, deltaNormals and deltaTangents of a blend shape frame. - - The shape index of the frame. - The frame index to get the weight from. - Delta vertices output array for the frame being retreived. - Delta normals output array for the frame being retreived. - Delta tangents output array for the frame being retreived. - - - - Returns the weight of a blend shape frame. - - The shape index of the frame. - The frame index to get the weight from. - - - - Returns index of BlendShape by given name. - - - - - - Returns name of BlendShape by given index. - - - - - - The number of non-zero bone weights for each vertex. - - - Returns the number of non-zero bone weights for each vertex. - - - - - Gets the bone weights for the Mesh. - - A list of BoneWeight structs to populate. - - - - Gets the vertex colors of the Mesh. - - A list of vertex colors to populate. - - - - Gets the vertex colors of the Mesh. - - A list of vertex colors to populate. - - - - Gets the index count of the given sub-mesh. - - - - - - Gets the starting index location within the Mesh's index buffer, for the given sub-mesh. - - - - - - Fetches the index list for the specified sub-mesh. - - The sub-mesh index. See subMeshCount. - True (default value) will apply base vertex offset to returned indices. - - Array with face indices. - - - - - Fetches the index list for the specified sub-mesh. - - The sub-mesh index. See subMeshCount. - True (default value) will apply base vertex offset to returned indices. - - Array with face indices. - - - - - Use this method overload if you control the life cycle of the list passed in and you want to avoid allocating a new array with every access. - - A list of indices to populate. - The sub-mesh index. See subMeshCount. - True (default value) will apply base vertex offset to returned indices. - - - - Use this method overload if you control the life cycle of the list passed in and you want to avoid allocating a new array with every access. - - A list of indices to populate. - The sub-mesh index. See subMeshCount. - True (default value) will apply base vertex offset to returned indices. - - - - Use this method overload if you control the life cycle of the list passed in and you want to avoid allocating a new array with every access. - - A list of indices to populate. - The sub-mesh index. See subMeshCount. - True (default value) will apply base vertex offset to returned indices. - - - - Retrieves a native (underlying graphics API) pointer to the index buffer. - - - Pointer to the underlying graphics API index buffer. - - - - - Retrieves a native (underlying graphics API) pointer to the vertex buffer. - - Which vertex buffer to get (some Meshes might have more than one). See vertexBufferCount. - - - Pointer to the underlying graphics API vertex buffer. - - - - - Gets the vertex normals of the Mesh. - - A list of vertex normals to populate. - - - - Get information about a sub-mesh of the Mesh. - - Sub-mesh index. See subMeshCount. Out of range indices throw an exception. - - Sub-mesh data. - - - - - Gets the tangents of the Mesh. - - A list of tangents to populate. - - - - Gets the topology of a sub-mesh. - - - - - - Fetches the triangle list for the specified sub-mesh on this object. - - A list of vertex indices to populate. - The sub-mesh index. See subMeshCount. - True (default value) will apply base vertex offset to returned indices. - - - - Fetches the triangle list for the specified sub-mesh on this object. - - A list of vertex indices to populate. - The sub-mesh index. See subMeshCount. - True (default value) will apply base vertex offset to returned indices. - - - - Fetches the triangle list for the specified sub-mesh on this object. - - A list of vertex indices to populate. - The sub-mesh index. See subMeshCount. - True (default value) will apply base vertex offset to returned indices. - - - - Fetches the triangle list for the specified sub-mesh on this object. - - A list of vertex indices to populate. - The sub-mesh index. See subMeshCount. - True (default value) will apply base vertex offset to returned indices. - - - - Fetches the triangle list for the specified sub-mesh on this object. - - A list of vertex indices to populate. - The sub-mesh index. See subMeshCount. - True (default value) will apply base vertex offset to returned indices. - - - - The UV distribution metric can be used to calculate the desired mipmap level based on the position of the camera. - - UV set index to return the UV distibution metric for. 0 for first. - - Average of triangle area / uv area. - - - - - Gets the UVs of the Mesh. - - The UV channel, in [0..7] range. Indices start at 0, which corresponds to uv. Note that 1 corresponds to uv2. - A list of UVs to populate. - - - - Gets the UVs of the Mesh. - - The UV channel, in [0..7] range. Indices start at 0, which corresponds to uv. Note that 1 corresponds to uv2. - A list of UVs to populate. - - - - Gets the UVs of the Mesh. - - The UV channel, in [0..7] range. Indices start at 0, which corresponds to uv. Note that 1 corresponds to uv2. - A list of UVs to populate. - - - - Returns information about a vertex attribute based on its index. - - The vertex attribute index (0 to vertexAttributeCount-1). - - Information about the vertex attribute. - - - - - Get dimension of a specific vertex data attribute on this Mesh. - - Vertex data attribute to check for. - - Dimensionality of the data attribute, or zero if it is not present. - - - - - Get format of a specific vertex data attribute on this Mesh. - - Vertex data attribute to check for. - - Format of the data attribute. - - - - - Get information about vertex attributes of a Mesh. - - - Array of vertex attribute information. - - - - - Get information about vertex attributes of a Mesh, without memory allocations. - - Collection of vertex attributes to receive the results. - - The number of vertex attributes returned in the attributes container. - - - - - Get information about vertex attributes of a Mesh, without memory allocations. - - Collection of vertex attributes to receive the results. - - The number of vertex attributes returned in the attributes container. - - - - - Gets the vertex positions of the Mesh. - - A list of vertex positions to populate. - - - - Checks if a specific vertex data attribute exists on this Mesh. - - Vertex data attribute to check for. - - Returns true if the data attribute is present in the mesh. - - - - - Optimize mesh for frequent updates. - - - - - Notify Renderer components of mesh geometry change. - - - - - A struct containing Mesh data for C# Job System access. - - - - - Gets the format of the index buffer data in the MeshData. (Read Only) - - - - - The number of sub-meshes in the MeshData. - - - - - Gets the number of vertex buffers in the MeshData. (Read Only) - - - - - Gets the number of vertices in the MeshData. (Read Only) - - - - - Populates an array with the vertex colors from the MeshData. - - The destination vertex colors array. - - - - Populates an array with the vertex colors from the MeshData. - - The destination vertex colors array. - - - - Gets raw data from the index buffer of the MeshData. - - - Returns a NativeArray containing the index buffer data. - - - - - Populates an array with the indices for a given sub-mesh from the MeshData. - - The destination indices array. - The index of the sub-mesh to get the indices for. See Mesh.MeshData.subMeshCount|subMeshCount. - If true, Unity will apply base vertex offset to the returned indices. The default value is true. - - - - Populates an array with the indices for a given sub-mesh from the MeshData. - - The destination indices array. - The index of the sub-mesh to get the indices for. See Mesh.MeshData.subMeshCount|subMeshCount. - If true, Unity will apply base vertex offset to the returned indices. The default value is true. - - - - Populates an array with the vertex normals from the MeshData. - - The destination vertex normals array. - - - - Gets data about a given sub-mesh in the MeshData. - - The index of the sub-mesh. See Mesh.MeshData.subMeshCount|subMeshCount. If you specify an out of range index, Unity throws an exception. - - Returns sub-mesh data. - - - - - Populates an array with the vertex tangents from the MeshData. - - The destination vertex tangents array. - - - - Populates an array with the UVs from the MeshData. - - The UV channel, in [0..7] range. - The destination texture coordinates array. - - - - Populates an array with the UVs from the MeshData. - - The UV channel, in [0..7] range. - The destination texture coordinates array. - - - - Populates an array with the UVs from the MeshData. - - The UV channel, in [0..7] range. - The destination texture coordinates array. - - - - Gets the dimension of a given vertex attribute in the MeshData. - - The vertex attribute to get the dimension of. - - Returns the dimension of the vertex attribute. Returns 0 if the vertex attribute is not present. - - - - - Gets the format of a given vertex attribute in the MeshData. - - The vertex attribute to check the format of. - - Returns the format of the given vertex attribute. - - - - - Gets raw data for a given vertex buffer stream format in the MeshData. - - The vertex buffer stream to get data for. The default value is 0. - - Returns a NativeArray containing the vertex buffer data. - - - - - Populates an array with the vertex positions from the MeshData. - - The destination vertex positions array. - - - - Checks if a given vertex attribute exists in the MeshData. - - The vertex attribute to check for. - - Returns true if the data attribute is present in the Mesh. Returns false if it is not. - - - - - Sets the index buffer size and format of the Mesh that Unity creates from the MeshData. - - The size of the index buffer. - The format of the indices. - - - - Sets the data for a sub-mesh of the Mesh that Unity creates from the MeshData. - - The index of the sub-mesh to set data for. See Mesh.MeshData.subMeshCount|subMeshCount. If you specify an out of range index, Unity throws an exception. - Sub-mesh data. - Flags controlling the function behavior. See MeshUpdateFlags. - - - - Sets the vertex buffer size and layout of the Mesh that Unity creates from the MeshData. - - The number of vertices in the Mesh. - Layout of the vertex data: which attributes are present, their data types and so on. - - - - Sets the vertex buffer size and layout of the Mesh that Unity creates from the MeshData. - - The number of vertices in the Mesh. - Layout of the vertex data: which attributes are present, their data types and so on. - - - - An array of Mesh data snapshots for C# Job System access. - - - - - Use this method to dispose of the MeshDataArray struct. - - - - - Number of Mesh data elements in the MeshDataArray. - - - - - Access MeshDataArray element by an index. - - - - - Optimizes the Mesh data to improve rendering performance. - - - - - Optimizes the geometry of the Mesh to improve rendering performance. - - - - - Optimizes the vertices of the Mesh to improve rendering performance. - - - - - Recalculate the bounding volume of the Mesh from the vertices. - - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Recalculate the bounding volume of the Mesh from the vertices. - - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Recalculates the normals of the Mesh from the triangles and vertices. - - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Recalculates the normals of the Mesh from the triangles and vertices. - - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Recalculates the tangents of the Mesh from the normals and texture coordinates. - - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Recalculates the tangents of the Mesh from the normals and texture coordinates. - - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Recalculates the UV distribution metric of the Mesh from the vertices and uv coordinates. - - The UV set index to set the UV distibution metric for. Use 0 for first index. - The minimum UV area to consider. The default value is 1e-9f. - - - - Recalculates the UV distribution metrics of the Mesh from the vertices and uv coordinates. - - The minimum UV area to consider. The default value is 1e-9f. - - - - Sets the bone weights for the Mesh. - - Bone count for each vertex in the Mesh. - BoneWeight1 structs for each vertex, sorted by vertex index. - - - - Set the per-vertex colors of the Mesh. - - Per-vertex colors. - - - - Set the per-vertex colors of the Mesh. - - Per-vertex colors. - - - - Set the per-vertex colors of the Mesh. - - Per-vertex colors. - - - - Set the per-vertex colors of the Mesh. - - Per-vertex colors. - - - - Set the per-vertex colors of the Mesh. - - Per-vertex colors. - - - - Sets the per-vertex colors of the Mesh, using a part of the input array. - - Per-vertex colors. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the per-vertex colors of the Mesh, using a part of the input array. - - Per-vertex colors. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the per-vertex colors of the Mesh, using a part of the input array. - - Per-vertex colors. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the per-vertex colors of the Mesh, using a part of the input array. - - Per-vertex colors. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the per-vertex colors of the Mesh, using a part of the input array. - - Per-vertex colors. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the per-vertex colors of the Mesh, using a part of the input array. - - Per-vertex colors. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the per-vertex colors of the Mesh, using a part of the input array. - - Per-vertex colors. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the per-vertex colors of the Mesh, using a part of the input array. - - Per-vertex colors. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the per-vertex colors of the Mesh, using a part of the input array. - - Per-vertex colors. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the per-vertex colors of the Mesh, using a part of the input array. - - Per-vertex colors. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the data of the index buffer of the Mesh. - - Index buffer data array. - The first element in the data to copy from. - The first element in the mesh index buffer to receive the data. - Count of indices to copy. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the data of the index buffer of the Mesh. - - Index buffer data array. - The first element in the data to copy from. - The first element in the mesh index buffer to receive the data. - Count of indices to copy. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the data of the index buffer of the Mesh. - - Index buffer data array. - The first element in the data to copy from. - The first element in the mesh index buffer to receive the data. - Count of indices to copy. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the data of the index buffer of the Mesh. - - Index buffer data array. - The first element in the data to copy from. - The first element in the mesh index buffer to receive the data. - Count of indices to copy. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the data of the index buffer of the Mesh. - - Index buffer data array. - The first element in the data to copy from. - The first element in the mesh index buffer to receive the data. - Count of indices to copy. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the data of the index buffer of the Mesh. - - Index buffer data array. - The first element in the data to copy from. - The first element in the mesh index buffer to receive the data. - Count of indices to copy. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the index buffer size and format. - - Size of index buffer. - Format of the indices. - - - - Sets the index buffer for the sub-mesh. - - The array of indices that define the mesh faces. - The topology of the Mesh, e.g: Triangles, Lines, Quads, Points, etc. See MeshTopology. - The sub-mesh to modify. - Calculate the bounding box of the Mesh after setting the indices. This is done by default. -Use false when you want to use the existing bounding box and reduce the CPU cost of setting the indices. - Optional vertex offset that is added to all vertex indices. - - - - Sets the index buffer for the sub-mesh. - - The array of indices that define the mesh faces. - The topology of the Mesh, e.g: Triangles, Lines, Quads, Points, etc. See MeshTopology. - The sub-mesh to modify. - Calculate the bounding box of the Mesh after setting the indices. This is done by default. -Use false when you want to use the existing bounding box and reduce the CPU cost of setting the indices. - Optional vertex offset that is added to all vertex indices. - - - - Sets the index buffer for the sub-mesh. - - The array of indices that define the mesh faces. - The topology of the Mesh, e.g: Triangles, Lines, Quads, Points, etc. See MeshTopology. - The sub-mesh to modify. - Calculate the bounding box of the Mesh after setting the indices. This is done by default. -Use false when you want to use the existing bounding box and reduce the CPU cost of setting the indices. - Optional vertex offset that is added to all vertex indices. - - - - Sets the index buffer for the sub-mesh. - - The array of indices that define the mesh faces. - The topology of the Mesh, e.g: Triangles, Lines, Quads, Points, etc. See MeshTopology. - The sub-mesh to modify. - Calculate the bounding box of the Mesh after setting the indices. This is done by default. -Use false when you want to use the existing bounding box and reduce the CPU cost of setting the indices. - Optional vertex offset that is added to all vertex indices. - - - - Sets the index buffer for the sub-mesh. - - The array of indices that define the mesh faces. - The topology of the Mesh, e.g: Triangles, Lines, Quads, Points, etc. See MeshTopology. - The sub-mesh to modify. - Calculate the bounding box of the Mesh after setting the indices. This is done by default. -Use false when you want to use the existing bounding box and reduce the CPU cost of setting the indices. - Optional vertex offset that is added to all vertex indices. - - - - Sets the index buffer for the sub-mesh. - - The array of indices that define the mesh faces. - The topology of the Mesh, e.g: Triangles, Lines, Quads, Points, etc. See MeshTopology. - The sub-mesh to modify. - Calculate the bounding box of the Mesh after setting the indices. This is done by default. -Use false when you want to use the existing bounding box and reduce the CPU cost of setting the indices. - Optional vertex offset that is added to all vertex indices. - - - - Sets the index buffer for the sub-mesh. - - The array of indices that define the mesh faces. - The topology of the Mesh, e.g: Triangles, Lines, Quads, Points, etc. See MeshTopology. - The sub-mesh to modify. - Calculate the bounding box of the Mesh after setting the indices. This is done by default. -Use false when you want to use the existing bounding box and reduce the CPU cost of setting the indices. - Optional vertex offset that is added to all vertex indices. - - - - Sets the index buffer of a sub-mesh, using a part of the input array. - - The array of indices that define the mesh faces. - Index of the first element to take from the input array. - Number of elements to take from the input array. - The topology of the Mesh, e.g: Triangles, Lines, Quads, Points, etc. See MeshTopology. - The sub-mesh to modify. - Calculate the bounding box of the Mesh after setting the indices. This is done by default. -Use false when you want to use the existing bounding box and reduce the CPU cost of setting the indices. - Optional vertex offset that is added to all vertex indices. - - - - Sets the index buffer of a sub-mesh, using a part of the input array. - - The array of indices that define the mesh faces. - Index of the first element to take from the input array. - Number of elements to take from the input array. - The topology of the Mesh, e.g: Triangles, Lines, Quads, Points, etc. See MeshTopology. - The sub-mesh to modify. - Calculate the bounding box of the Mesh after setting the indices. This is done by default. -Use false when you want to use the existing bounding box and reduce the CPU cost of setting the indices. - Optional vertex offset that is added to all vertex indices. - - - - Sets the index buffer of a sub-mesh, using a part of the input array. - - The array of indices that define the mesh faces. - Index of the first element to take from the input array. - Number of elements to take from the input array. - The topology of the Mesh, e.g: Triangles, Lines, Quads, Points, etc. See MeshTopology. - The sub-mesh to modify. - Calculate the bounding box of the Mesh after setting the indices. This is done by default. -Use false when you want to use the existing bounding box and reduce the CPU cost of setting the indices. - Optional vertex offset that is added to all vertex indices. - - - - Sets the index buffer of a sub-mesh, using a part of the input array. - - The array of indices that define the mesh faces. - Index of the first element to take from the input array. - Number of elements to take from the input array. - The topology of the Mesh, e.g: Triangles, Lines, Quads, Points, etc. See MeshTopology. - The sub-mesh to modify. - Calculate the bounding box of the Mesh after setting the indices. This is done by default. -Use false when you want to use the existing bounding box and reduce the CPU cost of setting the indices. - Optional vertex offset that is added to all vertex indices. - - - - Sets the index buffer of a sub-mesh, using a part of the input array. - - The array of indices that define the mesh faces. - Index of the first element to take from the input array. - Number of elements to take from the input array. - The topology of the Mesh, e.g: Triangles, Lines, Quads, Points, etc. See MeshTopology. - The sub-mesh to modify. - Calculate the bounding box of the Mesh after setting the indices. This is done by default. -Use false when you want to use the existing bounding box and reduce the CPU cost of setting the indices. - Optional vertex offset that is added to all vertex indices. - - - - Set the normals of the Mesh. - - Per-vertex normals. - - - - Set the normals of the Mesh. - - Per-vertex normals. - - - - Set the normals of the Mesh. - - Per-vertex normals. - - - - Sets the vertex normals of the Mesh, using a part of the input array. - - Per-vertex normals. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the vertex normals of the Mesh, using a part of the input array. - - Per-vertex normals. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the vertex normals of the Mesh, using a part of the input array. - - Per-vertex normals. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the vertex normals of the Mesh, using a part of the input array. - - Per-vertex normals. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the vertex normals of the Mesh, using a part of the input array. - - Per-vertex normals. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the vertex normals of the Mesh, using a part of the input array. - - Per-vertex normals. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the information about a sub-mesh of the Mesh. - - Sub-mesh index. See subMeshCount. Out of range indices throw an exception. - Sub-mesh data. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the information about a sub-mesh of the Mesh. - - Sub-mesh index. See subMeshCount. Out of range indices throw an exception. - Sub-mesh data. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets information defining all sub-meshes in this Mesh, replacing any existing sub-meshes. - - An array or list of sub-mesh data descriptors. - Index of the first element to take from the array or list in desc. - Number of elements to take from the array or list in desc. - (Optional) Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets information defining all sub-meshes in this Mesh, replacing any existing sub-meshes. - - An array or list of sub-mesh data descriptors. - Index of the first element to take from the array or list in desc. - Number of elements to take from the array or list in desc. - (Optional) Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets information defining all sub-meshes in this Mesh, replacing any existing sub-meshes. - - An array or list of sub-mesh data descriptors. - Index of the first element to take from the array or list in desc. - Number of elements to take from the array or list in desc. - (Optional) Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets information defining all sub-meshes in this Mesh, replacing any existing sub-meshes. - - An array or list of sub-mesh data descriptors. - Index of the first element to take from the array or list in desc. - Number of elements to take from the array or list in desc. - (Optional) Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets information defining all sub-meshes in this Mesh, replacing any existing sub-meshes. - - An array or list of sub-mesh data descriptors. - Index of the first element to take from the array or list in desc. - Number of elements to take from the array or list in desc. - (Optional) Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets information defining all sub-meshes in this Mesh, replacing any existing sub-meshes. - - An array or list of sub-mesh data descriptors. - Index of the first element to take from the array or list in desc. - Number of elements to take from the array or list in desc. - (Optional) Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets information defining all sub-meshes in this Mesh, replacing any existing sub-meshes. - - An array or list of sub-mesh data descriptors. - Index of the first element to take from the array or list in desc. - Number of elements to take from the array or list in desc. - (Optional) Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets information defining all sub-meshes in this Mesh, replacing any existing sub-meshes. - - An array or list of sub-mesh data descriptors. - Index of the first element to take from the array or list in desc. - Number of elements to take from the array or list in desc. - (Optional) Flags controlling the function behavior, see MeshUpdateFlags. - - - - Set the tangents of the Mesh. - - Per-vertex tangents. - - - - Set the tangents of the Mesh. - - Per-vertex tangents. - - - - Set the tangents of the Mesh. - - Per-vertex tangents. - - - - Sets the tangents of the Mesh, using a part of the input array. - - Per-vertex tangents. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the tangents of the Mesh, using a part of the input array. - - Per-vertex tangents. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the tangents of the Mesh, using a part of the input array. - - Per-vertex tangents. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the tangents of the Mesh, using a part of the input array. - - Per-vertex tangents. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the tangents of the Mesh, using a part of the input array. - - Per-vertex tangents. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the tangents of the Mesh, using a part of the input array. - - Per-vertex tangents. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the triangle list for the sub-mesh. - - The list of indices that define the triangles. - The sub-mesh to modify. - Calculate the bounding box of the Mesh after setting the triangles. This is done by default. -Use false when you want to use the existing bounding box and reduce the CPU cost of setting the triangles. - Optional vertex offset that is added to all triangle vertex indices. - - - - Sets the triangle list for the sub-mesh. - - The list of indices that define the triangles. - The sub-mesh to modify. - Calculate the bounding box of the Mesh after setting the triangles. This is done by default. -Use false when you want to use the existing bounding box and reduce the CPU cost of setting the triangles. - Optional vertex offset that is added to all triangle vertex indices. - - - - Sets the triangle list for the sub-mesh. - - The list of indices that define the triangles. - The sub-mesh to modify. - Calculate the bounding box of the Mesh after setting the triangles. This is done by default. -Use false when you want to use the existing bounding box and reduce the CPU cost of setting the triangles. - Optional vertex offset that is added to all triangle vertex indices. - - - - Sets the triangle list for the sub-mesh. - - The list of indices that define the triangles. - The sub-mesh to modify. - Calculate the bounding box of the Mesh after setting the triangles. This is done by default. -Use false when you want to use the existing bounding box and reduce the CPU cost of setting the triangles. - Optional vertex offset that is added to all triangle vertex indices. - - - - Sets the triangle list for the sub-mesh. - - The list of indices that define the triangles. - The sub-mesh to modify. - Calculate the bounding box of the Mesh after setting the triangles. This is done by default. -Use false when you want to use the existing bounding box and reduce the CPU cost of setting the triangles. - Optional vertex offset that is added to all triangle vertex indices. - - - - Sets the triangle list for the sub-mesh. - - The list of indices that define the triangles. - The sub-mesh to modify. - Calculate the bounding box of the Mesh after setting the triangles. This is done by default. -Use false when you want to use the existing bounding box and reduce the CPU cost of setting the triangles. - Optional vertex offset that is added to all triangle vertex indices. - - - - Sets the triangle list for the sub-mesh. - - The list of indices that define the triangles. - The sub-mesh to modify. - Calculate the bounding box of the Mesh after setting the triangles. This is done by default. -Use false when you want to use the existing bounding box and reduce the CPU cost of setting the triangles. - Optional vertex offset that is added to all triangle vertex indices. - - - - Sets the triangle list for the sub-mesh. - - The list of indices that define the triangles. - The sub-mesh to modify. - Calculate the bounding box of the Mesh after setting the triangles. This is done by default. -Use false when you want to use the existing bounding box and reduce the CPU cost of setting the triangles. - Optional vertex offset that is added to all triangle vertex indices. - - - - Sets the triangle list of the Mesh, using a part of the input array. - - The list of indices that define the triangles. - Index of the first element to take from the input array. - Number of elements to take from the input array. - The sub-mesh to modify. - Calculate the bounding box of the Mesh after setting the triangles. This is done by default. -Use false when you want to use the existing bounding box and reduce the CPU cost of setting the triangles. - Optional vertex offset that is added to all triangle vertex indices. - - - - Sets the triangle list of the Mesh, using a part of the input array. - - The list of indices that define the triangles. - Index of the first element to take from the input array. - Number of elements to take from the input array. - The sub-mesh to modify. - Calculate the bounding box of the Mesh after setting the triangles. This is done by default. -Use false when you want to use the existing bounding box and reduce the CPU cost of setting the triangles. - Optional vertex offset that is added to all triangle vertex indices. - - - - Sets the triangle list of the Mesh, using a part of the input array. - - The list of indices that define the triangles. - Index of the first element to take from the input array. - Number of elements to take from the input array. - The sub-mesh to modify. - Calculate the bounding box of the Mesh after setting the triangles. This is done by default. -Use false when you want to use the existing bounding box and reduce the CPU cost of setting the triangles. - Optional vertex offset that is added to all triangle vertex indices. - - - - Sets the triangle list of the Mesh, using a part of the input array. - - The list of indices that define the triangles. - Index of the first element to take from the input array. - Number of elements to take from the input array. - The sub-mesh to modify. - Calculate the bounding box of the Mesh after setting the triangles. This is done by default. -Use false when you want to use the existing bounding box and reduce the CPU cost of setting the triangles. - Optional vertex offset that is added to all triangle vertex indices. - - - - Sets the UVs of the Mesh. - - The UV channel, in [0..7] range. Indices start at 0, which corresponds to uv. Note that 1 corresponds to uv2. - UVs to set for the given index. - - - - Sets the UVs of the Mesh. - - The UV channel, in [0..7] range. Indices start at 0, which corresponds to uv. Note that 1 corresponds to uv2. - UVs to set for the given index. - - - - Sets the UVs of the Mesh. - - The UV channel, in [0..7] range. Indices start at 0, which corresponds to uv. Note that 1 corresponds to uv2. - UVs to set for the given index. - - - - Sets the UVs of the Mesh. - - The UV channel, in [0..7] range. Indices start at 0, which corresponds to uv. Note that 1 corresponds to uv2. - UVs to set for the given index. - - - - Sets the UVs of the Mesh. - - The UV channel, in [0..7] range. Indices start at 0, which corresponds to uv. Note that 1 corresponds to uv2. - UVs to set for the given index. - - - - Sets the UVs of the Mesh. - - The UV channel, in [0..7] range. Indices start at 0, which corresponds to uv. Note that 1 corresponds to uv2. - UVs to set for the given index. - - - - Sets the UVs of the Mesh. - - The UV channel, in [0..7] range. Indices start at 0, which corresponds to uv. Note that 1 corresponds to uv2. - UVs to set for the given index. - - - - Sets the UVs of the Mesh, using a part of the input array. - - The UV channel, in [0..7] range. - UVs to set for the given index. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the UVs of the Mesh, using a part of the input array. - - The UV channel, in [0..7] range. - UVs to set for the given index. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the UVs of the Mesh, using a part of the input array. - - The UV channel, in [0..7] range. - UVs to set for the given index. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the UVs of the Mesh, using a part of the input array. - - The UV channel, in [0..7] range. - UVs to set for the given index. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the UVs of the Mesh, using a part of the input array. - - The UV channel, in [0..7] range. - UVs to set for the given index. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the UVs of the Mesh, using a part of the input array. - - The UV channel, in [0..7] range. - UVs to set for the given index. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the UVs of the Mesh, using a part of the input array. - - The UV channel, in [0..7] range. - UVs to set for the given index. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the UVs of the Mesh, using a part of the input array. - - The UV channel, in [0..7] range. - UVs to set for the given index. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the UVs of the Mesh, using a part of the input array. - - The UV channel, in [0..7] range. - UVs to set for the given index. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the UVs of the Mesh, using a part of the input array. - - The UV channel, in [0..7] range. - UVs to set for the given index. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the UVs of the Mesh, using a part of the input array. - - The UV channel, in [0..7] range. - UVs to set for the given index. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the UVs of the Mesh, using a part of the input array. - - The UV channel, in [0..7] range. - UVs to set for the given index. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the UVs of the Mesh, using a part of the input array. - - The UV channel, in [0..7] range. - UVs to set for the given index. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the UVs of the Mesh, using a part of the input array. - - The UV channel, in [0..7] range. - UVs to set for the given index. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the data of the vertex buffer of the Mesh. - - Vertex data array. - The first element in the data to copy from. - The first element in mesh vertex buffer to receive the data. - Number of vertices to copy. - Vertex buffer stream to set data for (default 0). - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the data of the vertex buffer of the Mesh. - - Vertex data array. - The first element in the data to copy from. - The first element in mesh vertex buffer to receive the data. - Number of vertices to copy. - Vertex buffer stream to set data for (default 0). - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the data of the vertex buffer of the Mesh. - - Vertex data array. - The first element in the data to copy from. - The first element in mesh vertex buffer to receive the data. - Number of vertices to copy. - Vertex buffer stream to set data for (default 0). - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the data of the vertex buffer of the Mesh. - - Vertex data array. - The first element in the data to copy from. - The first element in mesh vertex buffer to receive the data. - Number of vertices to copy. - Vertex buffer stream to set data for (default 0). - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the data of the vertex buffer of the Mesh. - - Vertex data array. - The first element in the data to copy from. - The first element in mesh vertex buffer to receive the data. - Number of vertices to copy. - Vertex buffer stream to set data for (default 0). - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the data of the vertex buffer of the Mesh. - - Vertex data array. - The first element in the data to copy from. - The first element in mesh vertex buffer to receive the data. - Number of vertices to copy. - Vertex buffer stream to set data for (default 0). - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the vertex buffer size and layout. - - The number of vertices in the Mesh. - Layout of the vertex data -- which attributes are present, their data types and so on. - - - - Sets the vertex buffer size and layout. - - The number of vertices in the Mesh. - Layout of the vertex data -- which attributes are present, their data types and so on. - - - - Assigns a new vertex positions array. - - Per-vertex positions. - - - - Assigns a new vertex positions array. - - Per-vertex positions. - - - - Assigns a new vertex positions array. - - Per-vertex positions. - - - - Sets the vertex positions of the Mesh, using a part of the input array. - - Per-vertex positions. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the vertex positions of the Mesh, using a part of the input array. - - Per-vertex positions. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the vertex positions of the Mesh, using a part of the input array. - - Per-vertex positions. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the vertex positions of the Mesh, using a part of the input array. - - Per-vertex positions. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the vertex positions of the Mesh, using a part of the input array. - - Per-vertex positions. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Sets the vertex positions of the Mesh, using a part of the input array. - - Per-vertex positions. - Index of the first element to take from the input array. - Number of elements to take from the input array. - Flags controlling the function behavior, see MeshUpdateFlags. - - - - Upload previously done Mesh modifications to the graphics API. - - Frees up system memory copy of mesh data when set to true. - - - - A mesh collider allows you to do between meshes and primitives. - - - - - Use a convex collider from the mesh. - - - - - Options used to enable or disable certain features in mesh cooking. - - - - - Allow the physics engine to increase the volume of the input mesh in attempt to generate a valid convex mesh. - - - - - The mesh object used for collision detection. - - - - - Used when set to inflateMesh to determine how much inflation is acceptable. - - - - - Uses interpolated normals for sphere collisions instead of flat polygonal normals. - - - - - Cooking options that are available with MeshCollider. - - - - - Toggle between cooking for faster simulation or faster cooking time. - - - - - Toggle cleaning of the mesh. - - - - - Allow the physics engine to increase the volume of the input mesh in attempt to generate a valid convex mesh. - - - - - No optional cooking steps will be run. - - - - - Determines whether to use the fast midphase structure that doesn't require R-trees (only available on Desktop targets). - - - - - Toggle the removal of equal vertices. - - - - - A class to access the Mesh of the. - - - - - Returns the instantiated Mesh assigned to the mesh filter. - - - - - Returns the shared mesh of the mesh filter. - - - - - Renders meshes inserted by the MeshFilter or TextMesh. - - - - - Vertex attributes in this mesh will override or add attributes of the primary mesh in the MeshRenderer. - - - - - Vertex attributes in this mesh will override or add attributes of the primary mesh and the additionalVertexStreams in the MeshRenderer. - - - - - Determines how the object will receive global illumination. (Editor only) - - - - - Specifies the relative lightmap resolution of this object. (Editor only) - - - - - When enabled, seams in baked lightmaps will get smoothed. (Editor only) - - - - - Index of the first sub-mesh to use from the Mesh associated with this MeshRenderer (Read Only). - - - - - Topology of Mesh faces. - - - - - Mesh is made from lines. - - - - - Mesh is a line strip. - - - - - Mesh is made from points. - - - - - Mesh is made from quads. - - - - - Mesh is made from triangles. - - - - - Use this class to record to an AudioClip using a connected microphone. - - - - - A list of available microphone devices, identified by name. - - - - - Stops recording. - - The name of the device. - - - - Get the frequency capabilities of a device. - - The name of the device. - Returns the minimum sampling frequency of the device. - Returns the maximum sampling frequency of the device. - - - - Get the position in samples of the recording. - - The name of the device. - - - - Query if a device is currently recording. - - The name of the device. - - - - Start Recording with device. - - The name of the device. - Indicates whether the recording should continue recording if lengthSec is reached, and wrap around and record from the beginning of the AudioClip. - Is the length of the AudioClip produced by the recording. - The sample rate of the AudioClip produced by the recording. - - The function returns null if the recording fails to start. - - - - - Attribute used to make a float or int variable in a script be restricted to a specific minimum value. - - - - - The minimum allowed value. - - - - - Attribute used to make a float or int variable in a script be restricted to a specific minimum value. - - The minimum allowed value. - - - - Enum describing what lighting mode to be used with Mixed lights. - - - - - Mixed lights provide realtime direct lighting while indirect light is baked into lightmaps and light probes. - - - - - Mixed lights provide realtime direct lighting. Indirect lighting gets baked into lightmaps and light probes. Shadowmasks and light probe occlusion get generated for baked shadows. The Shadowmask Mode used at run time can be set in the Quality Settings panel. - - - - - Mixed lights provide baked direct and indirect lighting for static objects. Dynamic objects receive realtime direct lighting and cast shadows on static objects using the main directional light in the Scene. - - - - - MonoBehaviour is the base class from which every Unity script derives. - - - - - Logs message to the Unity Console (identical to Debug.Log). - - - - - - Allow a specific instance of a MonoBehaviour to run in edit mode (only available in the editor). - - - - - Disabling this lets you skip the GUI layout phase. - - - - - Cancels all Invoke calls on this MonoBehaviour. - - - - - Cancels all Invoke calls with name methodName on this behaviour. - - - - - - Invokes the method methodName in time seconds. - - - - - - - Invokes the method methodName in time seconds, then repeatedly every repeatRate seconds. - - - - - - - - Is any invoke on methodName pending? - - - - - - Is any invoke pending on this MonoBehaviour? - - - - - Starts a Coroutine. - - - - - - Starts a coroutine named methodName. - - - - - - - Starts a coroutine named methodName. - - - - - - - Stops all coroutines running on this behaviour. - - - - - Stops the first coroutine named methodName, or the coroutine stored in routine running on this behaviour. - - Name of coroutine. - Name of the function in code, including coroutines. - - - - Stops the first coroutine named methodName, or the coroutine stored in routine running on this behaviour. - - Name of coroutine. - Name of the function in code, including coroutines. - - - - Stops the first coroutine named methodName, or the coroutine stored in routine running on this behaviour. - - Name of coroutine. - Name of the function in code, including coroutines. - - - - Base class for AnimationClips and BlendTrees. - - - - - The type of motion vectors that should be generated. - - - - - Use only camera movement to track motion. - - - - - Do not track motion. Motion vectors will be 0. - - - - - Use a specific pass (if required) to track motion. - - - - - MovieTexture has been removed. Use VideoPlayer instead. - - - - - MovieTexture has been removed. Use VideoPlayer instead. - - - - - MovieTexture has been removed. Use VideoPlayer instead. - - - - - MovieTexture has been removed. Use VideoPlayer instead. - - - - - MovieTexture has been removed. Use VideoPlayer instead. - - - - - MovieTexture has been removed. Use VideoPlayer instead. - - - - - MovieTexture has been removed. Use VideoPlayer instead. - - - - - MovieTexture has been removed. Use VideoPlayer instead. - - - - - MovieTexture has been removed. Use VideoPlayer instead. - - - - - Attribute to make a string be edited with a multi-line textfield. - - - - - Attribute used to make a string value be shown in a multiline textarea. - - How many lines of text to make room for. Default is 3. - - - - Attribute used to make a string value be shown in a multiline textarea. - - How many lines of text to make room for. Default is 3. - - - - The network class is at the heart of the network implementation and provides the core functions. - - - - - All connected players. - - - - - The IP address of the connection tester used in Network.TestConnection. - - - - - The port of the connection tester used in Network.TestConnection. - - - - - Set the password for the server (for incoming connections). - - - - - Returns true if your peer type is client. - - - - - Enable or disable the processing of network messages. - - - - - Returns true if your peer type is server. - - - - - Set the log level for network messages (default is Off). - - - - - Set the maximum amount of connections/players allowed. - - - - - Get or set the minimum number of ViewID numbers in the ViewID pool given to clients by the server. - - - - - The IP address of the NAT punchthrough facilitator. - - - - - The port of the NAT punchthrough facilitator. - - - - - The status of the peer type, i.e. if it is disconnected, connecting, server or client. - - - - - Get the local NetworkPlayer instance. - - - - - The IP address of the proxy server. - - - - - Set the proxy server password. - - - - - The port of the proxy server. - - - - - The default send rate of network updates for all Network Views. - - - - - Get the current network time (seconds). - - - - - Indicate if proxy support is needed, in which case traffic is relayed through the proxy server. - - - - - Query for the next available network view ID number and allocate it (reserve). - - - - - Close the connection to another system. - - - - - - - Connect to the specified host (ip or domain name) and server port. - - - - - - - - Connect to the specified host (ip or domain name) and server port. - - - - - - - - This function is exactly like Network.Connect but can accept an array of IP addresses. - - - - - - - - This function is exactly like Network.Connect but can accept an array of IP addresses. - - - - - - - - Connect to a server GUID. NAT punchthrough can only be performed this way. - - - - - - - Connect to a server GUID. NAT punchthrough can only be performed this way. - - - - - - - Connect to the host represented by a HostData structure returned by the Master Server. - - - - - - - Connect to the host represented by a HostData structure returned by the Master Server. - - - - - - - Destroy the object associated with this view ID across the network. - - - - - - Destroy the object across the network. - - - - - - Destroy all the objects based on view IDs belonging to this player. - - - - - - Close all open connections and shuts down the network interface. - - - - - - Close all open connections and shuts down the network interface. - - - - - - The last average ping time to the given player in milliseconds. - - - - - - The last ping time to the given player in milliseconds. - - - - - - Check if this machine has a public IP address. - - - - - Initializes security layer. - - - - - Initialize the server. - - - - - - - - Initialize the server. - - - - - - - - Network instantiate a Prefab. - - - - - - - - - Remove all RPC functions which belong to this player ID. - - - - - - Remove all RPC functions which belong to this player ID and were sent based on the given group. - - - - - - - Remove the RPC function calls accociated with this view ID number. - - - - - - Remove all RPC functions which belong to given group number. - - - - - - Set the level prefix which will then be prefixed to all network ViewID numbers. - - - - - - Enable or disables the reception of messages in a specific group number from a specific player. - - - - - - - - Enables or disables transmission of messages and RPC calls on a specific network group number. - - - - - - - Enable or disable transmission of messages and RPC calls based on target network player as well as the network group. - - - - - - - - Test this machines network connection. - - - - - - Test this machines network connection. - - - - - - Test the connection specifically for NAT punch-through connectivity. - - - - - - Test the connection specifically for NAT punch-through connectivity. - - - - - - Possible status messages returned by Network.Connect and in MonoBehaviour.OnFailedToConnect|OnFailedToConnect in case the error was not immediate. - - - - - The reason a disconnect event occured, like in MonoBehaviour.OnDisconnectedFromServer|OnDisconnectedFromServer. - - - - - Responsible for rejecting or accepting certificates received on https requests. - - - - - Signals that this [CertificateHandler] is no longer being used, and should clean up any resources it is using. - - - - - Callback, invoked for each leaf certificate sent by the remote server. - - Certificate data in PEM or DER format. If certificate data contains multiple certificates, the first one is the leaf certificate. - - true if the certificate should be accepted, false if not. - - - - - Defines parameters of channels. - - - - - Returns true if the channel belongs to a shared group. - - - - - UnderlyingModel.MemDoc.MemDocModel. - - Requested type of quality of service (default Unreliable). - Copy constructor. - - - - UnderlyingModel.MemDoc.MemDocModel. - - Requested type of quality of service (default Unreliable). - Copy constructor. - - - - UnderlyingModel.MemDoc.MemDocModel. - - Requested type of quality of service (default Unreliable). - Copy constructor. - - - - Channel quality of service. - - - - - Defines size of the buffer holding reliable messages, before they will be acknowledged. - - - - - Ack buffer can hold 128 messages. - - - - - Ack buffer can hold 32 messages. - - - - - Ack buffer can hold 64 messages. - - - - - Ack buffer can hold 96 messages. - - - - - This class defines parameters of connection between two peers, this definition includes various timeouts and sizes as well as channel configuration. - - - - - Defines the duration in milliseconds that the receiver waits for before it sends an acknowledgement back without waiting for any data payload. Default value = 33. - -Network clients that send data to a server may do so using many different quality of service (QOS) modes, some of which (reliable modes) expect the server to send back acknowledgement of receipt of data sent. - -Servers must periodically acknowledge data packets received over channels with reliable QOS modes by sending packets containing acknowledgement data (also known as "acks") back to the client. If the server were to send an acknowledgement immediately after receiving each packet from the client there would be significant overhead (the acknowledgement is a 32 or 64 bit integer, which is very small compared to the whole size of the packet which also contains the IP and the UDP header). AckDelay allows the server some time to accumulate a list of received reliable data packets to acknowledge, and decreases traffic overhead by combining many acknowledgements into a single packet. - - - - - Determines the size of the buffer used to store reliable messages that are waiting for acknowledgement. It can be set to Acks32, Acks64, Acks96, or Acks128. Depends of this setting buffer can hold 32, 64, 96, or 128 messages. Default value = Ack32. - -Messages sent on reliable quality of service channels are stored in a special buffer while they wait for acknowledgement from the peer. This buffer can be either 32, 64, 96 or 128 positions long. It is recommended to begin with this value set to Ack32, which defines a buffer up to 32 messages in size. If you receive NoResources errors often when you send reliable messages, change this value to the next possible size. - - - - - Adds a new channel to the configuration and returns the unique id of that channel. - -Channels are logical delimiters of traffic between peers. Every time you send data to a peer, you should use two ids: connection id and channel id. Channels are not only logically separate traffic but could each be configured with a different quality of service (QOS). In the example below, a configuration is created containing two channels with Unreliable and Reliable QOS types. This configuration is then used for sending data. - - Add new channel to configuration. - - Channel id, user can use this id to send message via this channel. - - - - - Defines the timeout in milliseconds after which messages sent via the AllCost channel will be re-sent without waiting for acknowledgement. Default value = 20 ms. - -AllCost delivery quality of service (QOS) is a special QOS for delivering game-critical information, such as when the game starts, or when bullets are shot. - -Due to packets dropping, sometimes reliable messages cannot be delivered and need to be re-sent. Reliable messages will re-sent after RTT+Delta time, (RTT is round trip time) where RTT is a dynamic value and can reach couple of hundred milliseconds. For the AllCost delivery channel this timeout can be user-defined to force game critical information to be re-sent. - - - - - Defines, when multiplied internally by InitialBandwidth, the maximum bandwidth that can be used under burst conditions. - - - - - (Read Only) The number of channels in the current configuration. - - - - - The list of channels belonging to the current configuration. - -Note: any ConnectionConfig passed as a parameter to a function in Unity Multiplayer is deep copied (that is, an entirely new copy is made, with no references to the original). - - - - - Timeout in ms which library will wait before it will send another connection request. - - - - - Will create default connection config or will copy them from another. - - Connection config. - - - - Will create default connection config or will copy them from another. - - Connection config. - - - - Defines the timeout in milliseconds before a connection is considered to have been disconnected. Default value = 2000. - -Unity Multiplayer defines conditions under which a connection is considered as disconnected. Disconnection can happen for the following reasons: - -(1) A disconnection request was received. - -(2) The connection has not received any traffic at all for a time longer than DisconnectTimeout (Note that live connections receive regular keep-alive packets, so in this case "no traffic" means not only no user traffic but also absence of any keep-alive traffic as well). - -(3) Flow control determines that the time between sending packets is longer than DisconnectTimeout. Keep-alive packets are regularly delivered from peers and contain statistical information. This information includes values of packet loss due to network and peer overflow conditions. Setting NetworkDropThreshold and OverflowDropThreshold defines thresholds for flow control which can decrease packet frequency. When the time before sending the next packet is longer than DisconnectTimeout, the connection will be considered as disconnected and a disconnect event is received. - - - - - Defines the fragment size for fragmented messages (for QOS: ReliableFragmented and UnreliableFragmented). Default value = 500. - -Under fragmented quality of service modes, the original message is split into fragments (up to 64) of up to FragmentSize bytes each. The fragment size depends on the frequency and size of reliable messages sent. Each reliable message potentially could be re-sent, so you need to choose a fragment size less than the remaining free space in a UDP packet after retransmitted reliable messages are added to the packet. For example, if Networking.ConnectionConfig.PacketSize is 1440 bytes, and a reliable message's average size is 200 bytes, it would be wise to set this parameter to 900 – 1000 bytes. - - - - - Return the QoS set for the given channel or throw an out of range exception. - - Index in array. - - Channel QoS. - - - - - Return IList<byte> of channel IDs which belong to the group. - - Group id. - - List of channel IDs belonging to the group. - - - - - Gets or sets the bandwidth in bytes per second that can be used by Unity Multiplayer. No traffic over this limit is allowed. Unity Multiplayer may internally reduce the bandwidth it uses due to flow control. The default value is 1.5MB/sec (1,536,000 bytes per second). The default value is intentionally a large number to allow all traffic to pass without delay. - - - - - Allows you to combine multiple channels into a single group, so those channels share a common receiving order. - - The list of channel indices which should be grouped together. The list can include both reliable and unreliable channels. - - - - Defines the maximum number of small reliable messages that can be included in one combined message. Default value = 10. - -Since each message sent to a server contains IP information and a UDP header, duplicating this information for every message sent can be inefficient in the case where there are many small messages being sent frequently. Many small reliable messages can be combined into one longer reliable message, saving space in the waiting buffer. Unity Multiplayer will automatically combine up to MaxCombinedReliableMessageCount small messages into one message. To qualify as a small message, the data payload of the message should not be greater than MaxCombinedReliableMessageSize. - - - - - Defines the maximum size in bytes of a reliable message which is considered small enough to include in a combined message. Default value = 100. - -Since each message sent to a server contains IP information and a UDP header, duplicating this information for every message sent can be inefficient in the case where there are many small messages being sent frequently. Many small reliable messages can be combined into one longer reliable message, saving space in the waiting buffer. Unity Multiplayer will automatically combine up to MaxCombinedReliableMessageCount small messages into one message. To qualify as a small message, the data payload of the message should not be greater than MaxCombinedReliableMessageSize. - - - - - Defines the maximum number of times Unity Multiplayer will attempt to send a connection request without receiving a response before it reports that it cannot establish a connection. Default value = 10. - - - - - Defines maximum number of messages that can be held in the queue for sending. Default value = 128. - -This buffer serves to smooth spikes in traffic and decreases network jitter. If the queue is full, a NoResources error will result from any calls to Send(). Setting this value greater than around 300 is likely to cause significant delaying of message delivering and can make game unplayable. - - - - - Defines minimum time in milliseconds between sending packets. This duration may be automatically increased if required by flow control. Default value = 10. - -When Send() is called, Unity Multiplayer won’t send the message immediately. Instead, once every SendTimeout milliseconds each connection is checked to see if it has something to send. While initial and minimal send timeouts can be set, these may be increased internally due to network conditions or buffer overflows. - - - - - Defines the percentage (from 0 to 100) of packets that need to be dropped due to network conditions before the SendUpdate timeout is automatically increased (and send rate is automatically decreased). Default value = 5. - -To avoid receiver overflow, Unity Multiplayer supports flow control. Each ping packet sent between connected peers contains two values: - -(1) Packets lost due to network conditions. - -(2) Packets lost because the receiver does not have free space in its incoming buffers. - -Like OverflowDropThreshold, both values are reported in percent. Use NetworkDropThreshold and OverflowDropThreshold to set thresholds for these values. If a value reported in the ping packet exceeds the corresponding threshold, Unity Multiplayer increases the sending timeout for packets up to a maximum value of DisconnectTimeout. - -Note: wireless networks usually exhibit 5% or greater packet loss. For wireless networks it is advisable to use a NetworkDropThreshold of 40-50%. - - - - - Defines the percentage (from 0 to 100) of packets that need to be dropped due to lack of space in internal buffers before the SendUpdate timeout is automatically increased (and send rate is automatically decreased). Default value = 5. - -To avoid receiver overflow, Unity Multiplayer supports flow control. Each ping packet sent between connected peers contains two values: - -(1) Packets lost due to network conditions. - -(2) Packets lost because the receiver does not have free space in its incoming buffers. - -Like NetworkDropThreshold, both values are reported in percent. Use NetworkDropThreshold and OverflowDropThreshold to set thresholds for these values. If a value reported in the ping packet exceeds the corresponding threshold, Unity Multiplayer increases the sending timeout for packets up to a maximum value of DisconnectTimeout. - -Note: wireless networks usually exhibit 5% or greater packet loss. For wireless networks it is advisable to use a NetworkDropThreshold of 40-50%. - - - - - Defines maximum packet size (in bytes) (including payload and all header). Packet can contain multiple messages inside. Default value = 1500. - -Note that this default value is suitable for local testing only. Usually you should change this value; a recommended setting for PC or mobile is 1470. For games consoles this value should probably be less than ~1100. Wrong size definition can cause packet dropping. - - - - - Defines the duration in milliseconds between keep-alive packets, also known as pings. Default value = 500. - -The ping frequency should be long enough to accumulate good statistics and short enough to compare with DisconnectTimeout. A good guideline is to have more than 3 pings per disconnect timeout, and more than 5 messages per ping. For example, with a DisconnectTimeout of 2000ms, a PingTimeout of 500ms works well. - - - - - Defines the maximum wait time in milliseconds before the "not acknowledged" message is re-sent. Default value = 1200. - -It does not make a lot of sense to wait for acknowledgement forever. This parameter sets an upper time limit at which point reliable messages are re-sent. - - - - - Gets or sets the delay in milliseconds after a call to Send() before packets are sent. During this time, new messages may be combined in queued packets. Default value: 10ms. - - - - - (Read Only) The number of shared order groups in current configuration. - - - - - Defines the path to the file containing the certification authority (CA) certificate for WebSocket via SSL communication. - - - - - Defines path to SSL certificate file, for WebSocket via SSL communication. - - - - - Defines the path to the file containing the private key for WebSocket via SSL communication. - - - - - Defines the size in bytes of the receiving buffer for UDP sockets. It is useful to set this parameter equal to the maximum size of a fragmented message. Default value is OS specific (usually 8kb). - - - - - When starting a server use protocols that make use of platform specific optimisations where appropriate rather than cross-platform protocols. (Playstation/Xbox consoles only). - - - - - Validate parameters of connection config. Will throw exceptions if parameters are incorrect. - - - - - - WebSocket only. Defines the buffer size in bytes for received frames on a WebSocket host. If this value is 0 (the default), a 4 kilobyte buffer is used. Any other value results in a buffer of that size, in bytes. - -WebSocket message fragments are called "frames". A WebSocket host has a buffer to store incoming message frames. Therefore this buffer should be set to the largest legal frame size supported. If an incoming frame exceeds the buffer size, no error is reported. However, the buffer will invoke the user callback in order to create space for the overflow. - - - - - Create configuration for network simulator; You can use this class in editor and developer build only. - - - - - Will create object describing network simulation parameters. - - Minimal simulation delay for outgoing traffic in ms. - Average simulation delay for outgoing traffic in ms. - Minimal simulation delay for incoming traffic in ms. - Average simulation delay for incoming traffic in ms. - Probability of packet loss 0 <= p <= 1. - - - - Destructor. - - - - - Manage and process HTTP response body data received from a remote server. - - - - - Returns the raw bytes downloaded from the remote server, or null. (Read Only) - - - - - Error message describing a failure that occurred inside the download handler. - - - - - Returns true if this DownloadHandler has been informed by its parent UnityWebRequest that all data has been received, and this DownloadHandler has completed any necessary post-download processing. (Read Only) - - - - - Convenience property. Returns the bytes from data interpreted as a UTF8 string. (Read Only) - - - - - Callback, invoked when all data has been received from the remote server. - - - - - Signals that this DownloadHandler is no longer being used, and should clean up any resources it is using. - - - - - Callback, invoked when the data property is accessed. - - - Byte array to return as the value of the data property. - - - - - Callback, invoked when UnityWebRequest.downloadProgress is accessed. - - - The return value for UnityWebRequest.downloadProgress. - - - - - Callback, invoked when the text property is accessed. - - - String to return as the return value of the text property. - - - - - Callback, invoked with a Content-Length header is received. - - The value of the received Content-Length header. - - - - Callback, invoked with a Content-Length header is received. - - The value of the received Content-Length header. - - - - Callback, invoked as data is received from the remote server. - - A buffer containing unprocessed data, received from the remote server. - The number of bytes in data which are new. - - True if the download should continue, false to abort. - - - - - A DownloadHandler subclass specialized for downloading AssetBundles. - - - - - Returns the downloaded AssetBundle, or null. (Read Only) - - - - - Standard constructor for non-cached asset bundles. - - The nominal (pre-redirect) URL at which the asset bundle is located. - A checksum to compare to the downloaded data for integrity checking, or zero to skip integrity checking. - - - - Simple versioned constructor. Caches downloaded asset bundles. - - The nominal (pre-redirect) URL at which the asset bundle is located. - A checksum to compare to the downloaded data for integrity checking, or zero to skip integrity checking. - Current version number of the asset bundle at url. Increment to redownload. - - - - Versioned constructor. Caches downloaded asset bundles. - - The nominal (pre-redirect) URL at which the asset bundle is located. - A checksum to compare to the downloaded data for integrity checking, or zero to skip integrity checking. - A hash object defining the version of the asset bundle. - - - - Versioned constructor. Caches downloaded asset bundles to a customized cache path. - - The nominal (pre-redirect) URL at which the asset bundle is located. - A hash object defining the version of the asset bundle. - A checksum to compare to the downloaded data for integrity checking, or zero to skip integrity checking. - A structure used to download a given version of AssetBundle to a customized cache path. - AssetBundle name which is used as the customized cache path. - - - - Versioned constructor. Caches downloaded asset bundles to a customized cache path. - - The nominal (pre-redirect) URL at which the asset bundle is located. - A hash object defining the version of the asset bundle. - A checksum to compare to the downloaded data for integrity checking, or zero to skip integrity checking. - A structure used to download a given version of AssetBundle to a customized cache path. - AssetBundle name which is used as the customized cache path. - - - - Returns the downloaded AssetBundle, or null. - - A finished UnityWebRequest object with DownloadHandlerAssetBundle attached. - - The same as DownloadHandlerAssetBundle.assetBundle - - - - - Not implemented. Throws <a href="http:msdn.microsoft.comen-uslibrarysystem.notsupportedexception">NotSupportedException<a>. - - - Not implemented. - - - - - Not implemented. Throws <a href="http:msdn.microsoft.comen-uslibrarysystem.notsupportedexception">NotSupportedException<a>. - - - Not implemented. - - - - - A DownloadHandler subclass specialized for downloading audio data for use as AudioClip objects. - - - - - Returns the downloaded AudioClip, or null. (Read Only) - - - - - Create AudioClip that is compressed in memory. - - - - - Create streaming AudioClip. - - - - - Constructor, specifies what kind of audio data is going to be downloaded. - - The nominal (pre-redirect) URL at which the audio clip is located. - Value to set for AudioClip type. - - - - Returns the downloaded AudioClip, or null. - - A finished UnityWebRequest object with DownloadHandlerAudioClip attached. - - The same as DownloadHandlerAudioClip.audioClip - - - - - Called by DownloadHandler.data. Returns a copy of the downloaded clip data as raw bytes. - - - A copy of the downloaded data. - - - - - A general-purpose DownloadHandler implementation which stores received data in a native byte buffer. - - - - - Default constructor. - - - - - Returns a copy of the native-memory buffer interpreted as a UTF8 string. - - A finished UnityWebRequest object with DownloadHandlerBuffer attached. - - The same as DownloadHandlerBuffer.text - - - - - Returns a copy of the contents of the native-memory data buffer as a byte array. - - - A copy of the data which has been downloaded. - - - - - Download handler for saving the downloaded data to file. - - - - - Should the created file be removed if download is aborted (manually or due to an error). Default: false. - - - - - Creates a new instance and a file on disk where downloaded data will be written to. - - Path to file to be written. - When true, appends data to the given file instead of overwriting. - - - - Creates a new instance and a file on disk where downloaded data will be written to. - - Path to file to be written. - When true, appends data to the given file instead of overwriting. - - - - MovieTexture has been removed. Use VideoPlayer instead. - - - - - MovieTexture has been removed. Use VideoPlayer instead. - - - - - MovieTexture has been removed. Use VideoPlayer instead. - - - - - MovieTexture has been removed. Use VideoPlayer instead. - - - - - - MovieTexture has been removed. Use VideoPlayer instead. - - - Raw downloaded bytes. - - - - - An abstract base class for user-created scripting-driven DownloadHandler implementations. - - - - - Create a DownloadHandlerScript which allocates new buffers when passing data to callbacks. - - - - - Create a DownloadHandlerScript which reuses a preallocated buffer to pass data to callbacks. - - A byte buffer into which data will be copied, for use by DownloadHandler.ReceiveData. - - - - A DownloadHandler subclass specialized for downloading images for use as Texture objects. - - - - - Returns the downloaded Texture, or null. (Read Only) - - - - - Default constructor. - - - - - Constructor, allows TextureImporter.isReadable property to be set. - - Value to set for TextureImporter.isReadable. - - - - Returns the downloaded Texture, or null. - - A finished UnityWebRequest object with DownloadHandlerTexture attached. - - The same as DownloadHandlerTexture.texture - - - - - Called by DownloadHandler.data. Returns a copy of the downloaded image data as raw bytes. - - - A copy of the downloaded data. - - - - - Defines global paramters for network library. - - - - - Defines the callback delegate which you can use to get a notification when a connection is ready to send data. - - - - - Create new global config object. - - - - - Defines how many hosts you can use. Default Value = 16. Max value = 128. - - - - - Deprecated. Defines maximum delay for network simulator. See Also: MaxTimerTimeout. - - - - - Defines maximum possible packet size in bytes for all network connections. - - - - - Defines the maximum timeout in milliseconds for any configuration. The default value is 12 seconds (12000ms). - - - - - Deprecated. Defines the minimal timeout for network simulator. You cannot set up any delay less than this value. See Also: MinTimerTimeout. - - - - - Defines the minimum timeout in milliseconds recognised by the system. The default value is 1 ms. - - - - - Defines the callback delegate which you can use to get a notification when the host (defined by hostID) has a network event. The callback is called for all event types except Networking.NetworkEventType.Nothing. - -See Also: Networking.NetworkEventType - - - - - This property determines the initial size of the queue that holds messages received by Unity Multiplayer before they are processed. - - - - - Defines the initial size of the send queue. Messages are placed in this queue ready to be sent in packets to their destination. - - - - - Defines reactor model for the network library. - - - - - Defines (1) for select reactor, minimum time period, when system will check if there are any messages for send (2) for fixrate reactor, minimum interval of time, when system will check for sending and receiving messages. - - - - - Defines how many worker threads are available to handle incoming and outgoing messages. - - - - - Class defines network topology for host (socket opened by Networking.NetworkTransport.AddHost function). This topology defines: (1) how many connection with default config will be supported and (2) what will be special connections (connections with config different from default). - - - - - Add special connection to topology (for example if you need to keep connection to standalone chat server you will need to use this function). Returned id should be use as one of parameters (with ip and port) to establish connection to this server. - - Connection config for special connection. - - Id of this connection. You should use this id when you call Networking.NetworkTransport.Connect. - - - - - Create topology. - - Default config. - Maximum default connections. - - - - Defines config for default connections in the topology. - - - - - Return reference to special connection config. Parameters of this config can be changed. - - Config id. - - Connection config. - - - - - Defines how many connection with default config be permitted. - - - - - Defines the maximum number of messages that each host can hold in its pool of received messages. The default size is 128. - - - - - Defines the maximum number of messages that each host can hold in its pool of messages waiting to be sent. The default size is 128. - - - - - List of special connection configs. - - - - - Returns count of special connection added to topology. - - - - - An interface for composition of data into multipart forms. - - - - - Returns the value to use in the Content-Type header for this form section. - - - The value to use in the Content-Type header, or null. - - - - - Returns a string denoting the desired filename of this section on the destination server. - - - The desired file name of this section, or null if this is not a file section. - - - - - Returns the raw binary data contained in this section. Must not return null or a zero-length array. - - - The raw binary data contained in this section. Must not be null or empty. - - - - - Returns the name of this section, if any. - - - The section's name, or null. - - - - - Details about a UNET MatchMaker match. - - - - - The binary access token this client uses to authenticate its session for future commands. - - - - - IP address of the host of the match,. - - - - - The numeric domain for the match. - - - - - The unique ID of this match. - - - - - NodeID for this member client in the match. - - - - - Port of the host of the match. - - - - - This flag indicates whether or not the match is using a Relay server. - - - - - A class describing the match information as a snapshot at the time the request was processed on the MatchMaker. - - - - - The average Elo score of the match. - - - - - The current number of players in the match. - - - - - The collection of direct connect info classes describing direct connection information supplied to the MatchMaker. - - - - - The NodeID of the host for this match. - - - - - Describes if the match is private. Private matches are unlisted in ListMatch results. - - - - - The collection of match attributes on this match. - - - - - The maximum number of players this match can grow to. - - - - - The text name for this match. - - - - - The network ID for this match. - - - - - A class describing one member of a match and what direct connect information other clients have supplied. - - - - - The host priority for this direct connect info. Host priority describes the order in which this match member occurs in the list of clients attached to a match. - - - - - NodeID of the match member this info refers to. - - - - - The private network address supplied for this direct connect info. - - - - - The public network address supplied for this direct connect info. - - - - - A component for communicating with the Unity Multiplayer Matchmaking service. - - - - - The base URI of the MatchMaker that this NetworkMatch will communicate with. - - - - - A delegate that can handle MatchMaker responses that return basic response types (generally only indicating success or failure and extended information if a failure did happen). - - Indicates if the request succeeded. - A text description of the failure if success is false. - - - - Use this function to create a new match. The client which calls this function becomes the host of the match. - - The text string describing the name for this match. - When creating a match, the matchmaker will use either this value, or the maximum size you have configured online at https:multiplayer.unity3d.com, whichever is lower. This way you can specify different match sizes for a particular game, but still maintain an overall size limit in the online control panel. - A bool indicating if this match should be available in NetworkMatch.ListMatches results. - A text string indicating if this match is password protected. If it is, all clients trying to join this match must supply the correct match password. - The optional public client address. This value is stored on the matchmaker and given to clients listing matches. It is intended to be a network address for connecting to this client directly over the internet. This value will only be present if a publicly available address is known, and direct connection is supported by the matchmaker. - The optional private client address. This value is stored on the matchmaker and given to clients listing matches. It is intended to be a network address for connecting to this client directly on a local area network. This value will only be present if direct connection is supported by the matchmaker. This may be an empty string and it will not affect the ability to interface with matchmaker or use relay server. - The Elo score for the client hosting the match being created. If this number is set on all clients to indicate relative skill level, this number is used to return matches ordered by those that are most suitable for play given a listing player's skill level. This may be 0 on all clients, which would disable any Elo calculations in the MatchMaker. - The request domain for this request. Only requests in the same domain can interface with each other. For example if a NetworkMatch.CreateMatch is made with domain 1, only ListMatches that also specify domain 1 will find that match. Use this value to silo different (possibly incompatible) client versions. - The callback to be called when this function completes. This will be called regardless of whether the function succeeds or fails. - - This function is asynchronous and will complete at some point in the future, when the coroutine has finished communicating with the service backend. - - - - - Response delegate containing basic information plus a data member. This is used on a subset of MatchMaker callbacks that require data passed in along with the success/failure information of the call itself. - - Indicates if the request succeeded. - If success is false, this will contain a text string indicating the reason. - The generic passed in containing data required by the callback. This typically contains data returned from a call to the service backend. - - - - This function is used to tell MatchMaker to destroy a match in progress, regardless of who is connected. - - The NetworkID of the match to terminate. - The request domain for this request. Only requests in the same domain can interface with each other. For example if a NetworkMatch.CreateMatch is made with domain 1, only ListMatches that also specify domain 1 will find that match. Use this value to silo different (possibly incompatible) client versions. - The callback to be called when the request completes. - - This function is asynchronous and will complete at some point in the future, when the coroutine has finished communicating with the service backend. - - - - - A function to allow an individual client to be dropped from a match. - - The NetworkID of the match the client to drop belongs to. - The NodeID of the client to drop inside the specified match. - The request domain for this request. Only requests in the same domain can interface with each other. For example if a NetworkMatch.CreateMatch is made with domain 1, only ListMatches that also specify domain 1 will find that match. Use this value to silo different (possibly incompatible) client versions. - The callback to invoke when the request completes. - - This function is asynchronous and will complete at some point in the future, when the coroutine has finished communicating with the service backend. - - - - - The function used to tell MatchMaker the current client wishes to join a specific match. - - The NetworkID of the match to join. This is found through calling NetworkMatch.ListMatches and picking a result from the returned list of matches. - The password of the match. Leave empty if there is no password for the match, and supply the text string password if the match was configured to have one of the NetworkMatch.CreateMatch request. - The optional public client address. This value will be stored on the matchmaker and given to other clients listing matches. You should send this value if you want your players to be able to connect directly with each other over the internet. Alternatively you can pass an empty string and it will not affect the ability to interface with matchmaker or use relay server. - The optional private client address. This value will be stored on the matchmaker and given to other clients listing matches. You should send this value if you want your players to be able to connect directly with each other over a Local Area Network. Alternatively you can pass an empty string and it will not affect the ability to interface with matchmaker or use relay server. - The Elo score for the client joining the match being created. If this number is set on all clients to indicate relative skill level, this number is used to return matches ordered by those that are most suitable for play given a listing player's skill level. This may be 0 on all clients, which would disable any Elo calculations in the MatchMaker. - The request domain for this request. Only requests in the same domain can interface with each other. For example if a NetworkMatch.CreateMatch is made with domain 1, only ListMatches that also specify domain 1 will find that match. Use this value to silo different (possibly incompatible) client versions. - The callback to be invoked when this call completes. - - This function is asynchronous and will complete at some point in the future, when the coroutine has finished communicating with the service backend. - - - - - The function to list ongoing matches in the MatchMaker. - - The current page to list in the return results. - The size of the page requested. This determines the maximum number of matches contained in the list of matches passed into the callback. - The text string name filter. This is a partial wildcard search against match names that are currently active, and can be thought of as matching equivalent to *<matchNameFilter>* where any result containing the entire string supplied here will be in the result set. - Boolean that indicates if the response should contain matches that are private (meaning matches that are password protected). - The Elo score target for the match list results to be grouped around. If used, this should be set to the Elo level of the client listing the matches so results will more closely match that player's skill level. If not used this can be set to 0 along with all other Elo refereces in funcitons like NetworkMatch.CreateMatch or NetworkMatch.JoinMatch. - The request domain for this request. Only requests in the same domain can interface with each other. For example if a NetworkMatch.CreateMatch is made with domain 1, only ListMatches that also specify domain 1 will find that match. Use this value to silo different (possibly incompatible) client versions. - The callback invoked when this call completes on the MatchMaker. - - This function is asynchronous and will complete at some point in the future, when the coroutine has finished communicating with the service backend. - - - - - This function allows the caller to change attributes on a match in progress. - - The NetworkID of the match to set attributes on. - A bool indicating whether the match should be listed in NetworkMatch.ListMatches results after this call is complete. - The request domain for this request. Only requests in the same domain can interface with each other. For example if a NetworkMatch.CreateMatch is made with domain 1, only ListMatches that also specify domain 1 will find that match. Use this value to silo different (possibly incompatible) client versions. - The callback invoked after the call has completed, indicating if it was successful or not. - - This function is asynchronous and will complete at some point in the future, when the coroutine has finished communicating with the service backend. - - - - - This method is deprecated. Please instead log in through the editor services panel and setup the project under the Unity Multiplayer section. This will populate the required infomation from the cloud site automatically. - - Deprecated, see description. - - - - A helper object for form sections containing generic, non-file data. - - - - - Returns the value to use in this section's Content-Type header. - - - The Content-Type header for this section, or null. - - - - - Returns a string denoting the desired filename of this section on the destination server. - - - The desired file name of this section, or null if this is not a file section. - - - - - Returns the raw binary data contained in this section. Will not return null or a zero-length array. - - - The raw binary data contained in this section. Will not be null or empty. - - - - - Returns the name of this section, if any. - - - The section's name, or null. - - - - - Raw data section, unnamed and no Content-Type header. - - Data payload of this section. - - - - Raw data section with a section name, no Content-Type header. - - Section name. - Data payload of this section. - - - - A raw data section with a section name and a Content-Type header. - - Section name. - Data payload of this section. - The value for this section's Content-Type header. - - - - A named raw data section whose payload is derived from a string, with a Content-Type header. - - Section name. - String data payload for this section. - The value for this section's Content-Type header. - An encoding to marshal data to or from raw bytes. - - - - A named raw data section whose payload is derived from a UTF8 string, with a Content-Type header. - - Section name. - String data payload for this section. - C. - - - - A names raw data section whose payload is derived from a UTF8 string, with a default Content-Type. - - Section name. - String data payload for this section. - - - - An anonymous raw data section whose payload is derived from a UTF8 string, with a default Content-Type. - - String data payload for this section. - - - - A helper object for adding file uploads to multipart forms via the [IMultipartFormSection] API. - - - - - Returns the value of the section's Content-Type header. - - - The Content-Type header for this section, or null. - - - - - Returns a string denoting the desired filename of this section on the destination server. - - - The desired file name of this section, or null if this is not a file section. - - - - - Returns the raw binary data contained in this section. Will not return null or a zero-length array. - - - The raw binary data contained in this section. Will not be null or empty. - - - - - Returns the name of this section, if any. - - - The section's name, or null. - - - - - Contains a named file section based on the raw bytes from data, with a custom Content-Type and file name. - - Name of this form section. - Raw contents of the file to upload. - Name of the file uploaded by this form section. - The value for this section's Content-Type header. - - - - Contains an anonymous file section based on the raw bytes from data, assigns a default Content-Type and file name. - - Raw contents of the file to upload. - - - - Contains an anonymous file section based on the raw bytes from data with a specific file name. Assigns a default Content-Type. - - Raw contents of the file to upload. - Name of the file uploaded by this form section. - - - - Contains a named file section with data drawn from data, as marshaled by dataEncoding. Assigns a specific file name from fileName and a default Content-Type. - - Name of this form section. - Contents of the file to upload. - A string encoding. - Name of the file uploaded by this form section. - - - - An anonymous file section with data drawn from data, as marshaled by dataEncoding. Assigns a specific file name from fileName and a default Content-Type. - - Contents of the file to upload. - A string encoding. - Name of the file uploaded by this form section. - - - - An anonymous file section with data drawn from the UTF8 string data. Assigns a specific file name from fileName and a default Content-Type. - - Contents of the file to upload. - Name of the file uploaded by this form section. - - - - Possible Networking.NetworkTransport errors. - - - - - Not a data message. - - - - - The Networking.ConnectionConfig does not match the other endpoint. - - - - - The address supplied to connect to was invalid or could not be resolved. - - - - - The message is too long to fit the buffer. - - - - - Not enough resources are available to process this request. - - - - - The operation completed successfully. - - - - - Connection timed out. - - - - - This error will occur if any function is called with inappropriate parameter values. - - - - - The protocol versions are not compatible. Check your library versions. - - - - - The specified channel doesn't exist. - - - - - The specified connectionId doesn't exist. - - - - - The specified host not available. - - - - - Operation is not supported. - - - - - Event that is returned when calling the Networking.NetworkTransport.Receive and Networking.NetworkTransport.ReceiveFromHost functions. - - - - - Broadcast discovery event received. -To obtain sender connection info and possible complimentary message from them, call Networking.NetworkTransport.GetBroadcastConnectionInfo() and Networking.NetworkTransport.GetBroadcastConnectionMessage() functions. - - - - - Connection event received. Indicating that a new connection was established. - - - - - Data event received. Indicating that data was received. - - - - - Disconnection event received. - - - - - No new event was received. - - - - - Transport Layer API. - - - - - Creates a host based on Networking.HostTopology. - - The Networking.HostTopology associated with the host. - Port to bind to (when 0 is selected, the OS will choose a port at random). - IP address to bind to. - - Returns the ID of the host that was created. - - - - - Create a host and configure them to simulate Internet latency (works on Editor and development build only). - - The Networking.HostTopology associated with the host. - Minimum simulated delay in milliseconds. - Maximum simulated delay in milliseconds. - Port to bind to (when 0 is selected, the OS will choose a port at random). - IP address to bind to. - - Returns host ID just created. - - - - - Created web socket host. - - Port to bind to. - The Networking.HostTopology associated with the host. - IP address to bind to. - - Web socket host id. - - - - - Created web socket host. - - Port to bind to. - The Networking.HostTopology associated with the host. - IP address to bind to. - - Web socket host id. - - - - - Tries to establish a connection to another peer. - - Host ID associated with this connection (retrieved when calling Networking.NetworkTransport.AddHost). - IPv4 address of the other peer. - Port of the other peer. - Set to 0 in the case of a default connection. - Error (can be cast to Networking.NetworkError for more information). - - - A unique connection identifier on success (otherwise zero). - - - - - Create dedicated connection to Relay server. - - Host ID associated with this connection (Retrieved when calling Networking.NetworkTransport.AddHost). - IPv4 address of the relay. - Port of the relay. - GUID for the relay match, retrieved by calling Networking.Match.NetworkMatch.CreateMatch and using the Networking.Match.MatchInfo.networkId. - GUID for the source, can be retrieved by calling Utility.GetSourceID. - Error (can be cast to Networking.NetworkError for more information). - Slot ID for this user, retrieved by calling Networking.Match.NetworkMatch.CreateMatch and using the Networking.Match.MatchInfo.nodeId. - - - - Try to establish connection to other peer, where the peer is specified using a C# System.EndPoint. - - Host ID associated with this connection (Retrieved when calling Networking.NetworkTransport.AddHost). - Error (can be cast to Networking.NetworkError for more information). - A valid System.EndPoint. - Set to 0 in the case of a default connection. - - - A unique connection identifier on success (otherwise zero). - - - - - Create a connection to another peer in the Relay group. - - Host ID associated with this connection (retrieved when calling Networking.NetworkTransport.AddHost). - IP address of the peer, retrieved by calling Networking.Match.NetworkMatch.JoinMatch and using the Networking.Match.MatchInfo.address. - Port of the peer, retrieved by calling Networking.Match.NetworkMatch.JoinMatch and using the Networking.Match.MatchInfo.port. - Set to 0 in the case of a default connection. - ID of the remote peer in relay. - GUID for the relay match, retrieved by calling Networking.Match.NetworkMatch.JoinMatch and using the Networking.Match.MatchInfo.networkId. - GUID for the source, can be retrieved by calling Utility.GetSourceID. - Error (can be cast to Networking.NetworkError for more information). - Slot ID reserved for the user, retrieved by calling Networking.Match.NetworkMatch.JoinMatch and using the Networking.Match.MatchInfo.nodeId. - Allowed peak bandwidth (peak bandwidth = factor*bytesPerSec, recommended value is 2.0) If data has not been sent for a long time, it is allowed to send more data, with factor 2 it is allowed send 2*bytesPerSec bytes per sec. - Average bandwidth (bandwidth will be throttled on this level). - - A unique connection identifier on success (otherwise zero). - - - - - Create a connection to another peer in the Relay group. - - Host ID associated with this connection (retrieved when calling Networking.NetworkTransport.AddHost). - IP address of the peer, retrieved by calling Networking.Match.NetworkMatch.JoinMatch and using the Networking.Match.MatchInfo.address. - Port of the peer, retrieved by calling Networking.Match.NetworkMatch.JoinMatch and using the Networking.Match.MatchInfo.port. - Set to 0 in the case of a default connection. - ID of the remote peer in relay. - GUID for the relay match, retrieved by calling Networking.Match.NetworkMatch.JoinMatch and using the Networking.Match.MatchInfo.networkId. - GUID for the source, can be retrieved by calling Utility.GetSourceID. - Error (can be cast to Networking.NetworkError for more information). - Slot ID reserved for the user, retrieved by calling Networking.Match.NetworkMatch.JoinMatch and using the Networking.Match.MatchInfo.nodeId. - Allowed peak bandwidth (peak bandwidth = factor*bytesPerSec, recommended value is 2.0) If data has not been sent for a long time, it is allowed to send more data, with factor 2 it is allowed send 2*bytesPerSec bytes per sec. - Average bandwidth (bandwidth will be throttled on this level). - - A unique connection identifier on success (otherwise zero). - - - - - Connect with simulated latency. - - Host ID associated with this connection (Retrieved when calling Networking.NetworkTransport.AddHost). - IPv4 address of the other peer. - Port of the other peer. - Set to 0 in the case of a default connection. - Error (can be cast to Networking.NetworkError for more information). - A Networking.ConnectionSimulatorConfig defined for this connection. - - A unique connection identifier on success (otherwise zero). - - - - - Send a disconnect signal to the connected peer and close the connection. Poll Networking.NetworkTransport.Receive() to be notified that the connection is closed. This signal is only sent once (best effort delivery). If this packet is dropped for some reason, the peer closes the connection by timeout. - - Host ID associated with this connection. - The connection ID of the connection you want to close. - Error (can be cast to Networking.NetworkError for more information). - - - - This will disconnect the host and disband the group. -DisconnectNetworkHost can only be called by the group owner on the relay server. - - Host ID associated with this connection. - Error (can be cast to Networking.NetworkError for more information). - - - - Check if the transport is using a platform specific protocol. - - EndPoint instance to check. - - True if the given endpoint is using a platform protocol. - - - - - Finalizes sending of a message to a group of connections. Only one multicast message at a time is allowed per host. - - Host ID associated with this connection (retrieved when calling Networking.NetworkTransport.AddHost). - Error (can be cast to Networking.NetworkError for more information). - - - - Returns size of reliable buffer. - - Host ID associated with this connection. - ID of the connection. - Error (can be cast to Networking.NetworkError for more information). - - Size of ack buffer. - - - - - The Unity Multiplayer spawning system uses assetIds to identify what remote objects to spawn. This function allows you to get the assetId for the Prefab associated with an object. - - Target GameObject to get assetId for. - - The assetId of the game object's Prefab. - - - - - After Networking.NetworkTransport.Receive() returns Networking.NetworkEventType.BroadcastEvent, this function will return the connection information of the broadcast sender. This information can then be used for connecting to the broadcast sender. - - ID of the broadcast receiver. - IPv4 address of broadcast sender. - Port of broadcast sender. - Error (can be cast to Networking.NetworkError for more information). - - - - After Networking.NetworkTransport.Receive() returns Networking.NetworkEventType.BroadcastEvent, this function returns a complimentary message from the broadcast sender. - - ID of broadcast receiver. - Message buffer provided by caller. - Buffer size. - Received size (if received size > bufferSize, corresponding error will be set). - Error (can be cast to Networking.NetworkError for more information). - - - - Returns the connection parameters for the specified connectionId. These parameters can be sent to other users to establish a direct connection to this peer. If this peer is connected to the host via Relay, the Relay-related parameters are set. - - Host ID associated with this connection. - ID of connection. - IP address. - Port. - Relay network guid. - Error (can be cast to Networking.NetworkError for more information). - Destination slot id. - - - - Returns the number of unread messages in the read-queue. - - - - - Returns the total number of messages still in the write-queue. - - - - - Return the round trip time for the given connectionId. - - Error (can be cast to Networking.NetworkError for more information). - Host ID associated with this connection. - ID of the connection. - - Current round trip time in ms. - - - - - Gets the safe un-encrypted maximum payload size for a given maximum packet size. - - The largest packet size that the network allows, in bytes. - - The maximum amount of bytes that can you can safely send over the network so they fit in the given maximum packet size after encryption. - - - - - Returns the port number assigned to the host. - - Host ID. - - The UDP port number, or -1 if an error occurred. - - - - - Returns the number of received messages waiting in the queue for processing. - - Host ID associated with this queue. - Error code. Cast this value to Networking.NetworkError for more information. - - The number of messages in the queue. - - - - - Returns how many packets have been received from start for connection. - - Host ID associated with this connection. - ID of the connection. - Error (can be cast to Networking.NetworkError for more information). - - The absolute number of packets received since the connection was established. - - - - - Returns how many packets have been received from start. (from Networking.NetworkTransport.Init call). - - - Packets count received from start for all hosts. - - - - - How many packets have been dropped due lack space in incoming queue (absolute value, countinf from start). - - - Dropping packet count. - - - - - Returns how many incoming packets have been lost due transmitting (dropped by network). - - Host ID associated with this connection. - ID of the connection. - Error (can be cast to Networking.NetworkError for more information). - - The absolute number of packets that have been lost since the connection was established. - - - - - Gets the currently-allowed network bandwidth in bytes per second. The value returned can vary because bandwidth can be throttled by flow control. If the bandwidth is throttled to zero, the connection is disconnected.ted. - - Host ID associated with this connection. - ID of the connection. - Error (can be cast to Networking.NetworkError for more information). - - Currently-allowed bandwidth in bytes per second. - - - - - Function returns time spent on network I/O operations in microseconds. - - - Time in micro seconds. - - - - - Return the total number of packets that has been lost. - - Host ID associated with this connection. - ID of the connection. - Error (can be cast to Networking.NetworkError for more information). - - - - Get a network timestamp. Can be used in your messages to investigate network delays together with Networking.GetRemoteDelayTimeMS. - - - Timestamp. - - - - - Returns how much raw data (in bytes) have been sent from start for all hosts (from Networking.NetworkTransport.Init call). - - - Total data (user payload, protocol specific data, ip and udp headers) (in bytes) sent from start for all hosts. - - - - - Returns how much raw data (in bytes) have been sent from start for connection (from call Networking.NetworkTransport.Connect for active connect or from connection request receiving for passive connect). - - Host ID associated with this connection. - ID of the connection. - Error (can be cast to Networking.NetworkError for more information). - - Total data (user payload, protocol specific data, ip and udp headers) (in bytes) sent from start for connection. - - - - - Returns how much raw data (in bytes) have been sent from start for the host (from call Networking.NetworkTransport.AddHost). - - ID of the host. - Error (can be cast to Networking.NetworkError for more information). - - Total data (user payload, protocol specific data, ip and udp headers) (in bytes) sent from start for the host. - - - - - Returns how many messages have been sent from start (from Networking.NetworkTransport.Init call). - - - Messages count sent from start (from call Networking.NetworkTransport.Init) for all hosts. - - - - - Returns how many packets have been sent from start for connection (from call Networking.NetworkTransport.Connect for active connect or from connection request receiving for passive connect). - - Host ID associated with this connection. - ID of the connection. - Error (can be cast to Networking.NetworkError for more information). - - Messages count sending from start for connection. - - - - - Returns how many messages have been sent from start for host (from call Networking.NetworkTransport.AddHost). - - ID of the host. - Error (can be cast to Networking.NetworkError for more information). - - Messages count sending from start for the host. - - - - - Returns the number of messages waiting in the outgoing message queue to be sent. - - Host ID associated with this queue. - Error code. Cast this value to Networking.NetworkError for more information. - - The number of messages waiting in the outgoing message queue to be sent. - - - - - Returns how many packets have been sent from start (from call Networking.NetworkTransport.Init) for all hosts. - - - Packets count sent from networking library start (from call Networking.NetworkTransport.Init) for all hosts. - - - - - Returns how many packets have been sent for connection from it start (from call Networking.NetworkTransport.Connect for active connect or from connection request receiving for passive connect). - - Host ID associated with this connection. - ID of the connection. - Error (can be cast to Networking.NetworkError for more information). - - Packets count sent for connection from it start. - - - - - Returns how many packets have been sent for host from it start (from call Networking.NetworkTransport.AddHost). - - ID of the host. - Error (can be cast to Networking.NetworkError for more information). - - Count packets have been sent from host start. - - - - - Returns the value in percent of the number of sent packets that were dropped by the network and not received by the peer. - - Host ID associated with this connection. - ID of the connection. - Error (can be cast to Networking.NetworkError for more information). - - The number of packets dropped by the network in the last ping timeout period expressed as an integer percentage from 0 to 100. - - - - - Returns the value in percent of the number of sent packets that were dropped by the peer. - - Host ID associated with this connection. - ID of the connection. - Error (can be cast to Networking.NetworkError for more information). - - The number of packets dropped by the peer in the last ping timeout period expressed as an integer percentage from 0 to 100. - - - - - Returns how much user payload and protocol system headers (in bytes) have been sent from start (from Networking.NetworkTransport.Init call). - - - Total payload and protocol system headers (in bytes) sent from start for all hosts. - - - - - Returns how much payload and protocol system headers (in bytes) have been sent from start for connection (from call Networking.NetworkTransport.Connect for active connect or from connection request receiving for passive connect). - - Host ID associated with this connection. - ID of the connection. - Error (can be cast to Networking.NetworkError for more information). - - Total user payload and protocol system headers (in bytes) sent from start for connection. - - - - - Returns how much payload and protocol system headers (in bytes) have been sent from start for the host (from call Networking.NetworkTransport.AddHost). - - ID of the host. - Error (can be cast to Networking.NetworkError for more information). - - Total user payload and protocol system headers (in bytes) sent from start for the host. - - - - - Returns how much payload (user) bytes have been sent from start (from Networking.NetworkTransport.Init call). - - - Total payload (in bytes) sent from start for all hosts. - - - - - Returns how much payload (user) bytes have been sent from start for connection (from call Networking.NetworkTransport.Connect for active connect or from connection request receiving for passive connect). - - Host ID associated with this connection. - ID of the connection. - Error (can be cast to Networking.NetworkError for more information). - - Total payload (in bytes) sent from start for connection. - - - - - Returns how much payload (user) bytes have been sent from start for the host (from call Networking.NetworkTransport.AddHost). - - ID of the host. - Error (can be cast to Networking.NetworkError for more information). - - Total payload (in bytes) sent from start for the host. - - - - - Return the current receive rate in bytes per second. - - Host ID associated with this connection. - ID of the connection. - Error (can be cast to Networking.NetworkError for more information). - - - - Return the current send rate in bytes per second. - - Host ID associated with this connection. - ID of the connection. - Error (can be cast to Networking.NetworkError for more information). - - - - Returns the delay for the timestamp received. - - Host ID associated with this connection. - ID of the connection. - Timestamp delivered from peer. - Error (can be cast to Networking.NetworkError for more information). - - - - Deprecated. Use Networking.NetworkTransport.GetNetworkLostPacketNum() instead. - - Host ID associated with this connection. - ID of the connection. - Error (can be cast to Networking.NetworkError for more information). - - - - Initializes the NetworkTransport. Should be called before any other operations on the NetworkTransport are done. - - - - - Check if the broadcast discovery sender is running. - - - True if it is running. False if it is not running. - - - - - Returns whether the network transport layer has successfully loaded an encryption plugin and is using it. - - - True if an encryption plugin has been loaded and is being used, false otherwise. - - - - - Deprecated. - - - - - Instructs the transport layer to load the provided encryption plugin. - - The path to the native encryption plugin to load, relative to the executable. - - True if the provided native encryption plugin was loaded successfully and is being used by the transport layer. False otherwise. - - - - - This method allows you to specify that notifications callbacks should be called when Unity's networking can send more messages than defined in notificationLevel. - - Host ID. - Connection ID. - Defines how many free slots in the incoming queue should be available before [GlobalConfig.ConnectionReadyForSend] callback is triggered. - Error code. - - Result, if false error will show error code. - - - - - Function is queueing but not sending messages. - - Host ID associated with this connection. - ID of the connection. - Error (can be cast to Networking.NetworkError for more information). - The channel ID to send on. - Buffer containing the data to send. - Size of the buffer. - - True if success. - - - - - Called to poll the underlying system for events. - - Host ID associated with the event. - The connectionID that received the event. - The channel ID associated with the event. - The buffer that will hold the data received. - Size of the buffer supplied. - The actual receive size of the data. - Error (can be cast to Networking.NetworkError for more information). - - Type of event returned. - - - - - Similar to Networking.NetworkTransport.Receive but will only poll for the provided hostId. - - The host ID to check for events. - The connection ID that received the event. - The channel ID associated with the event. - The buffer that will hold the data received. - Size of the buffer supplied. - The actual receive size of the data. - Error (can be cast to Networking.NetworkError for more information). - - Type of event returned. - - - - - Polls the host for the following events: Networking.NetworkEventType.ConnectEvent and Networking.NetworkEventType.DisconnectEvent. -Can only be called by the relay group owner. - - The host ID to check for events. - Error (can be cast to Networking.NetworkError for more information). - - Type of event returned. - - - - - Closes the opened socket, and closes all connections belonging to that socket. - - Host ID to remove. - - - - Send data to peer. - - Host ID associated with this connection. - ID of the connection. - The channel ID to send on. - Buffer containing the data to send. - Size of the buffer. - Error (can be cast to Networking.NetworkError for more information). - - - - Add a connection for the multicast send. - - Host ID associated with this connection. - ID of the connection. - Error (can be cast to Networking.NetworkError for more information). - - - - Sends messages, previously queued by NetworkTransport.QueueMessageForSending function. - - Host ID associated with this connection. - ID of the connection. - Error (can be cast to Networking.NetworkError for more information). - - True if hostId and connectioId are valid. - - - - - Sets the credentials required for receiving broadcast messages. Should any credentials of a received broadcast message not match, the broadcast discovery message is dropped. - - Host ID associated with this broadcast. - Key part of the credentials associated with this broadcast. - Version part of the credentials associated with this broadcast. - Subversion part of the credentials associated with this broadcast. - Error (can be cast to Networking.NetworkError for more information). - - - - Enable or disable a multicast lock. - - - - - - Used to inform the profiler of network packet statistics. - - The ID of the message being reported. - Number of messages being reported. - Number of bytes used by reported messages. - Whether the packet is outgoing (-1) or incoming (0). - - - - Shut down the NetworkTransport. - - - - - Starts sending a broadcasting message in all local subnets. - - Host ID which should be reported via broadcast (broadcast receivers will connect to this host). - Port used for the broadcast message. - Key part of the credentials associated with this broadcast. - Version part of the credentials associated with this broadcast. - Subversion part of the credentials associated with this broadcast. - Complimentary message. This message will delivered to the receiver with the broadcast event. - Size of message. - Specifies how often the broadcast message should be sent in milliseconds. - Error (can be cast to Networking.NetworkError for more information). - - Return true if broadcasting request has been submitted. - - - - - Start to multicast send. - - Host ID associated with this connection. - The channel ID. - Buffer containing the data to send. - Size of the buffer. - Error (can be cast to Networking.NetworkError for more information). - - - - Stop sending the broadcast discovery message. - - - - - Unloads the currently loaded encryption plugin, if one is loaded. - - - - - The type of the connected target. - - - - - The connected target is an Editor. - - - - - No target is connected, this is only possible in a Player. - - - - - The connected target is a Player. - - - - - The state of an Editor-to-Player or Editor-to-Editor connection to be used in Networking.PlayerConnection.PlayerConnectionGUI.ConnectionTargetSelectionDropdown or Networking.PlayerConnection.PlayerConnectionGUILayout.ConnectionTargetSelectionDropdown. - - - - - Supplies the type of the established connection, as in whether the target is a Player or an Editor. - - - - - The name of the connected target. - - - - - Arguments passed to Action callbacks registered in PlayerConnection. - - - - - Data that is received. - - - - - The Player ID that the data is received from. - - - - - Used for handling the network connection from the Player to the Editor. - - - - - Returns a singleton instance of a PlayerConnection. - - - - - Returns true when the Editor is connected to the Player. - - - - - Blocks the calling thread until either a message with the specified messageId is received or the specified time-out elapses. - - The type ID of the message that is sent to the Editor. - The time-out specified in milliseconds. - - Returns true when the message is received and false if the call timed out. - - - - - This disconnects all of the active connections. - - - - - Registers a listener for a specific message ID, with an Action to be executed whenever that message is received by the Editor. -This ID must be the same as for messages sent from EditorConnection.Send(). - - The message ID that should cause the Action callback to be executed when received. - Action that is executed when a message with ID messageId is received by the Editor. -The callback includes the data that is sent from the Player, and the Player ID. -The Player ID is always 1, because only one Editor can be connected. - - - - Registers a callback that is invoked when the Editor connects to the Player. - - The action that is called when the Player connects to the Editor, with the Player ID of the Editor. - - - - Registers a callback to be called when Editor disconnects. - - The Action that is called when a Player disconnects from the Editor. - - - - Sends data to the Editor. - - The type ID of the message that is sent to the Editor. - - - - - Attempt to sends data to the Editor. - - The type ID of the message that is sent to the Editor. - - - Returns true when the Player sends data successfully, and false when there is no space in the socket ring buffer or sending fails. - - - - - Deregisters a message listener. - - Message ID associated with the callback that you wish to deregister. - The associated callback function you wish to deregister. - - - - Unregisters the connection callback. - - - - - - Unregisters the disconnection callback. - - - - - - Enumeration of all supported quality of service channel modes. - - - - - A reliable message that will be re-sent with a high frequency until it is acknowledged. - - - - - Each message is guaranteed to be delivered but not guaranteed to be in order. - - - - - Each message is guaranteed to be delivered, also allowing fragmented messages with up to 32 fragments per message. - - - - - Each message is guaranteed to be delivered in order, also allowing fragmented messages with up to 32 fragments per message. - - - - - Each message is guaranteed to be delivered and in order. - - - - - A reliable message. Note: Only the last message in the send buffer is sent. Only the most recent message in the receive buffer will be delivered. - - - - - An unreliable message. Only the last message in the send buffer is sent. Only the most recent message in the receive buffer will be delivered. - - - - - There is no guarantee of delivery or ordering. - - - - - There is no guarantee of delivery or ordering, but allowing fragmented messages with up to 32 fragments per message. - - - - - There is garantee of ordering, no guarantee of delivery, but allowing fragmented messages with up to 32 fragments per message. - - - - - There is no guarantee of delivery and all unordered messages will be dropped. Example: VoIP. - - - - - Define how unet will handle network io operation. - - - - - Network thread will sleep up to threadawake timeout, after that it will try receive up to maxpoolsize amount of messages and then will try perform send operation for connection whihc ready to send. - - - - - Network thread will sleep up to threadawake timeout, or up to receive event on socket will happened. Awaked thread will try to read up to maxpoolsize packets from socket and will try update connections ready to send (with fixing awaketimeout rate). - - - - - The AppID identifies the application on the Unity Cloud or UNET servers. - - - - - Invalid AppID. - - - - - An Enum representing the priority of a client in a match, starting at 0 and increasing. - - - - - The Invalid case for a HostPriority. An Invalid host priority is not a valid host. - - - - - Describes the access levels granted to this client. - - - - - Administration access level, generally describing clearence to perform game altering actions against anyone inside a particular match. - - - - - Invalid access level, signifying no access level has been granted/specified. - - - - - Access level Owner, generally granting access for operations key to the peer host server performing it's work. - - - - - User access level. This means you can do operations which affect yourself only, like disconnect yourself from the match. - - - - - Access token used to authenticate a client session for the purposes of allowing or disallowing match operations requested by that client. - - - - - Binary field for the actual token. - - - - - Accessor to get an encoded string from the m_array data. - - - - - Checks if the token is a valid set of data with respect to default values (returns true if the values are not default, does not validate the token is a current legitimate token with respect to the server's auth framework). - - - - - Network ID, used for match making. - - - - - Invalid NetworkID. - - - - - The NodeID is the ID used in Relay matches to track nodes in a network. - - - - - The invalid case of a NodeID. - - - - - Identifies a specific game instance. - - - - - Invalid SourceID. - - - - - The UnityWebRequest object is used to communicate with web servers. - - - - - Holds a reference to a CertificateHandler object, which manages certificate validation for this UnityWebRequest. - - - - - **Deprecated.**. HTTP2 and many HTTP1.1 servers don't support this; we recommend leaving it set to false (default). - - - - - If true, any CertificateHandler attached to this UnityWebRequest will have CertificateHandler.Dispose called automatically when UnityWebRequest.Dispose is called. - - - - - If true, any DownloadHandler attached to this UnityWebRequest will have DownloadHandler.Dispose called automatically when UnityWebRequest.Dispose is called. - - - - - If true, any UploadHandler attached to this UnityWebRequest will have UploadHandler.Dispose called automatically when UnityWebRequest.Dispose is called. - - - - - Returns the number of bytes of body data the system has downloaded from the remote server. (Read Only) - - - - - Holds a reference to a DownloadHandler object, which manages body data received from the remote server by this UnityWebRequest. - - - - - Returns a floating-point value between 0.0 and 1.0, indicating the progress of downloading body data from the server. (Read Only) - - - - - A human-readable string describing any system errors encountered by this UnityWebRequest object while handling HTTP requests or responses. (Read Only) - - - - - Returns true after the UnityWebRequest has finished communicating with the remote server. (Read Only) - - - - - Returns true after this UnityWebRequest receives an HTTP response code indicating an error. (Read Only) - - - - - Returns true while a UnityWebRequest’s configuration properties can be altered. (Read Only) - - - - - Returns true after this UnityWebRequest encounters a system error. (Read Only) - - - - - The string "CREATE", commonly used as the verb for an HTTP CREATE request. - - - - - The string "DELETE", commonly used as the verb for an HTTP DELETE request. - - - - - The string "GET", commonly used as the verb for an HTTP GET request. - - - - - The string "HEAD", commonly used as the verb for an HTTP HEAD request. - - - - - The string "POST", commonly used as the verb for an HTTP POST request. - - - - - The string "PUT", commonly used as the verb for an HTTP PUT request. - - - - - Defines the HTTP verb used by this UnityWebRequest, such as GET or POST. - - - - - Indicates the number of redirects which this UnityWebRequest will follow before halting with a “Redirect Limit Exceeded” system error. - - - - - The numeric HTTP response code returned by the server, such as 200, 404 or 500. (Read Only) - - - - - The result of this UnityWebRequest. - - - - - Sets UnityWebRequest to attempt to abort after the number of seconds in timeout have passed. - - - - - Returns the number of bytes of body data the system has uploaded to the remote server. (Read Only) - - - - - Holds a reference to the UploadHandler object which manages body data to be uploaded to the remote server. - - - - - Returns a floating-point value between 0.0 and 1.0, indicating the progress of uploading body data to the server. - - - - - Defines the target URI for the UnityWebRequest to communicate with. - - - - - Defines the target URL for the UnityWebRequest to communicate with. - - - - - Determines whether this UnityWebRequest will include Expect: 100-Continue in its outgoing request headers. (Default: true). - - - - - If in progress, halts the UnityWebRequest as soon as possible. - - - - - Clears stored cookies from the cache. - - An optional URL to define which cookies are removed. Only cookies that apply to this URL will be removed from the cache. - - - - Clears stored cookies from the cache. - - An optional URL to define which cookies are removed. Only cookies that apply to this URL will be removed from the cache. - - - - Creates a UnityWebRequest with the default options and no attached DownloadHandler or UploadHandler. Default method is GET. - - The target URL with which this UnityWebRequest will communicate. Also accessible via the url property. - The target URI to which form data will be transmitted. - HTTP GET, POST, etc. methods. - Replies from the server. - Upload data to the server. - - - - Creates a UnityWebRequest with the default options and no attached DownloadHandler or UploadHandler. Default method is GET. - - The target URL with which this UnityWebRequest will communicate. Also accessible via the url property. - The target URI to which form data will be transmitted. - HTTP GET, POST, etc. methods. - Replies from the server. - Upload data to the server. - - - - Creates a UnityWebRequest with the default options and no attached DownloadHandler or UploadHandler. Default method is GET. - - The target URL with which this UnityWebRequest will communicate. Also accessible via the url property. - The target URI to which form data will be transmitted. - HTTP GET, POST, etc. methods. - Replies from the server. - Upload data to the server. - - - - Creates a UnityWebRequest with the default options and no attached DownloadHandler or UploadHandler. Default method is GET. - - The target URL with which this UnityWebRequest will communicate. Also accessible via the url property. - The target URI to which form data will be transmitted. - HTTP GET, POST, etc. methods. - Replies from the server. - Upload data to the server. - - - - Creates a UnityWebRequest with the default options and no attached DownloadHandler or UploadHandler. Default method is GET. - - The target URL with which this UnityWebRequest will communicate. Also accessible via the url property. - The target URI to which form data will be transmitted. - HTTP GET, POST, etc. methods. - Replies from the server. - Upload data to the server. - - - - Creates a UnityWebRequest with the default options and no attached DownloadHandler or UploadHandler. Default method is GET. - - The target URL with which this UnityWebRequest will communicate. Also accessible via the url property. - The target URI to which form data will be transmitted. - HTTP GET, POST, etc. methods. - Replies from the server. - Upload data to the server. - - - - Creates a UnityWebRequest with the default options and no attached DownloadHandler or UploadHandler. Default method is GET. - - The target URL with which this UnityWebRequest will communicate. Also accessible via the url property. - The target URI to which form data will be transmitted. - HTTP GET, POST, etc. methods. - Replies from the server. - Upload data to the server. - - - - Creates a UnityWebRequest configured for HTTP DELETE. - - The URI to which a DELETE request should be sent. - - A UnityWebRequest configured to send an HTTP DELETE request. - - - - - Signals that this UnityWebRequest is no longer being used, and should clean up any resources it is using. - - - - - Escapes characters in a string to ensure they are URL-friendly. - - A string with characters to be escaped. - The text encoding to use. - - - - Escapes characters in a string to ensure they are URL-friendly. - - A string with characters to be escaped. - The text encoding to use. - - - - Generate a random 40-byte array for use as a multipart form boundary. - - - 40 random bytes, guaranteed to contain only printable ASCII values. - - - - - Create a UnityWebRequest for HTTP GET. - - The URI of the resource to retrieve via HTTP GET. - - An object that retrieves data from the uri. - - - - - Create a UnityWebRequest for HTTP GET. - - The URI of the resource to retrieve via HTTP GET. - - An object that retrieves data from the uri. - - - - - Deprecated. Replaced by UnityWebRequestAssetBundle.GetAssetBundle. - - - - - - - - - - Deprecated. Replaced by UnityWebRequestAssetBundle.GetAssetBundle. - - - - - - - - - - Deprecated. Replaced by UnityWebRequestAssetBundle.GetAssetBundle. - - - - - - - - - - Deprecated. Replaced by UnityWebRequestAssetBundle.GetAssetBundle. - - - - - - - - - - OBSOLETE. Use UnityWebRequestMultimedia.GetAudioClip(). - - - - - - - Retrieves the value of a custom request header. - - Name of the custom request header. Case-insensitive. - - The value of the custom request header. If no custom header with a matching name has been set, returns an empty string. - - - - - Retrieves the value of a response header from the latest HTTP response received. - - The name of the HTTP header to retrieve. Case-insensitive. - - The value of the HTTP header from the latest HTTP response. If no header with a matching name has been received, or no responses have been received, returns null. - - - - - Retrieves a dictionary containing all the response headers received by this UnityWebRequest in the latest HTTP response. - - - A dictionary containing all the response headers received in the latest HTTP response. If no responses have been received, returns null. - - - - - Creates a UnityWebRequest intended to download an image via HTTP GET and create a Texture based on the retrieved data. - - The URI of the image to download. - If true, the texture's raw data will not be accessible to script. This can conserve memory. Default: false. - - A UnityWebRequest properly configured to download an image and convert it to a Texture. - - - - - Creates a UnityWebRequest intended to download an image via HTTP GET and create a Texture based on the retrieved data. - - The URI of the image to download. - If true, the texture's raw data will not be accessible to script. This can conserve memory. Default: false. - - A UnityWebRequest properly configured to download an image and convert it to a Texture. - - - - - Creates a UnityWebRequest configured to send a HTTP HEAD request. - - The URI to which to send a HTTP HEAD request. - - A UnityWebRequest configured to transmit a HTTP HEAD request. - - - - - Creates a UnityWebRequest configured to send form data to a server via HTTP POST. - - The target URI to which form data will be transmitted. - Form body data. Will be URLEncoded prior to transmission. - - A UnityWebRequest configured to send form data to uri via POST. - - - - - Create a UnityWebRequest configured to send form data to a server via HTTP POST. - - The target URI to which form data will be transmitted. - Form fields or files encapsulated in a WWWForm object, for formatting and transmission to the remote server. - - A UnityWebRequest configured to send form data to uri via POST. - - - - - Create a UnityWebRequest configured to send form data to a server via HTTP POST. - - The target URI to which form data will be transmitted. - A list of form fields or files to be formatted and transmitted to the remote server. - A unique boundary string, which will be used when separating form fields in a multipart form. If not supplied, a boundary will be generated for you. - - A UnityWebRequest configured to send form data to uri via POST. - - - - - Create a UnityWebRequest configured to send form data to a server via HTTP POST. - - The target URI to which form data will be transmitted. - A list of form fields or files to be formatted and transmitted to the remote server. - A unique boundary string, which will be used when separating form fields in a multipart form. If not supplied, a boundary will be generated for you. - - A UnityWebRequest configured to send form data to uri via POST. - - - - - Create a UnityWebRequest configured to send form data to a server via HTTP POST. - - The target URI to which form data will be transmitted. - Strings indicating the keys and values of form fields. Will be automatically formatted into a URL-encoded form body. - - A UnityWebRequest configured to send form data to uri via POST. - - - - - Creates a UnityWebRequest configured to upload raw data to a remote server via HTTP PUT. - - The URI to which the data will be sent. - The data to transmit to the remote server. - -If a string, the string will be converted to raw bytes via <a href="http:msdn.microsoft.comen-uslibrarysystem.text.encoding.utf8">System.Text.Encoding.UTF8<a>. - - A UnityWebRequest configured to transmit bodyData to uri via HTTP PUT. - - - - - Creates a UnityWebRequest configured to upload raw data to a remote server via HTTP PUT. - - The URI to which the data will be sent. - The data to transmit to the remote server. - -If a string, the string will be converted to raw bytes via <a href="http:msdn.microsoft.comen-uslibrarysystem.text.encoding.utf8">System.Text.Encoding.UTF8<a>. - - A UnityWebRequest configured to transmit bodyData to uri via HTTP PUT. - - - - - Defines codes describing the possible outcomes of a UnityWebRequest. - - - - - Failed to communicate with the server. For example, the request couldn't connect or it could not establish a secure channel. - - - - - Error processing data. The request succeeded in communicating with the server, but encountered an error when processing the received data. For example, the data was corrupted or not in the correct format. - - - - - The request hasn't finished yet. - - - - - The server returned an error response. The request succeeded in communicating with the server, but received an error as defined by the connection protocol. - - - - - The request succeeded. - - - - - Begin communicating with the remote server. - - - An AsyncOperation indicating the progress/completion state of the UnityWebRequest. Yield this object to wait until the UnityWebRequest is done. - - - - - Begin communicating with the remote server. - - - - - Converts a List of IMultipartFormSection objects into a byte array containing raw multipart form data. - - A List of IMultipartFormSection objects. - A unique boundary string to separate the form sections. - - A byte array of raw multipart form data. - - - - - Serialize a dictionary of strings into a byte array containing URL-encoded UTF8 characters. - - A dictionary containing the form keys and values to serialize. - - A byte array containing the serialized form. The form's keys and values have been URL-encoded. - - - - - Set a HTTP request header to a custom value. - - The key of the header to be set. Case-sensitive. - The header's intended value. - - - - Converts URL-friendly escape sequences back to normal text. - - A string containing escaped characters. - The text encoding to use. - - - - Converts URL-friendly escape sequences back to normal text. - - A string containing escaped characters. - The text encoding to use. - - - - Helpers for downloading asset bundles using UnityWebRequest. - - - - - Creates a UnityWebRequest optimized for downloading a Unity Asset Bundle via HTTP GET. - - The URI of the asset bundle to download. - If nonzero, this number will be compared to the checksum of the downloaded asset bundle data. If the CRCs do not match, an error will be logged and the asset bundle will not be loaded. If set to zero, CRC checking will be skipped. - An integer version number, which will be compared to the cached version of the asset bundle to download. Increment this number to force Unity to redownload a cached asset bundle. - -Analogous to the version parameter for WWW.LoadFromCacheOrDownload. - A version hash. If this hash does not match the hash for the cached version of this asset bundle, the asset bundle will be redownloaded. - A structure used to download a given version of AssetBundle to a customized cache path. - - A UnityWebRequest configured to downloading a Unity Asset Bundle. - - - - - Creates a UnityWebRequest optimized for downloading a Unity Asset Bundle via HTTP GET. - - The URI of the asset bundle to download. - If nonzero, this number will be compared to the checksum of the downloaded asset bundle data. If the CRCs do not match, an error will be logged and the asset bundle will not be loaded. If set to zero, CRC checking will be skipped. - An integer version number, which will be compared to the cached version of the asset bundle to download. Increment this number to force Unity to redownload a cached asset bundle. - -Analogous to the version parameter for WWW.LoadFromCacheOrDownload. - A version hash. If this hash does not match the hash for the cached version of this asset bundle, the asset bundle will be redownloaded. - A structure used to download a given version of AssetBundle to a customized cache path. - - A UnityWebRequest configured to downloading a Unity Asset Bundle. - - - - - Creates a UnityWebRequest optimized for downloading a Unity Asset Bundle via HTTP GET. - - The URI of the asset bundle to download. - If nonzero, this number will be compared to the checksum of the downloaded asset bundle data. If the CRCs do not match, an error will be logged and the asset bundle will not be loaded. If set to zero, CRC checking will be skipped. - An integer version number, which will be compared to the cached version of the asset bundle to download. Increment this number to force Unity to redownload a cached asset bundle. - -Analogous to the version parameter for WWW.LoadFromCacheOrDownload. - A version hash. If this hash does not match the hash for the cached version of this asset bundle, the asset bundle will be redownloaded. - A structure used to download a given version of AssetBundle to a customized cache path. - - A UnityWebRequest configured to downloading a Unity Asset Bundle. - - - - - Creates a UnityWebRequest optimized for downloading a Unity Asset Bundle via HTTP GET. - - The URI of the asset bundle to download. - If nonzero, this number will be compared to the checksum of the downloaded asset bundle data. If the CRCs do not match, an error will be logged and the asset bundle will not be loaded. If set to zero, CRC checking will be skipped. - An integer version number, which will be compared to the cached version of the asset bundle to download. Increment this number to force Unity to redownload a cached asset bundle. - -Analogous to the version parameter for WWW.LoadFromCacheOrDownload. - A version hash. If this hash does not match the hash for the cached version of this asset bundle, the asset bundle will be redownloaded. - A structure used to download a given version of AssetBundle to a customized cache path. - - A UnityWebRequest configured to downloading a Unity Asset Bundle. - - - - - Creates a UnityWebRequest optimized for downloading a Unity Asset Bundle via HTTP GET. - - The URI of the asset bundle to download. - If nonzero, this number will be compared to the checksum of the downloaded asset bundle data. If the CRCs do not match, an error will be logged and the asset bundle will not be loaded. If set to zero, CRC checking will be skipped. - An integer version number, which will be compared to the cached version of the asset bundle to download. Increment this number to force Unity to redownload a cached asset bundle. - -Analogous to the version parameter for WWW.LoadFromCacheOrDownload. - A version hash. If this hash does not match the hash for the cached version of this asset bundle, the asset bundle will be redownloaded. - A structure used to download a given version of AssetBundle to a customized cache path. - - A UnityWebRequest configured to downloading a Unity Asset Bundle. - - - - - Creates a UnityWebRequest optimized for downloading a Unity Asset Bundle via HTTP GET. - - The URI of the asset bundle to download. - If nonzero, this number will be compared to the checksum of the downloaded asset bundle data. If the CRCs do not match, an error will be logged and the asset bundle will not be loaded. If set to zero, CRC checking will be skipped. - An integer version number, which will be compared to the cached version of the asset bundle to download. Increment this number to force Unity to redownload a cached asset bundle. - -Analogous to the version parameter for WWW.LoadFromCacheOrDownload. - A version hash. If this hash does not match the hash for the cached version of this asset bundle, the asset bundle will be redownloaded. - A structure used to download a given version of AssetBundle to a customized cache path. - - A UnityWebRequest configured to downloading a Unity Asset Bundle. - - - - - Creates a UnityWebRequest optimized for downloading a Unity Asset Bundle via HTTP GET. - - The URI of the asset bundle to download. - If nonzero, this number will be compared to the checksum of the downloaded asset bundle data. If the CRCs do not match, an error will be logged and the asset bundle will not be loaded. If set to zero, CRC checking will be skipped. - An integer version number, which will be compared to the cached version of the asset bundle to download. Increment this number to force Unity to redownload a cached asset bundle. - -Analogous to the version parameter for WWW.LoadFromCacheOrDownload. - A version hash. If this hash does not match the hash for the cached version of this asset bundle, the asset bundle will be redownloaded. - A structure used to download a given version of AssetBundle to a customized cache path. - - A UnityWebRequest configured to downloading a Unity Asset Bundle. - - - - - Creates a UnityWebRequest optimized for downloading a Unity Asset Bundle via HTTP GET. - - The URI of the asset bundle to download. - If nonzero, this number will be compared to the checksum of the downloaded asset bundle data. If the CRCs do not match, an error will be logged and the asset bundle will not be loaded. If set to zero, CRC checking will be skipped. - An integer version number, which will be compared to the cached version of the asset bundle to download. Increment this number to force Unity to redownload a cached asset bundle. - -Analogous to the version parameter for WWW.LoadFromCacheOrDownload. - A version hash. If this hash does not match the hash for the cached version of this asset bundle, the asset bundle will be redownloaded. - A structure used to download a given version of AssetBundle to a customized cache path. - - A UnityWebRequest configured to downloading a Unity Asset Bundle. - - - - - Creates a UnityWebRequest optimized for downloading a Unity Asset Bundle via HTTP GET. - - The URI of the asset bundle to download. - If nonzero, this number will be compared to the checksum of the downloaded asset bundle data. If the CRCs do not match, an error will be logged and the asset bundle will not be loaded. If set to zero, CRC checking will be skipped. - An integer version number, which will be compared to the cached version of the asset bundle to download. Increment this number to force Unity to redownload a cached asset bundle. - -Analogous to the version parameter for WWW.LoadFromCacheOrDownload. - A version hash. If this hash does not match the hash for the cached version of this asset bundle, the asset bundle will be redownloaded. - A structure used to download a given version of AssetBundle to a customized cache path. - - A UnityWebRequest configured to downloading a Unity Asset Bundle. - - - - - Creates a UnityWebRequest optimized for downloading a Unity Asset Bundle via HTTP GET. - - The URI of the asset bundle to download. - If nonzero, this number will be compared to the checksum of the downloaded asset bundle data. If the CRCs do not match, an error will be logged and the asset bundle will not be loaded. If set to zero, CRC checking will be skipped. - An integer version number, which will be compared to the cached version of the asset bundle to download. Increment this number to force Unity to redownload a cached asset bundle. - -Analogous to the version parameter for WWW.LoadFromCacheOrDownload. - A version hash. If this hash does not match the hash for the cached version of this asset bundle, the asset bundle will be redownloaded. - A structure used to download a given version of AssetBundle to a customized cache path. - - A UnityWebRequest configured to downloading a Unity Asset Bundle. - - - - - Asynchronous operation object returned from UnityWebRequest.SendWebRequest(). - -You can yield until it continues, register an event handler with AsyncOperation.completed, or manually check whether it's done (AsyncOperation.isDone) or progress (AsyncOperation.progress). - - - - - Returns the associated UnityWebRequest that created the operation. - - - - - Helpers for downloading multimedia files using UnityWebRequest. - - - - - Create a UnityWebRequest to download an audio clip via HTTP GET and create an AudioClip based on the retrieved data. - - The URI of the audio clip to download. - The type of audio encoding for the downloaded audio clip. See AudioType. - - A UnityWebRequest properly configured to download an audio clip and convert it to an AudioClip. - - - - - MovieTexture has been removed. Use VideoPlayer instead. - - - - - - Helpers for downloading image files into Textures using UnityWebRequest. - - - - - Create a UnityWebRequest intended to download an image via HTTP GET and create a Texture based on the retrieved data. - - The URI of the image to download. - If true, the texture's raw data will not be accessible to script. This can conserve memory. Default: false. - - A UnityWebRequest properly configured to download an image and convert it to a Texture. - - - - - Create a UnityWebRequest intended to download an image via HTTP GET and create a Texture based on the retrieved data. - - The URI of the image to download. - If true, the texture's raw data will not be accessible to script. This can conserve memory. Default: false. - - A UnityWebRequest properly configured to download an image and convert it to a Texture. - - - - - Helper object for UnityWebRequests. Manages the buffering and transmission of body data during HTTP requests. - - - - - Determines the default Content-Type header which will be transmitted with the outbound HTTP request. - - - - - The raw data which will be transmitted to the remote server as body data. (Read Only) - - - - - Returns the proportion of data uploaded to the remote server compared to the total amount of data to upload. (Read Only) - - - - - Signals that this UploadHandler is no longer being used, and should clean up any resources it is using. - - - - - A specialized UploadHandler that reads data from a given file and sends raw bytes to the server as the request body. - - - - - Create a new upload handler to send data from the given file to the server. - - A file containing data to send. - - - - A general-purpose UploadHandler subclass, using a native-code memory buffer. - - - - - General constructor. Contents of the input argument are copied into a native buffer. - - Raw data to transmit to the remote server. - - - - Networking Utility. - - - - - This property is deprecated and does not need to be set or referenced. - - - - - Utility function to get this client's access token for a particular network, if it has been set. - - - - - - Utility function to fetch the program's ID for UNET Cloud interfacing. - - - - - Utility function to get the client's SourceID for unique identification. - - - - - Utility function that accepts the access token for a network after it's received from the server. - - - - - - - Deprecated; Setting the AppID is no longer necessary. Please log in through the editor and set up the project there. - - - - - - Describes different levels of log information the network layer supports. - - - - - This data structure contains information on a message just received from the network. - - - - - The NetworkView who sent this message. - - - - - The player who sent this network message (owner). - - - - - The time stamp when the Message was sent in seconds. - - - - - Describes the status of the network interface peer type as returned by Network.peerType. - - - - - The NetworkPlayer is a data structure with which you can locate another player over the network. - - - - - Returns the external IP address of the network interface. - - - - - Returns the external port of the network interface. - - - - - The GUID for this player, used when connecting with NAT punchthrough. - - - - - The IP address of this player. - - - - - The port of this player. - - - - - Describes network reachability options. - - - - - Network is not reachable. - - - - - Network is reachable via carrier data network. - - - - - Network is reachable via WiFi or cable. - - - - - Different types of synchronization for the NetworkView component. - - - - - The network view is the binding material of multiplayer games. - - - - - The network group number of this network view. - - - - - Is the network view controlled by this object? - - - - - The component the network view is observing. - - - - - The NetworkPlayer who owns this network view. - - - - - The type of NetworkStateSynchronization set for this network view. - - - - - The ViewID of this network view. - - - - - Call a RPC function on all connected peers. - - - - - - - - Call a RPC function on a specific player. - - - - - - - - The NetworkViewID is a unique identifier for a network view instance in a multiplayer game. - - - - - True if instantiated by me. - - - - - The NetworkPlayer who owns the NetworkView. Could be the server. - - - - - Represents an invalid network view ID. - - - - - Disables reordering of an array or list in the Inspector window. - - - - - NPOT Texture2D|textures support. - - - - - Full NPOT support. - - - - - NPOT textures are not supported. Will be upscaled/padded at loading time. - - - - - Limited NPOT support: no mip-maps and clamp TextureWrapMode|wrap mode will be forced. - - - - - Base class for all objects Unity can reference. - - - - - Should the object be hidden, saved with the Scene or modifiable by the user? - - - - - The name of the object. - - - - - Removes a GameObject, component or asset. - - The object to destroy. - The optional amount of time to delay before destroying the object. - - - - Removes a GameObject, component or asset. - - The object to destroy. - The optional amount of time to delay before destroying the object. - - - - Destroys the object obj immediately. You are strongly recommended to use Destroy instead. - - Object to be destroyed. - Set to true to allow assets to be destroyed. - - - - Destroys the object obj immediately. You are strongly recommended to use Destroy instead. - - Object to be destroyed. - Set to true to allow assets to be destroyed. - - - - Do not destroy the target Object when loading a new Scene. - - An Object not destroyed on Scene change. - - - - Returns the first active loaded object of Type type. - - The type of object to find. - - - Object The first active loaded object that matches the specified type. It returns null if no Object matches the type. - - - - - Returns the first active loaded object of Type type. - - The type of object to find. - - - Object The first active loaded object that matches the specified type. It returns null if no Object matches the type. - - - - - Returns the first active loaded object of Type type. - - The type of object to find. - - - Object The first active loaded object that matches the specified type. It returns null if no Object matches the type. - - - - - Returns the first active loaded object of Type type. - - The type of object to find. - - - Object The first active loaded object that matches the specified type. It returns null if no Object matches the type. - - - - - Gets a list of all loaded objects of Type type. - - The type of object to find. - If true, components attached to inactive GameObjects are also included. - - The array of objects found matching the type specified. - - - - - Gets a list of all loaded objects of Type type. - - The type of object to find. - If true, components attached to inactive GameObjects are also included. - - The array of objects found matching the type specified. - - - - - Gets a list of all loaded objects of Type type. - - The type of object to find. - If true, components attached to inactive GameObjects are also included. - - The array of objects found matching the type specified. - - - - - Gets a list of all loaded objects of Type type. - - The type of object to find. - If true, components attached to inactive GameObjects are also included. - - The array of objects found matching the type specified. - - - - - Returns a list of all active and inactive loaded objects of Type type. - - The type of object to find. - - The array of objects found matching the type specified. - - - - - Returns a list of all active and inactive loaded objects of Type type, including assets. - - The type of object or asset to find. - - The array of objects and assets found matching the type specified. - - - - - Returns the instance id of the object. - - - - - Does the object exist? - - - - - - Clones the object original and returns the clone. - - An existing object that you want to make a copy of. - Position for the new object. - Orientation of the new object. - Parent that will be assigned to the new object. - When you assign a parent Object, pass true to position the new object directly in world space. Pass false to set the Object’s position relative to its new parent.. - - The instantiated clone. - - - - - Clones the object original and returns the clone. - - An existing object that you want to make a copy of. - Position for the new object. - Orientation of the new object. - Parent that will be assigned to the new object. - When you assign a parent Object, pass true to position the new object directly in world space. Pass false to set the Object’s position relative to its new parent.. - - The instantiated clone. - - - - - Clones the object original and returns the clone. - - An existing object that you want to make a copy of. - Position for the new object. - Orientation of the new object. - Parent that will be assigned to the new object. - When you assign a parent Object, pass true to position the new object directly in world space. Pass false to set the Object’s position relative to its new parent.. - - The instantiated clone. - - - - - Clones the object original and returns the clone. - - An existing object that you want to make a copy of. - Position for the new object. - Orientation of the new object. - Parent that will be assigned to the new object. - When you assign a parent Object, pass true to position the new object directly in world space. Pass false to set the Object’s position relative to its new parent.. - - The instantiated clone. - - - - - Clones the object original and returns the clone. - - An existing object that you want to make a copy of. - Position for the new object. - Orientation of the new object. - Parent that will be assigned to the new object. - When you assign a parent Object, pass true to position the new object directly in world space. Pass false to set the Object’s position relative to its new parent.. - - The instantiated clone. - - - - - You can also use Generics to instantiate objects. See the page for more details. - - Object of type T that you want to clone. - - - - - - Object of type T. - - - - - You can also use Generics to instantiate objects. See the page for more details. - - Object of type T that you want to clone. - - - - - - Object of type T. - - - - - You can also use Generics to instantiate objects. See the page for more details. - - Object of type T that you want to clone. - - - - - - Object of type T. - - - - - You can also use Generics to instantiate objects. See the page for more details. - - Object of type T that you want to clone. - - - - - - Object of type T. - - - - - You can also use Generics to instantiate objects. See the page for more details. - - Object of type T that you want to clone. - - - - - - Object of type T. - - - - - Compares two object references to see if they refer to the same object. - - The first Object. - The Object to compare against the first. - - - - Compares if two objects refer to a different object. - - - - - - - Returns the name of the object. - - - The name returned by ToString. - - - - - OcclusionArea is an area in which occlusion culling is performed. - - - - - Center of the occlusion area relative to the transform. - - - - - Size that the occlusion area will have. - - - - - The portal for dynamically changing occlusion at runtime. - - - - - Gets / sets the portal's open state. - - - - - Enumeration for SystemInfo.operatingSystemFamily. - - - - - Linux operating system family. - - - - - macOS operating system family. - - - - - Returned for operating systems that do not fall into any other category. - - - - - Windows operating system family. - - - - - Information about a particle collision. - - - - - The Collider for the GameObject struck by the particles. - - - - - The Collider or Collider2D for the GameObject struck by the particles. - - - - - Intersection point of the collision in world coordinates. - - - - - Geometry normal at the intersection point of the collision. - - - - - Incident velocity at the intersection point of the collision. - - - - - Method extension for Physics in Particle System. - - - - - Get the particle collision events for a GameObject. Returns the number of events written to the array. - - The GameObject for which to retrieve collision events. - Array to write collision events to. - - - - - Safe array size for use with ParticleSystem.GetCollisionEvents. - - - - - - Safe array size for use with ParticleSystem.GetTriggerParticles. - - Particle system. - Type of trigger to return size for. - - Number of particles with this trigger event type. - - - - - Get the particles that met the condition in the particle trigger module. Returns the number of particles written to the array. - - Particle system. - Type of trigger to return particles for. - The array of particles matching the trigger event type. - - Number of particles with this trigger event type. - - - - - Write modified particles back to the Particle System, during a call to OnParticleTrigger. - - Particle system. - Type of trigger to set particles for. - Particle array. - Offset into the array, if you only want to write back a subset of the returned particles. - Number of particles to write, if you only want to write back a subset of the returned particles. - - - - Write modified particles back to the Particle System, during a call to OnParticleTrigger. - - Particle system. - Type of trigger to set particles for. - Particle array. - Offset into the array, if you only want to write back a subset of the returned particles. - Number of particles to write, if you only want to write back a subset of the returned particles. - - - - Script interface for ParticleSystem. Unity's powerful and versatile particle system implementation. - - - - - Does this system support Automatic Culling? - - - - - Script interface for the CollisionModule of a Particle System. - - - - - Script interface for the ColorByLifetimeModule of a Particle System. - - - - - Script interface for the ColorOverLifetimeModule of a Particle System. - - - - - Script interface for the CustomDataModule of a Particle System. - - - - - The duration of the Particle System in seconds (Read Only). - - - - - Script interface for the EmissionModule of a Particle System. - - - - - The rate of particle emission. - - - - - When set to false, the Particle System will not emit particles. - - - - - Script interface for the ExternalForcesModule of a Particle System. - - - - - Script interface for the ForceOverLifetimeModule of a Particle System. - - - - - Scale being applied to the gravity defined by Physics.gravity. - - - - - Script interface for the InheritVelocityModule of a Particle System. - - - - - Determines whether the Particle System is emitting particles. A Particle System may stop emitting when its emission module has finished, it has been paused or if the system has been stopped using ParticleSystem.Stop|Stop with the ParticleSystemStopBehavior.StopEmitting|StopEmitting flag. Resume emitting by calling ParticleSystem.Play|Play. - - - - - Determines whether the Particle System is paused. - - - - - Determines whether the Particle System is playing. - - - - - Determines whether the Particle System is in the stopped state. - - - - - Script interface for the Particle System Lifetime By Emitter Speed module. - - - - - Script interface for the LightsModule of a Particle System. - - - - - Script interface for the LimitVelocityOverLifetimeModule of a Particle System. . - - - - - Determines whether the Particle System is looping. - - - - - Access the main Particle System settings. - - - - - The maximum number of particles to emit. - - - - - Script interface for the NoiseModule of a Particle System. - - - - - The current number of particles (Read Only). - - - - - The playback speed of the Particle System. 1 is normal playback speed. - - - - - If set to true, the Particle System will automatically start playing on startup. - - - - - Does this system support Procedural Simulation? - - - - - Override the random seed used for the Particle System emission. - - - - - Script interface for the RotationBySpeedModule of a Particle System. - - - - - Script interface for the RotationOverLifetimeModule of a Particle System. - - - - - The scaling mode applied to particle sizes and positions. - - - - - Script interface for the ShapeModule of a Particle System. - - - - - This selects the space in which to simulate particles. It can be either world or local space. - - - - - Script interface for the SizeBySpeedModule of a Particle System. - - - - - Script interface for the SizeOverLifetimeModule of a Particle System. - - - - - The initial color of particles when emitted. - - - - - Start delay in seconds. - - - - - The total lifetime in seconds that particles will have when emitted. When using curves, this value acts as a scale on the curve. This value is set in the particle when it is created by the Particle System. - - - - - The initial rotation of particles when emitted. When using curves, this value acts as a scale on the curve. - - - - - The initial 3D rotation of particles when emitted. When using curves, this value acts as a scale on the curves. - - - - - The initial size of particles when emitted. When using curves, this value acts as a scale on the curve. - - - - - The initial speed of particles when emitted. When using curves, this value acts as a scale on the curve. - - - - - Script interface for the SubEmittersModule of a Particle System. - - - - - Script interface for the TextureSheetAnimationModule of a Particle System. - - - - - Playback position in seconds. - - - - - Script interface for the TrailsModule of a Particle System. - - - - - Script interface for the TriggerModule of a Particle System. - - - - - Controls whether the Particle System uses an automatically-generated random number to seed the random number generator. - - - - - Script interface for the VelocityOverLifetimeModule of a Particle System. - - - - - Script interface for a Burst. - - - - - Specify the number of particles to emit. - - - - - Specifies how many times the system should play the burst. Set this to 0 to make it play indefinitely. - - - - - The maximum number of particles to emit. - - - - - The minimum number of particles to emit. - - - - - The probability that the system triggers a burst. - - - - - How often to repeat the burst, in seconds. - - - - - The time that each burst occurs. - - - - - Construct a new Burst with a time and count. - - Time to emit the burst. - Minimum number of particles to emit. - Maximum number of particles to emit. - Number of particles to emit. - Specifies how many times the system should play the burst. Set this to 0 to make it play indefinitely. - How often to repeat the burst, in seconds. - - - - Construct a new Burst with a time and count. - - Time to emit the burst. - Minimum number of particles to emit. - Maximum number of particles to emit. - Number of particles to emit. - Specifies how many times the system should play the burst. Set this to 0 to make it play indefinitely. - How often to repeat the burst, in seconds. - - - - Construct a new Burst with a time and count. - - Time to emit the burst. - Minimum number of particles to emit. - Maximum number of particles to emit. - Number of particles to emit. - Specifies how many times the system should play the burst. Set this to 0 to make it play indefinitely. - How often to repeat the burst, in seconds. - - - - Construct a new Burst with a time and count. - - Time to emit the burst. - Minimum number of particles to emit. - Maximum number of particles to emit. - Number of particles to emit. - Specifies how many times the system should play the burst. Set this to 0 to make it play indefinitely. - How often to repeat the burst, in seconds. - - - - Construct a new Burst with a time and count. - - Time to emit the burst. - Minimum number of particles to emit. - Maximum number of particles to emit. - Number of particles to emit. - Specifies how many times the system should play the burst. Set this to 0 to make it play indefinitely. - How often to repeat the burst, in seconds. - - - - Remove all particles in the Particle System. - - Clear all child Particle Systems as well. - - - - Remove all particles in the Particle System. - - Clear all child Particle Systems as well. - - - - Script interface for particle Collider data. - - - - - Retrieve a specific Collider that a particle iss interacting with. - - The index of the particle event. - The index of the collider to obtain. - - The Collider or Collider2D Component that a particle is interacting with. - - - - - Returns how how many Colliders a particle is interacting with. - - The index of the particle event. - - The number of Colliders the particle is interacting with. - - - - - Script interface for the CollisionMmodule of a Particle System. - - - - - How much force is applied to each particle after a collision. - - - - - A multiplier for ParticleSystem.CollisionModule._bounce. - - - - - How much force is applied to a Collider when hit by particles from this Particle System. - - - - - Control which Layers this Particle System collides with. - - - - - How much speed does each particle lose after a collision. - - - - - Change the dampen multiplier. - - - - - Specifies whether the CollisionModule is enabled or disabled. - - - - - Allow particles to collide with dynamic colliders when using world collision mode. - - - - - Allow particles to collide when inside colliders. - - - - - How much a collision reduces a particle's lifetime. - - - - - Change the lifetime loss multiplier. - - - - - The maximum number of collision shapes Unity considers for particle collisions. It ignores excess shapes. Terrains take priority. - - - - - Kill particles whose speed goes above this threshold, after a collision. - - - - - The maximum number of planes it is possible to set as colliders. - - - - - Kill particles whose speed falls below this threshold, after a collision. - - - - - Choose between 2D and 3D world collisions. - - - - - Specifies whether the physics system considers the collision angle when it applies forces from particles to Colliders. - - - - - Specifies whether the physics system considers particle sizes when it applies forces to Colliders. - - - - - Specifies whether the physics system considers particle speeds when it applies forces to Colliders. - - - - - Shows the number of planes currently set as Colliders. - - - - - Specifies the accuracy of particle collisions against colliders in the Scene. - - - - - A multiplier that Unity applies to the size of each particle before collisions are processed. - - - - - Send collision callback messages. - - - - - The type of particle collision to perform. - - - - - Size of voxels in the collision cache. - - - - - Adds a collision plane to use with this Particle System. - - The plane to add. - - - - Get a collision plane associated with this Particle System. - - The plane to return. - - The plane. - - - - - Removes a collision plane associated with this Particle System. - - The collision plane to remove. - - - - Removes a collision plane associated with this Particle System. - - The collision plane to remove. - - - - Set a collision plane to use with this Particle System. - - The plane entry to set. - The plane to collide particles against. - - - - Script interface for the ColorBySpeedModule of a Particle System. - - - - - The gradient that controls the particle colors. - - - - - Specifies whether the ColorBySpeedModule is enabled or disabled. - - - - - Apply the color gradient between these minimum and maximum speeds. - - - - - Script interface for the ColorOverLifetimeModule of a Particle System. - - - - - The gradient that controls the particle colors. - - - - - Specifies whether the ColorOverLifetimeModule is enabled or disabled. - - - - - Script interface for the CustomDataModule of a Particle System. - - - - - Specifies whether the CustomDataModule is enabled or disabled. - - - - - Get a ParticleSystem.MinMaxGradient, that is being used to generate custom HDR color data. - - The name of the custom data stream to retrieve the gradient from. - - The color gradient being used to generate custom color data. - - - - - Find out the type of custom data that is being generated for the chosen data stream. - - The name of the custom data stream to query. - - The type of data being generated for the requested stream. - - - - - Get a ParticleSystem.MinMaxCurve, that is being used to generate custom data. - - The name of the custom data stream to retrieve the curve from. - The component index to retrieve the curve for (0-3, mapping to the xyzw components of a Vector4 or float4). - - The curve being used to generate custom data. - - - - - Query how many ParticleSystem.MinMaxCurve elements are being used to generate this stream of custom data. - - The name of the custom data stream to retrieve the curve from. - - The number of curves. - - - - - Set a ParticleSystem.MinMaxGradient, in order to generate custom HDR color data. - - The name of the custom data stream to apply the gradient to. - The gradient to be used for generating custom color data. - - - - Choose the type of custom data to generate for the chosen data stream. - - The name of the custom data stream to enable data generation on. - The type of data to generate. - - - - Set a ParticleSystem.MinMaxCurve, in order to generate custom data. - - The name of the custom data stream to apply the curve to. - The component index to apply the curve to (0-3, mapping to the xyzw components of a Vector4 or float4). - The curve to be used for generating custom data. - - - - Specify how many curves are used to generate custom data for this stream. - - The name of the custom data stream to apply the curve to. - The number of curves to generate data for. - - - - - Script interface for the EmissionModule of a Particle System. - - - - - The current number of bursts. - - - - - Specifies whether the EmissionModule is enabled or disabled. - - - - - The rate at which the system spawns new particles. - - - - - Change the rate multiplier. - - - - - The rate at which the emitter spawns new particles over distance. - - - - - Change the rate over distance multiplier. - - - - - The rate at which the emitter spawns new particles over time. - - - - - Change the rate over time multiplier. - - - - - The emission type. - - - - - Gets a single burst from the array of bursts. - - The index of the burst to retrieve. - - The burst data at the given index. - - - - - Gets the burst array. - - Array of bursts to fill. - - The number of bursts in the array. - - - - - Sets a single burst in the array of bursts. - - The index of the burst to set. - The new burst data to apply to the Particle System. - - - - Sets the burst array. - - Array of bursts. - Optional array size for if the burst count is less than the array size. - - - - Sets the burst array. - - Array of bursts. - Optional array size for if the burst count is less than the array size. - - - - Emit count particles immediately. - - Number of particles to emit. - - - - Emit a number of particles from script. - - Overidden particle properties. - Number of particles to emit. - - - - - - - - - - - - - - - - - - - - Script interface for Particle System emission parameters. - - - - - Override the angular velocity of particles this system emits. - - - - - Override the 3D angular velocity of particles this system emits. - - - - - When overriding the position of particles, setting this flag to true allows you to retain the influence of the shape module. - - - - - Override the axis of rotation of particles this system emits. - - - - - Set the index that specifies which Mesh to emit. - - - - - Override all the properties of particles this system emits. - - - - - Override the position of particles this system emits. - - - - - Override the random seed of particles this system emits. - - - - - Override the rotation of particles this system emits. - - - - - Override the 3D rotation of particles this system emits. - - - - - Override the initial color of particles this system emits. - - - - - Override the lifetime of particles this system emits. - - - - - Override the initial size of particles this system emits. - - - - - Override the initial 3D size of particles this system emits. - - - - - Override the velocity of particles this system emits. - - - - - Reverts angularVelocity and angularVelocity3D back to the values specified in the Inspector. - - - - - Revert the axis of rotation back to the value specified in the Inspector. - - - - - Revert the Mesh selection back to the default randomized behavior. - - - - - Revert the position back to the value specified in the Inspector. - - - - - Revert the random seed back to the value specified in the Inspector. - - - - - Reverts rotation and rotation3D back to the values specified in the Inspector. - - - - - Revert the initial color back to the value specified in the Inspector. - - - - - Revert the lifetime back to the value specified in the Inspector. - - - - - Revert the initial size back to the value specified in the Inspector. - - - - - Revert the velocity back to the value specified in the Inspector. - - - - - Script interface for the ExternalForcesModule of a Particle System. - - - - - Specifies whether the ExternalForcesModule is enabled or disabled. - - - - - The number of Force Fields explicitly provided to the influencers list. - - - - - Apply all Force Fields belonging to a matching Layer to this Particle System. - - - - - Particle System Force Field Components with a matching Layer affect this Particle System. - - - - - Multiplies the magnitude of external forces affecting the particles. - - - - - Multiplies the magnitude of applied external forces. - - - - - Adds a ParticleSystemForceField to the influencers list. - - The Force Field to add to the influencers list. - - - - Gets the ParticleSystemForceField at the given index in the influencers list. - - The index to return the chosen Force Field from. - - The ForceField from the list. - - - - - Determines whether any particles are inside the influence of a Force Field. - - The Force Field to test. - - Whether the Force Field affects the Particle System. - - - - - Removes every Force Field from the influencers list. - - - - - Removes the Force Field from the influencers list at the given index. - - The index to remove the chosen Force Field from. - The Force Field to remove from the list. - - - - Removes the Force Field from the influencers list at the given index. - - The index to remove the chosen Force Field from. - The Force Field to remove from the list. - - - - Assigns the Force Field at the given index in the influencers list. - - Index to assign the Force Field. - Force Field that to assign. - - - - Script interface for the ForceOverLifetimeModule of a Particle System. - - - - - Specifies whether the ForceOverLifetimeModule is enabled or disabled. - - - - - When randomly selecting values between two curves or constants, this flag causes the system to choose a new random force on each frame. - - - - - Specifies whether the modules applies the forces in local or world space. - - - - - The curve that defines particle forces in the x-axis. - - - - - Defines the x-axis multiplier. - - - - - The curve defining particle forces in the y-axis. - - - - - Defines the y-axis multiplier. - - - - - The curve defining particle forces in the z-axis. - - - - - Defines the z-axis multiplier. - - - - - Get a stream of custom per-particle data. - - The array of per-particle data. - Which stream to retrieve the data from. - - The amount of valid per-particle data. - - - - - Gets the particles of this Particle System. - - Output particle buffer, containing the current particle state. - The number of elements that are read from the Particle System. - The offset into the active particle list, from which to copy the particles. - - The number of particles written to the input particle array (the number of particles currently alive). - - - - - Gets the particles of this Particle System. - - Output particle buffer, containing the current particle state. - The number of elements that are read from the Particle System. - The offset into the active particle list, from which to copy the particles. - - The number of particles written to the input particle array (the number of particles currently alive). - - - - - Gets the particles of this Particle System. - - Output particle buffer, containing the current particle state. - The number of elements that are read from the Particle System. - The offset into the active particle list, from which to copy the particles. - - The number of particles written to the input particle array (the number of particles currently alive). - - - - - Gets the particles of this Particle System. - - Output particle buffer, containing the current particle state. - The number of elements that are read from the Particle System. - The offset into the active particle list, from which to copy the particles. - - The number of particles written to the input particle array (the number of particles currently alive). - - - - - Gets the particles of this Particle System. - - Output particle buffer, containing the current particle state. - The number of elements that are read from the Particle System. - The offset into the active particle list, from which to copy the particles. - - The number of particles written to the input particle array (the number of particles currently alive). - - - - - Gets the particles of this Particle System. - - Output particle buffer, containing the current particle state. - The number of elements that are read from the Particle System. - The offset into the active particle list, from which to copy the particles. - - The number of particles written to the input particle array (the number of particles currently alive). - - - - - Returns all the data that relates to the current internal state of the Particle System. - - - The current internal state of the Particle System. - - - - - Returns all the data relating to the current internal state of the Particle System Trails. - - - The current Trails belonging to the Particle System. - - - - - The Inherit Velocity Module controls how the velocity of the emitter is transferred to the particles as they are emitted. - - - - - Curve to define how much of the emitter velocity the system applies during the lifetime of a particle. - - - - - Change the curve multiplier. - - - - - Specifies whether the InheritVelocityModule is enabled or disabled. - - - - - Specifies how to apply emitter velocity to particles. - - - - - Does the Particle System contain any live particles, or will it produce more? - - Check all child Particle Systems as well. - - True if the Particle System contains live particles or is still creating new particles. False if the Particle System has stopped emitting particles and all particles are dead. - - - - - Does the Particle System contain any live particles, or will it produce more? - - Check all child Particle Systems as well. - - True if the Particle System contains live particles or is still creating new particles. False if the Particle System has stopped emitting particles and all particles are dead. - - - - - The Lifetime By Emitter Speed Module controls the initial lifetime of each particle based on the speed of the emitter when the particle was spawned. - - - - - Use this curve to define which value to multiply the start lifetime of a particle with, based on the speed of the emitter when the particle is spawned. - - - - - Use this property to change the curve multiplier. - - - - - Use this property to enable or disable the LifetimeByEmitterSpeed module. - - - - - Control the start lifetime multiplier between these minimum and maximum speeds of the emitter. - - - - - Access the ParticleSystem Lights Module. - - - - - Toggle whether the system multiplies the particle alpha by the light intensity when it computes the final light intensity. - - - - - Specifies whether the LightsModule is enabled or disabled. - - - - - Define a curve to apply custom intensity scaling to particle Lights. - - - - - Intensity multiplier. - - - - - Select what Light Prefab you want to base your particle lights on. - - - - - Set a limit on how many Lights this Module can create. - - - - - Define a curve to apply custom range scaling to particle Lights. - - - - - Range multiplier. - - - - - Choose what proportion of particles receive a dynamic light. - - - - - Toggle whether the system multiplies the particle size by the light range to determine the final light range. - - - - - Toggle whether the particle lights multiply their color by the particle color. - - - - - Randomly assign Lights to new particles based on ParticleSystem.LightsModule.ratio. - - - - - Script interface for the Limit Velocity Over Lifetime module. - - - - - Controls how much this module dampens particle velocities that exceed the velocity limit. - - - - - Controls the amount of drag that this modules applies to the particle velocities. - - - - - Specifies the drag multiplier. - - - - - Specifies whether the LimitForceOverLifetimeModule is enabled or disabled. - - - - - Maximum velocity curve, when not using one curve per axis. - - - - - Change the limit multiplier. - - - - - Maximum velocity curve for the x-axis. - - - - - Change the limit multiplier on the x-axis. - - - - - Maximum velocity curve for the y-axis. - - - - - Change the limit multiplier on the y-axis. - - - - - Maximum velocity curve for the z-axis. - - - - - Change the limit multiplier on the z-axis. - - - - - Adjust the amount of drag this module applies to particles, based on their sizes. - - - - - Adjust the amount of drag this module applies to particles, based on their speeds. - - - - - Set the velocity limit on each axis separately. This module uses ParticleSystem.LimitVelocityOverLifetimeModule._drag to dampen a particle's velocity if the velocity exceeds this value. - - - - - Specifies if the velocity limits are in local space (rotated with the transform) or world space. - - - - - Script interface for the MainModule of a Particle System. - - - - - Configure whether the Particle System will still be simulated each frame, when it is offscreen. - - - - - Simulate particles relative to a custom transform component. - - - - - The duration of the Particle System in seconds. - - - - - Control how the Particle System calculates its velocity, when moving in the world. - - - - - Makes some particles spin in the opposite direction. - - - - - A scale that this Particle System applies to gravity, defined by Physics.gravity. - - - - - Change the gravity multiplier. - - - - - Specifies whether the Particle System is looping. - - - - - The maximum number of particles to emit. - - - - - If set to true, the Particle System automatically begins to play on startup. - - - - - If ParticleSystem.MainModule._loop is true, when you enable this property, the Particle System looks like it has already simulated for one loop when first becoming visible. - - - - - Cause some particles to spin in the opposite direction. - - - - - When ParticleSystem.MainModule.ringBufferMode is set to loop, this value defines the proportion of the particle life that loops. - - - - - Configure the Particle System to not kill its particles when their lifetimes are exceeded. - - - - - Control how the Particle System applies its Transform component to the particles it emits. - - - - - This selects the space in which to simulate particles. It can be either world or local space. - - - - - Override the default playback speed of the Particle System. - - - - - The initial color of particles when the Particle System first spawns them. - - - - - Start delay in seconds. - - - - - A multiplier for ParticleSystem.MainModule._startDelay in seconds. - - - - - The total lifetime in seconds that each new particle has. - - - - - A multiplier for ParticleSystem.MainModule._startLifetime. - - - - - The initial rotation of particles when the Particle System first spawns them. - - - - - A flag to enable 3D particle rotation. - - - - - A multiplier for ParticleSystem.MainModule._startRotation. - - - - - The initial rotation of particles around the x-axis when emitted. - - - - - The initial rotation multiplier of particles around the x-axis when the Particle System first spawns them. - - - - - The initial rotation of particles around the y-axis when the Particle System first spawns them. - - - - - The initial rotation multiplier of particles around the y-axis when the Particle System first spawns them.. - - - - - The initial rotation of particles around the z-axis when the Particle System first spawns them - - - - - The initial rotation multiplier of particles around the z-axis when the Particle System first spawns them. - - - - - The initial size of particles when the Particle System first spawns them. - - - - - A flag to enable specifying particle size individually for each axis. - - - - - A multiplier for the initial size of particles when the Particle System first spawns them. - - - - - The initial size of particles along the x-axis when the Particle System first spawns them. - - - - - A multiplier for ParticleSystem.MainModule._startSizeX. - - - - - The initial size of particles along the y-axis when the Particle System first spawns them. - - - - - A multiplier for ParticleSystem.MainModule._startSizeY. - - - - - The initial size of particles along the z-axis when the Particle System first spawns them. - - - - - A multiplier for ParticleSystem.MainModule._startSizeZ. - - - - - The initial speed of particles when the Particle System first spawns them. - - - - - A multiplier for ParticleSystem.MainModule._startSpeed. - - - - - Select whether to Disable or Destroy the GameObject, or to call the OnParticleSystemStopped script Callback, when the Particle System stops and all particles have died. - - - - - When true, use the unscaled delta time to simulate the Particle System. Otherwise, use the scaled delta time. - - - - - Script interface for a Min-Max Curve. - - - - - Set the constant value. - - - - - Set a constant for the upper bound. - - - - - Set a constant for the lower bound. - - - - - Set the curve. - - - - - Set a curve for the upper bound. - - - - - Set a curve for the lower bound. - - - - - Set a multiplier to apply to the curves. - - - - - Set the mode that the min-max curve uses to evaluate values. - - - - - A single constant value for the entire curve. - - Constant value. - - - - Use one curve when evaluating numbers along this Min-Max curve. - - A multiplier to apply to the curve. - A single curve to evaluate against. - - - - - Randomly select values based on the interval between the minimum and maximum curves. - - A multiplier to apply to the curves. - The curve describing the minimum values to be evaluated. - The curve describing the maximum values to be evaluated. - - - - - Randomly select values based on the interval between the minimum and maximum constants. - - The constant describing the minimum values to be evaluated. - The constant describing the maximum values to be evaluated. - - - - Manually query the curve to calculate values based on what mode it is in. - - Normalized time (in the range 0 - 1, where 1 represents 100%) at which to evaluate the curve. This is valid when ParticleSystem.MinMaxCurve.mode is set to ParticleSystemCurveMode.Curve or ParticleSystemCurveMode.TwoCurves. - Blend between the two curves/constants (Valid when ParticleSystem.MinMaxCurve.mode is set to ParticleSystemCurveMode.TwoConstants or ParticleSystemCurveMode.TwoCurves). - - Calculated curve/constant value. - - - - - Manually query the curve to calculate values based on what mode it is in. - - Normalized time (in the range 0 - 1, where 1 represents 100%) at which to evaluate the curve. This is valid when ParticleSystem.MinMaxCurve.mode is set to ParticleSystemCurveMode.Curve or ParticleSystemCurveMode.TwoCurves. - Blend between the two curves/constants (Valid when ParticleSystem.MinMaxCurve.mode is set to ParticleSystemCurveMode.TwoConstants or ParticleSystemCurveMode.TwoCurves). - - Calculated curve/constant value. - - - - - Script interface for a Min-Max Gradient. - - - - - Set a constant color. - - - - - Set a constant color for the upper bound. - - - - - Set a constant color for the lower bound. - - - - - Set the gradient. - - - - - Set a gradient for the upper bound. - - - - - Set a gradient for the lower bound. - - - - - Set the mode that the Min-Max Gradient uses to evaluate colors. - - - - - A single constant color for the entire gradient. - - Constant color. - - - - Use one gradient when evaluating numbers along this Min-Max Gradient. - - A single gradient for evaluating against. - - - - Randomly select colors based on the interval between the minimum and maximum constants. - - The constant color describing the minimum colors to be evaluated. - The constant color describing the maximum colors to be evaluated. - - - - Randomly select colors based on the interval between the minimum and maximum gradients. - - The gradient describing the minimum colors to be evaluated. - The gradient describing the maximum colors to be evaluated. - - - - Manually query the gradient to calculate colors based on what mode it is in. - - Normalized time (in the range 0 - 1, where 1 represents 100%) at which to evaluate the gradient. This is valid when ParticleSystem.MinMaxGradient.mode is set to ParticleSystemGradientMode.Gradient or ParticleSystemGradientMode.TwoGradients. - Blend between the two gradients/colors (Valid when ParticleSystem.MinMaxGradient.mode is set to ParticleSystemGradientMode.TwoColors or ParticleSystemGradientMode.TwoGradients). - - Calculated gradient/color value. - - - - - Manually query the gradient to calculate colors based on what mode it is in. - - Normalized time (in the range 0 - 1, where 1 represents 100%) at which to evaluate the gradient. This is valid when ParticleSystem.MinMaxGradient.mode is set to ParticleSystemGradientMode.Gradient or ParticleSystemGradientMode.TwoGradients. - Blend between the two gradients/colors (Valid when ParticleSystem.MinMaxGradient.mode is set to ParticleSystemGradientMode.TwoColors or ParticleSystemGradientMode.TwoGradients). - - Calculated gradient/color value. - - - - - Script interface for the NoiseModule. - - - - - Higher frequency noise reduces the strength by a proportional amount, if enabled. - - - - - Specifies whether the the NoiseModule is enabled or disabled. - - - - - Low values create soft, smooth noise, and high values create rapidly changing noise. - - - - - Layers of noise that combine to produce final noise. - - - - - When combining each octave, scale the intensity by this amount. - - - - - When combining each octave, zoom in by this amount. - - - - - How much the noise affects the particle positions. - - - - - Generate 1D, 2D or 3D noise. - - - - - Define how the noise values are remapped. - - - - - Enable remapping of the final noise values, allowing for noise values to be translated into different values. - - - - - Remap multiplier. - - - - - Define how the noise values are remapped on the x-axis, when using the ParticleSystem.NoiseModule.separateAxes option. - - - - - x-axis remap multiplier. - - - - - Define how the noise values are remapped on the y-axis, when using the ParticleSystem.NoiseModule.separateAxes option. - - - - - y-axis remap multiplier. - - - - - Define how the noise values are remapped on the z-axis, when using the ParticleSystem.NoiseModule.separateAxes option. - - - - - z-axis remap multiplier. - - - - - How much the noise affects the particle rotation, in degrees per second. - - - - - Scroll the noise map over the Particle System. - - - - - Scroll speed multiplier. - - - - - Control the noise separately for each axis. - - - - - How much the noise affects the particle sizes, applied as a multiplier on the size of each particle. - - - - - How strong the overall noise effect is. - - - - - Strength multiplier. - - - - - Define the strength of the effect on the x-axis, when using the ParticleSystem.NoiseModule.separateAxes option. - - - - - x-axis strength multiplier. - - - - - Define the strength of the effect on the y-axis, when using the ParticleSystem.NoiseModule.separateAxes option. - - - - - y-axis strength multiplier. - - - - - Define the strength of the effect on the z-axis, when using the ParticleSystem.NoiseModule.separateAxes option. - - - - - z-axis strength multiplier. - - - - - Script interface for a Particle. - - - - - The angular velocity of the particle. - - - - - The 3D angular velocity of the particle. - - - - - The animated velocity of the particle. - - - - - Mesh particles rotate around this axis. - - - - - The lifetime of the particle. - - - - - The position of the particle. - - - - - The random seed of the particle. - - - - - The random value of the particle. - - - - - The remaining lifetime of the particle. - - - - - The rotation of the particle. - - - - - The 3D rotation of the particle. - - - - - The initial color of the particle. The current color of the particle is calculated procedurally based on this value and the active color modules. - - - - - The starting lifetime of the particle. - - - - - The initial size of the particle. The current size of the particle is calculated procedurally based on this value and the active size modules. - - - - - The initial 3D size of the particle. The current size of the particle is calculated procedurally based on this value and the active size modules. - - - - - The total velocity of the particle. - - - - - The velocity of the particle. - - - - - Calculate the current color of the particle by applying the relevant curves to its startColor property. - - The Particle System from which this particle was emitted. - - Current color. - - - - - Calculate the current size of the particle by applying the relevant curves to its startSize property. - - The Particle System from which this particle was emitted. - - Current size. - - - - - Calculate the current 3D size of the particle by applying the relevant curves to its startSize3D property. - - The Particle System from which this particle was emitted. - - Current size. - - - - - Calculate the Mesh index of the particle, used for choosing which Mesh a particle is rendered with. - - The Particle System from which this particle was emitted. - - The index of the mesh used for rendering the particle. - - - - - Sets the Mesh index of the particle, used for choosing which Mesh a particle is rendered with. - - The Mesh index. - - - - Pauses the system so no new particles are emitted and the existing particles are not updated. - - Pause all child Particle Systems as well. - - - - Pauses the system so no new particles are emitted and the existing particles are not updated. - - Pause all child Particle Systems as well. - - - - Starts the Particle System. - - Play all child Particle Systems as well. - - - - Starts the Particle System. - - Play all child Particle Systems as well. - - - - Script interface for storing the particle playback state. - - - - - Reset the cache of reserved graphics memory used for efficient rendering of Particle Systems. - - - - - Script interface for the RotationBySpeedModule. - - - - - ESpecifies whether the RotationBySpeedModule is enabled or disabled. - - - - - Set the minimum and maximum speeds that this module applies the rotation curve between. - - - - - Set the rotation by speed on each axis separately. - - - - - Rotation by speed curve for the x-axis. - - - - - Speed multiplier along the x-axis. - - - - - Rotation by speed curve for the y-axis. - - - - - Speed multiplier along the y-axis. - - - - - Rotation by speed curve for the z-axis. - - - - - Speed multiplier along the z-axis. - - - - - Script interface for the RotationOverLifetimeModule. - - - - - Specifies whether the RotationOverLifetimeModule is enabled or disabled. - - - - - Set the rotation over lifetime on each axis separately. - - - - - Rotation over lifetime curve for the x-axis. - - - - - Rotation multiplier around the x-axis. - - - - - Rotation over lifetime curve for the y-axis. - - - - - Rotation multiplier around the y-axis. - - - - - Rotation over lifetime curve for the z-axis. - - - - - Rotation multiplier around the z-axis. - - - - - Set a stream of custom per-particle data. - - The array of per-particle data. - Which stream to assign the data to. - - - - Limits the amount of graphics memory Unity reserves for efficient rendering of Particle Systems. - - The maximum number of cached vertex buffers. - The maximum number of cached index buffers. - - - - Sets the particles of this Particle System. - - Input particle buffer, containing the desired particle state. - The number of elements in the particles array that is written to the Particle System. - The offset into the destination particle list, to assign these particles. - - - - Sets the particles of this Particle System. - - Input particle buffer, containing the desired particle state. - The number of elements in the particles array that is written to the Particle System. - The offset into the destination particle list, to assign these particles. - - - - Sets the particles of this Particle System. - - Input particle buffer, containing the desired particle state. - The number of elements in the particles array that is written to the Particle System. - The offset into the destination particle list, to assign these particles. - - - - Sets the particles of this Particle System. - - Input particle buffer, containing the desired particle state. - The number of elements in the particles array that is written to the Particle System. - The offset into the destination particle list, to assign these particles. - - - - Sets the particles of this Particle System. - - Input particle buffer, containing the desired particle state. - The number of elements in the particles array that is written to the Particle System. - The offset into the destination particle list, to assign these particles. - - - - Sets the particles of this Particle System. - - Input particle buffer, containing the desired particle state. - The number of elements in the particles array that is written to the Particle System. - The offset into the destination particle list, to assign these particles. - - - - Use this method with the results of an earlier call to ParticleSystem.GetPlaybackState, in order to restore the Particle System to the state stored in the playbackState object. - - The PlaybackState to apply to the Particle System. - - - - Use this method with the results of an earlier call to ParticleSystem.GetTrails, in order to restore the Particle System to the state stored in the Trails object. - - The Trails to apply to the Particle System. - - - - - Script interface for the ShapeModule. - - - - - Align particles based on their initial direction of travel. - - - - - Angle of the cone to emit particles from. - - - - - Angle of the circle arc to emit particles from. - - - - - The mode that Unity uses to generate particles around the arc. - - - - - In animated modes, this determines how quickly the particle emission position moves around the arc. - - - - - A multiplier of the arc speed of the particle emission shape. - - - - - Control the gap between particle emission points around the arc. - - - - - Scale of the box to emit particles from. - - - - - Thickness of the box to emit particles from. - - - - - The thickness of the Donut shape to emit particles from. - - - - - Specifies whether the ShapeModule is enabled or disabled. - - - - - Length of the cone to emit particles from. - - - - - Mesh to emit particles from. - - - - - Emit particles from a single Material of a Mesh. - - - - - MeshRenderer to emit particles from. - - - - - Apply a scaling factor to the Mesh that emits the particles. - - - - - Where on the Mesh to emit particles from. - - - - - The mode to use to generate particles on a Mesh. - - - - - In animated modes, this determines how quickly the particle emission position moves across the Mesh. - - - - - A multiplier of the Mesh spawn speed. - - - - - Control the gap between particle emission points across the Mesh. - - - - - Move particles away from the surface of the source Mesh. - - - - - Apply an offset to the position from which the system emits particles. - - - - - Radius of the shape to emit particles from. - - - - - The mode to use to generate particles along the radius. - - - - - In animated modes, this determines how quickly the particle emission position moves along the radius. - - - - - A multiplier of the radius speed of the particle emission shape. - - - - - Control the gap between particle emission points along the radius. - - - - - Radius thickness of the shape's edge from which to emit particles. - - - - - Randomizes the starting direction of particles. - - - - - Randomizes the starting direction of particles. - - - - - Randomizes the starting position of particles. - - - - - Apply a rotation to the shape from which the system emits particles. - - - - - Apply scale to the shape from which the system emits particles. - - - - - The type of shape to emit particles from. - - - - - SkinnedMeshRenderer to emit particles from. - - - - - Makes particles move in a spherical direction from their starting point. - - - - - Sprite to emit particles from. - - - - - SpriteRenderer to emit particles from. - - - - - Specifies a Texture to tint the particle's start colors. - - - - - When enabled, the system applies the alpha channel of the Texture to the particle alpha when the particle spawns. - - - - - When enabled, the system takes four neighboring samples from the Texture then combines them to give the final particle value. - - - - - Selects which channel of the Texture to use for discarding particles. - - - - - Discards particles when they spawn on an area of the Texture with a value lower than this threshold. - - - - - When enabled, the system applies the RGB channels of the Texture to the particle color when the particle spawns. - - - - - When using a Mesh as a source shape type, this option controls which UV channel on the Mesh to use for reading the source Texture. - - - - - Modulate the particle colors with the vertex colors, or the Material color if no vertex colors exist. - - - - - Emit particles from a single Material, or the whole Mesh. - - - - - Fast-forwards the Particle System by simulating particles over the given period of time, then pauses it. - - Time period in seconds to advance the ParticleSystem simulation by. If restart is true, the ParticleSystem will be reset to 0 time, and then advanced by this value. If restart is false, the ParticleSystem simulation will be advanced in time from its current state by this value. - Fast-forward all child Particle Systems as well. - Restart and start from the beginning. - Only update the system at fixed intervals, based on the value in "Fixed Time" in the Time options. - - - - Fast-forwards the Particle System by simulating particles over the given period of time, then pauses it. - - Time period in seconds to advance the ParticleSystem simulation by. If restart is true, the ParticleSystem will be reset to 0 time, and then advanced by this value. If restart is false, the ParticleSystem simulation will be advanced in time from its current state by this value. - Fast-forward all child Particle Systems as well. - Restart and start from the beginning. - Only update the system at fixed intervals, based on the value in "Fixed Time" in the Time options. - - - - Fast-forwards the Particle System by simulating particles over the given period of time, then pauses it. - - Time period in seconds to advance the ParticleSystem simulation by. If restart is true, the ParticleSystem will be reset to 0 time, and then advanced by this value. If restart is false, the ParticleSystem simulation will be advanced in time from its current state by this value. - Fast-forward all child Particle Systems as well. - Restart and start from the beginning. - Only update the system at fixed intervals, based on the value in "Fixed Time" in the Time options. - - - - Fast-forwards the Particle System by simulating particles over the given period of time, then pauses it. - - Time period in seconds to advance the ParticleSystem simulation by. If restart is true, the ParticleSystem will be reset to 0 time, and then advanced by this value. If restart is false, the ParticleSystem simulation will be advanced in time from its current state by this value. - Fast-forward all child Particle Systems as well. - Restart and start from the beginning. - Only update the system at fixed intervals, based on the value in "Fixed Time" in the Time options. - - - - Script interface for the SizeBySpeedModule. - - - - - Specifies whether the SizeBySpeedModule is enabled or disabled. - - - - - Set the minimum and maximum speed that this modules applies the size curve between. - - - - - Set the size by speed on each axis separately. - - - - - Curve to control particle size based on speed. - - - - - A multiplier for ParticleSystem.SizeBySpeedModule._size. - - - - - Size by speed curve for the x-axis. - - - - - Size multiplier along the x-axis. - - - - - Size by speed curve for the y-axis. - - - - - Size multiplier along the y-axis. - - - - - Size by speed curve for the z-axis. - - - - - Size multiplier along the z-axis. - - - - - Script interface for the SizeOverLifetimeModule. - - - - - Specifies whether the SizeOverLifetimeModule is enabled or disabled. - - - - - Set the size over lifetime on each axis separately. - - - - - Curve to control particle size based on lifetime. - - - - - A multiplier for ParticleSystem.SizeOverLifetimeModule._size. - - - - - Size over lifetime curve for the x-axis. - - - - - Size multiplier along the x-axis. - - - - - Size over lifetime curve for the y-axis. - - - - - Size multiplier along the y-axis. - - - - - Size over lifetime curve for the z-axis. - - - - - Size multiplier along the z-axis. - - - - - Stops playing the Particle System using the supplied stop behaviour. - - Stop all child Particle Systems as well. - Stop emitting or stop emitting and clear the system. - - - - Stops playing the Particle System using the supplied stop behaviour. - - Stop all child Particle Systems as well. - Stop emitting or stop emitting and clear the system. - - - - Stops playing the Particle System using the supplied stop behaviour. - - Stop all child Particle Systems as well. - Stop emitting or stop emitting and clear the system. - - - - Script interface for the SubEmittersModule. - - - - - Sub-Particle System which spawns at the locations of the birth of the particles from the parent system. - - - - - Sub-Particle System which spawns at the locations of the birth of the particles from the parent system. - - - - - Sub-Particle System which spawns at the locations of the collision of the particles from the parent system. - - - - - Sub-Particle System which spawns at the locations of the collision of the particles from the parent system. - - - - - Sub-Particle System which spawns at the locations of the death of the particles from the parent system. - - - - - Sub-Particle System to spawn on death of the parent system's particles. - - - - - Specifies whether the SubEmittersModule is enabled or disabled. - - - - - The total number of sub-emitters. - - - - - Add a new sub-emitter. - - The sub-emitter to add. - The event that creates new particles. - The properties of the new particles. - The probability that the sub-emitter emits particles. Accepts values from 0 to 1, where 0 is never and 1 is always. - - - - Add a new sub-emitter. - - The sub-emitter to add. - The event that creates new particles. - The properties of the new particles. - The probability that the sub-emitter emits particles. Accepts values from 0 to 1, where 0 is never and 1 is always. - - - - Gets the probability that the sub-emitter emits particles. - - The index of the sub-emitter. - - The emission probability for the sub-emitter - - - - - Gets the properties of the sub-emitter at the given index. - - The index of the sub-emitter. - - The properties of the sub-emitter at the index. - - - - - Gets the sub-emitter Particle System at the given index. - - The index of the desired sub-emitter. - - The sub-emitter at the index. - - - - - Gets the type of the sub-emitter at the given index. - - The index of the desired sub-emitter. - - The type of sub-emitter at the index. - - - - - Removes a sub-emitter from the given index in the array. - - The index from which to remove a sub-emitter. - - - - Removes a sub-emitter from the given index in the array. - - The sub-emitter to remove. - - - - Sets the probability that the sub-emitter emits particles. - - The index of the sub-emitter you want to modify. - The probability value. - - - - Sets the properties of the sub-emitter at the given index. - - The index of the sub-emitter you want to modify. - The new properties to assign to this sub-emitter. - - - - Sets the Particle System to use as the sub-emitter at the given index. - - The index of the sub-emitter you want to modify. - The Particle System to use as the sub-emitter at the specified index. - - - - Sets the type of the sub-emitter at the given index. - - The index of the sub-emitter you want to modify. - The new spawning type to assign to this sub-emitter. - - - - Script interface for the TextureSheetAnimationModule. - - - - - Specifies the animation type. - - - - - Specifies how many times the animation loops during the lifetime of the particle. - - - - - Specifies whether the TextureSheetAnimationModule is enabled or disabled. - - - - - Flip the U coordinate on particles, causing them to appear mirrored horizontally. - - - - - Flip the V coordinate on particles, causing them to appear mirrored vertically. - - - - - Control how quickly the animation plays. - - - - - A curve to control which frame of the Texture sheet animation to play. - - - - - The frame over time mutiplier. - - - - - Select whether the animated Texture information comes from a grid of frames on a single Texture, or from a list of Sprite objects. - - - - - Defines the tiling of the Texture in the x-axis. - - - - - Defines the tiling of the texture in the y-axis. - - - - - Explicitly select which row of the Texture sheet to use. The system uses this property when ParticleSystem.TextureSheetAnimationModule.rowMode is set to Custom. - - - - - Select how particles choose which row of a Texture Sheet Animation to use. - - - - - Specify how particle speeds are mapped to the animation frames. - - - - - The total number of sprites. - - - - - Define a random starting frame for the Texture sheet animation. - - - - - The starting frame multiplier. - - - - - Select whether the system bases the playback on mapping a curve to the lifetime of each particle, by using the particle speeds, or if playback simply uses a constant frames per second. - - - - - Use a random row of the Texture sheet for each particle emitted. - - - - - Choose which UV channels receive Texture animation. - - - - - Add a new Sprite. - - The Sprite to be added. - - - - Get the Sprite at the given index. - - The index of the desired Sprite. - - The Sprite being requested. - - - - - Remove a Sprite from the given index in the array. - - The index from which to remove a Sprite. - - - - Set the Sprite at the given index. - - The index of the Sprite being modified. - The Sprite being assigned. - - - - Script interface for the TrailsModule. - - - - - Adds an extra position to each ribbon, connecting it to the location of the Transform Component. - - - - - The gradient that controls the trail colors during the lifetime of the attached particle. - - - - - The gradient that controls the trail colors over the length of the trail. - - - - - Specifies whether trails disappear immediately when their owning particle dies. When false, each trail persists until all its points have naturally expired, based on its lifetime. - - - - - Specifies whether the TrailModule is enabled or disabled. - - - - - Configures the trails to generate Normals and Tangents. With this data, Scene lighting can affect the trails via Normal Maps and the Unity Standard Shader, or your own custom-built Shaders. - - - - - Toggle whether the trail inherits the particle color as its starting color. - - - - - The curve describing the trail lifetime, throughout the lifetime of the particle. - - - - - A multiplier for ParticleSystem.TrailModule._lifetime. - - - - - Set the minimum distance each trail can travel before the system adds a new vertex to it. - - - - - Choose how the system generates the particle trails. - - - - - Choose what proportion of particles receive a trail. - - - - - Select how many lines to create through the Particle System. - - - - - Apply a shadow bias to prevent self-shadowing artifacts. The specified value is the proportion of the trail width at each segment. - - - - - Set whether the particle size acts as a multiplier on top of the trail lifetime. - - - - - Set whether the particle size acts as a multiplier on top of the trail width. - - - - - Specifies whether, if you use this system as a sub-emitter, ribbons connect particles from each parent particle independently. - - - - - Choose whether the U coordinate of the trail Texture is tiled or stretched. - - - - - The curve describing the width of each trail point. - - - - - A multiplier for ParticleSystem.TrailModule._widthOverTrail. - - - - - Drop new trail points in world space, regardless of Particle System Simulation Space. - - - - - Script interface for storing the particle trail data. - - - - - Script interface for the TriggerModule. - - - - - Indicates the number of collision shapes attached to this Particle System trigger. - - - - - Determines whether collider information is available when calling ParticleSystem::GetTriggerParticles. - - - - - Specifies whether the TriggerModule is enabled or disabled. - - - - - Choose what action to perform when particles enter the trigger volume. - - - - - Choose what action to perform when particles leave the trigger volume. - - - - - Choose what action to perform when particles are inside the trigger volume. - - - - - The maximum number of collision shapes that can be attached to this Particle System trigger. - - - - - Choose what action to perform when particles are outside the trigger volume. - - - - - A multiplier Unity applies to the size of each particle before it processes overlaps. - - - - - Adds a Collision shape associated with this Particle System trigger. - - The Collider to associate with this trigger. - - - - - Gets a collision shape associated with this Particle System trigger. - - The Collider to return. - - The Collider at the given index. - - - - - Removes a collision shape associated with this Particle System trigger. - - The Collider to remove. - - - - Removes a collision shape associated with this Particle System trigger. - - The Collider to remove. - - - - Sets a Collision shape associated with this Particle System trigger. - - The Collider entry to assign. - The Collider to associate with this trigger. - - - - Triggers the specified sub emitter on all particles of the Particle System. - - Index of the sub emitter to trigger. - - - - Triggers the specified sub emitter on the specified particle(s) of the Particle System. - - Index of the sub emitter to trigger. - Triggers the sub emtter on a single particle. - Triggers the sub emtter on a list of particles. - - - - Triggers the specified sub emitter on the specified particle(s) of the Particle System. - - Index of the sub emitter to trigger. - Triggers the sub emtter on a single particle. - Triggers the sub emtter on a list of particles. - - - - Script interface for the VelocityOverLifetimeModule. - - - - - Specifies whether the VelocityOverLifetimeModule is enabled or disabled. - - - - - Specify a custom center of rotation for the orbital and radial velocities. - - - - - A multiplier for _orbitalOffsetX. - - - - - Specify a custom center of rotation for the orbital and radial velocities. - - - - - A multiplier for _orbitalOffsetY. - - - - - Specify a custom center of rotation for the orbital and radial velocities. - - - - - A multiplier for _orbitalOffsetY. - - - - - Curve to control particle speed based on lifetime, around the x-axis. - - - - - Speed multiplier along the x-axis. - - - - - Curve to control particle speed based on lifetime, around the y-axis. - - - - - Speed multiplier along the y-axis. - - - - - Curve to control particle speed based on lifetime, around the z-axis. - - - - - Speed multiplier along the z-axis. - - - - - Curve to control particle speed based on lifetime, away from a center position. - - - - - A multiplier for ParticleSystem.VelocityOverLifetimeModule._radial. - - - - - Specifies if the velocities are in local space (rotated with the transform) or world space. - - - - - Curve to control particle speed based on lifetime, without affecting the direction of the particles. - - - - - A multiplier for ParticleSystem.VelocityOverLifetimeModule._speedModifier. - - - - - Curve to control particle speed based on lifetime, on the x-axis. - - - - - A multiplier for ParticleSystem.VelocityOverLifetimeModule._x - - - - - Curve to control particle speed based on lifetime, on the y-axis. - - - - - A multiplier for ParticleSystem.VelocityOverLifetimeModule._y. - - - - - Curve to control particle speed based on lifetime, on the z-axis. - - - - - A multiplier for ParticleSystem.VelocityOverLifetimeModule._z. - - - - - The animation mode. - - - - - Use a regular grid to construct a sequence of animation frames. - - - - - Use a list of sprites to construct a sequence of animation frames. - - - - - The mode used for selecting rows of an animation in the Texture Sheet Animation Module. - - - - - Use a specific row for all particles. - - - - - Use the mesh index as the row, so that meshes can be mapped to specific animation frames. - - - - - Use a random row for each particle. - - - - - Control how animation frames are selected. - - - - - Select animation frames sequentially at a constant rate of the specified frames per second. - - - - - Select animation frames based on the particle ages. - - - - - Select animation frames based on the particle speeds. - - - - - The animation type. - - - - - Animate a single row in the sheet from left to right. - - - - - Animate over the whole texture sheet from left to right, top to bottom. - - - - - Whether collider information is available when using the ParticleSystem::GetTriggerParticles method. - - - - - ParticleSystem::GetTriggerParticles returns all colliders that each particle is interacting with. - - - - - ParticleSystem::GetTriggerParticles does not return any information about which colliders each particle is interacting with. - - - - - ParticleSystem::GetTriggerParticles may only return one collider that each particle is interacting with. - - - - - Whether to use 2D or 3D colliders for particle collisions. - - - - - Use 2D colliders to collide particles against. - - - - - Use 3D colliders to collide particles against. - - - - - Quality of world collisions. Medium and low quality are approximate and may leak particles. - - - - - The most accurate world collisions. - - - - - Fastest and most approximate world collisions. - - - - - Approximate world collisions. - - - - - The type of collisions to use for a given Particle System. - - - - - Collide with a list of planes. - - - - - Collide with the world geometry. - - - - - The action to perform when the Particle System is offscreen. - - - - - Continue simulating the Particle System when it is offscreen. - - - - - For looping effects, the simulation is paused when offscreen, and for one-shot effects, the simulation will continue playing. - - - - - Pause the Particle System simulation when it is offscreen. - - - - - Pause the Particle System simulation when it is offscreen, and perform an extra simulation when the system comes back onscreen, creating the impression that it was never paused. - - - - - The particle curve mode. - - - - - Use a single constant for the ParticleSystem.MinMaxCurve. - - - - - Use a single curve for the ParticleSystem.MinMaxCurve. - - - - - Use a random value between 2 constants for the ParticleSystem.MinMaxCurve. - - - - - Use a random value between 2 curves for the ParticleSystem.MinMaxCurve. - - - - - Which stream of custom particle data to set. - - - - - The first stream of custom per-particle data. - - - - - The second stream of custom per-particle data. - - - - - Which mode CustomDataModule uses to generate its data. - - - - - Generate data using ParticleSystem.MinMaxGradient. - - - - - Don't generate any data. - - - - - Generate data using ParticleSystem.MinMaxCurve. - - - - - The mode in which particles are emitted. - - - - - Emit when emitter moves. - - - - - Emit over time. - - - - - Control how a Particle System calculates its velocity. - - - - - Calculate the Particle System velocity by using a Rigidbody or Rigidbody2D component, if one exists on the GameObject. - - - - - Calculate the Particle System velocity by using the Transform component. - - - - - Script interface for Particle System Force Fields. - - - - - Apply a linear force along the local X axis to particles within the volume of the Force Field. - - - - - Apply a linear force along the local Y axis to particles within the volume of the Force Field. - - - - - Apply a linear force along the local Z axis to particles within the volume of the Force Field. - - - - - Apply drag to particles within the volume of the Force Field. - - - - - Determines the size of the shape used for influencing particles. - - - - - Apply gravity to particles within the volume of the Force Field. - - - - - When using the gravity force, set this value between 0 and 1 to control the focal point of the gravity effect. - - - - - Describes the length of the Cylinder when using the Cylinder Force Field shape to influence particles. - - - - - When using Drag, the drag strength will be multiplied by the size of the particles if this toggle is enabled. - - - - - When using Drag, the drag strength will be multiplied by the speed of the particles if this toggle is enabled. - - - - - Controls how strongly particles are dragged into the vortex motion. - - - - - Apply randomness to the Force Field axis that particles will travel around. - - - - - The speed at which particles are propelled around a vortex. - - - - - Selects the type of shape used for influencing particles. - - - - - Setting a value greater than 0 creates a hollow Force Field shape. This will cause particles to not be affected by the Force Field when closer to the center of the volume than the startRange property. - - - - - Apply forces to particles within the volume of the Force Field, by using a 3D texture containing vector field data. - - - - - Controls how strongly particles are dragged into the vector field motion. - - - - - The speed at which particles are propelled through the vector field. - - - - - The type of shape used for influencing particles in the Force Field Component. - - - - - Influence particles inside a box shape. - - - - - Influence particles inside a cylinder shape. - - - - - Influence particles inside a hemisphere shape. - - - - - Influence particles inside a sphere shape. - - - - - The particle GameObject filtering mode that specifies which objects are used by specific Particle System modules. - - - - - Include objects based on a layer mask, where all objects that match the mask are included. - - - - - Include objects based on both a layer mask and an explicitly provided list. - - - - - Include objects based on an explicitly provided list. - - - - - The particle gradient mode. - - - - - Use a single color for the ParticleSystem.MinMaxGradient. - - - - - Use a single color gradient for the ParticleSystem.MinMaxGradient. - - - - - Define a list of colors in the ParticleSystem.MinMaxGradient, to be chosen from at random. - - - - - Use a random value between 2 colors for the ParticleSystem.MinMaxGradient. - - - - - Use a random value between 2 color gradients for the ParticleSystem.MinMaxGradient. - - - - - How to apply emitter velocity to particles. - - - - - Each particle's velocity is set to the emitter's current velocity value, every frame. - - - - - Each particle inherits the emitter's velocity on the frame when it was initially emitted. - - - - - Inherit from this interface to implement a Particle System job. - - - - - Implement this method to access and modify particle properties. - - Contains the particle properties. - - - - Inherit from this interface to implement a Particle System job. - - - - - Implement this method to access and modify particle properties. - - Contains the particle properties. - The index of the current particle. - - - - Inherit from this interface to implement a Particle System job. - - - - - Implement this method to access and modify particle properties. - - Contains the particle properties. - The first particle index that this job should process. - The number of particles that this job should process. - - - - This struct specifies all the per-particle data. - - - - - Specifies how long each particle has been alive. - - - - - Specifies the number of particles alive in the Particle System. - - - - - This array contains the custom data values when you use a CustomDataModule, or when you call SetCustomParticleData. - - - - - This array contains the custom data values when you use a CustomDataModule, or when you call SetCustomParticleData. - - - - - The lifetime of each particle, stored as 1.0f / lifetime. - - - - - The position of each particle. - - - - - The random seed assigned to each particle. - - - - - The angular velocity of each particle. - - - - - The rotation of each particle. - - - - - The size of each particle. - - - - - The initial color of each particle. - - - - - The velocity of each particle. - - - - - A container to hold x, y, and z-axis data for particles. - - - - - The x-axis value for each particle. - - - - - The y-axis value for each particle. - - - - - The z-axis value for each particle. - - - - - A container to hold 4 arrays of data for particles. - - - - - The w-axis value for each particle. - - - - - The x-axis value for each particle. - - - - - The y-axis value for each particle. - - - - - The z-axis value for each particle. - - - - - The mesh emission type. - - - - - Emit from the edges of the mesh. - - - - - Emit from the surface of the mesh. - - - - - Emit from the vertices of the mesh. - - - - - The quality of the generated noise. - - - - - High quality 3D noise. - - - - - Low quality 1D noise. - - - - - Medium quality 2D noise. - - - - - What action to perform when the particle trigger module passes a test. - - - - - Send the OnParticleTrigger command to the Particle System's script. - - - - - Do nothing. - - - - - Kill all particles that pass this test. - - - - - Use this class to render particles on to the screen. - - - - - The number of currently active custom vertex streams. - - - - - Control the direction that particles face. - - - - - Allow billboard particles to roll around their z-axis. - - - - - How much do the particles stretch depending on the Camera's speed. - - - - - Enables GPU Instancing on platforms that support it. - - - - - Flip a percentage of the particles, along each axis. - - - - - Enables freeform stretching behavior. - - - - - How much are the particles stretched in their direction of motion, defined as the length of the particle compared to its width. - - - - - Specifies how the Particle System Renderer interacts with SpriteMask. - - - - - Clamp the maximum particle size. - - - - - The Mesh that the particle uses instead of a billboarded Texture. - - - - - The number of Meshes the system uses for particle rendering. - - - - - Clamp the minimum particle size. - - - - - Specifies how much a billboard particle orients its normals towards the Camera. - - - - - Modify the pivot point used for rotating particles. - - - - - Specifies how the system draws particles. - - - - - Rotate the particles based on the direction they are stretched in. This is added on top of other particle rotation. - - - - - Apply a shadow bias to prevent self-shadowing artifacts. The specified value is the proportion of the particle size. - - - - - Biases Particle System sorting amongst other transparencies. - - - - - Specifies how to sort particles within a system. - - - - - Determines whether the Particle System can be rendered using GPU Instancing. - - - - - Set the Material that the TrailModule uses to attach trails to particles. - - - - - Specifies how much particles stretch depending on their velocity. - - - - - Query whether the Particle System Renderer uses a particular set of vertex streams. - - Streams to query. - - true if the queried streams are enabled. Returns false otherwise. - - - - - Creates a snapshot of ParticleSystemRenderer and stores it in mesh. - - A static Mesh to receive the snapshot of the particles. - The Camera used to determine which way camera-space particles face. - Specifies whether to include the rotation and scale of the Transform in the baked Mesh. - - - - Creates a snapshot of ParticleSystemRenderer and stores it in mesh. - - A static Mesh to receive the snapshot of the particles. - The Camera used to determine which way camera-space particles face. - Specifies whether to include the rotation and scale of the Transform in the baked Mesh. - - - - Creates a snapshot of ParticleSystemRenderer and stores it in mesh. - - A static Mesh to receive the snapshot of the particles. - The Camera used to determine which way camera-space particles face. - Specifies whether to include the rotation and scale of the Transform in the baked Mesh. - - - - Creates a snapshot of ParticleSystemRenderer and stores it in mesh. - - A static Mesh to receive the snapshot of the particles. - The Camera used to determine which way camera-space particles face. - Specifies whether to include the rotation and scale of the Transform in the baked Mesh. - - - - Creates a snapshot of ParticleSystem Trails and stores them in mesh. - - A static Mesh to receive the snapshot of the particle trails. - The Camera used to determine which way camera-space trails face. - Specifies whether to include the rotation and scale of the Transform in the baked Mesh. - - - - Creates a snapshot of ParticleSystem Trails and stores them in mesh. - - A static Mesh to receive the snapshot of the particle trails. - The Camera used to determine which way camera-space trails face. - Specifies whether to include the rotation and scale of the Transform in the baked Mesh. - - - - Creates a snapshot of ParticleSystem Trails and stores them in mesh. - - A static Mesh to receive the snapshot of the particle trails. - The Camera used to determine which way camera-space trails face. - Specifies whether to include the rotation and scale of the Transform in the baked Mesh. - - - - Creates a snapshot of ParticleSystem Trails and stores them in mesh. - - A static Mesh to receive the snapshot of the particle trails. - The Camera used to determine which way camera-space trails face. - Specifies whether to include the rotation and scale of the Transform in the baked Mesh. - - - - Disable a set of vertex Shader streams on the Particle System Renderer. -The position stream is always enabled, and any attempts to remove it are ignored. - - Streams to disable. - - - - Enable a set of vertex Shader streams on the Particle System renderer. - - Streams to enable. - - - - Query which Vertex Shader streams are enabled on the ParticleSystemRenderer. - - The array of streams to populate. - - - - Query whether the Particle System renderer uses a particular set of vertex streams. - - Streams to query. - - The subset of the queried streams that are actually enabled. - - - - - Get the array of Meshes to be used as particles. - - This array is populated with the list of Meshes being used for particle rendering. - - The number of Meshes actually written to the destination array. - - - - - Enables a set of vertex Shader streams on the ParticleSystemRenderer. - - The new array of enabled vertex streams. - - - - Set an array of Meshes to use as particles when the ParticleSystemRenderer.renderMode is set to ParticleSystemRenderMode.Mesh. - - Array of Meshes to use. - Number of elements from the Mesh array to apply. - - - - Set an array of Meshes to use as particles when the ParticleSystemRenderer.renderMode is set to ParticleSystemRenderMode.Mesh. - - Array of Meshes to use. - Number of elements from the Mesh array to apply. - - - - The rendering mode for particle systems. - - - - - Render particles as billboards facing the active camera. (Default) - - - - - Render particles as billboards always facing up along the y-Axis. - - - - - Render particles as meshes. - - - - - Do not render particles. - - - - - Stretch particles in the direction of motion. - - - - - Render particles as billboards always facing the player, but not pitching along the x-Axis. - - - - - How particles are aligned when rendered. - - - - - Particles face the eye position. - - - - - Particles align with their local transform. - - - - - Particles are aligned to their direction of travel. - - - - - Particles face the camera plane. - - - - - Particles align with the world. - - - - - Control how particles are removed from the Particle System. - - - - - Particles are removed when their age exceeds their lifetime. - - - - - Particle ages loop until they need to be removed. Particles are removed when creating new particles would exceed the Max Particles property. - - - - - Particle ages pause at the end of their lifetime until they need to be removed. Particles are removed when creating new particles would exceed the Max Particles property. - - - - - Control how particle systems apply transform scale. - - - - - Scale the Particle System using the entire transform hierarchy. - - - - - Scale the Particle System using only its own transform scale. (Ignores parent scale). - - - - - Only apply transform scale to the shape component, which controls where - particles are spawned, but does not affect their size or movement. - - - - - - The mode used to generate new points in a shape. - - - - - Distribute new particles around the shape evenly. - - - - - Animate the emission point around the shape. - - - - - Animate the emission point around the shape, alternating between clockwise and counter-clockwise directions. - - - - - Generate points randomly. (Default) - - - - - The texture channel. - - - - - The alpha channel. - - - - - The blue channel. - - - - - The green channel. - - - - - The red channel. - - - - - The emission shape. - - - - - Emit from the volume of a box. - - - - - Emit from the edges of a box. - - - - - Emit from the surface of a box. - - - - - Emit from a circle. - - - - - Emit from the edge of a circle. - - - - - Emit from the base of a cone. - - - - - Emit from the base surface of a cone. - - - - - Emit from a cone. - - - - - Emit from the surface of a cone. - - - - - Emit from a Donut. - - - - - Emit from a half-sphere. - - - - - Emit from the surface of a half-sphere. - - - - - Emit from a mesh. - - - - - Emit from a mesh renderer. - - - - - Emit from a rectangle. - - - - - Emit from an edge. - - - - - Emit from a skinned mesh renderer. - - - - - Emit from a sphere. - - - - - Emit from the surface of a sphere. - - - - - Emit from a sprite. - - - - - Emit from a sprite renderer. - - - - - The space to simulate particles in. - - - - - Simulate particles relative to a custom transform component, defined by ParticleSystem.MainModule.customSimulationSpace. - - - - - Simulate particles in local space. - - - - - Simulate particles in world space. - - - - - The sorting mode for particle systems. - - - - - Sort based on depth from the camera plane. - - - - - Sort based on distance to the camera position. For orthographic cameras, this mode is the same as sorting by depth. - - - - - No sorting. - - - - - Sort the oldest particles to the front. - - - - - Sort the youngest particles to the front. - - - - - The action to perform when the Particle System stops. - - - - - Call OnParticleSystemStopped on the ParticleSystem script. - - - - - Destroy the GameObject containing the Particle System. - - - - - Disable the GameObject containing the Particle System. - - - - - Do nothing. - - - - - The behavior to apply when calling ParticleSystem.Stop|Stop. - - - - - Stops Particle System emitting any further particles. All existing particles will remain until they expire. - - - - - Stops Particle System emitting and removes all existing emitted particles. - - - - - The properties of sub-emitter particles. - - - - - When spawning new particles, multiply the start color by the color of the parent particles. - - - - - When spawning new particles, use the duration and age properties from the parent system, when sampling MainModule curves in the Sub-Emitter. - - - - - When spawning new particles, inherit all available properties from the parent particles. - - - - - New particles will have a shorter lifespan, the closer their parent particles are to death. - - - - - When spawning new particles, do not inherit any properties from the parent particles. - - - - - When spawning new particles, add the start rotation to the rotation of the parent particles. - - - - - When spawning new particles, multiply the start size by the size of the parent particles. - - - - - The events that cause new particles to be spawned. - - - - - Spawns new particles when particles from the parent system are born. - - - - - Spawns new particles when particles from the parent system collide with something. - - - - - Spawns new particles when particles from the parent system die. - - - - - Spawns new particles when triggered from script using ParticleSystem.TriggerSubEmitter. - - - - - Spawns new particles when particles from the parent system pass conditions in the Trigger Module. - - - - - Choose how Particle Trails are generated. - - - - - Makes a trail behind each particle as the particle moves. - - - - - Draws a line between each particle, connecting the youngest particle to the oldest. - - - - - Choose how textures are applied to Particle Trails. - - - - - Map the texture once along the entire length of the trail, assuming all vertices are evenly spaced. - - - - - Repeat the texture along the trail, repeating at a rate of once per trail segment. To adjust the tiling rate, use Material.SetTextureScale. - - - - - Map the texture once along the entire length of the trail. - - - - - Repeat the texture along the trail. To set the tiling rate, use Material.SetTextureScale. - - - - - The different types of particle triggers. - - - - - Trigger when particles enter the collision volume. - - - - - Trigger when particles leave the collision volume. - - - - - Trigger when particles are inside the collision volume. - - - - - Trigger when particles are outside the collision volume. - - - - - All possible Particle System vertex shader inputs. - - - - - The normalized age of each particle, from 0 to 1. - - - - - The amount to blend between animated texture frames, from 0 to 1. - - - - - The current animation frame index of each particle. - - - - - The center position of the entire particle, in world space. - - - - - The color of each particle. - - - - - One custom value for each particle, defined by the Custom Data Module, or ParticleSystem.SetCustomParticleData. - - - - - Two custom values for each particle, defined by the Custom Data Module, or ParticleSystem.SetCustomParticleData. - - - - - Three custom values for each particle, defined by the Custom Data Module, or ParticleSystem.SetCustomParticleData. - - - - - Four custom values for each particle, defined by the Custom Data Module, or ParticleSystem.SetCustomParticleData. - - - - - One custom value for each particle, defined by the Custom Data Module, or ParticleSystem.SetCustomParticleData. - - - - - Two custom values for each particle, defined by the Custom Data Module, or ParticleSystem.SetCustomParticleData. - - - - - Three custom values for each particle, defined by the Custom Data Module, or ParticleSystem.SetCustomParticleData. - - - - - Four custom values for each particle, defined by the Custom Data Module, or ParticleSystem.SetCustomParticleData. - - - - - The reciprocal of the starting lifetime, in seconds (1.0f / startLifetime). - - - - - The index of the mesh used by the current particle. - - - - - The X axis noise on the current frame. - - - - - The X and Y axis noise on the current frame. - - - - - The 3D noise on the current frame. - - - - - The accumulated X axis noise, over the lifetime of the particle. - - - - - The accumulated X and Y axis noise, over the lifetime of the particle. - - - - - The accumulated 3D noise, over the lifetime of the particle. - - - - - The vertex normal of each particle. - - - - - The position of each particle vertex, in world space. - - - - - The Z axis rotation of each particle. - - - - - The 3D rotation of each particle. - - - - - The Z axis rotational speed of each particle. - - - - - The 3D rotational speed of each particle. - - - - - The X axis size of each particle. - - - - - The X and Y axis sizes of each particle. - - - - - The 3D size of each particle. - - - - - The speed of each particle, calculated by taking the magnitude of the velocity. - - - - - A random number for each particle, which remains constant during their lifetime. - - - - - Two random numbers for each particle, which remain constant during their lifetime. - - - - - Three random numbers for each particle, which remain constant during their lifetime. - - - - - Four random numbers for each particle, which remain constant during their lifetime. - - - - - The tangent vector for each particle (for normal mapping). - - - - - The first UV stream of each particle. - - - - - The second UV stream of each particle. - - - - - The third UV stream of each particle (only for meshes). - - - - - The fourth UV stream of each particle (only for meshes). - - - - - A random number for each particle, which changes during their lifetime. - - - - - Two random numbers for each particle, which change during their lifetime. - - - - - Three random numbers for each particle, which change during their lifetime. - - - - - Four random numbers for each particle, which change during their lifetime. - - - - - The velocity of each particle, in world space. - - - - - The vertex ID of each particle. - - - - - All possible Particle System vertex shader inputs. - - - - - A mask with all vertex streams enabled. - - - - - The center position of each particle, with the vertex ID of each particle, from 0-3, stored in the w component. - - - - - The color of each particle. - - - - - The first stream of custom data, supplied from script. - - - - - The second stream of custom data, supplied from script. - - - - - Alive time as a 0-1 value in the X component, and Total Lifetime in the Y component. -To get the current particle age, simply multiply X by Y. - - - - - A mask with no vertex streams enabled. - - - - - The normal of each particle. - - - - - The world space position of each particle. - - - - - 4 random numbers. The first 3 are deterministic and assigned once when each particle is born, but the 4th value will change during the lifetime of the particle. - - - - - The rotation of each particle. - - - - - The size of each particle. - - - - - Tangent vectors for normal mapping. - - - - - The texture coordinates of each particle. - - - - - With the TextureSheetAnimationModule enabled, this contains the UVs for the second texture frame, the blend factor for each particle, and the raw frame, allowing for blending of frames. - - - - - The 3D velocity of each particle. - - - - - Structure containing minimum and maximum terrain patch height values. - - - - - Maximum height of a terrain patch. - - - - - Minimum height of a terrain patch. - - - - - Physics material describes how to handle colliding objects (friction, bounciness). - - - - - Determines how the bounciness is combined. - - - - - How bouncy is the surface? A value of 0 will not bounce. A value of 1 will bounce without any loss of energy. - - - - - The friction used when already moving. This value is usually between 0 and 1. - - - - - If anisotropic friction is enabled, dynamicFriction2 will be applied along frictionDirection2. - - - - - Determines how the friction is combined. - - - - - The direction of anisotropy. Anisotropic friction is enabled if the vector is not zero. - - - - - The friction coefficient used when an object is lying on a surface. - - - - - If anisotropic friction is enabled, staticFriction2 will be applied along frictionDirection2. - - - - - Creates a new material. - - - - - Creates a new material named name. - - - - - - Describes how physics materials of the colliding objects are combined. - -The friction force as well as the residual bounce impulse are applied symmertrically to both of the colliders in contact, so each pair of overlapping colliders must have a single set of friction and bouciness settings. However, one can set arbitrary physics materials to any colliders. For that particular reason, there is a mechanism that allows the combination of two different sets of properties that correspond to each of the colliders in contact into one set to be used in the solver. - -Specifying Average, Maximum, Minimum or Multiply as the physics material combine mode, you directly set the function that is used to combine the settings corresponding to the two overlapping colliders into one set of settings that can be used to apply the material effect. - -Note that there is a special case when the two overlapping colliders have physics materials with different combine modes set. In this particular case, the function that has the highest priority is used. The priority order is as follows: Average < Minimum < Multiply < Maximum. For example, if one material has Average set but the other one has Maximum, then the combine function to be used is Maximum, since it has higher priority. - - - - - Averages the friction/bounce of the two colliding materials. - - - - - Uses the larger friction/bounce of the two colliding materials. - - - - - Uses the smaller friction/bounce of the two colliding materials. - - - - - Multiplies the friction/bounce of the two colliding materials. - - - - - Global physics properties and helper methods. - - - - - Sets whether the physics should be simulated automatically or not. - - - - - Whether or not to automatically sync transform changes with the physics system whenever a Transform component changes. - - - - - Two colliding objects with a relative velocity below this will not bounce (default 2). Must be positive. - - - - - Cloth Gravity setting. -Set gravity for all cloth components. - - - - - The default contact offset of the newly created colliders. - - - - - Default maximum angular speed of the dynamic Rigidbody, in radians (default 50). - - - - - The maximum default velocity needed to move a Rigidbody's collider out of another collider's surface penetration. Must be positive. - - - - - The PhysicsScene automatically created when Unity starts. - - - - - The defaultSolverIterations determines how accurately Rigidbody joints and collision contacts are resolved. (default 6). Must be positive. - - - - - The defaultSolverVelocityIterations affects how accurately the Rigidbody joints and collision contacts are resolved. (default 1). Must be positive. - - - - - The gravity applied to all rigid bodies in the Scene. - - - - - Sets the minimum separation distance for cloth inter-collision. - - - - - Sets the cloth inter-collision stiffness. - - - - - The default maximum angular velocity permitted for any rigid bodies (default 7). Must be positive. - - - - - The minimum contact penetration value in order to apply a penalty force (default 0.05). Must be positive. - - - - - Whether physics queries should hit back-face triangles. - - - - - Specifies whether queries (raycasts, spherecasts, overlap tests, etc.) hit Triggers by default. - - - - - Determines whether the garbage collector should reuse only a single instance of a Collision type for all collision callbacks. - - - - - The default angular velocity, below which objects start sleeping (default 0.14). Must be positive. - - - - - The mass-normalized energy threshold, below which objects start going to sleep. - - - - - The default linear velocity, below which objects start going to sleep (default 0.15). Must be positive. - - - - - Layer mask constant to select all layers. - - - - - Prepares the Mesh for use with a MeshCollider. - - The instance ID of the Mesh to bake collision data from. - A flag to indicate whether to bake convex geometry or not. - - - - Casts the box along a ray and returns detailed information on what was hit. - - Center of the box. - Half the size of the box in each dimension. - The direction in which to cast the box. - Rotation of the box. - The max length of the cast. - A that is used to selectively ignore colliders when casting a capsule. - Specifies whether this query should hit Triggers. - - True, if any intersections were found. - - - - - Casts the box along a ray and returns detailed information on what was hit. - - Center of the box. - Half the size of the box in each dimension. - The direction in which to cast the box. - If true is returned, hitInfo will contain more information about where the collider was hit. (See Also: RaycastHit). - Rotation of the box. - The max length of the cast. - A that is used to selectively ignore colliders when casting a capsule. - Specifies whether this query should hit Triggers. - - True, if any intersections were found. - - - - - Like Physics.BoxCast, but returns all hits. - - Center of the box. - Half the size of the box in each dimension. - The direction in which to cast the box. - Rotation of the box. - The max length of the cast. - A that is used to selectively ignore colliders when casting a capsule. - Specifies whether this query should hit Triggers. - - - All colliders that were hit. - - - - - Cast the box along the direction, and store hits in the provided buffer. - - Center of the box. - Half the size of the box in each dimension. - The direction in which to cast the box. - The buffer to store the results in. - Rotation of the box. - The max length of the cast. - A that is used to selectively ignore colliders when casting a capsule. - Specifies whether this query should hit Triggers. - - - The amount of hits stored to the results buffer. - - - - - Casts a capsule against all colliders in the Scene and returns detailed information on what was hit. - - The center of the sphere at the start of the capsule. - The center of the sphere at the end of the capsule. - The radius of the capsule. - The direction into which to sweep the capsule. - The max length of the sweep. - A that is used to selectively ignore colliders when casting a capsule. - Specifies whether this query should hit Triggers. - - True when the capsule sweep intersects any collider, otherwise false. - - - - - - - The center of the sphere at the start of the capsule. - The center of the sphere at the end of the capsule. - The radius of the capsule. - The direction into which to sweep the capsule. - The max length of the sweep. - If true is returned, hitInfo will contain more information about where the collider was hit. (See Also: RaycastHit). - A that is used to selectively ignore colliders when casting a capsule. - Specifies whether this query should hit Triggers. - - - - Like Physics.CapsuleCast, but this function will return all hits the capsule sweep intersects. - - The center of the sphere at the start of the capsule. - The center of the sphere at the end of the capsule. - The radius of the capsule. - The direction into which to sweep the capsule. - The max length of the sweep. - A that is used to selectively ignore colliders when casting a capsule. - Specifies whether this query should hit Triggers. - - - An array of all colliders hit in the sweep. - - - - - Casts a capsule against all colliders in the Scene and returns detailed information on what was hit into the buffer. - - The center of the sphere at the start of the capsule. - The center of the sphere at the end of the capsule. - The radius of the capsule. - The direction into which to sweep the capsule. - The buffer to store the hits into. - The max length of the sweep. - A that is used to selectively ignore colliders when casting a capsule. - Specifies whether this query should hit Triggers. - - The amount of hits stored into the buffer. - - - - - Check whether the given box overlaps with other colliders or not. - - Center of the box. - Half the size of the box in each dimension. - Rotation of the box. - A that is used to selectively ignore colliders when casting a ray. - Specifies whether this query should hit Triggers. - - True, if the box overlaps with any colliders. - - - - - Checks if any colliders overlap a capsule-shaped volume in world space. - - The center of the sphere at the start of the capsule. - The center of the sphere at the end of the capsule. - The radius of the capsule. - A that is used to selectively ignore colliders when casting a capsule. - Specifies whether this query should hit Triggers. - - - - - Returns true if there are any colliders overlapping the sphere defined by position and radius in world coordinates. - - Center of the sphere. - Radius of the sphere. - A that is used to selectively ignore colliders when casting a capsule. - Specifies whether this query should hit Triggers. - - - - Returns a point on the given collider that is closest to the specified location. - - Location you want to find the closest point to. - The collider that you find the closest point on. - The position of the collider. - The rotation of the collider. - - The point on the collider that is closest to the specified location. - - - - - Compute the minimal translation required to separate the given colliders apart at specified poses. - - The first collider. - Position of the first collider. - Rotation of the first collider. - The second collider. - Position of the second collider. - Rotation of the second collider. - Direction along which the translation required to separate the colliders apart is minimal. - The distance along direction that is required to separate the colliders apart. - - True, if the colliders overlap at the given poses. - - - - - Layer mask constant to select default raycast layers. - - - - - Checks whether the collision detection system will ignore all collisionstriggers between collider1 and collider2/ or not. - - The first collider to compare to collider2. - The second collider to compare to collider1. - - Whether the collision detection system will ignore all collisionstriggers between collider1 and collider2/ or not. - - - - - Are collisions between layer1 and layer2 being ignored? - - - - - - - Makes the collision detection system ignore all collisions between collider1 and collider2. - - Any collider. - Another collider you want to have collider1 to start or stop ignoring collisions with. - Whether or not the collisions between the two colliders should be ignored or not. - - - - Makes the collision detection system ignore all collisions between any collider in layer1 and any collider in layer2. - -Note that IgnoreLayerCollision will reset the trigger state of affected colliders, so you might receive OnTriggerExit and OnTriggerEnter messages in response to calling this. - - - - - - - - Layer mask constant to select ignore raycast layer. - - - - - Returns true if there is any collider intersecting the line between start and end. - - Start point. - End point. - A that is used to selectively ignore colliders when casting a ray. - Specifies whether this query should hit Triggers. - - - - Returns true if there is any collider intersecting the line between start and end. - - Start point. - End point. - A that is used to selectively ignore colliders when casting a ray. - Specifies whether this query should hit Triggers. - If true is returned, hitInfo will contain more information about where the collider was hit. (See Also: RaycastHit). - - - - Find all colliders touching or inside of the given box. - - Center of the box. - Half of the size of the box in each dimension. - Rotation of the box. - A that is used to selectively ignore colliders when casting a ray. - Specifies whether this query should hit Triggers. - - Colliders that overlap with the given box. - - - - - Find all colliders touching or inside of the given box, and store them into the buffer. - - Center of the box. - Half of the size of the box in each dimension. - The buffer to store the results in. - Rotation of the box. - A that is used to selectively ignore colliders when casting a ray. - Specifies whether this query should hit Triggers. - - - The amount of colliders stored in results. - - - - - Check the given capsule against the physics world and return all overlapping colliders. - - The center of the sphere at the start of the capsule. - The center of the sphere at the end of the capsule. - The radius of the capsule. - A that is used to selectively ignore colliders when casting a capsule. - Specifies whether this query should hit Triggers. - - Colliders touching or inside the capsule. - - - - - Check the given capsule against the physics world and return all overlapping colliders in the user-provided buffer. - - The center of the sphere at the start of the capsule. - The center of the sphere at the end of the capsule. - The radius of the capsule. - The buffer to store the results into. - A that is used to selectively ignore colliders when casting a capsule. - Specifies whether this query should hit Triggers. - - The amount of entries written to the buffer. - - - - - Computes and stores colliders touching or inside the sphere. - - Center of the sphere. - Radius of the sphere. - A defines which layers of colliders to include in the query. - Specifies whether this query should hit Triggers. - - Returns an array with all colliders touching or inside the sphere. - - - - - Computes and stores colliders touching or inside the sphere into the provided buffer. - - Center of the sphere. - Radius of the sphere. - The buffer to store the results into. - A defines which layers of colliders to include in the query. - Specifies whether this query should hit Triggers. - - Returns the amount of colliders stored into the results buffer. - - - - - Casts a ray, from point origin, in direction direction, of length maxDistance, against all colliders in the Scene. - - The starting point of the ray in world coordinates. - The direction of the ray. - The max distance the ray should check for collisions. - A that is used to selectively ignore Colliders when casting a ray. - Specifies whether this query should hit Triggers. - - Returns true if the ray intersects with a Collider, otherwise false. - - - - - Casts a ray against all colliders in the Scene and returns detailed information on what was hit. - - The starting point of the ray in world coordinates. - The direction of the ray. - If true is returned, hitInfo will contain more information about where the closest collider was hit. (See Also: RaycastHit). - The max distance the ray should check for collisions. - A that is used to selectively ignore colliders when casting a ray. - Specifies whether this query should hit Triggers. - - Returns true when the ray intersects any collider, otherwise false. - - - - - Same as above using ray.origin and ray.direction instead of origin and direction. - - The starting point and direction of the ray. - The max distance the ray should check for collisions. - A that is used to selectively ignore colliders when casting a ray. - Specifies whether this query should hit Triggers. - - Returns true when the ray intersects any collider, otherwise false. - - - - - Same as above using ray.origin and ray.direction instead of origin and direction. - - The starting point and direction of the ray. - If true is returned, hitInfo will contain more information about where the closest collider was hit. (See Also: RaycastHit). - The max distance the ray should check for collisions. - A that is used to selectively ignore colliders when casting a ray. - Specifies whether this query should hit Triggers. - - Returns true when the ray intersects any collider, otherwise false. - - - - - Casts a ray through the Scene and returns all hits. Note that order of the results is undefined. - - The starting point and direction of the ray. - The max distance the rayhit is allowed to be from the start of the ray. - A that is used to selectively ignore colliders when casting a ray. - Specifies whether this query should hit Triggers. - - An array of RaycastHit objects. Note that the order of the results is undefined. - - - - - See Also: Raycast. - - The starting point of the ray in world coordinates. - The direction of the ray. - The max distance the rayhit is allowed to be from the start of the ray. - A that is used to selectively ignore colliders when casting a ray. - Specifies whether this query should hit Triggers. - - - - - Cast a ray through the Scene and store the hits into the buffer. - - The starting point and direction of the ray. - The buffer to store the hits into. - The max distance the rayhit is allowed to be from the start of the ray. - A that is used to selectively ignore colliders when casting a ray. - Specifies whether this query should hit Triggers. - - The amount of hits stored into the results buffer. - - - - - Cast a ray through the Scene and store the hits into the buffer. - - The starting point and direction of the ray. - The buffer to store the hits into. - The direction of the ray. - The max distance the rayhit is allowed to be from the start of the ray. - Specifies whether this query should hit Triggers. - A that is used to selectively ignore colliders when casting a ray. - - The amount of hits stored into the results buffer. - - - - - Rebuild the broadphase interest regions as well as set the world boundaries. - - Boundaries of the physics world. - How many cells to create along x and z axis. - - - - Simulate physics in the Scene. - - The time to advance physics by. - - - - Casts a sphere along a ray and returns detailed information on what was hit. - - The center of the sphere at the start of the sweep. - The radius of the sphere. - The direction into which to sweep the sphere. - If true is returned, hitInfo will contain more information about where the collider was hit. (See Also: RaycastHit). - The max length of the cast. - A that is used to selectively ignore colliders when casting a capsule. - Specifies whether this query should hit Triggers. - - True when the sphere sweep intersects any collider, otherwise false. - - - - - Casts a sphere along a ray and returns detailed information on what was hit. - - The starting point and direction of the ray into which the sphere sweep is cast. - The radius of the sphere. - The max length of the cast. - A that is used to selectively ignore colliders when casting a capsule. - Specifies whether this query should hit Triggers. - - True when the sphere sweep intersects any collider, otherwise false. - - - - - - - The starting point and direction of the ray into which the sphere sweep is cast. - The radius of the sphere. - If true is returned, hitInfo will contain more information about where the collider was hit. (See Also: RaycastHit). - The max length of the cast. - A that is used to selectively ignore colliders when casting a capsule. - Specifies whether this query should hit Triggers. - - - - Like Physics.SphereCast, but this function will return all hits the sphere sweep intersects. - - The center of the sphere at the start of the sweep. - The radius of the sphere. - The direction in which to sweep the sphere. - The max length of the sweep. - A that is used to selectively ignore colliders when casting a sphere. - Specifies whether this query should hit Triggers. - - An array of all colliders hit in the sweep. - - - - - Like Physics.SphereCast, but this function will return all hits the sphere sweep intersects. - - The starting point and direction of the ray into which the sphere sweep is cast. - The radius of the sphere. - The max length of the sweep. - A that is used to selectively ignore colliders when casting a sphere. - Specifies whether this query should hit Triggers. - - - - Cast sphere along the direction and store the results into buffer. - - The center of the sphere at the start of the sweep. - The radius of the sphere. - The direction in which to sweep the sphere. - The buffer to save the hits into. - The max length of the sweep. - A that is used to selectively ignore colliders when casting a sphere. - Specifies whether this query should hit Triggers. - - The amount of hits stored into the results buffer. - - - - - Cast sphere along the direction and store the results into buffer. - - The starting point and direction of the ray into which the sphere sweep is cast. - The radius of the sphere. - The buffer to save the results to. - The max length of the sweep. - A that is used to selectively ignore colliders when casting a sphere. - Specifies whether this query should hit Triggers. - - The amount of hits stored into the results buffer. - - - - - Apply Transform changes to the physics engine. - - - - - Global settings and helpers for 2D physics. - - - - - Enable to always show the Collider Gizmos even when they are not selected. - - - - - A Rigidbody cannot sleep if its angular velocity is above this tolerance threshold. - - - - - Set whether the physics should be simulated automatically or not. - - - - - Set whether to automatically sync changes to the Transform component with the physics engine. - - - - - - The scale factor that controls how fast overlaps are resolved. - - - - - The scale factor that controls how fast TOI overlaps are resolved. - - - - - Use this to control whether or not the appropriate OnCollisionExit2D or OnTriggerExit2D callbacks should be called when a Collider2D is disabled. - - - - - Set whether the reporting of collisions callbacks immediately stops if any of the objects involved in the collision are deleted or moved. - - - - - Set the color used by the Gizmos to show all Collider axis-aligned bounding boxes (AABBs). - - - - - The color used by the Gizmos to show all asleep Colliders (Collider is asleep when the body is asleep). - - - - - The color used by the Gizmos to show all awake Colliders (Collider is awake when the body is awake). - - - - - The color used by the Gizmos to show all Collider contacts. - - - - - The scale of the contact arrow used by the Collider Gizmos. - - - - - The default contact offset of the newly created Colliders. - - - - - The PhysicsScene2D automatically created when Unity starts. - - - - - Set whether to continue or stop the proccesing of collision callbacks if any of the objects involved in the collision are deleted. - - - - - Acceleration due to gravity. - - - - - A set of options that control how physics operates when using the job system to multithread the physics simulation. - - - - - A rigid-body cannot sleep if its linear velocity is above this tolerance. - - - - - The maximum angular position correction used when solving constraints. This helps to prevent overshoot. - - - - - The maximum linear position correction used when solving constraints. This helps to prevent overshoot. - - - - - The maximum angular speed of a rigid-body per physics update. Increasing this can cause numerical problems. - - - - - The maximum linear speed of a rigid-body per physics update. Increasing this can cause numerical problems. - - - - - This property is obsolete. You should use defaultContactOffset instead. - - - - - The number of iterations of the physics solver when considering objects' positions. - - - - - Do raycasts detect Colliders configured as triggers? - - - - - Set the raycasts or linecasts that start inside Colliders to detect or not detect those Colliders. - - - - - Set the raycasts to either detect or not detect Triggers. - - - - - Do ray/line casts that start inside a Collider(s) detect those Collider(s)? - - - - - Determines whether the garbage collector should reuse only a single instance of a Collision2D type for all collision callbacks. - - - - - Should the Collider Gizmos show the AABBs for each Collider? - - - - - Should the Collider Gizmos show current contacts for each Collider? - - - - - Should the Collider Gizmos show the sleep-state for each Collider? - - - - - Controls when Unity executes the 2D physics simulation. - - - - - The time in seconds that a rigid-body must be still before it will go to sleep. - - - - - The number of iterations of the physics solver when considering objects' velocities. - - - - - Any collisions with a relative linear velocity below this threshold will be treated as inelastic. - - - - - Layer mask constant that includes all layers. - - - - - Casts a box against Colliders in the Scene, returning the first Collider to contact with it. - - The point in 2D space where the box originates. - The size of the box. - The angle of the box (in degrees). - A vector representing the direction of the box. - The maximum distance over which to cast the box. - Filter to detect Colliders only on certain layers. - Only include objects with a Z coordinate (depth) greater than or equal to this value. - Only include objects with a Z coordinate (depth) less than or equal to this value. - - The cast results returned. - - - - - Casts a box against the Colliders in the Scene and returns all Colliders that are in contact with it. - - The point in 2D space where the box originates. - The size of the box. - The angle of the box (in degrees). - A vector representing the direction of the box. - The maximum distance over which to cast the box. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - - Returns the number of results placed in the results array. - - - - - Casts a box against the Colliders in the Scene and returns all Colliders that are in contact with it. - - The point in 2D space where the box originates. - The size of the box. - The angle of the box (in degrees). - A vector representing the direction of the box. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - The list to receive results. - The maximum distance over which to cast the box. - - Returns the number of results placed in the results list. - - - - - Casts a box against Colliders in the Scene, returning all Colliders that contact with it. - - The point in 2D space where the box originates. - The size of the box. - The angle of the box (in degrees). - A vector representing the direction of the box. - The maximum distance over which to cast the box. - Filter to detect Colliders only on certain layers. - Only include objects with a Z coordinate (depth) greater than or equal to this value. - Only include objects with a Z coordinate (depth) less than or equal to this value. - - The cast results returned. - - - - - Casts a box into the Scene, returning Colliders that contact with it into the provided results array. Note: This method will be deprecated in a future build and it is recommended to use BoxCast instead. - - The point in 2D space where the box originates. - The size of the box. - The angle of the box (in degrees). - A vector representing the direction of the box. - Array to receive results. - The maximum distance over which to cast the box. - Filter to detect Colliders only on certain layers. - Only include objects with a Z coordinate (depth) greater than or equal to this value. - Only include objects with a Z coordinate (depth) less than or equal to this value. - - Returns the number of results placed in the results array. - - - - - Casts a capsule against Colliders in the Scene, returning the first Collider to contact with it. - - The point in 2D space where the capsule originates. - The size of the capsule. - The direction of the capsule. - The angle of the capsule (in degrees). - Vector representing the direction to cast the capsule. - The maximum distance over which to cast the capsule. - Filter to detect Colliders only on certain layers. - Only include objects with a Z coordinate (depth) greater than this value. - Only include objects with a Z coordinate (depth) less than this value. - - The cast results returned. - - - - - Casts a capsule against the Colliders in the Scene and returns all Colliders that are in contact with it. - - The point in 2D space where the capsule originates. - The size of the capsule. - The direction of the capsule. - The angle of the capsule (in degrees). - Vector representing the direction to cast the capsule. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - The maximum distance over which to cast the capsule. - - Returns the number of results placed in the results array. - - - - - Casts a capsule against the Colliders in the Scene and returns all Colliders that are in contact with it. - - The point in 2D space where the capsule originates. - The size of the capsule. - The direction of the capsule. - The angle of the capsule (in degrees). - A vector representing the direction to cast the capsule. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - The list to receive results. - The maximum distance over which to cast the capsule. - - Returns the number of results placed in the results list. - - - - - Casts a capsule against Colliders in the Scene, returning all Colliders that contact with it. - - The point in 2D space where the capsule originates. - The size of the capsule. - The direction of the capsule. - The angle of the capsule (in degrees). - Vector representing the direction to cast the capsule. - The maximum distance over which to cast the capsule. - Filter to detect Colliders only on certain layers. - Only include objects with a Z coordinate (depth) greater than this value. - Only include objects with a Z coordinate (depth) less than this value. - - The cast results returned. - - - - - Casts a capsule into the Scene, returning Colliders that contact with it into the provided results array. Note: This method will be deprecated in a future build and it is recommended to use CapsuleCast instead. - - The point in 2D space where the capsule originates. - The size of the capsule. - The direction of the capsule. - The angle of the capsule (in degrees). - Vector representing the direction to cast the capsule. - Array to receive results. - The maximum distance over which to cast the capsule. - Filter to detect Colliders only on certain layers. - Only include objects with a Z coordinate (depth) greater than this value. - Only include objects with a Z coordinate (depth) less than this value. - - Returns the number of results placed in the results array. - - - - - Casts a circle against Colliders in the Scene, returning the first Collider to contact with it. - - The point in 2D space where the circle originates. - The radius of the circle. - A vector representing the direction of the circle. - The maximum distance over which to cast the circle. - Filter to detect Colliders only on certain layers. - Only include objects with a Z coordinate (depth) greater than or equal to this value. - Only include objects with a Z coordinate (depth) less than or equal to this value. - - The cast results returned. - - - - - Casts a circle against Colliders in the Scene, returning all Colliders that contact with it. - - The point in 2D space where the circle originates. - The radius of the circle. - A vector representing the direction of the circle. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - The maximum distance over which to cast the circle. - - Returns the number of results placed in the results array. - - - - - Casts a circle against Colliders in the Scene, returning all Colliders that contact with it. - - The point in 2D space where the circle originates. - The radius of the circle. - A vector representing the direction of the circle. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - The list to receive results. - The maximum distance over which to cast the circle. - - Returns the number of results placed in the results list. - - - - - Casts a circle against Colliders in the Scene, returning all Colliders that contact with it. - - The point in 2D space where the circle originates. - The radius of the circle. - A vector representing the direction of the circle. - The maximum distance over which to cast the circle. - Filter to detect Colliders only on certain layers. - Only include objects with a Z coordinate (depth) greater than or equal to this value. - Only include objects with a Z coordinate (depth) less than or equal to this value. - - The cast results returned. - - - - - Casts a circle into the Scene, returning Colliders that contact with it into the provided results array. Note: This method will be deprecated in a future build and it is recommended to use CircleCast instead. - - The point in 2D space where the circle originates. - The radius of the circle. - A vector representing the direction of the circle. - Array to receive results. - The maximum distance over which to cast the circle. - Filter to detect Colliders only on certain layers. - Only include objects with a Z coordinate (depth) greater than or equal to this value. - Only include objects with a Z coordinate (depth) less than or equal to this value. - - Returns the number of results placed in the results array. - - - - - Returns a point on the perimeter of the Collider that is closest to the specified position. - - The position from which to find the closest point on the specified Collider. - The Collider on which to find the closest specified position. - - - A point on the perimeter of the Collider that is closest to the specified position. - - - - - Returns a point on the perimeter of all enabled Colliders attached to the rigidbody that is closest to the specified position. - - The position from which to find the closest point on the specified rigidbody. - The Rigidbody on which to find the closest specified position. - - A point on the perimeter of a Collider attached to the rigidbody that is closest to the specified position. - - - - - Layer mask constant that includes all layers participating in raycasts by default. - - - - - Calculates the minimum distance between two Colliders. - - A Collider used to calculate the minimum distance against colliderB. - A Collider used to calculate the minimum distance against colliderA. - - The minimum distance between colliderA and colliderB. - - - - - Retrieves all Colliders in contact with the Collider. - - The Collider to retrieve contacts for. - An array of Collider2D used to receive the results. - - - - Returns the number of Colliders placed in the Colliders array. - - - - - Retrieves all contact points in contact with the Collider. - - The Collider to retrieve contacts for. - An array of ContactPoint2D used to receive the results. - - - Returns the number of contacts placed in the contacts array. - - - - - Retrieves all contact points in contact with the Collider, with the results filtered by the ContactFilter2D. - - The Collider to retrieve contacts for. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - An array of ContactPoint2D used to receive the results. - - - Returns the number of contacts placed in the contacts array. - - - - - Retrieves all Colliders in contact with the Collider, with the results filtered by the ContactFilter2D. - - The Collider to retrieve contacts for. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - An array of Collider2D used to receive the results. - - - - Returns the number of Colliders placed in the Colliders array. - - - - - Retrieves all contact points in for contacts between with the collider1 and collider2, with the results filtered by the ContactFilter2D. - - The Collider to check if it has contacts against collider2. - The Collider to check if it has contacts against collider1. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - An array of ContactPoint2D used to receive the results. - - Returns the number of contacts placed in the contacts array. - - - - - Retrieves all contact points in contact with any of the Collider(s) attached to this rigidbody. - - The rigidbody to retrieve contacts for. All Colliders attached to this rigidbody will be checked. - An array of ContactPoint2D used to receive the results. - - Returns the number of contacts placed in the contacts array. - - - - - Retrieves all Colliders in contact with any of the Collider(s) attached to this rigidbody. - - The rigidbody to retrieve contacts for. All Colliders attached to this rigidbody will be checked. - An array of Collider2D used to receive the results. - - - Returns the number of Colliders placed in the Colliders array. - - - - - Retrieves all contact points in contact with any of the Collider(s) attached to this rigidbody, with the results filtered by the ContactFilter2D. - - The rigidbody to retrieve contacts for. All Colliders attached to this rigidbody will be checked. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - An array of ContactPoint2D used to receive the results. - - Returns the number of contacts placed in the contacts array. - - - - - Retrieves all Colliders in contact with any of the Collider(s) attached to this rigidbody, with the results filtered by the ContactFilter2D. - - The rigidbody to retrieve contacts for. All Colliders attached to this rigidbody will be checked. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - An array of Collider2D used to receive the results. - - - Returns the number of Colliders placed in the Colliders array. - - - - - Retrieves all Colliders in contact with the Collider. - - The Collider to retrieve contacts for. - A list of Collider2D used to receive the results. - - - - Returns the number of Colliders placed in the Colliders list. - - - - - Retrieves all Colliders in contact with the Collider, with the results filtered by the contactFilter2D. - - The Collider to retrieve contacts for. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - A list of Collider2D used to receive the results. - - - - Returns the number of Colliders placed in the Colliders list. - - - - - Retrieves all contact points in contact with the Collider. - - The Collider to retrieve contacts for. - A list of ContactPoint2D used to receive the results. - - - Returns the number of contacts placed in the contacts list. - - - - - Retrieves all contact points in contact with the Collider, with the results filtered by the contactFilter2D. - - The Collider to retrieve contacts for. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - A list of ContactPoint2D used to receive the results. - - - Returns the number of contacts placed in the contacts list. - - - - - Retrieves all contact points in for contacts between with the collider1 and collider2, with the results filtered by the contactFilter2D. - - The Collider to check if it has contacts against collider2. - The Collider to check if it has contacts against collider1. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - A list of ContactPoint2D used to receive the results. - - Returns the number of contacts placed in the contacts list. - - - - - Retrieves all Colliders in contact with any of the Collider(s) attached to this Rigidbody. - - The Rigidbody to retrieve contacts for. All Colliders attached to this Rigidbody will be checked. - A list of Collider2D used to receive the results. - - - Returns the number of Colliders placed in the Colliders list. - - - - - Retrieves all Colliders in contact with any of the Collider(s) attached to this Rigidbody, with the results filtered by the contactFilter2D. - - The Rigidbody to retrieve contacts for. All Colliders attached to this Rigidbody will be checked. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - A list of Collider2D used to receive the results. - - - Returns the number of Colliders placed in the Colliders list. - - - - - Retrieves all contact points in contact with any of the Collider(s) attached to this Rigidbody. - - The Rigidbody to retrieve contacts for. All Colliders attached to this Rigidbody will be checked. - A list of ContactPoint2D used to receive the results. - - Returns the number of contacts placed in the contacts list. - - - - - Retrieves all Colliders in contact with any of the Collider(s) attached to this Rigidbody, with the results filtered by the contactFilter2D. - - The Rigidbody to retrieve contacts for. All Colliders attached to this Rigidbody will be checked. - Returns the number of contacts placed in the contacts list. - A list of ContactPoint2D used to receive the results. - - Returns the number of contacts placed in the contacts list. - - - - - Checks whether the collision detection system will ignore all collisionstriggers between collider1 and collider2/ or not. - - The first Collider to compare to collider2. - The second Collider to compare to collider1. - - Whether the collision detection system will ignore all collisionstriggers between collider1 and collider2/ or not. - - - - - Checks whether collisions between the specified layers be ignored or not. - - ID of first layer. - ID of second layer. - - Whether collisions between the specified layers be ignored or not. - - - - - Get the collision layer mask that indicates which layer(s) the specified layer can collide with. - - The layer to retrieve the collision layer mask for. - - A mask where each bit indicates a layer and whether it can collide with layer or not. - - - - - Cast a 3D ray against the Colliders in the Scene returning the first Collider along the ray. - - The 3D ray defining origin and direction to test. - The maximum distance over which to cast the ray. - Filter to detect Colliders only on certain layers. - - The cast results returned. - - - - - Cast a 3D ray against the Colliders in the Scene returning all the Colliders along the ray. - - The 3D ray defining origin and direction to test. - The maximum distance over which to cast the ray. - Filter to detect Colliders only on certain layers. - - The cast results returned. - - - - - Cast a 3D ray against the Colliders in the Scene returning the Colliders along the ray. Note: This method will be deprecated in a future build and it is recommended to use GetRayIntersection instead. - - The 3D ray defining origin and direction to test. - The maximum distance over which to cast the ray. - Filter to detect Colliders only on certain layers. - Array to receive results. - - The number of results returned. - - - - - Makes the collision detection system ignore all collisionstriggers between collider1 and collider2/. - - The first Collider to compare to collider2. - The second Collider to compare to collider1. - Whether collisionstriggers between collider1 and collider2/ should be ignored or not. - - - - Choose whether to detect or ignore collisions between a specified pair of layers. - - ID of the first layer. - ID of the second layer. - Should collisions between these layers be ignored? - - - - Layer mask constant for the default layer that ignores raycasts. - - - - - Checks whether the passed Colliders are in contact or not. - - The Collider to check if it is touching collider2. - The Collider to check if it is touching collider1. - - Whether collider1 is touching collider2 or not. - - - - - Checks whether the passed Colliders are in contact or not. - - The Collider to check if it is touching any other Collider filtered by the contactFilter. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - - - Whether the Collider is touching any other Collider filtered by the contactFilter or not. - - - - - Checks whether the passed Colliders are in contact or not. - - The Collider to check if it is touching collider2. - The Collider to check if it is touching collider1. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - - Whether collider1 is touching collider2 or not. - - - - - Checks whether the Collider is touching any Colliders on the specified layerMask or not. - - The Collider to check if it is touching Colliders on the layerMask. - Any Colliders on any of these layers count as touching. - - - Whether the Collider is touching any Colliders on the specified layerMask or not. - - - - - Casts a line segment against Colliders in the Scene. - - The start point of the line in world space. - The end point of the line in world space. - Filter to detect Colliders only on certain layers. - Only include objects with a Z coordinate (depth) greater than or equal to this value. - Only include objects with a Z coordinate (depth) less than or equal to this value. - - The cast results returned. - - - - - Casts a line segment against Colliders in the Scene with results filtered by ContactFilter2D. - - The start point of the line in world space. - The end point of the line in world space. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - - Returns the number of results placed in the results array. - - - - - Casts a line segment against Colliders in the Scene with results filtered by ContactFilter2D. - - The start point of the line in world space. - The end point of the line in world space. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - The list to receive results. - - Returns the number of results placed in the results list. - - - - - Casts a line against Colliders in the Scene. - - The start point of the line in world space. - The end point of the line in world space. - Filter to detect Colliders only on certain layers. - Only include objects with a Z coordinate (depth) greater than or equal to this value. - Only include objects with a Z coordinate (depth) less than or equal to this value. - - The cast results returned. - - - - - Casts a line against Colliders in the Scene. Note: This method will be deprecated in a future build and it is recommended to use Linecast instead. - - Only include objects with a Z coordinate (depth) greater than or equal to this value. - Only include objects with a Z coordinate (depth) less than or equal to this value. - The start point of the line in world space. - The end point of the line in world space. - Returned array of objects that intersect the line. - Filter to detect Colliders only on certain layers. - - Returns the number of results placed in the results array. - - - - - Checks if a Collider falls within a rectangular area. - - One corner of the rectangle. - Diagonally opposite the point A corner of the rectangle. - Filter to check objects only on specific layers. - Only include objects with a Z coordinate (depth) greater than or equal to this value. - Only include objects with a Z coordinate (depth) less than or equal to this value. - - The Collider overlapping the area. - - - - - Checks if a Collider falls within a rectangular area. - - One corner of the rectangle. - Diagonally opposite the point A corner of the rectangle. - The contact filter used to filter the results differently, such as by layer mask, Z depth. Note that normal angle is not used for overlap testing. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - - Returns the number of results placed in the results array. - - - - - Checks if a Collider falls within a rectangular area. - - One corner of the rectangle. - Diagonally opposite the point A corner of the rectangle. - The contact filter used to filter the results differently, such as by layer mask, Z depth. Note that normal angle is not used for overlap testing. - The list to receive results. - - Returns the number of results placed in the results list. - - - - - Get a list of all Colliders that fall within a rectangular area. - - One corner of the rectangle. - Diagonally opposite the point A corner of the rectangle. - Filter to check objects only on specific layers. - Only include objects with a Z coordinate (depth) greater than or equal to this value. - Only include objects with a Z coordinate (depth) less than or equal to this value. - - The cast results returned. - - - - - Get a list of all Colliders that fall within a specified area. Note: This method will be deprecated in a future build and it is recommended to use OverlapArea instead. - - One corner of the rectangle. - Diagonally opposite the point A corner of the rectangle. - Array to receive results. - Filter to check objects only on specified layers. - Only include objects with a Z coordinate (depth) greater than or equal to this value. - Only include objects with a Z coordinate (depth) less than or equal to this value. - - Returns the number of results placed in the results array. - - - - - Checks if a Collider falls within a box area. - - The center of the box. - The size of the box. - The angle of the box. - Filter to check objects only on specific layers. - Only include objects with a Z coordinate (depth) greater than this value. - Only include objects with a Z coordinate (depth) less than this value. - - The Collider overlapping the box. - - - - - Checks if a Collider falls within a box area. - - The center of the box. - The size of the box. - The angle of the box. - The contact filter used to filter the results differently, such as by layer mask, Z depth. Note that normal angle is not used for overlap testing. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - - Returns the number of results placed in the results array. - - - - - Checks if a Collider falls within a box area. - - The center of the box. - The size of the box. - The angle of the box. - The contact filter used to filter the results differently, such as by layer mask, Z depth. Note that normal angle is not used for overlap testing. - The list to receive results. - - Returns the number of results placed in the results list. - - - - - Get a list of all Colliders that fall within a box area. - - The center of the box. - The size of the box. - The angle of the box. - Filter to check objects only on specific layers. - Only include objects with a Z coordinate (depth) greater than this value. - Only include objects with a Z coordinate (depth) less than this value. - - The cast results returned. - - - - - Get a list of all Colliders that fall within a box area. Note: This method will be deprecated in a future build and it is recommended to use OverlapBox instead. - - The center of the box. - The size of the box. - The angle of the box. - Array to receive results. - Filter to check objects only on specific layers. - Only include objects with a Z coordinate (depth) greater than this value. - Only include objects with a Z coordinate (depth) less than this value. - - Returns the number of results placed in the results array. - - - - - Checks if a Collider falls within a capsule area. - - The center of the capsule. - The size of the capsule. - The direction of the capsule. - The angle of the capsule. - Filter to check objects only on specific layers. - Only include objects with a Z coordinate (depth) greater than this value. - Only include objects with a Z coordinate (depth) less than this value. - - The Collider overlapping the capsule. - - - - - Checks if a Collider falls within a capsule area. - - The center of the capsule. - The size of the capsule. - The direction of the capsule. - The angle of the capsule. - The contact filter used to filter the results differently, such as by layer mask, Z depth. Note that normal angle is not used for overlap testing. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - - Returns the number of results placed in the results array. - - - - - Checks if a Collider falls within a capsule area. - - The center of the capsule. - The size of the capsule. - The direction of the capsule. - The angle of the capsule. - The contact filter used to filter the results differently, such as by layer mask, Z depth. Note that normal angle is not used for overlap testing. - The list to receive results. - - Returns the number of results placed in the results list. - - - - - Get a list of all Colliders that fall within a capsule area. - - The center of the capsule. - The size of the capsule. - The direction of the capsule. - The angle of the capsule. - Filter to check objects only on specific layers. - Only include objects with a Z coordinate (depth) greater than this value. - Only include objects with a Z coordinate (depth) less than this value. - - The cast results returned. - - - - - Get a list of all Colliders that fall within a capsule area. Note: This method will be deprecated in a future build and it is recommended to use OverlapCapsule instead. - - The center of the capsule. - The size of the capsule. - The direction of the capsule. - The angle of the capsule. - Array to receive results. - Filter to check objects only on specific layers. - Only include objects with a Z coordinate (depth) greater than this value. - Only include objects with a Z coordinate (depth) less than this value. - - Returns the number of results placed in the results array. - - - - - Checks if a Collider falls within a circular area. - - Centre of the circle. - The radius of the circle. - Filter to check objects only on specific layers. - Only include objects with a Z coordinate (depth) greater than or equal to this value. - Only include objects with a Z coordinate (depth) less than or equal to this value. - - The Collider overlapping the circle. - - - - - Checks if a Collider is within a circular area. - - Centre of the circle. - The radius of the circle. - The contact filter used to filter the results differently, such as by layer mask, Z depth. Note that normal angle is not used for overlap testing. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - - Returns the number of results placed in the results array. - - - - - Checks if a Collider is within a circular area. - - Centre of the circle. - The radius of the circle. - The contact filter used to filter the results differently, such as by layer mask, Z depth. Note that normal angle is not used for overlap testing. - The list to receive results. - - Returns the number of results placed in the results list. - - - - - Get a list of all Colliders that fall within a circular area. - - The center of the circle. - The radius of the circle. - Filter to check objects only on specified layers. - Only include objects with a Z coordinate (depth) greater than or equal to this value. - Only include objects with a Z coordinate (depth) less than or equal to this value. - - The cast results. - - - - - Get a list of all Colliders that fall within a circular area. Note: This method will be deprecated in a future build and it is recommended to use OverlapCircle instead. - - The center of the circle. - The radius of the circle. - Array to receive results. - Filter to check objects only on specific layers. - Only include objects with a Z coordinate (depth) greater than or equal to this value. - Only include objects with a Z coordinate (depth) less than or equal to this value. - - Returns the number of results placed in the results array. - - - - - Gets a list of all Colliders that overlap the given Collider. - - The Collider that defines the area used to query for other Collider overlaps. - The contact filter used to filter the results differently, such as by layer mask, Z depth. Note that normal angle is not used for overlap testing. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - - - Returns the number of results placed in the results array. - - - - - Gets a list of all Colliders that overlap the given Collider. - - The Collider that defines the area used to query for other Collider overlaps. - The contact filter used to filter the results differently, such as by layer mask, Z depth. Note that normal angle is not used for overlap testing. - The list to receive results. - - - Returns the number of results placed in the results list. - - - - - Checks if a Collider overlaps a point in space. - - A point in world space. - Filter to check objects only on specific layers. - Only include objects with a Z coordinate (depth) greater than or equal to this value. - Only include objects with a Z coordinate (depth) less than or equal to this value. - - The Collider overlapping the point. - - - - - Checks if a Collider overlaps a point in world space. - - A point in world space. - The contact filter used to filter the results differently, such as by layer mask, Z depth. Note that normal angle is not used for overlap testing. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - - Returns the number of results placed in the results array. - - - - - Checks if a Collider overlaps a point in world space. - - A point in world space. - The contact filter used to filter the results differently, such as by layer mask, Z depth. Note that normal angle is not used for overlap testing. - The list to receive results. - - Returns the number of results placed in the results list. - - - - - Get a list of all Colliders that overlap a point in space. - - Only include objects with a Z coordinate (depth) greater than or equal to this value. - Only include objects with a Z coordinate (depth) less than or equal to this value. - A point in space. - Filter to check objects only on specific layers. - - The cast results returned. - - - - - Get a list of all Colliders that overlap a point in space. Note: This method will be deprecated in a future build and it is recommended to use OverlapPoint instead. - - Only include objects with a Z coordinate (depth) greater than or equal to this value. - Only include objects with a Z coordinate (depth) less than or equal to this value. - A point in space. - Array to receive results. - Filter to check objects only on specific layers. - - Returns the number of results placed in the results array. - - - - - Casts a ray against Colliders in the Scene. - - The point in 2D space where the ray originates. - A vector representing the direction of the ray. - The maximum distance over which to cast the ray. - Filter to detect Colliders only on certain layers. - Only include objects with a Z coordinate (depth) greater than or equal to this value. - Only include objects with a Z coordinate (depth) less than or equal to this value. - - The cast results returned. - - - - - Casts a ray against Colliders in the Scene. - - The point in 2D space where the ray originates. - A vector representing the direction of the ray. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - The maximum distance over which to cast the ray. - - Returns the number of results placed in the results array. - - - - - Casts a ray against Colliders in the Scene. - - The point in 2D space where the ray originates. - A vector representing the direction of the ray. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - The list to receive results. - The maximum distance over which to cast the ray. - - Returns the number of results placed in the results list. - - - - - Casts a ray against Colliders in the Scene, returning all Colliders that contact with it. - - The point in 2D space where the ray originates. - A vector representing the direction of the ray. - The maximum distance over which to cast the ray. - Filter to detect Colliders only on certain layers. - Only include objects with a Z coordinate (depth) greater than or equal to this value. - Only include objects with a Z coordinate (depth) less than or equal to this value. - - The cast results returned. - - - - - Casts a ray into the Scene. Note: This method will be deprecated in a future build and it is recommended to use Raycast instead. - - Only include objects with a Z coordinate (depth) greater than or equal to this value. - Only include objects with a Z coordinate (depth) less than or equal to this value. - The point in 2D space where the ray originates. - A vector representing the direction of the ray. - Array to receive results. - The maximum distance over which to cast the ray. - Filter to check objects only on specific layers. - - Returns the number of results placed in the results array. - - - - - Set the collision layer mask that indicates which layer(s) the specified layer can collide with. - - The layer to set the collision layer mask for. - A mask where each bit indicates a layer and whether it can collide with layer or not. - - - - Simulate physics in the Scene. - - The time to advance physics by. - - Whether the simulation was run or not. Running the simulation during physics callbacks will always fail. - - - - - Synchronizes. - - - - - A set of options that control how physics operates when using the job system to multithread the physics simulation. - - - - - Controls the minimum number of bodies to be cleared in each simulation job. - - - - - Controls the minimum number of flags to be cleared in each simulation job. - - - - - Controls the minimum number of contacts to collide in each simulation job. - - - - - Controls the minimum number of nearest contacts to find in each simulation job. - - - - - Controls the minimum number of Rigidbody2D being interpolated in each simulation job. - - - - - Controls the minimum number of bodies to solve in each simulation job when performing island solving. - - - - - Scales the cost of each body during discrete island solving. - - - - - Scales the cost of each contact during discrete island solving. - - - - - Controls the minimum number of contacts to solve in each simulation job when performing island solving. - - - - - The minimum threshold cost of all bodies, contacts and joints in an island during discrete island solving. - - - - - Scales the cost of each joint during discrete island solving. - - - - - Controls the minimum number of new contacts to find in each simulation job. - - - - - Controls the minimum number of fixtures to synchronize in the broadphase during continuous island solving in each simulation job. - - - - - Controls the minimum number of fixtures to synchronize in the broadphase during discrete island solving in each simulation job. - - - - - Controls the minimum number of trigger contacts to update in each simulation job. - - - - - Should physics simulation sort multi-threaded results to maintain processing order consistency? - - - - - Should physics simulation use multithreading? - - - - - Asset type that defines the surface properties of a Collider2D. - - - - - The degree of elasticity during collisions. - - - - - Coefficient of friction. - - - - - Represents a single instance of a 3D physics Scene. - - - - - Casts the box along a ray and returns detailed information on what was hit. - - Center of the box. - Half the size of the box in each dimension. - The direction in which to cast the box. - If true is returned, hitInfo will contain more information about where the collider was hit. (See Also: RaycastHit). - Rotation of the box. - The max length of the cast. - A that is used to selectively ignore colliders when casting a capsule. - Specifies whether this query should hit Triggers. - - True, if any intersections were found. - - - - - Casts the box along a ray and returns detailed information on what was hit. - - Center of the box. - Half the size of the box in each dimension. - The direction in which to cast the box. - The buffer to store the results in. - Rotation of the box. - The max length of the cast. - A that is used to selectively ignore colliders when casting a capsule. - Specifies whether this query should hit Triggers. - - The amount of hits stored to the results buffer. - - - - - Casts a capsule against all colliders in this physics scene and returns detailed information on what was hit. - - The center of the sphere at the start of the capsule. - The center of the sphere at the end of the capsule. - The radius of the capsule. - The direction into which to sweep the capsule. - If true is returned, hitInfo will contain more information about where the collider was hit. (See Also: RaycastHit). - The max length of the sweep. - A that is used to selectively ignore colliders when casting a capsule. - Specifies whether this query should hit Triggers. - - True when the capsule sweep intersects any collider, otherwise false. - - - - - Casts a capsule against all colliders in this physics scene and returns detailed information on what was hit. - - The center of the sphere at the start of the capsule. - The center of the sphere at the end of the capsule. - The radius of the capsule. - The direction into which to sweep the capsule. - The buffer to store the results in. - The max length of the sweep. - A that is used to selectively ignore colliders when casting a capsule. - Specifies whether this query should hit Triggers. - - The amount of hits stored to the results buffer. - - - - - Gets whether the physics Scene is empty or not. - - - Is the physics Scene is empty? - - - - - Gets whether the physics Scene is valid or not. - - - Is the physics scene valid? - - - - - Find all colliders touching or inside of the given box, and store them into the buffer. - - Center of the box. - Half of the size of the box in each dimension. - The buffer to store the results in. - Rotation of the box. - A that is used to selectively ignore colliders when casting a ray. - Specifies whether this query should hit Triggers. - - The amount of colliders stored in results. - - - - - Check the given capsule against the physics world and return all overlapping colliders in the user-provided buffer. - - The center of the sphere at the start of the capsule. - The center of the sphere at the end of the capsule. - The radius of the capsule. - The buffer to store the results into. - A that is used to selectively ignore colliders when casting a capsule. - Specifies whether this query should hit Triggers. - - The amount of entries written to the buffer. - - - - - Computes and stores colliders touching or inside the sphere into the provided buffer. - - Center of the sphere. - Radius of the sphere. - The buffer to store the results into. - A that is used to selectively ignore colliders when casting a ray. - Specifies whether this query should hit Triggers. - - The amount of colliders stored into the results buffer. - - - - - Casts a ray, from point origin, in direction direction, of length maxDistance, against all colliders in the Scene. - - The starting point of the ray in world coordinates. - The direction of the ray. - The max distance the ray should check for collisions. - A that is used to selectively ignore Colliders when casting a ray. - Specifies whether this query should hit Triggers. - - True if the ray intersects with a Collider, otherwise false. - - - - - Casts a ray, from point origin, in direction direction, of length maxDistance, against all colliders in the Scene. - - The starting point of the ray in world coordinates. - The direction of the ray. - If true is returned, hitInfo will contain more information about where the collider was hit. (See Also: RaycastHit). - The max distance the ray should check for collisions. - A that is used to selectively ignore Colliders when casting a ray. - Specifies whether this query should hit Triggers. - - True if the ray intersects with a Collider, otherwise false. - - - - - Casts a ray, from point origin, in direction direction, of length maxDistance, against all colliders in the Scene. - - The starting point and direction of the ray. - The direction of the ray. - The buffer to store the hits into. - The max distance the rayhit is allowed to be from the start of the ray. - A that is used to selectively ignore colliders when casting a ray. - The amount of hits stored into the results buffer. - - True if the ray intersects with a Collider, otherwise false. - - - - - Simulate physics associated with this PhysicsScene. - - The time to advance physics by. - - Whether the simulation was run or not. Running the simulation during physics callbacks will always fail. - - - - - Casts a sphere along a ray and returns detailed information on what was hit. - - The center of the sphere at the start of the sweep. - The radius of the sphere. - The direction into which to sweep the sphere. - If true is returned, hitInfo will contain more information about where the collider was hit. (See Also: RaycastHit). - The max length of the cast. - A that is used to selectively ignore colliders when casting a capsule. - Specifies whether this query should hit Triggers. - - True when the sphere sweep intersects any collider, otherwise false. - - - - - Cast sphere along the direction and store the results into buffer. - - The center of the sphere at the start of the sweep. - The radius of the sphere. - The direction into which to sweep the sphere. - The buffer to save the results to. - The max length of the cast. - A that is used to selectively ignore colliders when casting a capsule. - A that is used to selectively ignore colliders when casting a capsule. - - The amount of hits stored into the results buffer. - - - - - Represents a single instance of a 2D physics Scene. - - - - - Casts a box against colliders in the PhysicsScene2D, returning the first intersection only. - - The point in 2D space where the box originates. - The size of the box. - The angle of the box (in degrees). - Vector representing the direction to cast the box. - Maximum distance over which to cast the box. - Filter to detect colliders only on certain layers. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - - The cast results returned. - - - - - Casts a box against colliders in the PhysicsScene2D, returning the first intersection only. - - The point in 2D space where the box originates. - The size of the box. - The angle of the box (in degrees). - Vector representing the direction to cast the box. - Maximum distance over which to cast the box. - Filter to detect colliders only on certain layers. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - - The cast results returned. - - - - - Casts a box against the colliders in the PhysicsScene2D, returning all intersections. - - The point in 2D space where the box originates. - The size of the box. - The angle of the box (in degrees). - Vector representing the direction to cast the box. - Maximum distance over which to cast the box. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - Filter to detect colliders only on certain layers. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - - Returns the number of results placed in the results array. - - - - - Casts a box against the colliders in the PhysicsScene2D, returning all intersections. - - The point in 2D space where the box originates. - The size of the box. - The angle of the box (in degrees). - Vector representing the direction to cast the box. - Maximum distance over which to cast the box. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - Filter to detect colliders only on certain layers. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - - Returns the number of results placed in the results array. - - - - - Casts a box against the Colliders in the PhysicsScene2D, returning all intersections. - - The point in 2D space where the box originates. - The size of the box. - The angle of the box (in degrees). - Vector representing the direction to cast the box. - Maximum distance over which to cast the box. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - The list to receive results. - - Returns the number of results placed in the results list. - - - - - Casts a capsule against colliders in the PhysicsScene2D, returning the first intersection only. - - The point in 2D space where the capsule originates. - The size of the capsule. - The direction of the capsule. - The angle of the capsule (in degrees). - Vector representing the direction to cast the capsule. - Maximum distance over which to cast the capsule. - The filter used to detect Colliders only on certain layers. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - - The cast results returned. - - - - - Casts a capsule against colliders in the PhysicsScene2D, returning the first intersection only. - - The point in 2D space where the capsule originates. - The size of the capsule. - The direction of the capsule. - The angle of the capsule (in degrees). - Vector representing the direction to cast the capsule. - Maximum distance over which to cast the capsule. - The filter used to detect Colliders only on certain layers. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - - The cast results returned. - - - - - Casts a capsule against the Colliders in the PhysicsScene2D, returning all intersections. - - The point in 2D space where the capsule originates. - The size of the capsule. - The direction of the capsule. - The angle of the capsule (in degrees). - Vector representing the direction to cast the capsule. - Maximum distance over which to cast the capsule. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - The filter used to detect Colliders only on certain layers. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - - Returns the number of results placed in the results array. - - - - - Casts a capsule against the Colliders in the PhysicsScene2D, returning all intersections. - - The point in 2D space where the capsule originates. - The size of the capsule. - The direction of the capsule. - The angle of the capsule (in degrees). - Vector representing the direction to cast the capsule. - Maximum distance over which to cast the capsule. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - The filter used to detect Colliders only on certain layers. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - - Returns the number of results placed in the results array. - - - - - Casts a capsule against the Colliders in the PhysicsScene2D, returning all intersections. - - The point in 2D space where the capsule originates. - The size of the capsule. - The direction of the capsule. - The angle of the capsule (in degrees). - Vector representing the direction to cast the capsule. - Maximum distance over which to cast the capsule. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - The list to receive results. - - Returns the number of results placed in the results list. - - - - - Casts a circle against colliders in the PhysicsScene2D, returning the first intersection only. - - The point in 2D space where the circle originates. - The radius of the circle. - Vector representing the direction to cast the circle. - Maximum distance over which to cast the circle. - The filter used to detect Colliders only on certain layers. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - - The cast results returned. - - - - - Casts a circle against colliders in the PhysicsScene2D, returning the first intersection only. - - The point in 2D space where the circle originates. - The radius of the circle. - Vector representing the direction to cast the circle. - Maximum distance over which to cast the circle. - The filter used to detect Colliders only on certain layers. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - - The cast results returned. - - - - - Casts a circle against the colliders in the PhysicsScene2D, returning all intersections. - - The point in 2D space where the circle originates. - The radius of the circle. - Vector representing the direction to cast the circle. - Maximum distance over which to cast the circle. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - The filter used to detect Colliders only on certain layers. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - - Returns the number of results placed in the results array. - - - - - Casts a circle against the colliders in the PhysicsScene2D, returning all intersections. - - The point in 2D space where the circle originates. - The radius of the circle. - Vector representing the direction to cast the circle. - Maximum distance over which to cast the circle. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - The filter used to detect Colliders only on certain layers. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - - Returns the number of results placed in the results array. - - - - - Casts a circle against the Colliders in the PhysicsScene2D, returning all intersections. - - The point in 2D space where the circle originates. - The radius of the circle. - Vector representing the direction to cast the circle. - Maximum distance over which to cast the circle. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - The list to receive results. - - Returns the number of results placed in the results list. - - - - - Cast a 3D ray against the colliders in the PhysicsScene2D, returning the first intersection only. - - The 3D ray defining origin and direction to test. - Maximum distance over which to cast the ray. - Filter to detect colliders only on certain layers. - - The cast results returned. - - - - - Cast a 3D ray against the colliders in the PhysicsScene2D, returning all intersections. - - The 3D ray defining origin and direction to test. - Maximum distance over which to cast the ray. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - Filter to detect colliders only on certain layers. - - The number of results returned. - - - - - Determines whether the physics Scene is empty or not. - - - True when the physics Scene is empty. - - - - - Determines whether the physics Scene is valid or not. - - - True when the physics Scene valid. - - - - - Casts a line segment against colliders in the PhysicsScene2D, returning the first intersection only. - - The start point of the line in world space. - The end point of the line in world space. - The filter used to detect Colliders only on certain layers. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - - The cast results returned. - - - - - Casts a line segment against colliders in the PhysicsScene2D, returning the first intersection only. - - The start point of the line in world space. - The end point of the line in world space. - The filter used to detect Colliders only on certain layers. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - - The cast results returned. - - - - - Casts a line segment against colliders in the PhysicsScene2D. - - The start point of the line in world space. - The end point of the line in world space. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - The filter used to detect Colliders only on certain layers. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - - Returns the number of results placed in the results array. - - - - - Casts a line segment against colliders in the PhysicsScene2D. - - The start point of the line in world space. - The end point of the line in world space. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - The filter used to detect Colliders only on certain layers. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - - Returns the number of results placed in the results array. - - - - - Casts a line segment against Colliders in the PhysicsScene2D. - - The start point of the line in world space. - The end point of the line in world space. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - The listto receive results. - - Returns the number of results placed in the results list. - - - - - Checks an area (non-rotated box) against Colliders in the PhysicsScene2D, returning the first intersection only. - - One corner of the rectangle. - The corner of the rectangle diagonally opposite the pointA corner. - Filter to check objects only on specific layers. - The contact filter used to filter the results differently, such as by layer mask and Z depth. Note that the normal angle is not used for overlap testing. - - The collider overlapping the area. - - - - - Checks an area (non-rotated box) against Colliders in the PhysicsScene2D, returning the first intersection only. - - One corner of the rectangle. - The corner of the rectangle diagonally opposite the pointA corner. - Filter to check objects only on specific layers. - The contact filter used to filter the results differently, such as by layer mask and Z depth. Note that the normal angle is not used for overlap testing. - - The collider overlapping the area. - - - - - Checks an area (non-rotated box) against Colliders in the PhysicsScene2D, returning all intersections. - - One corner of the rectangle. - The corner of the rectangle diagonally opposite the pointA corner. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - Filter to check objects only on specific layers. - The contact filter used to filter the results differently, such as by layer mask and Z depth. Note that the normal angle is not used for overlap testing. - - Returns the number of results placed in the results array. - - - - - Checks an area (non-rotated box) against Colliders in the PhysicsScene2D, returning all intersections. - - One corner of the rectangle. - The corner of the rectangle diagonally opposite the pointA corner. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - Filter to check objects only on specific layers. - The contact filter used to filter the results differently, such as by layer mask and Z depth. Note that the normal angle is not used for overlap testing. - - Returns the number of results placed in the results array. - - - - - Checks an area (non-rotated box) against Colliders in the PhysicsScene2D, returning all intersections. - - One corner of the rectangle. - The corner of the rectangle diagonally opposite the pointA corner. - The contact filter used to filter the results differently, such as by layer mask and Z depth. Note that the normal angle is not used for overlap testing. - The list to receive results. - - Returns the number of results placed in the results list. - - - - - Checks a box against Colliders in the PhysicsScene2D, returning the first intersection only. - - The center of the box. - The size of the box. - The angle of the box. - Filter to check objects only on specific layers. - The contact filter used to filter the results differently, such as by layer mask and Z depth. Note that the normal angle is not used for overlap testing. - - The collider overlapping the box. - - - - - Checks a box against Colliders in the PhysicsScene2D, returning the first intersection only. - - The center of the box. - The size of the box. - The angle of the box. - Filter to check objects only on specific layers. - The contact filter used to filter the results differently, such as by layer mask and Z depth. Note that the normal angle is not used for overlap testing. - - The collider overlapping the box. - - - - - Checks a box against Colliders in the PhysicsScene2D, returning all intersections. - - The center of the box. - The size of the box. - The angle of the box. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - Filter to check objects only on specific layers. - The contact filter used to filter the results differently, such as by layer mask and Z depth. Note that the normal angle is not used for overlap testing. - - Returns the number of results placed in the results array. - - - - - Checks a box against Colliders in the PhysicsScene2D, returning all intersections. - - The center of the box. - The size of the box. - The angle of the box. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - Filter to check objects only on specific layers. - The contact filter used to filter the results differently, such as by layer mask and Z depth. Note that the normal angle is not used for overlap testing. - - Returns the number of results placed in the results array. - - - - - Checks a box against Colliders in the PhysicsScene2D, returning all intersections. - - The center of the box. - The size of the box. - The angle of the box. - The contact filter used to filter the results differently, such as by layer mask and Z depth. Note that the normal angle is not used for overlap testing. - The list to receive results. - - Returns the number of results placed in the results list. - - - - - Checks a capsule against Colliders in the PhysicsScene2D, returning the first intersection only. - - The center of the capsule. - The size of the capsule. - The direction of the capsule. - The angle of the capsule. - Filter to check objects only on specific layers. - The contact filter used to filter the results differently, such as by layer mask and Z depth. Note that the normal angle is not used for overlap testing. - - The collider overlapping the capsule. - - - - - Checks a capsule against Colliders in the PhysicsScene2D, returning the first intersection only. - - The center of the capsule. - The size of the capsule. - The direction of the capsule. - The angle of the capsule. - Filter to check objects only on specific layers. - The contact filter used to filter the results differently, such as by layer mask and Z depth. Note that the normal angle is not used for overlap testing. - - The collider overlapping the capsule. - - - - - Checks a capsule against Colliders in the PhysicsScene2D, returning all intersections. - - The center of the capsule. - The size of the capsule. - The direction of the capsule. - The angle of the capsule. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - Filter to check objects only on specific layers. - The contact filter used to filter the results differently, such as by layer mask and Z depth. Note that the normal angle is not used for overlap testing. - - Returns the number of results placed in the results array. - - - - - Checks a capsule against Colliders in the PhysicsScene2D, returning all intersections. - - The center of the capsule. - The size of the capsule. - The direction of the capsule. - The angle of the capsule. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - Filter to check objects only on specific layers. - The contact filter used to filter the results differently, such as by layer mask and Z depth. Note that the normal angle is not used for overlap testing. - - Returns the number of results placed in the results array. - - - - - Checks a capsule against Colliders in the PhysicsScene2D, returning all intersections. - - The center of the capsule. - The size of the capsule. - The direction of the capsule. - The angle of the capsule. - The contact filter used to filter the results differently, such as by layer mask and Z depth. Note that the normal angle is not used for overlap testing. - The list to receive results. - - Returns the number of results placed in the results list. - - - - - Checks a circle against Colliders in the PhysicsScene2D, returning the first intersection only. - - The centre of the circle. - The radius of the circle. - Filter to check objects only on specific layers. - The contact filter used to filter the results differently, such as by layer mask and Z depth. Note that the normal angle is not used for overlap testing. - - The collider overlapping the circle. - - - - - Checks a circle against Colliders in the PhysicsScene2D, returning the first intersection only. - - The centre of the circle. - The radius of the circle. - Filter to check objects only on specific layers. - The contact filter used to filter the results differently, such as by layer mask and Z depth. Note that the normal angle is not used for overlap testing. - - The collider overlapping the circle. - - - - - Checks a circle against Colliders in the PhysicsScene2D, returning all intersections. - - The centre of the circle. - The radius of the circle. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - Filter to check objects only on specific layers. - The contact filter used to filter the results differently, such as by layer mask and Z depth. Note that the normal angle is not used for overlap testing. - - Returns the number of results placed in the results array. - - - - - Checks a circle against Colliders in the PhysicsScene2D, returning all intersections. - - The centre of the circle. - The radius of the circle. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - Filter to check objects only on specific layers. - The contact filter used to filter the results differently, such as by layer mask and Z depth. Note that the normal angle is not used for overlap testing. - - Returns the number of results placed in the results array. - - - - - Checks a circle against Colliders in the PhysicsScene2D, returning all intersections. - - The centre of the circle. - The radius of the circle. - The contact filter used to filter the results differently, such as by layer mask and Z depth. Note that the normal angle is not used for overlap testing. - The list to receive results. - - Returns the number of results placed in the results list. - - - - - Checks a Collider against Colliders in the PhysicsScene2D, returning all intersections. - - The Collider that defines the area used to query for other Collider overlaps. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - Filter to check objects only on specific layers. - The contact filter used to filter the results differently, such as by layer mask and Z depth. Note that the normal angle is not used for overlap testing. - - Returns the number of results placed in the results array. - - - - - Checks a Collider against Colliders in the PhysicsScene2D, returning all intersections. - - The Collider that defines the area used to query for other Collider overlaps. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - Filter to check objects only on specific layers. - The contact filter used to filter the results differently, such as by layer mask and Z depth. Note that the normal angle is not used for overlap testing. - - Returns the number of results placed in the results array. - - - - - Checks a Collider against Colliders in the PhysicsScene2D, returning all intersections. - - The Collider that defines the area used to query for other Collider overlaps. - The contact filter used to filter the results differently, such as by layer mask and Z depth. Note that the normal angle is not used for overlap testing. - The list to receive results. - - Returns the number of results placed in the results list. - - - - - Checks a point against Colliders in the PhysicsScene2D, returning the first intersection only. - - A point in world space. - Filter to check objects only on specific layers. - The contact filter used to filter the results differently, such as by layer mask and Z depth. Note that the normal angle is not used for overlap testing. - - The collider overlapping the point. - - - - - Checks a point against Colliders in the PhysicsScene2D, returning the first intersection only. - - A point in world space. - Filter to check objects only on specific layers. - The contact filter used to filter the results differently, such as by layer mask and Z depth. Note that the normal angle is not used for overlap testing. - - The collider overlapping the point. - - - - - Checks a point against Colliders in the PhysicsScene2D, returning all intersections. - - A point in world space. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - Filter to check objects only on specific layers. - The contact filter used to filter the results differently, such as by layer mask and Z depth. Note that the normal angle is not used for overlap testing. - - Returns the number of results placed in the results array. - - - - - Checks a point against Colliders in the PhysicsScene2D, returning all intersections. - - A point in world space. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - Filter to check objects only on specific layers. - The contact filter used to filter the results differently, such as by layer mask and Z depth. Note that the normal angle is not used for overlap testing. - - Returns the number of results placed in the results array. - - - - - Checks a point against Colliders in the PhysicsScene2D, returning all intersections. - - A point in world space. - The contact filter used to filter the results differently, such as by layer mask and Z depth. Note that the normal angle is not used for overlap testing. - The list to receive results. - - Returns the number of results placed in the results list. - - - - - Casts a ray against colliders in the PhysicsScene2D, returning the first intersection only. - - The point in 2D space where the ray originates. - The vector representing the direction of the ray. - Maximum distance over which to cast the ray. - The filter used to detect Colliders only on certain layers. - The contact filter used to filter the results differently, such as by layer mask and Z depth, or normal angle. - - The cast results returned. - - - - - Casts a ray against colliders in the PhysicsScene2D, returning the first intersection only. - - The point in 2D space where the ray originates. - The vector representing the direction of the ray. - Maximum distance over which to cast the ray. - The filter used to detect Colliders only on certain layers. - The contact filter used to filter the results differently, such as by layer mask and Z depth, or normal angle. - - The cast results returned. - - - - - Casts a ray against colliders the PhysicsScene2D, returning all intersections. - - The point in 2D space where the ray originates. - The vector representing the direction of the ray. - Maximum distance over which to cast the ray. - The filter used to detect Colliders only on certain layers. - The contact filter used to filter the results differently, such as by layer mask and Z depth, or normal angle. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - - Returns the number of results placed in the results array. - - - - - Casts a ray against colliders the PhysicsScene2D, returning all intersections. - - The point in 2D space where the ray originates. - The vector representing the direction of the ray. - Maximum distance over which to cast the ray. - The filter used to detect Colliders only on certain layers. - The contact filter used to filter the results differently, such as by layer mask and Z depth, or normal angle. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - - Returns the number of results placed in the results array. - - - - - Casts a ray against Colliders the PhysicsScene2D, returning all intersections. - - The point in 2D space where the ray originates. - The vector representing the direction of the ray. - Maximum distance over which to cast the ray. - The contact filter used to filter the results differently, such as by layer mask and Z depth, or normal angle. - The list to receive results. - - Returns the number of results placed in the results list. - - - - - Simulate physics associated with this PhysicsScene. - - The time to advance physics by. - - Whether the simulation was run or not. Running the simulation during physics callbacks will always fail. - - - - - Scene extensions to access the underlying physics scene. - - - - - An extension method that returns the 3D physics Scene from the Scene. - - The Scene from which to return the 3D physics Scene. - - The 3D physics Scene used by the Scene. - - - - - Scene extensions to access the underlying physics scene. - - - - - An extension method that returns the 2D physics Scene from the Scene. - - The Scene from which to return the 2D physics Scene. - - The 2D physics Scene used by the Scene. - - - - - A base type for 2D physics components that required a callback during FixedUpdate. - - - - - Ping any given IP address (given in dot notation). - - - - - The IP target of the ping. - - - - - Has the ping function completed? - - - - - This property contains the ping time result after isDone returns true. - - - - - Perform a ping to the supplied target IP address. - - - - - - Representation of a plane in 3D space. - - - - - The distance measured from the Plane to the origin, along the Plane's normal. - - - - - Returns a copy of the plane that faces in the opposite direction. - - - - - Normal vector of the plane. - - - - - For a given point returns the closest point on the plane. - - The point to project onto the plane. - - A point on the plane that is closest to point. - - - - - Creates a plane. - - - - - - - Creates a plane. - - - - - - - Creates a plane. - - - - - - - - Makes the plane face in the opposite direction. - - - - - Returns a signed distance from plane to point. - - - - - - Is a point on the positive side of the plane? - - - - - - Intersects a ray with the plane. - - - - - - - Are two points on the same side of the plane? - - - - - - - Sets a plane using three points that lie within it. The points go around clockwise as you look down on the top surface of the plane. - - First point in clockwise order. - Second point in clockwise order. - Third point in clockwise order. - - - - Sets a plane using a point that lies within it along with a normal to orient it. - - The plane's normal vector. - A point that lies on the plane. - - - - Returns a copy of the given plane that is moved in space by the given translation. - - The plane to move in space. - The offset in space to move the plane with. - - The translated plane. - - - - - Moves the plane in space by the translation vector. - - The offset in space to move the plane with. - - - - Applies "platform" behaviour such as one-way collisions etc. - - - - - Whether to use one-way collision behaviour or not. - - - - - The rotational offset angle from the local 'up'. - - - - - The angle variance centered on the sides of the platform. Zero angle only matches sides 90-degree to the platform "top". - - - - - The angle of an arc that defines the sides of the platform centered on the local 'left' and 'right' of the effector. Any collision normals within this arc are considered for the 'side' behaviours. - - - - - Whether bounce should be used on the platform sides or not. - - - - - Whether friction should be used on the platform sides or not. - - - - - The angle of an arc that defines the surface of the platform centered of the local 'up' of the effector. - - - - - Should the one-way collision behaviour be used? - - - - - Ensures that all contacts controlled by the one-way behaviour act the same. - - - - - Should bounce be used on the platform sides? - - - - - Should friction be used on the platform sides? - - - - - Implements high-level utility methods to simplify use of the Playable API with Animations. - - - - - Plays the Playable on the given Animator. - - Target Animator. - The Playable that will be played. - The Graph that owns the Playable. - - - - Creates a PlayableGraph to be played on the given Animator. An AnimatorControllerPlayable is also created for the given RuntimeAnimatorController. - - Target Animator. - The RuntimeAnimatorController to create an AnimatorControllerPlayable for. - The created PlayableGraph. - - A handle to the newly-created AnimatorControllerPlayable. - - - - - Creates a PlayableGraph to be played on the given Animator. An AnimationClipPlayable is also created for the given AnimationClip. - - Target Animator. - The AnimationClip to create an AnimationClipPlayable for. - The created PlayableGraph. - - A handle to the newly-created AnimationClipPlayable. - - - - - Creates a PlayableGraph to be played on the given Animator. An AnimationLayerMixerPlayable is also created. - - Target Animator. - The input count for the AnimationLayerMixerPlayable. Defines the number of layers. - The created PlayableGraph. - - A handle to the newly-created AnimationLayerMixerPlayable. - - - - - Creates a PlayableGraph to be played on the given Animator. An AnimationMixerPlayable is also created. - - Target Animator. - The input count for the AnimationMixerPlayable. - The created PlayableGraph. - - A handle to the newly-created AnimationMixerPlayable. - - - - - Describes the type of information that flows in and out of a Playable. This also specifies that this Playable is connectable to others of the same type. - - - - - Describes that the information flowing in and out of the Playable is of Animation type. - - - - - Describes that the information flowing in and out of the Playable is of Audio type. - - - - - Describes that the Playable does not have any particular type. This is use for Playables that execute script code, or that create their own playable graphs, such as the Sequence. - - - - - Describes that the information flowing in and out of the Playable is of type Texture. - - - - - Defines what time source is used to update a Director graph. - - - - - Update is based on DSP (Digital Sound Processing) clock. Use this for graphs that need to be synchronized with Audio. - - - - - Update is based on Time.time. Use this for graphs that need to be synchronized on gameplay, and that need to be paused when the game is paused. - - - - - Update mode is manual. You need to manually call PlayableGraph.Evaluate with your own deltaTime. This can be useful for graphs that are completely disconnected from the rest of the game. For example, localized bullet time. - - - - - Update is based on Time.unscaledTime. Use this for graphs that need to be updated even when gameplay is paused. Example: Menus transitions need to be updated even when the game is paused. - - - - - Wrap mode for Playables. - - - - - Hold the last frame when the playable time reaches it's duration. - - - - - Loop back to zero time and continue playing. - - - - - Do not keep playing when the time reaches the duration. - - - - - This structure contains the frame information a Playable receives in Playable.PrepareFrame. - - - - - Time difference between this frame and the preceding frame. - - - - - The accumulated delay of the parent Playable during the PlayableGraph traversal. - - - - - The accumulated speed of the parent Playable during the PlayableGraph traversal. - - - - - The accumulated play state of this playable. - - - - - The accumulated speed of the Playable during the PlayableGraph traversal. - - - - - The accumulated weight of the Playable during the PlayableGraph traversal. - - - - - Indicates the type of evaluation that caused PlayableGraph.PrepareFrame to be called. - - - - - The current frame identifier. - - - - - The PlayableOutput that initiated this graph traversal. - - - - - Indicates that the local time was explicitly set. - - - - - Indicates the local time did not advance because it has reached the duration and the extrapolation mode is set to Hold. - - - - - Indicates the local time wrapped because it has reached the duration and the extrapolation mode is set to Loop. - - - - - The weight of the current Playable. - - - - - Describes the cause for the evaluation of a PlayableGraph. - - - - - Indicates the graph was updated due to a call to PlayableGraph.Evaluate. - - - - - Indicates the graph was called by the runtime during normal playback due to PlayableGraph.Play being called. - - - - - The base interface for all notifications sent through the playable system. - - - - - The identifier is a name that identifies this notifications, or class of notifications. - - - - - Implement this interface to create a class that will receives notifications from PlayableOutput. - - - - - The method called when a notification is raised. - - The playable that sent the notification. - The received notification. - User defined data that depends on the type of notification. Uses this to pass necessary information that can change with each invocation. - - - - Interface implemented by all C# Playable implementations. - - - - - Interface that permits a class to inject playables into a graph. - - - - - Duration in seconds. - - - - - A description of the PlayableOutputs generated by this asset. - - - - - Implement this method to have your asset inject playables into the given graph. - - The graph to inject playables into. - The game object which initiated the build. - - The playable injected into the graph, or the root playable if multiple playables are injected. - - - - - Interface implemented by all C# Playable Behaviour implementations. - - - - - Interface implemented by all C# Playable output implementations. - - - - - Default implementation for Playable notifications. - - - - - The name that identifies this notification. - - - - - Creates a new notification with the name specified in the argument. - - The name that identifies this notifications. - - - - Playables are customizable runtime objects that can be connected together and are contained in a PlayableGraph to create complex behaviours. - - - - - Returns an invalid Playable. - - - - - A base class for assets that can be used to instantiate a Playable at runtime. - - - - - The playback duration in seconds of the instantiated Playable. - - - - - A description of the outputs of the instantiated Playable. - - - - - Implement this method to have your asset inject playables into the given graph. - - The graph to inject playables into. - The game object which initiated the build. - - The playable injected into the graph, or the root playable if multiple playables are injected. - - - - - PlayableBehaviour is the base class from which every custom playable script derives. - - - - - This function is called when the Playable play state is changed to Playables.PlayState.Delayed. - - The Playable that owns the current PlayableBehaviour. - A FrameData structure that contains information about the current frame context. - - - - This method is invoked when one of the following situations occurs: -<br><br> - The effective play state during traversal is changed to Playables.PlayState.Paused. This state is indicated by FrameData.effectivePlayState.<br><br> - The PlayableGraph is stopped while the playable play state is Playing. This state is indicated by PlayableGraph.IsPlaying returning true. - - The Playable that owns the current PlayableBehaviour. - A FrameData structure that contains information about the current frame context. - - - - This function is called when the Playable play state is changed to Playables.PlayState.Playing. - - The Playable that owns the current PlayableBehaviour. - A FrameData structure that contains information about the current frame context. - - - - This function is called when the PlayableGraph that owns this PlayableBehaviour starts. - - The Playable that owns the current PlayableBehaviour. - - - - This function is called when the PlayableGraph that owns this PlayableBehaviour stops. - - The Playable that owns the current PlayableBehaviour. - - - - This function is called when the Playable that owns the PlayableBehaviour is created. - - The Playable that owns the current PlayableBehaviour. - - - - This function is called when the Playable that owns the PlayableBehaviour is destroyed. - - The Playable that owns the current PlayableBehaviour. - - - - This function is called during the PrepareData phase of the PlayableGraph. - - The Playable that owns the current PlayableBehaviour. - A FrameData structure that contains information about the current frame context. - - - - This function is called during the PrepareFrame phase of the PlayableGraph. - - The Playable that owns the current PlayableBehaviour. - A FrameData structure that contains information about the current frame context. - - - - This function is called during the ProcessFrame phase of the PlayableGraph. - - The Playable that owns the current PlayableBehaviour. - A FrameData structure that contains information about the current frame context. - The user data of the ScriptPlayableOutput that initiated the process pass. - - - - Struct that holds information regarding an output of a PlayableAsset. - - - - - The type of target required by the PlayableOutput for this PlayableBinding. - - - - - A reference to a UnityEngine.Object that acts a key for this binding. - - - - - The name of the output or input stream. - - - - - The type of the output or input stream. - - - - - The default duration used when a PlayableOutput has no fixed duration. - - - - - A constant to represent a PlayableAsset has no bindings. - - - - - Instantiates a PlayableAsset and controls playback of Playable objects. - - - - - The duration of the Playable in seconds. - - - - - Controls how the time is incremented when it goes beyond the duration of the playable. - - - - - The time at which the Playable should start when first played. - - - - - Event that is raised when a PlayableDirector component has paused. - - - - - - The PlayableAsset that is used to instantiate a playable for playback. - - - - - The PlayableGraph created by the PlayableDirector. - - - - - Event that is raised when a PlayableDirector component has begun playing. - - - - - - Whether the playable asset will start playing back as soon as the component awakes. - - - - - The current playing state of the component. (Read Only) - - - - - Event that is raised when a PlayableDirector component has stopped. - - - - - - The component's current time. This value is incremented according to the PlayableDirector.timeUpdateMode when it is playing. You can also change this value manually. - - - - - Controls how time is incremented when playing back. - - - - - Clears the binding of a reference object. - - The source object in the PlayableBinding. - - - - Clears an exposed reference value. - - Identifier of the ExposedReference. - - - - Tells the PlayableDirector to evaluate it's PlayableGraph on the next update. - - - - - Evaluates the currently playing Playable at the current time. - - - - - Returns a binding to a reference object. - - The object that acts as a key. - - - - Retreives an ExposedReference binding. - - Identifier of the ExposedReference. - Whether the reference was found. - - - - Pauses playback of the currently running playable. - - - - - Instatiates a Playable using the provided PlayableAsset and starts playback. - - An asset to instantiate a playable from. - What to do when the time passes the duration of the playable. - - - - Instatiates a Playable using the provided PlayableAsset and starts playback. - - An asset to instantiate a playable from. - What to do when the time passes the duration of the playable. - - - - Instatiates a Playable using the provided PlayableAsset and starts playback. - - An asset to instantiate a playable from. - What to do when the time passes the duration of the playable. - - - - Rebinds each PlayableOutput of the PlayableGraph. - - - - - Discards the existing PlayableGraph and creates a new instance. - - - - - Resume playing a paused playable. - - - - - Sets the binding of a reference object from a PlayableBinding. - - The source object in the PlayableBinding. - The object to bind to the key. - - - - Sets an ExposedReference value. - - Identifier of the ExposedReference. - The object to bind to set the reference value to. - - - - Stops playback of the current Playable and destroys the corresponding graph. - - - - - Extensions for all the types that implements IPlayable. - - - - - Create a new input port and connect it to the output port of the given Playable. - - The Playable used by this operation. - The Playable to connect to. - The output port of the Playable. - The weight of the created input port. - - The index of the newly created input port. - - - - - Connect the output port of a Playable to one of the input ports. - - The Playable used by this operation. - The input port index. - The Playable to connect to. - The output port of the Playable. - The weight of the input port. - - - - Destroys the current Playable. - - The Playable used by this operation. - - - - Disconnect the input port of a Playable. - - The Playable used by this operation. - The input port index. - - - - Returns the delay of the playable. - - The Playable used by this operation. - - The delay in seconds. - - - - - Returns the duration of the Playable. - - The Playable used by this operation. - - The duration in seconds. - - - - - Returns the PlayableGraph that owns this Playable. A Playable can only be used in the graph that was used to create it. - - The Playable used by this operation. - - The PlayableGraph associated with the current Playable. - - - - - Returns the Playable connected at the given input port index. - - The Playable used by this operation. - The port index. - - Playable connected at the index specified, or null if the index is valid but is not connected to anything. This happens if there was once a Playable connected at the index, but was disconnected via PlayableGraph.Disconnect. - - - - - Returns the number of inputs supported by the Playable. - - The Playable used by this operation. - - The count of inputs on the Playable. - - - - - Returns the weight of the Playable connected at the given input port index. - - The Playable used by this operation. - The port index. - - The current weight of the connected Playable. - - - - - Returns the Playable lead time in seconds. - - The Playable used by this operation. - - - - Returns the Playable connected at the given output port index. - - The Playable used by this operation. - The port index. - - Playable connected at the output index specified, or null if the index is valid but is not connected to anything. This happens if there was once a Playable connected at the index, but was disconnected via PlayableGraph.Disconnect. - - - - - Returns the number of outputs supported by the Playable. - - The Playable used by this operation. - - The count of outputs on the Playable. - - - - - Returns the current PlayState of the Playable. - - The Playable used by this operation. - - The current PlayState of the Playable. - - - - - Returns the previous local time of the Playable. - - The Playable used by this operation. - - The previous time in seconds. - - - - - Returns the time propagation behavior of this Playable. - - The Playable used by this operation. - - True if time propagation is enabled. - - - - - Returns the speed multiplier that is applied to the the current Playable. - - The Playable used by this operation. - - The current speed. - - - - - Returns the current local time of the Playable. - - The Playable used by this operation. - - The current time in seconds. - - - - - Returns the propagation mode for the multi-output playable. - - - - Traversal mode (Mix or Passthrough). - - - - - Returns whether or not the Playable has a delay. - - The Playable used by this operation. - - True if the playable is delayed, false otherwise. - - - - - Returns a flag indicating that a playable has completed its operation. - - The Playable used by this operation. - - True if the playable has completed its operation, false otherwise. - - - - - Returns true if the Playable is null, false otherwise. - - The Playable used by this operation. - - - - Returns the vality of the current Playable. - - The Playable used by this operation. - - True if the Playable is properly constructed by the PlayableGraph and has not been destroyed, false otherwise. - - - - - Tells to pause the Playable. - - The Playable used by this operation. - - - - Starts to play the Playable. - - The Playable used by this operation. - - - - Set a delay until the playable starts. - - The Playable used by this operation. - The delay in seconds. - - - - Changes a flag indicating that a playable has completed its operation. - - The Playable used by this operation. - True if the operation is completed, false otherwise. - - - - Changes the duration of the Playable. - - The Playable used by this operation. - The new duration in seconds, must be a positive value. - - - - Changes the number of inputs supported by the Playable. - - The Playable used by this operation. - - - - - Changes the weight of the Playable connected to the current Playable. - - The Playable used by this operation. - The connected Playable to change. - The weight. Should be between 0 and 1. - - - - - Changes the weight of the Playable connected to the current Playable. - - The Playable used by this operation. - The connected Playable to change. - The weight. Should be between 0 and 1. - - - - - Sets the Playable lead time in seconds. - - The Playable used by this operation. - The new lead time in seconds. - - - - Changes the number of outputs supported by the Playable. - - The Playable used by this operation. - - - - - Changes the current PlayState of the Playable. - - The Playable used by this operation. - The new PlayState. - - - - Changes the time propagation behavior of this Playable. - - The Playable used by this operation. - True to enable time propagation. - - - - Changes the speed multiplier that is applied to the the current Playable. - - The Playable used by this operation. - The new speed. - - - - Changes the current local time of the Playable. - - The Playable used by this operation. - The current time in seconds. - - - - Sets the propagation mode of PrepareFrame and ProcessFrame for the multi-output playable. - - The Playable used by this operation. - The new traversal mode. - - - - Use the PlayableGraph to manage Playable creations and destructions. - - - - - Connects two Playable instances. - - The source playable or its handle. - The port used in the source playable. - The destination playable or its handle. - The port used in the destination playable. - - Returns true if connection is successful. - - - - - Creates a PlayableGraph. - - The name of the graph. - - The newly created PlayableGraph. - - - - - Creates a PlayableGraph. - - The name of the graph. - - The newly created PlayableGraph. - - - - - Destroys the graph. - - - - - Destroys the PlayableOutput. - - The output to destroy. - - - - Destroys the Playable. - - The playable to destroy. - - - - Destroys the Playable and all its inputs, recursively. - - The Playable to destroy. - - - - Disconnects the Playable. The connections determine the topology of the PlayableGraph and how it is evaluated. - - The source playabe or its handle. - The port used in the source playable. - - - - Evaluates all the PlayableOutputs in the graph, and updates all the connected Playables in the graph. - - The time in seconds by which to advance each Playable in the graph. - - - - Evaluates all the PlayableOutputs in the graph, and updates all the connected Playables in the graph. - - The time in seconds by which to advance each Playable in the graph. - - - - Returns the name of the PlayableGraph. - - - - - Get PlayableOutput at the given index in the graph. - - The output index. - - The PlayableOutput at this given index, otherwise null. - - - - - Get PlayableOutput of the requested type at the given index in the graph. - - The output index. - - The PlayableOutput at the given index among all the PlayableOutput of the same type T. - - - - - Returns the number of PlayableOutput in the graph. - - - The number of PlayableOutput in the graph. - - - - - Get the number of PlayableOutput of the requested type in the graph. - - - The number of PlayableOutput of the same type T in the graph. - - - - - Returns the number of Playable owned by the Graph. - - - - - Returns the table used by the graph to resolve ExposedReferences. - - - - - Returns the Playable with no output connections at the given index. - - The index of the root Playable. - - - - Returns the number of Playable owned by the Graph that have no connected outputs. - - - - - Returns how time is incremented when playing back. - - - - - Indicates that a graph has completed its operations. - - - A boolean indicating if the graph is done playing or not. - - - - - Indicates that a graph is presently running. - - - A boolean indicating if the graph is playing or not. - - - - - Returns true if the PlayableGraph has been properly constructed using PlayableGraph.CreateGraph and is not deleted. - - - A boolean indicating if the graph is invalid or not. - - - - - Plays the graph. - - - - - Changes the table used by the graph to resolve ExposedReferences. - - - - - - Changes how time is incremented when playing back. - - The new DirectorUpdateMode. - - - - Stops the graph, if it is playing. - - - - - See: Playables.IPlayableOutput. - - - - - Returns an invalid PlayableOutput. - - - - - Extensions for all the types that implements IPlayableOutput. - - - - - Registers a new receiver that listens for notifications. - - The target output. - The receiver to register. - - - - Retrieves the list of notification receivers currently registered on the output. - - The output holding the receivers. - - Returns the list of registered receivers. - - - - - Returns the source playable's output connection index. - - The PlayableOutput used by this operation. - - The output port. - - - - - Returns the source playable. - - The PlayableOutput used by this operation. - - The source playable. - - - - - Returns the opaque user data. This is the same value as the last last argument of ProcessFrame. - - The PlayableOutput used by this operation. - - The user data. - - - - - Returns the weight of the connection from the PlayableOutput to the source playable. - - The PlayableOutput used by this operation. - - The weight of the connection to the source playable. - - - - - Returns true if the PlayableOutput is null, false otherwise. - - The PlayableOutput used by this operation. - - - - - - The PlayableOutput used by this operation. - - True if the PlayableOutput has not yet been destroyed and false otherwise. - - - - - Queues a notification to be sent through the Playable system. - - The output sending the notification. - The originating playable of the notification. - The notification to be sent. - Extra information about the state when the notification was fired. - - - - Unregisters a receiver on the output. - - The target output. - The receiver to unregister. - - - - Sets the bound object to a new value. Used to associate an output to an object (Track asset in case of Timeline). - - The PlayableOutput used by this operation. - The new reference object value. - - - - Sets the source playable's output connection index. For playables with multiple outputs, this determines which sub-branch of the source playable generates this output. - - The PlayableOutput used by this operation. - The new output port value. - - - - Sets which playable that computes the output and which sub-tree index. - - The PlayableOutput used by this operation. - The new source Playable. - The new output port value. - - - - Sets which playable that computes the output. - - The PlayableOutput used by this operation. - The new source Playable. - - - - Sets the opaque user data. This same data is passed as the last argument to ProcessFrame. - - The PlayableOutput used by this operation. - The new user data. - - - - Sets the weight of the connection from the PlayableOutput to the source playable. - - The PlayableOutput used by this operation. - The new weight. - - - - Traversal mode for Playables. - - - - - Causes the Playable to prepare and process it's inputs when demanded by an output. - - - - - Causes the Playable to act as a passthrough for PrepareFrame and ProcessFrame. If the PlayableOutput being processed is connected to the n-th input port of the Playable, the Playable only propagates the n-th output port. Use this enum value in conjunction with PlayableOutput SetSourceOutputPort. - - - - - Status of a Playable. - - - - - The Playable has been delayed, using PlayableExtensions.SetDelay. It will not start until the delay is entirely consumed. - - - - - The Playable has been paused. Its local time will not advance. - - - - - The Playable is currently Playing. - - - - - A IPlayable implementation that contains a PlayableBehaviour for the PlayableGraph. PlayableBehaviour can be used to write custom Playable that implement their own PrepareFrame callback. - - - - - A PlayableBinding that contains information representing a ScriptingPlayableOutput. - - - - - Creates a PlayableBinding that contains information representing a ScriptPlayableOutput. - - A reference to a UnityEngine.Object that acts as a key for this binding. - The type of object that will be bound to the ScriptPlayableOutput. - The name of the ScriptPlayableOutput. - - Returns a PlayableBinding that contains information that is used to create a ScriptPlayableOutput. - - - - - A IPlayableOutput implementation that contains a script output for the a PlayableGraph. - - - - - Creates a new ScriptPlayableOutput in the associated PlayableGraph. - - The PlayableGraph that will contain the ScriptPlayableOutput. - The name of this ScriptPlayableOutput. - - The created ScriptPlayableOutput. - - - - - Returns an invalid ScriptPlayableOutput. - - - - - Update phase in the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Update phase in the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Update phase in the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Update phase in the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the Player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the Player loop. - - - - - Update phase in the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Update phase in the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Update phase in the native player loop that waits for the operating system (OS) to flip the back buffer to the display and update the time in the engine. - - - - - Waits for the operating system (OS) to flip the back buffer to the display and update the time in the engine. - - - - - Update phase in the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - Native engine system updated by the native player loop. - - - - - `PlayerPrefs` is a class that stores Player preferences between game sessions. It can store string, float and integer values into the user’s platform registry. - - - - - Removes all keys and values from the preferences. Use with caution. - - - - - Removes the given key from the PlayerPrefs. If the key does not exist, DeleteKey has no impact. - - - - - - Returns the value corresponding to key in the preference file if it exists. - - - - - - - Returns the value corresponding to key in the preference file if it exists. - - - - - - - Returns the value corresponding to key in the preference file if it exists. - - - - - - - Returns the value corresponding to key in the preference file if it exists. - - - - - - - Returns the value corresponding to key in the preference file if it exists. - - - - - - - Returns the value corresponding to key in the preference file if it exists. - - - - - - - Returns true if the given key exists in PlayerPrefs, otherwise returns false. - - - - - - Writes all modified preferences to disk. - - - - - Sets the float value of the preference identified by the given key. You can use PlayerPrefs.GetFloat to retrieve this value. - - - - - - - Sets a single integer value for the preference identified by the given key. You can use PlayerPrefs.GetInt to retrieve this value. - - - - - - - Sets a single string value for the preference identified by the given key. You can use PlayerPrefs.GetString to retrieve this value. - - - - - - - An exception thrown by the PlayerPrefs class in a web player build. - - - - - Used by Animation.Play function. - - - - - Will stop all animations that were started with this component before playing. - - - - - Will stop all animations that were started in the same layer. This is the default when playing animations. - - - - - Applies forces to attract/repulse against a point. - - - - - The angular drag to apply to rigid-bodies. - - - - - The scale applied to the calculated distance between source and target. - - - - - The linear drag to apply to rigid-bodies. - - - - - The magnitude of the force to be applied. - - - - - The mode used to apply the effector force. - - - - - The source which is used to calculate the centroid point of the effector. The distance from the target is defined from this point. - - - - - The target for where the effector applies any force. - - - - - The variation of the magnitude of the force to be applied. - - - - - Pointer types. - - - - - The pointer type for mouse events. - - - - - The pointer type for pen events. - - - - - The pointer type for touch events. - - - - - Collider for 2D physics representing an arbitrary polygon defined by its vertices. - - - - - Determines whether the PolygonCollider2D's shape is automatically updated based on a SpriteRenderer's tiling properties. - - - - - The number of paths in the polygon. - - - - - Corner points that define the collider's shape in local space. - - - - - Creates as regular primitive polygon with the specified number of sides. - - The number of sides in the polygon. This must be greater than two. - The X/Y scale of the polygon. These must be greater than zero. - The X/Y offset of the polygon. - - - - Gets a path from the Collider by its index. - - The index of the path to retrieve. - - An ordered array of the vertices (points) in the selected path. - - - - - Gets a path from the Collider by its index. - - The index of the path to retrieve. - An ordered list of the vertices (points) in the selected path. - - Returns the number of results placed in the points list. - - - - - Return the total number of points in the polygon in all paths. - - - - - Define a path by its constituent points. - - Index of the path to set. - An ordered array of the vertices (points) that define the path. - - - - Define a path by its constituent points. - - Index of the path to set. - An ordered list of the vertices (points) that define the path. - - - - Representation of a Position, and a Rotation in 3D Space - - - - - Returns the forward vector of the pose. - - - - - Shorthand for pose which represents zero position, and an identity rotation. - - - - - The position component of the pose. - - - - - Returns the right vector of the pose. - - - - - The rotation component of the pose. - - - - - Returns the up vector of the pose. - - - - - Creates a new pose with the given vector, and quaternion values. - - - - - Transforms the current pose into the local space of the provided pose. - - - - - - Transforms the current pose into the local space of the provided pose. - - - - - - Returns true if two poses are equal. - - - - - - - Returns true if two poses are not equal. - - - - - - - Prefer ScriptableObject derived type to use binary serialization regardless of project's asset serialization mode. - - - - - The various primitives that can be created using the GameObject.CreatePrimitive function. - - - - - A capsule primitive. - - - - - A cube primitive. - - - - - A cylinder primitive. - - - - - A plane primitive. - - - - - A quad primitive. - - - - - A sphere primitive. - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - - Deprecated feature, no longer available - - - - - - Deprecated feature, no longer available - - - - - - Deprecated feature, no longer available - - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - - Deprecated feature, no longer available - - - - - - Deprecated feature, no longer available - - - - - - Deprecated feature, no longer available - - - - - - Deprecated feature, no longer available - - - - - - Deprecated feature, no longer available - - - - - - Deprecated feature, no longer available - - - - - Triggers an immediate (synchronous) rebuild of this ProceduralMaterial's dirty textures. - - - - - Deprecated feature, no longer available - - - - - - - Deprecated feature, no longer available - - - - - - - Deprecated feature, no longer available - - - - - - - Deprecated feature, no longer available - - - - - - - Deprecated feature, no longer available - - - - - - - Deprecated feature, no longer available - - - - - - - Deprecated feature, no longer available - - - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - Deprecated feature, no longer available - - - - - - - - - Deprecated feature, no longer available - - - - - Custom CPU Profiler label used for profiling arbitrary code blocks. - - - - - Begin profiling a piece of code with a custom label defined by this instance of CustomSampler. - - - - - - Begin profiling a piece of code with a custom label defined by this instance of CustomSampler. - - - - - - Creates a new CustomSampler for profiling parts of your code. - - Name of the Sampler. - Specifies whether this Sampler records GPU timings. If you want the Sampler to record GPU timings, set this to true. - - CustomSampler object or null if a built-in Sampler with the same name exists. - - - - - Creates a new CustomSampler for profiling parts of your code. - - Name of the Sampler. - Specifies whether this Sampler records GPU timings. If you want the Sampler to record GPU timings, set this to true. - - CustomSampler object or null if a built-in Sampler with the same name exists. - - - - - End profiling a piece of code with a custom label. - - - - - A raw data representation of a screenshot. - - - - - Height of the image. - - - - - The format in which the image was captured. - - - - - A non-owning reference to the image data. - - - - - Width of the image. - - - - - Flags that specify which fields to capture in a snapshot. - - - - - Corresponds to the ManagedHeapSections, ManagedStacks, Connections, TypeDescriptions fields in a Memory Snapshot. - - - - - Corresponds to the NativeAllocations, NativeMemoryRegions, NativeRootReferences, and NativeMemoryLabels fields in a Memory Snapshot. - - - - - Corresponds to the NativeAllocationSite field in a Memory Snapshot. - - - - - Corresponds to the NativeObject and NativeType fields in a Memory Snapshot. - - - - - Corresponds to the NativeCallstackSymbol field in a Memory Snapshot. - - - - - Memory profiling API container class. - - - - - A metadata event that collection methods can subscribe to. - - - - - - Triggers a memory snapshot capture. - - Destination path for the memory snapshot file. - Event that is fired once the memory snapshot has finished the process of capturing data. - Flag mask defining the content of the memory snapshot. - Event that you can specify to retrieve a screengrab after the snapshot has finished. - - - - Triggers a memory snapshot capture. - - Destination path for the memory snapshot file. - Event that is fired once the memory snapshot has finished the process of capturing data. - Flag mask defining the content of the memory snapshot. - Event that you can specify to retrieve a screengrab after the snapshot has finished. - - - - Triggers a memory snapshot capture to the Application.temporaryCachePath folder. - - Event that is fired once the memory snapshot has finished the process of capturing data. - Flag mask defining the content of the memory snapshot. - - - - Container for memory snapshot meta data. - - - - - User defined meta data. - - - - - Memory snapshot meta data containing platform information. - - - - - Controls the from script. - - - - - The number of ProfilerArea|Profiler Areas that you can profile. - - - - - Enables the recording of callstacks for managed allocations. - - - - - Enables the logging of profiling data to a file. - - - - - Enables the Profiler. - - - - - Specifies the file to use when writing profiling data. - - - - - Resize the profiler sample buffers to allow the desired amount of samples per thread. - - - - - Sets the maximum amount of memory that Profiler uses for buffering data. This property is expressed in bytes. - - - - - Heap size used by the program. - - - Size of the used heap in bytes, (or 0 if the profiler is disabled). - - - - - Returns the number of bytes that Unity has allocated. This does not include bytes allocated by external libraries or drivers. - - - Size of the memory allocated by Unity (or 0 if the profiler is disabled). - - - - - Displays the recorded profile data in the profiler. - - The name of the file containing the frame data, including extension. - - - - Begin profiling a piece of code with a custom label. - - A string to identify the sample in the Profiler window. - An object that provides context to the sample,. - - - - Begin profiling a piece of code with a custom label. - - A string to identify the sample in the Profiler window. - An object that provides context to the sample,. - - - - Enables profiling on the thread from which you call this method. - - The name of the thread group to which the thread belongs. - The name of the thread. - - - - Write metadata associated with the current frame to the Profiler stream. - - Module identifier. Used to distinguish metadata streams between different plugins, packages or modules. - Data stream index. - Binary data. - - - - Write metadata associated with the current frame to the Profiler stream. - - Module identifier. Used to distinguish metadata streams between different plugins, packages or modules. - Data stream index. - Binary data. - - - - Write metadata associated with the current frame to the Profiler stream. - - Module identifier. Used to distinguish metadata streams between different plugins, packages or modules. - Data stream index. - Binary data. - - - - Ends the current profiling sample. - - - - - Frees the internal resources used by the Profiler for the thread. - - - - - Returns the amount of allocated memory for the graphics driver, in bytes. - -Only available in development players and editor. - - - - - Returns whether or not a given ProfilerArea is currently enabled. - - Which area you want to check the state of. - - Returns whether or not a given ProfilerArea is currently enabled. - - - - - Returns the size of the mono heap. - - - - - Returns the size of the reserved space for managed-memory. - - - The size of the managed heap. - - - - - Returns the used size from mono. - - - - - The allocated managed-memory for live objects and non-collected objects. - - - A long integer value of the memory in use. - - - - - Returns the runtime memory usage of the resource. - - - - - - Gathers the native-memory used by a Unity object. - - The target Unity object. - - The amount of native-memory used by a Unity object. This returns 0 if the Profiler is not available. - - - - - Returns the size of the temp allocator. - - - Size in bytes. - - - - - Returns the amount of allocated and used system memory. - - - - - The total memory allocated by the internal allocators in Unity. Unity reserves large pools of memory from the system. This function returns the amount of used memory in those pools. - - - The amount of memory allocated by Unity. This returns 0 if the Profiler is not available. - - - - - Returns heap memory fragmentation information. - - An array to receive the count of free blocks grouped by power of two sizes. Given a small array, Unity counts the larger free blocks together in the final array element. - - Returns the total number of free blocks in the dynamic heap. - - - - - Returns the amount of reserved system memory. - - - - - The total memory Unity has reserved. - - - Memory reserved by Unity in bytes. This returns 0 if the Profiler is not available. - - - - - Returns the amount of reserved but not used system memory. - - - - - Unity allocates memory in pools for usage when unity needs to allocate memory. This function returns the amount of unused memory in these pools. - - - The amount of unused memory in the reserved pools. This returns 0 if the Profiler is not available. - - - - - Enable or disable a given ProfilerArea. - - The area you want to enable or disable. - Enable or disable the collection of data for this area. - - - - Sets the size of the temp allocator. - - Size in bytes. - - Returns true if requested size was successfully set. Will return false if value is disallowed (too small). - - - - - The different areas of profiling, corresponding to the charts in ProfilerWindow. - - - - - Audio statistics. - - - - - CPU statistics. - - - - - Global Illumination statistics. - - - - - GPU statistics. - - - - - Memory statistics. - - - - - Network messages statistics. - - - - - Network operations statistics. - - - - - 3D Physics statistics. - - - - - 2D physics statistics. - - - - - Rendering statistics. - - - - - UI statistics. - - - - - Detailed UI statistics. - - - - - Video playback statistics. - - - - - Virtual Texturing statistics. - - - - - Records profiling data produced by a specific Sampler. - - - - - Accumulated time of Begin/End pairs for the previous frame in nanoseconds. (Read Only) - - - - - Enables recording. - - - - - Gets the accumulated GPU time, in nanoseconds, for a frame. The Recorder has a three frame delay so this gives the timings for the frame that was three frames before the one that you access this property on. (Read Only). - - - - - Gets the number of Begin/End time pairs that the GPU executed during a frame. The Recorder has a three frame delay so this gives the timings for the frame that was three frames before the one that you access this property on. (Read Only). - - - - - Returns true if Recorder is valid and can collect data. (Read Only) - - - - - Number of time Begin/End pairs was called during the previous frame. (Read Only) - - - - - Configures the recorder to collect samples from all threads. - - - - - Configures the recorder to only collect data from the current thread. - - - - - Use this function to get a Recorder for the specific Profiler label. - - Sampler name. - - Recorder object for the specified Sampler. - - - - - Provides control over a CPU Profiler label. - - - - - Returns true if Sampler is valid. (Read Only) - - - - - Sampler name. (Read Only) - - - - - Returns Sampler object for the specific CPU Profiler label. - - Profiler Sampler name. - - Sampler object which represents specific profiler label. - - - - - Returns number and names of all registered Profiler labels. - - Preallocated list the Sampler names are written to. Or null if you want to get number of Samplers only. - - Number of active Samplers. - - - - - Returns Recorder associated with the Sampler. - - - Recorder object associated with the Sampler. - - - - - A script interface for a. - - - - - The aspect ratio of the projection. - - - - - The far clipping plane distance. - - - - - The field of view of the projection in degrees. - - - - - Which object layers are ignored by the projector. - - - - - The material that will be projected onto every object. - - - - - The near clipping plane distance. - - - - - Is the projection orthographic (true) or perspective (false)? - - - - - Projection's half-size when in orthographic mode. - - - - - Base class to derive custom property attributes from. Use this to create custom attributes for script variables. - - - - - Optional field to specify the order that multiple DecorationDrawers should be drawn in. - - - - - Represents a string as an int for efficient lookup and comparison. Use this for common PropertyNames. - -Internally stores just an int to represent the string. A PropertyName can be created from a string but can not be converted back to a string. The same string always results in the same int representing that string. Thus this is a very efficient string representation in both memory and speed when all you need is comparison. - -PropertyName is serializable. - -ToString() is only implemented for debugging purposes in the editor it returns "theName:3737" in the player it returns "Unknown:3737". - - - - - Initializes the PropertyName using a string. - - - - - - Determines whether this instance and a specified object, which must also be a PropertyName object, have the same value. - - - - - - Returns the hash code for this PropertyName. - - - - - Converts the string passed into a PropertyName. See Also: PropertyName.ctor(System.String). - - - - - - Indicates whether the specified PropertyName is an Empty string. - - - - - - Determines whether two specified PropertyName have the same string value. Because two PropertyNames initialized with the same string value always have the same name index, we can simply perform a comparison of two ints to find out if the string value equals. - - - - - - - Determines whether two specified PropertyName have a different string value. - - - - - - - For debugging purposes only. Returns the string value representing the string in the Editor. -Returns "UnityEngine.PropertyName" in the player. - - - - - Script interface for. - - - - - Active color space (Read Only). - - - - - Global anisotropic filtering mode. - - - - - Set The AA Filtering option. - - - - - Asynchronous texture and mesh data upload provides timesliced async texture and mesh data upload on the render thread with tight control over memory and timeslicing. There are no allocations except for the ones which driver has to do. To read data and upload texture and mesh data, Unity re-uses a ringbuffer whose size can be controlled. - -Use asyncUploadBufferSize to set the buffer size for asynchronous texture and mesh data uploads. The size is in megabytes. The minimum value is 2 and the maximum value is 512. The buffer resizes automatically to fit the largest texture currently loading. To avoid re-sizing of the buffer, which can incur performance cost, set the value approximately to the size of biggest texture used in the Scene. - - - - - This flag controls if the async upload pipeline's ring buffer remains allocated when there are no active loading operations. -Set this to true, to make the ring buffer allocation persist after all upload operations have completed. -If you have issues with excessive memory usage, you can set this to false. This means you reduce the runtime memory footprint, but memory fragmentation can occur. -The default value is true. - - - - - Async texture upload provides timesliced async texture upload on the render thread with tight control over memory and timeslicing. There are no allocations except for the ones which driver has to do. To read data and upload texture data a ringbuffer whose size can be controlled is re-used. - -Use asyncUploadTimeSlice to set the time-slice in milliseconds for asynchronous texture uploads per -frame. Minimum value is 1 and maximum is 33. - - - - - If enabled, billboards will face towards camera position rather than camera orientation. - - - - - Desired color space (Read Only). - - - - - Global multiplier for the LOD's switching distance. - - - - - A texture size limit applied to all textures. - - - - - A maximum LOD level. All LOD groups. - - - - - Maximum number of frames queued up by graphics driver. - - - - - The indexed list of available Quality Settings. - - - - - Budget for how many ray casts can be performed per frame for approximate collision testing. - - - - - The maximum number of pixel lights that should affect any object. - - - - - Enables realtime reflection probes. - - - - - The RenderPipelineAsset for this quality level - - - - - In resolution scaling mode, this factor is used to multiply with the target Fixed DPI specified to get the actual Fixed DPI to use for this quality setting. - - - - - The normalized cascade distribution for a 2 cascade setup. The value defines the position of the cascade with respect to Zero. - - - - - The normalized cascade start position for a 4 cascade setup. Each member of the vector defines the normalized position of the coresponding cascade with respect to Zero. - - - - - Number of cascades to use for directional light shadows. - - - - - Shadow drawing distance. - - - - - The rendering mode of Shadowmask. - - - - - Offset shadow frustum near plane. - - - - - Directional light shadow projection. - - - - - The default resolution of the shadow maps. - - - - - Realtime Shadows type to be used. - - - - - The maximum number of bones per vertex that are taken into account during skinning, for all meshes in the project. - - - - - Should soft blending be used for particles? - - - - - Use a two-pass shader for the vegetation in the terrain engine. - - - - - Enable automatic streaming of texture mipmap levels based on their distance from all active cameras. - - - - - Process all enabled Cameras for texture streaming (rather than just those with StreamingController components). - - - - - The maximum number of active texture file IO requests from the texture streaming system. - - - - - The maximum number of mipmap levels to discard for each texture. - - - - - The total amount of memory to be used by streaming and non-streaming textures. - - - - - The number of renderer instances that are processed each frame when calculating which texture mipmap levels should be streamed. - - - - - The VSync Count. - - - - - Decrease the current quality level. - - Should expensive changes be applied (Anti-aliasing etc). - - - - Returns the current graphics quality level. - - - - - Get the Render Pipeline Asset assigned at the specified quality level. - - Index of the quality level to check. - - Null if the quality level was not found or there is no assigned SRP Asset for this level, otherwise the SRP Asset assigned for this quality level. - - - - - Increase the current quality level. - - Should expensive changes be applied (Anti-aliasing etc). - - - - Sets a new graphics quality level. - - Quality index to set. - Should expensive changes be applied (Anti-aliasing etc). - - - - Quaternions are used to represent rotations. - - - - - Returns or sets the euler angle representation of the rotation. - - - - - The identity rotation (Read Only). - - - - - Returns this quaternion with a magnitude of 1 (Read Only). - - - - - W component of the Quaternion. Do not directly modify quaternions. - - - - - X component of the Quaternion. Don't modify this directly unless you know quaternions inside out. - - - - - Y component of the Quaternion. Don't modify this directly unless you know quaternions inside out. - - - - - Z component of the Quaternion. Don't modify this directly unless you know quaternions inside out. - - - - - Returns the angle in degrees between two rotations a and b. - - - - - - - Creates a rotation which rotates angle degrees around axis. - - - - - - - Constructs new Quaternion with given x,y,z,w components. - - - - - - - - - The dot product between two rotations. - - - - - - - Returns a rotation that rotates z degrees around the z axis, x degrees around the x axis, and y degrees around the y axis; applied in that order. - - - - - - - - Returns a rotation that rotates z degrees around the z axis, x degrees around the x axis, and y degrees around the y axis. - - - - - - Creates a rotation which rotates from fromDirection to toDirection. - - - - - - - Returns the Inverse of rotation. - - - - - - Interpolates between a and b by t and normalizes the result afterwards. The parameter t is clamped to the range [0, 1]. - - - - - - - - Interpolates between a and b by t and normalizes the result afterwards. The parameter t is not clamped. - - - - - - - - Creates a rotation with the specified forward and upwards directions. - - The direction to look in. - The vector that defines in which direction up is. - - - - Creates a rotation with the specified forward and upwards directions. - - The direction to look in. - The vector that defines in which direction up is. - - - - Converts this quaternion to one with the same orientation but with a magnitude of 1. - - - - - - Are two quaternions equal to each other? - - - - - - - Combines rotations lhs and rhs. - - Left-hand side quaternion. - Right-hand side quaternion. - - - - Rotates the point point with rotation. - - - - - - - Rotates a rotation from towards to. - - - - - - - - Set x, y, z and w components of an existing Quaternion. - - - - - - - - - Creates a rotation which rotates from fromDirection to toDirection. - - - - - - - Creates a rotation with the specified forward and upwards directions. - - The direction to look in. - The vector that defines in which direction up is. - - - - Creates a rotation with the specified forward and upwards directions. - - The direction to look in. - The vector that defines in which direction up is. - - - - Spherically interpolates between quaternions a and b by ratio t. The parameter t is clamped to the range [0, 1]. - - Start value, returned when t = 0. - End value, returned when t = 1. - Interpolation ratio. - - A quaternion spherically interpolated between quaternions a and b. - - - - - Spherically interpolates between a and b by t. The parameter t is not clamped. - - - - - - - - Access the x, y, z, w components using [0], [1], [2], [3] respectively. - - - - - Converts a rotation to angle-axis representation (angles in degrees). - - - - - - - Returns a formatted string of the Quaternion. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Returns a formatted string of the Quaternion. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Returns a formatted string of the Quaternion. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Overrides the global Physics.queriesHitTriggers. - - - - - Queries always report Trigger hits. - - - - - Queries never report Trigger hits. - - - - - Queries use the global Physics.queriesHitTriggers setting. - - - - - Used by Animation.Play function. - - - - - Will start playing after all other animations have stopped playing. - - - - - Starts playing immediately. This can be used if you just want to quickly create a duplicate animation. - - - - - Easily generate random data for games. - - - - - Returns a random point inside or on a circle with radius 1.0 (Read Only). - - - - - Returns a random point inside or on a sphere with radius 1.0 (Read Only). - - - - - Returns a random point on the surface of a sphere with radius 1.0 (Read Only). - - - - - Returns a random rotation (Read Only). - - - - - Returns a random rotation with uniform distribution (Read Only). - - - - - Gets or sets the full internal state of the random number generator. - - - - - Returns a random float within [0.0..1.0] (range is inclusive) (Read Only). - - - - - Generates a random color from HSV and alpha ranges. - - Minimum hue [0..1]. - Maximum hue [0..1]. - Minimum saturation [0..1]. - Maximum saturation [0..1]. - Minimum value [0..1]. - Maximum value [0..1]. - Minimum alpha [0..1]. - Maximum alpha [0..1]. - - A random color with HSV and alpha values in the (inclusive) input ranges. Values for each component are derived via linear interpolation of value. - - - - - Generates a random color from HSV and alpha ranges. - - Minimum hue [0..1]. - Maximum hue [0..1]. - Minimum saturation [0..1]. - Maximum saturation [0..1]. - Minimum value [0..1]. - Maximum value [0..1]. - Minimum alpha [0..1]. - Maximum alpha [0..1]. - - A random color with HSV and alpha values in the (inclusive) input ranges. Values for each component are derived via linear interpolation of value. - - - - - Generates a random color from HSV and alpha ranges. - - Minimum hue [0..1]. - Maximum hue [0..1]. - Minimum saturation [0..1]. - Maximum saturation [0..1]. - Minimum value [0..1]. - Maximum value [0..1]. - Minimum alpha [0..1]. - Maximum alpha [0..1]. - - A random color with HSV and alpha values in the (inclusive) input ranges. Values for each component are derived via linear interpolation of value. - - - - - Generates a random color from HSV and alpha ranges. - - Minimum hue [0..1]. - Maximum hue [0..1]. - Minimum saturation [0..1]. - Maximum saturation [0..1]. - Minimum value [0..1]. - Maximum value [0..1]. - Minimum alpha [0..1]. - Maximum alpha [0..1]. - - A random color with HSV and alpha values in the (inclusive) input ranges. Values for each component are derived via linear interpolation of value. - - - - - Generates a random color from HSV and alpha ranges. - - Minimum hue [0..1]. - Maximum hue [0..1]. - Minimum saturation [0..1]. - Maximum saturation [0..1]. - Minimum value [0..1]. - Maximum value [0..1]. - Minimum alpha [0..1]. - Maximum alpha [0..1]. - - A random color with HSV and alpha values in the (inclusive) input ranges. Values for each component are derived via linear interpolation of value. - - - - - Initializes the random number generator state with a seed. - - Seed used to initialize the random number generator. - - - - Returns a random float within [minInclusive..maxInclusive] (range is inclusive). - - - - - - - Return a random int within [minInclusive..maxExclusive) (Read Only). - - - - - - - Serializable structure used to hold the full internal state of the random number generator. See Also: Random.state. - - - - - Attribute used to make a float or int variable in a script be restricted to a specific range. - - - - - Attribute used to make a float or int variable in a script be restricted to a specific range. - - The minimum allowed value. - The maximum allowed value. - - - - Describes an integer range. - - - - - The end index of the range (not inclusive). - - - - - The length of the range. - - - - - The starting index of the range, where 0 is the first position, 1 is the second, 2 is the third, and so on. - - - - - Constructs a new RangeInt with given start, length values. - - The starting index of the range. - The length of the range. - - - - Representation of rays. - - - - - The direction of the ray. - - - - - The origin point of the ray. - - - - - Creates a ray starting at origin along direction. - - - - - - - Returns a point at distance units along the ray. - - - - - - Returns a formatted string for this ray. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Returns a formatted string for this ray. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Returns a formatted string for this ray. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - A ray in 2D space. - - - - - The direction of the ray in world space. - - - - - The starting point of the ray in world space. - - - - - Creates a 2D ray starting at origin along direction. - - Origin. - Direction. - - - - - - Get a point that lies a given distance along a ray. - - Distance of the desired point along the path of the ray. - - - - Returns a formatted string for this 2D ray. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Returns a formatted string for this 2D ray. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Returns a formatted string for this 2D ray. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Struct used to set up a raycast command to be performed asynchronously during a job. - - - - - The direction of the ray. - - - - - The maximum distance the ray should check for collisions. - - - - - The starting point of the ray in world coordinates. - - - - - A LayerMask that is used to selectively ignore Colliders when casting a ray. - - - - - The maximum number of Colliders the ray can hit. - - - - - Create a RaycastCommand. - - The starting point of the ray in world coordinates. - The direction of the ray. - The maximum distance the ray should check for collisions. - A LayerMask that is used to selectively ignore Colliders when casting a ray. - The maximum number of Colliders the ray can hit. - - - - Schedule a batch of raycasts which are performed in a job. - - A NativeArray of the RaycastCommands to perform. - A NativeArray of the RaycastHits where the results of the commands are stored. - The minimum number of jobs which should be performed in a single job. - A JobHandle of a job which must be completed before the raycast starts. - - The JobHandle of the job which will perform the raycasts. - - - - - Structure used to get information back from a raycast. - - - - - The ArticulationBody of the collider that was hit. If the collider is not attached to an articulation body then it is null. - - - - - The barycentric coordinate of the triangle we hit. - - - - - The Collider that was hit. - - - - - The distance from the ray's origin to the impact point. - - - - - The uv lightmap coordinate at the impact point. - - - - - The normal of the surface the ray hit. - - - - - The impact point in world space where the ray hit the collider. - - - - - The Rigidbody of the collider that was hit. If the collider is not attached to a rigidbody then it is null. - - - - - The uv texture coordinate at the collision location. - - - - - The secondary uv texture coordinate at the impact point. - - - - - The Transform of the rigidbody or collider that was hit. - - - - - The index of the triangle that was hit. - - - - - Information returned about an object detected by a raycast in 2D physics. - - - - - The centroid of the primitive used to perform the cast. - - - - - The collider hit by the ray. - - - - - The distance from the ray origin to the impact point. - - - - - Fraction of the distance along the ray that the hit occurred. - - - - - The normal vector of the surface hit by the ray. - - - - - The point in world space where the ray hit the collider's surface. - - - - - The Rigidbody2D attached to the object that was hit. - - - - - The Transform of the object that was hit. - - - - - This property only takes effect if you enable a global illumination setting such as for the GameObject associated with the target Mesh Renderer. Otherwise this property defaults to the Light Probes setting. - - - - - Makes the GameObject use lightmaps to receive Global Illumination. - - - - - The object will have the option to use Light Probes to receive Global Illumination. See Rendering.LightProbeUsage. - - - - - A 2D Rectangle defined by X and Y position, width and height. - - - - - The position of the center of the rectangle. - - - - - The height of the rectangle, measured from the Y position. - - - - - The position of the maximum corner of the rectangle. - - - - - The position of the minimum corner of the rectangle. - - - - - The X and Y position of the rectangle. - - - - - The width and height of the rectangle. - - - - - The width of the rectangle, measured from the X position. - - - - - The X coordinate of the rectangle. - - - - - The maximum X coordinate of the rectangle. - - - - - The minimum X coordinate of the rectangle. - - - - - The Y coordinate of the rectangle. - - - - - The maximum Y coordinate of the rectangle. - - - - - The minimum Y coordinate of the rectangle. - - - - - Shorthand for writing new Rect(0,0,0,0). - - - - - Returns true if the x and y components of point is a point inside this rectangle. If allowInverse is present and true, the width and height of the Rect are allowed to take negative values (ie, the min value is greater than the max), and the test will still work. - - Point to test. - Does the test allow the Rect's width and height to be negative? - - True if the point lies within the specified rectangle. - - - - - Returns true if the x and y components of point is a point inside this rectangle. If allowInverse is present and true, the width and height of the Rect are allowed to take negative values (ie, the min value is greater than the max), and the test will still work. - - Point to test. - Does the test allow the Rect's width and height to be negative? - - True if the point lies within the specified rectangle. - - - - - Returns true if the x and y components of point is a point inside this rectangle. If allowInverse is present and true, the width and height of the Rect are allowed to take negative values (ie, the min value is greater than the max), and the test will still work. - - Point to test. - Does the test allow the Rect's width and height to be negative? - - True if the point lies within the specified rectangle. - - - - - Creates a new rectangle. - - The X value the rect is measured from. - The Y value the rect is measured from. - The width of the rectangle. - The height of the rectangle. - - - - - - - - - - Creates a rectangle given a size and position. - - The position of the minimum corner of the rect. - The width and height of the rect. - - - - Creates a rectangle from min/max coordinate values. - - The minimum X coordinate. - The minimum Y coordinate. - The maximum X coordinate. - The maximum Y coordinate. - - A rectangle matching the specified coordinates. - - - - - Returns a point inside a rectangle, given normalized coordinates. - - Rectangle to get a point inside. - Normalized coordinates to get a point for. - - - - Returns true if the rectangles are the same. - - - - - - - Returns true if the other rectangle overlaps this one. If allowInverse is present and true, the widths and heights of the Rects are allowed to take negative values (ie, the min value is greater than the max), and the test will still work. - - Other rectangle to test overlapping with. - Does the test allow the widths and heights of the Rects to be negative? - - - - Returns true if the other rectangle overlaps this one. If allowInverse is present and true, the widths and heights of the Rects are allowed to take negative values (ie, the min value is greater than the max), and the test will still work. - - Other rectangle to test overlapping with. - Does the test allow the widths and heights of the Rects to be negative? - - - - Returns the normalized coordinates cooresponding the the point. - - Rectangle to get normalized coordinates inside. - A point inside the rectangle to get normalized coordinates for. - - - - Set components of an existing Rect. - - - - - - - - - Returns a formatted string for this Rect. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Returns a formatted string for this Rect. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Returns a formatted string for this Rect. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - A 2D Rectangle defined by x, y, width, height with integers. - - - - - A RectInt.PositionCollection that contains all positions within the RectInt. - - - - - Center coordinate of the rectangle. - - - - - Height of the rectangle. - - - - - The upper right corner of the rectangle; which is the maximal position of the rectangle along the x- and y-axes, when it is aligned to both axes. - - - - - The lower left corner of the rectangle; which is the minimal position of the rectangle along the x- and y-axes, when it is aligned to both axes. - - - - - Returns the position (x, y) of the RectInt. - - - - - Returns the width and height of the RectInt. - - - - - Width of the rectangle. - - - - - Left coordinate of the rectangle. - - - - - Shows the maximum X value of the RectInt. - - - - - Shows the minimum X value of the RectInt. - - - - - Top coordinate of the rectangle. - - - - - Shows the maximum Y value of the RectInt. - - - - - Show the minimum Y value of the RectInt. - - - - - Clamps the position and size of the RectInt to the given bounds. - - Bounds to clamp the RectInt. - - - - Returns true if the given position is within the RectInt. - - Position to check. - - Whether the position is within the RectInt. - - - - - Returns true if the given RectInt is equal to this RectInt. - - - - - - RectInts overlap if each RectInt Contains a shared point. - - Other rectangle to test overlapping with. - - True if the other rectangle overlaps this one. - - - - - An iterator that allows you to iterate over all positions within the RectInt. - - - - - Current position of the enumerator. - - - - - Returns this as an iterator that allows you to iterate over all positions within the RectInt. - - - This RectInt.PositionEnumerator. - - - - - Moves the enumerator to the next position. - - - Whether the enumerator has successfully moved to the next position. - - - - - Resets this enumerator to its starting state. - - - - - Sets the bounds to the min and max value of the rect. - - - - - - - Returns the x, y, width and height of the RectInt. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Returns the x, y, width and height of the RectInt. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Returns the x, y, width and height of the RectInt. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Offsets for rectangles, borders, etc. - - - - - Bottom edge size. - - - - - Shortcut for left + right. (Read Only) - - - - - Left edge size. - - - - - Right edge size. - - - - - Top edge size. - - - - - Shortcut for top + bottom. (Read Only) - - - - - Add the border offsets to a rect. - - - - - - Creates a new rectangle with offsets. - - - - - - - - - Creates a new rectangle with offsets. - - - - - - - - - Remove the border offsets from a rect. - - - - - - Returns a formatted string for this RectOffset. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Returns a formatted string for this RectOffset. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Returns a formatted string for this RectOffset. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Position, size, anchor and pivot information for a rectangle. - - - - - The position of the pivot of this RectTransform relative to the anchor reference point. - - - - - The 3D position of the pivot of this RectTransform relative to the anchor reference point. - - - - - The normalized position in the parent RectTransform that the upper right corner is anchored to. - - - - - The normalized position in the parent RectTransform that the lower left corner is anchored to. - - - - - The offset of the upper right corner of the rectangle relative to the upper right anchor. - - - - - The offset of the lower left corner of the rectangle relative to the lower left anchor. - - - - - The normalized position in this RectTransform that it rotates around. - - - - - Event that is invoked for RectTransforms that need to have their driven properties reapplied. - - - - - - The calculated rectangle in the local space of the Transform. - - - - - The size of this RectTransform relative to the distances between the anchors. - - - - - An axis that can be horizontal or vertical. - - - - - Horizontal. - - - - - Vertical. - - - - - Enum used to specify one edge of a rectangle. - - - - - The bottom edge. - - - - - The left edge. - - - - - The right edge. - - - - - The top edge. - - - - - Force the recalculation of RectTransforms internal data. - - - - - Get the corners of the calculated rectangle in the local space of its Transform. - - The array that corners are filled into. - - - - Get the corners of the calculated rectangle in world space. - - The array that corners are filled into. - - - - Delegate used for the reapplyDrivenProperties event. - - - - - - Set the distance of this rectangle relative to a specified edge of the parent rectangle, while also setting its size. - - The edge of the parent rectangle to inset from. - The inset distance. - The size of the rectangle along the same direction of the inset. - - - - Makes the RectTransform calculated rect be a given size on the specified axis. - - The axis to specify the size along. - The desired size along the specified axis. - - - - Utility class containing helper methods for working with RectTransform. - - - - - Flips the horizontal and vertical axes of the RectTransform size and alignment, and optionally its children as well. - - The RectTransform to flip. - Flips around the pivot if true. Flips within the parent rect if false. - Flip the children as well? - - - - Flips the alignment of the RectTransform along the horizontal or vertical axis, and optionally its children as well. - - The RectTransform to flip. - Flips around the pivot if true. Flips within the parent rect if false. - Flip the children as well? - The axis to flip along. 0 is horizontal and 1 is vertical. - - - - Convert a given point in screen space into a pixel correct point. - - - - - - Pixel adjusted point. - - - - - Given a rect transform, return the corner points in pixel accurate coordinates. - - - - - Pixel adjusted rect. - - - - - Does the RectTransform contain the screen point as seen from the given camera? - - The RectTransform to test with. - The screen point to test. - The camera from which the test is performed from. (Optional) - - True if the point is inside the rectangle. - - - - - Transform a screen space point to a position in the local space of a RectTransform that is on the plane of its rectangle. - - The RectTransform to find a point inside. - The camera associated with the screen space position. - Screen space position. - Point in local space of the rect transform. - - Returns true if the plane of the RectTransform is hit, regardless of whether the point is inside the rectangle. - - - - - Transform a screen space point to a position in world space that is on the plane of the given RectTransform. - - The RectTransform to find a point inside. - The camera associated with the screen space position. - Screen space position. - Point in world space. - - Returns true if the plane of the RectTransform is hit, regardless of whether the point is inside the rectangle. - - - - - The reflection probe is used to capture the surroundings into a texture which is passed to the shaders and used for reflections. - - - - - The color with which the texture of reflection probe will be cleared. - - - - - Reference to the baked texture of the reflection probe's surrounding. - - - - - Distance around probe used for blending (used in deferred probes). - - - - - The bounding volume of the reflection probe (Read Only). - - - - - Should this reflection probe use box projection? - - - - - The center of the box area in which reflections will be applied to the objects. Measured in the probes's local space. - - - - - How the reflection probe clears the background. - - - - - This is used to render parts of the reflecion probe's surrounding selectively. - - - - - Reference to the baked texture of the reflection probe's surrounding. Use this to assign custom reflection texture. - - - - - Adds a delegate to get notifications when the default specular Cubemap is changed. - - - - - - Texture which is used outside of all reflection probes (Read Only). - - - - - HDR decode values of the default reflection probe texture. - - - - - The far clipping plane distance when rendering the probe. - - - - - Should this reflection probe use HDR rendering? - - - - - Reflection probe importance. - - - - - The intensity modifier that is applied to the texture of reflection probe in the shader. - - - - - Should reflection probe texture be generated in the Editor (ReflectionProbeMode.Baked) or should probe use custom specified texure (ReflectionProbeMode.Custom)? - - - - - The near clipping plane distance when rendering the probe. - - - - - Reference to the realtime texture of the reflection probe's surroundings. Use this to assign a RenderTexture to use for realtime reflection. - - - - - Adds a delegate to get notifications when a Reflection Probe is added to a Scene or removed from a Scene. - - - - - - Sets the way the probe will refresh. - -See Also: ReflectionProbeRefreshMode. - - - - - Specifies whether Unity should render non-static GameObjects into the Reflection Probe. If you set this to true, Unity renders non-static GameObjects into the Reflection Probe. If you set this to false, Unity does not render non-static GameObjects into the Reflection Probe. Unity only takes this property into account if the Reflection Probe's Type is Custom. - - - - - Resolution of the underlying reflection texture in pixels. - - - - - Shadow drawing distance when rendering the probe. - - - - - The size of the box area in which reflections will be applied to the objects. Measured in the probes's local space. - - - - - Texture which is passed to the shader of the objects in the vicinity of the reflection probe (Read Only). - - - - - HDR decode values of the reflection probe texture. - - - - - Sets this probe time-slicing mode - -See Also: ReflectionProbeTimeSlicingMode. - - - - - Utility method to blend 2 cubemaps into a target render texture. - - Cubemap to blend from. - Cubemap to blend to. - Blend weight. - RenderTexture which will hold the result of the blend. - - Returns trues if cubemaps were blended, false otherwise. - - - - - Checks if a probe has finished a time-sliced render. - - An integer representing the RenderID as returned by the RenderProbe method. - - - True if the render has finished, false otherwise. - - See Also: timeSlicingMode - - - - - - Types of events that occur when ReflectionProbe components are used in a Scene. - - - - - An event that occurs when a Reflection Probe component is added to a Scene or enabled in a Scene. - - - - - An event that occurs when a Reflection Probe component is unloaded from a Scene or disabled in a Scene. - - - - - Refreshes the probe's cubemap. - - Target RendeTexture in which rendering should be done. Specifying null will update the probe's default texture. - - - An integer representing a RenderID which can subsequently be used to check if the probe has finished rendering while rendering in time-slice mode. - - See Also: IsFinishedRendering - See Also: timeSlicingMode - - - - - - Revert all ReflectionProbe parameters to default. - - - - - Keeps two Rigidbody2D at their relative orientations. - - - - - The current angular offset between the Rigidbody2D that the joint connects. - - - - - Should both the linearOffset and angularOffset be calculated automatically? - - - - - Scales both the linear and angular forces used to correct the required relative orientation. - - - - - The current linear offset between the Rigidbody2D that the joint connects. - - - - - The maximum force that can be generated when trying to maintain the relative joint constraint. - - - - - The maximum torque that can be generated when trying to maintain the relative joint constraint. - - - - - The world-space position that is currently trying to be maintained. - - - - - Provides access to your remote settings. - - - - - Dispatched before the RemoteSettings object makes the network request for the latest settings. - - - - - - Dispatched when the network request made by the RemoteSettings object to fetch the remote configuration file is complete. - - - - - - Forces the game to download the newest settings from the server and update its values. - - - - - Gets the value corresponding to remote setting identified by key, if it exists. - - The key identifying the setting. - The default value to use if the setting identified by the key parameter cannot be found or is unavailable. - - The current value of the setting identified by key, or the default value. - - - - - Gets the value corresponding to remote setting identified by key, if it exists. - - The key identifying the setting. - The default value to use if the setting identified by the key parameter cannot be found or is unavailable. - - The current value of the setting identified by key, or the default value. - - - - - Gets the number of keys in the remote settings configuration. - - - - - Gets a dictionary corresponding to the remote setting identified by key, if it exists. - - The key identifying the setting. - - An instance of Dictionary<string, object> containing the corresponding remote value or values. - - - - - Gets the value corresponding to remote setting identified by key, if it exists. - - The key identifying the setting. - The default value to use if the setting identified by the key parameter cannot be found or is unavailable. - - The current value of the setting identified by key, or the default value. - - - - - Gets the value corresponding to remote setting identified by key, if it exists. - - The key identifying the setting. - The default value to use if the setting identified by the key parameter cannot be found or is unavailable. - - The current value of the setting identified by key, or the default value. - - - - - Gets the value corresponding to remote setting identified by key, if it exists. - - The key identifying the setting. - The default value to use if the setting identified by the key parameter cannot be found or is unavailable. - - The current value of the setting identified by key, or the default value. - - - - - Gets the value corresponding to remote setting identified by key, if it exists. - - The key identifying the setting. - The default value to use if the setting identified by the key parameter cannot be found or is unavailable. - - The current value of the setting identified by key, or the default value. - - - - - Gets an array containing all the keys in the remote settings configuration. - - - - - Gets the value corresponding to remote setting identified by key, if it exists. - - The key identifying the setting. - The default value to use if the setting identified by the key parameter cannot be found or is unavailable. - - The current value of the setting identified by key, or the default value. - - - - - Gets the object corresponding to the remote setting identified by key, if it exists. - - The key identifying the setting. - - An instance of the object with fields assigned the corresponding remote values. - - - - - Gets the object corresponding to the remote setting identified by key, if it exists. - - The key identifying the setting. - The type of object represented in RemoteSettings. - - An instance of the object with fields assigned the corresponding remote values. - - - - - Gets the object corresponding to the remote setting identified by key, if it exists. - - The object that should be for default values. - The key identifying the setting. - - An instance of the object with fields assigned the corresponding remote values. - - - - - Gets the value corresponding to remote setting identified by key, if it exists. - - The key identifying the setting. - The default value to use if the setting identified by the key parameter cannot be found or is unavailable. - - The current value of the setting identified by key, or the default value. - - - - - Gets the value corresponding to remote setting identified by key, if it exists. - - The key identifying the setting. - The default value to use if the setting identified by the key parameter cannot be found or is unavailable. - - The current value of the setting identified by key, or the default value. - - - - - Reports whether the specified key exists in the remote settings configuration. - - The key identifying the setting. - - True, if the key exists. - - - - - Dispatched when a remote settings configuration is fetched and successfully parsed from the server or from local cache. - - - - - - Defines the delegate signature for handling RemoteSettings.Updated events. - - - - - Reports whether or not the settings available from the RemoteSettings object were received from the Analytics Service during the current session. - - - True, if the remote settings file was received from the Analytics Service in the current session. False, if the remote settings file was received during an earlier session and cached. - - - - - Color or depth buffer part of a RenderTexture. - - - - - Returns native RenderBuffer. Be warned this is not native Texture, but rather pointer to unity struct that can be used with native unity API. Currently such API exists only on iOS. - - - - - General functionality for all renderers. - - - - - Controls if dynamic occlusion culling should be performed for this renderer. - - - - - The bounding volume of the renderer (Read Only). - - - - - Makes the rendered 3D object visible if enabled. - - - - - Allows turning off rendering for a specific component. - - - - - Has this renderer been statically batched with any other renderers? - - - - - Is this renderer visible in any camera? (Read Only) - - - - - The index of the baked lightmap applied to this renderer. - - - - - The UV scale & offset used for a lightmap. - - - - - If set, the Renderer will use the Light Probe Proxy Volume component attached to the source GameObject. - - - - - The light probe interpolation type. - - - - - Matrix that transforms a point from local space into world space (Read Only). - - - - - Returns the first instantiated Material assigned to the renderer. - - - - - Returns all the instantiated materials of this object. - - - - - Specifies the mode for motion vector rendering. - - - - - Specifies whether this renderer has a per-object motion vector pass. - - - - - If set, Renderer will use this Transform's position to find the light or reflection probe. - - - - - Describes how this renderer is updated for ray tracing. - - - - - The index of the realtime lightmap applied to this renderer. - - - - - The UV scale & offset used for a realtime lightmap. - - - - - Does this object receive shadows? - - - - - Should reflection probes be used for this Renderer? - - - - - This value sorts renderers by priority. Lower values are rendered first and higher values are rendered last. - - - - - Determines which rendering layer this renderer lives on. - - - - - Does this object cast shadows? - - - - - The shared material of this object. - - - - - All the shared materials of this object. - - - - - Unique ID of the Renderer's sorting layer. - - - - - Name of the Renderer's sorting layer. - - - - - Renderer's order within a sorting layer. - - - - - Should light probes be used for this Renderer? - - - - - Matrix that transforms a point from world space into local space (Read Only). - - - - - Returns an array of closest reflection probes with weights, weight shows how much influence the probe has on the renderer, this value is also used when blending between reflection probes occur. - - - - - - Returns all the instantiated materials of this object. - - A list of materials to populate. - - - - Get per-Renderer or per-Material property block. - - Material parameters to retrieve. - The index of the Material you want to get overridden parameters from. The index ranges from 0 to Renderer.sharedMaterials.Length-1. - - - - Get per-Renderer or per-Material property block. - - Material parameters to retrieve. - The index of the Material you want to get overridden parameters from. The index ranges from 0 to Renderer.sharedMaterials.Length-1. - - - - Returns all the shared materials of this object. - - A list of materials to populate. - - - - Returns true if the Renderer has a material property block attached via SetPropertyBlock. - - - - - Lets you set or clear per-renderer or per-material parameter overrides. - - Property block with values you want to override. - The index of the Material you want to override the parameters of. The index ranges from 0 to Renderer.sharedMaterial.Length-1. - - - - Lets you set or clear per-renderer or per-material parameter overrides. - - Property block with values you want to override. - The index of the Material you want to override the parameters of. The index ranges from 0 to Renderer.sharedMaterial.Length-1. - - - - Extension methods to the Renderer class, used only for the UpdateGIMaterials method used by the Global Illumination System. - - - - - Schedules an update of the albedo and emissive Textures of a system that contains the Renderer. - - - - - - Ambient lighting mode. - - - - - Ambient lighting is defined by a custom cubemap. - - - - - Flat ambient lighting. - - - - - Skybox-based or custom ambient lighting. - - - - - Trilight ambient lighting. - - - - - Allows the asynchronous read back of GPU resources. - - - - - Retrieves data asynchronously from a GPU resource. - - Resource to read the data from. - Size in bytes of the data to be retrieved from the ComputeBuffer or GraphicsBuffer. - Offset in bytes in the ComputeBuffer or GraphicsBuffer. - Index of the mipmap to be fetched. - Target TextureFormat of the data. If the target format is different from the format stored on the GPU, the conversion is automatic. - Starting X coordinate in pixels of the Texture data to be fetched. - Width in pixels of the Texture data to be fetched. - Starting Y coordinate in pixels of the Texture data to be fetched. - Height in pixels of the Texture data to be fetched. - Start Z coordinate in pixels for the Texture3D being fetched. Index of Start layer for TextureCube, Texture2DArray and TextureCubeArray being fetched. - Depth in pixels for Texture3D being fetched. Number of layers for TextureCube, TextureArray and TextureCubeArray. - An optional delegate System.Action called once the request is fullfilled. The completed request is passed as parameter to the System.Action. - - Returns an AsyncGPUReadbackRequest that you can use to determine when the data is available. Otherwise, a request with an error is returned. - - - - - Retrieves data asynchronously from a GPU resource. - - Resource to read the data from. - Size in bytes of the data to be retrieved from the ComputeBuffer or GraphicsBuffer. - Offset in bytes in the ComputeBuffer or GraphicsBuffer. - Index of the mipmap to be fetched. - Target TextureFormat of the data. If the target format is different from the format stored on the GPU, the conversion is automatic. - Starting X coordinate in pixels of the Texture data to be fetched. - Width in pixels of the Texture data to be fetched. - Starting Y coordinate in pixels of the Texture data to be fetched. - Height in pixels of the Texture data to be fetched. - Start Z coordinate in pixels for the Texture3D being fetched. Index of Start layer for TextureCube, Texture2DArray and TextureCubeArray being fetched. - Depth in pixels for Texture3D being fetched. Number of layers for TextureCube, TextureArray and TextureCubeArray. - An optional delegate System.Action called once the request is fullfilled. The completed request is passed as parameter to the System.Action. - - Returns an AsyncGPUReadbackRequest that you can use to determine when the data is available. Otherwise, a request with an error is returned. - - - - - Retrieves data asynchronously from a GPU resource. - - Resource to read the data from. - Size in bytes of the data to be retrieved from the ComputeBuffer or GraphicsBuffer. - Offset in bytes in the ComputeBuffer or GraphicsBuffer. - Index of the mipmap to be fetched. - Target TextureFormat of the data. If the target format is different from the format stored on the GPU, the conversion is automatic. - Starting X coordinate in pixels of the Texture data to be fetched. - Width in pixels of the Texture data to be fetched. - Starting Y coordinate in pixels of the Texture data to be fetched. - Height in pixels of the Texture data to be fetched. - Start Z coordinate in pixels for the Texture3D being fetched. Index of Start layer for TextureCube, Texture2DArray and TextureCubeArray being fetched. - Depth in pixels for Texture3D being fetched. Number of layers for TextureCube, TextureArray and TextureCubeArray. - An optional delegate System.Action called once the request is fullfilled. The completed request is passed as parameter to the System.Action. - - Returns an AsyncGPUReadbackRequest that you can use to determine when the data is available. Otherwise, a request with an error is returned. - - - - - Retrieves data asynchronously from a GPU resource. - - Resource to read the data from. - Size in bytes of the data to be retrieved from the ComputeBuffer or GraphicsBuffer. - Offset in bytes in the ComputeBuffer or GraphicsBuffer. - Index of the mipmap to be fetched. - Target TextureFormat of the data. If the target format is different from the format stored on the GPU, the conversion is automatic. - Starting X coordinate in pixels of the Texture data to be fetched. - Width in pixels of the Texture data to be fetched. - Starting Y coordinate in pixels of the Texture data to be fetched. - Height in pixels of the Texture data to be fetched. - Start Z coordinate in pixels for the Texture3D being fetched. Index of Start layer for TextureCube, Texture2DArray and TextureCubeArray being fetched. - Depth in pixels for Texture3D being fetched. Number of layers for TextureCube, TextureArray and TextureCubeArray. - An optional delegate System.Action called once the request is fullfilled. The completed request is passed as parameter to the System.Action. - - Returns an AsyncGPUReadbackRequest that you can use to determine when the data is available. Otherwise, a request with an error is returned. - - - - - Retrieves data asynchronously from a GPU resource. - - Resource to read the data from. - Size in bytes of the data to be retrieved from the ComputeBuffer or GraphicsBuffer. - Offset in bytes in the ComputeBuffer or GraphicsBuffer. - Index of the mipmap to be fetched. - Target TextureFormat of the data. If the target format is different from the format stored on the GPU, the conversion is automatic. - Starting X coordinate in pixels of the Texture data to be fetched. - Width in pixels of the Texture data to be fetched. - Starting Y coordinate in pixels of the Texture data to be fetched. - Height in pixels of the Texture data to be fetched. - Start Z coordinate in pixels for the Texture3D being fetched. Index of Start layer for TextureCube, Texture2DArray and TextureCubeArray being fetched. - Depth in pixels for Texture3D being fetched. Number of layers for TextureCube, TextureArray and TextureCubeArray. - An optional delegate System.Action called once the request is fullfilled. The completed request is passed as parameter to the System.Action. - - Returns an AsyncGPUReadbackRequest that you can use to determine when the data is available. Otherwise, a request with an error is returned. - - - - - Retrieves data asynchronously from a GPU resource. - - Resource to read the data from. - Size in bytes of the data to be retrieved from the ComputeBuffer or GraphicsBuffer. - Offset in bytes in the ComputeBuffer or GraphicsBuffer. - Index of the mipmap to be fetched. - Target TextureFormat of the data. If the target format is different from the format stored on the GPU, the conversion is automatic. - Starting X coordinate in pixels of the Texture data to be fetched. - Width in pixels of the Texture data to be fetched. - Starting Y coordinate in pixels of the Texture data to be fetched. - Height in pixels of the Texture data to be fetched. - Start Z coordinate in pixels for the Texture3D being fetched. Index of Start layer for TextureCube, Texture2DArray and TextureCubeArray being fetched. - Depth in pixels for Texture3D being fetched. Number of layers for TextureCube, TextureArray and TextureCubeArray. - An optional delegate System.Action called once the request is fullfilled. The completed request is passed as parameter to the System.Action. - - Returns an AsyncGPUReadbackRequest that you can use to determine when the data is available. Otherwise, a request with an error is returned. - - - - - Retrieves data asynchronously from a GPU Texture resource. - - Reference to the NativeArray to write the data into. - The Texture resource to read the data from. - The index of the mipmap to fetch. - The target TextureFormat of the data. Conversion happens automatically if this format is different from the format stored on the GPU. - The starting x-coordinate, in pixels, of the Texture data to fetch. - The width, in pixels, of the Texture data to fetch. - The starting y-coordinate, in pixels, of the Texture data to fetch. - The height, in pixels, of the Texture data to fetch. - The starting z-coordinate, in pixels, of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the index of the start layer. - The depth, in pixels of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the number of layers to retrieve. - An optional delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - Returns an AsyncGPUReadbackRequest that you can use to determine when the data is available. Otherwise, returns a request with an error. - - - - - Retrieves data asynchronously from a GPU Texture resource. - - Reference to the NativeArray to write the data into. - The Texture resource to read the data from. - The index of the mipmap to fetch. - The target TextureFormat of the data. Conversion happens automatically if this format is different from the format stored on the GPU. - The starting x-coordinate, in pixels, of the Texture data to fetch. - The width, in pixels, of the Texture data to fetch. - The starting y-coordinate, in pixels, of the Texture data to fetch. - The height, in pixels, of the Texture data to fetch. - The starting z-coordinate, in pixels, of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the index of the start layer. - The depth, in pixels of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the number of layers to retrieve. - An optional delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - Returns an AsyncGPUReadbackRequest that you can use to determine when the data is available. Otherwise, returns a request with an error. - - - - - Retrieves data asynchronously from a GPU Texture resource. - - Reference to the NativeArray to write the data into. - The Texture resource to read the data from. - The index of the mipmap to fetch. - The target TextureFormat of the data. Conversion happens automatically if this format is different from the format stored on the GPU. - The starting x-coordinate, in pixels, of the Texture data to fetch. - The width, in pixels, of the Texture data to fetch. - The starting y-coordinate, in pixels, of the Texture data to fetch. - The height, in pixels, of the Texture data to fetch. - The starting z-coordinate, in pixels, of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the index of the start layer. - The depth, in pixels of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the number of layers to retrieve. - An optional delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - Returns an AsyncGPUReadbackRequest that you can use to determine when the data is available. Otherwise, returns a request with an error. - - - - - Retrieves data asynchronously from a GPU Texture resource. - - Reference to the NativeArray to write the data into. - The Texture resource to read the data from. - The index of the mipmap to fetch. - The target TextureFormat of the data. Conversion happens automatically if this format is different from the format stored on the GPU. - The starting x-coordinate, in pixels, of the Texture data to fetch. - The width, in pixels, of the Texture data to fetch. - The starting y-coordinate, in pixels, of the Texture data to fetch. - The height, in pixels, of the Texture data to fetch. - The starting z-coordinate, in pixels, of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the index of the start layer. - The depth, in pixels of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the number of layers to retrieve. - An optional delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - Returns an AsyncGPUReadbackRequest that you can use to determine when the data is available. Otherwise, returns a request with an error. - - - - - Retrieves data asynchronously from a GPU Texture resource. - - Reference to the NativeArray to write the data into. - The Texture resource to read the data from. - The index of the mipmap to fetch. - The target TextureFormat of the data. Conversion happens automatically if this format is different from the format stored on the GPU. - The starting x-coordinate, in pixels, of the Texture data to fetch. - The width, in pixels, of the Texture data to fetch. - The starting y-coordinate, in pixels, of the Texture data to fetch. - The height, in pixels, of the Texture data to fetch. - The starting z-coordinate, in pixels, of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the index of the start layer. - The depth, in pixels of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the number of layers to retrieve. - An optional delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - Returns an AsyncGPUReadbackRequest that you can use to determine when the data is available. Otherwise, returns a request with an error. - - - - - Retrieves data asynchronously from a GPU Graphics Buffer resource. - - Reference to the NativeArray to write the data into. - The GraphicsBuffer to read the data from. - The size, in bytes, of the data to retrieve from the GraphicsBuffer. - Offset in bytes in the GraphicsBuffer. - An optional delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - Returns an AsyncGPUReadbackRequest that you can use to determine when the data is available. Otherwise, returns a request with an error. - - - - - Retrieves data asynchronously from a GPU Graphics Buffer resource. - - Reference to the NativeArray to write the data into. - The GraphicsBuffer to read the data from. - The size, in bytes, of the data to retrieve from the GraphicsBuffer. - Offset in bytes in the GraphicsBuffer. - An optional delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - Returns an AsyncGPUReadbackRequest that you can use to determine when the data is available. Otherwise, returns a request with an error. - - - - - Retrieves data asynchronously from a GPU Graphics Buffer resource. - - Reference to the NativeArray to write the data into. - The GraphicsBuffer to read the data from. - The size, in bytes, of the data to retrieve from the GraphicsBuffer. - Offset in bytes in the GraphicsBuffer. - An optional delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - Returns an AsyncGPUReadbackRequest that you can use to determine when the data is available. Otherwise, returns a request with an error. - - - - - Retrieves data asynchronously from a GPU Graphics Buffer resource. - - Reference to the NativeArray to write the data into. - The GraphicsBuffer to read the data from. - The size, in bytes, of the data to retrieve from the GraphicsBuffer. - Offset in bytes in the GraphicsBuffer. - An optional delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - Returns an AsyncGPUReadbackRequest that you can use to determine when the data is available. Otherwise, returns a request with an error. - - - - - Retrieves data asynchronously from a GPU Texture resource. - - Reference to the NativeSlice to write the data into. - The Texture resource to read the data from. - The index of the mipmap to fetch. - The target TextureFormat of the data. Conversion happens automatically if this format is different from the format stored on the GPU. - The starting x-coordinate, in pixels, of the Texture data to fetch. - The width, in pixels, of the Texture data to fetch. - The starting y-coordinate, in pixels, of the Texture data to fetch. - The height, in pixels, of the Texture data to fetch. - The starting z-coordinate, in pixels, of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the index of the start layer. - The depth, in pixels of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the number of layers to retrieve. - An optional delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - Returns an AsyncGPUReadbackRequest that you can use to determine when the data is available. Otherwise, returns a request with an error. - - - - - Retrieves data asynchronously from a GPU Texture resource. - - Reference to the NativeSlice to write the data into. - The Texture resource to read the data from. - The index of the mipmap to fetch. - The target TextureFormat of the data. Conversion happens automatically if this format is different from the format stored on the GPU. - The starting x-coordinate, in pixels, of the Texture data to fetch. - The width, in pixels, of the Texture data to fetch. - The starting y-coordinate, in pixels, of the Texture data to fetch. - The height, in pixels, of the Texture data to fetch. - The starting z-coordinate, in pixels, of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the index of the start layer. - The depth, in pixels of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the number of layers to retrieve. - An optional delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - Returns an AsyncGPUReadbackRequest that you can use to determine when the data is available. Otherwise, returns a request with an error. - - - - - Retrieves data asynchronously from a GPU Texture resource. - - Reference to the NativeSlice to write the data into. - The Texture resource to read the data from. - The index of the mipmap to fetch. - The target TextureFormat of the data. Conversion happens automatically if this format is different from the format stored on the GPU. - The starting x-coordinate, in pixels, of the Texture data to fetch. - The width, in pixels, of the Texture data to fetch. - The starting y-coordinate, in pixels, of the Texture data to fetch. - The height, in pixels, of the Texture data to fetch. - The starting z-coordinate, in pixels, of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the index of the start layer. - The depth, in pixels of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the number of layers to retrieve. - An optional delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - Returns an AsyncGPUReadbackRequest that you can use to determine when the data is available. Otherwise, returns a request with an error. - - - - - Retrieves data asynchronously from a GPU Texture resource. - - Reference to the NativeSlice to write the data into. - The Texture resource to read the data from. - The index of the mipmap to fetch. - The target TextureFormat of the data. Conversion happens automatically if this format is different from the format stored on the GPU. - The starting x-coordinate, in pixels, of the Texture data to fetch. - The width, in pixels, of the Texture data to fetch. - The starting y-coordinate, in pixels, of the Texture data to fetch. - The height, in pixels, of the Texture data to fetch. - The starting z-coordinate, in pixels, of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the index of the start layer. - The depth, in pixels of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the number of layers to retrieve. - An optional delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - Returns an AsyncGPUReadbackRequest that you can use to determine when the data is available. Otherwise, returns a request with an error. - - - - - Retrieves data asynchronously from a GPU Texture resource. - - Reference to the NativeSlice to write the data into. - The Texture resource to read the data from. - The index of the mipmap to fetch. - The target TextureFormat of the data. Conversion happens automatically if this format is different from the format stored on the GPU. - The starting x-coordinate, in pixels, of the Texture data to fetch. - The width, in pixels, of the Texture data to fetch. - The starting y-coordinate, in pixels, of the Texture data to fetch. - The height, in pixels, of the Texture data to fetch. - The starting z-coordinate, in pixels, of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the index of the start layer. - The depth, in pixels of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the number of layers to retrieve. - An optional delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - Returns an AsyncGPUReadbackRequest that you can use to determine when the data is available. Otherwise, returns a request with an error. - - - - - Retrieves data asynchronously from a GPU Graphics Buffer resource. - - Reference to the NativeSlice to write the data into. - The GraphicsBuffer to read the data from. - The size, in bytes, of the data to retrieve from the GraphicsBuffer. - Offset in bytes in the GraphicsBuffer. - An optional delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - Returns an AsyncGPUReadbackRequest that you can use to determine when the data is available. Otherwise, returns a request with an error. - - - - - Retrieves data asynchronously from a GPU Graphics Buffer resource. - - Reference to the NativeSlice to write the data into. - The GraphicsBuffer to read the data from. - The size, in bytes, of the data to retrieve from the GraphicsBuffer. - Offset in bytes in the GraphicsBuffer. - An optional delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - Returns an AsyncGPUReadbackRequest that you can use to determine when the data is available. Otherwise, returns a request with an error. - - - - - Retrieves data asynchronously from a GPU Graphics Buffer resource. - - Reference to the NativeSlice to write the data into. - The GraphicsBuffer to read the data from. - The size, in bytes, of the data to retrieve from the GraphicsBuffer. - Offset in bytes in the GraphicsBuffer. - An optional delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - Returns an AsyncGPUReadbackRequest that you can use to determine when the data is available. Otherwise, returns a request with an error. - - - - - Retrieves data asynchronously from a GPU Graphics Buffer resource. - - Reference to the NativeSlice to write the data into. - The GraphicsBuffer to read the data from. - The size, in bytes, of the data to retrieve from the GraphicsBuffer. - Offset in bytes in the GraphicsBuffer. - An optional delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - Returns an AsyncGPUReadbackRequest that you can use to determine when the data is available. Otherwise, returns a request with an error. - - - - - Waits until the completion of every request. - - - - - Represents an asynchronous request for a GPU resource. - - - - - When reading data from a ComputeBuffer, depth is 1, otherwise, the property takes the value of the requested depth from the texture. - - - - - Checks whether the request has been processed. - - - - - This property is true if the request has encountered an error. - - - - - When reading data from a ComputeBuffer, height is 1, otherwise, the property takes the value of the requested height from the texture. - - - - - Number of layers in the current request. - - - - - The size in bytes of one layer of the readback data. - - - - - The width of the requested GPU data. - - - - - Fetches the data of a successful request. - - The index of the layer to retrieve. - - - - Triggers an update of the request. - - - - - Waits for completion of the request. - - - - - A declaration of a single color or depth rendering surface to be attached into a RenderPass. - - - - - The currently assigned clear color for this attachment. Default is black. - - - - - Currently assigned depth clear value for this attachment. Default value is 1.0. - - - - - Currently assigned stencil clear value for this attachment. Default is 0. - - - - - The format of this attachment. - - - - - The GraphicsFormat of this attachment. To use in place of format. - - - - - The load action to be used on this attachment when the RenderPass starts. - - - - - The surface to use as the backing storage for this AttachmentDescriptor. - - - - - When the renderpass that uses this attachment ends, resolve the MSAA surface into the given target. - - - - - The store action to use with this attachment when the RenderPass ends. Only used when either ConfigureTarget or ConfigureResolveTarget has been called. - - - - - When the RenderPass starts, clear this attachment into the color or depth/stencil values given (depending on the format of this attachment). Changes loadAction to RenderBufferLoadAction.Clear. - - Color clear value. Ignored on depth/stencil attachments. - Depth clear value. Ignored on color surfaces. - Stencil clear value. Ignored on color or depth-only surfaces. - - - - - - - When the renderpass that uses this attachment ends, resolve the MSAA surface into the given target. - - The target surface to receive the MSAA-resolved pixels. - - - - - Binds this AttachmentDescriptor to the given target surface. - - The surface to use as the backing storage for this AttachmentDescriptor. - Whether to read in the existing contents of the surface when the RenderPass starts. - Whether to store the rendering results of the attachment when the RenderPass ends. - - - - - Create a AttachmentDescriptor to be used with RenderPass. - - The format of this attachment. - - - - - Culling context for a batch. - - - - - Visibility information for the batch. - - - - - Culling matrix. - - - - - Planes to cull against. - - - - - See Also: LODParameters. - - - - - The near frustum plane for this culling context. - - - - - Array of visible indices for all the batches in the group. - - - - - Array of uints containing extra data for the visible indices for all the batches in the group. Elements in this array correspond to elements in Rendering.BatchCullingContext.visibleIndices. - - - - - A group of batches. - - - - - Adds a new batch to the group. - - The Mesh to draw. - Specifies which subset of the mesh to draw. This applies only to meshes that are composed of several materials. - Material to use. - to use. - Whether the meshes cast shadows. - Whether the meshes receive shadows. - Specify whether to invert the backface culling (true) or not (false). This flag can "flip" the culling mode of all rendered objects. Major use case: rendering reflections for mirrors, water etc. Since virtual camera for rendering the reflection is mirrored, the culling order has to be inverted. You can see how the Water script in Effects standard package does that. - Bounds to use. Should specify the combined bounds of all the instances. - The number of instances to draw. - Additional material properties to apply. See MaterialPropertyBlock. - The GameObject to select when you pick an object that the batch renders. - Additional culling mask usually used for scene based culling. See Also: EditorSceneManager.GetSceneCullingMask. - Rendering layer this batch lives on. See Also: Renderer.renderingLayerMask. - - The batch's index in the BatchedRendererGroup. - - - - - Adds a new batch to the group. - - The Mesh to draw. - Specifies which subset of the mesh to draw. This applies only to meshes that are composed of several materials. - Material to use. - to use. - Whether the meshes cast shadows. - Whether the meshes receive shadows. - Specify whether to invert the backface culling (true) or not (false). This flag can "flip" the culling mode of all rendered objects. Major use case: rendering reflections for mirrors, water etc. Since virtual camera for rendering the reflection is mirrored, the culling order has to be inverted. You can see how the Water script in Effects standard package does that. - Bounds to use. Should specify the combined bounds of all the instances. - The number of instances to draw. - Additional material properties to apply. See MaterialPropertyBlock. - The GameObject to select when you pick an object that the batch renders. - Additional culling mask usually used for scene based culling. See Also: EditorSceneManager.GetSceneCullingMask. - Rendering layer this batch lives on. See Also: Renderer.renderingLayerMask. - - The batch's index in the BatchedRendererGroup. - - - - - Creates a new Rendering.BatchRendererGroup. - - The delegate to call for performing culling. -See Also: BatchRendererGroup.OnPerformCulling. - - - - Deletes a group. - - - - - Enables or disables Rendering.BatchCullingContext.visibleIndicesY. - - Pass true to enable the array, or false to disable it. - - - - Retrieves the matrices associated with one batch. - - Batch index. - - Matrices associated with the batch specified by batchIndex. - - - - - Retrieves an array of instanced vector properties for a given batch. - - Batch index. - Property name. - - An array of writable matrix properties for the batch specified by batchIndex. - - - - - Retrieves an array of instanced vector properties for a given batch. - - Batch index. - Property name. - - An array of writable matrix properties for the batch specified by batchIndex. - - - - - Retrieves an array of instanced float properties for a given batch. - - Batch index. - Property name. - - An array of writable float properties for the batch specified by batchIndex. - - - - - Retrieves an array of instanced float properties for a given batch. - - Batch index. - Property name. - - An array of writable float properties for the batch specified by batchIndex. - - - - - Retrieves an array of instanced int properties for a given batch. - - Batch index. - Property name. - - An array of writable int properties for the batch specified by batchIndex. - - - - - Retrieves an array of instanced int properties for a given batch. - - Batch index. - Property name. - - An array of writable int properties for the batch specified by batchIndex. - - - - - Retrieves an array of instanced vector properties for a given batch. - - Batch index. - Property name. - - An array of writable vector properties for the batch specified by batchIndex. - - - - - Retrieves an array of instanced vector properties for a given batch. - - Batch index. - Property name. - - An array of writable vector properties for the batch specified by batchIndex. - - - - - Retrieves an array of instanced int vector properties for a given batch. - - Batch index. - Property name. - - An array of writable vector properties for the batch specified by batchIndex, arranged linearly as individual int elements. - - - - - Retrieves an array of instanced int vector properties for a given batch. - - Batch index. - Property name. - - An array of writable vector properties for the batch specified by batchIndex, arranged linearly as individual int elements. - - - - - Retrieves the number of batches added to the group. - - - Number of batches inside the group. - - - - - Culling callback function. - - Group to cull. - Culling context. - - - - Removes a batch from the group. - Note: For performance reasons, the removal is done via emplace_back() which will simply replace the removed batch index with the last index in the array and will decrement the size. - If you're holding your own array of batch indices, you'll have to either regenerate it or apply the same emplace_back() mechanism as RemoveBatch does. - - Batch index. - - - - Sets the bounding box of the batch. - - Batch index. - The new bounds for the batch specified by batchIndex. - - - - Sets flag bits that enable special behavior for this Hybrid Renderer V2 batch. - - Batch index. Must be a Hybrid Renderer V2 batch. - Flag bits to set for the batch. - - - - Sets all Hybrid Renderer DOTS instancing metadata for this batch, and marks it as a Hybrid Renderer V2 batch. - - Batch index. - One int for each DOTS instancing metadata constant buffer that describes how many metadata ints are in each of them. - Metadata ints for all DOTS instancing metadata constant buffers, laid out one after another. cbufferLengths describes which ints belong to which constant buffer. - - - - Updates a batch. - - Batch index. - New number of instances in the batch. - Additional material properties to apply. See MaterialPropertyBlock. - - - - Describes the visibility for a batch. - - - - - Input property specifying the total number of instances in the batch. (readonly). - - - - - Input property specifying the offset into the BatchCullingContext.visibleIndices where the batch's visibile indices start. (readonly). - - - - - Output property that has to be set to the number of visible instances in the batch after culling. - - - - - Blend mode for controlling the blending. - - - - - Blend factor is (Ad, Ad, Ad, Ad). - - - - - Blend factor is (Rd, Gd, Bd, Ad). - - - - - Blend factor is (1, 1, 1, 1). - - - - - Blend factor is (1 - Ad, 1 - Ad, 1 - Ad, 1 - Ad). - - - - - Blend factor is (1 - Rd, 1 - Gd, 1 - Bd, 1 - Ad). - - - - - Blend factor is (1 - As, 1 - As, 1 - As, 1 - As). - - - - - Blend factor is (1 - Rs, 1 - Gs, 1 - Bs, 1 - As). - - - - - Blend factor is (As, As, As, As). - - - - - Blend factor is (f, f, f, 1); where f = min(As, 1 - Ad). - - - - - Blend factor is (Rs, Gs, Bs, As). - - - - - Blend factor is (0, 0, 0, 0). - - - - - Blend operation. - - - - - Add (s + d). - - - - - Color burn (Advanced OpenGL blending). - - - - - Color dodge (Advanced OpenGL blending). - - - - - Darken (Advanced OpenGL blending). - - - - - Difference (Advanced OpenGL blending). - - - - - Exclusion (Advanced OpenGL blending). - - - - - Hard light (Advanced OpenGL blending). - - - - - HSL color (Advanced OpenGL blending). - - - - - HSL Hue (Advanced OpenGL blending). - - - - - HSL luminosity (Advanced OpenGL blending). - - - - - HSL saturation (Advanced OpenGL blending). - - - - - Lighten (Advanced OpenGL blending). - - - - - Logical AND (s & d) (D3D11.1 only). - - - - - Logical inverted AND (!s & d) (D3D11.1 only). - - - - - Logical reverse AND (s & !d) (D3D11.1 only). - - - - - Logical Clear (0). - - - - - Logical Copy (s) (D3D11.1 only). - - - - - Logical inverted Copy (!s) (D3D11.1 only). - - - - - Logical Equivalence !(s XOR d) (D3D11.1 only). - - - - - Logical Inverse (!d) (D3D11.1 only). - - - - - Logical NAND !(s & d). D3D11.1 only. - - - - - Logical No-op (d) (D3D11.1 only). - - - - - Logical NOR !(s | d) (D3D11.1 only). - - - - - Logical OR (s | d) (D3D11.1 only). - - - - - Logical inverted OR (!s | d) (D3D11.1 only). - - - - - Logical reverse OR (s | !d) (D3D11.1 only). - - - - - Logical SET (1) (D3D11.1 only). - - - - - Logical XOR (s XOR d) (D3D11.1 only). - - - - - Max. - - - - - Min. - - - - - Multiply (Advanced OpenGL blending). - - - - - Overlay (Advanced OpenGL blending). - - - - - Reverse subtract. - - - - - Screen (Advanced OpenGL blending). - - - - - Soft light (Advanced OpenGL blending). - - - - - Subtract. - - - - - Values for the blend state. - - - - - Turns on alpha-to-coverage. - - - - - Blend state for render target 0. - - - - - Blend state for render target 1. - - - - - Blend state for render target 2. - - - - - Blend state for render target 3. - - - - - Blend state for render target 4. - - - - - Blend state for render target 5. - - - - - Blend state for render target 6. - - - - - Blend state for render target 7. - - - - - Default values for the blend state. - - - - - Determines whether each render target uses a separate blend state. - - - - - Creates a new blend state with the specified values. - - Determines whether each render target uses a separate blend state. - Turns on alpha-to-coverage. - - - - Built-in temporary render textures produced during camera's rendering. - - - - - The raw RenderBuffer pointer to be used. - - - - - Target texture of currently rendering camera. - - - - - Currently active render target. - - - - - Camera's depth texture. - - - - - Camera's depth+normals texture. - - - - - Deferred shading G-buffer #0 (typically diffuse color). - - - - - Deferred shading G-buffer #1 (typically specular + roughness). - - - - - Deferred shading G-buffer #2 (typically normals). - - - - - Deferred shading G-buffer #3 (typically emission/lighting). - - - - - Deferred shading G-buffer #4 (typically occlusion mask for static lights if any). - - - - - G-buffer #5 Available. - - - - - G-buffer #6 Available. - - - - - G-buffer #7 Available. - - - - - Motion Vectors generated when the camera has motion vectors enabled. - - - - - Deferred lighting light buffer. - - - - - Deferred lighting HDR specular light buffer (Xbox 360 only). - - - - - Deferred lighting (normals+specular) G-buffer. - - - - - A globally set property name. - - - - - Reflections gathered from default reflection and reflections probes. - - - - - The given RenderTexture. - - - - - Resolved depth buffer from deferred. - - - - - Defines set by editor when compiling shaders, depending on target platform and tier. - - - - - SHADER_API_DESKTOP is set when compiling shader for "desktop" platforms. - - - - - SHADER_API_ES30 is set when the Graphics API is OpenGL ES 3 and the minimum supported OpenGL ES 3 version is OpenGL ES 3.0. - - - - - SHADER_API_MOBILE is set when compiling shader for mobile platforms. - - - - - Unity enables UNITY_ASTC_NORMALMAP_ENCODING when DXT5nm-style normal maps are used on Android, iOS or tvOS. - - - - - UNITY_COLORSPACE_GAMMA is set when compiling shaders for Gamma Color Space. - - - - - UNITY_ENABLE_DETAIL_NORMALMAP is set if Detail Normal Map should be sampled if assigned. - - - - - UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS enables use of built-in shadow comparison samplers on OpenGL ES 2.0. - - - - - UNITY_ENABLE_REFLECTION_BUFFERS is set when deferred shading renders reflection probes in deferred mode. With this option set reflections are rendered into a per-pixel buffer. This is similar to the way lights are rendered into a per-pixel buffer. UNITY_ENABLE_REFLECTION_BUFFERS is on by default when using deferred shading, but you can turn it off by setting “No support” for the Deferred Reflections shader option in Graphics Settings. When the setting is off, reflection probes are rendered per-object, similar to the way forward rendering works. - - - - - UNITY_FRAMEBUFFER_FETCH_AVAILABLE is set when compiling shaders for platforms where framebuffer fetch is potentially available. - - - - - UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS is set automatically for platforms that don't require full floating-point precision support in fragment shaders. - - - - - UNITY_HARDWARE_TIER1 is set when compiling shaders for GraphicsTier.Tier1. - - - - - UNITY_HARDWARE_TIER2 is set when compiling shaders for GraphicsTier.Tier2. - - - - - UNITY_HARDWARE_TIER3 is set when compiling shaders for GraphicsTier.Tier3. - - - - - UNITY_LIGHT_PROBE_PROXY_VOLUME is set when Light Probe Proxy Volume feature is supported by the current graphics API and is enabled in the current Tier Settings(Graphics Settings). - - - - - UNITY_LIGHTMAP_DLDR_ENCODING is set when lightmap textures are using double LDR encoding to store the values in the texture. - - - - - UNITY_LIGHTMAP_FULL_HDR is set when lightmap textures are not using any encoding to store the values in the texture. - - - - - UNITY_LIGHTMAP_RGBM_ENCODING is set when lightmap textures are using RGBM encoding to store the values in the texture. - - - - - UNITY_METAL_SHADOWS_USE_POINT_FILTERING is set if shadow sampler should use point filtering on iOS Metal. - - - - - UNITY_NO_DXT5nm is set when compiling shader for platform that do not support DXT5NM, meaning that normal maps will be encoded in RGB instead. - - - - - UNITY_NO_FULL_STANDARD_SHADER is set if Standard shader BRDF3 with extra simplifications should be used. - - - - - UNITY_NO_RGBM is set when compiling shader for platform that do not support RGBM, so dLDR will be used instead. - - - - - UNITY_NO_SCREENSPACE_SHADOWS is set when screenspace cascaded shadow maps are disabled. - - - - - UNITY_PBS_USE_BRDF1 is set if Standard Shader BRDF1 should be used. - - - - - UNITY_PBS_USE_BRDF2 is set if Standard Shader BRDF2 should be used. - - - - - UNITY_PBS_USE_BRDF3 is set if Standard Shader BRDF3 should be used. - - - - - Unity enables UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION when Vulkan pre-transform is enabled and supported on the target build platform. - - - - - UNITY_SPECCUBE_BLENDING is set if Reflection Probes Blending is enabled. - - - - - UNITY_SPECCUBE_BLENDING is set if Reflection Probes Box Projection is enabled. - - - - - Unity sets UNITY_UNIFIED_SHADER_PRECISION_MODEL if, in Player Settings, you set Shader Precision Model to Unified. - - - - - UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS is set when Semitransparent Shadows are enabled. - - - - - Is virtual texturing enabled and supported on this platform. - - - - - Built-in shader modes used by Rendering.GraphicsSettings. - - - - - Don't use any shader, effectively disabling the functionality. - - - - - Use built-in shader (default). - - - - - Use custom shader instead of built-in one. - - - - - Built-in shader types used by Rendering.GraphicsSettings. - - - - - Shader used for deferred reflection probes. - - - - - Shader used for deferred shading calculations. - - - - - Shader used for depth and normals texture when enabled on a Camera. - - - - - Shader used for legacy deferred lighting calculations. - - - - - Default shader used for lens flares. - - - - - Default shader used for light halos. - - - - - Shader used for Motion Vectors when enabled on a Camera. - - - - - Shader used for screen-space cascaded shadows. - - - - - Defines a place in camera's rendering to attach Rendering.CommandBuffer objects to. - - - - - After camera's depth+normals texture is generated. - - - - - After camera's depth texture is generated. - - - - - After camera has done rendering everything. - - - - - After final geometry pass in deferred lighting. - - - - - After transparent objects in forward rendering. - - - - - After opaque objects in forward rendering. - - - - - After deferred rendering G-buffer is rendered. - - - - - After halo and lens flares. - - - - - After image effects. - - - - - After image effects that happen between opaque & transparent objects. - - - - - After lighting pass in deferred rendering. - - - - - After reflections pass in deferred rendering. - - - - - After skybox is drawn. - - - - - Before camera's depth+normals texture is generated. - - - - - Before camera's depth texture is generated. - - - - - Before final geometry pass in deferred lighting. - - - - - Before transparent objects in forward rendering. - - - - - Before opaque objects in forward rendering. - - - - - Before deferred rendering G-buffer is rendered. - - - - - Before halo and lens flares. - - - - - Before image effects. - - - - - Before image effects that happen between opaque & transparent objects. - - - - - Before lighting pass in deferred rendering. - - - - - Before reflections pass in deferred rendering. - - - - - Before skybox is drawn. - - - - - The HDR mode to use for rendering. - - - - - Uses RenderTextureFormat.ARGBHalf. - - - - - Uses RenderTextureFormat.RGB111110Float. - - - - - Camera related properties in CullingParameters. - - - - - Get a camera culling plane. - - Plane index (up to 5). - - Camera culling plane. - - - - - Get a shadow culling plane. - - Plane index (up to 5). - - Shadow culling plane. - - - - - Set a camera culling plane. - - Plane index (up to 5). - Camera culling plane. - - - - Set a shadow culling plane. - - Plane index (up to 5). - Shadow culling plane. - - - - Specifies which color components will get written into the target framebuffer. - - - - - Write all components (R, G, B and Alpha). - - - - - Write alpha component. - - - - - Write blue component. - - - - - Write green component. - - - - - Write red component. - - - - - List of graphics commands to execute. - - - - - Name of this command buffer. - - - - - Size of this command buffer in bytes (Read Only). - - - - - Adds a command to begin profile sampling. - - Name of the profile information used for sampling. - The CustomSampler that the CommandBuffer uses for sampling. - - - - Adds a command to begin profile sampling. - - Name of the profile information used for sampling. - The CustomSampler that the CommandBuffer uses for sampling. - - - - Add a "blit into a render texture" command. - - Source texture or render target to blit from. - Destination to blit into. - Material to use. - Shader pass to use (default is -1, meaning "all passes"). - Scale applied to the source texture coordinate. - Offset applied to the source texture coordinate. - The texture array source slice to perform the blit from. - The texture array destination slice to perform the blit to. - - - - Add a "blit into a render texture" command. - - Source texture or render target to blit from. - Destination to blit into. - Material to use. - Shader pass to use (default is -1, meaning "all passes"). - Scale applied to the source texture coordinate. - Offset applied to the source texture coordinate. - The texture array source slice to perform the blit from. - The texture array destination slice to perform the blit to. - - - - Add a "blit into a render texture" command. - - Source texture or render target to blit from. - Destination to blit into. - Material to use. - Shader pass to use (default is -1, meaning "all passes"). - Scale applied to the source texture coordinate. - Offset applied to the source texture coordinate. - The texture array source slice to perform the blit from. - The texture array destination slice to perform the blit to. - - - - Add a "blit into a render texture" command. - - Source texture or render target to blit from. - Destination to blit into. - Material to use. - Shader pass to use (default is -1, meaning "all passes"). - Scale applied to the source texture coordinate. - Offset applied to the source texture coordinate. - The texture array source slice to perform the blit from. - The texture array destination slice to perform the blit to. - - - - Add a "blit into a render texture" command. - - Source texture or render target to blit from. - Destination to blit into. - Material to use. - Shader pass to use (default is -1, meaning "all passes"). - Scale applied to the source texture coordinate. - Offset applied to the source texture coordinate. - The texture array source slice to perform the blit from. - The texture array destination slice to perform the blit to. - - - - Add a "blit into a render texture" command. - - Source texture or render target to blit from. - Destination to blit into. - Material to use. - Shader pass to use (default is -1, meaning "all passes"). - Scale applied to the source texture coordinate. - Offset applied to the source texture coordinate. - The texture array source slice to perform the blit from. - The texture array destination slice to perform the blit to. - - - - Add a "blit into a render texture" command. - - Source texture or render target to blit from. - Destination to blit into. - Material to use. - Shader pass to use (default is -1, meaning "all passes"). - Scale applied to the source texture coordinate. - Offset applied to the source texture coordinate. - The texture array source slice to perform the blit from. - The texture array destination slice to perform the blit to. - - - - Add a "blit into a render texture" command. - - Source texture or render target to blit from. - Destination to blit into. - Material to use. - Shader pass to use (default is -1, meaning "all passes"). - Scale applied to the source texture coordinate. - Offset applied to the source texture coordinate. - The texture array source slice to perform the blit from. - The texture array destination slice to perform the blit to. - - - - Add a "blit into a render texture" command. - - Source texture or render target to blit from. - Destination to blit into. - Material to use. - Shader pass to use (default is -1, meaning "all passes"). - Scale applied to the source texture coordinate. - Offset applied to the source texture coordinate. - The texture array source slice to perform the blit from. - The texture array destination slice to perform the blit to. - - - - Add a "blit into a render texture" command. - - Source texture or render target to blit from. - Destination to blit into. - Material to use. - Shader pass to use (default is -1, meaning "all passes"). - Scale applied to the source texture coordinate. - Offset applied to the source texture coordinate. - The texture array source slice to perform the blit from. - The texture array destination slice to perform the blit to. - - - - Add a "blit into a render texture" command. - - Source texture or render target to blit from. - Destination to blit into. - Material to use. - Shader pass to use (default is -1, meaning "all passes"). - Scale applied to the source texture coordinate. - Offset applied to the source texture coordinate. - The texture array source slice to perform the blit from. - The texture array destination slice to perform the blit to. - - - - Adds a command to build the RayTracingAccelerationStructure to be used in a ray tracing dispatch. - - The RayTracingAccelerationStructure to be generated. - - - - Clear all commands in the buffer. - - - - - Clear random write targets for level pixel shaders. - - - - - Adds a "clear render target" command. - - Should clear depth buffer? - Should clear color buffer? - Color to clear with. - Depth to clear with (default is 1.0). - - - - Converts and copies a source texture to a destination texture with a different format or dimensions. - - Source texture. - Destination texture. - Source element (e.g. cubemap face). Set this to 0 for 2D source textures. - Destination element (e.g. cubemap face or texture array element). - - - - Converts and copies a source texture to a destination texture with a different format or dimensions. - - Source texture. - Destination texture. - Source element (e.g. cubemap face). Set this to 0 for 2D source textures. - Destination element (e.g. cubemap face or texture array element). - - - - Adds a command to copy ComputeBuffer or GraphicsBuffer counter value. - - Append/consume buffer to copy the counter from. - A buffer to copy the counter to. - Target byte offset in dst buffer. - - - - Adds a command to copy ComputeBuffer or GraphicsBuffer counter value. - - Append/consume buffer to copy the counter from. - A buffer to copy the counter to. - Target byte offset in dst buffer. - - - - Adds a command to copy ComputeBuffer or GraphicsBuffer counter value. - - Append/consume buffer to copy the counter from. - A buffer to copy the counter to. - Target byte offset in dst buffer. - - - - Adds a command to copy ComputeBuffer or GraphicsBuffer counter value. - - Append/consume buffer to copy the counter from. - A buffer to copy the counter to. - Target byte offset in dst buffer. - - - - Adds a command to copy a texture into another texture. - - Source texture or identifier, see RenderTargetIdentifier. - Destination texture or identifier, see RenderTargetIdentifier. - Source texture element (cubemap face, texture array layer or 3D texture depth slice). - Source texture mipmap level. - Destination texture element (cubemap face, texture array layer or 3D texture depth slice). - Destination texture mipmap level. - X coordinate of source texture region to copy (left side is zero). - Y coordinate of source texture region to copy (bottom is zero). - Width of source texture region to copy. - Height of source texture region to copy. - X coordinate of where to copy region in destination texture (left side is zero). - Y coordinate of where to copy region in destination texture (bottom is zero). - - - - Adds a command to copy a texture into another texture. - - Source texture or identifier, see RenderTargetIdentifier. - Destination texture or identifier, see RenderTargetIdentifier. - Source texture element (cubemap face, texture array layer or 3D texture depth slice). - Source texture mipmap level. - Destination texture element (cubemap face, texture array layer or 3D texture depth slice). - Destination texture mipmap level. - X coordinate of source texture region to copy (left side is zero). - Y coordinate of source texture region to copy (bottom is zero). - Width of source texture region to copy. - Height of source texture region to copy. - X coordinate of where to copy region in destination texture (left side is zero). - Y coordinate of where to copy region in destination texture (bottom is zero). - - - - Adds a command to copy a texture into another texture. - - Source texture or identifier, see RenderTargetIdentifier. - Destination texture or identifier, see RenderTargetIdentifier. - Source texture element (cubemap face, texture array layer or 3D texture depth slice). - Source texture mipmap level. - Destination texture element (cubemap face, texture array layer or 3D texture depth slice). - Destination texture mipmap level. - X coordinate of source texture region to copy (left side is zero). - Y coordinate of source texture region to copy (bottom is zero). - Width of source texture region to copy. - Height of source texture region to copy. - X coordinate of where to copy region in destination texture (left side is zero). - Y coordinate of where to copy region in destination texture (bottom is zero). - - - - Adds a command to copy a texture into another texture. - - Source texture or identifier, see RenderTargetIdentifier. - Destination texture or identifier, see RenderTargetIdentifier. - Source texture element (cubemap face, texture array layer or 3D texture depth slice). - Source texture mipmap level. - Destination texture element (cubemap face, texture array layer or 3D texture depth slice). - Destination texture mipmap level. - X coordinate of source texture region to copy (left side is zero). - Y coordinate of source texture region to copy (bottom is zero). - Width of source texture region to copy. - Height of source texture region to copy. - X coordinate of where to copy region in destination texture (left side is zero). - Y coordinate of where to copy region in destination texture (bottom is zero). - - - - Shortcut for calling GommandBuffer.CreateGraphicsFence with GraphicsFenceType.AsyncQueueSynchronization as the first parameter. - - The synchronization stage. See Graphics.CreateGraphicsFence. - - Returns a new GraphicsFence. - - - - - Shortcut for calling GommandBuffer.CreateGraphicsFence with GraphicsFenceType.AsyncQueueSynchronization as the first parameter. - - The synchronization stage. See Graphics.CreateGraphicsFence. - - Returns a new GraphicsFence. - - - - - This functionality is deprecated, and should no longer be used. Please use CommandBuffer.CreateGraphicsFence. - - - - - - Creates a GraphicsFence which will be passed after the last Blit, Clear, Draw, Dispatch or Texture Copy command prior to this call has been completed on the GPU. - - The type of GraphicsFence to create. Currently the only supported value is GraphicsFenceType.AsyncQueueSynchronization. - On some platforms there is a significant gap between the vertex processing completing and the pixel processing begining for a given draw call. This parameter allows for the fence to be passed after either the vertex or pixel processing for the proceeding draw has completed. If a compute shader dispatch was the last task submitted then this parameter is ignored. - - Returns a new GraphicsFence. - - - - - Create a new empty command buffer. - - - - - Add a command to disable the hardware scissor rectangle. - - - - - Adds a command to disable global shader keyword. - - Shader keyword to disable. - - - - Add a command to execute a ComputeShader. - - ComputeShader to execute. - Kernel index to execute, see ComputeShader.FindKernel. - Number of work groups in the X dimension. - Number of work groups in the Y dimension. - Number of work groups in the Z dimension. - ComputeBuffer with dispatch arguments. - Byte offset indicating the location of the dispatch arguments in the buffer. - - - - Add a command to execute a ComputeShader. - - ComputeShader to execute. - Kernel index to execute, see ComputeShader.FindKernel. - Number of work groups in the X dimension. - Number of work groups in the Y dimension. - Number of work groups in the Z dimension. - ComputeBuffer with dispatch arguments. - Byte offset indicating the location of the dispatch arguments in the buffer. - - - - Add a command to execute a ComputeShader. - - ComputeShader to execute. - Kernel index to execute, see ComputeShader.FindKernel. - Number of work groups in the X dimension. - Number of work groups in the Y dimension. - Number of work groups in the Z dimension. - ComputeBuffer with dispatch arguments. - Byte offset indicating the location of the dispatch arguments in the buffer. - - - - Adds a command to execute a RayTracingShader. - - RayTracingShader to execute. - The name of the ray generation shader. - The width of the ray generation shader thread grid. - The height of the ray generation shader thread grid. - The depth of the ray generation shader thread grid. - Optional parameter used to setup camera-related built-in shader variables. - - - - Add a "draw mesh" command. - - Mesh to draw. - Transformation matrix to use. - Material to use. - Which subset of the mesh to render. - Which pass of the shader to use (default is -1, which renders all passes). - Additional Material properties to apply onto the Material just before this Mesh is drawn. See MaterialPropertyBlock. - - - - Adds a "draw mesh with instancing" command. - -The command will not immediately fail and throw an exception if Material.enableInstancing is false, but it will log an error and skips rendering each time the command is being executed if such a condition is detected. - -InvalidOperationException will be thrown if the current platform doesn't support this API (i.e. if GPU instancing is not available). See SystemInfo.supportsInstancing. - - The Mesh to draw. - Which subset of the mesh to draw. This only applies to meshes that are composed of several materials. - Material to use. - Which pass of the shader to use, or -1 which renders all passes. - The array of object transformation matrices. - The number of instances to be drawn. - Additional Material properties to apply onto the Material just before this Mesh is drawn. See MaterialPropertyBlock. - - - - Adds a "draw mesh with instancing" command. - -The command will not immediately fail and throw an exception if Material.enableInstancing is false, but it will log an error and skips rendering each time the command is being executed if such a condition is detected. - -InvalidOperationException will be thrown if the current platform doesn't support this API (i.e. if GPU instancing is not available). See SystemInfo.supportsInstancing. - - The Mesh to draw. - Which subset of the mesh to draw. This only applies to meshes that are composed of several materials. - Material to use. - Which pass of the shader to use, or -1 which renders all passes. - The array of object transformation matrices. - The number of instances to be drawn. - Additional Material properties to apply onto the Material just before this Mesh is drawn. See MaterialPropertyBlock. - - - - Adds a "draw mesh with instancing" command. - -The command will not immediately fail and throw an exception if Material.enableInstancing is false, but it will log an error and skips rendering each time the command is being executed if such a condition is detected. - -InvalidOperationException will be thrown if the current platform doesn't support this API (i.e. if GPU instancing is not available). See SystemInfo.supportsInstancing. - - The Mesh to draw. - Which subset of the mesh to draw. This only applies to meshes that are composed of several materials. - Material to use. - Which pass of the shader to use, or -1 which renders all passes. - The array of object transformation matrices. - The number of instances to be drawn. - Additional Material properties to apply onto the Material just before this Mesh is drawn. See MaterialPropertyBlock. - - - - Add a "draw mesh with indirect instancing" command. - - The Mesh to draw. - Which subset of the mesh to draw. This only applies to meshes that are composed of several materials. - Material to use. - Which pass of the shader to use, or -1 which renders all passes. - Additional Material properties to apply onto the Material just before this Mesh is drawn. See MaterialPropertyBlock. - The GPU buffer containing the arguments for how many instances of this mesh to draw. - The byte offset into the buffer, where the draw arguments start. - - - - Add a "draw mesh with indirect instancing" command. - - The Mesh to draw. - Which subset of the mesh to draw. This only applies to meshes that are composed of several materials. - Material to use. - Which pass of the shader to use, or -1 which renders all passes. - Additional Material properties to apply onto the Material just before this Mesh is drawn. See MaterialPropertyBlock. - The GPU buffer containing the arguments for how many instances of this mesh to draw. - The byte offset into the buffer, where the draw arguments start. - - - - Add a "draw mesh with indirect instancing" command. - - The Mesh to draw. - Which subset of the mesh to draw. This only applies to meshes that are composed of several materials. - Material to use. - Which pass of the shader to use, or -1 which renders all passes. - Additional Material properties to apply onto the Material just before this Mesh is drawn. See MaterialPropertyBlock. - The GPU buffer containing the arguments for how many instances of this mesh to draw. - The byte offset into the buffer, where the draw arguments start. - - - - Add a "draw mesh with indirect instancing" command. - - The Mesh to draw. - Which subset of the mesh to draw. This only applies to meshes that are composed of several materials. - Material to use. - Which pass of the shader to use, or -1 which renders all passes. - Additional Material properties to apply onto the Material just before this Mesh is drawn. See MaterialPropertyBlock. - The GPU buffer containing the arguments for how many instances of this mesh to draw. - The byte offset into the buffer, where the draw arguments start. - - - - Add a "draw mesh with indirect instancing" command. - - The Mesh to draw. - Which subset of the mesh to draw. This only applies to meshes that are composed of several materials. - Material to use. - Which pass of the shader to use, or -1 which renders all passes. - Additional Material properties to apply onto the Material just before this Mesh is drawn. See MaterialPropertyBlock. - The GPU buffer containing the arguments for how many instances of this mesh to draw. - The byte offset into the buffer, where the draw arguments start. - - - - Add a "draw mesh with indirect instancing" command. - - The Mesh to draw. - Which subset of the mesh to draw. This only applies to meshes that are composed of several materials. - Material to use. - Which pass of the shader to use, or -1 which renders all passes. - Additional Material properties to apply onto the Material just before this Mesh is drawn. See MaterialPropertyBlock. - The GPU buffer containing the arguments for how many instances of this mesh to draw. - The byte offset into the buffer, where the draw arguments start. - - - - Add a "draw mesh with instancing" command. - -Draw a mesh using Procedural Instancing. This is similar to Graphics.DrawMeshInstancedIndirect, except that when the instance count is known from script, it can be supplied directly using this method, rather than via a ComputeBuffer. -If Material.enableInstancing is false, the command logs an error and skips rendering each time the command is executed; the command does not immediately fail and throw an exception. - -InvalidOperationException will be thrown if the current platform doesn't support this API (for example, if GPU instancing is not available). See SystemInfo.supportsInstancing. - - The Mesh to draw. - Which subset of the mesh to draw. This only applies to meshes that are composed of several materials. - Material to use. - Which pass of the shader to use, or -1 which renders all passes. - The number of instances to be drawn. - Additional Material properties to apply onto the Material just before this Mesh is drawn. See MaterialPropertyBlock. - - - - Adds a command onto the commandbuffer to draw the VR Device's occlusion mesh to the current render target. - - The viewport of the camera currently being rendered. - - - - Add a "draw procedural geometry" command. - - Transformation matrix to use. - Material to use. - Which pass of the shader to use (or -1 for all passes). - Topology of the procedural geometry. - Vertex count to render. - Instance count to render. - Additional material properties to apply just before rendering. See MaterialPropertyBlock. - - - - Add a "draw procedural geometry" command. - - Transformation matrix to use. - Material to use. - Which pass of the shader to use (or -1 for all passes). - Topology of the procedural geometry. - Vertex count to render. - Instance count to render. - Additional material properties to apply just before rendering. See MaterialPropertyBlock. - - - - Add a "draw procedural geometry" command. - - Transformation matrix to use. - Material to use. - Which pass of the shader to use (or -1 for all passes). - Topology of the procedural geometry. - Vertex count to render. - Instance count to render. - Additional material properties to apply just before rendering. See MaterialPropertyBlock. - - - - Add a "draw procedural geometry" command. - - Transformation matrix to use. - Material to use. - Which pass of the shader to use (or -1 for all passes). - Topology of the procedural geometry. - Index count to render. - Instance count to render. - The index buffer used to submit vertices to the GPU. - Additional material properties to apply just before rendering. See MaterialPropertyBlock. - - - - Add a "draw procedural geometry" command. - - Transformation matrix to use. - Material to use. - Which pass of the shader to use (or -1 for all passes). - Topology of the procedural geometry. - Index count to render. - Instance count to render. - The index buffer used to submit vertices to the GPU. - Additional material properties to apply just before rendering. See MaterialPropertyBlock. - - - - Add a "draw procedural geometry" command. - - Transformation matrix to use. - Material to use. - Which pass of the shader to use (or -1 for all passes). - Topology of the procedural geometry. - Index count to render. - Instance count to render. - The index buffer used to submit vertices to the GPU. - Additional material properties to apply just before rendering. See MaterialPropertyBlock. - - - - Add a "draw procedural geometry" command. - - Transformation matrix to use. - Material to use. - Which pass of the shader to use (or -1 for all passes). - Topology of the procedural geometry. - Additional material properties to apply just before rendering. See MaterialPropertyBlock. - Buffer with draw arguments. - Byte offset where in the buffer the draw arguments are. - - - - Add a "draw procedural geometry" command. - - Transformation matrix to use. - Material to use. - Which pass of the shader to use (or -1 for all passes). - Topology of the procedural geometry. - Additional material properties to apply just before rendering. See MaterialPropertyBlock. - Buffer with draw arguments. - Byte offset where in the buffer the draw arguments are. - - - - Add a "draw procedural geometry" command. - - Transformation matrix to use. - Material to use. - Which pass of the shader to use (or -1 for all passes). - Topology of the procedural geometry. - Additional material properties to apply just before rendering. See MaterialPropertyBlock. - Buffer with draw arguments. - Byte offset where in the buffer the draw arguments are. - - - - Add a "draw procedural geometry" command. - - Transformation matrix to use. - Material to use. - Which pass of the shader to use (or -1 for all passes). - Topology of the procedural geometry. - Additional material properties to apply just before rendering. See MaterialPropertyBlock. - Buffer with draw arguments. - Byte offset where in the buffer the draw arguments are. - - - - Add a "draw procedural geometry" command. - - Transformation matrix to use. - Material to use. - Which pass of the shader to use (or -1 for all passes). - Topology of the procedural geometry. - Additional material properties to apply just before rendering. See MaterialPropertyBlock. - Buffer with draw arguments. - Byte offset where in the buffer the draw arguments are. - - - - Add a "draw procedural geometry" command. - - Transformation matrix to use. - Material to use. - Which pass of the shader to use (or -1 for all passes). - Topology of the procedural geometry. - Additional material properties to apply just before rendering. See MaterialPropertyBlock. - Buffer with draw arguments. - Byte offset where in the buffer the draw arguments are. - - - - Add a "draw procedural geometry" command. - - Index buffer used to submit vertices to the GPU. - Transformation matrix to use. - Material to use. - Which pass of the shader to use (or -1 for all passes). - Topology of the procedural geometry. - Buffer with draw arguments. - Byte offset where in the buffer the draw arguments are. - Additional material properties to apply just before rendering. See MaterialPropertyBlock. - - - - Add a "draw procedural geometry" command. - - Index buffer used to submit vertices to the GPU. - Transformation matrix to use. - Material to use. - Which pass of the shader to use (or -1 for all passes). - Topology of the procedural geometry. - Buffer with draw arguments. - Byte offset where in the buffer the draw arguments are. - Additional material properties to apply just before rendering. See MaterialPropertyBlock. - - - - Add a "draw procedural geometry" command. - - Index buffer used to submit vertices to the GPU. - Transformation matrix to use. - Material to use. - Which pass of the shader to use (or -1 for all passes). - Topology of the procedural geometry. - Buffer with draw arguments. - Byte offset where in the buffer the draw arguments are. - Additional material properties to apply just before rendering. See MaterialPropertyBlock. - - - - Add a "draw procedural geometry" command. - - Index buffer used to submit vertices to the GPU. - Transformation matrix to use. - Material to use. - Which pass of the shader to use (or -1 for all passes). - Topology of the procedural geometry. - Buffer with draw arguments. - Byte offset where in the buffer the draw arguments are. - Additional material properties to apply just before rendering. See MaterialPropertyBlock. - - - - Add a "draw procedural geometry" command. - - Index buffer used to submit vertices to the GPU. - Transformation matrix to use. - Material to use. - Which pass of the shader to use (or -1 for all passes). - Topology of the procedural geometry. - Buffer with draw arguments. - Byte offset where in the buffer the draw arguments are. - Additional material properties to apply just before rendering. See MaterialPropertyBlock. - - - - Add a "draw procedural geometry" command. - - Index buffer used to submit vertices to the GPU. - Transformation matrix to use. - Material to use. - Which pass of the shader to use (or -1 for all passes). - Topology of the procedural geometry. - Buffer with draw arguments. - Byte offset where in the buffer the draw arguments are. - Additional material properties to apply just before rendering. See MaterialPropertyBlock. - - - - Add a "draw renderer" command. - - Renderer to draw. - Material to use. - Which subset of the mesh to render. - Which pass of the shader to use (default is -1, which renders all passes). - - - - Add a command to enable the hardware scissor rectangle. - - Viewport rectangle in pixel coordinates. - - - - Adds a command to enable global shader keyword. - - Shader keyword to enable. - - - - Adds a command to begin profile sampling. - - Name of the profile information used for sampling. - The CustomSampler that the CommandBuffer uses for sampling. - - - - Adds a command to begin profile sampling. - - Name of the profile information used for sampling. - The CustomSampler that the CommandBuffer uses for sampling. - - - - Generate mipmap levels of a render texture. - - The render texture requiring mipmaps generation. - - - - Generate mipmap levels of a render texture. - - The render texture requiring mipmaps generation. - - - - Add a "get a temporary render texture" command. - - Shader property name for this texture. - Width in pixels, or -1 for "camera pixel width". - Height in pixels, or -1 for "camera pixel height". - Depth buffer bits (0, 16 or 24). - Texture filtering mode (default is Point). - Format of the render texture (default is ARGB32). - Color space conversion mode. - Anti-aliasing (default is no anti-aliasing). - Should random-write access into the texture be enabled (default is false). - Use this RenderTextureDescriptor for the settings when creating the temporary RenderTexture. - Render texture memoryless mode. - - - - Add a "get a temporary render texture" command. - - Shader property name for this texture. - Width in pixels, or -1 for "camera pixel width". - Height in pixels, or -1 for "camera pixel height". - Depth buffer bits (0, 16 or 24). - Texture filtering mode (default is Point). - Format of the render texture (default is ARGB32). - Color space conversion mode. - Anti-aliasing (default is no anti-aliasing). - Should random-write access into the texture be enabled (default is false). - Use this RenderTextureDescriptor for the settings when creating the temporary RenderTexture. - Render texture memoryless mode. - - - - Add a "get a temporary render texture array" command. - - Shader property name for this texture. - Width in pixels, or -1 for "camera pixel width". - Height in pixels, or -1 for "camera pixel height". - Number of slices in texture array. - Depth buffer bits (0, 16 or 24). - Texture filtering mode (default is Point). - Format of the render texture (default is ARGB32). - Color space conversion mode. - Anti-aliasing (default is no anti-aliasing). - Should random-write access into the texture be enabled (default is false). - - - - Increments the updateCount property of a Texture. - - Increments the updateCount for this Texture. - - - - Send a user-defined blit event to a native code plugin. - - Native code callback to queue for Unity's renderer to invoke. - User defined command id to send to the callback. - Source render target. - Destination render target. - User data command parameters. - User data command flags. - - - - Deprecated. Use CommandBuffer.IssuePluginCustomTextureUpdateV2 instead. - - Native code callback to queue for Unity's renderer to invoke. - Texture resource to be updated. - User data to send to the native plugin. - - - - Deprecated. Use CommandBuffer.IssuePluginCustomTextureUpdateV2 instead. - - Native code callback to queue for Unity's renderer to invoke. - Texture resource to be updated. - User data to send to the native plugin. - - - - Send a texture update event to a native code plugin. - - Native code callback to queue for Unity's renderer to invoke. - Texture resource to be updated. - User data to send to the native plugin. - - - - Send a user-defined event to a native code plugin. - - Native code callback to queue for Unity's renderer to invoke. - User defined id to send to the callback. - - - - Send a user-defined event to a native code plugin with custom data. - - Native code callback to queue for Unity's renderer to invoke. - Custom data to pass to the native plugin callback. - Built in or user defined id to send to the callback. - - - - Add a "release a temporary render texture" command. - - Shader property name for this texture. - - - - Adds an asynchonous GPU readback request command to the command buffer. - - The resource to read the data from. - Size in bytes of the data to be retrieved from the ComputeBuffer or GraphicsBuffer. - Offset in bytes in the ComputeBuffer or GraphicsBuffer. - The index of the mipmap to be fetched. - The target TextureFormat of the data. Conversion will happen automatically if format is different from the format stored on GPU. - Starting X coordinate in pixels of the Texture data to be fetched. - Starting Y coordinate in pixels of the Texture data to be fetched. - Start Z coordinate in pixels for the Texture3D being fetched. Index of Start layer for TextureCube, Texture2DArray and TextureCubeArray being fetched. - Depth in pixels for Texture3D being fetched. Number of layers for TextureCube, TextureArray and TextureCubeArray. - Width in pixels of the Texture data to be fetched. - Height in pixels of the Texture data to be fetched. - A delegate System.Action called once the request is fullfilled. The done request is passed as parameter to the System.Action. - - - - Adds an asynchonous GPU readback request command to the command buffer. - - The resource to read the data from. - Size in bytes of the data to be retrieved from the ComputeBuffer or GraphicsBuffer. - Offset in bytes in the ComputeBuffer or GraphicsBuffer. - The index of the mipmap to be fetched. - The target TextureFormat of the data. Conversion will happen automatically if format is different from the format stored on GPU. - Starting X coordinate in pixels of the Texture data to be fetched. - Starting Y coordinate in pixels of the Texture data to be fetched. - Start Z coordinate in pixels for the Texture3D being fetched. Index of Start layer for TextureCube, Texture2DArray and TextureCubeArray being fetched. - Depth in pixels for Texture3D being fetched. Number of layers for TextureCube, TextureArray and TextureCubeArray. - Width in pixels of the Texture data to be fetched. - Height in pixels of the Texture data to be fetched. - A delegate System.Action called once the request is fullfilled. The done request is passed as parameter to the System.Action. - - - - Adds an asynchonous GPU readback request command to the command buffer. - - The resource to read the data from. - Size in bytes of the data to be retrieved from the ComputeBuffer or GraphicsBuffer. - Offset in bytes in the ComputeBuffer or GraphicsBuffer. - The index of the mipmap to be fetched. - The target TextureFormat of the data. Conversion will happen automatically if format is different from the format stored on GPU. - Starting X coordinate in pixels of the Texture data to be fetched. - Starting Y coordinate in pixels of the Texture data to be fetched. - Start Z coordinate in pixels for the Texture3D being fetched. Index of Start layer for TextureCube, Texture2DArray and TextureCubeArray being fetched. - Depth in pixels for Texture3D being fetched. Number of layers for TextureCube, TextureArray and TextureCubeArray. - Width in pixels of the Texture data to be fetched. - Height in pixels of the Texture data to be fetched. - A delegate System.Action called once the request is fullfilled. The done request is passed as parameter to the System.Action. - - - - Adds an asynchonous GPU readback request command to the command buffer. - - The resource to read the data from. - Size in bytes of the data to be retrieved from the ComputeBuffer or GraphicsBuffer. - Offset in bytes in the ComputeBuffer or GraphicsBuffer. - The index of the mipmap to be fetched. - The target TextureFormat of the data. Conversion will happen automatically if format is different from the format stored on GPU. - Starting X coordinate in pixels of the Texture data to be fetched. - Starting Y coordinate in pixels of the Texture data to be fetched. - Start Z coordinate in pixels for the Texture3D being fetched. Index of Start layer for TextureCube, Texture2DArray and TextureCubeArray being fetched. - Depth in pixels for Texture3D being fetched. Number of layers for TextureCube, TextureArray and TextureCubeArray. - Width in pixels of the Texture data to be fetched. - Height in pixels of the Texture data to be fetched. - A delegate System.Action called once the request is fullfilled. The done request is passed as parameter to the System.Action. - - - - Adds an asynchonous GPU readback request command to the command buffer. - - The resource to read the data from. - Size in bytes of the data to be retrieved from the ComputeBuffer or GraphicsBuffer. - Offset in bytes in the ComputeBuffer or GraphicsBuffer. - The index of the mipmap to be fetched. - The target TextureFormat of the data. Conversion will happen automatically if format is different from the format stored on GPU. - Starting X coordinate in pixels of the Texture data to be fetched. - Starting Y coordinate in pixels of the Texture data to be fetched. - Start Z coordinate in pixels for the Texture3D being fetched. Index of Start layer for TextureCube, Texture2DArray and TextureCubeArray being fetched. - Depth in pixels for Texture3D being fetched. Number of layers for TextureCube, TextureArray and TextureCubeArray. - Width in pixels of the Texture data to be fetched. - Height in pixels of the Texture data to be fetched. - A delegate System.Action called once the request is fullfilled. The done request is passed as parameter to the System.Action. - - - - Adds an asynchonous GPU readback request command to the command buffer. - - The resource to read the data from. - Size in bytes of the data to be retrieved from the ComputeBuffer or GraphicsBuffer. - Offset in bytes in the ComputeBuffer or GraphicsBuffer. - The index of the mipmap to be fetched. - The target TextureFormat of the data. Conversion will happen automatically if format is different from the format stored on GPU. - Starting X coordinate in pixels of the Texture data to be fetched. - Starting Y coordinate in pixels of the Texture data to be fetched. - Start Z coordinate in pixels for the Texture3D being fetched. Index of Start layer for TextureCube, Texture2DArray and TextureCubeArray being fetched. - Depth in pixels for Texture3D being fetched. Number of layers for TextureCube, TextureArray and TextureCubeArray. - Width in pixels of the Texture data to be fetched. - Height in pixels of the Texture data to be fetched. - A delegate System.Action called once the request is fullfilled. The done request is passed as parameter to the System.Action. - - - - Adds an asynchonous GPU readback request command to the command buffer. - - The resource to read the data from. - Size in bytes of the data to be retrieved from the ComputeBuffer or GraphicsBuffer. - Offset in bytes in the ComputeBuffer or GraphicsBuffer. - The index of the mipmap to be fetched. - The target TextureFormat of the data. Conversion will happen automatically if format is different from the format stored on GPU. - Starting X coordinate in pixels of the Texture data to be fetched. - Starting Y coordinate in pixels of the Texture data to be fetched. - Start Z coordinate in pixels for the Texture3D being fetched. Index of Start layer for TextureCube, Texture2DArray and TextureCubeArray being fetched. - Depth in pixels for Texture3D being fetched. Number of layers for TextureCube, TextureArray and TextureCubeArray. - Width in pixels of the Texture data to be fetched. - Height in pixels of the Texture data to be fetched. - A delegate System.Action called once the request is fullfilled. The done request is passed as parameter to the System.Action. - - - - Adds an asynchonous GPU readback request command to the command buffer. - - The resource to read the data from. - Size in bytes of the data to be retrieved from the ComputeBuffer or GraphicsBuffer. - Offset in bytes in the ComputeBuffer or GraphicsBuffer. - The index of the mipmap to be fetched. - The target TextureFormat of the data. Conversion will happen automatically if format is different from the format stored on GPU. - Starting X coordinate in pixels of the Texture data to be fetched. - Starting Y coordinate in pixels of the Texture data to be fetched. - Start Z coordinate in pixels for the Texture3D being fetched. Index of Start layer for TextureCube, Texture2DArray and TextureCubeArray being fetched. - Depth in pixels for Texture3D being fetched. Number of layers for TextureCube, TextureArray and TextureCubeArray. - Width in pixels of the Texture data to be fetched. - Height in pixels of the Texture data to be fetched. - A delegate System.Action called once the request is fullfilled. The done request is passed as parameter to the System.Action. - - - - Adds an asynchonous GPU readback request command to the command buffer. - - The resource to read the data from. - Size in bytes of the data to be retrieved from the ComputeBuffer or GraphicsBuffer. - Offset in bytes in the ComputeBuffer or GraphicsBuffer. - The index of the mipmap to be fetched. - The target TextureFormat of the data. Conversion will happen automatically if format is different from the format stored on GPU. - Starting X coordinate in pixels of the Texture data to be fetched. - Starting Y coordinate in pixels of the Texture data to be fetched. - Start Z coordinate in pixels for the Texture3D being fetched. Index of Start layer for TextureCube, Texture2DArray and TextureCubeArray being fetched. - Depth in pixels for Texture3D being fetched. Number of layers for TextureCube, TextureArray and TextureCubeArray. - Width in pixels of the Texture data to be fetched. - Height in pixels of the Texture data to be fetched. - A delegate System.Action called once the request is fullfilled. The done request is passed as parameter to the System.Action. - - - - Adds an asynchonous GPU readback request command to the command buffer. - - The resource to read the data from. - Size in bytes of the data to be retrieved from the ComputeBuffer or GraphicsBuffer. - Offset in bytes in the ComputeBuffer or GraphicsBuffer. - The index of the mipmap to be fetched. - The target TextureFormat of the data. Conversion will happen automatically if format is different from the format stored on GPU. - Starting X coordinate in pixels of the Texture data to be fetched. - Starting Y coordinate in pixels of the Texture data to be fetched. - Start Z coordinate in pixels for the Texture3D being fetched. Index of Start layer for TextureCube, Texture2DArray and TextureCubeArray being fetched. - Depth in pixels for Texture3D being fetched. Number of layers for TextureCube, TextureArray and TextureCubeArray. - Width in pixels of the Texture data to be fetched. - Height in pixels of the Texture data to be fetched. - A delegate System.Action called once the request is fullfilled. The done request is passed as parameter to the System.Action. - - - - Adds an asynchonous GPU readback request command to the command buffer. - - The resource to read the data from. - Size in bytes of the data to be retrieved from the ComputeBuffer or GraphicsBuffer. - Offset in bytes in the ComputeBuffer or GraphicsBuffer. - The index of the mipmap to be fetched. - The target TextureFormat of the data. Conversion will happen automatically if format is different from the format stored on GPU. - Starting X coordinate in pixels of the Texture data to be fetched. - Starting Y coordinate in pixels of the Texture data to be fetched. - Start Z coordinate in pixels for the Texture3D being fetched. Index of Start layer for TextureCube, Texture2DArray and TextureCubeArray being fetched. - Depth in pixels for Texture3D being fetched. Number of layers for TextureCube, TextureArray and TextureCubeArray. - Width in pixels of the Texture data to be fetched. - Height in pixels of the Texture data to be fetched. - A delegate System.Action called once the request is fullfilled. The done request is passed as parameter to the System.Action. - - - - Adds an asynchonous GPU readback request command to the command buffer. - - Reference to a NativeArray to write the data into. - The resource to read the data from. - The index of the mipmap to fetch. - The target TextureFormat of the data. Conversion happens automatically if this format is different from the format stored on the GPU. - The starting x-coordinate, in pixels, of the Texture data to fetch. - The starting y-coordinate, in pixels, of the Texture data to fetch. - The starting z-coordinate, in pixels, of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the index of the start layer. - The width, in pixels, of the Texture data to fetch. - The height, in pixels, of the Texture data to fetch. - The depth, in pixels of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the number of layers to retrieve. - A delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - - - Adds an asynchonous GPU readback request command to the command buffer. - - Reference to a NativeArray to write the data into. - The resource to read the data from. - The index of the mipmap to fetch. - The target TextureFormat of the data. Conversion happens automatically if this format is different from the format stored on the GPU. - The starting x-coordinate, in pixels, of the Texture data to fetch. - The starting y-coordinate, in pixels, of the Texture data to fetch. - The starting z-coordinate, in pixels, of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the index of the start layer. - The width, in pixels, of the Texture data to fetch. - The height, in pixels, of the Texture data to fetch. - The depth, in pixels of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the number of layers to retrieve. - A delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - - - Adds an asynchonous GPU readback request command to the command buffer. - - Reference to a NativeArray to write the data into. - The resource to read the data from. - The index of the mipmap to fetch. - The target TextureFormat of the data. Conversion happens automatically if this format is different from the format stored on the GPU. - The starting x-coordinate, in pixels, of the Texture data to fetch. - The starting y-coordinate, in pixels, of the Texture data to fetch. - The starting z-coordinate, in pixels, of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the index of the start layer. - The width, in pixels, of the Texture data to fetch. - The height, in pixels, of the Texture data to fetch. - The depth, in pixels of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the number of layers to retrieve. - A delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - - - Adds an asynchonous GPU readback request command to the command buffer. - - Reference to a NativeArray to write the data into. - The resource to read the data from. - The index of the mipmap to fetch. - The target TextureFormat of the data. Conversion happens automatically if this format is different from the format stored on the GPU. - The starting x-coordinate, in pixels, of the Texture data to fetch. - The starting y-coordinate, in pixels, of the Texture data to fetch. - The starting z-coordinate, in pixels, of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the index of the start layer. - The width, in pixels, of the Texture data to fetch. - The height, in pixels, of the Texture data to fetch. - The depth, in pixels of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the number of layers to retrieve. - A delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - - - Adds an asynchonous GPU readback request command to the command buffer. - - Reference to a NativeArray to write the data into. - The resource to read the data from. - The index of the mipmap to fetch. - The target TextureFormat of the data. Conversion happens automatically if this format is different from the format stored on the GPU. - The starting x-coordinate, in pixels, of the Texture data to fetch. - The starting y-coordinate, in pixels, of the Texture data to fetch. - The starting z-coordinate, in pixels, of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the index of the start layer. - The width, in pixels, of the Texture data to fetch. - The height, in pixels, of the Texture data to fetch. - The depth, in pixels of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the number of layers to retrieve. - A delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - - - Adds an asynchonous GPU readback request command to the command buffer. - - Reference to a NativeArray to write the data into. - The resource to read the data from. - The index of the mipmap to fetch. - The target TextureFormat of the data. Conversion happens automatically if this format is different from the format stored on the GPU. - The starting x-coordinate, in pixels, of the Texture data to fetch. - The starting y-coordinate, in pixels, of the Texture data to fetch. - The starting z-coordinate, in pixels, of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the index of the start layer. - The width, in pixels, of the Texture data to fetch. - The height, in pixels, of the Texture data to fetch. - The depth, in pixels of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the number of layers to retrieve. - A delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - - - Adds an asynchonous GPU readback request command to the command buffer. - - Reference to a NativeArray to write the data into. - The resource to read the data from. - The index of the mipmap to fetch. - The target TextureFormat of the data. Conversion happens automatically if this format is different from the format stored on the GPU. - The starting x-coordinate, in pixels, of the Texture data to fetch. - The starting y-coordinate, in pixels, of the Texture data to fetch. - The starting z-coordinate, in pixels, of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the index of the start layer. - The width, in pixels, of the Texture data to fetch. - The height, in pixels, of the Texture data to fetch. - The depth, in pixels of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the number of layers to retrieve. - A delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - - - Adds an asynchonous GPU readback request command to the command buffer. - - Reference to a NativeArray to write the data into. - The resource to read the data from. - The size, in bytes, of the data to retrieve from the ComputeBuffer or GraphicsBuffer. - The offset in bytes in the ComputeBuffer or GraphicsBuffer. - A delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - - - Adds an asynchonous GPU readback request command to the command buffer. - - Reference to a NativeArray to write the data into. - The resource to read the data from. - The size, in bytes, of the data to retrieve from the ComputeBuffer or GraphicsBuffer. - The offset in bytes in the ComputeBuffer or GraphicsBuffer. - A delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - - - Adds an asynchonous GPU readback request command to the command buffer. - - Reference to a NativeArray to write the data into. - The resource to read the data from. - The size, in bytes, of the data to retrieve from the ComputeBuffer or GraphicsBuffer. - The offset in bytes in the ComputeBuffer or GraphicsBuffer. - A delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - - - Adds an asynchonous GPU readback request command to the command buffer. - - Reference to a NativeArray to write the data into. - The resource to read the data from. - The size, in bytes, of the data to retrieve from the ComputeBuffer or GraphicsBuffer. - The offset in bytes in the ComputeBuffer or GraphicsBuffer. - A delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - - - Adds an asynchonous GPU readback request command to the command buffer. - - Reference to a NativeSlice to write the data into. - The resource to read the data from. - The index of the mipmap to fetch. - The target TextureFormat of the data. If the target format is different from the format stored on the GPU, the conversion is automatic. - The starting x-coordinate, in pixels, of the Texture data to fetch. - The starting y-coordinate, in pixels, of the Texture data to fetch. - The starting z-coordinate, in pixels, of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the index of the start layer. - The width, in pixels, of the Texture data to fetch. - The height, in pixels, of the Texture data to fetch. - The depth, in pixels of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the number of layers to retrieve. - A delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - - - Adds an asynchonous GPU readback request command to the command buffer. - - Reference to a NativeSlice to write the data into. - The resource to read the data from. - The index of the mipmap to fetch. - The target TextureFormat of the data. If the target format is different from the format stored on the GPU, the conversion is automatic. - The starting x-coordinate, in pixels, of the Texture data to fetch. - The starting y-coordinate, in pixels, of the Texture data to fetch. - The starting z-coordinate, in pixels, of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the index of the start layer. - The width, in pixels, of the Texture data to fetch. - The height, in pixels, of the Texture data to fetch. - The depth, in pixels of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the number of layers to retrieve. - A delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - - - Adds an asynchonous GPU readback request command to the command buffer. - - Reference to a NativeSlice to write the data into. - The resource to read the data from. - The index of the mipmap to fetch. - The target TextureFormat of the data. If the target format is different from the format stored on the GPU, the conversion is automatic. - The starting x-coordinate, in pixels, of the Texture data to fetch. - The starting y-coordinate, in pixels, of the Texture data to fetch. - The starting z-coordinate, in pixels, of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the index of the start layer. - The width, in pixels, of the Texture data to fetch. - The height, in pixels, of the Texture data to fetch. - The depth, in pixels of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the number of layers to retrieve. - A delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - - - Adds an asynchonous GPU readback request command to the command buffer. - - Reference to a NativeSlice to write the data into. - The resource to read the data from. - The index of the mipmap to fetch. - The target TextureFormat of the data. If the target format is different from the format stored on the GPU, the conversion is automatic. - The starting x-coordinate, in pixels, of the Texture data to fetch. - The starting y-coordinate, in pixels, of the Texture data to fetch. - The starting z-coordinate, in pixels, of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the index of the start layer. - The width, in pixels, of the Texture data to fetch. - The height, in pixels, of the Texture data to fetch. - The depth, in pixels of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the number of layers to retrieve. - A delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - - - Adds an asynchonous GPU readback request command to the command buffer. - - Reference to a NativeSlice to write the data into. - The resource to read the data from. - The index of the mipmap to fetch. - The target TextureFormat of the data. If the target format is different from the format stored on the GPU, the conversion is automatic. - The starting x-coordinate, in pixels, of the Texture data to fetch. - The starting y-coordinate, in pixels, of the Texture data to fetch. - The starting z-coordinate, in pixels, of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the index of the start layer. - The width, in pixels, of the Texture data to fetch. - The height, in pixels, of the Texture data to fetch. - The depth, in pixels of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the number of layers to retrieve. - A delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - - - Adds an asynchonous GPU readback request command to the command buffer. - - Reference to a NativeSlice to write the data into. - The resource to read the data from. - The index of the mipmap to fetch. - The target TextureFormat of the data. If the target format is different from the format stored on the GPU, the conversion is automatic. - The starting x-coordinate, in pixels, of the Texture data to fetch. - The starting y-coordinate, in pixels, of the Texture data to fetch. - The starting z-coordinate, in pixels, of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the index of the start layer. - The width, in pixels, of the Texture data to fetch. - The height, in pixels, of the Texture data to fetch. - The depth, in pixels of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the number of layers to retrieve. - A delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - - - Adds an asynchonous GPU readback request command to the command buffer. - - Reference to a NativeSlice to write the data into. - The resource to read the data from. - The index of the mipmap to fetch. - The target TextureFormat of the data. If the target format is different from the format stored on the GPU, the conversion is automatic. - The starting x-coordinate, in pixels, of the Texture data to fetch. - The starting y-coordinate, in pixels, of the Texture data to fetch. - The starting z-coordinate, in pixels, of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the index of the start layer. - The width, in pixels, of the Texture data to fetch. - The height, in pixels, of the Texture data to fetch. - The depth, in pixels of the Texture3D to fetch. For TextureCube, Texture2DArray, and TextureCubeArray, this is the number of layers to retrieve. - A delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - - - Adds an asynchonous GPU readback request command to the command buffer. - - Reference to a NativeSlice to write the data into. - The resource to read the data from. - The size, in bytes, of the data to retrieve from the ComputeBuffer or GraphicsBuffer. - The offset in bytes in the ComputeBuffer or GraphicsBuffer. - A delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - - - Adds an asynchonous GPU readback request command to the command buffer. - - Reference to a NativeSlice to write the data into. - The resource to read the data from. - The size, in bytes, of the data to retrieve from the ComputeBuffer or GraphicsBuffer. - The offset in bytes in the ComputeBuffer or GraphicsBuffer. - A delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - - - Adds an asynchonous GPU readback request command to the command buffer. - - Reference to a NativeSlice to write the data into. - The resource to read the data from. - The size, in bytes, of the data to retrieve from the ComputeBuffer or GraphicsBuffer. - The offset in bytes in the ComputeBuffer or GraphicsBuffer. - A delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - - - Adds an asynchonous GPU readback request command to the command buffer. - - Reference to a NativeSlice to write the data into. - The resource to read the data from. - The size, in bytes, of the data to retrieve from the ComputeBuffer or GraphicsBuffer. - The offset in bytes in the ComputeBuffer or GraphicsBuffer. - A delegate System.Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the System.Action. - - - - Force an antialiased render texture to be resolved. - - The antialiased render texture to resolve. - The render texture to resolve into. If set, the target render texture must have the same dimensions and format as the source. - - - - Adds a command to set the counter value of append/consume buffer. - - The destination buffer. - Value of the append/consume counter. - - - - Adds a command to set the buffer with values from an array. - - The destination buffer. - Array of values to fill the buffer. - - - - Adds a command to set the buffer with values from an array. - - The destination buffer. - Array of values to fill the buffer. - - - - Adds a command to set the buffer with values from an array. - - The destination buffer. - Array of values to fill the buffer. - - - - Adds a command to process a partial copy of data values from an array into the buffer. - - The destination buffer. - Array of values to fill the buffer. - The first element index in data to copy to the compute buffer. - The first element index in compute buffer to receive the data. - The number of elements to copy. - The first element index in data to copy to the compute buffer. - - - - Adds a command to process a partial copy of data values from an array into the buffer. - - The destination buffer. - Array of values to fill the buffer. - The first element index in data to copy to the compute buffer. - The first element index in compute buffer to receive the data. - The number of elements to copy. - The first element index in data to copy to the compute buffer. - - - - Adds a command to process a partial copy of data values from an array into the buffer. - - The destination buffer. - Array of values to fill the buffer. - The first element index in data to copy to the compute buffer. - The first element index in compute buffer to receive the data. - The number of elements to copy. - The first element index in data to copy to the compute buffer. - - - - Adds a command to set an input or output buffer parameter on a ComputeShader. - - ComputeShader to set parameter for. - Which kernel the buffer is being set for. See ComputeShader.FindKernel. - Name of the buffer variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Buffer to set. - - - - Adds a command to set an input or output buffer parameter on a ComputeShader. - - ComputeShader to set parameter for. - Which kernel the buffer is being set for. See ComputeShader.FindKernel. - Name of the buffer variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Buffer to set. - - - - Adds a command to set an input or output buffer parameter on a ComputeShader. - - ComputeShader to set parameter for. - Which kernel the buffer is being set for. See ComputeShader.FindKernel. - Name of the buffer variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Buffer to set. - - - - Adds a command to set an input or output buffer parameter on a ComputeShader. - - ComputeShader to set parameter for. - Which kernel the buffer is being set for. See ComputeShader.FindKernel. - Name of the buffer variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Buffer to set. - - - - Adds a command to set a constant buffer on a ComputeShader. - - The ComputeShader to set parameter for. - The ID of the property name for the constant buffer in shader code. Use Shader.PropertyToID to get this ID. - The name of the constant buffer in shaders code. - The buffer to bind as constant buffer. - The offset in bytes from the beginning of the buffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0. - The number of bytes to bind. - - - - Adds a command to set a constant buffer on a ComputeShader. - - The ComputeShader to set parameter for. - The ID of the property name for the constant buffer in shader code. Use Shader.PropertyToID to get this ID. - The name of the constant buffer in shaders code. - The buffer to bind as constant buffer. - The offset in bytes from the beginning of the buffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0. - The number of bytes to bind. - - - - Adds a command to set a constant buffer on a ComputeShader. - - The ComputeShader to set parameter for. - The ID of the property name for the constant buffer in shader code. Use Shader.PropertyToID to get this ID. - The name of the constant buffer in shaders code. - The buffer to bind as constant buffer. - The offset in bytes from the beginning of the buffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0. - The number of bytes to bind. - - - - Adds a command to set a constant buffer on a ComputeShader. - - The ComputeShader to set parameter for. - The ID of the property name for the constant buffer in shader code. Use Shader.PropertyToID to get this ID. - The name of the constant buffer in shaders code. - The buffer to bind as constant buffer. - The offset in bytes from the beginning of the buffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0. - The number of bytes to bind. - - - - Adds a command to set a float parameter on a ComputeShader. - - ComputeShader to set parameter for. - Name of the variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Value to set. - - - - Adds a command to set a float parameter on a ComputeShader. - - ComputeShader to set parameter for. - Name of the variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Value to set. - - - - Adds a command to set multiple consecutive float parameters on a ComputeShader. - - ComputeShader to set parameter for. - Name of the variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Values to set. - - - - Adds a command to set multiple consecutive float parameters on a ComputeShader. - - ComputeShader to set parameter for. - Name of the variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Values to set. - - - - Adds a command to set an integer parameter on a ComputeShader. - - ComputeShader to set parameter for. - Name of the variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Value to set. - - - - Adds a command to set an integer parameter on a ComputeShader. - - ComputeShader to set parameter for. - Name of the variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Value to set. - - - - Adds a command to set multiple consecutive integer parameters on a ComputeShader. - - ComputeShader to set parameter for. - Name of the variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Values to set. - - - - Adds a command to set multiple consecutive integer parameters on a ComputeShader. - - ComputeShader to set parameter for. - Name of the variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Values to set. - - - - Adds a command to set a matrix array parameter on a ComputeShader. - - ComputeShader to set parameter for. - Name of the variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Value to set. - - - - Adds a command to set a matrix array parameter on a ComputeShader. - - ComputeShader to set parameter for. - Name of the variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Value to set. - - - - Adds a command to set a matrix parameter on a ComputeShader. - - ComputeShader to set parameter for. - Name of the variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Value to set. - - - - Adds a command to set a matrix parameter on a ComputeShader. - - ComputeShader to set parameter for. - Name of the variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Value to set. - - - - Adds a command to set a texture parameter on a ComputeShader. - - ComputeShader to set parameter for. - Which kernel the texture is being set for. See ComputeShader.FindKernel. - Name of the texture variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Texture value or identifier to set, see RenderTargetIdentifier. - Optional mipmap level of the read-write texture. - Optional parameter that specifies the type of data to set from the RenderTexture. - - - - Adds a command to set a texture parameter on a ComputeShader. - - ComputeShader to set parameter for. - Which kernel the texture is being set for. See ComputeShader.FindKernel. - Name of the texture variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Texture value or identifier to set, see RenderTargetIdentifier. - Optional mipmap level of the read-write texture. - Optional parameter that specifies the type of data to set from the RenderTexture. - - - - Adds a command to set a texture parameter on a ComputeShader. - - ComputeShader to set parameter for. - Which kernel the texture is being set for. See ComputeShader.FindKernel. - Name of the texture variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Texture value or identifier to set, see RenderTargetIdentifier. - Optional mipmap level of the read-write texture. - Optional parameter that specifies the type of data to set from the RenderTexture. - - - - Adds a command to set a texture parameter on a ComputeShader. - - ComputeShader to set parameter for. - Which kernel the texture is being set for. See ComputeShader.FindKernel. - Name of the texture variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Texture value or identifier to set, see RenderTargetIdentifier. - Optional mipmap level of the read-write texture. - Optional parameter that specifies the type of data to set from the RenderTexture. - - - - Adds a command to set a texture parameter on a ComputeShader. - - ComputeShader to set parameter for. - Which kernel the texture is being set for. See ComputeShader.FindKernel. - Name of the texture variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Texture value or identifier to set, see RenderTargetIdentifier. - Optional mipmap level of the read-write texture. - Optional parameter that specifies the type of data to set from the RenderTexture. - - - - Adds a command to set a texture parameter on a ComputeShader. - - ComputeShader to set parameter for. - Which kernel the texture is being set for. See ComputeShader.FindKernel. - Name of the texture variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Texture value or identifier to set, see RenderTargetIdentifier. - Optional mipmap level of the read-write texture. - Optional parameter that specifies the type of data to set from the RenderTexture. - - - - Adds a command to set a vector array parameter on a ComputeShader. - - ComputeShader to set parameter for. - Property name. - Property name ID. Use Shader.PropertyToID to get this ID. - Value to set. - - - - Adds a command to set a vector array parameter on a ComputeShader. - - ComputeShader to set parameter for. - Property name. - Property name ID. Use Shader.PropertyToID to get this ID. - Value to set. - - - - Adds a command to set a vector parameter on a ComputeShader. - - ComputeShader to set parameter for. - Name of the variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Value to set. - - - - Adds a command to set a vector parameter on a ComputeShader. - - ComputeShader to set parameter for. - Name of the variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Value to set. - - - - Set flags describing the intention for how the command buffer will be executed. - - The flags to set. - - - - Add a "set global shader buffer property" command. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - The buffer to set. - - - - Add a "set global shader buffer property" command. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - The buffer to set. - - - - Add a "set global shader buffer property" command. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - The buffer to set. - - - - Add a "set global shader buffer property" command. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - The buffer to set. - - - - Add a "set global shader color property" command. - - - - - - - - Add a "set global shader color property" command. - - - - - - - - Add a command to bind a global constant buffer. - - The name ID of the constant buffer retrieved by Shader.PropertyToID. - The name of the constant buffer to override. - The buffer to bind. - Offset from the start of the buffer in bytes. - Size in bytes of the area to bind. - - - - Add a command to bind a global constant buffer. - - The name ID of the constant buffer retrieved by Shader.PropertyToID. - The name of the constant buffer to override. - The buffer to bind. - Offset from the start of the buffer in bytes. - Size in bytes of the area to bind. - - - - Add a command to bind a global constant buffer. - - The name ID of the constant buffer retrieved by Shader.PropertyToID. - The name of the constant buffer to override. - The buffer to bind. - Offset from the start of the buffer in bytes. - Size in bytes of the area to bind. - - - - Add a command to bind a global constant buffer. - - The name ID of the constant buffer retrieved by Shader.PropertyToID. - The name of the constant buffer to override. - The buffer to bind. - Offset from the start of the buffer in bytes. - Size in bytes of the area to bind. - - - - Add a command to set global depth bias. - - Constant depth bias. - Slope-dependent depth bias. - - - - Add a "set global shader float property" command. - - - - - - - - Add a "set global shader float property" command. - - - - - - - - Add a "set global shader float array property" command. - - - - - - - - Add a "set global shader float array property" command. - - - - - - - - Add a "set global shader float array property" command. - - - - - - - - Add a "set global shader float array property" command. - - - - - - - - Sets the given global integer property for all shaders. - - - - - - - - Sets the given global integer property for all shaders. - - - - - - - - Add a "set global shader matrix property" command. - - - - - - - - Add a "set global shader matrix property" command. - - - - - - - - Add a "set global shader matrix array property" command. - - - - - - - - Add a "set global shader matrix array property" command. - - - - - - - - Add a "set global shader matrix array property" command. - - - - - - - - Add a "set global shader matrix array property" command. - - - - - - - - Add a "set global shader texture property" command, referencing a RenderTexture. - - - - - - - - - Add a "set global shader texture property" command, referencing a RenderTexture. - - - - - - - - - Add a "set global shader texture property" command, referencing a RenderTexture. - - - - - - - - - Add a "set global shader texture property" command, referencing a RenderTexture. - - - - - - - - - Add a "set global shader vector property" command. - - - - - - - - Add a "set global shader vector property" command. - - - - - - - - Add a "set global shader vector array property" command. - - - - - - - - Add a "set global shader vector array property" command. - - - - - - - - Add a "set global shader vector array property" command. - - - - - - - - Add a "set global shader vector array property" command. - - - - - - - - Adds a command to multiply the instance count of every draw call by a specific multiplier. - - - - - - Add a "set invert culling" command to the buffer. - - A boolean indicating whether to invert the backface culling (true) or not (false). - - - - Add a command to set the projection matrix. - - Projection (camera to clip space) matrix. - - - - Set random write target for level pixel shaders. - - Index of the random write target in the shader. - Buffer to set as the write target. - Whether to leave the append/consume counter value unchanged. - RenderTargetIdentifier to set as the write target. - - - - Set random write target for level pixel shaders. - - Index of the random write target in the shader. - Buffer to set as the write target. - Whether to leave the append/consume counter value unchanged. - RenderTargetIdentifier to set as the write target. - - - - Set random write target for level pixel shaders. - - Index of the random write target in the shader. - Buffer to set as the write target. - Whether to leave the append/consume counter value unchanged. - RenderTargetIdentifier to set as the write target. - - - - Set random write target for level pixel shaders. - - Index of the random write target in the shader. - Buffer to set as the write target. - Whether to leave the append/consume counter value unchanged. - RenderTargetIdentifier to set as the write target. - - - - Set random write target for level pixel shaders. - - Index of the random write target in the shader. - Buffer to set as the write target. - Whether to leave the append/consume counter value unchanged. - RenderTargetIdentifier to set as the write target. - - - - Adds a command to set the RayTracingAccelerationStructure to be used with the RayTracingShader. - - The RayTracingShader to set parameter for. - Name of the RayTracingAccelerationStructure in shader coder. - Property name ID. Use Shader.PropertyToID to get this ID. - The RayTracingAccelerationStructure to be used. - - - - Adds a command to set the RayTracingAccelerationStructure to be used with the RayTracingShader. - - The RayTracingShader to set parameter for. - Name of the RayTracingAccelerationStructure in shader coder. - Property name ID. Use Shader.PropertyToID to get this ID. - The RayTracingAccelerationStructure to be used. - - - - Adds a command to set the RayTracingAccelerationStructure to be used with the RayTracingShader. - - The RayTracingShader to set parameter for. - Name of the RayTracingAccelerationStructure in shader coder. - Property name ID. Use Shader.PropertyToID to get this ID. - The RayTracingAccelerationStructure to be used. - - - - Adds a command to set the RayTracingAccelerationStructure to be used with the RayTracingShader. - - The RayTracingShader to set parameter for. - Name of the RayTracingAccelerationStructure in shader coder. - Property name ID. Use Shader.PropertyToID to get this ID. - The RayTracingAccelerationStructure to be used. - - - - Adds a command to set an input or output buffer parameter on a RayTracingShader. - - The RayTracingShader to set parameter for. - The name of the constant buffer in shader code. - The ID of the property name for the constant buffer in shader code. Use Shader.PropertyToID to get this ID. - Buffer to set. - - - - Adds a command to set an input or output buffer parameter on a RayTracingShader. - - The RayTracingShader to set parameter for. - The name of the constant buffer in shader code. - The ID of the property name for the constant buffer in shader code. Use Shader.PropertyToID to get this ID. - Buffer to set. - - - - Adds a command to set a constant buffer on a RayTracingShader. - - The RayTracingShader to set parameter for. - The ID of the property name for the constant buffer in shader code. Use Shader.PropertyToID to get this ID. - The name of the constant buffer in shader code. - The buffer to bind as constant buffer. - The offset in bytes from the beginning of the buffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0. - The number of bytes to bind. - - - - Adds a command to set a constant buffer on a RayTracingShader. - - The RayTracingShader to set parameter for. - The ID of the property name for the constant buffer in shader code. Use Shader.PropertyToID to get this ID. - The name of the constant buffer in shader code. - The buffer to bind as constant buffer. - The offset in bytes from the beginning of the buffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0. - The number of bytes to bind. - - - - Adds a command to set a constant buffer on a RayTracingShader. - - The RayTracingShader to set parameter for. - The ID of the property name for the constant buffer in shader code. Use Shader.PropertyToID to get this ID. - The name of the constant buffer in shader code. - The buffer to bind as constant buffer. - The offset in bytes from the beginning of the buffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0. - The number of bytes to bind. - - - - Adds a command to set a constant buffer on a RayTracingShader. - - The RayTracingShader to set parameter for. - The ID of the property name for the constant buffer in shader code. Use Shader.PropertyToID to get this ID. - The name of the constant buffer in shader code. - The buffer to bind as constant buffer. - The offset in bytes from the beginning of the buffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0. - The number of bytes to bind. - - - - Adds a command to set a float parameter on a RayTracingShader. - - RayTracingShader to set parameter for. - Name of the variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Value to set. - - - - Adds a command to set a float parameter on a RayTracingShader. - - RayTracingShader to set parameter for. - Name of the variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Value to set. - - - - Adds a command to set multiple consecutive float parameters on a RayTracingShader. - - RayTracingShader to set parameter for. - Name of the variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Values to set. - - - - Adds a command to set multiple consecutive float parameters on a RayTracingShader. - - RayTracingShader to set parameter for. - Name of the variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Values to set. - - - - Adds a command to set an integer parameter on a RayTracingShader. - - RayTracingShader to set parameter for. - Name of the variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Value to set. - - - - Adds a command to set an integer parameter on a RayTracingShader. - - RayTracingShader to set parameter for. - Name of the variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Value to set. - - - - Adds a command to set multiple consecutive integer parameters on a RayTracingShader. - - RayTracingShader to set parameter for. - Name of the variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Values to set. - - - - Adds a command to set multiple consecutive integer parameters on a RayTracingShader. - - RayTracingShader to set parameter for. - Name of the variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Values to set. - - - - Adds a command to set a matrix array parameter on a RayTracingShader. - - RayTracingShader to set parameter for. - Name of the variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Value to set. - - - - Adds a command to set a matrix array parameter on a RayTracingShader. - - RayTracingShader to set parameter for. - Name of the variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Value to set. - - - - Adds a command to set a matrix parameter on a RayTracingShader. - - RayTracingShader to set parameter for. - Name of the variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Value to set. - - - - Adds a command to set a matrix parameter on a RayTracingShader. - - RayTracingShader to set parameter for. - Name of the variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Value to set. - - - - Adds a command to select which Shader Pass to use when executing ray/geometry intersection shaders. - - RayTracingShader to set parameter for. - The Shader Pass to use when executing ray tracing shaders. - - - - Adds a command to set a texture parameter on a RayTracingShader. - - RayTracingShader to set parameter for. - Name of the texture variable in shader code. - The ID of the property name for the texture in shader code. Use Shader.PropertyToID to get this ID. - Texture value or identifier to set, see RenderTargetIdentifier. - - - - Adds a command to set a texture parameter on a RayTracingShader. - - RayTracingShader to set parameter for. - Name of the texture variable in shader code. - The ID of the property name for the texture in shader code. Use Shader.PropertyToID to get this ID. - Texture value or identifier to set, see RenderTargetIdentifier. - - - - Adds a command to set a vector array parameter on a RayTracingShader. - - RayTracingShader to set parameter for. - Property name. - Property name ID. Use Shader.PropertyToID to get this ID. - Value to set. - - - - Adds a command to set a vector array parameter on a RayTracingShader. - - RayTracingShader to set parameter for. - Property name. - Property name ID. Use Shader.PropertyToID to get this ID. - Value to set. - - - - Adds a command to set a vector parameter on a RayTracingShader. - - RayTracingShader to set parameter for. - Name of the variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Value to set. - - - - Adds a command to set a vector parameter on a RayTracingShader. - - RayTracingShader to set parameter for. - Name of the variable in shader code. - Property name ID. Use Shader.PropertyToID to get this ID. - Value to set. - - - - Add a "set active render target" command. - - Render target to set for both color & depth buffers. - Render target to set as a color buffer. - Render targets to set as color buffers (MRT). - Render target to set as a depth buffer. - The mip level of the render target to render into. - The cubemap face of a cubemap render target to render into. - Slice of a 3D or array render target to set. - Load action that is used for color and depth/stencil buffers. - Store action that is used for color and depth/stencil buffers. - Load action that is used for the color buffer. - Store action that is used for the color buffer. - Load action that is used for the depth/stencil buffer. - Store action that is used for the depth/stencil buffer. - - - - - Add a "set active render target" command. - - Render target to set for both color & depth buffers. - Render target to set as a color buffer. - Render targets to set as color buffers (MRT). - Render target to set as a depth buffer. - The mip level of the render target to render into. - The cubemap face of a cubemap render target to render into. - Slice of a 3D or array render target to set. - Load action that is used for color and depth/stencil buffers. - Store action that is used for color and depth/stencil buffers. - Load action that is used for the color buffer. - Store action that is used for the color buffer. - Load action that is used for the depth/stencil buffer. - Store action that is used for the depth/stencil buffer. - - - - - Add a "set active render target" command. - - Render target to set for both color & depth buffers. - Render target to set as a color buffer. - Render targets to set as color buffers (MRT). - Render target to set as a depth buffer. - The mip level of the render target to render into. - The cubemap face of a cubemap render target to render into. - Slice of a 3D or array render target to set. - Load action that is used for color and depth/stencil buffers. - Store action that is used for color and depth/stencil buffers. - Load action that is used for the color buffer. - Store action that is used for the color buffer. - Load action that is used for the depth/stencil buffer. - Store action that is used for the depth/stencil buffer. - - - - - Add a "set active render target" command. - - Render target to set for both color & depth buffers. - Render target to set as a color buffer. - Render targets to set as color buffers (MRT). - Render target to set as a depth buffer. - The mip level of the render target to render into. - The cubemap face of a cubemap render target to render into. - Slice of a 3D or array render target to set. - Load action that is used for color and depth/stencil buffers. - Store action that is used for color and depth/stencil buffers. - Load action that is used for the color buffer. - Store action that is used for the color buffer. - Load action that is used for the depth/stencil buffer. - Store action that is used for the depth/stencil buffer. - - - - - Add a "set active render target" command. - - Render target to set for both color & depth buffers. - Render target to set as a color buffer. - Render targets to set as color buffers (MRT). - Render target to set as a depth buffer. - The mip level of the render target to render into. - The cubemap face of a cubemap render target to render into. - Slice of a 3D or array render target to set. - Load action that is used for color and depth/stencil buffers. - Store action that is used for color and depth/stencil buffers. - Load action that is used for the color buffer. - Store action that is used for the color buffer. - Load action that is used for the depth/stencil buffer. - Store action that is used for the depth/stencil buffer. - - - - - Add a "set active render target" command. - - Render target to set for both color & depth buffers. - Render target to set as a color buffer. - Render targets to set as color buffers (MRT). - Render target to set as a depth buffer. - The mip level of the render target to render into. - The cubemap face of a cubemap render target to render into. - Slice of a 3D or array render target to set. - Load action that is used for color and depth/stencil buffers. - Store action that is used for color and depth/stencil buffers. - Load action that is used for the color buffer. - Store action that is used for the color buffer. - Load action that is used for the depth/stencil buffer. - Store action that is used for the depth/stencil buffer. - - - - - Add a "set active render target" command. - - Render target to set for both color & depth buffers. - Render target to set as a color buffer. - Render targets to set as color buffers (MRT). - Render target to set as a depth buffer. - The mip level of the render target to render into. - The cubemap face of a cubemap render target to render into. - Slice of a 3D or array render target to set. - Load action that is used for color and depth/stencil buffers. - Store action that is used for color and depth/stencil buffers. - Load action that is used for the color buffer. - Store action that is used for the color buffer. - Load action that is used for the depth/stencil buffer. - Store action that is used for the depth/stencil buffer. - - - - - Add a "set active render target" command. - - Render target to set for both color & depth buffers. - Render target to set as a color buffer. - Render targets to set as color buffers (MRT). - Render target to set as a depth buffer. - The mip level of the render target to render into. - The cubemap face of a cubemap render target to render into. - Slice of a 3D or array render target to set. - Load action that is used for color and depth/stencil buffers. - Store action that is used for color and depth/stencil buffers. - Load action that is used for the color buffer. - Store action that is used for the color buffer. - Load action that is used for the depth/stencil buffer. - Store action that is used for the depth/stencil buffer. - - - - - Add a "set active render target" command. - - Render target to set for both color & depth buffers. - Render target to set as a color buffer. - Render targets to set as color buffers (MRT). - Render target to set as a depth buffer. - The mip level of the render target to render into. - The cubemap face of a cubemap render target to render into. - Slice of a 3D or array render target to set. - Load action that is used for color and depth/stencil buffers. - Store action that is used for color and depth/stencil buffers. - Load action that is used for the color buffer. - Store action that is used for the color buffer. - Load action that is used for the depth/stencil buffer. - Store action that is used for the depth/stencil buffer. - - - - - Add a "set active render target" command. - - Render target to set for both color & depth buffers. - Render target to set as a color buffer. - Render targets to set as color buffers (MRT). - Render target to set as a depth buffer. - The mip level of the render target to render into. - The cubemap face of a cubemap render target to render into. - Slice of a 3D or array render target to set. - Load action that is used for color and depth/stencil buffers. - Store action that is used for color and depth/stencil buffers. - Load action that is used for the color buffer. - Store action that is used for the color buffer. - Load action that is used for the depth/stencil buffer. - Store action that is used for the depth/stencil buffer. - - - - - Add a "set active render target" command. - - Render target to set for both color & depth buffers. - Render target to set as a color buffer. - Render targets to set as color buffers (MRT). - Render target to set as a depth buffer. - The mip level of the render target to render into. - The cubemap face of a cubemap render target to render into. - Slice of a 3D or array render target to set. - Load action that is used for color and depth/stencil buffers. - Store action that is used for color and depth/stencil buffers. - Load action that is used for the color buffer. - Store action that is used for the color buffer. - Load action that is used for the depth/stencil buffer. - Store action that is used for the depth/stencil buffer. - - - - - Add a "set active render target" command. - - Render target to set for both color & depth buffers. - Render target to set as a color buffer. - Render targets to set as color buffers (MRT). - Render target to set as a depth buffer. - The mip level of the render target to render into. - The cubemap face of a cubemap render target to render into. - Slice of a 3D or array render target to set. - Load action that is used for color and depth/stencil buffers. - Store action that is used for color and depth/stencil buffers. - Load action that is used for the color buffer. - Store action that is used for the color buffer. - Load action that is used for the depth/stencil buffer. - Store action that is used for the depth/stencil buffer. - - - - - Add a "set active render target" command. - - Render target to set for both color & depth buffers. - Render target to set as a color buffer. - Render targets to set as color buffers (MRT). - Render target to set as a depth buffer. - The mip level of the render target to render into. - The cubemap face of a cubemap render target to render into. - Slice of a 3D or array render target to set. - Load action that is used for color and depth/stencil buffers. - Store action that is used for color and depth/stencil buffers. - Load action that is used for the color buffer. - Store action that is used for the color buffer. - Load action that is used for the depth/stencil buffer. - Store action that is used for the depth/stencil buffer. - - - - - Add a "set active render target" command. - - Render target to set for both color & depth buffers. - Render target to set as a color buffer. - Render targets to set as color buffers (MRT). - Render target to set as a depth buffer. - The mip level of the render target to render into. - The cubemap face of a cubemap render target to render into. - Slice of a 3D or array render target to set. - Load action that is used for color and depth/stencil buffers. - Store action that is used for color and depth/stencil buffers. - Load action that is used for the color buffer. - Store action that is used for the color buffer. - Load action that is used for the depth/stencil buffer. - Store action that is used for the depth/stencil buffer. - - - - - Add a "set active render target" command. - - Render target to set for both color & depth buffers. - Render target to set as a color buffer. - Render targets to set as color buffers (MRT). - Render target to set as a depth buffer. - The mip level of the render target to render into. - The cubemap face of a cubemap render target to render into. - Slice of a 3D or array render target to set. - Load action that is used for color and depth/stencil buffers. - Store action that is used for color and depth/stencil buffers. - Load action that is used for the color buffer. - Store action that is used for the color buffer. - Load action that is used for the depth/stencil buffer. - Store action that is used for the depth/stencil buffer. - - - - - Add a "set shadow sampling mode" command. - - Shadowmap render target to change the sampling mode on. - New sampling mode. - - - - Add a command to set single-pass stereo mode for the camera. - - Single-pass stereo mode for the camera. - - - - Add a command to set the view matrix. - - View (world to camera space) matrix. - - - - Add a command to set the rendering viewport. - - Viewport rectangle in pixel coordinates. - - - - Add a command to set the view and projection matrices. - - View (world to camera space) matrix. - Projection (camera to clip space) matrix. - - - - Adds an "AsyncGPUReadback.WaitAllRequests" command to the CommandBuffer. - - - - - Instructs the GPU to wait until the given GraphicsFence is passed. - - The GraphicsFence that the GPU will be instructed to wait upon before proceeding with its processing of the graphics queue. - On some platforms there is a significant gap between the vertex processing completing and the pixel processing beginning for a given draw call. This parameter allows for a requested wait to be made before the next item's vertex or pixel processing begins. If a compute shader dispatch is the next item to be submitted then this parameter is ignored. - - - - Instructs the GPU to wait until the given GraphicsFence is passed. - - The GraphicsFence that the GPU will be instructed to wait upon before proceeding with its processing of the graphics queue. - On some platforms there is a significant gap between the vertex processing completing and the pixel processing beginning for a given draw call. This parameter allows for a requested wait to be made before the next item's vertex or pixel processing begins. If a compute shader dispatch is the next item to be submitted then this parameter is ignored. - - - - This functionality is deprecated, and should no longer be used. Please use CommandBuffer.WaitOnAsyncGraphicsFence. - - The GPUFence that the GPU will be instructed to wait upon. - On some platforms there is a significant gap between the vertex processing completing and the pixel processing completing for a given draw call. This parameter allows for requested wait to be before the next items vertex or pixel processing begins. Some platforms can not differentiate between the start of vertex and pixel processing, these platforms will wait before the next items vertex processing. If a compute shader dispatch is the next item to be submitted then this parameter is ignored. - - - - Flags describing the intention for how the command buffer will be executed. Set these via CommandBuffer.SetExecutionFlags. - - - - - Command buffers flagged for async compute execution will throw exceptions if non-compatible commands are added to them. See ScriptableRenderContext.ExecuteCommandBufferAsync and Graphics.ExecuteCommandBufferAsync. - - - - - When no flags are specified, the command buffer is considered valid for all means of execution. This is the default for new command buffers. - - - - - Static class providing extension methods for CommandBuffer. - - - - - Adds a command to put a given render target into fast GPU memory. - - The render target to put into fast GPU memory. - The memory layout to use if only part of the render target is put into fast GPU memory, either because of the residency parameter or because of fast GPU memory availability. - The amount of the render target to put into fast GPU memory. Valid values are 0.0f - 1.0f inclusive. -A value of 0.0f is equal to none of the render target, and a value of 1.0f is equal to the whole render target. - - When this value is true, Unity copies the existing contents of the render target into fast memory. -When this value is false, Unity does not copy the existing contents of the render target into fast memory. -Set this value to true if you plan to add to the existing contents, and set it to false if you plan to overwrite or clear the existing contents. -Where possible, set this value to false for better performance. - - - - - - Adds a command to remove a given render target from fast GPU memory. - - The render target to remove from fast GPU memory. - When this value is true, Unity copies the existing contents of the render target when it removes it from fast GPU memory. When this value is false, Unity does not copy the existing contents of the render target when it removes it from fast GPU memory. Set this value to true if you plan to add to the existing contents, and set it to false if you plan to overwrite or clear the existing contents. Where possible, set this value to false for better performance. - - - - - Depth or stencil comparison function. - - - - - Always pass depth or stencil test. - - - - - Depth or stencil test is disabled. - - - - - Pass depth or stencil test when values are equal. - - - - - Pass depth or stencil test when new value is greater than old one. - - - - - Pass depth or stencil test when new value is greater or equal than old one. - - - - - Pass depth or stencil test when new value is less than old one. - - - - - Pass depth or stencil test when new value is less or equal than old one. - - - - - Never pass depth or stencil test. - - - - - Pass depth or stencil test when values are different. - - - - - Describes the desired characteristics with respect to prioritisation and load balancing of the queue that a command buffer being submitted via Graphics.ExecuteCommandBufferAsync or [[ScriptableRenderContext.ExecuteCommandBufferAsync] should be sent to. - - - - - Background queue types would be the choice for tasks intended to run for an extended period of time, e.g for most of a frame or for several frames. Dispatches on background queues would execute at a lower priority than gfx queue tasks. - - - - - This queue type would be the choice for compute tasks supporting or as optimisations to graphics processing. CommandBuffers sent to this queue would be expected to complete within the scope of a single frame and likely be synchronised with the graphics queue via GPUFences. Dispatches on default queue types would execute at a lower priority than graphics queue tasks. - - - - - This queue type would be the choice for compute tasks requiring processing as soon as possible and would be prioritised over the graphics queue. - - - - - Support for various Graphics.CopyTexture cases. - - - - - Basic Graphics.CopyTexture support. - - - - - Support for Texture3D in Graphics.CopyTexture. - - - - - Support for Graphics.CopyTexture between different texture types. - - - - - No support for Graphics.CopyTexture. - - - - - Support for RenderTexture to Texture copies in Graphics.CopyTexture. - - - - - Support for Texture to RenderTexture copies in Graphics.CopyTexture. - - - - - Flags used by ScriptableCullingParameters.cullingOptions to configure a culling operation. - - - - - When this flag is set, Unity does not perform per-object culling. - - - - - When this flag is set, Unity performs the culling operation even if the Camera is not active. - - - - - When this flag is set, Unity culls Lights as part of the culling operation. - - - - - When this flag is set, Unity culls Reflection Probes as part of the culling operation. - - - - - Unset all CullingOptions flags. - - - - - When this flag is set, Unity performs occlusion culling as part of the culling operation. - - - - - When this flag is set, Unity culls shadow casters as part of the culling operation. - - - - - When this flag is set, Unity culls both eyes together for stereo rendering. - - - - - Culling results (visible objects, lights, reflection probes). - - - - - Gets the number of per-object light and reflection probe indices. - - - The number of per-object light and reflection probe indices. - - - - - Gets the number of per-object light indices. - - - The number of per-object light indices. - - - - - Gets the number of per-object reflection probe indices. - - - The number of per-object reflection probe indices. - - - - - Array of visible lights. - - - - - Off screen lights that still effect visible Scene vertices. - - - - - Array of visible reflection probes. - - - - - Calculates the view and projection matrices and shadow split data for a directional light. - - The index into the active light array. - The cascade index. - The number of cascades. - The cascade ratios. - The resolution of the shadowmap. - The near plane offset for the light. - The computed view matrix. - The computed projection matrix. - The computed cascade data. - - If false, the shadow map for this cascade does not need to be rendered this frame. - - - - - Calculates the view and projection matrices and shadow split data for a point light. - - The index into the active light array. - The cubemap face to be rendered. - The amount by which to increase the camera FOV above 90 degrees. - The computed view matrix. - The computed projection matrix. - The computed split data. - - If false, the shadow map for this light and cubemap face does not need to be rendered this frame. - - - - - Calculates the view and projection matrices and shadow split data for a spot light. - - The index into the active light array. - The computed view matrix. - The computed projection matrix. - The computed split data. - - If false, the shadow map for this light does not need to be rendered this frame. - - - - - Fills a buffer with per-object light indices. - - The compute buffer object to fill. - The buffer object to fill. - - - - Fills a buffer with per-object light indices. - - The compute buffer object to fill. - The buffer object to fill. - - - - If a RenderPipeline sorts or otherwise modifies the VisibleLight list, an index remap will be necessary to properly make use of per-object light lists. - - - Array of indices that map from VisibleLight indices to internal per-object light list indices. - - - - - If a RenderPipeline sorts or otherwise modifies the VisibleReflectionProbe list, an index remap will be necessary to properly make use of per-object reflection probe lists. - - - Array of indices that map from VisibleReflectionProbe indices to internal per-object reflection probe list indices. - - - - - Returns the bounding box that encapsulates the visible shadow casters. Can be used to, for instance, dynamically adjust cascade ranges. - - The index of the shadow-casting light. - The bounds to be computed. - - True if the light affects at least one shadow casting object in the Scene. - - - - - If a RenderPipeline sorts or otherwise modifies the VisibleLight list, an index remap will be necessary to properly make use of per-object light lists. -If an element of the array is set to -1, the light corresponding to that element will be disabled. - - Array with light indices that map from VisibleLight to internal per-object light lists. - - - - If a RenderPipeline sorts or otherwise modifies the VisibleReflectionProbe list, an index remap will be necessary to properly make use of per-object reflection probe lists. -If an element of the array is set to -1, the reflection probe corresponding to that element will be disabled. - - Array with reflection probe indices that map from VisibleReflectionProbe to internal per-object reflection probe lists. - - - - Backface culling mode. - - - - - Cull back-facing geometry. - - - - - Cull front-facing geometry. - - - - - Disable culling. - - - - - Default reflection mode. - - - - - Custom default reflection. - - - - - Skybox-based default reflection. - - - - - Values for the depth state. - - - - - How should depth testing be performed. - - - - - Default values for the depth state. - - - - - Controls whether pixels from this object are written to the depth buffer. - - - - - Creates a new depth state with the given values. - - Controls whether pixels from this object are written to the depth buffer. - How should depth testing be performed. - - - - Type of sorting to use while rendering. - - - - - Sort objects based on distance along a custom axis. - - - - - Orthographic sorting mode. - - - - - Perspective sorting mode. - - - - - Settings for ScriptableRenderContext.DrawRenderers. - - - - - Controls whether dynamic batching is enabled. - - - - - Controls whether instancing is enabled. - - - - - Configures what light should be used as main light. - - - - - The maxiumum number of passes that can be rendered in 1 DrawRenderers call. - - - - - Sets the Material to use for all drawers that would render in this group. - - - - - Selects which pass of the override material to use. - - - - - What kind of per-object data to setup during rendering. - - - - - How to sort objects during rendering. - - - - - Create a draw settings struct. - - Shader pass to use. - Describes the methods to sort objects during rendering. - - - - Get the shader passes that this draw call can render. - - Index of the shader pass to use. - - - - Set the shader passes that this draw call can render. - - Index of the shader pass to use. - Name of the shader pass. - - - - Control Fast Memory render target layout. - - - - - Use the default fast memory layout. - - - - - Sections of the render target not placed in fast memory will be taken from the bottom of the image. - - - - - Sections of the render target not placed in fast memory will be taken from the top of the image. - - - - - Filter settings for ScriptableRenderContext.DrawRenderers. - - - - - Provides a set of default values that causes no filtering to occur. - - - - - Set to true to exclude objects that are currently in motion from rendering. The default value is false. - - - - - Only render objects in the given layer mask. - - - - - The rendering layer mask to use when filtering available renderers for drawing. - - - - - Render objects whose material render queue in inside this range. - - - - - Render objects whose sorting layer is inside this range. - - - - - Create a draw settings struct. - - Render objects whose material render queue in inside this range. - Only render objects in the given layer mask. - The rendering layer mask to use when filtering available renderers for drawing. - Objects that have a motion pass enabled, or have it disabled but have moved since the last frame are excluded when this is set to true. The default value is false. - - - - Graphics Format Swizzle. - - - - - The channel specified is not present for the format - - - - - The channel specified is not present for the format. - - - - - The channel specified contains alpha. - - - - - The channel specified contains blue. - - - - - The channel specified contains green. - - - - - The channel specified contains red. - - - - - Gizmo subsets. - - - - - Use to specify gizmos that should be rendered after ImageEffects. - - - - - Use to specify gizmos that should be rendered before ImageEffects. - - - - - This functionality is deprecated, and should no longer be used. Please use GraphicsFence. - - - - - This functionality is deprecated, and should no longer be used. Please use GraphicsFence.passed. - - - - - Graphics device API type. - - - - - Direct3D 11 graphics API. - - - - - Direct3D 12 graphics API. - - - - - Direct3D 9 graphics API. - - - - - Game Core Xbox One graphics API using Direct3D 12. - - - - - Game Core XboxSeries graphics API using Direct3D 12. - - - - - iOS Metal graphics API. - - - - - Nintendo 3DS graphics API. - - - - - No graphics API. - - - - - OpenGL 2.x graphics API. (deprecated, only available on Linux and MacOSX) - - - - - OpenGL (Core profile - GL3 or later) graphics API. - - - - - OpenGL ES 2.0 graphics API. (deprecated on iOS and tvOS) - - - - - OpenGL ES 3.0 graphics API. (deprecated on iOS and tvOS) - - - - - PlayStation 3 graphics API. - - - - - PlayStation 4 graphics API. - - - - - PlayStation Mobile (PSM) graphics API. - - - - - Nintendo Switch graphics API. - - - - - Vulkan (EXPERIMENTAL). - - - - - Xbox One graphics API using Direct3D 11. - - - - - Xbox One graphics API using Direct3D 12. - - - - - Used to manage synchronisation between tasks on async compute queues and the graphics queue. - - - - - Determines whether the GraphicsFence has passed. - -Allows the CPU to determine whether the GPU has passed the point in its processing represented by the GraphicsFence. - - - - - The type of the GraphicsFence. Currently the only supported fence type is AsyncQueueSynchronization. - - - - - The GraphicsFence can be used to synchronise between different GPU queues, as well as to synchronise between GPU and the CPU. - - - - - The GraphicsFence can only be used to synchronize between the GPU and the CPU. - - - - - Script interface for. - - - - - All RenderPipelineAssets that are configured - - - - - The current active RenderPipelineAsset taking into consideration the default and any active override. - - - - - Stores the default value for the RenderingLayerMask property of newly created Renderers. - - - - - The default RenderPipelineAsset that describes how the Scene should be rendered when no override is configured. - - - - - Disables the built-in update loop for Custom Render Textures, so that you can write your own update loop. - - - - - Whether to use a Light's color temperature when calculating the final color of that Light." - - - - - If this is true, Light intensity is multiplied against linear color values. If it is false, gamma color values are used. - - - - - If this is true, a log entry is made each time a shader is compiled at application runtime. - - - - - Is the current render pipeline capable of rendering direct lighting for rectangular area Lights? - - - - - The RenderPipelineAsset that describes how the Scene should be rendered. - - - - - An axis that describes the direction along which the distances of objects are measured for the purpose of sorting. - - - - - Transparent object sorting mode. - - - - - Enable/Disable SRP batcher (experimental) at runtime. - - - - - If and when to include video shaders in the build. - - - - - Get custom shader used instead of a built-in shader. - - Built-in shader type to query custom shader for. - - The shader used. - - - - - Provides a reference to the GraphicSettings object. - - - Returns the GraphicsSettings object. - - - - - Get built-in shader mode. - - Built-in shader type to query. - - Mode used for built-in shader. - - - - - Returns true if shader define was set when compiling shaders for current GraphicsTier. - - - - - - - Returns true if shader define was set when compiling shaders for given tier. - - - - - - Set custom shader to use instead of a built-in shader. - - Built-in shader type to set custom shader to. - The shader to use. - - - - Set built-in shader mode. - - Built-in shader type to change. - Mode to use for built-in shader. - - - - Graphics Tier. -See Also: Graphics.activeTier. - - - - - The first graphics tier (Low) - corresponds to shader define UNITY_HARDWARE_TIER1. - - - - - The second graphics tier (Medium) - corresponds to shader define UNITY_HARDWARE_TIER2. - - - - - The third graphics tier (High) - corresponds to shader define UNITY_HARDWARE_TIER3. - - - - - Format of the mesh index buffer data. - - - - - 16 bit mesh index buffer format. - - - - - 32 bit mesh index buffer format. - - - - - Defines a place in light's rendering to attach Rendering.CommandBuffer objects to. - - - - - After directional light screenspace shadow mask is computed. - - - - - After shadowmap is rendered. - - - - - After shadowmap pass is rendered. - - - - - Before directional light screenspace shadow mask is computed. - - - - - Before shadowmap is rendered. - - - - - Before shadowmap pass is rendered. - - - - - Light probe interpolation type. - - - - - Simple light probe interpolation is used. - - - - - The light probe shader uniform values are extracted from the material property block set on the renderer. - - - - - Light Probes are not used. The Scene's ambient probe is provided to the shader. - - - - - Uses a 3D grid of interpolated light probes. - - - - - Shadow resolution options for a Light. - - - - - Use resolution from QualitySettings (default). - - - - - High shadow map resolution. - - - - - Low shadow map resolution. - - - - - Medium shadow map resolution. - - - - - Very high shadow map resolution. - - - - - LODGroup culling parameters. - - - - - Rendering view height in pixels. - - - - - Camera position. - - - - - Camera's field of view. - - - - - Indicates whether camera is orthographic. - - - - - Orhographic camera size. - - - - - Mesh data update flags. - - - - - Indicates that Unity should perform the default checks and validation when you update a Mesh's data. - - - - - Indicates that Unity should not notify Renderer components about a possible Mesh bounds change, when you modify Mesh data. - - - - - Indicates that Unity should not recalculate the bounds when you set Mesh data using Mesh.SetSubMesh. - - - - - Indicates that Unity should not reset skinned mesh bone bounds when you modify Mesh data using Mesh.SetVertexBufferData or Mesh.SetIndexBufferData. - - - - - Indicates that Unity should not check index values when you use Mesh.SetIndexBufferData to modify a Mesh's data. - - - - - Use the OnDemandRendering class to control and query information about your application's rendering speed independent from all other subsystems (such as physics, input, or animation). - - - - - - The current estimated rate of rendering in frames per second rounded to the nearest integer. - - - - - Get or set the current frame rate interval. To restore rendering back to the value of Application.targetFrameRate or QualitySettings.vSyncCount set this to 0 or 1. - - - - - True if the current frame will be rendered. - - - - - Opaque object sorting mode of a Camera. - - - - - Default opaque sorting mode. - - - - - Do rough front-to-back sorting of opaque objects. - - - - - Do not sort opaque objects by distance. - - - - - Specifies the OpenGL ES version. - - - - - No valid OpenGL ES version - - - - - OpenGL ES 2.0 - - - - - OpenGL ES 3.0 - - - - - OpenGL ES 3.1 - - - - - OpenGL ES 3.1 with Android Extension Pack - - - - - OpenGL ES 3.2 - - - - - Shader pass type for Unity's lighting pipeline. - - - - - Deferred Shading shader pass. - - - - - Forward rendering additive pixel light pass. - - - - - Forward rendering base pass. - - - - - Legacy deferred lighting (light pre-pass) base pass. - - - - - Legacy deferred lighting (light pre-pass) final pass. - - - - - Shader pass used to generate the albedo and emissive values used as input to lightmapping. - - - - - Motion vector render pass. - - - - - Regular shader pass that does not interact with lighting. - - - - - Custom scriptable pipeline. - - - - - Custom scriptable pipeline when lightmode is set to default unlit or no light mode is set. - - - - - Shadow caster & depth texure shader pass. - - - - - Legacy vertex-lit shader pass. - - - - - Legacy vertex-lit shader pass, with mobile lightmaps. - - - - - Legacy vertex-lit shader pass, with desktop (RGBM) lightmaps. - - - - - What kind of per-object data to setup during rendering. - - - - - Setup per-object light data. - - - - - Setup per-object light indices. - - - - - Setup per-object lightmaps. - - - - - Setup per-object light probe SH data. - - - - - Setup per-object light probe proxy volume data. - - - - - Setup per-object motion vectors. - - - - - Do not setup any particular per-object data besides the transformation matrix. - - - - - Setup per-object occlusion probe data. - - - - - Setup per-object occlusion probe proxy volume data (occlusion in alpha channels). - - - - - Setup per-object reflection probe index offset and count. - - - - - Setup per-object reflection probe data. - - - - - Setup per-object shadowmask. - - - - - Provides an interface to control GPU frame capture in Microsoft's PIX software. - - - - - Begins a GPU frame capture in PIX. If not running via PIX, or as a development build, then it has no effect. - - - - - Ends the current GPU frame capture in PIX. If not running via PIX, or as a development build, then it has no effect. - - - - - Returns true if running via PIX and in a development build. - - - - - A collection of Rendering.ShaderKeyword that represents a specific platform variant. - - - - - Disable a specific shader keyword. - - - - - Enable a specific shader keyword. - - - - - Check whether a specific shader keyword is enabled. - - - - - - Values for the raster state. - - - - - Enables conservative rasterization. Before using check for support via SystemInfo.supportsConservativeRaster property. - - - - - Controls which sides of polygons should be culled (not drawn). - - - - - Default values for the raster state. - - - - - Enable clipping based on depth. - - - - - Scales the maximum Z slope. - - - - - Scales the minimum resolvable depth buffer value. - - - - - Creates a new raster state with the given values. - - Controls which sides of polygons should be culled (not drawn). - Scales the minimum resolvable depth buffer value. - Scales the maximum Z slope. - - - - - How much CPU usage to assign to the final lighting calculations at runtime. - - - - - 75% of the allowed CPU threads are used as worker threads. - - - - - 25% of the allowed CPU threads are used as worker threads. - - - - - 50% of the allowed CPU threads are used as worker threads. - - - - - 100% of the allowed CPU threads are used as worker threads. - - - - - Determines how Unity will compress baked reflection cubemap. - - - - - Baked Reflection cubemap will be compressed if compression format is suitable. - - - - - Baked Reflection cubemap will be compressed. - - - - - Baked Reflection cubemap will be left uncompressed. - - - - - ReflectionProbeBlendInfo contains information required for blending probes. - - - - - Reflection Probe used in blending. - - - - - Specifies the weight used in the interpolation between two probes, value varies from 0.0 to 1.0. - - - - - Values for ReflectionProbe.clearFlags, determining what to clear when rendering a ReflectionProbe. - - - - - Clear with the skybox. - - - - - Clear with a background color. - - - - - Reflection probe's update mode. - - - - - Reflection probe is baked in the Editor. - - - - - Reflection probe uses a custom texture specified by the user. - - - - - Reflection probe is updating in realtime. - - - - - An enum describing the way a realtime reflection probe refreshes in the Player. - - - - - Causes Unity to update the probe's cubemap every frame. -Note that updating a probe is very costly. Setting this option on too many probes could have a significant negative effect on frame rate. Use time-slicing to help improve performance. - -See Also: ReflectionProbeTimeSlicingMode. - - - - - Causes the probe to update only on the first frame it becomes visible. The probe will no longer update automatically, however you may subsequently use RenderProbe to refresh the probe - -See Also: ReflectionProbe.RenderProbe. - - - - - Sets the probe to never be automatically updated by Unity while your game is running. Use this to completely control the probe refresh behavior by script. - -See Also: ReflectionProbe.RenderProbe. - - - - - Visible reflection probes sorting options. - - - - - Sort probes by importance. - - - - - Sort probes by importance, then by size. - - - - - Do not sort reflection probes. - - - - - Sort probes from largest to smallest. - - - - - When a probe's ReflectionProbe.refreshMode is set to ReflectionProbeRefreshMode.EveryFrame, this enum specify whether or not Unity should update the probe's cubemap over several frames or update the whole cubemap in one frame. -Updating a probe's cubemap is a costly operation. Unity needs to render the entire Scene for each face of the cubemap, as well as perform special blurring in order to get glossy reflections. The impact on frame rate can be significant. Time-slicing helps maintaning a more constant frame rate during these updates by performing the rendering over several frames. - - - - - Instructs Unity to use time-slicing by first rendering all faces at once, then spreading the remaining work over the next 8 frames. Using this option, updating the probe will take 9 frames. - - - - - Instructs Unity to spread the rendering of each face over several frames. Using this option, updating the cubemap will take 14 frames. This option greatly reduces the impact on frame rate, however it may produce incorrect results, especially in Scenes where lighting conditions change over these 14 frames. - - - - - Unity will render the probe entirely in one frame. - - - - - Reflection Probe usage. - - - - - Reflection probes are enabled. Blending occurs only between probes, useful in indoor environments. The renderer will use default reflection if there are no reflection probes nearby, but no blending between default reflection and probe will occur. - - - - - Reflection probes are enabled. Blending occurs between probes or probes and default reflection, useful for outdoor environments. - - - - - Reflection probes are disabled, skybox will be used for reflection. - - - - - Reflection probes are enabled, but no blending will occur between probes when there are two overlapping volumes. - - - - - This enum describes what should be done on the render target when it is activated (loaded). - - - - - Upon activating the render buffer, clear its contents. Currently only works together with the RenderPass API. - - - - - When this RenderBuffer is activated, the GPU is instructed not to care about the existing contents of that RenderBuffer. On tile-based GPUs this means that the RenderBuffer contents do not need to be loaded into the tile memory, providing a performance boost. - - - - - When this RenderBuffer is activated, preserve the existing contents of it. This setting is expensive on tile-based GPUs and should be avoided whenever possible. - - - - - This enum describes what should be done on the render target when the GPU is done rendering into it. - - - - - The contents of the RenderBuffer are not needed and can be discarded. Tile-based GPUs will skip writing out the surface contents altogether, providing performance boost. - - - - - Resolve the (MSAA'd) surface. Currently only used with the RenderPass API. - - - - - The RenderBuffer contents need to be stored to RAM. If the surface has MSAA enabled, this stores the non-resolved surface. - - - - - Resolve the (MSAA'd) surface, but also store the multisampled version. Currently only used with the RenderPass API. - - - - - Options for the application's actual rendering threading mode. - - - - - Use the Direct enum to directly render your application from the main thread. - - - - - Generates intermediate graphics commands via several worker threads. A single render thread then converts them into low-level platform API graphics commands. - - - - - Generates intermediate graphics commands via the main thread. The render thread converts them into low-level platform API graphics commands. - - - - - Main thread generates intermediate graphics commands. Render thread converts them into low-level platform API graphics commands. Render thread can also dispatch graphics jobs to several worker threads. - - - - - Generates intermediate graphics commands via several worker threads and converts them into low-level platform API graphics commands. - - - - - Use SingleThreaded for internal debugging. It uses only a single thread to simulate RenderingThreadingMode.MultiThreaded. - - - - - Defines a series of commands and settings that describes how Unity renders a frame. - - - - - Returns true when the RenderPipeline is invalid or destroyed. - - - - - Calls the RenderPipelineManager.beginCameraRendering delegate. - - - - - - - Calls the RenderPipelineManager.beginFrameRendering delegate. - - - - - - - Calls the RenderPipelineManager.endCameraRendering delegate. - - - - - - - Calls the RenderPipelineManager.endFrameRendering delegate. - - - - - - - Executes RenderRequests submitted using Camera.SubmitRenderRequests. - - The list of RenderRequests to execute. - - - - - - Entry point method that defines custom rendering for this RenderPipeline. - - - - - - - An asset that produces a specific IRenderPipeline. - - - - - Retrieves the default Autodesk Interactive masked Shader for this pipeline. - - - Returns the default shader. - - - - - Retrieves the default Autodesk Interactive Shader for this pipeline. - - - Returns the default shader. - - - - - Retrieves the default Autodesk Interactive transparent Shader for this pipeline. - - - Returns the default shader. - - - - - Return the default 2D Material for this pipeline. - - - Default material. - - - - - Return the default Line Material for this pipeline. - - - Default material. - - - - - Return the default Material for this pipeline. - - - Default material. - - - - - Return the default particle Material for this pipeline. - - - Default material. - - - - - Return the default Shader for this pipeline. - - - Default shader. - - - - - Return the default SpeedTree v7 Shader for this pipeline. - - - - - Return the default SpeedTree v8 Shader for this pipeline. - - - - - Return the default Terrain Material for this pipeline. - - - Default material. - - - - - Return the default UI ETC1 Material for this pipeline. - - - Default material. - - - - - Return the default UI Material for this pipeline. - - - Default material. - - - - - Return the default UI overdraw Material for this pipeline. - - - Default material. - - - - - Returns the list of names used to display Rendering Layer Mask UI for this pipeline. - - - Array of 32 Rendering Layer Mask names. - - - - - The render index for the terrain brush in the editor. - - - Queue index. - - - - - Return the detail grass billboard Shader for this pipeline. - - - - - Return the detail grass Shader for this pipeline. - - - - - Return the detail lit Shader for this pipeline. - - - - - Create a IRenderPipeline specific to this asset. - - - Created pipeline. - - - - - Default implementation of OnDisable for RenderPipelineAsset. See ScriptableObject.OnDisable - - - - - Default implementation of OnValidate for RenderPipelineAsset. See MonoBehaviour.OnValidate - - - - - Render Pipeline manager. - - - - - Delegate that you can use to invoke custom code before Unity renders an individual Camera. - - - - - - Delegate that you can use to invoke custom code at the start of RenderPipeline.Render. - - - - - - Returns the instance of the current RenderPipeline. - - - - - Delegate that you can use to invoke custom code after Unity renders an individual Camera. - - - - - - Delegate that you can use to invoke custom code at the end of RenderPipeline.Render. - - - - - - Determine in which order objects are renderered. - - - - - Alpha tested geometry uses this queue. - - - - - This render queue is rendered before any others. - - - - - Opaque geometry uses this queue. - - - - - Last render queue that is considered "opaque". - - - - - This render queue is meant for overlay effects. - - - - - This render queue is rendered after Geometry and AlphaTest, in back-to-front order. - - - - - Describes a material render queue range. - - - - - A range that includes all objects. - - - - - Inclusive lower bound for the range. - - - - - Maximum value that can be used as a bound. - - - - - Minimum value that can be used as a bound. - - - - - A range that includes only opaque objects. - - - - - A range that includes only transparent objects. - - - - - Inclusive upper bound for the range. - - - - - Create a render queue range struct. - - Inclusive lower bound for the range. - Inclusive upper bound for the range. - - - - A set of values used to override the render state. Note that it is not enough to set e.g. blendState, but that mask must also include RenderStateMask.Blend for the override to occur. - - - - - Specifies the new blend state. - - - - - Specifies the new depth state. - - - - - Specifies which parts of the render state that is overriden. - - - - - Specifies the new raster state. - - - - - The value to be compared against and/or the value to be written to the buffer based on the stencil state. - - - - - Specifies the new stencil state. - - - - - Creates a new render state block with the specified mask. - - Specifies which parts of the render state that is overriden. - - - - Specifies which parts of the render state that is overriden. - - - - - When set, the blend state is overridden. - - - - - When set, the depth state is overridden. - - - - - When set, all render states are overridden. - - - - - No render states are overridden. - - - - - When set, the raster state is overridden. - - - - - When set, the stencil state and reference value is overridden. - - - - - Describes a render target with one or more color buffers, a depthstencil buffer and the associated loadstore-actions that are applied when the render target is active. - - - - - Load actions for color buffers. - - - - - Color buffers to use as render targets. - - - - - Store actions for color buffers. - - - - - Load action for the depth/stencil buffer. - - - - - Depth/stencil buffer to use as render target. - - - - - Store action for the depth/stencil buffer. - - - - - Optional flags. - - - - - Constructs RenderTargetBinding. - - Color buffers to use as render targets. - Depth buffer to use as render target. - Load actions for color buffers. - Store actions for color buffers. - Load action for the depth/stencil buffer. - Store action for the depth/stencil buffer. - - - - - - - - - - Constructs RenderTargetBinding. - - Color buffers to use as render targets. - Depth buffer to use as render target. - Load actions for color buffers. - Store actions for color buffers. - Load action for the depth/stencil buffer. - Store action for the depth/stencil buffer. - - - - - - - - - - Constructs RenderTargetBinding. - - Color buffers to use as render targets. - Depth buffer to use as render target. - Load actions for color buffers. - Store actions for color buffers. - Load action for the depth/stencil buffer. - Store action for the depth/stencil buffer. - - - - - - - - - - Values for the blend state. - - - - - Operation used for blending the alpha (A) channel. - - - - - Operation used for blending the color (RGB) channel. - - - - - Default values for the blend state. - - - - - Blend factor used for the alpha (A) channel of the destination. - - - - - Blend factor used for the color (RGB) channel of the destination. - - - - - Blend factor used for the alpha (A) channel of the source. - - - - - Blend factor used for the color (RGB) channel of the source. - - - - - Specifies which color components will get written into the target framebuffer. - - - - - Creates a new blend state with the given values. - - Specifies which color components will get written into the target framebuffer. - Blend factor used for the color (RGB) channel of the source. - Blend factor used for the color (RGB) channel of the destination. - Blend factor used for the alpha (A) channel of the source. - Blend factor used for the alpha (A) channel of the destination. - Operation used for blending the color (RGB) channel. - Operation used for blending the alpha (A) channel. - - - - This enum describes optional flags for the RenderTargetBinding structure. - - - - - No flag option (0). - - - - - The depth buffer bound for rendering may also bound as a samplable texture to the graphics pipeline: some platforms require the depth buffer to be set to read-only mode in such cases (D3D11, Vulkan). This flag can be used for both packed depth-stencil as well as separate depth-stencil formats. - - - - - Both depth and stencil buffers bound for rendering may be bound as samplable textures to the graphics pipeline: some platforms require the depth and stencil buffers to be set to read-only mode in such cases (D3D11, Vulkan). This flag can be used for both packed depth-stencil as well as separate depth-stencil formats. - This flag is a bitwise combination of RenderTargetFlags.ReadOnlyDepth and RenderTargetFlags.ReadOnlyStencil. - - - - - The stencil buffer bound for rendering may also bound as a samplable texture to the graphics pipeline: some platforms require the stencil buffer to be set to read-only mode in such cases (D3D11, Vulkan). This flag can be used for both packed depth-stencil as well as separate depth-stencil formats. - - - - - Identifies a RenderTexture for a Rendering.CommandBuffer. - - - - - All depth-slices of the render resource are bound for rendering. For textures which are neither array nor 3D, the default slice is bound. - - - - - Creates a render target identifier. - - Built-in temporary render texture type. - Temporary render texture name. - Temporary render texture name (as integer, see Shader.PropertyToID). - RenderTexture or Texture object to use. - MipLevel of the RenderTexture to use. - Cubemap face of the Cubemap RenderTexture to use. - Depth slice of the Array RenderTexture to use. The symbolic constant RenderTargetIdentifier.AllDepthSlices indicates that all slices should be bound for rendering. The default value is 0. - An existing render target identifier. - - - - - Creates a render target identifier. - - Built-in temporary render texture type. - Temporary render texture name. - Temporary render texture name (as integer, see Shader.PropertyToID). - RenderTexture or Texture object to use. - MipLevel of the RenderTexture to use. - Cubemap face of the Cubemap RenderTexture to use. - Depth slice of the Array RenderTexture to use. The symbolic constant RenderTargetIdentifier.AllDepthSlices indicates that all slices should be bound for rendering. The default value is 0. - An existing render target identifier. - - - - - Creates a render target identifier. - - Built-in temporary render texture type. - Temporary render texture name. - Temporary render texture name (as integer, see Shader.PropertyToID). - RenderTexture or Texture object to use. - MipLevel of the RenderTexture to use. - Cubemap face of the Cubemap RenderTexture to use. - Depth slice of the Array RenderTexture to use. The symbolic constant RenderTargetIdentifier.AllDepthSlices indicates that all slices should be bound for rendering. The default value is 0. - An existing render target identifier. - - - - - Creates a render target identifier. - - Built-in temporary render texture type. - Temporary render texture name. - Temporary render texture name (as integer, see Shader.PropertyToID). - RenderTexture or Texture object to use. - MipLevel of the RenderTexture to use. - Cubemap face of the Cubemap RenderTexture to use. - Depth slice of the Array RenderTexture to use. The symbolic constant RenderTargetIdentifier.AllDepthSlices indicates that all slices should be bound for rendering. The default value is 0. - An existing render target identifier. - - - - - Creates a render target identifier. - - Built-in temporary render texture type. - Temporary render texture name. - Temporary render texture name (as integer, see Shader.PropertyToID). - RenderTexture or Texture object to use. - MipLevel of the RenderTexture to use. - Cubemap face of the Cubemap RenderTexture to use. - Depth slice of the Array RenderTexture to use. The symbolic constant RenderTargetIdentifier.AllDepthSlices indicates that all slices should be bound for rendering. The default value is 0. - An existing render target identifier. - - - - - Types of data that you can encapsulate within a render texture. - - - - - Color element of a RenderTexture. - - - - - The Default element of a RenderTexture. - - - - - The depth element of a RenderTexture. - - - - - The stencil element of a RenderTexture. - - - - - Represents an active render pass until disposed. - - - - - Ends the current render pass in the ScriptableRenderContext that was used to create the ScopedRenderPass. - - - - - Represents an active sub pass until disposed. - - - - - Ends the current sub pass in the ScriptableRenderContext that was used to create the ScopedSubPass. - - - - - Parameters that configure a culling operation in the Scriptable Render Pipeline. - - - - - This parameter determines query distance for occlusion culling. - - - - - Camera Properties used for culling. - - - - - The lower limit to the value ScriptableCullingParameters.maximumPortalCullingJobs. - - - - - The upper limit to the value ScriptableCullingParameters.maximumPortalCullingJobs. - - - - - The mask for the culling operation. - - - - - The matrix for the culling operation. - - - - - Flags to configure a culling operation in the Scriptable Render Pipeline. - - - - - Number of culling planes to use. - - - - - Is the cull orthographic. - - - - - The amount of layers available. - - - - - LODParameters for culling. - - - - - Maximum amount of culling planes that can be specified. - - - - - This parameter controls how many active jobs contribute to occlusion culling. - - - - - This parameter controls how many visible lights are allowed. - - - - - Position for the origin of the cull. - - - - - Reflection Probe Sort options for the cull. - - - - - Shadow distance to use for the cull. - - - - - The projection matrix generated for single-pass stereo culling. - - - - - Distance between the virtual eyes. - - - - - The view matrix generated for single-pass stereo culling. - - - - - Fetch the culling plane at the given index. - - - - - - Get the distance for the culling of a specific layer. - - - - - - Set the culling plane at a given index. - - - - - - - Set the distance for the culling of a specific layer. - - - - - - - Defines state and drawing commands that custom render pipelines use. - - - - - Schedules the beginning of a new render pass. Only one render pass can be active at any time. - - The width of the render pass surfaces in pixels. - The height of the render pass surfaces in pixels. - MSAA sample count; set to 1 to disable antialiasing. - Array of color attachments to use within this render pass. The values in the array are copied immediately. - The index of the attachment to be used as the depthstencil buffer for this render pass, or -1 to disable depthstencil. - - - - Schedules the beginning of a new render pass. If you call this a using-statement, Unity calls EndRenderPass automatically when exiting the using-block. Only one render pass can be active at any time. - - The width of the render pass surfaces in pixels. - The height of the render pass surfaces in pixels. - MSAA sample count; set to 1 to disable antialiasing. - Array of color attachments to use within this render pass. The values in the array are copied immediately. - The index of the attachment to be used as the depthstencil buffer for this render pass, or -1 to disable depthstencil. - - - - Schedules the beginning of a new sub pass within a render pass. If you call this in a using-statement, Unity executes EndSubPass automatically when exiting the using-block. -Render passes can never be standalone, they must always contain at least one sub pass. Only one sub pass can be active at any time. - - Array of attachments to be used as the color render targets in this sub pass. These are specificed as indices into the array passed to BeginRenderPass. The values in the array are copied immediately. - Array of attachments to be used as input attachments in this sub pass. These are specificed as indices into the array passed to BeginRenderPass. The values in the array are copied immediately. - If true, both depth and stencil attachments are read-only in this sub pass. Some renderers require this in order to be able to use the depth and stencil attachments as inputs. - If true, the depth attachment is read-only in this sub pass. Some renderers require this in order to be able to use the depth attachment as input. - If true, the stencil attachment is read-only in this sub pass. Some renderers require this in order to be able to use the stencil attachment as input. - - - - Schedules the beginning of a new sub pass within a render pass. If you call this in a using-statement, Unity executes EndSubPass automatically when exiting the using-block. -Render passes can never be standalone, they must always contain at least one sub pass. Only one sub pass can be active at any time. - - Array of attachments to be used as the color render targets in this sub pass. These are specificed as indices into the array passed to BeginRenderPass. The values in the array are copied immediately. - Array of attachments to be used as input attachments in this sub pass. These are specificed as indices into the array passed to BeginRenderPass. The values in the array are copied immediately. - If true, both depth and stencil attachments are read-only in this sub pass. Some renderers require this in order to be able to use the depth and stencil attachments as inputs. - If true, the depth attachment is read-only in this sub pass. Some renderers require this in order to be able to use the depth attachment as input. - If true, the stencil attachment is read-only in this sub pass. Some renderers require this in order to be able to use the stencil attachment as input. - - - - Schedules the beginning of a new sub pass within a render pass. If you call this in a using-statement, Unity executes EndSubPass automatically when exiting the using-block. -Render passes can never be standalone, they must always contain at least one sub pass. Only one sub pass can be active at any time. - - Array of attachments to be used as the color render targets in this sub pass. These are specificed as indices into the array passed to BeginRenderPass. The values in the array are copied immediately. - Array of attachments to be used as input attachments in this sub pass. These are specificed as indices into the array passed to BeginRenderPass. The values in the array are copied immediately. - If true, both depth and stencil attachments are read-only in this sub pass. Some renderers require this in order to be able to use the depth and stencil attachments as inputs. - If true, the depth attachment is read-only in this sub pass. Some renderers require this in order to be able to use the depth attachment as input. - If true, the stencil attachment is read-only in this sub pass. Some renderers require this in order to be able to use the stencil attachment as input. - - - - Schedules the beginning of a new sub pass within a render pass. If you call this in a using-statement, Unity executes EndSubPass automatically when exiting the using-block. -Render passes can never be standalone, they must always contain at least one sub pass. Only one sub pass can be active at any time. - - Array of attachments to be used as the color render targets in this sub pass. These are specificed as indices into the array passed to BeginRenderPass. The values in the array are copied immediately. - Array of attachments to be used as input attachments in this sub pass. These are specificed as indices into the array passed to BeginRenderPass. The values in the array are copied immediately. - If true, both depth and stencil attachments are read-only in this sub pass. Some renderers require this in order to be able to use the depth and stencil attachments as inputs. - If true, the depth attachment is read-only in this sub pass. Some renderers require this in order to be able to use the depth attachment as input. - If true, the stencil attachment is read-only in this sub pass. Some renderers require this in order to be able to use the stencil attachment as input. - - - - Schedules the beginning of a new sub pass within a render pass. Render passes can never be standalone, they must always contain at least one sub pass. Only one sub pass can be active at any time. - - Array of attachments to be used as the color render targets in this sub pass. These are specificed as indices into the array passed to BeginRenderPass. - Array of attachments to be used as input attachments in this sub pass. These are specificed as indices into the array passed to BeginRenderPass. - If true, both depth and stencil attachments are read-only in this sub pass. Some renderers require this in order to be able to use the depth and stencil attachments as inputs. - If true, the depth attachment is read-only in this sub pass. Some renderers require this in order to be able to use the depth attachment as input. - If true, the stencil attachment is read-only in this sub pass. Some renderers require this in order to be able to use the stencil attachment as input. - - - - Schedules the beginning of a new sub pass within a render pass. Render passes can never be standalone, they must always contain at least one sub pass. Only one sub pass can be active at any time. - - Array of attachments to be used as the color render targets in this sub pass. These are specificed as indices into the array passed to BeginRenderPass. - Array of attachments to be used as input attachments in this sub pass. These are specificed as indices into the array passed to BeginRenderPass. - If true, both depth and stencil attachments are read-only in this sub pass. Some renderers require this in order to be able to use the depth and stencil attachments as inputs. - If true, the depth attachment is read-only in this sub pass. Some renderers require this in order to be able to use the depth attachment as input. - If true, the stencil attachment is read-only in this sub pass. Some renderers require this in order to be able to use the stencil attachment as input. - - - - Schedules the beginning of a new sub pass within a render pass. Render passes can never be standalone, they must always contain at least one sub pass. Only one sub pass can be active at any time. - - Array of attachments to be used as the color render targets in this sub pass. These are specificed as indices into the array passed to BeginRenderPass. - Array of attachments to be used as input attachments in this sub pass. These are specificed as indices into the array passed to BeginRenderPass. - If true, both depth and stencil attachments are read-only in this sub pass. Some renderers require this in order to be able to use the depth and stencil attachments as inputs. - If true, the depth attachment is read-only in this sub pass. Some renderers require this in order to be able to use the depth attachment as input. - If true, the stencil attachment is read-only in this sub pass. Some renderers require this in order to be able to use the stencil attachment as input. - - - - Schedules the beginning of a new sub pass within a render pass. Render passes can never be standalone, they must always contain at least one sub pass. Only one sub pass can be active at any time. - - Array of attachments to be used as the color render targets in this sub pass. These are specificed as indices into the array passed to BeginRenderPass. - Array of attachments to be used as input attachments in this sub pass. These are specificed as indices into the array passed to BeginRenderPass. - If true, both depth and stencil attachments are read-only in this sub pass. Some renderers require this in order to be able to use the depth and stencil attachments as inputs. - If true, the depth attachment is read-only in this sub pass. Some renderers require this in order to be able to use the depth attachment as input. - If true, the stencil attachment is read-only in this sub pass. Some renderers require this in order to be able to use the stencil attachment as input. - - - - Performs culling based on the ScriptableCullingParameters typically obtained from the Camera currently being rendered. - - Parameters for culling. - - Culling results. - - - - - Schedules the drawing of a subset of Gizmos (before or after post-processing) for the given Camera. - - The camera of the current view. - Set to GizmoSubset.PreImageEffects to draw Gizmos that should be affected by postprocessing, or GizmoSubset.PostImageEffects to draw Gizmos that should not be affected by postprocessing. See also: GizmoSubset. - - - - Schedules the drawing of a subset of visible GameObjects. - - Specifies which set of visible objects to draw, typically obtained from Cull. - Specifies how to draw GameObjects. - Specifies how the render pipeline should further filter the Renderers in the Scene. - Specifies parts of the render state to override. - Specifies the name of the Pass Tag or SubShader Tag that identifies renderers whose render state will be overridden. When this is not specified, the default value is "RenderType". - If set to true, tagName specifies a Pass Tag. If set to false, tagName specifies a SubShader Tag. When this is not specified, the default value is false. - Specifies the values of the Pass Tag or SubShader Tag that identifies renderers whose render state will be overridden. - Specifies render types whose render states are overridden. - Specifies parts of the render state to override for specific render types. - - - - Schedules the drawing of a subset of visible GameObjects. - - Specifies which set of visible objects to draw, typically obtained from Cull. - Specifies how to draw GameObjects. - Specifies how the render pipeline should further filter the Renderers in the Scene. - Specifies parts of the render state to override. - Specifies the name of the Pass Tag or SubShader Tag that identifies renderers whose render state will be overridden. When this is not specified, the default value is "RenderType". - If set to true, tagName specifies a Pass Tag. If set to false, tagName specifies a SubShader Tag. When this is not specified, the default value is false. - Specifies the values of the Pass Tag or SubShader Tag that identifies renderers whose render state will be overridden. - Specifies render types whose render states are overridden. - Specifies parts of the render state to override for specific render types. - - - - Schedules the drawing of a subset of visible GameObjects. - - Specifies which set of visible objects to draw, typically obtained from Cull. - Specifies how to draw GameObjects. - Specifies how the render pipeline should further filter the Renderers in the Scene. - Specifies parts of the render state to override. - Specifies the name of the Pass Tag or SubShader Tag that identifies renderers whose render state will be overridden. When this is not specified, the default value is "RenderType". - If set to true, tagName specifies a Pass Tag. If set to false, tagName specifies a SubShader Tag. When this is not specified, the default value is false. - Specifies the values of the Pass Tag or SubShader Tag that identifies renderers whose render state will be overridden. - Specifies render types whose render states are overridden. - Specifies parts of the render state to override for specific render types. - - - - Schedules the drawing of a subset of visible GameObjects. - - Specifies which set of visible objects to draw, typically obtained from Cull. - Specifies how to draw GameObjects. - Specifies how the render pipeline should further filter the Renderers in the Scene. - Specifies parts of the render state to override. - Specifies the name of the Pass Tag or SubShader Tag that identifies renderers whose render state will be overridden. When this is not specified, the default value is "RenderType". - If set to true, tagName specifies a Pass Tag. If set to false, tagName specifies a SubShader Tag. When this is not specified, the default value is false. - Specifies the values of the Pass Tag or SubShader Tag that identifies renderers whose render state will be overridden. - Specifies render types whose render states are overridden. - Specifies parts of the render state to override for specific render types. - - - - Schedules the drawing of shadow casters for a single Light. - - Specifies which set of shadow casters to draw, and how to draw them. - - - - Schedules the drawing of the skybox. - - Camera to draw the skybox for. - - - - Draw the UI overlay. - - The camera of the current view. - - - - Schedules the drawing of a wireframe overlay for a given Scene view Camera. - - The Scene view Camera to draw the overlay for. - - - - Emits UI geometry for rendering for the specified camera. - - Camera to emit the geometry for. - - - - Emits UI geometry into the Scene view for rendering. - - Camera to emit the geometry for. - - - - Schedules the end of a currently active render pass. - - - - - Schedules the end of the currently active sub pass. - - - - - Schedules the execution of a custom graphics Command Buffer. - - Specifies the Command Buffer to execute. - - - - Schedules the execution of a Command Buffer on an async compute queue. The ComputeQueueType that you pass in determines the queue order. - - The CommandBuffer to be executed. - Describes the desired async compute queue the supplied CommandBuffer should be executed on. - - - - Schedules an invocation of the OnRenderObject callback for MonoBehaviour scripts. - - - - - Schedules the setup of Camera specific global Shader variables. - - Camera to setup shader variables for. - Set up the stereo shader variables and state. - The current eye to be rendered. - - - - Schedules the setup of Camera specific global Shader variables. - - Camera to setup shader variables for. - Set up the stereo shader variables and state. - The current eye to be rendered. - - - - Schedules a fine-grained beginning of stereo rendering on the ScriptableRenderContext. - - Camera to enable stereo rendering on. - The current eye to be rendered. - - - - Schedules a fine-grained beginning of stereo rendering on the ScriptableRenderContext. - - Camera to enable stereo rendering on. - The current eye to be rendered. - - - - Schedule notification of completion of stereo rendering on a single frame. - - Camera to indicate completion of stereo rendering. - The current eye to be rendered. - - - - - Schedule notification of completion of stereo rendering on a single frame. - - Camera to indicate completion of stereo rendering. - The current eye to be rendered. - - - - - Schedule notification of completion of stereo rendering on a single frame. - - Camera to indicate completion of stereo rendering. - The current eye to be rendered. - - - - - Schedules a stop of stereo rendering on the ScriptableRenderContext. - - Camera to disable stereo rendering on. - - - - Submits all the scheduled commands to the rendering loop for execution. - - - - - Identifier of a specific code path in a shader. - - - - - The index of the shader keyword. - - - - - Initializes a new instance of the ShaderKeyword class from a shader global keyword name. - - The name of the keyword. - - - - Initializes a new instance of the ShaderKeyword class from a global or local shader keyword name. - - The shader that declares the keyword. - The name of the keyword. - - - - Initializes a new instance of the ShaderKeyword class from a local shader keyword name, and the compute shader that defines that local keyword. - - The compute shader that declares the local keyword. - The name of the keyword. - - - - Returns the string name of the global keyword. - - - - - - Returns the type of global keyword: built-in or user defined. - - - - - - Returns the string name of the keyword. - - - - - - - Returns the string name of the keyword. - - - - - - - Returns the string name of the keyword. - - - - - - - Returns the type of keyword: built-in or user defined. - - - - - - - Returns the type of keyword: built-in or user defined. - - - - - - - Returns the type of keyword: built-in or user defined. - - - - - - - Returns true if the keyword is local. - - - - - - Returns true if the keyword has been imported by Unity. - - - - - A collection of Rendering.ShaderKeyword that represents a specific shader variant. - - - - - Disable a specific shader keyword. - - - - - - Enable a specific shader keyword. - - - - - - Return an array with all the enabled keywords in the ShaderKeywordSet. - - - - - Check whether a specific shader keyword is enabled. - - - - - - Type of a shader keyword, eg: built-in or user defined. - - - - - The keyword is built-in the runtime and can be automatically stripped if unusued. - - - - - The keyword is built-in the runtime and it is systematically reserved. - - - - - The keyword is built-in the runtime and it is optionally reserved depending on the features used. - - - - - No type is assigned. - - - - - The keyword is defined by the user. - - - - - Flags that control how a shader property behaves. - - - - - Signifies that values of this property are in gamma space. If the active color space is linear, Unity converts the values to linear space values. - - - - - Signifies that values of this property contain High Dynamic Range (HDR) data. - - - - - Signifies that Unity hides the property in the default Material Inspector. - - - - - Signifies that value of this property contains the main color of the Material. - - - - - Signifies that value of this property contains the main texture of the Material. - - - - - No flags are set. - - - - - You cannot edit this Texture property in the default Material Inspector. - - - - - Signifies that values of this property contain Normal (normalized vector) data. - - - - - Do not show UV scale/offset fields next to Textures in the default Material Inspector. - - - - - In the Material Inspector, Unity queries the value for this property from the Renderer's MaterialPropertyBlock, instead of from the Material. The value will also appear as read-only. - - - - - Type of a given shader property. - - - - - The property holds a Vector4 value representing a color. - - - - - The property holds a floating number value. - - - - - The property holds a floating number value in a certain range. - - - - - The property holds a Texture object. - - - - - The property holds a Vector4 value. - - - - - Shader tag ids are used to refer to various names in shaders. - - - - - Gets the name of the tag referred to by the shader tag id. - - - - - Describes a shader tag id not referring to any name. - - - - - Gets or creates a shader tag id representing the given name. - - The name to represent with the shader tag id. - - - - Converts a string to a ShaderTagId. - - - - - - Converts a ShaderTagId to a string. - - - - - - How shadows are cast from this object. - - - - - No shadows are cast from this object. - - - - - Shadows are cast from this object. - - - - - Object casts shadows, but is otherwise invisible in the Scene. - - - - - Shadows are cast from this object, treating it as two-sided. - - - - - Settings for ScriptableRenderContext.DrawShadows. - - - - - Culling results to use. - - - - - The index of the shadow-casting light to be rendered. - - - - - The split data. - - - - - Set this to true to make Unity filter Renderers during shadow rendering. Unity filters Renderers based on the Rendering Layer Mask of the Renderer itself, and the Rendering Layer Mask of each shadow casting Light. - - - - - Create a shadow settings object. - - The cull results for this light. - The light index. - - - - - Allows precise control over which shadow map passes to execute Rendering.CommandBuffer objects attached using Light.AddCommandBuffer. - - - - - All shadow map passes. - - - - - All directional shadow map passes. - - - - - First directional shadow map cascade. - - - - - Second directional shadow map cascade. - - - - - Third directional shadow map cascade. - - - - - Fourth directional shadow map cascade. - - - - - All point light shadow passes. - - - - - -X point light shadow cubemap face. - - - - - -Y point light shadow cubemap face. - - - - - -Z point light shadow cubemap face. - - - - - +X point light shadow cubemap face. - - - - - +Y point light shadow cubemap face. - - - - - +Z point light shadow cubemap face. - - - - - Spotlight shadow pass. - - - - - Used by CommandBuffer.SetShadowSamplingMode. - - - - - Default shadow sampling mode: sampling with a comparison filter. - - - - - In ShadowSamplingMode.None, depths are not compared. Use this value if a Texture is not a shadowmap. - - - - - Shadow sampling mode for sampling the depth value. - - - - - Describes the culling information for a given shadow split (e.g. directional cascade). - - - - - The number of culling planes. - - - - - The culling sphere. The first three components of the vector describe the sphere center, and the last component specifies the radius. - - - - - The maximum number of culling planes. - - - - - - A multiplier applied to the radius of the culling sphere. - -Values must be in the range 0 to 1. With higher values, Unity culls more objects. Lower makes the cascades share more rendered objects. Using lower values allows blending between different cascades as they then share objects. - - - - - - Gets a culling plane. - - The culling plane index. - - The culling plane. - - - - - Sets a culling plane. - - The index of the culling plane to set. - The culling plane. - - - - Enum type defines the different stereo rendering modes available. - - - - - Render stereo using GPU instancing. - - - - - Render stereo using OpenGL multiview. - - - - - Render stereo using multiple passes. - - - - - Render stereo to the left and right halves of a single, double-width render target. - - - - - How to sort objects during rendering. - - - - - Sort objects back to front. - - - - - Sort renderers taking canvas order into account. - - - - - Typical sorting for opaque objects. - - - - - Typical sorting for transparencies. - - - - - Do not sort objects. - - - - - Sort objects to reduce draw state changes. - - - - - Sort objects in rough front-to-back buckets. - - - - - Sorts objects by renderer priority. - - - - - Sort by material render queue. - - - - - Sort by renderer sorting layer. - - - - - Adding a SortingGroup component to a GameObject will ensure that all Renderers within the GameObject's descendants will be sorted and rendered together. - - - - - Unique ID of the Renderer's sorting layer. - - - - - Name of the Renderer's sorting layer. - - - - - Renderer's order within a sorting layer. - - - - - Updates all Sorting Group immediately. - - - - - Describes a renderer's sorting layer range. - - - - - A range that includes all objects. - - - - - Inclusive lower bound for the range. - - - - - Inclusive upper bound for the range. - - - - - Sets the inclusive range for a sorting layer object. - - Lowest sorting layer value to include. - Highest sorting layer value to include. - - - - This struct describes the methods to sort objects during rendering. - - - - - Used to calculate the distance to objects. - - - - - What kind of sorting to do while rendering. - - - - - Used to calculate distance to objects, by comparing the positions of objects to this axis. - - - - - Type of sorting to use while rendering. - - - - - Used to calculate the distance to objects. - - - - - Create a sorting settings struct. - - The camera's transparency sort mode is used to determine whether to use orthographic or distance based sorting. - - - - Spherical harmonics up to the second order (3 bands, 9 coefficients). - - - - - Add ambient lighting to probe data. - - - - - - Add directional light to probe data. - - - - - - - - Clears SH probe to zero. - - - - - Evaluates the Spherical Harmonics for each of the given directions. The result from the first direction is written into the first element of results, the result from the second direction is written into the second element of results, and so on. The array size of directions and results must match and directions must be normalized. - - Normalized directions for which the spherical harmonics are to be evaluated. - Output array for the evaluated values of the corresponding directions. - - - - Returns true if SH probes are equal. - - - - - - - Scales SH by a given factor. - - - - - - - Scales SH by a given factor. - - - - - - - Returns true if SH probes are different. - - - - - - - Adds two SH probes. - - - - - - - Access individual SH coefficients. - - - - - Provides an interface to the Unity splash screen. - - - - - Returns true once the splash screen has finished. This is once all logos have been shown for their specified duration. - - - - - Initializes the splash screen so it is ready to begin drawing. Call this before you start calling Rendering.SplashScreen.Draw. Internally this function resets the timer and prepares the logos for drawing. - - - - - Immediately draws the splash screen. Ensure you have called Rendering.SplashScreen.Begin before you start calling this. - - - - - Stop the SplashScreen rendering. - - - - - - The behavior to apply when calling ParticleSystem.Stop|Stop. - - - - - Jumps to the final stage of the Splash Screen and performs a fade from the background to the game. - - - - - Immediately stop rendering the SplashScreen. - - - - - Specifies the operation that's performed on the stencil buffer when rendering. - - - - - Decrements the current stencil buffer value. Clamps to 0. - - - - - Decrements the current stencil buffer value. Wraps stencil buffer value to the maximum representable unsigned value when decrementing a stencil buffer value of zero. - - - - - Increments the current stencil buffer value. Clamps to the maximum representable unsigned value. - - - - - Increments the current stencil buffer value. Wraps stencil buffer value to zero when incrementing the maximum representable unsigned value. - - - - - Bitwise inverts the current stencil buffer value. - - - - - Keeps the current stencil value. - - - - - Replace the stencil buffer value with reference value (specified in the shader). - - - - - Sets the stencil buffer value to zero. - - - - - Values for the stencil state. - - - - - The function used to compare the reference value to the current contents of the buffer for back-facing geometry. - - - - - The function used to compare the reference value to the current contents of the buffer for front-facing geometry. - - - - - Default values for the stencil state. - - - - - Controls whether the stencil buffer is enabled. - - - - - What to do with the contents of the buffer if the stencil test fails for back-facing geometry. - - - - - What to do with the contents of the buffer if the stencil test fails for front-facing geometry. - - - - - What to do with the contents of the buffer if the stencil test (and the depth test) passes for back-facing geometry. - - - - - What to do with the contents of the buffer if the stencil test (and the depth test) passes for front-facing geometry. - - - - - An 8 bit mask as an 0–255 integer, used when comparing the reference value with the contents of the buffer. - - - - - An 8 bit mask as an 0–255 integer, used when writing to the buffer. - - - - - What to do with the contents of the buffer if the stencil test passes, but the depth test fails for back-facing geometry. - - - - - What to do with the contents of the buffer if the stencil test passes, but the depth test fails for front-facing geometry. - - - - - Creates a new stencil state with the given values. - - An 8 bit mask as an 0–255 integer, used when comparing the reference value with the contents of the buffer. - An 8 bit mask as an 0–255 integer, used when writing to the buffer. - Controls whether the stencil buffer is enabled. - The function used to compare the reference value to the current contents of the buffer for front-facing geometry. - What to do with the contents of the buffer if the stencil test (and the depth test) passes for front-facing geometry. - What to do with the contents of the buffer if the stencil test fails for front-facing geometry. - What to do with the contents of the buffer if the stencil test passes, but the depth test fails for front-facing geometry. - The function used to compare the reference value to the current contents of the buffer for back-facing geometry. - What to do with the contents of the buffer if the stencil test (and the depth test) passes for back-facing geometry. - What to do with the contents of the buffer if the stencil test fails for back-facing geometry. - What to do with the contents of the buffer if the stencil test passes, but the depth test fails for back-facing geometry. - The function used to compare the reference value to the current contents of the buffer. - What to do with the contents of the buffer if the stencil test (and the depth test) passes. - What to do with the contents of the buffer if the stencil test fails. - What to do with the contents of the buffer if the stencil test passes, but the depth test. - - - - Creates a new stencil state with the given values. - - An 8 bit mask as an 0–255 integer, used when comparing the reference value with the contents of the buffer. - An 8 bit mask as an 0–255 integer, used when writing to the buffer. - Controls whether the stencil buffer is enabled. - The function used to compare the reference value to the current contents of the buffer for front-facing geometry. - What to do with the contents of the buffer if the stencil test (and the depth test) passes for front-facing geometry. - What to do with the contents of the buffer if the stencil test fails for front-facing geometry. - What to do with the contents of the buffer if the stencil test passes, but the depth test fails for front-facing geometry. - The function used to compare the reference value to the current contents of the buffer for back-facing geometry. - What to do with the contents of the buffer if the stencil test (and the depth test) passes for back-facing geometry. - What to do with the contents of the buffer if the stencil test fails for back-facing geometry. - What to do with the contents of the buffer if the stencil test passes, but the depth test fails for back-facing geometry. - The function used to compare the reference value to the current contents of the buffer. - What to do with the contents of the buffer if the stencil test (and the depth test) passes. - What to do with the contents of the buffer if the stencil test fails. - What to do with the contents of the buffer if the stencil test passes, but the depth test. - - - - The function used to compare the reference value to the current contents of the buffer. - - The value to set. - - - - What to do with the contents of the buffer if the stencil test fails. - - The value to set. - - - - What to do with the contents of the buffer if the stencil test (and the depth test) passes. - - The value to set. - - - - What to do with the contents of the buffer if the stencil test passes, but the depth test fails. - - The value to set. - - - - Contains information about a single sub-mesh of a Mesh. - - - - - Offset that is added to each value in the index buffer, to compute the final vertex index. - - - - - Bounding box of vertices in local space. - - - - - First vertex in the index buffer for this sub-mesh. - - - - - Index count for this sub-mesh face data. - - - - - Starting point inside the whole Mesh index buffer where the face index data is found. - - - - - Face topology of this sub-mesh. - - - - - Number of vertices used by the index buffer of this sub-mesh. - - - - - Create a submesh descriptor. - - Initial value for indexStart field. - Initial value for indexCount field. - Initial value for topology field. - - - - Describes the rendering features supported by a given render pipeline. - - - - - Get / Set a SupportedRenderingFeatures. - - - - - This is the fallback mode if the mode the user had previously selected is no longer available. See SupportedRenderingFeatures.mixedLightingModes. - - - - - Determines whether the Scriptable Render Pipeline will override the default Material’s Render Queue settings and, if true, hides the Render Queue property in the Inspector. - - - - - Determines whether Enlighten is supported. When not supported, Enlighten-specific settings do not appear in the Editor (for both Baked and Realtime GI), unless the Project was upgraded from 2019.2 or earlier. - - - - - What baking types are supported. The unsupported ones will be hidden from the UI. See LightmapBakeType. - - - - - Specifies what modes are supported. Has to be at least one. See LightmapsMode. - - - - - Are light probe proxy volumes supported? - - - - - Specifies what LightmapMixedBakeModes that are supported. Please define a SupportedRenderingFeatures.defaultMixedLightingModes in case multiple modes are supported. - - - - - Are motion vectors supported? - - - - - Determines if the renderer will override the Environment Lighting and will no longer need the built-in UI for it. - - - - - Determines if the renderer will override the fog settings in the Lighting Panel and will no longer need the built-in UI for it. - - - - - Describes where the Shadowmask settings are located if SupportedRenderingFeatures.overridesShadowmask is set to true. - - - - - Specifies whether the renderer overrides the LOD bias settings in the Quality Settings Panel. If It does, the renderer does not need the built-in UI for LOD bias settings. - - - - - Specifies whether the renderer overrides the maximum LOD level settings in the Quality Settings Panel. If It does, the renderer does not need the built-in UI for maximum LOD level settings. - - - - - Determines if the renderer will override halo and flare settings in the Lighting Panel and will no longer need the built-in UI for it. - - - - - Specifies whether the render pipeline overrides the Realtime Reflection Probes settings in the Quality settings. If It does, the render pipeline does not need the built-in UI for Realtime Reflection Probes settings. - - - - - Specifies whether the render pipeline overrides the Shadowmask settings in the Quality settings. - - - - - Determines if the renderer supports Particle System GPU instancing. - - - - - Can renderers support receiving shadows? - - - - - Flags for supported reflection probes. - - - - - Are reflection probes supported? - - - - - Determines if the renderer supports renderer priority sorting. - - - - - Determines whether the Renderer supports probe lighting. - - - - - Determines whether the function to render UI overlays is called by SRP and not by the engine. - - - - - A message that tells the user where the Shadowmask settings are located. - - - - - Determines if the renderer supports terrain detail rendering. - - - - - Same as MixedLightingMode for baking, but is used to determine what is supported by the pipeline. - - - - - Same as MixedLightingMode.IndirectOnly but determines if it is supported by the pipeline. - - - - - No mode is supported. - - - - - Determines what is supported by the rendering pipeline. This enum is similar to MixedLightingMode. - - - - - Same as MixedLightingMode.Subtractive but determines if it is supported by the pipeline. - - - - - Supported modes for ReflectionProbes. - - - - - Default reflection probe support. - - - - - Rotated reflection probes are supported. - - - - - Broadly describes the stages of processing a draw call on the GPU. - - - - - The process of creating and shading the fragments. - - - - - All aspects of vertex processing. - - - - - Describes the various stages of GPU processing against which the GraphicsFence can be set and waited against. - - - - - All previous GPU operations (vertex, pixel and compute). - - - - - All compute shader dispatch operations. - - - - - All aspects of pixel processing in the GPU. - - - - - All aspects of vertex processing in the GPU. - - - - - Texture "dimension" (type). - - - - - Any texture type. - - - - - Cubemap texture. - - - - - Cubemap array texture (CubemapArray). - - - - - No texture is assigned. - - - - - 2D texture (Texture2D). - - - - - 2D array texture (Texture2DArray). - - - - - 3D volume texture (Texture3D). - - - - - Texture type is not initialized or unknown. - - - - - A flag representing each UV channel. - - - - - First UV channel. - - - - - Second UV channel. - - - - - Third UV channel. - - - - - Fourth UV channel. - - - - - Possible attribute types that describe a vertex in a Mesh. - - - - - Bone indices for skinned Meshes. - - - - - Bone blend weights for skinned Meshes. - - - - - Vertex color. - - - - - Vertex normal. - - - - - Vertex position. - - - - - Vertex tangent. - - - - - Primary texture coordinate (UV). - - - - - Additional texture coordinate. - - - - - Additional texture coordinate. - - - - - Additional texture coordinate. - - - - - Additional texture coordinate. - - - - - Additional texture coordinate. - - - - - Additional texture coordinate. - - - - - Additional texture coordinate. - - - - - Information about a single VertexAttribute of a Mesh vertex. - - - - - The vertex attribute. - - - - - Dimensionality of the vertex attribute. - - - - - Format of the vertex attribute. - - - - - Which vertex buffer stream the attribute should be in. - - - - - Create a VertexAttributeDescriptor structure. - - The VertexAttribute. - Format of the vertex attribute. Default is VertexAttributeFormat.Float32. - Dimensionality of the vertex attribute (1 to 4). Default is 3. - Vertex buffer stream that the attribute should be placed in. Default is 0. - - - - Data type of a VertexAttribute. - - - - - 16-bit float number. - - - - - 32-bit float number. - - - - - 16-bit signed integer. - - - - - 32-bit signed integer. - - - - - 8-bit signed integer. - - - - - 16-bit signed normalized number. - - - - - 8-bit signed normalized number. - - - - - 16-bit unsigned integer. - - - - - 32-bit unsigned integer. - - - - - 8-bit unsigned integer. - - - - - 16-bit unsigned normalized number. - - - - - 8-bit unsigned normalized number. - - - - - Video shaders mode used by Rendering.GraphicsSettings. - - - - - Include video shaders in builds (default). - - - - - Exclude video shaders from builds. This effectively disables video functionality. - - - - - Include video shaders in builds when referenced by scenes. - - - - - Filtering modes available in the virtual texturing system. - - - - - Bilinear filtering. - - - - - Trilinear filtering. - - - - - Settings for a virtual texturing GPU cache. - - - - - Format of the cache these settings are applied to. - - - - - Size in MegaBytes of the cache created with these settings. - - - - - Static class representing the Procedural Virtual Texturing system. - - - - - Procedural virtual texturing stack where request data resides in CPU memory. - - - - - Create a new CPUTextureStack object. - - Name of this stack. - The properties used to create this stack. - - - - Per-layer properties of a ProceduralTextureRequest. - - - - - Datasize (in bytes) of a single scanline of the tile's lower-resolution mip data for this layer, used for trilinear filtering. - - - - - Indicates that this request needs both the actual tile data as well as the corresponding data at the next lower-resolution mip. - - - - - Datasize (in bytes) of a single scanline of the tile data for this layer. - - - - - Get a reference to the tile layer data to write texture data to. - - - The array where tile layer data can be written to. - - - - - Get a reference to the tile layer mip date to write texture data to. - - - The array where mip data can be written to. - - - - - A single procedural virtual texture tile generation request, to be filled in CPU memory. - - - - - Height of the requested rectangle. - - - - - Miplevel of the requested rectangle. - - - - - Number of layers inside the request. - - - - - Width of the requested rectangle. - - - - - X offset of the requested rectangle. - - - - - Y offset of the requested rectangle. - - - - - Get the request properties of one of the requested layers. - - Layer index. - - Properties of the requested layer. - - - - - Struct that contains all parameters required to create a ProceduralTextureStack. - - - - - Filtering mode that will be used when sampling this PVT stack. - - - - - Height of the virtual UV space the stack has. - - - - - The layers this stack contains. - - - - - How many request do you plan on processing each frame. - - - - - Size of a single tile inside the stack. - - - - - Width of the virtual UV space the stack has. - - - - - Internal limit of maximum number of layers. - - - - - Internal limit on maximum number of requests per frame. - - - - - Gets the Procedural Virtual Texturing CPU cache size. - - - The size of the CPU caches. - - - - - Gets the Procedural Virtual Texturing GPU cache settings. - - - An array of GPU cache settings. - - - - - Procedural virtual texturing stack where request data resides in GPU memory. - - - - - Create a new GPUTextureStack object. - - Name of this stack. - The properties used to create this stack. - - - - Per-layer properties of a request. - - - - - RenderTarget where the tile should be generated on. - - - - - X offset inside the destination RenderTexture. - - - - - Y offset inside the destination RenderTexture. - - - - - Gets the height of the RenderTexture asociated with the request. - - - - - Gets the width of the RenderTexture asociated with the request. - - - - - A single procedural virtual texture tile generation request, to be filled in GPU memory. - - - - - Height of the requested rectangle. - - - - - Miplevel of the requested rectangle. - - - - - Number of layers inside the request. - - - - - Width of the requested rectangle. - - - - - X offset of the requested rectangle. - - - - - Y offset of the requested rectangle. - - - - - Get the request properties of one of the requested layers. - - Layer index. - - Properties of the requested layer. - - - - - The status that can be given to a request. - - - - - No data is provided and the VT system should fall back to a lower resolution. - - - - - Data is filled in properly and can be used by the VT system. - - - - - Sets the Procedural Virtual Texturing CPU cache size (in MegaBytes). - - - - - - Sets the Procedural Virtual Texturing GPU cache settings. - - - - - - Procedural virtual texturing stack. - - - - - Size of the border around each tile. - - - - - Specify all mipmaps starting from the 'mipMap' argument, for use with the Invalidate and MakeResident functions. - - - - - Try to bind the texture stack globally for all shaders. - - - - - Try to bind this texture stack to a Material so it can be used for sampling the VT. - - Material to bind this stack on. - - - - Try to bind this texture stack to a MaterialPropertyBlock so it can be used for sampling the VT. - - The property block to assign this procedural virtual texture stack too. - - - - Create a new ProceduralTextureStack. - - Name of this stack. - This properties used to create this stack. - Whether the data should be generated in GPU-memory or CPU-memory. - - - - Disposes this object. - - - - - Evict the data in the specified rectangle causing it to be procedurally re-generated. The data will become unavailable immediately causing lower resolution fallback textures to be used in the mean time. Use this method to immediately free up memory for other VT tiles when data will not be needed in the near future. - - The rectangle in 0-1 UV space to evict. Anything outside the [ 0...1 [ x [ 0...1 [ rectangle will be silently ignored. - The miplevel to evict. Mips are numbered from 0 (= full resolution) to n (= lowest resolution) where n is the mipmap level what is a single tile in size. Invalid mips are silently ignored. - The number of miplevels starting from 'mipMap' to evict. Invalid mips are silently ignored. - - - - Invalidate the data in the specified rectangle causing it to be procedurally re-generated. Any existing data will continue to be used while the new data is being re-generated. Use this method to cause re-generation of data in interactive applications like painting. - - The rectangle in 0-1 UV space to invalidate. Anything outside the [ 0...1 [ x [ 0...1 [ rectangle will be silently ignored. - The miplevel to invalidate. Mips are numbered from 0 (= full resolution) to n (= lowest resolution) where n is the mipmap level what is a single tile in size. Invalid mips are silently ignored. - The number of miplevels starting from 'mipMap' to invalidate. Invalid mips are silently ignored. - - - - Check if a texture stack is valid. - - - - - Get the active requests for this stack that were not previously popped from the internal request queue. - - The slice into which the resulting requests will be written. - - The number of valid requests written in requestHandles. - - - - - Make a rectangle in UV space resident for a given stack. - - The rectangle in 0-1 UV space to make resident. Anything outside the [ 0...1 [ x [ 0...1 [ rectangle will be silently ignored. - The miplevel to make resident. Mips are numbered from 0 (= full resolution) to n (= lowest resolution) where n is the mipmap level what is a single tile in size. Requesting invalid mips is silently ignored. - The number of miplevels starting from 'mipMap' to make resident. Requesting invalid mips is silently ignored. - - - - Handle for a (CPUTextureStackRequest|CPU or GPUTextureStackRequest|GPU) TextureStackRequest. - - - - - Complete the request with a given status. - - Completion status for the request. - - - - Complete a number of requests with a given status. - - Status for each request in requestHandles. - Handles of the requests that will be completed. - - - - Fetch the actual (CPUTextureStackRequestParameters|CPU or GPUTextureStackRequestParameters|GPU) request associated with this handle. - - - The request parameters associated with this handle. - - - - - Class responsable for virtual texturing feedback analysis. - - - - - Create a new VirtualTextureResolver object. - - - - - >Height of the texture that the internal buffers can hold. - - - - - Width of the texture that the internal buffers can hold. - - - - - Disposes this object. - - - - - Process the passed in feedback texture. - - The commandbuffer used to schedule processing. - Texture containing the feedback data. - X position of the subrect that is processed. - Width of the subrect that is processed. - Y position of the subrect that is processed. - Height of the subrect that is processed. - Miplevel of the texture to process. - Arrayslice of the texture to process. - - - - Process the passed in feedback texture. - - The commandbuffer used to schedule processing. - Texture containing the feedback data. - X position of the subrect that is processed. - Width of the subrect that is processed. - Y position of the subrect that is processed. - Height of the subrect that is processed. - Miplevel of the texture to process. - Arrayslice of the texture to process. - - - - Update the internal buffers. - - Width of the texture passed in during Process. - Height of the texture passed in during Process. - - - - Static class representing the Streaming Virtual Texturing system. - - - - - Gets the width and height of a Virtual Texture Stack, in pixels. - - The Material that contains the Virtual Texture Stack. The Virtual Texture Stacks contained in a Material are declared in the Material's Shader. - The unique identifier for the name of the Virtual Texture Stack, as declared in the Shader. To find the identifier for a given Shader property name, use Shader.PropertyToID. - Unity populates width with the width of the Virtual Texture Stack, in pixels. - Unity populates height with the height of the Virtual Texture Stack, in pixels. - - - - Make a rectangle in UV space resident for a given Virtual Texture Stack. - - The Material that contains the Virtual Texture Stack. The Virtual Texture Stacks contained in a Material are declared in the Material's Shader. - The unique identifier for the name of the Virtual Texture Stack, as declared in the Shader. To find the identifier for a given Shader property name, use Shader.PropertyToID. - The rectangle in 0-1 UV space to make resident. Anything outside the [ 0...1 [ x [ 0...1 [ rectangle will be silently ignored. - The mip level to make resident. Mips are numbered from 0 (= full resolution) to n (= lowest resolution) where n is the mipmap level what is a single tile in size. Requesting invalid mips is silently ignored. - The number of mip levels starting from 'mipMap' to make resident. Requesting invalid mips is silently ignored. - - - - Sets the CPU cache size (in MegaBytes) used by Streaming Virtual Texturing. - - - - - - Sets the GPU cache settings used by Streaming Virtual Texturing. - - - - - - The virtual texturing system. - - - - - Request all avalable mips. - - - - - Update the virtual texturing system. - - - - - Holds data of a visible light. - - - - - Light color multiplied by intensity. - - - - - Light intersects far clipping plane. - - - - - Light intersects near clipping plane. - - - - - Accessor to Light component. - - - - - Light type. - - - - - Light transformation matrix. - - - - - Light range. - - - - - Light's influence rectangle on screen. - - - - - Spot light angle. - - - - - Holds data of a visible reflection reflectionProbe. - - - - - Probe blending distance. - - - - - Probe bounding box. - - - - - Probe projection center. - - - - - Shader data for probe HDR texture decoding. - - - - - Probe importance. - - - - - Should probe use box projection. - - - - - Probe transformation matrix. - - - - - Accessor to ReflectionProbe component. - - - - - Probe texture. - - - - - Rendering path of a Camera. - - - - - Deferred Lighting (Legacy). - - - - - Deferred Shading. - - - - - Forward Rendering. - - - - - Use Player Settings. - - - - - Vertex Lit. - - - - - RenderMode for the Canvas. - - - - - Render using the Camera configured on the Canvas. - - - - - Render at the end of the Scene using a 2D Canvas. - - - - - Render using any Camera in the Scene that can render the layer. - - - - - The Render Settings contain values for a range of visual elements in your Scene, like fog and ambient light. - - - - - Ambient lighting coming from the sides. - - - - - Ambient lighting coming from below. - - - - - How much the light from the Ambient Source affects the Scene. - - - - - Flat ambient lighting color. - - - - - Ambient lighting mode. - - - - - Custom or skybox ambient lighting data. - - - - - Ambient lighting coming from above. - - - - - Custom specular reflection cubemap. - - - - - Default reflection mode. - - - - - Cubemap resolution for default reflection. - - - - - The fade speed of all flares in the Scene. - - - - - The intensity of all flares in the Scene. - - - - - Is fog enabled? - - - - - The color of the fog. - - - - - The density of the exponential fog. - - - - - The ending distance of linear fog. - - - - - Fog mode to use. - - - - - The starting distance of linear fog. - - - - - Size of the Light halos. - - - - - The number of times a reflection includes other reflections. - - - - - How much the skybox / custom cubemap reflection affects the Scene. - - - - - The global skybox to use. - - - - - The color used for the sun shadows in the Subtractive lightmode. - - - - - The light used by the procedural skybox. - - - - - Fully describes setup of RenderTarget. - - - - - Color Buffers to set. - - - - - Load Actions for Color Buffers. It will override any actions set on RenderBuffers themselves. - - - - - Store Actions for Color Buffers. It will override any actions set on RenderBuffers themselves. - - - - - Cubemap face to render to. - - - - - Depth Buffer to set. - - - - - Load Action for Depth Buffer. It will override any actions set on RenderBuffer itself. - - - - - Slice of a Texture3D or Texture2DArray to set as a render target. - - - - - Store Actions for Depth Buffer. It will override any actions set on RenderBuffer itself. - - - - - Mip Level to render to. - - - - - Constructs RenderTargetSetup. - - Color Buffer(s) to set. - Depth Buffer to set. - Mip Level to render to. - Cubemap face to render to. - - - - - Constructs RenderTargetSetup. - - Color Buffer(s) to set. - Depth Buffer to set. - Mip Level to render to. - Cubemap face to render to. - - - - - Constructs RenderTargetSetup. - - Color Buffer(s) to set. - Depth Buffer to set. - Mip Level to render to. - Cubemap face to render to. - - - - - Constructs RenderTargetSetup. - - Color Buffer(s) to set. - Depth Buffer to set. - Mip Level to render to. - Cubemap face to render to. - - - - - Constructs RenderTargetSetup. - - Color Buffer(s) to set. - Depth Buffer to set. - Mip Level to render to. - Cubemap face to render to. - - - - - Constructs RenderTargetSetup. - - Color Buffer(s) to set. - Depth Buffer to set. - Mip Level to render to. - Cubemap face to render to. - - - - - Render textures are textures that can be rendered to. - - - - - Currently active render texture. - - - - - The antialiasing level for the RenderTexture. - - - - - Mipmap levels are generated automatically when this flag is set. - - - - - If true and antiAliasing is greater than 1, the render texture will not be resolved by default. Use this if the render texture needs to be bound as a multisampled texture in a shader. - - - - - Color buffer of the render texture (Read Only). - - - - - The precision of the render texture's depth buffer in bits (0, 16, 24/32 are supported). - - - - - Depth/stencil buffer of the render texture (Read Only). - - - - - This struct contains all the information required to create a RenderTexture. It can be copied, cached, and reused to easily create RenderTextures that all share the same properties. - - - - - Dimensionality (type) of the render texture. - - - - - Enable random access write into this render texture on Shader Model 5.0 level shaders. - - - - - The color format of the render texture. - - - - - The height of the render texture in pixels. - - - - - If enabled, this Render Texture will be used as a Texture3D. - - - - - The render texture memoryless mode property. - - - - - Does this render texture use sRGB read/write conversions? (Read Only). - - - - - The format of the stencil data that you can encapsulate within a RenderTexture. - -Specifying this property creates a stencil element for the RenderTexture and sets its format. -This allows for stencil data to be bound as a Texture to all shader types for the platforms that support it. -This property does not specify the format of the stencil buffer, which is constrained by the depth buffer format specified in RenderTexture.depth. - -Currently, most platforms only support R8_UInt (DirectX11, DirectX12), while PS4 also supports R8_UNorm. - - - - - Is the render texture marked to be scaled by the Dynamic Resolution system. - - - - - Render texture has mipmaps when this flag is set. - - - - - Volume extent of a 3D render texture or number of slices of array texture. - - - - - If this RenderTexture is a VR eye texture used in stereoscopic rendering, this property decides what special rendering occurs, if any. - - - - - The width of the render texture in pixels. - - - - - Converts the render texture to equirectangular format (both stereoscopic or monoscopic equirect). -The left eye will occupy the top half and the right eye will occupy the bottom. The monoscopic version will occupy the whole texture. -Texture dimension must be of type TextureDimension.Cube. - - RenderTexture to render the equirect format to. - A Camera eye corresponding to the left or right eye for stereoscopic rendering, or neither for monoscopic rendering. - - - - Actually creates the RenderTexture. - - - True if the texture is created, else false. - - - - - Creates a new RenderTexture object. - - Texture width in pixels. - Texture height in pixels. - Number of bits in depth buffer (0, 16 or 24). Note that only 24 bit depth has stencil buffer. - Texture color format. - How or if color space conversions should be done on texture read/write. - Create the RenderTexture with the settings in the RenderTextureDescriptor. - Copy the settings from another RenderTexture. - - - - Creates a new RenderTexture object. - - Texture width in pixels. - Texture height in pixels. - Number of bits in depth buffer (0, 16 or 24). Note that only 24 bit depth has stencil buffer. - Texture color format. - How or if color space conversions should be done on texture read/write. - Create the RenderTexture with the settings in the RenderTextureDescriptor. - Copy the settings from another RenderTexture. - - - - Creates a new RenderTexture object. - - Texture width in pixels. - Texture height in pixels. - Number of bits in depth buffer (0, 16 or 24). Note that only 24 bit depth has stencil buffer. - Texture color format. - How or if color space conversions should be done on texture read/write. - Create the RenderTexture with the settings in the RenderTextureDescriptor. - Copy the settings from another RenderTexture. - - - - Hint the GPU driver that the contents of the RenderTexture will not be used. - - Should the colour buffer be discarded? - Should the depth buffer be discarded? - - - - Hint the GPU driver that the contents of the RenderTexture will not be used. - - Should the colour buffer be discarded? - Should the depth buffer be discarded? - - - - Generate mipmap levels of a render texture. - - - - - Retrieve a native (underlying graphics API) pointer to the depth buffer resource. - - - Pointer to an underlying graphics API depth buffer resource. - - - - - Allocate a temporary render texture. - - Width in pixels. - Height in pixels. - Depth buffer bits (0, 16 or 24). Note that only 24 bit depth has stencil buffer. - Render texture format. - Color space conversion mode. - Number of antialiasing samples to store in the texture. Valid values are 1, 2, 4, and 8. Throws an exception if any other value is passed. - Render texture memoryless mode. - Use this RenderTextureDesc for the settings when creating the temporary RenderTexture. - - - - - - Allocate a temporary render texture. - - Width in pixels. - Height in pixels. - Depth buffer bits (0, 16 or 24). Note that only 24 bit depth has stencil buffer. - Render texture format. - Color space conversion mode. - Number of antialiasing samples to store in the texture. Valid values are 1, 2, 4, and 8. Throws an exception if any other value is passed. - Render texture memoryless mode. - Use this RenderTextureDesc for the settings when creating the temporary RenderTexture. - - - - - - Is the render texture actually created? - - - - - Indicate that there's a RenderTexture restore operation expected. - - - - - Releases the RenderTexture. - - - - - Release a temporary texture allocated with GetTemporary. - - - - - - Force an antialiased render texture to be resolved. - - The render texture to resolve into. If set, the target render texture must have the same dimensions and format as the source. - - - - Force an antialiased render texture to be resolved. - - The render texture to resolve into. If set, the target render texture must have the same dimensions and format as the source. - - - - Assigns this RenderTexture as a global shader property named propertyName. - - - - - - Does a RenderTexture have stencil buffer? - - Render texture, or null for main screen. - - - - Set of flags that control the state of a newly-created RenderTexture. - - - - - Clear this flag when a RenderTexture is a VR eye texture and the device does not automatically flip the texture when being displayed. This is platform specific and -It is set by default. This flag is only cleared when part of a RenderTextureDesc that is returned from GetDefaultVREyeTextureDesc or other VR functions that return a RenderTextureDesc. Currently, only Hololens eye textures need to clear this flag. - - - - - Determines whether or not mipmaps are automatically generated when the RenderTexture is modified. -This flag is set by default, and has no effect if the RenderTextureCreationFlags.MipMap flag is not also set. -See RenderTexture.autoGenerateMips for more details. - - - - - Setting this flag causes the RenderTexture to be bound as a multisampled texture in a shader. The flag prevents the RenderTexture from being resolved by default when RenderTexture.antiAliasing is greater than 1. - - - - - This flag is always set internally when a RenderTexture is created from script. It has no effect when set manually from script code. - - - - - Set this flag to mark this RenderTexture for Dynamic Resolution should the target platform/graphics API support Dynamic Resolution. See ScalabeBufferManager for more details. - - - - - Set this flag to enable random access writes to the RenderTexture from shaders. -Normally, pixel shaders only operate on pixels they are given. Compute shaders cannot write to textures without this flag. Random write enables shaders to write to arbitrary locations on a RenderTexture. See RenderTexture.enableRandomWrite for more details, including supported platforms. - - - - - Set this flag when the Texture is to be used as a VR eye texture. This flag is cleared by default. This flag is set on a RenderTextureDesc when it is returned from GetDefaultVREyeTextureDesc or other VR functions returning a RenderTextureDesc. - - - - - Set this flag to allocate mipmaps in the RenderTexture. See RenderTexture.useMipMap for more details. - - - - - When this flag is set, the engine will not automatically resolve the color surface. - - - - - When this flag is set, reads and writes to this texture are converted to SRGB color space. See RenderTexture.sRGB for more details. - - - - - This struct contains all the information required to create a RenderTexture. It can be copied, cached, and reused to easily create RenderTextures that all share the same properties. Avoid using the default constructor as it does not initialize some flags with the recommended values. - - - - - Mipmap levels are generated automatically when this flag is set. - - - - - If true and msaaSamples is greater than 1, the render texture will not be resolved by default. Use this if the render texture needs to be bound as a multisampled texture in a shader. - - - - - The precision of the render texture's depth buffer in bits (0, 16, 24/32 are supported). - -See Also: RenderTexture.depth. - - - - - Dimensionality (type) of the render texture. - -See Also: RenderTexture.dimension. - - - - - Enable random access write into this render texture on Shader Model 5.0 level shaders. - -See Also: RenderTexture.enableRandomWrite. - - - - - A set of RenderTextureCreationFlags that control how the texture is created. - - - - - The color format for the RenderTexture. - - - - - The height of the render texture in pixels. - - - - - The render texture memoryless mode property. - - - - - User-defined mipmap count. - - - - - The multisample antialiasing level for the RenderTexture. - -See Also: RenderTexture.antiAliasing. - - - - - Determines how the RenderTexture is sampled if it is used as a shadow map. - -See Also: ShadowSamplingMode for more details. - - - - - This flag causes the render texture uses sRGB read/write conversions. - - - - - The format of the stencil data that you can encapsulate within a RenderTexture. - -Specifying this property creates a stencil element for the RenderTexture and sets its format. -This allows for stencil data to be bound as a Texture to all shader types for the platforms that support it. -This property does not specify the format of the stencil buffer, which is constrained by the depth buffer format specified in RenderTexture.depth. - -Currently, most platforms only support R8_UInt (DirectX11, DirectX12), while PS4 also supports R8_UNorm. - - - - - Set to true to enable dynamic resolution scaling on this render texture. - -See Also: RenderTexture.useDynamicScale. - - - - - Render texture has mipmaps when this flag is set. - -See Also: RenderTexture.useMipMap. - - - - - Volume extent of a 3D render texture. - - - - - If this RenderTexture is a VR eye texture used in stereoscopic rendering, this property decides what special rendering occurs, if any. Instead of setting this manually, use the value returned by XR.XRSettings.eyeTextureDesc|eyeTextureDesc or other VR functions returning a RenderTextureDescriptor. - - - - - The width of the render texture in pixels. - - - - - Create a RenderTextureDescriptor with default values, or a certain width, height, and format. - - Width of the RenderTexture in pixels. - Height of the RenderTexture in pixels. - The color format for the RenderTexture. - The number of bits to use for the depth buffer. - - - - Create a RenderTextureDescriptor with default values, or a certain width, height, and format. - - Width of the RenderTexture in pixels. - Height of the RenderTexture in pixels. - The color format for the RenderTexture. - The number of bits to use for the depth buffer. - - - - Create a RenderTextureDescriptor with default values, or a certain width, height, and format. - - Width of the RenderTexture in pixels. - Height of the RenderTexture in pixels. - The color format for the RenderTexture. - The number of bits to use for the depth buffer. - - - - Format of a RenderTexture. - - - - - Color render texture format, 1 bit for Alpha channel, 5 bits for Red, Green and Blue channels. - - - - - Color render texture format. 10 bits for colors, 2 bits for alpha. - - - - - Color render texture format, 8 bits per channel. - - - - - Color render texture format, 4 bit per channel. - - - - - Four color render texture format, 16 bits per channel, fixed point, unsigned normalized. - - - - - Color render texture format, 32 bit floating point per channel. - - - - - Color render texture format, 16 bit floating point per channel. - - - - - Four channel (ARGB) render texture format, 32 bit signed integer per channel. - - - - - Color render texture format, 10 bit per channel, extended range. - - - - - Color render texture format, 10 bit per channel, extended range. - - - - - Color render texture format, 8 bits per channel. - - - - - Default color render texture format: will be chosen accordingly to Frame Buffer format and Platform. - - - - - Default HDR color render texture format: will be chosen accordingly to Frame Buffer format and Platform. - - - - - A depth render texture format. - - - - - Single channel (R) render texture format, 16 bit integer. - - - - - Single channel (R) render texture format, 8 bit integer. - - - - - Scalar (R) render texture format, 32 bit floating point. - - - - - Two channel (RG) render texture format, 8 bits per channel. - - - - - Two color (RG) render texture format, 16 bits per channel, fixed point, unsigned normalized. - - - - - Color render texture format. R and G channels are 11 bit floating point, B channel is 10 bit floating point. - - - - - Color render texture format. - - - - - Four channel (RGBA) render texture format, 16 bit unsigned integer per channel. - - - - - Two color (RG) render texture format, 32 bit floating point per channel. - - - - - Two color (RG) render texture format, 16 bit floating point per channel. - - - - - Two channel (RG) render texture format, 32 bit signed integer per channel. - - - - - Scalar (R) render texture format, 16 bit floating point. - - - - - Scalar (R) render texture format, 32 bit signed integer. - - - - - A native shadowmap render texture format. - - - - - Flags enumeration of the render texture memoryless modes. - - - - - Render texture color pixels are memoryless when RenderTexture.antiAliasing is set to 1. - - - - - Render texture depth pixels are memoryless. - - - - - Render texture color pixels are memoryless when RenderTexture.antiAliasing is set to 2, 4 or 8. - - - - - The render texture is not memoryless. - - - - - Color space conversion mode of a RenderTexture. - - - - - Render texture contains sRGB (color) data, perform Linear<->sRGB conversions on it. - - - - - Default color space conversion based on project settings. - - - - - Render texture contains linear (non-color) data; don't perform color conversions on it. - - - - - The RequireComponent attribute automatically adds required components as dependencies. - - - - - Require a single component. - - - - - - Require two components. - - - - - - - Require three components. - - - - - - - - Represents a display resolution. - - - - - Resolution height in pixels. - - - - - Resolution's vertical refresh rate in Hz. - - - - - Resolution width in pixels. - - - - - Returns a nicely formatted string of the resolution. - - - A string with the format "width x height @ refreshRateHz". - - - - - Asynchronous load request from the Resources bundle. - - - - - Asset object being loaded (Read Only). - - - - - The Resources class allows you to find and access Objects including assets. - - - - - Returns a list of all objects of Type T. - - - - - Returns a list of all objects of Type type. - - - - - - Translates an instance ID to an object reference. - - Instance ID of an Object. - - Resolved reference or null if the instance ID didn't match anything. - - - - - Translates an array of instance IDs to a list of Object references. - - IDs of Object instances. - List of resoved object references, instanceIDs and objects will be of the same length and in the same order, the list will be resized if needed. Missing objects will be null. - - - - Loads the asset of the requested type stored at path in a Resources folder using a generic parameter type filter of type T. - - Path to the target resource to load. - - An object of the requested generic parameter type. - - - - - Loads an asset stored at path in a Resources folder using an optional systemTypeInstance filter. - - Path to the target resource to load. - Type filter for objects returned. - - The requested asset returned as an Object. - - - - - Loads an asset stored at path in a Resources folder using an optional systemTypeInstance filter. - - Path to the target resource to load. - Type filter for objects returned. - - The requested asset returned as an Object. - - - - - Loads all assets in a folder or file at path in a Resources folder. - - Pathname of the target folder. When using the empty string (i.e., ""), the function will load the entire contents of the Resources folder. - Type filter for objects returned. - - - - Loads all assets in a folder or file at path in a Resources folder. - - Pathname of the target folder. When using the empty string (i.e., ""), the function will load the entire contents of the Resources folder. - Type filter for objects returned. - - - - Loads all assets in a folder or file at path in a Resources folder. - - Pathname of the target folder. When using the empty string (i.e., ""), the function will load the entire contents of the Resources folder. - - - - Returns a resource at an asset path (Editor Only). - - Pathname of the target asset. - Type filter for objects returned. - - - - Returns a resource at an asset path (Editor Only). - - Pathname of the target asset. - - - - Asynchronously loads an asset stored at path in a Resources folder. - - Pathname of the target folder. When using the empty string (i.e., ""), the function will load the entire contents of the Resources folder. - Type filter for objects returned. - - - - - Asynchronously loads an asset stored at path in a Resources folder. - - Pathname of the target folder. When using the empty string (i.e., ""), the function will load the entire contents of the Resources folder. - Type filter for objects returned. - - - - - Asynchronously loads an asset stored at path in a Resources folder. - - Pathname of the target folder. When using the empty string (i.e., ""), the function will load the entire contents of the Resources folder. - - - - Unloads assetToUnload from memory. - - - - - - Unloads assets that are not used. - - - Object on which you can yield to wait until the operation completes. - - - - - Derive from this base class to provide alternative implementations to the C# behavior of specific Resources methods. - - - - - The specific ResourcesAPI instance to use to handle overridden Resources methods. - - - - - Override for customizing the behavior of the Resources.FindObjectsOfTypeAll function. - - - - - - Override for customizing the behavior of the Shader.Find function. - - - - - - Override for customizing the behavior of the Resources.Load function. - - Path to the target resource to load. - The requested asset's Type. - - The requested asset returned as an Object. - - - - - Override for customizing the behavior of the Resources.LoadAll function. - - Path to the target resource to load. - Type filter for objects returned. - - - - Override for customizing the behavior of the Resources.LoadAsync function. - - Path to the target resource to load. - Type filter for objects returned. - - - - Override for customizing the behavior of the Resources.Unload function. - - - - - - Control of an object's position through physics simulation. - - - - - The angular drag of the object. - - - - - The angular velocity vector of the rigidbody measured in radians per second. - - - - - The center of mass relative to the transform's origin. - - - - - The Rigidbody's collision detection mode. - - - - - Controls which degrees of freedom are allowed for the simulation of this Rigidbody. - - - - - Should collision detection be enabled? (By default always enabled). - - - - - The drag of the object. - - - - - Controls whether physics will change the rotation of the object. - - - - - The diagonal inertia tensor of mass relative to the center of mass. - - - - - The rotation of the inertia tensor. - - - - - Interpolation allows you to smooth out the effect of running physics at a fixed frame rate. - - - - - Controls whether physics affects the rigidbody. - - - - - The mass of the rigidbody. - - - - - The maximimum angular velocity of the rigidbody measured in radians per second. (Default 7) range { 0, infinity }. - - - - - Maximum velocity of a rigidbody when moving out of penetrating state. - - - - - The position of the rigidbody. - - - - - The rotation of the Rigidbody. - - - - - The angular velocity below which objects start going to sleep. (Default 0.14) range { 0, infinity }. - - - - - The mass-normalized energy threshold, below which objects start going to sleep. - - - - - The linear velocity below which objects start going to sleep. (Default 0.14) range { 0, infinity }. - - - - - The solverIterations determines how accurately Rigidbody joints and collision contacts are resolved. Overrides Physics.defaultSolverIterations. Must be positive. - - - - - The solverVelocityIterations affects how how accurately Rigidbody joints and collision contacts are resolved. Overrides Physics.defaultSolverVelocityIterations. Must be positive. - - - - - Force cone friction to be used for this rigidbody. - - - - - Controls whether gravity affects this rigidbody. - - - - - The velocity vector of the rigidbody. It represents the rate of change of Rigidbody position. - - - - - The center of mass of the rigidbody in world space (Read Only). - - - - - Applies a force to a rigidbody that simulates explosion effects. - - The force of the explosion (which may be modified by distance). - The centre of the sphere within which the explosion has its effect. - The radius of the sphere within which the explosion has its effect. - Adjustment to the apparent position of the explosion to make it seem to lift objects. - The method used to apply the force to its targets. - - - - Applies a force to a rigidbody that simulates explosion effects. - - The force of the explosion (which may be modified by distance). - The centre of the sphere within which the explosion has its effect. - The radius of the sphere within which the explosion has its effect. - Adjustment to the apparent position of the explosion to make it seem to lift objects. - The method used to apply the force to its targets. - - - - Applies a force to a rigidbody that simulates explosion effects. - - The force of the explosion (which may be modified by distance). - The centre of the sphere within which the explosion has its effect. - The radius of the sphere within which the explosion has its effect. - Adjustment to the apparent position of the explosion to make it seem to lift objects. - The method used to apply the force to its targets. - - - - Adds a force to the Rigidbody. - - Force vector in world coordinates. - Type of force to apply. - - - - Adds a force to the Rigidbody. - - Force vector in world coordinates. - Type of force to apply. - - - - Adds a force to the Rigidbody. - - Size of force along the world x-axis. - Size of force along the world y-axis. - Size of force along the world z-axis. - Type of force to apply. - - - - Adds a force to the Rigidbody. - - Size of force along the world x-axis. - Size of force along the world y-axis. - Size of force along the world z-axis. - Type of force to apply. - - - - Applies force at position. As a result this will apply a torque and force on the object. - - Force vector in world coordinates. - Position in world coordinates. - - - - - Applies force at position. As a result this will apply a torque and force on the object. - - Force vector in world coordinates. - Position in world coordinates. - - - - - Adds a force to the rigidbody relative to its coordinate system. - - Force vector in local coordinates. - - - - - Adds a force to the rigidbody relative to its coordinate system. - - Force vector in local coordinates. - - - - - Adds a force to the rigidbody relative to its coordinate system. - - Size of force along the local x-axis. - Size of force along the local y-axis. - Size of force along the local z-axis. - - - - - Adds a force to the rigidbody relative to its coordinate system. - - Size of force along the local x-axis. - Size of force along the local y-axis. - Size of force along the local z-axis. - - - - - Adds a torque to the rigidbody relative to its coordinate system. - - Torque vector in local coordinates. - - - - - Adds a torque to the rigidbody relative to its coordinate system. - - Torque vector in local coordinates. - - - - - Adds a torque to the rigidbody relative to its coordinate system. - - Size of torque along the local x-axis. - Size of torque along the local y-axis. - Size of torque along the local z-axis. - - - - - Adds a torque to the rigidbody relative to its coordinate system. - - Size of torque along the local x-axis. - Size of torque along the local y-axis. - Size of torque along the local z-axis. - - - - - Adds a torque to the rigidbody. - - Torque vector in world coordinates. - - - - - Adds a torque to the rigidbody. - - Torque vector in world coordinates. - - - - - Adds a torque to the rigidbody. - - Size of torque along the world x-axis. - Size of torque along the world y-axis. - Size of torque along the world z-axis. - - - - - Adds a torque to the rigidbody. - - Size of torque along the world x-axis. - Size of torque along the world y-axis. - Size of torque along the world z-axis. - - - - - The closest point to the bounding box of the attached colliders. - - - - - - The velocity of the rigidbody at the point worldPoint in global space. - - - - - - The velocity relative to the rigidbody at the point relativePoint. - - - - - - Is the rigidbody sleeping? - - - - - Moves the kinematic Rigidbody towards position. - - Provides the new position for the Rigidbody object. - - - - Rotates the rigidbody to rotation. - - The new rotation for the Rigidbody. - - - - Reset the center of mass of the rigidbody. - - - - - Reset the inertia tensor value and rotation. - - - - - Sets the mass based on the attached colliders assuming a constant density. - - - - - - Forces a rigidbody to sleep at least one frame. - - - - - Tests if a rigidbody would collide with anything, if it was moved through the Scene. - - The direction into which to sweep the rigidbody. - If true is returned, hitInfo will contain more information about where the collider was hit (See Also: RaycastHit). - The length of the sweep. - Specifies whether this query should hit Triggers. - - True when the rigidbody sweep intersects any collider, otherwise false. - - - - - Like Rigidbody.SweepTest, but returns all hits. - - The direction into which to sweep the rigidbody. - The length of the sweep. - Specifies whether this query should hit Triggers. - - An array of all colliders hit in the sweep. - - - - - Forces a rigidbody to wake up. - - - - - Rigidbody physics component for 2D sprites. - - - - - Coefficient of angular drag. - - - - - Angular velocity in degrees per second. - - - - - Returns the number of Collider2D attached to this Rigidbody2D. - - - - - The physical behaviour type of the Rigidbody2D. - - - - - The center of mass of the rigidBody in local space. - - - - - The method used by the physics engine to check if two objects have collided. - - - - - Controls which degrees of freedom are allowed for the simulation of this Rigidbody2D. - - - - - Coefficient of drag. - - - - - Should the rigidbody be prevented from rotating? - - - - - Controls whether physics will change the rotation of the object. - - - - - The degree to which this object is affected by gravity. - - - - - The Rigidbody's resistance to changes in angular velocity (rotation). - - - - - Physics interpolation used between updates. - - - - - Should this rigidbody be taken out of physics control? - - - - - Mass of the Rigidbody. - - - - - The position of the rigidbody. - - - - - The rotation of the rigidbody. - - - - - The PhysicsMaterial2D that is applied to all Collider2D attached to this Rigidbody2D. - - - - - Indicates whether the rigid body should be simulated or not by the physics system. - - - - - The sleep state that the rigidbody will initially be in. - - - - - Should the total rigid-body mass be automatically calculated from the Collider2D.density of attached colliders? - - - - - Should kinematickinematic and kinematicstatic collisions be allowed? - - - - - Linear velocity of the Rigidbody in units per second. - - - - - Gets the center of mass of the rigidBody in global space. - - - - - Apply a force to the rigidbody. - - Components of the force in the X and Y axes. - The method used to apply the specified force. - - - - Apply a force at a given position in space. - - Components of the force in the X and Y axes. - Position in world space to apply the force. - The method used to apply the specified force. - - - - Adds a force to the rigidbody2D relative to its coordinate system. - - Components of the force in the X and Y axes. - The method used to apply the specified force. - - - - Apply a torque at the rigidbody's centre of mass. - - Torque to apply. - The force mode to use. - - - - All the Collider2D shapes attached to the Rigidbody2D are cast into the Scene starting at each Collider position ignoring the Colliders attached to the same Rigidbody2D. - - Vector representing the direction to cast each Collider2D shape. - Array to receive results. - Maximum distance over which to cast the Collider(s). - - Returns the number of results placed in the results array. - - - - - All the Collider2D shapes attached to the Rigidbody2D are cast into the Scene starting at each Collider position ignoring the Colliders attached to the same Rigidbody2D. - - Vector representing the direction to cast each Collider2D shape. - Filter results defined by the contact filter. - Array to receive results. - Maximum distance over which to cast the Collider(s). - - Returns the number of results placed in the results array. - - - - - All the Collider2D shapes attached to the Rigidbody2D are cast into the Scene starting at each Collider position ignoring the Colliders attached to the same Rigidbody2D. - - Vector representing the direction to cast each Collider2D shape. - List to receive results. - Maximum distance over which to cast the Collider(s). - - Returns the number of results placed in the results list. - - - - - All the Collider2D shapes attached to the Rigidbody2D are cast into the Scene starting at each Collider position ignoring the Colliders attached to the same Rigidbody2D. - - Vector representing the direction to cast each Collider2D shape. - Filter results defined by the contact filter. - List to receive results. - Maximum distance over which to cast the Collider(s). - - Returns the number of results placed in the results list. - - - - - Returns a point on the perimeter of all enabled Colliders attached to this Rigidbody that is closest to the specified position. - - The position from which to find the closest point on this Rigidbody. - - A point on the perimeter of a Collider attached to this rigidbody that is closest to the specified position. - - - - - Calculates the minimum distance of this collider against all Collider2D attached to this Rigidbody2D. - - A collider used to calculate the minimum distance against all colliders attached to this Rigidbody2D. - - The minimum distance of collider against all colliders attached to this Rigidbody2D. - - - - - Returns all Collider2D that are attached to this Rigidbody2D. - - An array of Collider2D used to receive the results. - - Returns the number of Collider2D placed in the results array. - - - - - Returns all Collider2D that are attached to this Rigidbody2D. - - A list of Collider2D used to receive the results. - - Returns the number of Collider2D placed in the results list. - - - - - Retrieves all contact points for all of the Collider(s) attached to this Rigidbody. - - An array of ContactPoint2D used to receive the results. - - Returns the number of contacts placed in the contacts array. - - - - - Retrieves all Colliders in contact with any of the Collider(s) attached to this Rigidbody. - - An array of Collider2D used to receive the results. - - Returns the number of colliders placed in the colliders array. - - - - - Retrieves all contact points for all of the Collider(s) attached to this Rigidbody, with the results filtered by the ContactFilter2D. - - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - An array of ContactPoint2D used to receive the results. - - Returns the number of contacts placed in the contacts array. - - - - - Retrieves all Colliders in contact with any of the Collider(s) attached to this rigidbody, with the results filtered by the ContactFilter2D. - - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - An array of Collider2D used to receive the results. - - Returns the number of colliders placed in the colliders array. - - - - - Retrieves all contact points for all of the Collider(s) attached to this Rigidbody. - - A list of ContactPoint2D used to receive the results. - - Returns the number of contacts placed in the contacts list. - - - - - Retrieves all contact points for all of the Collider(s) attached to this Rigidbody. - - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - A list of ContactPoint2D used to receive the results. - - Returns the number of contacts placed in the contacts list. - - - - - Retrieves all Colliders in contact with any of the Collider(s) attached to this Rigidbody. - - A list of Collider2D used to receive the results. - - Returns the number of Colliders placed in the colliders list. - - - - - Retrieves all Colliders in contact with any of the Collider(s) attached to this Rigidbody. - - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - A list of Collider2D used to receive the results. - - Returns the number of Colliders placed in the colliders list. - - - - - Get a local space point given the point point in rigidBody global space. - - The global space point to transform into local space. - - - - The velocity of the rigidbody at the point Point in global space. - - The global space point to calculate velocity for. - - - - Get a global space point given the point relativePoint in rigidBody local space. - - The local space point to transform into global space. - - - - The velocity of the rigidbody at the point Point in local space. - - The local space point to calculate velocity for. - - - - Get a global space vector given the vector relativeVector in rigidBody local space. - - The local space vector to transform into a global space vector. - - - - Get a local space vector given the vector vector in rigidBody global space. - - The global space vector to transform into a local space vector. - - - - Is the rigidbody "awake"? - - - - - Is the rigidbody "sleeping"? - - - - - Checks whether the collider is touching any of the collider(s) attached to this rigidbody or not. - - The collider to check if it is touching any of the collider(s) attached to this rigidbody. - - Whether the collider is touching any of the collider(s) attached to this rigidbody or not. - - - - - Checks whether the collider is touching any of the collider(s) attached to this rigidbody or not with the results filtered by the ContactFilter2D. - - The collider to check if it is touching any of the collider(s) attached to this rigidbody. - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - - Whether the collider is touching any of the collider(s) attached to this rigidbody or not. - - - - - Checks whether any collider is touching any of the collider(s) attached to this rigidbody or not with the results filtered by the ContactFilter2D. - - The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle. - - Whether any collider is touching any of the collider(s) attached to this rigidbody or not. - - - - - Checks whether any of the collider(s) attached to this rigidbody are touching any colliders on the specified layerMask or not. - - Any colliders on any of these layers count as touching. - - Whether any of the collider(s) attached to this rigidbody are touching any colliders on the specified layerMask or not. - - - - - Moves the rigidbody to position. - - The new position for the Rigidbody object. - - - - Rotates the Rigidbody to angle (given in degrees). - - The new rotation angle for the Rigidbody object. - - - - An overload of MoveRotation that allows a full 3D rotation as an argument. - - Full 3D rotation used to extract only the z-axis rotation. - - - - Get a list of all Colliders that overlap all Colliders attached to this Rigidbody2D. - - The contact filter used to filter the results differently, such as by layer mask, Z depth. Note that normal angle is not used for overlap testing. - The array to receive results. The size of the array determines the maximum number of results that can be returned. - - Returns the number of results placed in the results array. - - - - - Get a list of all Colliders that overlap all Colliders attached to this Rigidbody2D. - - The contact filter used to filter the results differently, such as by layer mask, Z depth. Note that normal angle is not used for overlap testing. - The list to receive results. - - Returns the number of results placed in the results list. - - - - - Check if any of the Rigidbody2D colliders overlap a point in space. - - A point in world space. - - Whether the point overlapped any of the Rigidbody2D colliders. - - - - - Sets the rotation of the Rigidbody2D to angle (given in degrees). - - The rotation of the Rigidbody (in degrees). - - - - Sets the rotation of the Rigidbody2D to the z-axis rotation extracted from the full 3D rotation. - - Full 3D rotation used to extract only the z-axis rotation. - - - - Make the rigidbody "sleep". - - - - - Disables the "sleeping" state of a rigidbody. - - - - - Use these flags to constrain motion of Rigidbodies. - - - - - Freeze rotation and motion along all axes. - - - - - Freeze motion along all axes. - - - - - Freeze motion along the X-axis. - - - - - Freeze motion along the Y-axis. - - - - - Freeze motion along the Z-axis. - - - - - Freeze rotation along all axes. - - - - - Freeze rotation along the X-axis. - - - - - Freeze rotation along the Y-axis. - - - - - Freeze rotation along the Z-axis. - - - - - No constraints. - - - - - Use these flags to constrain motion of the Rigidbody2D. - - - - - Freeze rotation and motion along all axes. - - - - - Freeze motion along the X-axis and Y-axis. - - - - - Freeze motion along the X-axis. - - - - - Freeze motion along the Y-axis. - - - - - Freeze rotation along the Z-axis. - - - - - No constraints. - - - - - Rigidbody interpolation mode. - - - - - Extrapolation will predict the position of the rigidbody based on the current velocity. - - - - - Interpolation will always lag a little bit behind but can be smoother than extrapolation. - - - - - No Interpolation. - - - - - Interpolation mode for Rigidbody2D objects. - - - - - Smooth an object's movement based on an estimate of its position in the next frame. - - - - - Smooth movement based on the object's positions in previous frames. - - - - - Do not apply any smoothing to the object's movement. - - - - - Settings for a Rigidbody2D's initial sleep state. - - - - - Rigidbody2D never automatically sleeps. - - - - - Rigidbody2D is initially asleep. - - - - - Rigidbody2D is initially awake. - - - - - The physical behaviour type of the Rigidbody2D. - - - - - Sets the Rigidbody2D to have dynamic behaviour. - - - - - Sets the Rigidbody2D to have kinematic behaviour. - - - - - Sets the Rigidbody2D to have static behaviour. - - - - - Control ConfigurableJoint's rotation with either X & YZ or Slerp Drive. - - - - - Use Slerp drive. - - - - - Use XY & Z Drive. - - - - - Attribute for setting up RPC functions. - - - - - Option for who will receive an RPC, used by NetworkView.RPC. - - - - - The runtime representation of the AnimatorController. Use this representation to change the Animator Controller during runtime. - - - - - Retrieves all AnimationClip used by the controller. - - - - - Set RuntimeInitializeOnLoadMethod type. - - - - - Callback when all assemblies are loaded and preloaded assets are initialized. - - - - - After Scene is loaded. - - - - - Before Scene is loaded. - - - - - Immediately before the splash screen is shown. - - - - - Callback used for registration of subsystems - - - - - Allow a runtime class method to be initialized when a game is loaded at runtime - without action from the user. - - - - - Set RuntimeInitializeOnLoadMethod type. - - - - - Creation of the runtime class used when Scenes are loaded. - - Determine whether methods are called before or after the - Scene is loaded. - - - - Creation of the runtime class used when Scenes are loaded. - - Determine whether methods are called before or after the - Scene is loaded. - - - - The platform application is running. Returned by Application.platform. - - - - - In the player on the Apple's tvOS. - - - - - In the player on Android devices. - - - - - In the player on CloudRendering. - - - - - In the player on the iPhone. - - - - - In the Unity editor on Linux. - - - - - In the player on Linux. - - - - - In the Dashboard widget on macOS. - - - - - In the Unity editor on macOS. - - - - - In the player on macOS. - - - - - In the web player on macOS. - - - - - In the player on the Playstation 4. - - - - - In the player on the Playstation 5. - - - - - In the player on Stadia. - - - - - In the player on Nintendo Switch. - - - - - In the player on WebGL - - - - - In the Unity editor on Windows. - - - - - In the player on Windows. - - - - - In the web player on Windows. - - - - - In the player on Windows Store Apps when CPU architecture is ARM. - - - - - In the player on Windows Store Apps when CPU architecture is X64. - - - - - In the player on Windows Store Apps when CPU architecture is X86. - - - - - In the player on Xbox One. - - - - - Scales render textures to support dynamic resolution if the target platform/graphics API supports it. - - - - - Height scale factor to control dynamic resolution. - - - - - Width scale factor to control dynamic resolution. - - - - - Function to resize all buffers marked as DynamicallyScalable. - - New scale factor for the width the ScalableBufferManager will use to resize all render textures the user marked as DynamicallyScalable, has to be some value greater than 0.0 and less than or equal to 1.0. - New scale factor for the height the ScalableBufferManager will use to resize all render textures the user marked as DynamicallyScalable, has to be some value greater than 0.0 and less than or equal to 1.0. - - - - Scaling mode to draw textures with. - - - - - Scales the texture, maintaining aspect ratio, so it completely covers the position rectangle passed to GUI.DrawTexture. If the texture is being draw to a rectangle with a different aspect ratio than the original, the image is cropped. - - - - - Scales the texture, maintaining aspect ratio, so it completely fits withing the position rectangle passed to GUI.DrawTexture. - - - - - Stretches the texture to fill the complete rectangle passed in to GUI.DrawTexture. - - - - - This struct collects all the CreateScene parameters in to a single place. - - - - - See SceneManagement.LocalPhysicsMode. - - - - - Used when loading a Scene in a player. - - - - - Adds the Scene to the current loaded Scenes. - - - - - Closes all current loaded Scenes - and loads a Scene. - - - - - This struct collects all the LoadScene parameters in to a single place. - - - - - See LoadSceneMode. - - - - - See SceneManagement.LocalPhysicsMode. - - - - - Constructor for LoadSceneParameters. See SceneManager.LoadScene. - - See LoadSceneParameters.loadSceneMode. - - - - Provides options for 2D and 3D local physics. - - - - - No local 2D or 3D physics Scene will be created. - - - - - A local 2D physics Scene will be created and owned by the Scene. - - - - - A local 3D physics Scene will be created and owned by the Scene. - - - - - Run-time data structure for *.unity file. - - - - - Return the index of the Scene in the Build Settings. - - - - - Returns true if the Scene is modifed. - - - - - Returns true if the Scene is loaded. - - - - - Returns the name of the Scene that is currently active in the game or app. - - - - - Returns the relative path of the Scene. Like: "AssetsMyScenesMyScene.unity". - - - - - The number of root transforms of this Scene. - - - - - Returns all the root game objects in the Scene. - - - An array of game objects. - - - - - Returns all the root game objects in the Scene. - - A list which is used to return the root game objects. - - - - Whether this is a valid Scene. -A Scene may be invalid if, for example, you tried to open a Scene that does not exist. In this case, the Scene returned from EditorSceneManager.OpenScene would return False for IsValid. - - - Whether this is a valid Scene. - - - - - Returns true if the Scenes are equal. - - - - - - - Returns true if the Scenes are different. - - - - - - - Scene management at run-time. - - - - - Subscribe to this event to get notified when the active Scene has changed. - - Use a subscription of either a UnityAction<SceneManagement.Scene, SceneManagement.Scene> or a method that takes two SceneManagement.Scene types arguments. - - - - The total number of currently loaded Scenes. - - - - - Number of Scenes in Build Settings. - - - - - Add a delegate to this to get notifications when a Scene has loaded. - - Use a subscription of either a UnityAction<SceneManagement.Scene, SceneManagement.LoadSceneMode> or a method that takes a SceneManagement.Scene and a SceneManagement.LoadSceneMode. - - - - Add a delegate to this to get notifications when a Scene has unloaded. - - Use a subscription of either a UnityAction<SceneManagement.Scene> or a method that takes a SceneManagement.Scene type argument. - - - - Create an empty new Scene at runtime with the given name. - - The name of the new Scene. It cannot be empty or null, or same as the name of the existing Scenes. - Various parameters used to create the Scene. - - A reference to the new Scene that was created, or an invalid Scene if creation failed. - - - - - Create an empty new Scene at runtime with the given name. - - The name of the new Scene. It cannot be empty or null, or same as the name of the existing Scenes. - Various parameters used to create the Scene. - - A reference to the new Scene that was created, or an invalid Scene if creation failed. - - - - - Gets the currently active Scene. - - - The active Scene. - - - - - Returns an array of all the Scenes currently open in the hierarchy. - - - Array of Scenes in the Hierarchy. - - - - - Get the Scene at index in the SceneManager's list of loaded Scenes. - - Index of the Scene to get. Index must be greater than or equal to 0 and less than SceneManager.sceneCount. - - A reference to the Scene at the index specified. - - - - - Get a Scene struct from a build index. - - Build index as shown in the Build Settings window. - - A reference to the Scene, if valid. If not, an invalid Scene is returned. - - - - - Searches through the Scenes loaded for a Scene with the given name. - - Name of Scene to find. - - A reference to the Scene, if valid. If not, an invalid Scene is returned. - - - - - Searches all Scenes loaded for a Scene that has the given asset path. - - Path of the Scene. Should be relative to the project folder. Like: "AssetsMyScenesMyScene.unity". - - A reference to the Scene, if valid. If not, an invalid Scene is returned. - - - - - Loads the Scene by its name or index in Build Settings. - - Name or path of the Scene to load. - Index of the Scene in the Build Settings to load. - Allows you to specify whether or not to load the Scene additively. See SceneManagement.LoadSceneMode for more information about the options. - - - - Loads the Scene by its name or index in Build Settings. - - Name or path of the Scene to load. - Index of the Scene in the Build Settings to load. - Allows you to specify whether or not to load the Scene additively. See SceneManagement.LoadSceneMode for more information about the options. - - - - Loads the Scene by its name or index in Build Settings. - - Name or path of the Scene to load. - Index of the Scene in the Build Settings to load. - Various parameters used to load the Scene. - - A handle to the Scene being loaded. - - - - - Loads the Scene by its name or index in Build Settings. - - Name or path of the Scene to load. - Index of the Scene in the Build Settings to load. - Various parameters used to load the Scene. - - A handle to the Scene being loaded. - - - - - Loads the Scene asynchronously in the background. - - Name or path of the Scene to load. - Index of the Scene in the Build Settings to load. - If LoadSceneMode.Single then all current Scenes will be unloaded before loading. - Struct that collects the various parameters into a single place except for the name and index. - - Use the AsyncOperation to determine if the operation has completed. - - - - - Loads the Scene asynchronously in the background. - - Name or path of the Scene to load. - Index of the Scene in the Build Settings to load. - If LoadSceneMode.Single then all current Scenes will be unloaded before loading. - Struct that collects the various parameters into a single place except for the name and index. - - Use the AsyncOperation to determine if the operation has completed. - - - - - Loads the Scene asynchronously in the background. - - Name or path of the Scene to load. - Index of the Scene in the Build Settings to load. - If LoadSceneMode.Single then all current Scenes will be unloaded before loading. - Struct that collects the various parameters into a single place except for the name and index. - - Use the AsyncOperation to determine if the operation has completed. - - - - - Loads the Scene asynchronously in the background. - - Name or path of the Scene to load. - Index of the Scene in the Build Settings to load. - If LoadSceneMode.Single then all current Scenes will be unloaded before loading. - Struct that collects the various parameters into a single place except for the name and index. - - Use the AsyncOperation to determine if the operation has completed. - - - - - This will merge the source Scene into the destinationScene. - - The Scene that will be merged into the destination Scene. - Existing Scene to merge the source Scene into. - - - - Move a GameObject from its current Scene to a new Scene. - - GameObject to move. - Scene to move into. - - - - Set the Scene to be active. - - The Scene to be set. - - Returns false if the Scene is not loaded yet. - - - - - Destroys all GameObjects associated with the given Scene and removes the Scene from the SceneManager. - - Index of the Scene in the Build Settings to unload. - Name or path of the Scene to unload. - Scene to unload. - - Returns true if the Scene is unloaded. - - - - - Destroys all GameObjects associated with the given Scene and removes the Scene from the SceneManager. - - Index of the Scene in the Build Settings to unload. - Name or path of the Scene to unload. - Scene to unload. - - Returns true if the Scene is unloaded. - - - - - Destroys all GameObjects associated with the given Scene and removes the Scene from the SceneManager. - - Index of the Scene in the Build Settings to unload. - Name or path of the Scene to unload. - Scene to unload. - - Returns true if the Scene is unloaded. - - - - - Destroys all GameObjects associated with the given Scene and removes the Scene from the SceneManager. - - Index of the Scene in BuildSettings. - Name or path of the Scene to unload. - Scene to unload. - Scene unloading options. - - Use the AsyncOperation to determine if the operation has completed. - - - - - Destroys all GameObjects associated with the given Scene and removes the Scene from the SceneManager. - - Index of the Scene in BuildSettings. - Name or path of the Scene to unload. - Scene to unload. - Scene unloading options. - - Use the AsyncOperation to determine if the operation has completed. - - - - - Destroys all GameObjects associated with the given Scene and removes the Scene from the SceneManager. - - Index of the Scene in BuildSettings. - Name or path of the Scene to unload. - Scene to unload. - Scene unloading options. - - Use the AsyncOperation to determine if the operation has completed. - - - - - Destroys all GameObjects associated with the given Scene and removes the Scene from the SceneManager. - - Index of the Scene in BuildSettings. - Name or path of the Scene to unload. - Scene to unload. - Scene unloading options. - - Use the AsyncOperation to determine if the operation has completed. - - - - - Destroys all GameObjects associated with the given Scene and removes the Scene from the SceneManager. - - Index of the Scene in BuildSettings. - Name or path of the Scene to unload. - Scene to unload. - Scene unloading options. - - Use the AsyncOperation to determine if the operation has completed. - - - - - Destroys all GameObjects associated with the given Scene and removes the Scene from the SceneManager. - - Index of the Scene in BuildSettings. - Name or path of the Scene to unload. - Scene to unload. - Scene unloading options. - - Use the AsyncOperation to determine if the operation has completed. - - - - - Derive from this base class to provide alternative implementations to the C# behavior of specific SceneManagement.SceneManager methods. - - - - - The specific SceneManagement.SceneManagerAPI instance to use to handle overridden SceneManagement.SceneManager methods. - - - - - Override for customizing the behavior of the SceneManagement.SceneManager.sceneCountInBuildSettings function. - - - Number of Scenes handled by SceneManagement.SceneManagerApi.GetSceneByBuildIndex. - - - - - Override for customizing the behavior of the SceneManagement.SceneManager.GetSceneByBuildIndex function. - - Build index as returned by SceneManagement.SceneManagerApi.GetNumScenesInBuildSettings. - - A reference to the Scene, if valid. If not, an invalid Scene is returned. - - - - - Override for customizing the behavior of loading the first Scene in a stub player build. - - - - - - Override for customizing the behavior of the SceneManagement.SceneManager.LoadScene and SceneManagement.SceneManager.LoadSceneAsync functions. - - - - - - - - - Override for customizing the behavior of the SceneManagement.SceneManager.UnloadSceneAsync function. - - - - - - - - - - Scene and Build Settings related utilities. - - - - - Get the build index from a Scene path. - - Scene path (e.g: "AssetsScenesScene1.unity"). - - Build index. - - - - - Get the Scene path from a build index. - - - - Scene path (e.g "AssetsScenesScene1.unity"). - - - - - Scene unloading options passed to SceneManager.UnloadScene. - - - - - Unload the scene without any special options. - - - - - Unloads all objects that are loaded from the scene's serialized file. Without this flag, only GameObject and Components within the scene's hierarchy are unloaded. - -Note: Objects that are dynamically created during the build process can be embedded in the scene's serialized file. This can occur when asset types are created and referenced inside the scene's post-processor callback. Some examples of these types are textures, meshes, and scriptable objects. Assets from your assets folder are not embedded in the scene's serialized file. -Note: This flag does not unload assets which can be referenced by other scenes. - - - - - Access to display information. - - - - - Allow auto-rotation to landscape left? - - - - - Allow auto-rotation to landscape right? - - - - - Allow auto-rotation to portrait? - - - - - Allow auto-rotation to portrait, upside down? - - - - - The current brightness of the screen. - - - - - The current screen resolution (Read Only). - - - - - Returns a list of screen areas that are not functional for displaying content (Read Only). - - - - - The current DPI of the screen / device (Read Only). - - - - - Is the game running full-screen? - - - - - Set this property to one of the values in FullScreenMode to change the display mode of your application. - - - - - The current height of the screen window in pixels (Read Only). - - - - - Should the cursor be locked? - - - - - Specifies logical orientation of the screen. - - - - - All full-screen resolutions supported by the monitor (Read Only). - - - - - Returns the safe area of the screen in pixels (Read Only). - - - - - Should the cursor be visible? - - - - - A power saving setting, allowing the screen to dim some time after the last active user interaction. - - - - - The current width of the screen window in pixels (Read Only). - - - - - Switches the screen resolution. - - - - - - - - - - Switches the screen resolution. - - - - - - - - - - Switches the screen resolution. - - - - - - - - - - Functionality to take Screenshots. - - - - - Captures a screenshot at path filename as a PNG file. - - Pathname to save the screenshot file to. - Factor by which to increase resolution. - Specifies the eye texture to capture when stereo rendering is enabled. - - - - Captures a screenshot at path filename as a PNG file. - - Pathname to save the screenshot file to. - Factor by which to increase resolution. - Specifies the eye texture to capture when stereo rendering is enabled. - - - - Captures a screenshot of the game view into a Texture2D object. - - Factor by which to increase resolution. - Specifies the eye texture to capture when stereo rendering is enabled. - - - - Captures a screenshot of the game view into a Texture2D object. - - Factor by which to increase resolution. - Specifies the eye texture to capture when stereo rendering is enabled. - - - - Captures a screenshot of the game view into a RenderTexture object. - - RenderTexture that will get filled with the screen content. - - - - Enumeration specifying the eye texture to capture when using ScreenCapture.CaptureScreenshot and when stereo rendering is enabled. - - - - - Both the left and right eyes are captured and composited into one image. - - - - - The Left Eye is captured. This is the default setting for the CaptureScreenshot method. - - - - - The Right Eye is captured. - - - - - Describes screen orientation. - - - - - Auto-rotates the screen as necessary toward any of the enabled orientations. - - - - - Landscape orientation, counter-clockwise from the portrait orientation. - - - - - Landscape orientation, clockwise from the portrait orientation. - - - - - Portrait orientation. - - - - - Portrait orientation, upside down. - - - - - A class you can derive from if you want to create objects that don't need to be attached to game objects. - - - - - Creates an instance of a scriptable object. - - The type of the ScriptableObject to create, as the name of the type. - The type of the ScriptableObject to create, as a System.Type instance. - - The created ScriptableObject. - - - - - Creates an instance of a scriptable object. - - The type of the ScriptableObject to create, as the name of the type. - The type of the ScriptableObject to create, as a System.Type instance. - - The created ScriptableObject. - - - - - Creates an instance of a scriptable object. - - - The created ScriptableObject. - - - - - Ensure an assembly is always processed during managed code stripping. - - - - - API to control the garbage collector on the Mono and IL2CPP scripting backends. - - - - - The target duration of a collection step when performing incremental garbage collection. - - - - - Reports whether incremental garbage collection is enabled. - - - - - Perform incremental garbage collection for the duration specified by the nanoseconds parameter. - - The maximum number of nanoseconds to spend in garbage collection. - - Returns true if additional garbage collection work remains when the method returns and false if garbage collection is complete. Also returns false if incremental garbage collection is not enabled or is not supported on the current platform. - - - - - Set and get global garbage collector operation mode. - - - - - Subscribe to this event to get notified when GarbageCollector.GCMode changes. - - - - - - Garbage collector operation mode. - - - - - Disable garbage collector. - - - - - Enable garbage collector. - - - - - Disable automatic invokations of the garbage collector, but allow manually invokations. - - - - - PreserveAttribute prevents byte code stripping from removing a class, method, field, or property. - - - - - Only allowed on attribute types. If the attribute type is marked, then so too will all CustomAttributes of that type. - - - - - When the type is marked, all types derived from that type will also be marked. - - - - - When a type is marked, all interface implementations of the specified types will be marked. - - - - - When a type is marked, all of it's members with [RequiredMember] will be marked. - - - - - When the interface type is marked, all types implementing that interface will be marked. - - - - - A class attribute that allows you to define label constraints on a MonoBehavior or ScriptableObject's field in the object selector. - - - - - The labels to match. - - - - - Boolean that indicates whether all labels, or only one of them, should match. Default is true. - - - - - Constructor used to declare the SearchService.ObjectSelectorHandlerWithLabelsAttribute on a field. - - An array of strings that represents the different labels to use as constraints. - This parameter specifies whether all labels must match, or only one of them must be present. - - - - Constructor used to declare the SearchService.ObjectSelectorHandlerWithLabelsAttribute on a field. - - An array of strings that represents the different labels to use as constraints. - This parameter specifies whether all labels must match, or only one of them must be present. - - - - A class attribute that allows you to define tag constraints on a MonoBehavior or ScriptableObject's field in the object selector. - - - - - The tags to match. Because a GameObject can only have one tag, only one of them must be present. - - - - - Constructor used to declare the SearchService.ObjectSelectorHandlerWithTagsAttribute on a field. - - An array of strings that represents the different tags to use as constraints. - - - - Encapsulates a Texture2D and its shader property name to give Sprite-based renderers access to a secondary texture, in addition to the main Sprite texture. - - - - - The shader property name of the secondary Sprite texture. Use this name to identify and sample the texture in the shader. - - - - - The texture to be used as a secondary Sprite texture. - - - - - Webplayer security related class. Not supported from 5.4.0 onwards. - - - - - Loads an assembly and checks that it is allowed to be used in the webplayer. (Web Player is no Longer Supported). - - Assembly to verify. - Public key used to verify assembly. - - Loaded, verified, assembly, or null if the assembly cannot be verfied. - - - - - Loads an assembly and checks that it is allowed to be used in the webplayer. (Web Player is no Longer Supported). - - Assembly to verify. - Public key used to verify assembly. - - Loaded, verified, assembly, or null if the assembly cannot be verfied. - - - - - Prefetch the webplayer socket security policy from a non-default port number. - - IP address of server. - Port from where socket policy is read. - Time to wait for response. - - - - Prefetch the webplayer socket security policy from a non-default port number. - - IP address of server. - Port from where socket policy is read. - Time to wait for response. - - - - Add this attribute to a script class to mark its GameObject as a selection base object for Scene View picking. - - - - - Options for how to send a message. - - - - - No receiver is required for SendMessage. - - - - - A receiver is required for SendMessage. - - - - - Use this attribute to rename a field without losing its serialized value. - - - - - The name of the field before the rename. - - - - - - - The name of the field before renaming. - - - - Force Unity to serialize a private field. - - - - - Instruct Unity to serialize a field as a reference. - - - - - Shader scripts used for all rendering. - - - - - Shader LOD level for all shaders. - - - - - Render pipeline currently in use. - - - - - Shader hardware tier classification for current device. - - - - - Can this shader run on the end-users graphics card? (Read Only) - - - - - Shader LOD level for this shader. - - - - - Returns the number of shader passes on the active SubShader. - - - - - Render queue of this shader. (Read Only) - - - - - Unset a global shader keyword. - - - - - - Set a global shader keyword. - - - - - - Finds a shader with the given name. - - - - - - Search for the pass tag specified by tagName on the shader's active SubShader and returns the value of the tag. - - The index of the pass. - The name of the pass tag. - - - - Finds the index of a shader property by its name. - - The name of the shader property. - - - - Find the name of a texture stack a texture belongs too. - - Index of the property. - On exit, contanis the name of the stack if one was found. - On exit, contains the stack layer index of the texture property. - - True, if a stack was found for the given texture property, false if not. - - - - - Returns the dependency shader. - - The name of the dependency to query. - - - - Gets a global color property for all shaders previously set using SetGlobalColor. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Gets a global color property for all shaders previously set using SetGlobalColor. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Gets a global float property for all shaders previously set using SetGlobalFloat. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Gets a global float property for all shaders previously set using SetGlobalFloat. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Gets a global float array for all shaders previously set using SetGlobalFloatArray. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Gets a global float array for all shaders previously set using SetGlobalFloatArray. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Fetches a global float array into a list. - - The list to hold the returned array. - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Fetches a global float array into a list. - - The list to hold the returned array. - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Gets a global int property for all shaders previously set using SetGlobalInt. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Gets a global int property for all shaders previously set using SetGlobalInt. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Gets a global matrix property for all shaders previously set using SetGlobalMatrix. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Gets a global matrix property for all shaders previously set using SetGlobalMatrix. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Gets a global matrix array for all shaders previously set using SetGlobalMatrixArray. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Gets a global matrix array for all shaders previously set using SetGlobalMatrixArray. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Fetches a global matrix array into a list. - - The list to hold the returned array. - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Fetches a global matrix array into a list. - - The list to hold the returned array. - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Gets a global texture property for all shaders previously set using SetGlobalTexture. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Gets a global texture property for all shaders previously set using SetGlobalTexture. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Gets a global vector property for all shaders previously set using SetGlobalVector. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Gets a global vector property for all shaders previously set using SetGlobalVector. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Gets a global vector array for all shaders previously set using SetGlobalVectorArray. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Gets a global vector array for all shaders previously set using SetGlobalVectorArray. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Fetches a global vector array into a list. - - The list to hold the returned array. - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Fetches a global vector array into a list. - - The list to hold the returned array. - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Returns an array of strings containing attributes of the shader property at the specified index. - - The index of the shader property. - - - - Returns the number of properties in this Shader. - - - - - Returns the default float value of the shader property at the specified index. - - The index of the shader property. - - - - Returns the default Vector4 value of the shader property at the specified index. - - The index of the shader property. - - - - Returns the description string of the shader property at the specified index. - - The index of the shader property. - - - - Returns the ShaderPropertyFlags of the shader property at the specified index. - - The index of the shader property. - - - - Returns the name of the shader property at the specified index. - - The index of the shader property. - - - - Returns the nameId of the shader property at the specified index. - - The index of the shader property. - - - - Returns the min and max limits for a <a href="Rendering.ShaderPropertyType.Range.html">Range</a> property at the specified index. - - The index of the shader property. - - - - Returns the default Texture name of a <a href="Rendering.ShaderPropertyType.Texture.html">Texture</a> shader property at the specified index. - - The index of the shader property. - - - - Returns the TextureDimension of a <a href="Rendering.ShaderPropertyType.Texture.html">Texture</a> shader property at the specified index. - - The index of the shader property. - - - - Returns the ShaderPropertyType of the property at the specified index. - - The index of the shader property. - - - - Is global shader keyword enabled? - - - - - - Gets unique identifier for a shader property name. - - Shader property name. - - Unique integer for the name. - - - - - Sets a global buffer property for all shaders. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - The buffer to set. - - - - Sets a global buffer property for all shaders. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - The buffer to set. - - - - Sets a global buffer property for all shaders. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - The buffer to set. - - - - Sets a global buffer property for all shaders. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - The buffer to set. - - - - Sets a global color property for all shaders. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - - Sets a global color property for all shaders. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - - Sets a ComputeBuffer or GraphicsBuffer as a named constant buffer for all shader types. - - The name ID of the constant buffer retrieved by Shader.PropertyToID. - The name of the constant buffer to override. - The buffer to override the constant buffer values with, or null to remove binding. - Offset in bytes from the beginning of the buffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0. - The number of bytes to bind. - - - - Sets a ComputeBuffer or GraphicsBuffer as a named constant buffer for all shader types. - - The name ID of the constant buffer retrieved by Shader.PropertyToID. - The name of the constant buffer to override. - The buffer to override the constant buffer values with, or null to remove binding. - Offset in bytes from the beginning of the buffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0. - The number of bytes to bind. - - - - Sets a ComputeBuffer or GraphicsBuffer as a named constant buffer for all shader types. - - The name ID of the constant buffer retrieved by Shader.PropertyToID. - The name of the constant buffer to override. - The buffer to override the constant buffer values with, or null to remove binding. - Offset in bytes from the beginning of the buffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0. - The number of bytes to bind. - - - - Sets a ComputeBuffer or GraphicsBuffer as a named constant buffer for all shader types. - - The name ID of the constant buffer retrieved by Shader.PropertyToID. - The name of the constant buffer to override. - The buffer to override the constant buffer values with, or null to remove binding. - Offset in bytes from the beginning of the buffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0. - The number of bytes to bind. - - - - Sets a global float property for all shaders. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - - Sets a global float property for all shaders. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - - Sets a global float array property for all shaders. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - - Sets a global float array property for all shaders. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - - Sets a global float array property for all shaders. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - - Sets a global float array property for all shaders. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - - Sets a global int property for all shaders. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - - Sets a global int property for all shaders. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - - Sets a global matrix property for all shaders. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - - Sets a global matrix property for all shaders. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - - Sets a global matrix array property for all shaders. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - - Sets a global matrix array property for all shaders. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - - Sets a global matrix array property for all shaders. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - - Sets a global matrix array property for all shaders. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - - Sets a global texture property for all shaders. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - The texture to set. - Optional parameter that specifies the type of data to set from the RenderTexture. - - - - Sets a global texture property for all shaders. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - The texture to set. - Optional parameter that specifies the type of data to set from the RenderTexture. - - - - Sets a global texture property for all shaders. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - The texture to set. - Optional parameter that specifies the type of data to set from the RenderTexture. - - - - Sets a global texture property for all shaders. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - The texture to set. - Optional parameter that specifies the type of data to set from the RenderTexture. - - - - Sets a global vector property for all shaders. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - - Sets a global vector property for all shaders. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - - Sets a global vector array property for all shaders. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - - Sets a global vector array property for all shaders. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - - Sets a global vector array property for all shaders. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - - Sets a global vector array property for all shaders. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - - Fully load all shaders to prevent future performance hiccups. - - - - - ShaderVariantCollection records which shader variants are actually used in each shader. - - - - - Is this ShaderVariantCollection already warmed up? (Read Only) - - - - - Number of shaders in this collection (Read Only). - - - - - Number of total varians in this collection (Read Only). - - - - - Adds a new shader variant to the collection. - - Shader variant to add. - - False if already in the collection. - - - - - Remove all shader variants from the collection. - - - - - Checks if a shader variant is in the collection. - - Shader variant to check. - - True if the variant is in the collection. - - - - - Create a new empty shader variant collection. - - - - - Adds shader variant from the collection. - - Shader variant to add. - - False if was not in the collection. - - - - - Identifies a specific variant of a shader. - - - - - Array of shader keywords to use in this variant. - - - - - Pass type to use in this variant. - - - - - Shader to use in this variant. - - - - - Creates a ShaderVariant structure. - - - - - - - - Fully load shaders in ShaderVariantCollection. - - - - - The rendering mode of Shadowmask. - - - - - Static shadow casters will be rendered into realtime shadow maps. Shadowmasks and occlusion from Light Probes will only be used past the realtime shadow distance. - - - - - Static shadow casters won't be rendered into realtime shadow maps. All shadows from static casters are handled via Shadowmasks and occlusion from Light Probes. - - - - - Shadow projection type for. - - - - - Close fit shadow maps with linear fadeout. - - - - - Stable shadow maps with spherical fadeout. - - - - - Determines which type of shadows should be used. - - - - - Hard and Soft Shadows. - - - - - Disable Shadows. - - - - - Hard Shadows Only. - - - - - Default shadow resolution. - - - - - High shadow map resolution. - - - - - Low shadow map resolution. - - - - - Medium shadow map resolution. - - - - - Very high shadow map resolution. - - - - - SharedBetweenAnimatorsAttribute is an attribute that specify that this StateMachineBehaviour should be instantiate only once and shared among all Animator instance. This attribute reduce the memory footprint for each controller instance. - - - - - A selection of modes that control when Unity executes the 2D physics simulation. - - - - - Use this enumeration to specify to Unity that it should execute the physics simulation immediately after the MonoBehaviour.FixedUpdate. - - - - - Use this enumeration to specify to Unity that it should execute the physics simulation manually when you call Physics2D.Simulate. - - - - - Use this enumeration to specify to Unity that it should execute the physics simulation immediately after MonoBehaviour.Update. - - - - - Details of the Transform name mapped to the skeleton bone of a model and its default position and rotation in the T-pose. - - - - - The name of the Transform mapped to the bone. - - - - - The T-pose position of the bone in local space. - - - - - The T-pose rotation of the bone in local space. - - - - - The T-pose scaling of the bone in local space. - - - - - The Skinned Mesh filter. - - - - - The bones used to skin the mesh. - - - - - Forces the Skinned Mesh to recalculate its matricies when rendered - - - - - AABB of this Skinned Mesh in its local space. - - - - - The maximum number of bones per vertex that are taken into account during skinning. - - - - - The mesh used for skinning. - - - - - Specifies whether skinned motion vectors should be used for this renderer. - - - - - If enabled, the Skinned Mesh will be updated when offscreen. If disabled, this also disables updating animations. - - - - - Creates a snapshot of SkinnedMeshRenderer and stores it in mesh. - - A static mesh that will receive the snapshot of the skinned mesh. - Whether to use the SkinnedMeshRenderer's Transform scale when baking the Mesh. If this is true, Unity bakes the Mesh using the position, rotation, and scale values from the SkinnedMeshRenderer's Transform. If this is false, Unity bakes the Mesh using the position and rotation values from the SkinnedMeshRenderer's Transform, but without using the scale value from the SkinnedMeshRenderer's Transform. The default value is false. - - - - Creates a snapshot of SkinnedMeshRenderer and stores it in mesh. - - A static mesh that will receive the snapshot of the skinned mesh. - Whether to use the SkinnedMeshRenderer's Transform scale when baking the Mesh. If this is true, Unity bakes the Mesh using the position, rotation, and scale values from the SkinnedMeshRenderer's Transform. If this is false, Unity bakes the Mesh using the position and rotation values from the SkinnedMeshRenderer's Transform, but without using the scale value from the SkinnedMeshRenderer's Transform. The default value is false. - - - - Returns the weight of a BlendShape for this Renderer. - - The index of the BlendShape whose weight you want to retrieve. Index must be smaller than the Mesh.blendShapeCount of the Mesh attached to this Renderer. - - The weight of the BlendShape. - - - - - Sets the weight of a BlendShape for this Renderer. - - The index of the BlendShape to modify. Index must be smaller than the Mesh.blendShapeCount of the Mesh attached to this Renderer. - The weight for this BlendShape. - - - - The maximum number of bones affecting a single vertex. - - - - - Chooses the number of bones from the number current QualitySettings. (Default) - - - - - Use only 1 bone to deform a single vertex. (The most important bone will be used). - - - - - Use 2 bones to deform a single vertex. (The most important bones will be used). - - - - - Use 4 bones to deform a single vertex. - - - - - Skin weights. - - - - - Four bones affect each vertex. - - - - - One bone affects each vertex. - - - - - Two bones affect each vertex. - - - - - An unlimited number of bones affect each vertex. - - - - - A script interface for the. - - - - - The material used by the skybox. - - - - - Constants for special values of Screen.sleepTimeout. - - - - - Prevent screen dimming. - - - - - Set the sleep timeout to whatever the user has specified in the system settings. - - - - - Joint that restricts the motion of a Rigidbody2D object to a single line. - - - - - The angle of the line in space (in degrees). - - - - - Should the angle be calculated automatically? - - - - - The current joint speed. - - - - - The current joint translation. - - - - - Restrictions on how far the joint can slide in each direction along the line. - - - - - Gets the state of the joint limit. - - - - - Parameters for a motor force that is applied automatically to the Rigibody2D along the line. - - - - - The angle (in degrees) referenced between the two bodies used as the constraint for the joint. - - - - - Should motion limits be used? - - - - - Should a motor force be applied automatically to the Rigidbody2D? - - - - - Gets the motor force of the joint given the specified timestep. - - The time to calculate the motor force for. - - - - Defines the axes that can be snapped. - - - - - Snapping is available on all axes: x, y, and z. - - - - - No axes support snapping. - - - - - Snapping is available only on the \x\ axis. - - - - - Snapping is available only on the \y\ axis. - - - - - Snapping is available only on the \z\ axis. - - - - - Snap values to rounded increments. - - - - - Rounds value to the closest multiple of snap. - - The value to round. - The increment to round to. - - The rounded value. - - - - - Rounds value to the closest multiple of snap. - - The value to round. - The increment to round to. - - The rounded value. - - - - - Rounds value to the closest multiple of snap. - - The value to round. - The increment to round to. - Restrict snapping to the components on these axes. - - The rounded value. - - - - - Generic access to the Social API. - - - - - The local user (potentially not logged in). - - - - - This is the currently active social platform. - - - - - Create an IAchievement instance. - - - - - Create an ILeaderboard instance. - - - - - Loads the achievement descriptions accociated with this application. - - - - - - Load the achievements the logged in user has already achieved or reported progress on. - - - - - - Load a default set of scores from the given leaderboard. - - - - - - - Load the user profiles accociated with the given array of user IDs. - - - - - - - Reports the progress of an achievement. - - - - - - - - Report a score to a specific leaderboard. - - - - - - - - Show a default/system view of the games achievements. - - - - - Show a default/system view of the games leaderboards. - - - - - iOS GameCenter implementation for network services. - - - - - Reset all the achievements for the local user. - - - - - - Show the default iOS banner when achievements are completed. - - - - - - Show the leaderboard UI with a specific leaderboard shown initially with a specific time scope selected. - - - - - - - Information for a user's achievement. - - - - - Set to true when percentCompleted is 100.0. - - - - - This achievement is currently hidden from the user. - - - - - The unique identifier of this achievement. - - - - - Set by server when percentCompleted is updated. - - - - - Progress for this achievement. - - - - - Send notification about progress on this achievement. - - - - - - Static data describing an achievement. - - - - - Description when the achivement is completed. - - - - - Hidden achievement are not shown in the list until the percentCompleted has been touched (even if it's 0.0). - - - - - Unique identifier for this achievement description. - - - - - Image representation of the achievement. - - - - - Point value of this achievement. - - - - - Human readable title. - - - - - Description when the achivement has not been completed. - - - - - The leaderboard contains the scores of all players for a particular game. - - - - - Unique identifier for this leaderboard. - - - - - The leaderboad is in the process of loading scores. - - - - - The leaderboard score of the logged in user. - - - - - The total amount of scores the leaderboard contains. - - - - - The rank range this leaderboard returns. - - - - - The leaderboard scores returned by a query. - - - - - The time period/scope searched by this leaderboard. - - - - - The human readable title of this leaderboard. - - - - - The users scope searched by this leaderboard. - - - - - Load scores according to the filters set on this leaderboard. - - - - - - Only search for these user IDs. - - List of user ids. - - - - Represents the local or currently logged in user. - - - - - Checks if the current user has been authenticated. - - - - - The users friends list. - - - - - Is the user underage? - - - - - Authenticate the local user to the current active Social API implementation and fetch his profile data. - - Callback that is called whenever the authentication operation is finished. The first parameter is a Boolean identifying whether the authentication operation was successful. The optional second argument contains a string identifying any errors (if available) if the operation was unsuccessful. - - - - Authenticate the local user to the current active Social API implementation and fetch his profile data. - - Callback that is called whenever the authentication operation is finished. The first parameter is a Boolean identifying whether the authentication operation was successful. The optional second argument contains a string identifying any errors (if available) if the operation was unsuccessful. - - - - Fetches the friends list of the logged in user. The friends list on the ISocialPlatform.localUser|Social.localUser instance is populated if this call succeeds. - - - - - - Returns the ID provided in the Apple GameKit by GKPlayer.playerID (deprecated and marked obsolete in iOS 12.4). - - - - - A game score. - - - - - The date the score was achieved. - - - - - The correctly formatted value of the score, like X points or X kills. - - - - - The ID of the leaderboard this score belongs to. - - - - - The rank or position of the score in the leaderboard. - - - - - The user who owns this score. - - - - - The score value achieved. - - - - - Report this score instance. - - - - - - The generic Social API interface which implementations must inherit. - - - - - See Social.localUser. - - - - - See Social.CreateAchievement.. - - - - - See Social.CreateLeaderboard. - - - - - See Social.LoadAchievementDescriptions. - - - - - - See Social.LoadAchievements. - - - - - - See Social.LoadScores. - - - - - - - - See Social.LoadScores. - - - - - - - - See Social.LoadUsers. - - - - - - - See Social.ReportProgress. - - - - - - - - See Social.ReportScore. - - - - - - - - See Social.ShowAchievementsUI. - - - - - See Social.ShowLeaderboardUI. - - - - - Represents generic user instances, like friends of the local user. - - - - - This user's global unique identifier. - - - - - Avatar image of the user. - - - - - Is this user a friend of the current logged in user? - - - - - Presence state of the user. - - - - - This user's username or alias. - - - - - The score range a leaderboard query should include. - - - - - The total amount of scores retreived. - - - - - The rank of the first score which is returned. - - - - - Constructor for a score range, the range starts from a specific value and contains a maxium score count. - - The minimum allowed value. - The number of possible values. - - - - The scope of time searched through when querying the leaderboard. - - - - - The scope of the users searched through when querying the leaderboard. - - - - - User presence state. - - - - - The user is offline. - - - - - The user is online. - - - - - The user is online but away from their computer. - - - - - The user is online but set their status to busy. - - - - - The user is playing a game. - - - - - The limits defined by the CharacterJoint. - - - - - When the joint hits the limit, it can be made to bounce off it. - - - - - Determines how far ahead in space the solver can "see" the joint limit. - - - - - If spring is greater than zero, the limit is soft. - - - - - The limit position/angle of the joint (in degrees). - - - - - If greater than zero, the limit is soft. The spring will pull the joint back. - - - - - The configuration of the spring attached to the joint's limits: linear and angular. Used by CharacterJoint and ConfigurableJoint. - - - - - The damping of the spring limit. In effect when the stiffness of the sprint limit is not zero. - - - - - The stiffness of the spring limit. When stiffness is zero the limit is hard, otherwise soft. - - - - - SortingLayer allows you to set the render order of multiple sprites easily. There is always a default SortingLayer named "Default" which all sprites are added to initially. Added more SortingLayers to easily control the order of rendering of groups of sprites. Layers can be ordered before or after the default layer. - - - - - This is the unique id assigned to the layer. It is not an ordered running value and it should not be used to compare with other layers to determine the sorting order. - - - - - Returns all the layers defined in this project. - - - - - Returns the name of the layer as defined in the TagManager. - - - - - This is the relative value that indicates the sort order of this layer relative to the other layers. - - - - - Returns the final sorting layer value. To determine the sorting order between the various sorting layers, use this method to retrieve the final sorting value and use CompareTo to determine the order. - - The unique value of the sorting layer as returned by any renderer's sortingLayerID property. - - The final sorting value of the layer relative to other layers. - - - - - Returns the final sorting layer value. See Also: GetLayerValueFromID. - - The unique value of the sorting layer as returned by any renderer's sortingLayerID property. - - The final sorting value of the layer relative to other layers. - - - - - Returns the unique id of the layer. Will return "<unknown layer>" if an invalid id is given. - - The unique id of the layer. - - The name of the layer with id or "<unknown layer>" for invalid id. - - - - - Returns true if the id provided is a valid layer id. - - The unique id of a layer. - - True if the id provided is valid and assigned to a layer. - - - - - Returns the id given the name. Will return 0 if an invalid name was given. - - The name of the layer. - - The unique id of the layer with name. - - - - - The coordinate space in which to operate. - - - - - Applies transformation relative to the local coordinate system. - - - - - Applies transformation relative to the world coordinate system. - - - - - Use this PropertyAttribute to add some spacing in the Inspector. - - - - - The spacing in pixels. - - - - - Use this DecoratorDrawer to add some spacing in the Inspector. - - The spacing in pixels. - - - - Class for handling Sparse Textures. - - - - - Is the sparse texture actually created? (Read Only) - - - - - Get sparse texture tile height (Read Only). - - - - - Get sparse texture tile width (Read Only). - - - - - Create a sparse texture. - - Texture width in pixels. - Texture height in pixels. - Texture format. - Mipmap count. Pass -1 to create full mipmap chain. - Whether texture data will be in linear or sRGB color space (default is sRGB). - - - - - Create a sparse texture. - - Texture width in pixels. - Texture height in pixels. - Texture format. - Mipmap count. Pass -1 to create full mipmap chain. - Whether texture data will be in linear or sRGB color space (default is sRGB). - - - - - Unload sparse texture tile. - - Tile X coordinate. - Tile Y coordinate. - Mipmap level of the texture. - - - - Update sparse texture tile with color values. - - Tile X coordinate. - Tile Y coordinate. - Mipmap level of the texture. - Tile color data. - - - - Update sparse texture tile with raw pixel values. - - Tile X coordinate. - Tile Y coordinate. - Mipmap level of the texture. - Tile raw pixel data. - - - - Use this struct to set up a sphere cast command that is performed asynchronously during a job. - - - - - The direction of the sphere cast. - - - - - The maximum distance the sphere should check for collisions. - - - - - The LayerMask that selectively ignores Colliders when casting a sphere. - - - - - The starting point of the sphere cast in world coordinates. - - - - - The radius of the casting sphere. - - - - - Creates a SpherecastCommand. - - The starting point of the sphere cast. - The radius of the casting sphere. - The direction of the sphere cast. - The maximum distance the cast should check for collisions. - The LayerMask that selectively ignores Colliders when casting a sphere. - - - - Schedules a batch of sphere casts to perform in a job. - - A NaviveArray of SpherecastCommands to perform. - A NavtiveArray of RaycastHit where the result of commands are stored. - The minimum number of jobs which should be performed in a single job. - A jobHandle of the job that must be completed before performing the sphere casts. - - Returns a JobHandle of the job that will perform the sphere casts. - - - - - A sphere-shaped primitive collider. - - - - - The center of the sphere in the object's local space. - - - - - The radius of the sphere measured in the object's local space. - - - - - A Splat prototype is just a texture that is used by the TerrainData. - - - - - The metallic value of the splat layer. - - - - - Normal map of the splat applied to the Terrain. - - - - - The smoothness value of the splat layer when the main texture has no alpha channel. - - - - - Texture of the splat applied to the Terrain. - - - - - Offset of the tile texture of the SplatPrototype. - - - - - Size of the tile used in the texture of the SplatPrototype. - - - - - The spring joint ties together 2 rigid bodies, spring forces will be automatically applied to keep the object at the given distance. - - - - - The damper force used to dampen the spring force. - - - - - The maximum distance between the bodies relative to their initial distance. - - - - - The minimum distance between the bodies relative to their initial distance. - - - - - The spring force used to keep the two objects together. - - - - - The maximum allowed error between the current spring length and the length defined by minDistance and maxDistance. - - - - - Joint that attempts to keep two Rigidbody2D objects a set distance apart by applying a force between them. - - - - - Should the distance be calculated automatically? - - - - - The amount by which the spring force is reduced in proportion to the movement speed. - - - - - The distance the spring will try to keep between the two objects. - - - - - The frequency at which the spring oscillates around the distance distance between the objects. - - - - - Represents a Sprite object for use in 2D gameplay. - - - - - Returns the texture that contains the alpha channel from the source texture. Unity generates this texture under the hood for sprites that have alpha in the source, and need to be compressed using techniques like ETC1. - -Returns NULL if there is no associated alpha texture for the source sprite. This is the case if the sprite has not been setup to use ETC1 compression. - - - - - Returns the border sizes of the sprite. - - - - - Bounds of the Sprite, specified by its center and extents in world space units. - - - - - Returns true if this Sprite is packed in an atlas. - - - - - If Sprite is packed (see Sprite.packed), returns its SpritePackingMode. - - - - - If Sprite is packed (see Sprite.packed), returns its SpritePackingRotation. - - - - - Location of the Sprite's center point in the Rect on the original Texture, specified in pixels. - - - - - The number of pixels in the sprite that correspond to one unit in world space. (Read Only) - - - - - Location of the Sprite on the original Texture, specified in pixels. - - - - - The Variant scale of texture used by the Sprite. This is useful to check when a Variant SpriteAtlas is being used by Sprites. - - - - - Get the reference to the used texture. If packed this will point to the atlas, if not packed will point to the source sprite. - - - - - Get the rectangle this sprite uses on its texture. Raises an exception if this sprite is tightly packed in an atlas. - - - - - Gets the offset of the rectangle this sprite uses on its texture to the original sprite bounds. If sprite mesh type is FullRect, offset is zero. - - - - - Returns a copy of the array containing sprite mesh triangles. - - - - - The base texture coordinates of the sprite mesh. - - - - - Returns a copy of the array containing sprite mesh vertex positions. - - - - - Create a new Sprite object. - - Texture from which to obtain the sprite graphic. - Rectangular section of the texture to use for the sprite. - Sprite's pivot point relative to its graphic rectangle. - The number of pixels in the sprite that correspond to one unit in world space. - Amount by which the sprite mesh should be expanded outwards. - Controls the type of mesh generated for the sprite. - The border sizes of the sprite (X=left, Y=bottom, Z=right, W=top). - Generates a default physics shape for the sprite. - - - - Create a new Sprite object. - - Texture from which to obtain the sprite graphic. - Rectangular section of the texture to use for the sprite. - Sprite's pivot point relative to its graphic rectangle. - The number of pixels in the sprite that correspond to one unit in world space. - Amount by which the sprite mesh should be expanded outwards. - Controls the type of mesh generated for the sprite. - The border sizes of the sprite (X=left, Y=bottom, Z=right, W=top). - Generates a default physics shape for the sprite. - - - - Create a new Sprite object. - - Texture from which to obtain the sprite graphic. - Rectangular section of the texture to use for the sprite. - Sprite's pivot point relative to its graphic rectangle. - The number of pixels in the sprite that correspond to one unit in world space. - Amount by which the sprite mesh should be expanded outwards. - Controls the type of mesh generated for the sprite. - The border sizes of the sprite (X=left, Y=bottom, Z=right, W=top). - Generates a default physics shape for the sprite. - - - - Create a new Sprite object. - - Texture from which to obtain the sprite graphic. - Rectangular section of the texture to use for the sprite. - Sprite's pivot point relative to its graphic rectangle. - The number of pixels in the sprite that correspond to one unit in world space. - Amount by which the sprite mesh should be expanded outwards. - Controls the type of mesh generated for the sprite. - The border sizes of the sprite (X=left, Y=bottom, Z=right, W=top). - Generates a default physics shape for the sprite. - - - - Create a new Sprite object. - - Texture from which to obtain the sprite graphic. - Rectangular section of the texture to use for the sprite. - Sprite's pivot point relative to its graphic rectangle. - The number of pixels in the sprite that correspond to one unit in world space. - Amount by which the sprite mesh should be expanded outwards. - Controls the type of mesh generated for the sprite. - The border sizes of the sprite (X=left, Y=bottom, Z=right, W=top). - Generates a default physics shape for the sprite. - - - - Create a new Sprite object. - - Texture from which to obtain the sprite graphic. - Rectangular section of the texture to use for the sprite. - Sprite's pivot point relative to its graphic rectangle. - The number of pixels in the sprite that correspond to one unit in world space. - Amount by which the sprite mesh should be expanded outwards. - Controls the type of mesh generated for the sprite. - The border sizes of the sprite (X=left, Y=bottom, Z=right, W=top). - Generates a default physics shape for the sprite. - - - - Gets a physics shape from the Sprite by its index. - - The index of the physics shape to retrieve. - An ordered list of the points in the selected physics shape to store points in. - - The number of points stored in the given list. - - - - - The number of physics shapes for the Sprite. - - - The number of physics shapes for the Sprite. - - - - - The number of points in the selected physics shape for the Sprite. - - The index of the physics shape to retrieve the number of points from. - - The number of points in the selected physics shape for the Sprite. - - - - - Sets up new Sprite geometry. - - Array of vertex positions in Sprite Rect space. - Array of sprite mesh triangle indices. - - - - Sets up a new Sprite physics shape. - - A multidimensional list of points in Sprite.rect space denoting the physics shape outlines. - - - - How a Sprite's graphic rectangle is aligned with its pivot point. - - - - - Pivot is at the center of the bottom edge of the graphic rectangle. - - - - - Pivot is at the bottom left corner of the graphic rectangle. - - - - - Pivot is at the bottom right corner of the graphic rectangle. - - - - - Pivot is at the center of the graphic rectangle. - - - - - Pivot is at a custom position within the graphic rectangle. - - - - - Pivot is at the center of the left edge of the graphic rectangle. - - - - - Pivot is at the center of the right edge of the graphic rectangle. - - - - - Pivot is at the center of the top edge of the graphic rectangle. - - - - - Pivot is at the top left corner of the graphic rectangle. - - - - - Pivot is at the top right corner of the graphic rectangle. - - - - - SpriteRenderer draw mode. - - - - - Displays the full sprite. - - - - - The SpriteRenderer will render the sprite as a 9-slice image where the corners will remain constant and the other sections will scale. - - - - - The SpriteRenderer will render the sprite as a 9-slice image where the corners will remain constant and the other sections will tile. - - - - - A component for masking Sprites and Particles. - - - - - The minimum alpha value used by the mask to select the area of influence defined over the mask's sprite. - - - - - Unique ID of the sorting layer defining the end of the custom range. - - - - - Order within the back sorting layer defining the end of the custom range. - - - - - Unique ID of the sorting layer defining the start of the custom range. - - - - - Order within the front sorting layer defining the start of the custom range. - - - - - Mask sprites from front to back sorting values only. - - - - - The Sprite used to define the mask. - - - - - Determines the position of the Sprite used for sorting the SpriteMask. - - - - - This enum controls the mode under which the sprite will interact with the masking system. - - - - - The sprite will not interact with the masking system. - - - - - The sprite will be visible only in areas where a mask is present. - - - - - The sprite will be visible only in areas where no mask is present. - - - - - Defines the type of mesh generated for a sprite. - - - - - Rectangle mesh equal to the user specified sprite size. - - - - - Tight mesh based on pixel alpha values. As many excess pixels are cropped as possible. - - - - - Sprite packing modes for the Sprite Packer. - - - - - Alpha-cropped ractangle packing. - - - - - Tight mesh based packing. - - - - - Sprite rotation modes for the Sprite Packer. - - - - - Any rotation. - - - - - Sprite is flipped horizontally when packed. - - - - - Sprite is flipped vertically when packed. - - - - - No rotation. - - - - - Sprite is rotated 180 degree when packed. - - - - - Renders a Sprite for 2D graphics. - - - - - The current threshold for Sprite Renderer tiling. - - - - - Rendering color for the Sprite graphic. - - - - - The current draw mode of the Sprite Renderer. - - - - - Flips the sprite on the X axis. - - - - - Flips the sprite on the Y axis. - - - - - Specifies how the sprite interacts with the masks. - - - - - Property to set/get the size to render when the SpriteRenderer.drawMode is set to SpriteDrawMode.Sliced. - - - - - The Sprite to render. - - - - - Determines the position of the Sprite used for sorting the SpriteRenderer. - - - - - The current tile mode of the Sprite Renderer. - - - - - Helper utilities for accessing Sprite data. - - - - - Inner UV's of the Sprite. - - - - - - Minimum width and height of the Sprite. - - - - - - Outer UV's of the Sprite. - - - - - - Return the padding on the sprite. - - - - - - Determines the position of the Sprite used for sorting the Renderer. - - - - - The center of the Sprite is used as the point for sorting the Renderer. - - - - - The pivot of the Sprite is used as the point for sorting the Renderer. - - - - - Tiling mode for SpriteRenderer.tileMode. - - - - - Sprite Renderer tiles the sprite once the Sprite Renderer size is above SpriteRenderer.adaptiveModeThreshold. - - - - - Sprite Renderer tiles the sprite continuously when is set to SpriteRenderer.tileMode. - - - - - Stack trace logging options. - - - - - Native and managed stack trace will be logged. - - - - - No stack trace will be outputed to log. - - - - - Only managed stack trace will be outputed. - - - - - StateMachineBehaviour is a component that can be added to a state machine state. It's the base class every script on a state derives from. - - - - - Called on the first Update frame when a state machine evaluate this state. - - - - - Called on the last update frame when a state machine evaluate this state. - - - - - Called right after MonoBehaviour.OnAnimatorIK. - - - - - Called on the first Update frame when making a transition to a state machine. This is not called when making a transition into a state machine sub-state. - - The Animator playing this state machine. - The full path hash for this state machine. - - - - Called on the last Update frame when making a transition out of a StateMachine. This is not called when making a transition into a StateMachine sub-state. - - The Animator playing this state machine. - The full path hash for this state machine. - - - - Called right after MonoBehaviour.OnAnimatorMove. - - - - - Called at each Update frame except for the first and last frame. - - - - - StaticBatchingUtility can prepare your objects to take advantage of Unity's static batching. - - - - - StaticBatchingUtility.Combine prepares all children of the staticBatchRoot for static batching. - - The GameObject that should become the root of the combined batch. - - - - StaticBatchingUtility.Combine prepares all GameObjects contained in gos for static batching. staticBatchRoot is treated as their parent. - - The GameObjects to prepare for static batching. - The GameObject that should become the root of the combined batch. - - - - Enum values for the Camera's targetEye property. - - - - - Render both eyes to the HMD. - - - - - Render only the Left eye to the HMD. - - - - - Do not render either eye to the HMD. - - - - - Render only the right eye to the HMD. - - - - - A StreamingController controls the streaming settings for an individual camera location. - - - - - Offset applied to the mipmap level chosen by the texture streaming system for any textures visible from this camera. This Offset can take either a positive or negative value. - - - - - Abort preloading. - - - - - Used to find out whether the StreamingController is currently preloading texture mipmaps. - - - True if in a preloading state, otherwise False. - - - - - Initiate preloading of streaming data for this camera. - - Optional timeout before stopping preloading. Set to 0.0f when no timeout is required. - Set to True to activate the connected Camera component when timeout expires. - Camera to deactivate on timeout (if Camera.activateCameraOnTime is True). This parameter can be null. - - - - A Subsystem is initialized from a SubsystemDescriptorWithProvider for a given Subsystem (Example, Input, Display, etc.) and provides an interface to interact with that given Subsystem until it is Destroyed. After a Subsystem is created it can be Started or Stopped to turn on and off functionality (and improve performance). The base type for subsystems only exposes this functionality; this class is designed to be a base class for derived classes that expose more functionality specific to a given Subsystem. - - Note: initializing a second Subsystem from the same SubsystemDescriptor will return a reference to the existing Subsystem as only one Subsystem is currently allowed for a single Subsystem provider. - -This subsystem base-class is deprecated. If you are creating a new subsystem type, derive from SubsystemWithProvider instead. - - - - - Whether or not the subsystem is running. - - - - - Destroys this instance of a subsystem. - - - - - Starts an instance of a subsystem. - - - - - Stops an instance of a subsystem. - - - - - Information about a subsystem that can be queried before creating a subsystem instance. - -This subsystem descriptor base-class is deprecated. If you are creating a new subsystem type, derive from SubsystemDecriptorWithProvider instead. - - - - - A unique string that identifies the subsystem that this Descriptor can create. - - - - - The System.Type of the subsystem implementation associated with this descriptor. - - - - - Gives access to subsystems which provide additional functionality through plugins. - - - - - Called from SubsystemManager when it has completed reloading all XR SDK Provider packaged subsystems. - - - - - - Called from SubsystemManager before reloading all XR SDK Provider packaged subsystems. - - - - - - Called from SubsystemManager when it has completed reloading all XR SDK Provider packaged subsystems. - - - - - - Called from SubsystemManager before reloading all XR SDK Provider packaged subsystems. - - - - - - Gets all of the currently known subsystem descriptors regardless of specific subsystem type. - - Subsystem descriptors. - - - - Returns active Subsystems of a specific instance type. - -*Note:* This method is deprecated, use GetSubsystems instead. - - Active instances. - - - - - Returns a list of SubsystemDescriptors which describe additional functionality that can be enabled. - - Subsystem specific descriptors. - - - - Returns active Subsystems of a specific instance type. - - Active subsystems. - - - - Registration entry point for subsystems to register their descriptor. - - - - - Information about a SubsystemWithProvider that can be queried before creating a subsystem instance. - - - - - A unique string that identifies the SubsystemWithProvider that this descriptor can create. - - - - - A provider that supplies data to a subsystem, generally for platform-specific implementations. - - - - - A subsystem is initialized from a SubsystemDescriptorWithProvider for a given subsystem (Session, Plane, Face, etc.) and provides an interface to interact with that given subsystem until it is Destroyed. After a subsystem is created, it can be Started or Stopped to turn on and off functionality and preserve performance. The base type for the subsystem only exposes this functionality; this class is designed to be a base class for derived classes that expose more functionality specific to a given subsystem. - -*Note:* Initializing a second subsystem from the same subsystem descriptor will return a reference to the existing subsystem, because only one subsystem is currently allowed for a single subsystem provider. - - - - - Whether or not the subsystem is running. - -This returns true after Start has been called on the subsystem, and false after Stop is called. - - - - - Destroys this instance of a subsystem. - -Also unloads all resources acquired during the initialization step. Call this when you no longer need this instance of a subsystem. - -Note: Once a subsystem is Destroyed, script can still hold a reference but calling a method on it will result in a NullArgumentException. - - - - - Starts an instance of a subsystem. - -Once the instance is started, the subsystem representing this instance is active and can be interacted with. - - - - - Stops an instance of a subsystem. - -Once the instance is stopped, the subsystem representing this instance is no longer active and should not consume CPU resources. - - - - - Applies tangent forces along the surfaces of colliders. - - - - - The scale of the impulse force applied while attempting to reach the surface speed. - - - - - The speed to be maintained along the surface. - - - - - The speed variation (from zero to the variation) added to base speed to be applied. - - - - - Should bounce be used for any contact with the surface? - - - - - Should the impulse force but applied to the contact point? - - - - - Should friction be used for any contact with the surface? - - - - - Access system and hardware information. - - - - - The current battery level (Read Only). - - - - - Returns the current status of the device's battery (Read Only). - - - - - Minimum buffer offset (in bytes) when binding a constant buffer using Shader.SetConstantBuffer or Material.SetConstantBuffer. - - - - - Support for various Graphics.CopyTexture cases (Read Only). - - - - - The model of the device (Read Only). - - - - - The user defined name of the device (Read Only). - - - - - Returns the kind of device the application is running on (Read Only). - - - - - A unique device identifier. It is guaranteed to be unique for every device (Read Only). - - - - - The identifier code of the graphics device (Read Only). - - - - - The name of the graphics device (Read Only). - - - - - The graphics API type used by the graphics device (Read Only). - - - - - The vendor of the graphics device (Read Only). - - - - - The identifier code of the graphics device vendor (Read Only). - - - - - The graphics API type and driver version used by the graphics device (Read Only). - - - - - Amount of video memory present (Read Only). - - - - - Is graphics device using multi-threaded rendering (Read Only)? - - - - - Graphics device shader capability level (Read Only). - - - - - Returns true if the texture UV coordinate convention for this platform has Y starting at the top of the image. - - - - - Returns true when the GPU has native support for indexing uniform arrays in fragment shaders without restrictions. - - - - - True if the GPU supports hidden surface removal. - - - - - Returns true if the GPU supports partial mipmap chains (Read Only). - - - - - Returns a bitwise combination of HDRDisplaySupportFlags describing the support for HDR displays on the system. - - - - - Determines how many compute buffers Unity supports simultaneously in a compute shader for reading. (Read Only) - - - - - Determines how many compute buffers Unity supports simultaneously in a domain shader for reading. (Read Only) - - - - - Determines how many compute buffers Unity supports simultaneously in a fragment shader for reading. (Read Only) - - - - - Determines how many compute buffers Unity supports simultaneously in a geometry shader for reading. (Read Only) - - - - - Determines how many compute buffers Unity supports simultaneously in a hull shader for reading. (Read Only) - - - - - Determines how many compute buffers Unity supports simultaneously in a vertex shader for reading. (Read Only) - - - - - The largest total number of invocations in a single local work group that can be dispatched to a compute shader (Read Only). - - - - - The maximum number of work groups that a compute shader can use in X dimension (Read Only). - - - - - The maximum number of work groups that a compute shader can use in Y dimension (Read Only). - - - - - The maximum number of work groups that a compute shader can use in Z dimension (Read Only). - - - - - Maximum Cubemap texture size (Read Only). - - - - - Maximum texture size (Read Only). - - - - - Obsolete - use SystemInfo.constantBufferOffsetAlignment instead. Minimum buffer offset (in bytes) when binding a constant buffer using Shader.SetConstantBuffer or Material.SetConstantBuffer. - - - - - What NPOT (non-power of two size) texture support does the GPU provide? (Read Only) - - - - - Operating system name with version (Read Only). - - - - - Returns the operating system family the game is running on (Read Only). - - - - - Number of processors present (Read Only). - - - - - Processor frequency in MHz (Read Only). - - - - - Processor name (Read Only). - - - - - Application's actual rendering threading mode (Read Only). - - - - - The maximum number of random write targets (UAV) that Unity supports simultaneously. (Read Only) - - - - - How many simultaneous render targets (MRTs) are supported? (Read Only) - - - - - Are 2D Array textures supported? (Read Only) - - - - - Are 32-bit index buffers supported? (Read Only) - - - - - Are 3D (volume) RenderTextures supported? (Read Only) - - - - - Are 3D (volume) textures supported? (Read Only) - - - - - Is an accelerometer available on the device? - - - - - Returns true when the platform supports asynchronous compute queues and false if otherwise. - - - - - Returns true if asynchronous readback of GPU data is available for this device and false otherwise. - - - - - Is there an Audio device available for playback? (Read Only) - - - - - Are compressed formats for 3D (volume) textures supported? (Read Only). - - - - - Are compute shaders supported? (Read Only) - - - - - Is conservative rasterization supported? (Read Only) - - - - - Are Cubemap Array textures supported? (Read Only) - - - - - Are geometry shaders supported? (Read Only) - - - - - This functionality is deprecated, and should no longer be used. Please use SystemInfo.supportsGraphicsFence. - - - - - Specifies whether the current platform supports the GPU Recorder or not. (Read Only). - - - - - Returns true when the platform supports GraphicsFences, and false if otherwise. - - - - - Is a gyroscope available on the device? - - - - - Does the hardware support quad topology? (Read Only) - - - - - Are image effects supported? (Read Only) - - - - - Is GPU draw call instancing supported? (Read Only) - - - - - Is the device capable of reporting its location? - - - - - Is streaming of texture mip maps supported? (Read Only) - - - - - Whether motion vectors are supported on this platform. - - - - - Returns true if multisampled textures are resolved automatically - - - - - Boolean that indicates whether multisampled texture arrays are supported (true if supported, false if not supported). - - - - - Are multisampled textures supported? (Read Only) - - - - - Boolean that indicates whether Multiview is supported (true if supported, false if not supported). (Read Only) - - - - - Is sampling raw depth from shadowmaps supported? (Read Only) - - - - - Checks if ray tracing is supported by the current configuration. - - - - - Boolean that indicates if SV_RenderTargetArrayIndex can be used in a vertex shader (true if it can be used, false if not). - - - - - Are render textures supported? (Read Only) - - - - - Are cubemap render textures supported? (Read Only) - - - - - Returns true when the platform supports different blend modes when rendering to multiple render targets, or false otherwise. - - - - - Does the current renderer support binding constant buffers directly? (Read Only) - - - - - Are built-in shadows supported? (Read Only) - - - - - Are sparse textures supported? (Read Only) - - - - - Is the stencil buffer supported? (Read Only) - - - - - Are tessellation shaders supported? (Read Only) - - - - - Returns true if the 'Mirror Once' texture wrap mode is supported. (Read Only) - - - - - Is the device capable of providing the user haptic feedback by vibration? - - - - - Amount of system memory present (Read Only). - - - - - Value returned by SystemInfo string properties which are not supported on the current platform. - - - - - True if the Graphics API takes RenderBufferLoadAction and RenderBufferStoreAction into account, false if otherwise. - - - - - This property is true if the current platform uses a reversed depth buffer (where values range from 1 at the near plane and 0 at far plane), and false if the depth buffer is normal (0 is near, 1 is far). (Read Only) - - - - - Returns a format supported by the platform for the specified usage. - - The Experimental.Rendering.GraphicsFormat format to look up. - The Experimental.Rendering.FormatUsage usage to look up. - - Returns a format supported by the platform. If no equivalent or compatible format is supported, the function returns GraphicsFormat.None. - - - - - Returns the platform-specific GraphicsFormat that is associated with the DefaultFormat. - - The DefaultFormat format to look up. - - - - Checks if the target platform supports the MSAA samples count in the RenderTextureDescriptor argument. - - The RenderTextureDescriptor to check. - - If the target platform supports the given MSAA samples count of RenderTextureDescriptor, returns the given MSAA samples count. Otherwise returns a lower fallback MSAA samples count value that the target platform supports. - - - - - Verifies that the specified graphics format is supported for the specified usage. - - The Experimental.Rendering.GraphicsFormat format to look up. - The Experimental.Rendering.FormatUsage usage to look up. - - Returns true if the format is supported for the specific usage. Returns false otherwise. - - - - - Is blending supported on render texture format? - - The format to look up. - - True if blending is supported on the given format. - - - - - Is render texture format supported? - - The format to look up. - - True if the format is supported. - - - - - Is texture format supported on this device? - - The TextureFormat format to look up. - - True if the format is supported. - - - - - Indicates whether the given combination of a vertex attribute format and dimension is supported on this device. - - The VertexAttributeFormat format to look up. - The dimension of vertex data to check for. - - True if the format with the given dimension is supported. - - - - - The language the user's operating system is running in. Returned by Application.systemLanguage. - - - - - Afrikaans. - - - - - Arabic. - - - - - Basque. - - - - - Belarusian. - - - - - Bulgarian. - - - - - Catalan. - - - - - Chinese. - - - - - ChineseSimplified. - - - - - ChineseTraditional. - - - - - Czech. - - - - - Danish. - - - - - Dutch. - - - - - English. - - - - - Estonian. - - - - - Faroese. - - - - - Finnish. - - - - - French. - - - - - German. - - - - - Greek. - - - - - Hebrew. - - - - - Hungarian. - - - - - Icelandic. - - - - - Indonesian. - - - - - Italian. - - - - - Japanese. - - - - - Korean. - - - - - Latvian. - - - - - Lithuanian. - - - - - Norwegian. - - - - - Polish. - - - - - Portuguese. - - - - - Romanian. - - - - - Russian. - - - - - Serbo-Croatian. - - - - - Slovak. - - - - - Slovenian. - - - - - Spanish. - - - - - Swedish. - - - - - Thai. - - - - - Turkish. - - - - - Ukrainian. - - - - - Unknown. - - - - - Vietnamese. - - - - - The joint attempts to move a Rigidbody2D to a specific target position. - - - - - The local-space anchor on the rigid-body the joint is attached to. - - - - - Should the target be calculated automatically? - - - - - The amount by which the target spring force is reduced in proportion to the movement speed. - - - - - The frequency at which the target spring oscillates around the target position. - - - - - The maximum force that can be generated when trying to maintain the target joint constraint. - - - - - The world-space position that the joint will attempt to move the body to. - - - - - The Terrain component renders the terrain. - - - - - The active Terrain. This is a convenient function to get to the main Terrain in the Scene. - - - - - The active terrains in the Scene. - - - - - Specifies if the terrain tile will be automatically connected to adjacent tiles. - - - - - Specifies if an array of internal light probes should be baked for terrain trees. Available only in editor. - - - - - Heightmap patches beyond basemap distance will use a precomputed low res basemap. - - - - - Terrain bottom neighbor. - - - - - Should terrain cast shadows?. - - - - - Collect detail patches from memory. - - - - - Graphics format of the Terrain holes Texture when it is compressed. - - - - - Texture format of the Terrain holes Texture when it is compressed. - - - - - Removes ringing from probes on trees if enabled. - - - - - Density of detail objects. - - - - - Detail objects will be displayed up to this distance. - - - - - Indicates whether Unity draws the Terrain geometry itself. - - - - - Set to true to enable the terrain instance renderer. The default value is false. - - - - - Specify if terrain trees and details should be drawn. - - - - - Controls what part of the terrain should be rendered. - - - - - Whether some per-camera rendering resources for the terrain should be freed after not being used for some frames. - - - - - Grouping ID for auto connect. - - - - - Graphics format of the Terrain heightmap. - - - - - Lets you essentially lower the heightmap resolution used for rendering. - - - - - An approximation of how many pixels the terrain will pop in the worst case when switching lod. - - - - - RenderTextureFormat of the terrain heightmap. - - - - - Graphics format of the Terrain holes Texture when it is not compressed. - - - - - Render texture format of the Terrain holes Texture. - - - - - The Terrain tile to the left, which is in the negative X direction. - - - - - The shininess value of the terrain. - - - - - The specular color of the terrain. - - - - - The index of the baked lightmap applied to this terrain. - - - - - The UV scale & offset used for a baked lightmap. - - - - - The custom material Unity uses to render the Terrain. - - - - - The type of the material used to render the terrain. Could be one of the built-in types or custom. See Terrain.MaterialType. - - - - - Graphics format of the Terrain normal map texture. - - - - - Render texture format of the Terrain normal map texture. - - - - - Returns the normal map texture computed from sampling the heightmap. It is only used when terrain is rendered using instancing. - - - - - Texture format of the Terrain normal map texture. - - - - - Set the terrain bounding box scale. - - - - - Allows you to specify how Unity chooses the for tree instances. - - - - - The index of the realtime lightmap applied to this terrain. - - - - - The UV scale & offset used for a realtime lightmap. - - - - - How reflection probes are used for terrain. See Rendering.ReflectionProbeUsage. - - - - - Determines which rendering layers the Terrain renderer lives on. - - - - - The Terrain tile to the left, which is in the positive X direction. - - - - - Allows you to set the shadow casting mode for the terrain. - - - - - The Terrain Data that stores heightmaps, terrain textures, detail meshes and trees. - - - - - Terrain top neighbor. - - - - - Distance from the camera where trees will be rendered as billboards only. - - - - - Total distance delta that trees will use to transition from billboard orientation to mesh orientation. - - - - - The maximum distance at which trees are rendered. - - - - - The multiplier to the current LOD bias used for rendering LOD trees (i.e. SpeedTree trees). - - - - - Maximum number of trees rendered at full LOD. - - - - - Adds a tree instance to the terrain. - - - - - - Update the terrain's LOD and vegetation information after making changes with TerrainData.SetHeightsDelayLOD. - - - - - Creates a Terrain including collider from TerrainData. - - - - - - Flushes any change done in the terrain so it takes effect. - - - - - Fills the list with reflection probes whose AABB intersects with terrain's AABB. Their weights are also provided. Weight shows how much influence the probe has on the terrain, and is used when the blending between multiple reflection probes occurs. - - [in / out] A list to hold the returned reflection probes and their weights. See ReflectionProbeBlendInfo. - - - - Get the position of the terrain. - - - - - Get the previously set splat material properties by copying to the dest MaterialPropertyBlock object. - - - - - - The type of the material used to render a terrain object. Could be one of the built-in types or custom. - - - - - A built-in material that uses the legacy Lambert (diffuse) lighting model and has optional normal map support. - - - - - A built-in material that uses the legacy BlinnPhong (specular) lighting model and has optional normal map support. - - - - - A built-in material that uses the standard physically-based lighting model. Inputs supported: smoothness, metallic / specular, normal. - - - - - Use a custom material given by Terrain.materialTemplate. - - - - - Samples the height at the given position defined in world space, relative to the Terrain space. - - - - - - Marks the current connectivity status as invalid. - - - - - Lets you set up the connection between neighboring Terrain tiles. This ensures LOD matches up on neighboring Terrain tiles. - - The Terrain tile to the left is in the negative X direction. - The Terrain tile to the top is in the positive Z direction. - The Terrain tile to the right is in the positive X direction. - The Terrain tile to the bottom is in the negative Z direction. - - - - Set the additional material properties when rendering the terrain heightmap using the splat material. - - - - - - Indicate the types of changes to the terrain in OnTerrainChanged callback. - - - - - Indicates a change to the heightmap data without computing LOD. - - - - - Indicates a change to the Terrain holes data, which doesn't include LOD calculations and tree/vegetation updates. - - - - - Indicates that a change was made to the terrain that was so significant that the internal rendering data need to be flushed and recreated. - - - - - Indicates a change to the heightmap data. - - - - - Indicates a change to the heightmap resolution. - - - - - Indicates a change to the Terrain holes data. - - - - - Indicates a change to the detail data. - - - - - Indicates a change to the tree data. - - - - - Indicates that the TerrainData object is about to be destroyed. - - - - - A heightmap based collider. - - - - - The terrain that stores the heightmap. - - - - - The TerrainData class stores heightmaps, detail mesh positions, tree instances, and terrain texture alpha maps. - - - - - Height of the alpha map. (Read only.) - - - - - Number of alpha map layers. - - - - - The size of the alpha map in texels for either the width or the height. - - - - - Returns the number of alphamap textures. - - - - - Alpha map textures used by the Terrain. Used by Terrain Inspector for undo. - - - - - Width of the alpha map. - - - - - Resolution of the base map used for rendering far patches on the terrain. - - - - - The local bounding box of the TerrainData object. - - - - - The resolution of the detail data stored in TerrainData. - - - - - The number of patches along a terrain tile edge. This is squared to make a grid of patches. - - - - - Contains the detail texture/meshes that the Terrain has. - - - - - Detail Resolution of the TerrainData. - - - - - Detail Resolution of each patch. A larger value will decrease the number of batches used by detail objects. - - - - - The resolution of the detail data stored in TerrainData. - - - - - Enable the Terrain holes Texture compression. - - - - - Height of the terrain in samples (Read Only). - - - - - The size of the heightmap in texels for either the width or the height. - - - - - Returns a Vector3 where the x and z components are the size of each heightmap sample (i.e. the space between two neighboring heightmap samples), and the y component is the entire Terrain's height range in world space. - - - - - Returns the heightmap texture. - - - - - Width of the terrain in samples (Read Only). - - - - - Returns the Terrain holes resolution for both the data and the Texture. - - - - - Returns the Terrain holes Texture. - - - - - The total size in world units of the terrain. - - - - - Splat texture used by the terrain. - - - - - Retrieves the terrain layers used by the current terrain. - - - - - The thickness of the terrain used for collision detection. - - - - - Returns the number of tree instances. - - - - - Contains the current trees placed in the terrain. - - - - - The list of tree prototypes this are the ones available in the inspector. - - - - - Amount of waving grass in the terrain. - - - - - Speed of the waving grass. - - - - - Strength of the waving grass in the terrain. - - - - - Color of the waving grass that the terrain has. - - - - - The name for the Terrain alpha map textures. - - - - - Copies the specified part of the active RenderTexture to the Terrain heightmap texture. - - The part of the active Render Texture to copy. - The X and Y coordinates of the heightmap texture to copy into. - Controls how CPU synchronization is performed. - - - - Copies the specified part of the active RenderTexture to the Terrain texture. - - The name of the Terrain texture to copy into. - The index of the Terrain texture to copy into. - The part of the active Render Texture to copy. - The X and Y coordinates of the Terrain texture to copy into. - Specifies whether to allow delayed CPU synchronization of the texture. - - - - Marks the specified part of the heightmap as dirty. - - The rectangular region to mark as dirty. - Controls how CPU synchronization is performed. - - - - Marks the specified part of the Terrain texture as dirty. - - The name of the Terrain texture. - The rectangular region to mark as dirty. - Specifies whether to allow delayed CPU synchronization of the texture. - - - - Returns the alpha map at a position x, y given a width and height. - - The x offset to read from. - The y offset to read from. - The width of the alpha map area to read. - The height of the alpha map area to read. - - A 3D array of floats, where the 3rd dimension represents the mixing weight of each splatmap at each x,y coordinate. - - - - - Returns the alphamap texture at the specified index. - - Index of the alphamap. - - Alphamap texture at the specified index. - - - - - Returns an array of detail patches, which are each identified by X-Z coordinates. Detail objects in the patches are clamped to the maximum count. - - The detail density value. See Terrain.detailObjectDensity. - - - - Returns a 2D array of the detail object density (i.e. the number of detail objects for this layer) in the specific location. - - First x index of detail object density data to retrieve. - First y index of detail object density data to retrieve. - The amount of detail object density data to retrieve along the Terrain's x axis. - The amount of detail object density data to retrieve along the Terrain's z axis. - The index of the detail in the TerrainData.detailPrototypes array. - - - - Gets the world space height of the Terrain at a certain point x,y without adding the Terrain's world position y. - - - - - - - Gets an array of heightmap samples. - - First index of heightmap samples to retrieve along the Terrain's x axis. - First index of heightmap samples to retrieve along the Terrain's z axis. - Number of samples to retrieve along the Terrain's x axis. - Number of samples to retrieve along the Terrain's z axis. - - - - Gets an array of Terrain holes samples. - - First x index of Terrain holes samples to retrieve. - First y index of Terrain holes samples to retrieve. - Number of samples to retrieve along the Terrain holes x axis. - Number of samples to retrieve along the Terrain holes y axis. - - - - Gets an interpolated height at a point x,y. The x and y coordinates are clamped to [0, 1]. - - X coordinate of the point in the range of [0, 1]. - Y coordinate of the point in the range of [0, 1]. - - - - Gets an array of terrain height values using the normalized x,y coordinates. - - The base x coordinate. - The base y coordinate. - The number of queries along the X axis. - The number of queries along the Y axis. - The interval between each query along the X axis. - The interval between each query along the Y axis. - - - - Fills the array with Terrain height values using normalized x,y coordinates. - - The array to fill with height values. - The offset from the beginning of the array, along the X axis, at which to start filling in height values. - The offset from the beginning of the array, along the Y axis, at which to start filling in height values. - The base x coordinate. - The base y coordinate. - The number of queries along the X axis. - The number of queries along the Y axis. - The interval between each query along the X axis. - The interval between each query along the Y axis. - - - - Get an interpolated normal at a given location. - - - - - - - Returns an array of tesselation maximum height error values per renderable terrain patch. The returned array can be modified and passed to OverrideMaximumHeightError. - - - Float array of maximum height error values. - - - - - Returns an array of min max height values for all the renderable patches in a terrain. The returned array can be modified and then passed to OverrideMinMaxPatchHeights. - - - Minimum and maximum height values for each patch. - - - - - Gets the gradient of the terrain at point (x,y). - - - - - - - Returns an array of all supported detail layer indices in the area. - - - - - - - - - Gets the tree instance at the specified index. It is used as a faster version of treeInstances[index] as this function doesn't create the entire tree instances array. - - The index of the tree instance. - - - - The name for the Terrain holes Texture. - - - - - Gets whether a certain point at x,y is a hole. - - - - - - - Override the maximum tessellation height error with user provided values. Note that the overriden values get reset when the terrain resolution is changed and stays unchanged when the terrain heightmap is painted or changed via script. - - Provided maximum height error values. - - - - Override the minimum and maximum patch heights for every renderable terrain patch. Note that the overriden values get reset when the terrain resolution is changed and stays unchanged when the terrain heightmap is painted or changed via script. - - Array of minimum and maximum terrain patch height values. - - - - Reloads all the values of the available prototypes (ie, detail mesh assets) in the TerrainData Object. - - - - - Assign all splat values in the given map area. - - - - - - - - Marks the terrain data as dirty to trigger an update of the terrain basemap texture. - - - - - Sets the detail layer density map. - - - - - - - - - Sets the resolution of the detail map. - - Specifies the number of pixels in the detail resolution map. A larger detailResolution, leads to more accurate detail object painting. - Specifies the size in pixels of each individually rendered detail patch. A larger number reduces draw calls, but might increase triangle count since detail patches are culled on a per batch basis. A recommended value is 16. If you use a very large detail object distance and your grass is very sparse, it makes sense to increase the value. - - - - Sets an array of heightmap samples. - - First x index of heightmap samples to set. - First y index of heightmap samples to set. - Array of heightmap samples to set (values range from 0 to 1, array indexed as [y,x]). - - - - Sets an array of heightmap samples. - - First x index of heightmap samples to set. - First y index of heightmap samples to set. - Array of heightmap samples to set (values range from 0 to 1, array indexed as [y,x]). - - - - Sets an array of Terrain holes samples. - - First x index of Terrain holes samples to set. - First y index of Terrain holes samples to set. - Array of Terrain holes samples to set (array indexed as [y,x]). - - - - Sets an array of Terrain holes samples. - - First x index of Terrain holes samples to set. - First y index of Terrain holes samples to set. - Array of Terrain holes samples to set (array indexed as [y,x]). - - - - This function sets the terrainLayers property, and in addition, registers the action to the Editor's undo stack. - - The Terrain Layer assets to set. - The name of the Editor's undo action. - - - - Sets the tree instance with new parameters at the specified index. However, you cannot change TreeInstance.prototypeIndex and TreeInstance.position. If you change them, the method throws an ArgumentException. - - The index of the tree instance. - The new TreeInstance value. - - - - Sets the Tree Instance array, and optionally snaps Trees onto the surface of the Terrain heightmap. - - The array of TreeInstance objects. - Specifies whether to snap Trees to the Terrain heightmap. - - - - Performs synchronization queued by previous calls to CopyActiveRenderTextureToHeightmap and DirtyHeightmapRegion, which makes the height data and LOD data used for tessellation up to date. - - - - - Performs synchronization queued by previous calls to CopyActiveRenderTextureToTexture and DirtyTextureRegion, which makes CPU data of the Terrain textures up to date. - - The name of the Terrain texture to synchronize. - - - - Triggers an update to integrate modifications done to the heightmap outside of unity. - - Start X position of the dirty heightmap region. - Start Y position of the dirty heightmap region. - Width of the the dirty heightmap region. - Width of the the dirty heightmap region. - Update immediately, instead of deferring the update. - - - - Extension methods to the Terrain class, used only for the UpdateGIMaterials method used by the Global Illumination System. - - - - - Schedules an update of the albedo and emissive Textures of a system that contains the Terrain. - - - - - - - - - - Schedules an update of the albedo and emissive Textures of a system that contains the Terrain. - - - - - - - - - - Controls what Terrain heightmap data to synchronize when there are changes to the heightmap texture. - - - - - Synchronizes height data of the heightmap texture from the GPU back to CPU memory. Then computes LOD data, used for determining the tessellation level, from the height data. - - - - - Synchronizes only height data of the heightmap texture from the GPU back to CPU memory. - - - - - Does not synchronize the height data nor the LOD data. - - - - - Description of a terrain layer. - - - - - A Vector4 value specifying the maximum RGBA value that the diffuse texture maps to when the value of the channel is 1. - - - - - A Vector4 value specifying the minimum RGBA value that the diffuse texture maps to when the value of the channel is 0. - - - - - The diffuse texture used by the terrain layer. - - - - - A Vector4 value specifying the maximum RGBA value that the mask map texture maps to when the value of the channel is 1. - - - - - A Vector4 value specifying the minimum RGBA value that the mask map texture maps to when the value of the channel is 0. - - - - - The mask map texture used by the terrain layer. - - - - - Metallic factor used by the terrain layer. - - - - - Normal map texture used by the terrain layer. - - - - - A float value that scales the normal vector. The minimum value is 0, the maximum value is 1. - - - - - Smoothness of the specular reflection. - - - - - Specular color. - - - - - UV tiling offset. - - - - - UV Tiling size. - - - - - Enum provding terrain rendering options. - - - - - Render all options. - - - - - Render terrain details. - - - - - Render heightmap. - - - - - Render trees. - - - - - Error states used by the TerrainMap. - - - - - Indicates that the adjacent terrain tiles are not aligned edge to edge. - - - - - No error detected. - - - - - Indicates that there are two terrain tiles occupying one grid cell in the TerrainMap. - - - - - Indicates that the adjacent terrain tiles have different sizes. - - - - - Terrain map filter. - - Terrain object to apply filter to. - - - - Specifies a set of 2D tile coordinates. - - - - - Tile X coordinate. - - - - - Tile Z coordinate. - - - - - Describes the interface for the code coverage data exposed by mono. - - - - - Enables or disables code coverage collection. Note that Code Coverage lowers Editor performance. - - - Returns whether coverage is enabled or disabled. - - - - - Returns the coverage sequence points for the method you specify. See CoveredSequencePoint for more information about the coverage data this method returns. - - The method to get the sequence points for. - - Array of sequence points. - - - - - Returns the coverage summary for the specified method. See CoveredMethodStats for more information about the coverage statistics returned by this method. - - The method to get coverage statistics for. - - Coverage summary. - - - - - Returns an array of coverage summaries for the specified array of methods. - - The array of methods. - - Array of coverage summaries. - - - - - Returns an array of coverage summaries for the specified type. - - The type. - - Array of coverage summaries. - - - - - Returns the coverage summary for all methods that have been called since either the Unity process was started or Coverage.ResetAll() has been called. - - - Array of coverage summaries. - - - - - Resets all coverage data. - - - - - Resets the coverage data for the specified method. - - The method. - - - - Describes the summary of the code coverage for the specified method used by TestTools.Coverage. For an example of typical usage, see TestTools.Coverage.GetStatsFor. - - - - - The covered method. - - - - - The total number of sequence points in the method. - - - - - The total number of uncovered sequence points in the method. - - - - - Describes a covered sequence point used by TestTools.Coverage. For an example of typical usage, see TestTools.Coverage.GetSequencePointsFor. - - - - - The column number of the line of the file that contains the sequence point. - - - - - The name of the file that contains the sequence point. - - - - - The number of times the sequence point has been visited. - - - - - The offset in bytes from the start of the method to the first Intermediate Language instruction of this sequence point. - - - - - The line number of the file that contains the sequence point. - - - - - The method covered by the sequence point. - - - - - Allows you to exclude an Assembly, Class, Constructor, Method or Struct from TestTools.Coverage. - - - - - How multiline text should be aligned. - - - - - Text lines are centered. - - - - - Text lines are aligned on the left side. - - - - - Text lines are aligned on the right side. - - - - - Where the anchor of the text is placed. - - - - - Text is anchored in lower side, centered horizontally. - - - - - Text is anchored in lower left corner. - - - - - Text is anchored in lower right corner. - - - - - Text is centered both horizontally and vertically. - - - - - Text is anchored in left side, centered vertically. - - - - - Text is anchored in right side, centered vertically. - - - - - Text is anchored in upper side, centered horizontally. - - - - - Text is anchored in upper left corner. - - - - - Text is anchored in upper right corner. - - - - - Attribute to make a string be edited with a height-flexible and scrollable text area. - - - - - The maximum amount of lines the text area can show before it starts using a scrollbar. - - - - - The minimum amount of lines the text area will use. - - - - - Attribute to make a string be edited with a height-flexible and scrollable text area. - - The minimum amount of lines the text area will use. - The maximum amount of lines the text area can show before it starts using a scrollbar. - - - - Attribute to make a string be edited with a height-flexible and scrollable text area. - - The minimum amount of lines the text area will use. - The maximum amount of lines the text area can show before it starts using a scrollbar. - - - - Text file assets. - - - - - The raw bytes of the text asset. (Read Only) - - - - - The text contents of the .txt file as a string. (Read Only) - - - - - Create a new TextAsset with the specified text contents. - -This constructor creates a TextAsset, which is not the same as a plain text file. When saved to disk using the AssetDatabase class, the TextAsset should be saved with the .asset extension. - - The text contents for the TextAsset. - - - - Returns the contents of the TextAsset. - - - - - Different methods for how the GUI system handles text being too large to fit the rectangle allocated. - - - - - Text gets clipped to be inside the element. - - - - - Text flows freely outside the element. - - - - - A structure that contains information about a given typeface and for a specific point size. - - - - - The Ascent line is typically located at the top of the tallest glyph in the typeface. - - - - - The Baseline is an imaginary line upon which all glyphs appear to rest on. - - - - - The Cap line is typically located at the top of capital letters. - - - - - The Descent line is typically located at the bottom of the glyph with the lowest descender in the typeface. - - - - - The name of the font typeface also known as family name. - - - - - The line height represents the distance between consecutive lines of text. - - - - - The Mean line is typically located at the top of lowercase letters. - - - - - The point size used for sampling the typeface. - - - - - The relative scale of the typeface. - - - - - The position of the strikethrough. - - - - - The thickness of the strikethrough. - - - - - The style name of the typeface which defines both the visual style and weight of the typeface. - - - - - The position of characters using subscript. - - - - - The relative size / scale of subscript characters. - - - - - The position of characters using superscript. - - - - - The relative size / scale of superscript characters. - - - - - The width of the tab character. - - - - - The position of the underline. - - - - - The thickness of the underline. - - - - - Compares the information in this FaceInfo structure with the information in the given FaceInfo structure to determine whether they have the same values. - - The FaceInfo structure to compare this FaceInfo structure with. - - Returns true if the FaceInfo structures have the same values. False if not. - - - - - A Glyph is the visual representation of a text element or character. - - - - - The index of the atlas texture that contains this glyph. - - - - - A rectangle that defines the position of a glyph within an atlas texture. - - - - - The index of the glyph in the source font file. - - - - - The metrics that define the size, position and spacing of a glyph when performing text layout. - - - - - The relative scale of the glyph. The default value is 1.0. - - - - - Compares two glyphs to determine if they have the same values. - - The glyph to compare with. - - Returns true if the glyphs have the same values. False if not. - - - - - Constructor for a new glyph. - - Glyph used as a reference for the new glyph. - The index of the glyph in the font file. - The metrics of the glyph. - The GlyphRect defining the position of the glyph in the atlas texture. - The relative scale of the glyph. - The index of the atlas texture that contains the glyph. - - - - Constructor for a new glyph. - - Glyph used as a reference for the new glyph. - The index of the glyph in the font file. - The metrics of the glyph. - The GlyphRect defining the position of the glyph in the atlas texture. - The relative scale of the glyph. - The index of the atlas texture that contains the glyph. - - - - Constructor for a new glyph. - - Glyph used as a reference for the new glyph. - The index of the glyph in the font file. - The metrics of the glyph. - The GlyphRect defining the position of the glyph in the atlas texture. - The relative scale of the glyph. - The index of the atlas texture that contains the glyph. - - - - Constructor for a new glyph. - - Glyph used as a reference for the new glyph. - The index of the glyph in the font file. - The metrics of the glyph. - The GlyphRect defining the position of the glyph in the atlas texture. - The relative scale of the glyph. - The index of the atlas texture that contains the glyph. - - - - A set of values that define the size, position and spacing of a glyph when performing text layout. - - - - - The height of the glyph. - - - - - The horizontal distance to increase (left to right) or decrease (right to left) the drawing position relative to the origin of the text element. - - - - - The horizontal distance from the current drawing position (origin) relative to the element's left bounding box edge (bbox). - - - - - The vertical distance from the current baseline relative to the element's top bounding box edge (bbox). - - - - - The width of the glyph. - - - - - Constructs a new GlyphMetrics structure. - - The width of the glyph. - The height of the glyph. - The horizontal bearingX. - The horizontal bearingY. - The horizontal advance. - - - - A rectangle that defines the position of a glyph within an atlas texture. - - - - - The height of the glyph. - - - - - The width of the glyph. - - - - - The x position of the glyph in the font atlas texture. - - - - - The y position of the glyph in the font atlas texture. - - - - - A GlyphRect with all values set to zero. Shorthand for writing GlyphRect(0, 0, 0, 0). - - - - - Constructor for a new GlyphRect. - - The x position of the glyph in the atlas texture. - The y position of the glyph in the atlas texture. - The width of the glyph. - The height of the glyph. - The Rect used to construct the new GlyphRect. - - - - Constructor for a new GlyphRect. - - The x position of the glyph in the atlas texture. - The y position of the glyph in the atlas texture. - The width of the glyph. - The height of the glyph. - The Rect used to construct the new GlyphRect. - - - - The FontEngine is used to access data from source font files. This includes information about individual characters, glyphs and relevant metrics typically used in the process of text parsing, layout and rendering. - -The types of font files supported are TrueType (.ttf, .ttc) and OpenType (.otf). - -The FontEngine is also used to raster the visual representation of characters known as glyphs in a given font atlas texture. - - - - - Destroy and unload resources used by the Font Engine. - - - A value of zero (0) if the Font Engine and used resources were successfully released. - - - - - Get the FaceInfo for the currently loaded and sized typeface. - - - Returns the FaceInfo of the currently loaded typeface. - - - - - Gets the font faces and styles for the currently loaded font. - - - An array that contains the names of the font faces and styles. - - - - - Initialize the Font Engine and required resources. - - - A value of zero (0) if the initialization of the Font Engine was successful. - - - - - Load a source font file. - - The path of the source font file relative to the project. - The point size used to scale the font face. - The byte array that contains the source font file. - The font to load the data from. The Unity font must be set to Dynamic mode with Include Font Data selected. - The face index of the font face to load. When the font file is a TrueType collection (.TTC), this specifies the face index of the font face to load. If the font file is a TrueType Font (.TTF) or OpenType Font (.OTF) file, the face index is always zero (0). - - A value of zero (0) if the font face was loaded successfully. - - - - - Load a source font file. - - The path of the source font file relative to the project. - The point size used to scale the font face. - The byte array that contains the source font file. - The font to load the data from. The Unity font must be set to Dynamic mode with Include Font Data selected. - The face index of the font face to load. When the font file is a TrueType collection (.TTC), this specifies the face index of the font face to load. If the font file is a TrueType Font (.TTF) or OpenType Font (.OTF) file, the face index is always zero (0). - - A value of zero (0) if the font face was loaded successfully. - - - - - Load a source font file. - - The path of the source font file relative to the project. - The point size used to scale the font face. - The byte array that contains the source font file. - The font to load the data from. The Unity font must be set to Dynamic mode with Include Font Data selected. - The face index of the font face to load. When the font file is a TrueType collection (.TTC), this specifies the face index of the font face to load. If the font file is a TrueType Font (.TTF) or OpenType Font (.OTF) file, the face index is always zero (0). - - A value of zero (0) if the font face was loaded successfully. - - - - - Load a source font file. - - The path of the source font file relative to the project. - The point size used to scale the font face. - The byte array that contains the source font file. - The font to load the data from. The Unity font must be set to Dynamic mode with Include Font Data selected. - The face index of the font face to load. When the font file is a TrueType collection (.TTC), this specifies the face index of the font face to load. If the font file is a TrueType Font (.TTF) or OpenType Font (.OTF) file, the face index is always zero (0). - - A value of zero (0) if the font face was loaded successfully. - - - - - Load a source font file. - - The path of the source font file relative to the project. - The point size used to scale the font face. - The byte array that contains the source font file. - The font to load the data from. The Unity font must be set to Dynamic mode with Include Font Data selected. - The face index of the font face to load. When the font file is a TrueType collection (.TTC), this specifies the face index of the font face to load. If the font file is a TrueType Font (.TTF) or OpenType Font (.OTF) file, the face index is always zero (0). - - A value of zero (0) if the font face was loaded successfully. - - - - - Load a source font file. - - The path of the source font file relative to the project. - The point size used to scale the font face. - The byte array that contains the source font file. - The font to load the data from. The Unity font must be set to Dynamic mode with Include Font Data selected. - The face index of the font face to load. When the font file is a TrueType collection (.TTC), this specifies the face index of the font face to load. If the font file is a TrueType Font (.TTF) or OpenType Font (.OTF) file, the face index is always zero (0). - - A value of zero (0) if the font face was loaded successfully. - - - - - Load a source font file. - - The path of the source font file relative to the project. - The point size used to scale the font face. - The byte array that contains the source font file. - The font to load the data from. The Unity font must be set to Dynamic mode with Include Font Data selected. - The face index of the font face to load. When the font file is a TrueType collection (.TTC), this specifies the face index of the font face to load. If the font file is a TrueType Font (.TTF) or OpenType Font (.OTF) file, the face index is always zero (0). - - A value of zero (0) if the font face was loaded successfully. - - - - - Load a source font file. - - The path of the source font file relative to the project. - The point size used to scale the font face. - The byte array that contains the source font file. - The font to load the data from. The Unity font must be set to Dynamic mode with Include Font Data selected. - The face index of the font face to load. When the font file is a TrueType collection (.TTC), this specifies the face index of the font face to load. If the font file is a TrueType Font (.TTF) or OpenType Font (.OTF) file, the face index is always zero (0). - - A value of zero (0) if the font face was loaded successfully. - - - - - Load a source font file. - - The path of the source font file relative to the project. - The point size used to scale the font face. - The byte array that contains the source font file. - The font to load the data from. The Unity font must be set to Dynamic mode with Include Font Data selected. - The face index of the font face to load. When the font file is a TrueType collection (.TTC), this specifies the face index of the font face to load. If the font file is a TrueType Font (.TTF) or OpenType Font (.OTF) file, the face index is always zero (0). - - A value of zero (0) if the font face was loaded successfully. - - - - - Set the size of the currently loaded font face. - - The point size used to scale the font face. - - A value of zero (0) if the font face was successfully scaled to the given point size. - - - - - Try to get the glyph index for the character at the given Unicode value. - - The unicode value of the character for which to lookup the glyph index. - The index of the glyph for the given unicode character or the .notdef glyph (index 0) if no glyph is available for the given Unicode value. - - Returns true if the given unicode has a glyph index. - - - - - Try loading the glyph for the given index value and if available populate the glyph. - - The index of the glyph that should be loaded. - The glyph loading flag that should be used to load the glyph. - The glyph using the provided index or the .notdef glyph (index 0) if no glyph was found at that index. - - Returns true if a glyph exists at the given index. Otherwise returns false. - - - - - Try loading a glyph for the given unicode value. If available, populates the glyph and returns true. Otherwise returns false and populates the glyph with the .notdef / missing glyph data. - - The glyph loading flag that should be used to load the glyph. - The glyph using the provided index or the .notdef glyph (index 0) if no glyph was found at that index. - The Unicode value of the character whose glyph should be loaded. - - Returns true if a glyph exists for the given unicode value. Otherwise returns false. - - - - - Unloads all currently loaded font faces and removes them from the cache. - - - A value of zero (0) if the font faces were successfully unloaded and removed from the cache. - - - - - Unloads current font face and removes it from the cache. - - - A value of zero (0) if the font face was successfully unloaded and removed from the cache. - - - - - Error code returned by the various FontEngine functions. - - - - - Error code returned when the FontEngine glyph packing or rendering process has been cancelled. - - - - - Error code returned by the LoadGlyph function when referencing an invalid Unicode character value. - - - - - Error code indicating an invalid font face. - - - - - Error code indicating an invalid font file. - - - - - Error code returned by the LoadFontFace function when the source font file is of an unknown or invalid format. - - - - - Error code returned by the LoadFontFace function when the file path to the source font file appears invalid. - - - - - Error code returned by the LoadFontFace function when the source font file appears invalid or improperly formatted. - - - - - Error code returned by the LoadGlyph function when referencing an invalid or out of range glyph index value. - - - - - Error code indicating failure to initialize the font engine library. - - - - - Error code indicating failure to initialize the font engine library and / or successfully load a font face. - - - - - Error code returned by the LoadGlyph or SetFaceSize functions using an invalid pointSize value. - - - - - Error code indicating failure to load one of the tables of the font file. - - - - - Error code returned when the function was successfully executed. - - - - - The positional adjustment values of a glyph. - - - - - The index of the glyph in the source font file. - - - - - The GlyphValueRecord contains the positional adjustments of the glyph. - - - - - Constructor for new glyph adjustment record. - - The index of the glyph in the source font file. - The GlyphValueRecord contains the positional adjustments of the glyph. - - - - The various options (flags) used by the FontEngine when loading glyphs from a font face. - - - - - Load glyph metrics without allocating and loading the bitmap data. - - - - - Load glyph metrics without using the 'hdmx' table. This flag is mostly used to validate font data. - - - - - Load glyph metrics and bitmap representation if available for the current face size. - - - - - Load glyphs using the auto hinter instead of the font's native hinter. - - - - - Load glyph metrics and render outline using 1-bit monochrome. - - - - - Load glyphs using the font's native hinter. - - - - - Load glyphs and ignore embedded bitmap strikes. - - - - - Load glyphs without hinting. - - - - - Load glyphs at default font units without scaling. This flag implies LOAD_NO_HINTING and LOAD_NO_BITMAP and unsets LOAD_RENDER. - - - - - Load glyph metrics and render outline using 8-bit or antialiased image of the glyph. - - - - - The modes available when packing glyphs into an atlas texture. - - - - - Place the glyph into the smallest free space available in which it can fit. - - - - - Place the glyph against the longer side of a free space to minimize the length of the longer leftover side. - - - - - Place the glyph against the short side of a free space to minimize the length of the shorter leftover side. - - - - - Place the glyph into available free space in a Tetris like fashion. - - - - - Place the glyph into the available free space by trying to maximize the contact point between it and other glyphs. - - - - - The positional adjustment values of a pair of glyphs. - - - - - The positional adjustment values for the first glyph. - - - - - The positional adjustment values for the second glyph. - - - - - Constructor for new glyph pair adjustment record. - - The positional adjustment values for the first glyph. - The positional adjustment values for the second glyph. - - - - The rendering modes used by the Font Engine to render glyphs. - - - - - Renders a bitmap representation of the glyph from a binary (1-bit monochrome) image of the glyph outline with no hinting. - - - - - Renders a bitmap representation of the glyph from a binary (1-bit monochrome) image of the glyph outline with hinting. - - - - - Renders a signed distance field (SDF) representation of the glyph from a binary (1-bit monochrome) image of the glyph outline with no hinting. - - - - - Renders a signed distance field (SDF) representation of the glyph from a binary (1-bit monochrome) image of the glyph outline with no hinting. - - - - - Renders a signed distance field (SDF) representation of the glyph from a binary (1-bit monochrome) image of the glyph outline with no hinting. - - - - - Renders a signed distance field (SDF) representation of the glyph from a binary (1-bit monochrome) image of the glyph outline with no hinting. - - - - - Renders a signed distance field (SDF) representation of the glyph from an 8-bit or antialiased image of the glyph outline with no hinting. - - - - - Renders a signed distance field (SDF) representation of the glyph from an 8-bit or antialiased image of the glyph outline with hinting. - - - - - Renders a bitmap representation of the glyph from an 8-bit or antialiased image of the glyph outline with no hinting. - - - - - Renders a bitmap representation of the glyph from an 8-bit or antialiased image of the glyph outline with hinting. - - - - - The values used to adjust the position of a glyph or set of glyphs. - - - - - The positional adjustment that affects the horizontal advance of the glyph. - - - - - The positional adjustment that affects the horizontal bearing X of the glyph. - - - - - The positional adjustment that affects the vertical advance of the glyph. - - - - - The positional adjustment that affectsthe horizontal bearing Y of the glyph. - - - - - Constructor for new glyph value record. - - The positional adjustment that affects the horizontal bearing X of the glyph. - The positional adjustment that affects the horizontal bearing Y of the glyph. - The positional adjustment that affects the horizontal advance of the glyph. - The positional adjustment that affects the vertical advance of the glyph. - - - - A struct that stores the settings for TextGeneration. - - - - - Use the extents of glyph geometry to perform horizontal alignment rather than glyph metrics. - - - - - The base color for the text generation. - - - - - Font to use for generation. - - - - - Font size. - - - - - Font style. - - - - - Continue to generate characters even if the text runs out of bounds. - - - - - Extents that the generator will attempt to fit the text in. - - - - - What happens to text when it reaches the horizontal generation bounds. - - - - - The line spacing multiplier. - - - - - Generated vertices are offset by the pivot. - - - - - Should the text be resized to fit the configured bounds? - - - - - Maximum size for resized text. - - - - - Minimum size for resized text. - - - - - Allow rich text markup in generation. - - - - - A scale factor for the text. This is useful if the Text is on a Canvas and the canvas is scaled. - - - - - How is the generated text anchored. - - - - - Should the text generator update the bounds from the generated text. - - - - - What happens to text when it reaches the bottom generation bounds. - - - - - Class that can be used to generate text for rendering. - - - - - The number of characters that have been generated. - - - - - The number of characters that have been generated and are included in the visible lines. - - - - - Array of generated characters. - - - - - The size of the font that was found if using best fit mode. - - - - - Number of text lines generated. - - - - - Information about each generated text line. - - - - - Extents of the generated text in rect format. - - - - - Number of vertices generated. - - - - - Array of generated vertices. - - - - - Create a TextGenerator. - - - - - - Create a TextGenerator. - - - - - - Populate the given List with UICharInfo. - - List to populate. - - - - Returns the current UICharInfo. - - - Character information. - - - - - Populate the given list with UILineInfo. - - List to populate. - - - - Returns the current UILineInfo. - - - Line information. - - - - - Given a string and settings, returns the preferred height for a container that would hold this text. - - Generation text. - Settings for generation. - - Preferred height. - - - - - Given a string and settings, returns the preferred width for a container that would hold this text. - - Generation text. - Settings for generation. - - Preferred width. - - - - - Populate the given list with generated Vertices. - - List to populate. - - - - Returns the current UIVertex array. - - - Vertices. - - - - - Mark the text generator as invalid. This will force a full text generation the next time Populate is called. - - - - - Will generate the vertices and other data for the given string with the given settings. - - String to generate. - Settings. - - - - Will generate the vertices and other data for the given string with the given settings. - - String to generate. - Generation settings. - The object used as context of the error log message, if necessary. - - True if the generation is a success, false otherwise. - - - - - A script interface for the. - - - - - How lines of text are aligned (Left, Right, Center). - - - - - Which point of the text shares the position of the Transform. - - - - - The size of each character (This scales the whole text). - - - - - The color used to render the text. - - - - - The Font used. - - - - - The font size to use (for dynamic fonts). - - - - - The font style to use (for dynamic fonts). - - - - - How much space will be in-between lines of text. - - - - - How far should the text be offset from the transform.position.z when drawing. - - - - - Enable HTML-style tags for Text Formatting Markup. - - - - - How much space will be inserted for a tab '\t' character. This is a multiplum of the 'spacebar' character offset. - - - - - The text that is displayed. - - - - - Base class for texture handling. - - - - - Allow Unity internals to perform texture creation on any thread (rather than the dedicated render thread). - - - - - Anisotropic filtering level of the texture. - - - - - The amount of memory currently being used by the non-streaming and mipmap streaming textures combined. - - - - - This amount of texture memory would be used before the texture streaming budget is applied. - - - - - Dimensionality (type) of the texture (Read Only). - - - - - Filtering mode of the texture. - - - - - Returns the GraphicsFormat format or color format of a texture object. - - - - - Height of the texture in pixels. (Read Only) - - - - - The hash value of the Texture. - - - - - Returns true if the Read/Write Enabled checkbox was checked when the texture was imported; otherwise returns false. For a dynamic Texture created from script, always returns true. For additional information, see TextureImporter.isReadable. - - - - - Mip map bias of the texture. - - - - - How many mipmap levels are in this texture (Read Only). - - - - - Number of non-streaming textures. - - - - - Total amount of memory being used by non-streaming textures. - - - - - How many times has a texture been uploaded due to texture mipmap streaming. - - - - - Number of renderers registered with the texture streaming system. - - - - - Number of streaming textures. - - - - - Force the streaming texture system to discard all unused mipmaps immediately, rather than caching them until the texture memory budget is exceeded. - - - - - Force streaming textures to load all mipmap levels. - - - - - Number of streaming textures with mipmaps currently loading. - - - - - Number of streaming textures with outstanding mipmaps to be loaded. - - - - - The amount of memory used by textures after the mipmap streaming and budget are applied and loading is complete. - - - - - The total amount of memory that would be used by all textures at mipmap level 0. - - - - - This counter is incremented when the texture is updated. - - - - - Width of the texture in pixels. (Read Only) - - - - - Texture coordinate wrapping mode. - - - - - Texture U coordinate wrapping mode. - - - - - Texture V coordinate wrapping mode. - - - - - Texture W coordinate wrapping mode for Texture3D. - - - - - Can be used with texture constructors that take a mip count to indicate that all mips should be generated. The value of this field is -1. - - - - - Retrieve a native (underlying graphics API) pointer to the texture resource. - - - Pointer to an underlying graphics API texture resource. - - - - - Increment the update counter. - - - - - Sets Anisotropic limits. - - - - - - - Uploads additional debug information to materials using textures set to stream mip maps. - - - - - Class that represents textures in C# code. - - - - - Indicates whether this texture was imported with TextureImporter.alphaIsTransparency enabled. This setting is available only in the Editor scripts. Note that changing this setting will have no effect; it must be enabled in TextureImporter instead. - - - - - Gets a small Texture with all black pixels. - - - - - The mipmap level calculated by the streaming system, which takes into account the streaming Cameras and the location of the objects containing this Texture. This is unaffected by requestedMipmapLevel or minimumMipmapLevel. - - - - - The mipmap level that the streaming system would load before memory budgets are applied. - - - - - The format of the pixel data in the texture (Read Only). - - - - - Gets a small Texture with all gray pixels. - - - - - Returns true if the Read/Write Enabled checkbox was checked when the texture was imported; otherwise returns false. For a dynamic Texture created from script, always returns true. For additional information, see TextureImporter.isReadable. - - - - - Gets a small Texture with all gray pixels. - - - - - The mipmap level that is currently loaded by the streaming system. - - - - - The mipmap level that the mipmap streaming system is in the process of loading. - - - - - Restricts the mipmap streaming system to a minimum mip level for this Texture. - - - - - Gets a small Texture with pixels that represent surface normal vectors at a neutral position. - - - - - Gets a small Texture with all red pixels. - - - - - The mipmap level to load. - - - - - Determines whether mipmap streaming is enabled for this Texture. - - - - - Sets the relative priority for this Texture when reducing memory size to fit within the memory budget. - - - - - Returns true if the VTOnly checkbox was checked when the texture was imported; otherwise returns false. For additional information, see TextureImporter.vtOnly. - - - - - Gets a small Texture with all white pixels. - - - - - Actually apply all previous SetPixel and SetPixels changes. - - When set to true, mipmap levels are recalculated. - When set to true, system memory copy of a texture is released. - - - - Resets the minimumMipmapLevel field. - - - - - Resets the requestedMipmapLevel field. - - - - - Compress texture into DXT format. - - - - - - Creates a Unity Texture out of an externally created native texture object. - - Native 2D texture object. - Width of texture in pixels. - Height of texture in pixels. - Format of underlying texture object. - Does the texture have mipmaps? - Is texture using linear color space? - - - - - Create a new empty texture. - - - - - - - Create a new empty texture. - - - - - - - - - Create a new empty texture. - - - - - - - - - - Flags used to control the encoding to an EXR file. - - - - - This texture will use Wavelet compression. This is best used for grainy images. - - - - - The texture will use RLE (Run Length Encoding) EXR compression format (similar to Targa RLE compression). - - - - - The texture will use the EXR ZIP compression format. - - - - - No flag. This will result in an uncompressed 16-bit float EXR file. - - - - - The texture will be exported as a 32-bit float EXR file (default is 16-bit). - - - - - Packs a set of rectangles into a square atlas, with optional padding between rectangles. - - An array of rectangle dimensions. - Amount of padding to insert between adjacent rectangles in the atlas. - The size of the atlas. - - If the function succeeds, this will contain the packed rectangles. Otherwise, the return value is null. - - - - - Returns pixel color at coordinates (x, y). - - - - - - - Returns filtered pixel color at normalized coordinates (u, v). - - - - - - - Gets raw data from a Texture for reading or writing. - - The mip level to reference. - - - - Get the pixel colors from the texture. - - The mipmap level to fetch the pixels from. Defaults to zero. - - The array of all pixels in the mipmap level of the texture. - - - - - Get a block of pixel colors. - - The x position of the pixel array to fetch. - The y position of the pixel array to fetch. - The width length of the pixel array to fetch. - The height length of the pixel array to fetch. - The mipmap level to fetch the pixels. Defaults to zero, and is - optional. - - The array of pixels in the texture that have been selected. - - - - - Get a block of pixel colors in Color32 format. - - - - - - Get raw data from a texture for reading or writing. - - - Raw texture data view. - - - - - Get raw data from a texture. - - - Raw texture data as a byte array. - - - - - Checks to see whether the mipmap level set by requestedMipmapLevel has finished loading. - - - True if the mipmap level requested by requestedMipmapLevel has finished loading. - - - - - Fills texture pixels with raw preformatted data. - - Raw data array to initialize texture pixels with. - Size of data in bytes. - - - - Fills texture pixels with raw preformatted data. - - Raw data array to initialize texture pixels with. - Size of data in bytes. - - - - Fills texture pixels with raw preformatted data. - - Raw data array to initialize texture pixels with. - Size of data in bytes. - - - - Packs multiple Textures into a texture atlas. - - Array of textures to pack into the atlas. - Padding in pixels between the packed textures. - Maximum size of the resulting texture. - Should the texture be marked as no longer readable? - - An array of rectangles containing the UV coordinates in the atlas for each input texture, or null if packing fails. - - - - - Read pixels from screen into the saved texture data. - - Rectangular region of the view to read from. Pixels are read from current render target. - Horizontal pixel position in the texture to place the pixels that are read. - Vertical pixel position in the texture to place the pixels that are read. - Should the texture's mipmaps be recalculated after reading? - - - - Resizes the texture. - - - - - - - - - Resizes the texture. - - - - - - - Sets pixel color at coordinates (x,y). - - - - - - - - Set pixel values from raw preformatted data. - - Data array to initialize texture pixels with. - Mip level to fill. - Index in the source array to start copying from (default 0). - - - - Set pixel values from raw preformatted data. - - Data array to initialize texture pixels with. - Mip level to fill. - Index in the source array to start copying from (default 0). - - - - Set a block of pixel colors. - - The array of pixel colours to assign (a 2D image flattened to a 1D array). - The mip level of the texture to write to. - - - - Set a block of pixel colors. - - - - - - - - - - - Set a block of pixel colors. - - - - - - - Set a block of pixel colors. - - - - - - - - - - - Updates Unity texture to use different native texture object. - - Native 2D texture object. - - - - Class for handling 2D texture arrays. - - - - - Read Only. This property is used as a parameter in some overloads of the CommandBuffer.Blit, Graphics.Blit, CommandBuffer.SetRenderTarget, and Graphics.SetRenderTarget methods to indicate that all texture array slices are bound. The value of this property is -1. - - - - - Number of elements in a texture array (Read Only). - - - - - Texture format (Read Only). - - - - - Returns true if this texture array is Read/Write Enabled; otherwise returns false. For dynamic textures created from script, always returns true. - - - - - Actually apply all previous SetPixels changes. - - When set to true, mipmap levels are recalculated. - When set to true, system memory copy of a texture is released. - - - - Create a new texture array. - - Width of texture array in pixels. - Height of texture array in pixels. - Number of elements in the texture array. - Format of the texture. - Should mipmaps be created? - Does the texture contain non-color data (i.e. don't do any color space conversions when sampling)? Default is false. - - - - - - Create a new texture array. - - Width of texture array in pixels. - Height of texture array in pixels. - Number of elements in the texture array. - Format of the texture. - Should mipmaps be created? - Does the texture contain non-color data (i.e. don't do any color space conversions when sampling)? Default is false. - - - - - - Gets raw data from a Texture for reading or writing. - - The mip level to reference. - The array slice to reference. - - - - Returns pixel colors of a single array slice. - - Array slice to read pixels from. - Mipmap level to read pixels from. - - Array of pixel colors. - - - - - Returns pixel colors of a single array slice. - - Array slice to read pixels from. - Mipmap level to read pixels from. - - Array of pixel colors in low precision (8 bits/channel) format. - - - - - Set pixel values from raw preformatted data. - - Data array to initialize texture pixels with. - Mip level to fill. - Array slice to copy pixels to. - Index in the source array to start copying from (default 0). - - - - Set pixel values from raw preformatted data. - - Data array to initialize texture pixels with. - Mip level to fill. - Array slice to copy pixels to. - Index in the source array to start copying from (default 0). - - - - Set pixel colors for the whole mip level. - - An array of pixel colors. - The texture array element index. - The mip level. - - - - Set pixel colors for the whole mip level. - - An array of pixel colors. - The texture array element index. - The mip level. - - - - Class for handling 3D Textures, Use this to create. - - - - - The depth of the texture (Read Only). - - - - - The format of the pixel data in the texture (Read Only). - - - - - Returns true if this 3D texture is Read/Write Enabled; otherwise returns false. For dynamic textures created from script, always returns true. - - - - - Actually apply all previous SetPixels changes. - - When set to true, mipmap levels are recalculated. - When set to true, system memory copy of a texture is released. - - - - Creates Unity Texture out of externally created native texture object. - - Native 3D texture object. - Width of texture in pixels. - Height of texture in pixels. - Depth of texture in pixels - Format of underlying texture object. - Does the texture have mipmaps? - - - - - Create a new empty 3D Texture. - - Width of texture in pixels. - Height of texture in pixels. - Depth of texture in pixels. - Texture data format. - Determines whether the texture has mipmaps or not. A value of 1 (true) means the texture does have mipmaps, and a value of 0 (false) means the texture doesn't have mipmaps. - - - - Returns the pixel color that represents one mip level of the 3D texture at coordinates (x,y,z). - - X coordinate to access a pixel. - Y coordinate to access a pixel. - Z coordinate to access a pixel. - The mipmap level to be accessed. - - The color of the pixel. - - - - - Returns the filtered pixel color that represents one mip level of the 3D texture at normalized coordinates (u,v,w). - - U normalized coordinate to access a pixel. - V normalized coordinate to access a pixel. - W normalized coordinate to access a pixel. - The mipmap level to be accessed. - - The colors to return by bilinear filtering. - - - - - Gets raw data from a Texture for reading or writing. - - The mip level to reference. - - - - Returns an array of pixel colors representing one mip level of the 3D texture. - - The mipmap level to be accessed. - - The colors to get the array of pixels. - - - - - Returns an array of pixel colors representing one mip level of the 3D texture. - - The mipmap level to be accessed. - - The colors to get the array of pixels. - - - - - Sets the pixel color that represents one mip level of the 3D texture at coordinates (x,y,z). - - X coordinate to access a pixel. - Y coordinate to access a pixel. - Z coordinate to access a pixel. - The colors to set the pixels to. - The mipmap level to be affected by the new colors. - - - - Set pixel values from raw preformatted data. - - Data array to initialize texture pixels with. - Mip level to fill. - Index in the source array to start copying from (default 0). - - - - Set pixel values from raw preformatted data. - - Data array to initialize texture pixels with. - Mip level to fill. - Index in the source array to start copying from (default 0). - - - - Sets pixel colors of a 3D texture. - - The colors to set the pixels to. - The mipmap level to be affected by the new colors. - - - - Sets pixel colors of a 3D texture. - - The colors to set the pixels to. - The mipmap level to be affected by the new colors. - - - - Updates Unity texture to use different native texture object. - - Native 3D texture object. - - - - Format used when creating textures from scripts. - - - - - Alpha-only texture format, 8 bit integer. - - - - - Color with alpha texture format, 8-bits per channel. - - - - - A 16 bits/pixel texture format. Texture stores color with an alpha channel. - - - - - ASTC (10x10 pixel block in 128 bits) compressed RGB(A) texture format. - - - - - ASTC (12x12 pixel block in 128 bits) compressed RGB(A) texture format. - - - - - ASTC (4x4 pixel block in 128 bits) compressed RGB(A) texture format. - - - - - ASTC (5x5 pixel block in 128 bits) compressed RGB(A) texture format. - - - - - ASTC (6x6 pixel block in 128 bits) compressed RGB(A) texture format. - - - - - ASTC (8x8 pixel block in 128 bits) compressed RGB(A) texture format. - - - - - ASTC (10x10 pixel block in 128 bits) compressed RGB(A) HDR texture format. - - - - - ASTC (12x12 pixel block in 128 bits) compressed RGB(A) HDR texture format. - - - - - ASTC (4x4 pixel block in 128 bits) compressed RGB(A) HDR texture format. - - - - - ASTC (5x5 pixel block in 128 bits) compressed RGB(A) HDR texture format. - - - - - ASTC (6x6 pixel block in 128 bits) compressed RGB(A) HDR texture format. - - - - - ASTC (8x8 pixel block in 128 bits) compressed RGB(A) texture format. - - - - - ASTC (10x10 pixel block in 128 bits) compressed RGB texture format. - - - - - ASTC (12x12 pixel block in 128 bits) compressed RGB texture format. - - - - - ASTC (4x4 pixel block in 128 bits) compressed RGB texture format. - - - - - ASTC (5x5 pixel block in 128 bits) compressed RGB texture format. - - - - - ASTC (6x6 pixel block in 128 bits) compressed RGB texture format. - - - - - ASTC (8x8 pixel block in 128 bits) compressed RGB texture format. - - - - - ASTC (10x10 pixel block in 128 bits) compressed RGBA texture format. - - - - - ASTC (12x12 pixel block in 128 bits) compressed RGBA texture format. - - - - - ASTC (4x4 pixel block in 128 bits) compressed RGBA texture format. - - - - - ASTC (5x5 pixel block in 128 bits) compressed RGBA texture format. - - - - - ASTC (6x6 pixel block in 128 bits) compressed RGBA texture format. - - - - - ASTC (8x8 pixel block in 128 bits) compressed RGBA texture format. - - - - - Compressed one channel (R) texture format. - - - - - Compressed two-channel (RG) texture format. - - - - - HDR compressed color texture format. - - - - - High quality compressed color texture format. - - - - - Color with alpha texture format, 8-bits per channel. - - - - - Compressed color texture format. - - - - - Compressed color texture format with Crunch compression for smaller storage sizes. - - - - - Compressed color with alpha channel texture format. - - - - - Compressed color with alpha channel texture format with Crunch compression for smaller storage sizes. - - - - - ETC2 EAC (GL ES 3.0) 4 bitspixel compressed unsigned single-channel texture format. - - - - - ETC2 EAC (GL ES 3.0) 4 bitspixel compressed signed single-channel texture format. - - - - - ETC2 EAC (GL ES 3.0) 8 bitspixel compressed unsigned dual-channel (RG) texture format. - - - - - ETC2 EAC (GL ES 3.0) 8 bitspixel compressed signed dual-channel (RG) texture format. - - - - - ETC (GLES2.0) 4 bits/pixel compressed RGB texture format. - - - - - ETC 4 bits/pixel compressed RGB texture format. - - - - - Compressed color texture format with Crunch compression for smaller storage sizes. - - - - - ETC 4 bitspixel RGB + 4 bitspixel Alpha compressed texture format. - - - - - ETC2 (GL ES 3.0) 4 bits/pixel compressed RGB texture format. - - - - - ETC2 (GL ES 3.0) 4 bits/pixel RGB+1-bit alpha texture format. - - - - - ETC2 (GL ES 3.0) 8 bits/pixel compressed RGBA texture format. - - - - - Compressed color with alpha channel texture format using Crunch compression for smaller storage sizes. - - - - - PowerVR (iOS) 2 bits/pixel compressed color texture format. - - - - - PowerVR (iOS) 4 bits/pixel compressed color texture format. - - - - - PowerVR (iOS) 2 bits/pixel compressed with alpha channel texture format. - - - - - PowerVR (iOS) 4 bits/pixel compressed with alpha channel texture format. - - - - - Single channel (R) texture format, 16 bit integer. - - - - - Single channel (R) texture format, 8 bit integer. - - - - - Scalar (R) texture format, 32 bit floating point. - - - - - Two color (RG) texture format, 8-bits per channel. - - - - - Two channel (RG) texture format, 16 bit integer per channel. - - - - - Color texture format, 8-bits per channel. - - - - - Three channel (RGB) texture format, 16 bit integer per channel. - - - - - A 16 bit color texture format. - - - - - RGB HDR format, with 9 bit mantissa per channel and a 5 bit shared exponent. - - - - - Color with alpha texture format, 8-bits per channel. - - - - - Color and alpha texture format, 4 bit per channel. - - - - - Four channel (RGBA) texture format, 16 bit integer per channel. - - - - - RGB color and alpha texture format, 32-bit floats per channel. - - - - - RGB color and alpha texture format, 16 bit floating point per channel. - - - - - Two color (RG) texture format, 32 bit floating point per channel. - - - - - Two color (RG) texture format, 16 bit floating point per channel. - - - - - Scalar (R) texture format, 16 bit floating point. - - - - - A format that uses the YUV color space and is often used for video encoding or playback. - - - - - Wrap mode for textures. - - - - - Clamps the texture to the last pixel at the edge. - - - - - Tiles the texture, creating a repeating pattern by mirroring it at every integer boundary. - - - - - Mirrors the texture once, then clamps to edge pixels. - - - - - Tiles the texture, creating a repeating pattern. - - - - - Priority of a thread. - - - - - Below normal thread priority. - - - - - Highest thread priority. - - - - - Lowest thread priority. - - - - - Normal thread priority. - - - - - Class passed onto Tiles when information is queried from the Tiles. - - - - - Returns the boundaries of the Tilemap in cell size. - - - - - Returns the boundaries of the Tilemap in local space size. - - - - - The origin of the Tilemap in cell position. - - - - - The size of the Tilemap in cells. - - - - - Gets the color of a Tile given the XYZ coordinates of a cell in the Tilemap. - - Position of the Tile on the Tilemap. - - Color of the at the XY coordinate. - - - - - Returns the component of type T if the GameObject of the tile map has one attached, null if it doesn't. - - - The Component of type T to retrieve. - - - - - Gets the Sprite used in a Tile given the XYZ coordinates of a cell in the Tilemap. - - Position of the Tile on the Tilemap. - - Sprite at the XY coordinate. - - - - - Gets the Tile at the given XYZ coordinates of a cell in the|Tilemap. - - Position of the Tile on the Tilemap. - - placed at the cell. - - - - - Gets the Tile of type T at the given XYZ coordinates of a cell in the Tilemap. - - Position of the Tile on the Tilemap. - - placed at the cell. - - - - - Gets the Tile Flags of the Tile at the given position. - - Position of the Tile on the Tilemap. - - TileFlags from the Tile. - - - - - Gets the transform matrix of a Tile given the XYZ coordinates of a cell in the Tilemap. - - Position of the Tile on the Tilemap. - - The transform matrix. - - - - - Refreshes a Tile at the given XYZ coordinates of a cell in the :Tilemap. - - Position of the Tile on the Tilemap. - - - - Class for a default tile in the Tilemap. - - - - - Color of the Tile. - - - - - TileFlags of the Tile. - - - - - GameObject of the Tile. - - - - - Sprite to be rendered at the Tile. - - - - - Matrix4x4|Transform matrix of the Tile. - - - - - Enum for determining what collider shape is generated for this Tile by the TilemapCollider2D. - - - - - The grid layout boundary outline is used as the collider shape for the Tile by the TilemapCollider2D. - - - - - No collider shape is generated for the Tile by the TilemapCollider2D. - - - - - The Sprite outline is used as the collider shape for the Tile by the TilemapCollider2D. - - - - - Retrieves the tile rendering data for the Tile. - - Position of the Tile on the Tilemap. - The Tilemap the tile is present on. - Data to render the tile. This is filled with Tile, Tile.color and Tile.transform. - - Whether the call was successful. This returns true for Tile. - - - - - A Struct for the required data for animating a Tile. - - - - - The array of that are ordered by appearance in the animation. - - - - - The animation speed. - - - - - The start time of the animation. The animation will begin at this time offset. - - - - - Base class for a tile in the Tilemap. - - - - - Retrieves any tile animation data from the scripted tile. - - Position of the Tile on the Tilemap. - The Tilemap the tile is present on. - Data to run an animation on the tile. - - Whether the call was successful. - - - - - Retrieves any tile rendering data from the scripted tile. - - Position of the Tile on the Tilemap. - The Tilemap the tile is present on. - Data to render the tile. - - Whether the call was successful. - - - - - This method is called when the tile is refreshed. - - Position of the Tile on the Tilemap. - The Tilemap the tile is present on. - - - - StartUp is called on the first frame of the running Scene. - - Position of the Tile on the Tilemap. - The Tilemap the tile is present on. - The GameObject instantiated for the Tile. - - Whether the call was successful. - - - - - A Struct for the required data for rendering a Tile. - - - - - Color of the Tile. - - - - - TileFlags of the Tile. - - - - - GameObject of the Tile. - - - - - Sprite to be rendered at the Tile. - - - - - Matrix4x4|Transform matrix of the Tile. - - - - - Flags controlling behavior for the TileBase. - - - - - TileBase does not instantiate its associated GameObject in editor mode and instantiates it only during play mode. - - - - - All lock flags. - - - - - TileBase locks any color set by brushes or the user. - - - - - TileBase locks any transform matrix set by brushes or the user. - - - - - No TileFlags are set. - - - - - The tile map stores component. - - - - - The frame rate for all tile animations in the tile map. - - - - - Returns the boundaries of the Tilemap in cell size. - - - - - The color of the tile map layer. - - - - - The origin of the Tilemap in cell position inclusive of editor preview tiles. - - - - - The size of the Tilemap in cells inclusive of editor preview tiles. - - - - - Gets the Grid associated with this tile map. - - - - - Gets the Grid associated with this tile map. - - - - - Returns the boundaries of the Tilemap in local space size. - - - - - Orientation of the tiles in the Tilemap. - - - - - Orientation Matrix of the orientation of the tiles in the Tilemap. - - - - - The origin of the Tilemap in cell position. - - - - - The size of the Tilemap in cells. - - - - - Gets the anchor point of tiles in the Tilemap. - - - - - Callback when Tiles on a Tilemap have changed. - - A callback set by a user to notify them when Tiles are changed on a Tilemap. - - - - Adds the TileFlags onto the Tile at the given position. - - Position of the Tile on the Tilemap. - TileFlags to add (with bitwise or) onto the flags provided by Tile.TileBase. - - - - Does a box fill with the given. Starts from given coordinates and fills the limits from start to end (inclusive). - - Position of the Tile on the Tilemap. - to place. - The minimum X coordinate limit to fill to. - The minimum Y coordinate limit to fill to. - The maximum X coordinate limit to fill to. - The maximum Y coordinate limit to fill to. - - - - Clears all editor preview tiles that are placed in the Tilemap. - - - - - Clears all tiles that are placed in the Tilemap. - - - - - Compresses the origin and size of the Tilemap to bounds where tiles exist. - - - - - Returns true if the Tilemap contains the given. Returns false if not. - - Tile to check. - - Whether the Tilemap contains the tile. - - - - - Removes cells from within the Tilemap's bounds. - - The target position to remove from. - The number of columns, rows and layers of cells to remove. - - - - Removes cells from within the Tilemap's bounds. - - Target position to delete from. - The number of columns to remove. - The number of rows to remove. - The number of layers of cells to remove. - - - - Does an editor preview of a box fill with the given. Starts from given coordinates and fills the limits from start to end (inclusive). - - Position of the Tile on the Tilemap. - to place. - The start X coordinate limit to fill to. - The start Y coordinate limit to fill to. - The ending X coordinate limit to fill to. - The ending Y coordinate limit to fill to. - - - - Does an editor preview of a flood fill with the given starting from the given coordinates. - - Start position of the flood fill on the Tilemap. - TileBase to place. - - - - Does a flood fill with the given starting from the given coordinates. - - Start position of the flood fill on the Tilemap. - to place. - - - - Get the logical center coordinate of a grid cell in local space. - - Grid cell position. - - Center of the cell transformed into local space coordinates. - - - - - Get the logical center coordinate of a grid cell in world space. - - Grid cell position. - - Center of the cell transformed into world space coordinates. - - - - - Gets the collider type of a. - - Position of the Tile on the Tilemap. - - Collider type of the at the XY coordinate. - - - - - Gets the color of a. - - Position of the Tile on the Tilemap. - - Color of the at the XY coordinate. - - - - - Gets the Color of an editor preview. - - Position of the Tile on the Tilemap. - - Color of the editor preview at the XY coordinate. - - - - - Gets the. - - Position of the editor preview Tile on the Tilemap. - - Sprite at the XY coordinate. - - - - - Gets the editor preview. - - Position of the editor preview Tile on the Tilemap. - - The editor preview placed at the cell. - - - - - Gets the editor preview. - - Position of the editor preview Tile on the Tilemap. - - The editor preview placed at the cell. - - - - - Gets the TileFlags of the editor preview Tile at the given position. - - Position of the Tile on the Tilemap. - - TileFlags from the editor preview Tile. - - - - - Gets the transform matrix of an editor preview. - - Position of the editor preview Tile on the Tilemap. - - The transform matrix. - - - - - Gets the. - - Position of the Tile on the Tilemap. - - GameObject instantiated by the Tile at the position. - - - - - Gets the. - - The position of the Tile on the Tilemap. - - Returns the GameObject to be instantiated by the Tile at the position. - - - - - Gets the. - - Position of the Tile on the Tilemap. - - Sprite at the XY coordinate. - - - - - Gets the. - - Position of the Tile on the Tilemap. - - Tilemaps.TileBase placed at the cell. - - - - - Gets the. - - Position of the Tile on the Tilemap. - - Tilemaps.TileBase|Tile of type T placed at the cell. - - - - - Gets the TileFlags of the Tile at the given position. - - Position of the Tile on the Tilemap. - - TileFlags from the Tile. - - - - - Retrieves an array of tiles with the given bounds. - - Bounds to retrieve from. - - An array of at the given bounds. - - - - - Gets the transform matrix of a. - - Position of the Tile on the Tilemap. - - The transform matrix. - - - - - Get the total number of different. - - - The total number of different. - - - - - Fills the given array with the total number of different and returns the number of tiles filled. - - The array to be filled. - - The number of tiles filled. - - - - - Returns whether there is an editor preview tile at the position. - - Position to check. - - Returns true if there is an Editor Preview Tile at the position. Returns false otherwise. - - - - - Returns whether there is a tile at the position. - - Position to check. - - Returns true if there is a Tile at the position. Returns false otherwise. - - - - - Inserts cells into the Tilemap. - - The target position to insert at. - The number of columns, rows or layers of cells to insert. - - - - Inserts cells into the Tilemap. - - The target position to insert at. - The number of columns to insert. - The number of rows to insert. - The number of layers of cells to insert. - - - - Determines the orientation of. - - - - - Use a custom orientation to all tiles in the tile map. - - - - - Orients tiles in the XY plane. - - - - - Orients tiles in the XZ plane. - - - - - Orients tiles in the YX plane. - - - - - Orients tiles in the YZ plane. - - - - - Orients tiles in the ZX plane. - - - - - Orients tiles in the ZY plane. - - - - - Refreshes all. The tile map will retrieve the rendering data, animation data and other data for all tiles and update all relevant components. - - - - - Refreshes a. - - Position of the Tile on the Tilemap. - - - - Removes the TileFlags onto the Tile at the given position. - - Position of the Tile on the Tilemap. - TileFlags to remove from the Tile. - - - - Resizes tiles in the Tilemap to bounds defined by origin and size. - - - - - Sets the collider type of a. - - Position of the Tile on the Tilemap. - Collider type to set the to at the XYZ coordinate. - - - - Sets the color of a. - - Position of the Tile on the Tilemap. - Color to set the to at the XY coordinate. - - - - Sets the color of an editor preview. - - Position of the editor preview Tile on the Tilemap. - Color to set the editor preview to at the XY coordinate. - - - - Sets an editor preview. - - Position of the editor preview Tile on the Tilemap. - The editor preview to be placed the cell. - - - - Sets the transform matrix of an editor preview tile given the XYZ coordinates of a cell in the. - - Position of the editor preview Tile on the Tilemap. - The transform matrix. - - - - Sets a. - - Position of the Tile on the Tilemap. - to be placed the cell. - - - - Sets the TileFlags onto the Tile at the given position. - - Position of the Tile on the Tilemap. - TileFlags to add onto the Tile. - - - - Sets an array of. - - An array of positions of Tiles on the Tilemap. - An array of to be placed. - - - - Fills bounds with array of tiles. - - Bounds to be filled. - An array of to be placed. - - - - Sets the transform matrix of a tile given the XYZ coordinates of a cell in the. - - Position of the Tile on the Tilemap. - The transform matrix. - - - - Swaps all existing tiles of changeTile to newTile and refreshes all the swapped tiles. - - Tile to swap. - Tile to swap to. - - - - A Struct for containing changes to a Tile when it has been changed on a Tilemap. - - - - - The position of the Tile on a Tilemap which has changed. - - - - - The Tile at the given position on the Tilemap. - - - - - The properties of the Tile at the given position on the Tilemap. - - - - - Collider for 2D physics representing shapes defined by the corresponding Tilemap. - - - - - The amount of Collider shapes each Tile extrudes to facilitate compositing with neighboring Tiles. This eliminates fine gaps between Tiles when using a CompositeCollider2D. This is calculated in Unity units within world space. - - - - - Returns true if there are Tilemap changes that require processing for Collider updates. Returns false otherwise. - - - - - Maximum number of Tile Changes accumulated before doing a full collider rebuild instead of an incremental rebuild. - - - - - Processes Tilemap changes for Collider updates immediately, if there are any. - - - - - The tile map renderer is used to render the tile map marked out by a component. - - - - - Bounds used for culling of Tilemap chunks. - - - - - Size in number of tiles of each chunk created by the TilemapRenderer. - - - - - Returns whether the TilemapRenderer automatically detects the bounds to extend chunk culling by. - - - - - Specifies how the Tilemap interacts with the masks. - - - - - Maximum number of chunks the TilemapRenderer caches in memory. - - - - - Maximum number of frames the TilemapRenderer keeps unused chunks in memory. - - - - - The mode in which the TileMapRenderer batches the for rendering. - - - - - Active sort order for the TilemapRenderer. - - - - - Returns whether the TilemapRenderer automatically detects the bounds to extend chunk culling by. - - - - - The TilemapRenderer will automatically detect the bounds of extension by inspecting the Sprite/s used in the Tilemap. - - - - - The user adds in the values used for extend the bounds for culling of Tilemap chunks. - - - - - Determines how the TilemapRenderer should batch the for rendering. - - - - - Batches each Sprite from the Tilemap into grouped chunks to be rendered. - - - - - Sends each Sprite from the Tilemap to be rendered individually. - - - - - Sort order for all tiles rendered by the TilemapRenderer. - - - - - Sorts tiles for rendering starting from the tile with the lowest X and the lowest Y cell positions. - - - - - Sorts tiles for rendering starting from the tile with the highest X and the lowest Y cell positions. - - - - - Sorts tiles for rendering starting from the tile with the lowest X and the highest Y cell positions. - - - - - Sorts tiles for rendering starting from the tile with the highest X and the lowest Y cell positions. - - - - - The interface to get time information from Unity. - - - - - Slows game playback time to allow screenshots to be saved between frames. - - - - - The reciprocal of Time.captureDeltaTime. - - - - - The completion time in seconds since the last frame (Read Only). - - - - - The interval in seconds at which physics and other fixed frame rate updates (like MonoBehaviour's MonoBehaviour.FixedUpdate) are performed. - - - - - The time the latest MonoBehaviour.FixedUpdate has started (Read Only). This is the time in seconds since the start of the game. - - - - - The time the latest MonoBehaviour.FixedUpdate has started (Read Only). This is the time in seconds since the start of the game. - - - - - The timeScale-independent interval in seconds from the last fixed frame to the current one (Read Only). - - - - - The TimeScale-independant time the latest MonoBehaviour.FixedUpdate has started (Read Only). This is the time in seconds since the start of the game. - - - - - The TimeScale-independant time the latest MonoBehaviour.FixedUpdate has started (Read Only). This is the time in seconds since the start of the game. - - - - - The total number of frames that have passed (Read Only). - - - - - Returns true if called inside a fixed time step callback (like MonoBehaviour's MonoBehaviour.FixedUpdate), otherwise returns false. - - - - - The maximum time a frame can take. Physics and other fixed frame rate updates (like MonoBehaviour's MonoBehaviour.FixedUpdate) will be performed only for this duration of time per frame. - - - - - The maximum time a frame can spend on particle updates. If the frame takes longer than this, then updates are split into multiple smaller updates. - - - - - The real time in seconds since the game started (Read Only). - - - - - The real time in seconds since the game started (Read Only). Double precision version of Time.realtimeSinceStartup. This offers more precision than a float or single value, particularly over extended periods of real-world time. In almost all cases, choose the Time.realtimeSinceStartupAsDouble equivalent over Time.realtimeSinceStartup. - - - - - A smoothed out Time.deltaTime (Read Only). - - - - - The time at the beginning of this frame (Read Only). This is the time in seconds since the start of the game. - - - - - The time at the beginning of this frame (Read Only). This is the time in seconds since the start of the game. - - - - - The scale at which time passes. This can be used for slow motion effects. - - - - - The time this frame has started (Read Only). This is the time in seconds since the last level has been loaded. - - - - - The time this frame has started (Read Only). This is the time in seconds since the last level has been loaded. - - - - - The timeScale-independent interval in seconds from the last frame to the current one (Read Only). - - - - - The timeScale-independant time for this frame (Read Only). This is the time in seconds since the start of the game. - - - - - The timeScale-independant time for this frame (Read Only). This is the time in seconds since the start of the game. - - - - - Specify a tooltip for a field in the Inspector window. - - - - - The tooltip text. - - - - - Specify a tooltip for a field. - - The tooltip text. - - - - Structure describing the status of a finger touching the screen. - - - - - Value of 0 radians indicates that the stylus is parallel to the surface, pi/2 indicates that it is perpendicular. - - - - - Value of 0 radians indicates that the stylus is pointed along the x-axis of the device. - - - - - The position delta since last change in pixel coordinates. - - - - - Amount of time that has passed since the last recorded change in Touch values. - - - - - The unique index for the touch. - - - - - The maximum possible pressure value for a platform. If Input.touchPressureSupported returns false, the value of this property will always be 1.0f. - - - - - Describes the phase of the touch. - - - - - The position of the touch in screen space pixel coordinates. - - - - - The current amount of pressure being applied to a touch. 1.0f is considered to be the pressure of an average touch. If Input.touchPressureSupported returns false, the value of this property will always be 1.0f. - - - - - An estimated value of the radius of a touch. Add radiusVariance to get the maximum touch size, subtract it to get the minimum touch size. - - - - - This value determines the accuracy of the touch radius. Add this value to the radius to get the maximum touch size, subtract it to get the minimum touch size. - - - - - The first position of the touch contact in screen space pixel coordinates. - - - - - Number of taps. - - - - - A value that indicates whether a touch was of Direct, Indirect (or remote), or Stylus type. - - - - - Describes phase of a finger touch. - - - - - A finger touched the screen. - - - - - The system cancelled tracking for the touch. - - - - - A finger was lifted from the screen. This is the final phase of a touch. - - - - - A finger moved on the screen. - - - - - A finger is touching the screen but hasn't moved. - - - - - Interface for on-screen keyboards. Only native iPhone, Android, and Windows Store Apps are supported. - - - - - Is the keyboard visible or sliding into the position on the screen? - - - - - Returns portion of the screen which is covered by the keyboard. - - - - - Specifies whether the TouchScreenKeyboard supports the selection property. (Read Only) - - - - - Specifies whether the TouchScreenKeyboard supports the selection property. (Read Only) - - - - - How many characters the keyboard input field is limited to. 0 = infinite. - - - - - Specifies if input process was finished. (Read Only) - - - - - Will text input field above the keyboard be hidden when the keyboard is on screen? - - - - - Checks if the text within an input field can be selected and modified while TouchScreenKeyboard is open. - - - Returns true when you are able to select and modify the input field, returns false otherwise. - - - - - Is touch screen keyboard supported. - - - - - Gets or sets the character range of the selected text within the string currently being edited. - - - - - Returns the status of the on-screen keyboard. (Read Only) - - - - - Specified on which display the on-screen keyboard will appear. - - - - - Returns the text displayed by the input field of the keyboard. - - - - - Returns the TouchScreenKeyboardType of the keyboard. - - - - - Returns true whenever any keyboard is visible on the screen. - - - - - Specifies if input process was canceled. (Read Only) - - - - - Opens the native keyboard provided by OS on the screen. - - Text to edit. - Type of keyboard (eg, any text, numbers only, etc). - Is autocorrection applied? - Can more than one line of text be entered? - Is the text masked (for passwords, etc)? - Is the keyboard opened in alert mode? - Text to be used if no other text is present. - How many characters the keyboard input field is limited to. 0 = infinite. (Android and iOS only) - - - - Opens the native keyboard provided by OS on the screen. - - Text to edit. - Type of keyboard (eg, any text, numbers only, etc). - Is autocorrection applied? - Can more than one line of text be entered? - Is the text masked (for passwords, etc)? - Is the keyboard opened in alert mode? - Text to be used if no other text is present. - How many characters the keyboard input field is limited to. 0 = infinite. (Android and iOS only) - - - - Opens the native keyboard provided by OS on the screen. - - Text to edit. - Type of keyboard (eg, any text, numbers only, etc). - Is autocorrection applied? - Can more than one line of text be entered? - Is the text masked (for passwords, etc)? - Is the keyboard opened in alert mode? - Text to be used if no other text is present. - How many characters the keyboard input field is limited to. 0 = infinite. (Android and iOS only) - - - - Opens the native keyboard provided by OS on the screen. - - Text to edit. - Type of keyboard (eg, any text, numbers only, etc). - Is autocorrection applied? - Can more than one line of text be entered? - Is the text masked (for passwords, etc)? - Is the keyboard opened in alert mode? - Text to be used if no other text is present. - How many characters the keyboard input field is limited to. 0 = infinite. (Android and iOS only) - - - - Opens the native keyboard provided by OS on the screen. - - Text to edit. - Type of keyboard (eg, any text, numbers only, etc). - Is autocorrection applied? - Can more than one line of text be entered? - Is the text masked (for passwords, etc)? - Is the keyboard opened in alert mode? - Text to be used if no other text is present. - How many characters the keyboard input field is limited to. 0 = infinite. (Android and iOS only) - - - - Opens the native keyboard provided by OS on the screen. - - Text to edit. - Type of keyboard (eg, any text, numbers only, etc). - Is autocorrection applied? - Can more than one line of text be entered? - Is the text masked (for passwords, etc)? - Is the keyboard opened in alert mode? - Text to be used if no other text is present. - How many characters the keyboard input field is limited to. 0 = infinite. (Android and iOS only) - - - - Opens the native keyboard provided by OS on the screen. - - Text to edit. - Type of keyboard (eg, any text, numbers only, etc). - Is autocorrection applied? - Can more than one line of text be entered? - Is the text masked (for passwords, etc)? - Is the keyboard opened in alert mode? - Text to be used if no other text is present. - How many characters the keyboard input field is limited to. 0 = infinite. (Android and iOS only) - - - - Opens the native keyboard provided by OS on the screen. - - Text to edit. - Type of keyboard (eg, any text, numbers only, etc). - Is autocorrection applied? - Can more than one line of text be entered? - Is the text masked (for passwords, etc)? - Is the keyboard opened in alert mode? - Text to be used if no other text is present. - How many characters the keyboard input field is limited to. 0 = infinite. (Android and iOS only) - - - - The status of the on-screen keyboard. - - - - - The on-screen keyboard was canceled. - - - - - The user has finished providing input. - - - - - The on-screen keyboard has lost focus. - - - - - The on-screen keyboard is visible. - - - - - Enumeration of the different types of supported touchscreen keyboards. - - - - - Keyboard with standard ASCII keys. - - - - - Keyboard with numbers and a decimal point. - - - - - The default keyboard layout of the target platform. - - - - - Keyboard with additional keys suitable for typing email addresses. - - - - - Keyboard with alphanumeric keys. - - - - - Keyboard for the Nintendo Network (Deprecated). - - - - - Keyboard with standard numeric keys. - - - - - Keyboard with numbers and punctuation mark keys. - - - - - Keyboard with standard numeric keys. - - - - - Keyboard with a layout suitable for typing telephone numbers. - - - - - Keyboard with the "." key beside the space key, suitable for typing search terms. - - - - - Keyboard with symbol keys often used on social media, such as Twitter. - - - - - Keyboard with keys for URL entry. - - - - - Describes whether a touch is direct, indirect (or remote), or from a stylus. - - - - - A direct touch on a device. - - - - - An Indirect, or remote, touch on a device. - - - - - A touch from a stylus on a device. - - - - - The trail renderer is used to make trails behind objects in the Scene as they move about. - - - - - Select whether the trail will face the camera, or the orientation of the Transform Component. - - - - - Does the GameObject of this Trail Renderer auto destruct? - - - - - Set the color gradient describing the color of the trail at various points along its length. - - - - - Creates trails when the GameObject moves. - - - - - Set the color at the end of the trail. - - - - - The width of the trail at the end of the trail. - - - - - Configures a trail to generate Normals and Tangents. With this data, Scene lighting can affect the trail via Normal Maps and the Unity Standard Shader, or your own custom-built Shaders. - - - - - Set the minimum distance the trail can travel before a new vertex is added to it. - - - - - Set this to a value greater than 0, to get rounded corners on each end of the trail. - - - - - Set this to a value greater than 0, to get rounded corners between each segment of the trail. - - - - - Get the number of line segments in the trail. - - - - - Get the number of line segments in the trail. - - - - - Apply a shadow bias to prevent self-shadowing artifacts. The specified value is the proportion of the trail width at each segment. - - - - - Set the color at the start of the trail. - - - - - The width of the trail at the spawning point. - - - - - Choose whether the U coordinate of the trail texture is tiled or stretched. - - - - - How long does the trail take to fade out. - - - - - Set the curve describing the width of the trail at various points along its length. - - - - - Set an overall multiplier that is applied to the TrailRenderer.widthCurve to get the final width of the trail. - - - - - Adds a position to the trail. - - The position to add to the trail. - - - - Add an array of positions to the trail. - - The positions to add to the trail. - - - - Add an array of positions to the trail. - - The positions to add to the trail. - - - - Add an array of positions to the trail. - - The positions to add to the trail. - - - - Creates a snapshot of TrailRenderer and stores it in mesh. - - A static mesh that will receive the snapshot of the trail. - The camera used for determining which way camera-space trails will face. - Include the rotation and scale of the Transform in the baked mesh. - - - - Creates a snapshot of TrailRenderer and stores it in mesh. - - A static mesh that will receive the snapshot of the trail. - The camera used for determining which way camera-space trails will face. - Include the rotation and scale of the Transform in the baked mesh. - - - - Creates a snapshot of TrailRenderer and stores it in mesh. - - A static mesh that will receive the snapshot of the trail. - The camera used for determining which way camera-space trails will face. - Include the rotation and scale of the Transform in the baked mesh. - - - - Creates a snapshot of TrailRenderer and stores it in mesh. - - A static mesh that will receive the snapshot of the trail. - The camera used for determining which way camera-space trails will face. - Include the rotation and scale of the Transform in the baked mesh. - - - - Removes all points from the TrailRenderer. -Useful for restarting a trail from a new position. - - - - - Get the position of a vertex in the trail. - - The index of the position to retrieve. - - The position at the specified index in the array. - - - - - Get the positions of all vertices in the trail. - - The array of positions to retrieve. - - How many positions were actually stored in the output array. - - - - - Get the positions of all vertices in the trail. - - The array of positions to retrieve. - - How many positions were actually stored in the output array. - - - - - Get the positions of all vertices in the trail. - - The array of positions to retrieve. - - How many positions were actually stored in the output array. - - - - - Set the position of a vertex in the trail. - - Which position to set. - The new position. - - - - Sets the positions of all vertices in the trail. - - The array of positions to set. - - - - Sets the positions of all vertices in the trail. - - The array of positions to set. - - - - Sets the positions of all vertices in the trail. - - The array of positions to set. - - - - Position, rotation and scale of an object. - - - - - The number of children the parent Transform has. - - - - - The rotation as Euler angles in degrees. - - - - - Returns a normalized vector representing the blue axis of the transform in world space. - - - - - Has the transform changed since the last time the flag was set to 'false'? - - - - - The transform capacity of the transform's hierarchy data structure. - - - - - The number of transforms in the transform's hierarchy data structure. - - - - - The rotation as Euler angles in degrees relative to the parent transform's rotation. - - - - - Position of the transform relative to the parent transform. - - - - - The rotation of the transform relative to the transform rotation of the parent. - - - - - The scale of the transform relative to the GameObjects parent. - - - - - Matrix that transforms a point from local space into world space (Read Only). - - - - - The global scale of the object (Read Only). - - - - - The parent of the transform. - - - - - The world space position of the Transform. - - - - - The red axis of the transform in world space. - - - - - Returns the topmost transform in the hierarchy. - - - - - A Quaternion that stores the rotation of the Transform in world space. - - - - - The green axis of the transform in world space. - - - - - Matrix that transforms a point from world space into local space (Read Only). - - - - - Unparents all children. - - - - - Finds a child by n and returns it. - - Name of child to be found. - - The returned child transform or null if no child is found. - - - - - Returns a transform child by index. - - Index of the child transform to return. Must be smaller than Transform.childCount. - - Transform child by index. - - - - - Gets the sibling index. - - - - - Transforms a direction from world space to local space. The opposite of Transform.TransformDirection. - - - - - - Transforms the direction x, y, z from world space to local space. The opposite of Transform.TransformDirection. - - - - - - - - Transforms position from world space to local space. - - - - - - Transforms the position x, y, z from world space to local space. The opposite of Transform.TransformPoint. - - - - - - - - Transforms a vector from world space to local space. The opposite of Transform.TransformVector. - - - - - - Transforms the vector x, y, z from world space to local space. The opposite of Transform.TransformVector. - - - - - - - - Is this transform a child of parent? - - - - - - Rotates the transform so the forward vector points at target's current position. - - Object to point towards. - Vector specifying the upward direction. - - - - Rotates the transform so the forward vector points at target's current position. - - Object to point towards. - Vector specifying the upward direction. - - - - Rotates the transform so the forward vector points at worldPosition. - - Point to look at. - Vector specifying the upward direction. - - - - Rotates the transform so the forward vector points at worldPosition. - - Point to look at. - Vector specifying the upward direction. - - - - Applies a rotation of eulerAngles.z degrees around the z-axis, eulerAngles.x degrees around the x-axis, and eulerAngles.y degrees around the y-axis (in that order). - - The rotation to apply in euler angles. - Determines whether to rotate the GameObject either locally to the GameObject or relative to the Scene in world space. - - - - The implementation of this method applies a rotation of zAngle degrees around the z axis, xAngle degrees around the x axis, and yAngle degrees around the y axis (in that order). - - Determines whether to rotate the GameObject either locally to the GameObject or relative to the Scene in world space. - Degrees to rotate the GameObject around the X axis. - Degrees to rotate the GameObject around the Y axis. - Degrees to rotate the GameObject around the Z axis. - - - - Rotates the object around the given axis by the number of degrees defined by the given angle. - - The degrees of rotation to apply. - The axis to apply rotation to. - Determines whether to rotate the GameObject either locally to the GameObject or relative to the Scene in world space. - - - - Applies a rotation of eulerAngles.z degrees around the z-axis, eulerAngles.x degrees around the x-axis, and eulerAngles.y degrees around the y-axis (in that order). - - The rotation to apply in euler angles. - - - - The implementation of this method applies a rotation of zAngle degrees around the z axis, xAngle degrees around the x axis, and yAngle degrees around the y axis (in that order). - - Degrees to rotate the GameObject around the X axis. - Degrees to rotate the GameObject around the Y axis. - Degrees to rotate the GameObject around the Z axis. - - - - Rotates the object around the given axis by the number of degrees defined by the given angle. - - The axis to apply rotation to. - The degrees of rotation to apply. - - - - Rotates the transform about axis passing through point in world coordinates by angle degrees. - - - - - - - - - - - - - - - Move the transform to the start of the local transform list. - - - - - Move the transform to the end of the local transform list. - - - - - Set the parent of the transform. - - The parent Transform to use. - If true, the parent-relative position, scale and rotation are modified such that the object keeps the same world space position, rotation and scale as before. - - - - - Set the parent of the transform. - - The parent Transform to use. - If true, the parent-relative position, scale and rotation are modified such that the object keeps the same world space position, rotation and scale as before. - - - - - Sets the world space position and rotation of the Transform component. - - - - - - - Sets the sibling index. - - Index to set. - - - - Transforms direction from local space to world space. - - - - - - Transforms direction x, y, z from local space to world space. - - - - - - - - Transforms position from local space to world space. - - - - - - Transforms the position x, y, z from local space to world space. - - - - - - - - Transforms vector from local space to world space. - - - - - - Transforms vector x, y, z from local space to world space. - - - - - - - - Moves the transform in the direction and distance of translation. - - - - - - - Moves the transform in the direction and distance of translation. - - - - - - - Moves the transform by x along the x axis, y along the y axis, and z along the z axis. - - - - - - - - - Moves the transform by x along the x axis, y along the y axis, and z along the z axis. - - - - - - - - - Moves the transform in the direction and distance of translation. - - - - - - - Moves the transform by x along the x axis, y along the y axis, and z along the z axis. - - - - - - - - - Transparent object sorting mode of a Camera. - - - - - Sort objects based on distance along a custom axis. - - - - - Default transparency sorting mode. - - - - - Orthographic transparency sorting mode. - - - - - Perspective transparency sorting mode. - - - - - Tree Component for the tree creator. - - - - - Data asociated to the Tree. - - - - - Tells if there is wind data exported from SpeedTree are saved on this component. - - - - - Contains information about a tree placed in the Terrain game object. - - - - - Color of this instance. - - - - - Height scale of this instance (compared to the prototype's size). - - - - - Lightmap color calculated for this instance. - - - - - Position of the tree. - - - - - Index of this instance in the TerrainData.treePrototypes array. - - - - - Read-only. - -Rotation of the tree on X-Z plane (in radians). - - - - - Width scale of this instance (compared to the prototype's size). - - - - - Simple class that contains a pointer to a tree prototype. - - - - - Bend factor of the tree prototype. - - - - - The LOD index of a Tree LODGroup that Unity uses to generate a NavMesh. It uses this value only for Trees with a LODGroup, and ignores this value for regular Trees. - - - - - Retrieves the actual GameObject used by the tree. - - - - - Interface into tvOS specific functionality. - - - - - Advertising ID. - - - - - Is advertising tracking enabled. - - - - - The generation of the device. (Read Only) - - - - - iOS version. - - - - - Vendor ID. - - - - - Reset "no backup" file flag: file will be synced with iCloud/iTunes backup and can be deleted by OS in low storage situations. - - - - - - Set file flag to be excluded from iCloud/iTunes backup. - - - - - - iOS device generation. - - - - - First generation Apple TV. - - - - - Second generation (4K) Apple TV. - - - - - A class for Apple TV remote input configuration. - - - - - Configures how "Menu" button behaves on Apple TV Remote. If this property is set to true hitting "Menu" on Remote will exit to system home screen. When this property is false current application is responsible for handling "Menu" button. It is recommended to set this property to true on top level menus of your application. - - - - - Configures if Apple TV Remote should autorotate all the inputs when Remote is being held in horizontal orientation. Default is false. - - - - - Configures how touches are mapped to analog joystick axes in relative or absolute values. If set to true it will return +1 on Horizontal axis when very far right is being touched on Remote touch aread (and -1 when very left area is touched correspondingly). The same applies for Vertical axis too. When this property is set to false player should swipe instead of touching specific area of remote to generate Horizontal or Vertical input. - - - - - Disables Apple TV Remote touch propagation to Unity Input.touches API. Useful for 3rd party frameworks, which do not respect Touch.type == Indirect. -Default is false. - - - - - Describes the information about the edge and how to tessellate it. - - - - - The maximum angle to be considered within this range. - - - - - The render order of the edges that belong in this range. - - - - - The list of Sprites that are associated with this range. - - - - - The minimum angle to be considered within this range. - - - - - A collection of APIs that facilitate pixel perfect rendering of sprite-based renderers. - - - - - To achieve a pixel perfect render, Sprites must be displaced to discrete positions at render time. This value defines the minimum distance between these positions. This doesn’t affect the GameObject's transform position. - - - - - Data that describes the important points of the shape. - - - - - The position of the left tangent in local space. - - - - - The various modes of the tangent handles. They could be continuous or broken. - - - - - The position of this point in the object's local space. - - - - - The position of the right tangent point in the local space. - - - - - Sprite Atlas is an asset created within Unity. It is part of the built-in sprite packing solution. - - - - - Return true if this SpriteAtlas is a variant. - - - - - Get the total number of Sprite packed into this atlas. - - - - - Get the tag of this SpriteAtlas. - - - - - Return true if Sprite is packed into this SpriteAtlas. - - - - - - Clone the first Sprite in this atlas that matches the name packed in this atlas and return it. - - The name of the Sprite. - - - - Clone all the Sprite in this atlas and fill them into the supplied array. - - Array of Sprite that will be filled. - - The size of the returned array. - - - - - Clone all the Sprite matching the name in this atlas and fill them into the supplied array. - - Array of Sprite that will be filled. - The name of the Sprite. - - - - Manages SpriteAtlas during runtime. - - - - - Trigger when a SpriteAtlas is registered via invoking the callback in U2D.SpriteAtlasManager.atlasRequested. - - - - - - Trigger when any Sprite was bound to SpriteAtlas but couldn't locate the atlas asset during runtime. - - - - - - A struct that holds a rich set of information that describes the bind pose of this Sprite. - - - - - The length of the bone. This is important for the leaf bones to describe their length without needing another bone as the terminal bone. - - - - - The name of the bone. This is useful when recreating bone hierarchy at editor or runtime. You can also use this as a way of resolving the bone path when a Sprite is bound to a more complex or richer hierarchy. - - - - - The ID of the parent of this bone. - - - - - The position in local space of this bone. - - - - - The rotation of this bone in local space. - - - - - A list of methods designed for reading and writing to the rich internal data of a Sprite. - - - - - Returns an array of BindPoses. - - The sprite to retrieve the bind pose from. - - A list of bind poses for this sprite. There is no need to dispose the returned NativeArray. - - - - - Returns a list of SpriteBone in this Sprite. - - The sprite to get the list of SpriteBone from. - - An array of SpriteBone that belongs to this Sprite. - - - - - Returns a list of indices. This is the same as Sprite.triangle. - - - - A read-only list of indices indicating how the triangles are formed between the vertices. The array is marked as undisposable. - - - - - Retrieves a strided accessor to the internal vertex attributes. - - - - - A read-only list of. - - - - - Returns the number of vertices in this Sprite. - - - - - - Checks if a specific channel exists for this Sprite. - - - - - True if the channel exists. - - - - - Sets the bind poses for this Sprite. - - The list of bind poses for this Sprite. The array must be disposed of by the caller. - - - - - Sets the SpriteBones for this Sprite. - - - - - - - Set the indices for this Sprite. This is the same as Sprite.triangle. - - The list of indices for this Sprite. The array must be disposed of by the caller. - - - - - Sets a specific channel of the VertexAttribute. - - The list of values for this specific VertexAttribute channel. The array must be disposed of by the caller. - - - - - - Sets the vertex count. This resizes the internal buffer. It also preserves any configurations of VertexAttributes. - - - - - - - A list of methods that allow the caller to override what the SpriteRenderer renders. - - - - - Stop using the deformable buffer to render the Sprite and use the original mesh instead. - - - - - - Additional data about the shape's control point. This is useful during tessellation of the shape. - - - - - The threshold of the angle that decides if it should be tessellated as a curve or a corner. - - - - - The radius of the curve to be tessellated. - - - - - True will indicate that this point should be tessellated as a corner or a continuous line otherwise. - - - - - The height of the tessellated edge. - - - - - The Sprite to be used for a particular edge. - - - - - Input parameters for the SpriteShape tessellator. - - - - - If enabled, the tessellator will adapt the size of the quads based on the height of the edge. - - - - - The threshold of the angle that indicates whether it is a corner or not. - - - - - The threshold of the angle that decides if it should be tessellated as a curve or a corner. - - - - - The radius of the curve to be tessellated. - - - - - The local displacement of the Sprite when tessellated. - - - - - If true, the Shape will be tessellated as a closed form. - - - - - The scale to be used to calculate the UVs of the fill texture. - - - - - The texture to be used for the fill of the SpriteShape. - - - - - If enabled the tessellator will consider creating corners based on the various input parameters. - - - - - The tessellation quality of the input Spline that determines the complexity of the mesh. - - - - - The borders to be used for calculating the uv of the edges based on the border info found in Sprites. - - - - - Stretch the UV mapping for the Fill texture. - - - - - The world space transform of the GameObject used for calculating the UVs of the Fill texture. - - - - - Renders SpriteShapes defined through the SpriteShapeUtility.GenerateSpriteShape API. - - - - - Rendering color for the SpriteShape. - - - - - Specifies how the SpriteShape interacts with the masks. - - - - - Get Bounds data as NativeArray. The array count of this NativeArray will always be 1. - - - NativeArray of Bounds of SpriteShapeRenderer. The size of this will always be 1. - - - - - Get/Set an array of mesh data of SpriteShapeRenderer. - - Size to be reserved for the NativeArray. - NativeArray of indices. - NativeSlice of vertices. - NativeSlice of texture coordinate for channel 0. - NativeSlice of tangents. - NativeSlice of normals. - - - - Get/Set an array of mesh data of SpriteShapeRenderer. - - Size to be reserved for the NativeArray. - NativeArray of indices. - NativeSlice of vertices. - NativeSlice of texture coordinate for channel 0. - NativeSlice of tangents. - NativeSlice of normals. - - - - Get/Set an array of mesh data of SpriteShapeRenderer. - - Size to be reserved for the NativeArray. - NativeArray of indices. - NativeSlice of vertices. - NativeSlice of texture coordinate for channel 0. - NativeSlice of tangents. - NativeSlice of normals. - - - - Get/Set an array of segments of SpriteShapeRenderer. - - Size to be reserved for the segments array. - - Size to be reserved for the NativeArray. - - - - - Prepare and generate the SpriteShape geometry that will be fed to SpriteShape generator for rendering. - - JobHandle for the C# based SpriteShape Generator Job. - Sprite Shape generation input params. - Input list of Sprites. - - - - SpriteShapeSegment contains info of sub-meshes generated by the SpriteShape generator C# Job later fed to SpriteShapeRenderer. - - - - - Geometry index of list of sub-meshes generated by SpriteShape. - - - - - Index count of SpriteShape sub-mesh. - - - - - Index of sprite that is used to generate segment/corner for this SpriteShapeSegment. - - - - - Vertex count of SpriteShape sub-mesh. - - - - - A static class that helps tessellate a SpriteShape mesh. - - - - - Generate a mesh based on input parameters. - - The output mesh. - Input parameters for the SpriteShape tessellator. - A list of control points that describes the shape. - Additional data about the shape's control point. This is useful during tessellation of the shape. - The list of Sprites that could be used for the edges. - The list of Sprites that could be used for the corners. - A parameter that determins how to tessellate each of the edge. - - - - Generate a mesh based on input parameters. - - SpriteShapeRenderer to which the generated geometry is fed to. - Input parameters for the SpriteShape tessellator. - A list of control points that describes the shape. - Additional data about the shape's control point. This is useful during tessellation of the shape. - The list of Sprites that could be used for the edges. - The list of Sprites that could be used for the corners. - A parameter that determins how to tessellate each of the edge. - - - - Class that specifies some information about a renderable character. - - - - - Character width. - - - - - Position of the character cursor in local (text generated) space. - - - - - Defines the alignement behavior along an axis. - - - - - Let Flex decide. - - - - - Items are centered on the axis. - - - - - End margin of the item is placed at the end of the axis. - - - - - Start margin of the item is placed at the start of the axis. - - - - - Default. stretch to fill the axis while respecting min/max values. - - - - - Options for displaying alternating background colors for ListView rows. - - - - - Display alternating background colors for all rows in the ListView, regardless of whether they contain content. - - - - - Display alternating background colors only for rows that contain content. - - - - - Do not alternate background colors for rows. - - - - - Event sent after an element is added to an element that is a descendent of a panel. - - - - - Constructor. Avoid creating new event instances. Instead, use GetPooled() to get an instance from a pool of reusable event instances. - - - - - Describes a VisualElement background. - - - - - The texture to display as a background. You cannot set this and Background.vectorImage at the same time. - - - - - The VectorImage to display as a background. You cannot set this and Background.texture at the same time. - - - - - Creates from a Texture2D. - - - - - - Creates a background from a Texture2D. - - The texture to use as a background. - - A new background object. - - - - - Creates a background from a VectorImage. - - The vector image to use as a background. - - A new background object. - - - - - Abstract base class for controls. - - - - - USS class name of input elements in elements of this type. - - - - - The string representing the label that will appear beside the field. - - - - - USS class name of labels in elements of this type, when there is a dragger attached on them. - - - - - This is the Label object that appears beside the input for the field. - - - - - USS class name of labels in elements of this type. - - - - - USS class name of elements of this type, when there is no label. - - - - - The value of the element. - - - - - USS class name of elements of this type. - - - - - The value associated with the field. - - - - - Allow to set a value without being notified of the change, if any. - - New value to bbe set. - - - - Defines UxmlTraits for the BaseField. - - - - - Constructor. - - - - - Traits for the BaseField. - - - - - Initializes the trait of BaseField. - - The VisualElement to initialize. - Bag of attributes. - The creation context associated with these traits. - - - - This is a base class for the Slider fields. - - - - - This is the actual property to contain the direction of the slider. - - - - - USS class name of the dragger border element in elements of this type. - - - - - USS class name of dragger elements in elements of this type. - - - - - This is the maximum value that the slider encodes. - - - - - USS class name of elements of this type, when they are displayed horizontally. - - - - - USS class name of input elements in elements of this type. - - - - - USS class name of labels in elements of this type. - - - - - This is the minimum value that the slider encodes. - - - - - This is a generic page size used to change the value when clicking in the slider. - - - - - This is the range from the minimum value to the maximum value of the slider. - - - - - USS class name of tracker elements in elements of this type. - - - - - USS class name of elements of this type. - - - - - The actual value of the slider. - - - - - USS class name of elements of this type, when they are displayed vertically. - - - - - Method used to adjust the dragelement. Mainly used in a scroller. - - The factor used to adjust the drag element, where a value > 1 will make it invisible. - - - - Element that can be bound to a property. - - - - - Binding object that will be updated. - - - - - Path of the target property to be bound. - - - - - Constructor. - - - - - Instantiates a BindableElement using the data read from a UXML file. - - - - - Constructor. - - - - - Defines UxmlTraits for the BindableElement. - - - - - Constructor. - - - - - Initialize EnumField properties using values from the attribute bag. - - - - - - - - Event sent immediately after an element has lost focus. This event trickles down, it does not bubble up, and it cannot be cancelled. - - - - - Constructor. Avoid creating new event instances. Instead, use GetPooled() to get an instance from a pool of reusable event instances. - - - - - Styled visual element to match the IMGUI Box Style. - - - - - USS class name of elements of this type. - - - - - Instantiates a Box using the data read from a UXML file. - - - - - Constructor. - - - - - A clickable button. - - - - - Clickable MouseManipulator for this Button. - - - - - Callback triggered when the button is clicked. See Also: Clickable.clicked. - - - - - - Obsolete. Use Button.clicked instead. - - - - - - USS class name of elements of this type. - - - - - Constructs a Button. - - Action triggered when the button is clicked. - - - - Constructs a Button. - - Action triggered when the button is clicked. - - - - Instantiates a Button using the data read from a UXML file. - - - - - Constructor. - - - - - Defines UxmlTraits for the Button. - - - - - Constructor. - - - - - Interface for classes capable of having callbacks to handle events. - - - - - Handle an event, most often by executing the callbacks associated with the event. - - The event to handle. - - - - Return true if event handlers for the event propagation BubbleUp phase have been attached on this object. - - - True if object has event handlers for the BubbleUp phase. - - - - - Returns true if event handlers, for the event propagation TrickleDown phase, are attached to this object. - - - True if object has event handlers for the TrickleDown phase. - - - - - Adds an event handler to the instance. If the event handler has already been registered for the same phase (either TrickleDown or BubbleUp) then this method has no effect. - - The event handler to add. - By default, this callback is called during the BubbleUp phase. Pass TrickleDown.TrickleDown to call this callback during the TrickleDown phase. - Data to pass to the callback. - - - - Adds an event handler to the instance. If the event handler has already been registered for the same phase (either TrickleDown or BubbleUp) then this method has no effect. - - The event handler to add. - By default, this callback is called during the BubbleUp phase. Pass TrickleDown.TrickleDown to call this callback during the TrickleDown phase. - Data to pass to the callback. - - - - Sends an event to the event handler. - - The event to send. - - - - Remove callback from the instance. - - The callback to remove. - Set this parameter to true to remove the callback from the TrickleDown phase. Set this parameter to false to remove the callback from the BubbleUp phase. - - - - Remove callback from the instance. - - The callback to remove. - Set this parameter to true to remove the callback from the TrickleDown phase. Set this parameter to false to remove the callback from the BubbleUp phase. - - - - Sends an event when a value in a field changes. - - - - - The new value. - - - - - The value before the change occured. - - - - - Constructor. - - - - - Gets an event from the event pool and initializes it with the given values. Use this function instead of creating new events. Events obtained using this method need to be released back to the pool. You can use `Dispose()` to release them. - - The previous value. - The new value. - - An initialized event. - - - - - Sets the event to its initial state. - - - - - Manipulator that tracks Mouse events on an element and callbacks when the elements is clicked. - - - - - This property tracks the activation of the manipulator. Set it to true when the manipulator is activated. - - - - - Callback triggerred when the target element is clicked. - - - - - - Callback triggerred when the target element is clicked. - - - - - - Specifies the mouse position saved during the last mouse event on the target Element. - - - - - Constructor. - - - - - - - - Constructor. - - - - - - - - Constructor. - - - - - - - - Invokes a click action. - - - - - - This method is called when a MouseDownEvent is sent to the target element. - - The event. - - - - This method is called when a MouseMoveEvent is sent to the target element. - - The event. - - - - This method is called when a MouseUpEvent is sent to the target element. - - The event. - - - - This method processes the down event sent to the target Element. - - - - - - - - This method processes the move event sent to the target Element. - - - - - - - This method processes the up event sent to the target Element. - - - - - - - - Called to register mouse event callbacks on the target element. - - - - - Called to unregister event callbacks from the target element. - - - - - The event sent when the left mouse button is clicked. - - - - - Constructor. - - - - - Base class for command events. - - - - - Name of the command. - - - - - Gets an event from the event pool and initializes it with the given values. Use this function instead of creating new events. Events obtained using this method need to be released back to the pool. You can use `Dispose()` to release them. - - The command name. - An IMGUI command event. - - An initialized event. - - - - - Gets an event from the event pool and initializes it with the given values. Use this function instead of creating new events. Events obtained using this method need to be released back to the pool. You can use `Dispose()` to release them. - - The command name. - An IMGUI command event. - - An initialized event. - - - - - Resets the event members to their initial values. - - - - - The event sent when clicking the right mouse button. - - - - - Constructor. - - - - - Describes in which context a VisualElement hierarchy is being ran. - - - - - Currently running in the Unity Editor. - - - - - Currently running in an Unity Player. - - - - - Use this class to display a contextual menu. - - - - - Displays the contextual menu. - - The event that triggered the display of the menu. - The element for which the menu is displayed. - - - - Checks if the event triggers the display of the contextual menu. This method also displays the menu. - - The element for which the menu is displayed. - The event to inspect. - - - - Displays the contextual menu. - - The menu to display. - The event that triggers the display of the contextual menu. - - - - Manipulator that displays a contextual menu when the user clicks the right mouse button or presses the menu key on the keyboard. - - - - - Constructor. - - - - - - Register the event callbacks on the manipulator target. - - - - - Unregister the event callbacks from the manipulator target. - - - - - The event sent when a contextual menu requires menu items. - - - - - The menu to populate. - - - - - The event that triggered the ContextualMenuPopulateEvent. - - - - - Constructor. - - - - - Gets an event from the event pool and initializes it with the given values. Use this function instead of creating new events. Events obtained using this method need to be released back to the pool. You can use `Dispose()` to release them. - - The event that triggered the display of the contextual menu. - The menu to populate. - The element that triggered the display of the contextual menu. - The menu manager that displays the menu. - - An initialized event. - - - - - Resets the event members to their initial values. - - - - - This class is used during UXML template instantiation. - - - - - Compare two CreationContext objects and return true if they are equal. - - The first object. - The second object. - - - - Compare two CreationContext objects and return true if they are not equal. - - The first object. - The second object. - - - - Script interface for VisualElement cursor style property IStyle.cursor. - - - - - The offset from the top left of the texture to use as the target point (must be within the bounds of the cursor). - - - - - The texture to use for the cursor style. To use a texture as a cursor, import the texture with "Read/Write enabled" in the texture importer (or using the "Cursor" defaults). - - - - - Define a custom style property for an element to be retrieved with CustomStyleResolvedEvent. - - - - - Name of the custom property. - - - - - Creates custom property from a string. - - Name of the property. Must start with a -- prefix. - - - - Event sent after the custom style properties of a VisualElement have been resolved. - - - - - Returns the custom style properties accessor for the targeted VisualElement. - - - - - Event sent just before an element is detach from its parent, if the parent is the descendant of a panel. - - - - - Constructor. Avoid creating new event instances. Instead, use GetPooled() to get an instance from a pool of reusable event instances. - - - - - Defines how an element is displayed in the layout. - - - - - The element displays normally. - - - - - The element is not visible and absent from the layout. - - - - - Base class for drag and drop events. - - - - - Use the DragEnterEvent class to manage events that occur when dragging enters an element or one of its descendants. The DragEnterEvent is cancellable, it does not trickle down, and it does not bubble up. - - - - - Constructor. Avoid renewing events. Instead, use GetPooled() to get an event from a pool of reusable events. - - - - - Resets the event members to their initial values. - - - - - The event sent to a dragged element when the drag and drop process ends. - - - - - Constructor. - - - - - Gets an event from the event pool and initializes it with the given values. Use this function instead of creating new events. Events obtained using this method need to be released back to the pool. You can use `Dispose()` to release them. - - An IMGUI drag exited event. - - An initialized event. - - - - - Resets the event members to their initial values. - - - - - Use the DragLeaveEvent class to manage events sent when dragging leaves an element or one of its descendants. The DragLeaveEvent is cancellable, it does not trickle down, and it does not bubble up. - - - - - Constructor. Avoid renewing events. Instead, use GetPooled() to get an event from a pool of reusable events. - - - - - Resets the event members to their initial values. - - - - - The event sent to an element when another element is dragged and dropped on the element. - - - - - Constructor. - - - - - The event sent when the element being dragged enters a possible drop target. - - - - - Constructor. - - - - - Gets an event from the event pool and initializes it with the given values. Use this function instead of creating new events. Events obtained using this method need to be released back to the pool. You can use `Dispose()` to release them. - - An IMGUI drag updated event. - - An initialized event. - - - - - A drop-down menu. - - - - - Add an item that will execute an action in the drop-down menu. The item is added at the end of the current item list. - - Name of the item. This name will be displayed in the drop-down menu. - Callback to execute when the user selects this item in the menu. - Callback to execute to determine the status of the item. - An object that will be stored in the userData property of the DropdownMenuAction item. - The status of the item. - - - - Add an item that will execute an action in the drop-down menu. The item is added at the end of the current item list. - - Name of the item. This name will be displayed in the drop-down menu. - Callback to execute when the user selects this item in the menu. - Callback to execute to determine the status of the item. - An object that will be stored in the userData property of the DropdownMenuAction item. - The status of the item. - - - - Add a separator line in the menu. The separator is added at the end of the current item list. - - The submenu path where the separator will be added. Path components are delimited by forward slashes ('/'). - - - - Add a separator line in the menu. The separator is added at the end of the current item list. - - The submenu path where the separator will be added. Path components are delimited by forward slashes ('/'). - - - - Constructor. - - - - - Add an item that will execute an action in the drop-down menu. The item is added at the end of the specified index in the list. - - Name of the item. This name will be displayed in the drop-down menu. - Callback to execute when the user selects this item in the menu. - Callback to execute to determine the status of the item. - Index where the item should be inserted. - An object that will be stored in the userData property of the DropdownMenuAction item. This object is accessible through the action callback. - The status of the item. - - - - Add an item that will execute an action in the drop-down menu. The item is added at the end of the specified index in the list. - - Name of the item. This name will be displayed in the drop-down menu. - Callback to execute when the user selects this item in the menu. - Callback to execute to determine the status of the item. - Index where the item should be inserted. - An object that will be stored in the userData property of the DropdownMenuAction item. This object is accessible through the action callback. - The status of the item. - - - - Add a separator line in the menu. The separator is added at the end of the specified index in the list. - - Index where the separator should be inserted. - The submenu path where the separator is added. Path components are delimited by forward slashes ('/'). - - - - Get the list of menu items. - - - The list of items in the menu. - - - - - Update the status of all items by calling their status callback and remove the separators in excess. This is called just before displaying the menu. - - - - - - Remove the menu item at index. - - The index of the item to remove. - - - - A menu action item. - - - - - Provides information on the event that triggered the drop-down menu. - - - - - The name of the item. The name can be prefixed by its submenu path. Path components are delimited by forward slashes ('/'). - - - - - The status of the item. - - - - - The userData object stored by the constructor. - - - - - Status callback that always returns Status.Disabled. - - Unused parameter. - - Always return Status.Disabled. - - - - - Status callback that always returns Status.Enabled. - - Unused parameter. - - Always return Status.Enabled. - - - - - Constructor. - - The path and name of the menu item. Use the path, delimited by forward slashes ('/'), to place the menu item within a submenu. - Action to be executed when the menu item is selected. - Function called to determine if the menu item is enabled. - An object that will be stored in the userData property. - - - - Execute the callback associated with this item. - - - - - Status of the menu item. The values of this enumeration should be used as flags. - - - - - The item is displayed with a checkmark. - - - - - The item is disabled and is not be selectable by the user. - - - - - The item is not displayed. This flag can be used with other flags. - - - - - The item is not displayed. This is the default value and represents the absence of flags. - - - - - The item is displayed normally. - - - - - Update the status flag of this item by calling the item status callback. - - Information about the event that triggered the display of the drop-down menu, such as the mouse position or the key pressed. - - - - This class provides information about the event that triggered displaying the drop-down menu. - - - - - If the triggering event was a mouse event, this property is the mouse position. The position is expressed using the coordinate system of the element that received the mouse event. Otherwise this property is zero. - - - - - If modifier keys (Alt, Ctrl, Shift, Windows/Command) were pressed to trigger the display of the dropdown menu, this property lists the modifier keys. - - - - - If the triggering event was a mouse event, this property is the mouse position expressed using the global coordinate system. Otherwise this property is zero. - - - - - Constructor. - - - - - - An item in a drop-down menu. - - - - - A separator menu item. - - - - - The submenu path where the separator will be added. Path components are delimited by forward slashes ('/'). - - - - - Constructor. - - The path for the submenu. Path components are delimited by forward slashes ('/'). - - - - The base class for all UIElements events. - - - - - Whether this event type bubbles up in the event propagation path. - - - - - The current target of the event. This is the VisualElement, in the propagation path, for which event handlers are currently being executed. - - - - - Whether the event is being dispatched to a visual element. An event cannot be redispatched while it being dispatched. If you need to recursively dispatch an event, it is recommended that you use a copy of the event. - - - - - Retrieves the type ID for this event instance. - - - - - The IMGUIEvent at the source of this event. The source can be null since not all events are generated by IMGUI. - - - - - Return true if the default actions should not be executed for this event. - - - - - Whether StopImmediatePropagation() was called for this event. - - - - - Whether StopPropagation() was called for this event. - - - - - The original mouse position of the IMGUI event, before it is transformed to the current target local coordinates. - - - - - Whether the event is allocated from a pool of events. - - - - - The current propagation phase. - - - - - The target visual element that received this event. Unlike currentTarget, this target does not change when the event is sent to other elements along the propagation path. - - - - - The time when the event was created. - - - - - Whether this event is sent down the event propagation path during the TrickleDown phase. - - - - - Implementation of IDisposable. - - - - - Resets all event members to their initial values. - - - - - Whether the default actions are prevented from being executed for this event. - - - - - Registers an event class to the event type system. - - - The type ID. - - - - - Immediately stops the propagation of the event. The event is not sent to other elements along the propagation path. This method prevents other event handlers from executing on the current target. - - - - - Stops propagating this event. The event is not sent to other elements along the propagation path. This method does not prevent other event handlers from executing on the current target. - - - - - Generic base class for events, implementing event pooling and automatic registration to the event type system. - - - - - Retrieves the type ID for this event instance. - - - - - Implementation of IDispose. - - - - - Gets an event from the event pool. Use this function instead of creating new events. Events obtained using this method need to be released back to the pool. You can use `Dispose()` to release them. - - - An initialized event. - - - - - Resets all event members to their initial values. - - - - - Gets the type ID for the event class. - - - The event class type ID. - - - - - Dispatches events to a IPanel. - - - - - Gates control when the dispatcher processes events. - - - - - Constructor. - - The dispatcher controlled by this gate. - - - - Implementation of IDisposable.Dispose. Opens the gate. If all gates are open, events in the queue are processed. - - - - - The event sent when an element should execute a command. - - - - - Constructor. - - - - - A collection of easing curves to be used with ValueAnimations. - - - - - Provides helper methods to create transition animations for VisualElement style values - - - - - Triggers an animation changing this element's layout style values. See Also: IStyle.top, IStyle.left, IStyle.width, IStyle.height. - - - - - - - Triggers an animation changing this element's transform position. See Also: ITransform.position. - - - - - - - Triggers an animation changing this element's transform rotation. See Also: ITransform.rotation. - - - - - - - Triggers an animation changing this element's transform scale. See Also: ITransform.scale. - - - - - - - Triggers an animation changing this element's size style values. See Also: IStyle.width, IStyle.height. - - - - - - - Starts a transition animation on this VisualElement. - - Start value. - End value. - Duration of the transition in milliseconds. - Callback that applies the interpolated value. - Callback that provides the initial value. - - The created animation object. - - - - - Starts a transition animation on this VisualElement. - - Start value. - End value. - Duration of the transition in milliseconds. - Callback that applies the interpolated value. - Callback that provides the initial value. - - The created animation object. - - - - - Triggers an animation changing this element's positioning style values. See Also: IStyle.top, IStyle.left. - - - - - - - Base interface for transition animations. - - - - - Duration of the transition in milliseconds. - - - - - Tells if the animation is currently active. - - - - - Returns this animation object into its object pool. - - - - - Starts the animation using this object's values. - - - - - Stops this animation. - - - - - Container object used to animate multiple style values at once. - - - - - Background color to paint in the element's box. - - - - - The radius of the bottom-left corner when a rounded rectangle is drawn in the element's box. - - - - - The radius of the bottom-right corner when a rounded rectangle is drawn in the element's box. - - - - - Space reserved for the bottom edge of the border during the layout phase. - - - - - Color of the border to paint inside the element's box. - - - - - Space reserved for the left edge of the border during the layout phase. - - - - - Space reserved for the right edge of the border during the layout phase. - - - - - The radius of the top-left corner when a rounded rectangle is drawn in the element's box. - - - - - The radius of the top-right corner when a rounded rectangle is drawn in the element's box. - - - - - Space reserved for the top edge of the border during the layout phase. - - - - - Bottom distance from the element's box during layout. - - - - - Color to use when drawing the text of an element. - - - - - Specifies how much the item will grow relative to the rest of the flexible items inside the same container. - - - - - Specifies how the item will shrink relative to the rest of the flexible items inside the same container. - - - - - Fixed height of an element for the layout. - - - - - Left distance from the element's box during layout. - - - - - Space reserved for the bottom edge of the margin during the layout phase. - - - - - Space reserved for the left edge of the margin during the layout phase. - - - - - Space reserved for the right edge of the margin during the layout phase. - - - - - Space reserved for the top edge of the margin during the layout phase. - - - - - Specifies the transparency of an element. - - - - - Space reserved for the bottom edge of the padding during the layout phase. - - - - - Space reserved for the left edge of the padding during the layout phase. - - - - - Space reserved for the right edge of the padding during the layout phase. - - - - - Space reserved for the top edge of the padding during the layout phase. - - - - - Right distance from the element's box during layout. - - - - - Top distance from the element's box during layout. - - - - - Tinting color for the element's backgroundImage. - - - - - Fixed width of an element for the layout. - - - - - Implementation object for transition animations. - - - - - Returns true if this animation object will be automatically returned to the instance pool after the animation has completed. - - - - - Duration of the animation in milliseconds. - - - - - Smoothing function related to this animation. Default value is Easing.OutQuad. - - - - - The animation start value. - - - - - Callback invoked when the from field has not been set, in order to retrieve the starting state of this animation. - - - - - Value interpolation method. - - - - - Tells if the animation is currently active. - - - - - Callback invoked when this animation has completed. - - - - - The animation end value. - - - - - Callback invoked after every value interpolation. - - - - - Creates a new ValueAnimation object or returns an available one from it's instance pool. - - - - - - - Constructor. - - - - - Sets the easing function. - - - - - - Will not return the object to the instance pool when the animation has completed. - - - - - Sets a callback invoked when this animation has completed. - - - - - - Returns this animation object into its object pool. - - - - - Starts the animation using this object's values. - - - - - Stops this animation. - - - - - Defines the main-axis of the flex layout. - - - - - Top to Bottom. - - - - - Bottom to Top. - - - - - Left to Right. - - - - - Right to Left. - - - - - Base class for objects that can get the focus. - - - - - Return true if the element can be focused. - - - - - Whether the element should delegate the focus to its children. - - - - - True if the element can be focused. - - - - - Return the focus controller for this element. - - - - - An integer used to sort focusables in the focus ring. Must be greater than or equal to zero. - - - - - Tell the element to release the focus. - - - - - Attempt to give the focus to this element. - - - - - Base class for defining in which direction the focus moves in a focus ring. - - - - - Last value for the direction defined by this class. - - - - - The null direction. This is usually used when the focus stays on the same element. - - - - - Focus came from an unspecified direction, for example after a mouse down. - - - - - The underlying integer value for this direction. - - - - - - Class in charge of managing the focus inside a Panel. - - - - - The currently focused VisualElement. - - - - - Constructor. - - - - - Event sent immediately after an element has gained focus. This event trickles down, it does not bubble up, and it cannot be cancelled. - - - - - Constructor. Avoid creating new event instances. Instead, use GetPooled() to get an instance from a pool of reusable event instances. - - - - - Base class for focus related events. - - - - - Direction of the focus change. - - - - - The focus controller that emitted the event. - - - - - For FocusOut and Blur events, contains the element that gains the focus. For FocusIn and Focus events, contains the element that loses the focus. - - - - - Gets an event from the event pool and initializes it with the given values. Use this function instead of creating new events. Events obtained using this method need to be released back to the pool. You can use `Dispose()` to release them. - - The event target. - The related target. - The direction of the focus change. - The object that manages the focus. - - - An initialized event. - - - - - Resets the event members to their initial values. - - - - - Event sent immediately before an element gains focus. This event trickles down and bubbles up. This event cannot be cancelled. - - - - - Constructor. - - - - - Resets the event members to their initial values. - - - - - Event sent immediately before an element loses focus. This event trickles down and bubbles up. This event cannot be cancelled. - - - - - Constructor. Avoid creating new event instances. Instead, use GetPooled() to get an instance from a pool of reusable event instances. - - - - - Resets the event members to their initial values. - - - - - Collapsable section of UI. - - - - - USS class name of content element in a Foldout. - - - - - USS class name of toggle elements in elements of this type. - - - - - USS class name of elements of this type. - - - - - Contains the collapse state. True if the Foldout is open and the contents are visible. False if it's collapsed. - - - - - Instantiates a Foldout using the data read from a UXML file. - - - - - Constructor. - - - - - Event sent after layout calculations, when the position or the dimension of an element changes. This event cannot be cancelled, it does not trickle down, and it does not bubble up. - - - - - The new dimensions of the element. - - - - - The old dimensions of the element. - - - - - Constructor. - - - - - Gets an event from the event pool and initializes the event with the specified values. Use this method instead of instancing new events. Use Dispose() to release events back to the event pool. - - The old dimensions of the element. - The new dimensions of the element. - - An initialized event. - - - - - Resets the event values to their initial values. - - - - - Makes a help box with a message to the user. - - - - - The USS class name for the HelpBoxMessageType.Error state in Elements of this type. - - - - - The USS class name for the HelpBoxMessageType.Info state in Elements of this type. - - - - - The USS class name for images in Elements of this type. - - - - - The USS class name for the HelpBoxMessageType.Warning state in Elements of this type. - - - - - The USS class name for labels in Elements of this type. - - - - - The type of message. - - - - - The message text. - - - - - The USS class name for Elements of this type. - - - - - Creates a new HelpBox. - - The message text. - The type of message. - - - - Creates a new HelpBox. - - The message text. - The type of message. - - - - Instantiates a HelpBox with data from a UXML file. - - - - - Constructor. - - - - - Defines UxmlTraits for the HelpBox. - - - - - Constructor. - - - - - Initializes HelpBox properties with values from an attribute bag. - - The Element to initialize. - The attribute bag. - The creation context; unused. - - - - User message types. - - - - - Error message. - - - - - Info message. - - - - - Neutral message. - - - - - Warning message. - - - - - Interface for all bindable fields. - - - - - Binding object that will be updated. - - - - - Path of the target property to be bound. - - - - - Base interface for Binding objects. - - - - - Called at regular intervals to synchronize bound properties to their IBindable counterparts. Called before the Update() method. - - - - - Disconnects the field from its bound property - - - - - Called at regular intervals to synchronize bound properties to their IBindable counterparts. - - - - - Extensions methods to provide additional IBindable functionality. - - - - - Checks if a IBindable is bound to a property. - - This Bindable object. - - True if this IBindable is bound to a property. - - - - - Base interface for ChangeEvent. - - - - - Interface for Command events. - - - - - Name of the command. - - - - - This interface exposes methods to read custom style properties applied from USS files to visual elements. - - - - - Gets the value associated with the specified CustomStyleProperty. - - - - - True if the property is found, false if not. - - - - - Gets the value associated with the specified CustomStyleProperty. - - - - - True if the property is found, false if not. - - - - - Gets the value associated with the specified CustomStyleProperty. - - - - - True if the property is found, false if not. - - - - - Gets the value associated with the specified CustomStyleProperty. - - - - - True if the property is found, false if not. - - - - - Gets the value associated with the specified CustomStyleProperty. - - - - - True if the property is found, false if not. - - - - - Gets the value associated with the specified CustomStyleProperty. - - - - - True if the property is found, false if not. - - - - - Interface for drag and drop events. - - - - - Interface for class capable of handling events. - - - - - Handle an event. - - The event to handle. - - - - Return true if event handlers for the event propagation BubbleUp phase have been attached on this object. - - - True if object has event handlers for the BubbleUp phase. - - - - - Returns true if event handlers, for the event propagation TrickleDown phase, are attached to this object. - - - True if the object already has event handlers for the TrickleDown phase. - - - - - Sends an event to the event handler. - - The event to send. - - - - Give access to UIElement experimental features. - - - - - Returns the animation experimental interface. - - - - - Interface for focus events. - - - - - Direction of the focus change. - - - - - Related target. See implementation for specific meaning. - - - - - Interface for classes implementing focus rings. - - - - - Get the direction of the focus change for the given event. For example, when the Tab key is pressed, focus should be given to the element to the right. - - - - - - - Get the next element in the given direction. - - - - - - - Interface for keyboard events. - - - - - Returns true if the platform-specific action key is pressed. This key is Cmd on macOS, and Ctrl on all other platforms. - - - - - Return true if the Alt key is pressed. - - - - - The character. - - - - - Return true if the Windows/Command key is pressed. - - - - - Return true if the Control key is pressed. - - - - - The key code. - - - - - Flag set holding the pressed modifier keys (Alt, Control, Shift, Windows/Command). - - - - - Return true if the Shift key is pressed. - - - - - A VisualElement representing a source texture. - - - - - The texture to display in this image. You cannot set this and Image.vectorImage at the same time. - - - - - ScaleMode used to display the Image. - - - - - The source rectangle inside the texture relative to the top left corner. - - - - - Tinting color for this Image. - - - - - USS class name of elements of this type. - - - - - The base texture coordinates of the Image relative to the bottom left corner. - - - - - The VectorImage to display in this image. You cannot set this and Image.image at the same time. - - - - - Constructor. - - - - - Instantiates an Image using the data read from a UXML file. - - - - - Constructor. - - - - - Defines UxmlTraits for the Image. - - - - - Returns an empty enumerable, as images generally do not have children. - - - - - Constructor. - - - - - Interface for Manipulator objects. - - - - - VisualElement being manipulated. - - - - - Element that draws IMGUI content. - - - - - ContextType of this IMGUIContrainer. Currently only supports ContextType.Editor. - - - - - When this property is set to true, onGUIHandler is not called when the Element is outside the viewport. - - - - - The function that is called to render and handle IMGUI events. - - - - - USS class name of elements of this type. - - - - - Constructor. - - The function assigned to onGUIHandler. - - - - Constructor. - - The function assigned to onGUIHandler. - - - - Marks layout as dirty to trigger a redraw. - - - - - Instantiates an IMGUIContainer using the data read from a UXML file. - - - - - Constructor. - - - - - Defines UxmlTraits for the IMGUIContainer. - - - - - Returns an empty enumerable, as IMGUIContainer cannot have VisualElement children. - - - - - Constructor. - - - - - Class used to send a IMGUI event that has no equivalent UIElements event. - - - - - Constructor. Use GetPooled() to get an event from a pool of reusable events. - - - - - Gets an event from the event pool and initializes it with the given values. Use this function instead of creating new events. Events obtained using this method need to be released back to the pool. You can use `Dispose()` to release them. - - The IMGUI event used to initialize the event. - - An initialized event. - - - - - Resets the event members to their initial values. - - - - - VisualElement that can implement custom immediate mode rendering. - - - - - When this property is set to true, the Element does not repaint itself when it is outside the viewport. - - - - - Constructor. - - - - - Invoked during the repaint phase. - - - - - Invoked during the repaint phase. - - - - - Interface for mouse capture events. - - - - - Interface for mouse events. - - - - - Returns true if the platform-specific action key is pressed. This key is Cmd on macOS, and Ctrl on all other platforms. - - - - - Return true if the Alt key is pressed. - - - - - Integer that indicates which mouse button is pressed: 0 is the left button, 1 is the right button, 2 is the middle button. - - - - - The number of times the button is pressed. - - - - - Return true if the Windows/Command key is pressed. - - - - - Return true if the Ctrl key is pressed. - - - - - The mouse position in the current target coordinate system. - - - - - Flag set holding the pressed modifier keys (Alt, Ctrl, Shift, Windows/Command). - - - - - Mouse position difference between the last mouse event and this one. - - - - - The mouse position in the panel coordinate system. - - - - - A bitmask that describes the currently pressed buttons. - - - - - Return true if the Shift key is pressed. - - - - - Interface for controls that hold a value and can notify when it is changed by user input. - - - - - The Value held by the control. - - - - - Set the value and, even if different, does not notify registers callbacks with a ChangeEvent<T> - - The new value to be set. - - - - INotifyValueChangedExtensions is a set of extension methods useful for objects implementing INotifyValueChanged. - - - - - Registers this callback to receive ChangeEvent<T> when value is changed. - - - - - - - Unregisters this callback from receiving ChangeEvent<T> when value is changed. - - - - - - - Sends an event when text from a TextField changes. - - - - - The new text. - - - - - The text before the change occured. - - - - - Constructor. - - - - - Gets an event from the event pool and initializes it with the given values. Use this function instead of creating new events. Events obtained using this method need to be released back to the pool. You can use `Dispose()` to release them. - - The new text. - The text before the change occured. - - An initialized event. - - - - - Resets the event members to their initial values. - - - - - Interface for classes implementing UI panels. - - - - - Describes in which context a VisualElement hierarchy is being ran. - - - - - The Contextual menu manager for the panel. - - - - - This Panel EventDispatcher. - - - - - Return the focus controller for this panel. - - - - - Root of the VisualElement hierarchy. - - - - - Returns the top element at this position. Will not return elements with pickingMode set to PickingMode.Ignore. - - World coordinates. - - Top VisualElement at the position. Null if none was found. - - - - - Returns all elements at this position. Will not return elements with pickingMode set to PickingMode.Ignore. - - World coordinates. - All Visualelements overlapping this position. - - Top VisualElement at the position. Null if none was found. - - - - - Interface for panel change events. - - - - - Interface for pointer capture events and mouse capture events. - - - - - Interface for pointer events. - - - - - Returns true if the platform-specific action key is pressed. This key is Cmd on macOS, and Ctrl on all other platforms. - - - - - Angle of the stylus relative to the surface, in radians - - - - - Returns true if the Alt key is pressed. - - - - - Angle of the stylus relative to the x-axis, in radians. - - - - - Integer that indicates which mouse button is pressed: 0 is the left button, 1 is the right button, 2 is the middle button. - - - - - The number of times the button is pressed. - - - - - Returns true if the Windows/Cmd key is pressed. - - - - - Returns true if the Ctrl key is pressed. - - - - - The difference between the pointer's position during the previous mouse event and its position during the current mouse event. - - - - - The amount of time that has passed since the last recorded change in pointer values, in seconds. - - - - - Returns true if the pointer is a primary pointer - - - - - The pointer position in the current target coordinate system. - - - - - Flags that hold pressed modifier keys (Alt, Ctrl, Shift, Windows/Cmd). - - - - - Identifies the pointer that sends the event. - - - - - The type of pointer that created this event. This value is taken from the value defined in `PointerType`. - - - - - The pointer position in the Screen or World coordinate system. - - - - - A bitmask that describes the currently pressed buttons. - - - - - The amount of pressure currently applied by a touch. If the device does not report pressure, the value of this property is 1.0f. - - - - - An estimate of the radius of a touch. Add `radiusVariance` to get the maximum touch radius, subtract it to get the minimum touch radius. - - - - - Determines the accuracy of the touch radius. Add this value to the radius to get the maximum touch radius, subtract it to get the minimum touch radius. - - - - - Returns true if the Shift key is pressed. - - - - - The pressure applied to an additional pressure-sensitive control on the stylus. - - - - - The rotation of the stylus around its axis, in radians. - - - - - Style values after layout pass. - - - - - Alignment of the whole area of children on the cross axis if they span over multiple lines in this container. - - - - - Alignment of children on the cross axis of this container. - - - - - Similar to align-items, but only for this specific element. - - - - - Background color to paint in the element's box. - - - - - Background image to paint in the element's box. - - - - - Color of the element's bottom border. - - - - - The radius of the bottom-left corner when a rounded rectangle is drawn in the element's box. - - - - - The radius of the bottom-right corner when a rounded rectangle is drawn in the element's box. - - - - - Space reserved for the bottom edge of the border during the layout phase. - - - - - Color of the element's left border. - - - - - Space reserved for the left edge of the border during the layout phase. - - - - - Color of the element's right border. - - - - - Space reserved for the right edge of the border during the layout phase. - - - - - Color of the element's top border. - - - - - The radius of the top-left corner when a rounded rectangle is drawn in the element's box. - - - - - The radius of the top-right corner when a rounded rectangle is drawn in the element's box. - - - - - Space reserved for the top edge of the border during the layout phase. - - - - - Bottom distance from the element's box during layout. - - - - - Color to use when drawing the text of an element. - - - - - Defines how an element is displayed in the layout. - - - - - Initial main size of a flex item, on the main flex axis. The final layout mught be smaller or larger, according to the flex shrinking and growing determined by the other flex properties. - - - - - Direction of the main axis to layout children in a container. - - - - - Specifies how much the item will grow relative to the rest of the flexible items inside the same container. - - - - - Specifies how the item will shrink relative to the rest of the flexible items inside the same container. - - - - - Placement of children over multiple lines if not enough space is available in this container. - - - - - Font size to draw the element's text. - - - - - Fixed height of an element for the layout. - - - - - Justification of children on the main axis of this container. - - - - - Left distance from the element's box during layout. - - - - - Space reserved for the bottom edge of the margin during the layout phase. - - - - - Space reserved for the left edge of the margin during the layout phase. - - - - - Space reserved for the right edge of the margin during the layout phase. - - - - - Space reserved for the top edge of the margin during the layout phase. - - - - - Maximum height for an element, when it is flexible or measures its own size. - - - - - Maximum width for an element, when it is flexible or measures its own size. - - - - - Minimum height for an element, when it is flexible or measures its own size. - - - - - Minimum width for an element, when it is flexible or measures its own size. - - - - - Specifies the transparency of an element. - - - - - Space reserved for the bottom edge of the padding during the layout phase. - - - - - Space reserved for the left edge of the padding during the layout phase. - - - - - Space reserved for the right edge of the padding during the layout phase. - - - - - Space reserved for the top edge of the padding during the layout phase. - - - - - Element's positioning in its parent container. - - - - - Right distance from the element's box during layout. - - - - - The element's text overflow mode. - - - - - Top distance from the element's box during layout. - - - - - Tinting color for the element's backgroundImage - - - - - Background image scaling in the element's box. - - - - - Font to draw the element's text. - - - - - Font style and weight (normal, bold, italic) to draw the element's text. - - - - - Size of the 9-slice's bottom edge when painting an element's background image. - - - - - Size of the 9-slice's left edge when painting an element's background image. - - - - - Size of the 9-slice's right edge when painting an element's background image. - - - - - Size of the 9-slice's top edge when painting an element's background image. - - - - - Horizontal and vertical text alignment in the element's box. - - - - - The element's text overflow position. - - - - - Specifies whether or not an element is visible. - - - - - Word wrapping over multiple lines if not enough space is available to draw the text of an element. - - - - - Fixed width of an element for the layout. - - - - - This interface provides access to a VisualElement inline style data. - - - - - Alignment of the whole area of children on the cross axis if they span over multiple lines in this container. - - - - - Alignment of children on the cross axis of this container. - - - - - Similar to align-items, but only for this specific element. - - - - - Background color to paint in the element's box. - - - - - Background image to paint in the element's box. - - - - - Color of the element's bottom border. - - - - - The radius of the bottom-left corner when a rounded rectangle is drawn in the element's box. - - - - - The radius of the bottom-right corner when a rounded rectangle is drawn in the element's box. - - - - - Space reserved for the bottom edge of the border during the layout phase. - - - - - Color of the element's left border. - - - - - Space reserved for the left edge of the border during the layout phase. - - - - - Color of the element's right border. - - - - - Space reserved for the right edge of the border during the layout phase. - - - - - Color of the element's top border. - - - - - The radius of the top-left corner when a rounded rectangle is drawn in the element's box. - - - - - The radius of the top-right corner when a rounded rectangle is drawn in the element's box. - - - - - Space reserved for the top edge of the border during the layout phase. - - - - - Bottom distance from the element's box during layout. - - - - - Color to use when drawing the text of an element. - - - - - Mouse cursor to display when the mouse pointer is over an element. - - - - - Defines how an element is displayed in the layout. - - - - - Initial main size of a flex item, on the main flex axis. The final layout mught be smaller or larger, according to the flex shrinking and growing determined by the flex property. - - - - - Direction of the main axis to layout children in a container. - - - - - Specifies how much the item will grow relative to the rest of the flexible items inside the same container. - - - - - Specifies how the item will shrink relative to the rest of the flexible items inside the same container. - - - - - Placement of children over multiple lines if not enough space is available in this container. - - - - - Font size to draw the element's text. - - - - - Fixed height of an element for the layout. - - - - - Justification of children on the main axis of this container. - - - - - Left distance from the element's box during layout. - - - - - Space reserved for the bottom edge of the margin during the layout phase. - - - - - Space reserved for the left edge of the margin during the layout phase. - - - - - Space reserved for the right edge of the margin during the layout phase. - - - - - Space reserved for the top edge of the margin during the layout phase. - - - - - Maximum height for an element, when it is flexible or measures its own size. - - - - - Maximum width for an element, when it is flexible or measures its own size. - - - - - Minimum height for an element, when it is flexible or measures its own size. - - - - - Minimum width for an element, when it is flexible or measures its own size. - - - - - Specifies the transparency of an element. - - - - - How a container behaves if its content overflows its own box. - - - - - Space reserved for the bottom edge of the padding during the layout phase. - - - - - Space reserved for the left edge of the padding during the layout phase. - - - - - Space reserved for the right edge of the padding during the layout phase. - - - - - Space reserved for the top edge of the padding during the layout phase. - - - - - Element's positioning in its parent container. - - - - - Right distance from the element's box during layout. - - - - - The element's text overflow mode. - - - - - Top distance from the element's box during layout. - - - - - Tinting color for the element's backgroundImage - - - - - Background image scaling in the element's box. - - - - - Font to draw the element's text. - - - - - Size of the 9-slice's bottom edge when painting an element's background image. - - - - - Specifies which box the element content is clipped against. - - - - - Size of the 9-slice's bottom edge when painting an element's background image. - - - - - Size of the 9-slice's left edge when painting an element's background image. - - - - - Size of the 9-slice's right edge when painting an element's background image. - - - - - Size of the 9-slice's top edge when painting an element's background image. - - - - - Horizontal and vertical text alignment in the element's box. - - - - - The element's text overflow position. - - - - - Specifies whether or not an element is visible. - - - - - Word wrapping over multiple lines if not enough space is available to draw the text of an element. - - - - - Fixed width of an element for the layout. - - - - - This interface provides access to a VisualElement transform data. - - - - - Transformation matrix calculated from the position, rotation and scale of the transform (Read Only). - - - - - The position of the VisualElement's transform. - - - - - The rotation of the VisualElement's transform stored as a Quaternion. - - - - - The scale of the VisualElement's transform. - - - - - This type allows UXML attribute value retrieval during the VisualElement instantiation. An instance will be provided to the factory method - see UXMLFactoryAttribute. - - - - - Get the value of an attribute as a string. - - Attribute name. - The attribute value or null if not found. - - True if the attribute was found, false otherwise. - - - - - Interface for UXML factories. While it is not strictly required, concrete factories should derive from the generic class UxmlFactory. - - - - - Must return true if the UXML element attributes are not restricted to the values enumerated by uxmlAttributesDescription. - - - - - The type of element for which this element type can substitute for. - - - - - The UXML namespace for the type returned by substituteForTypeName. - - - - - The fully qualified XML name for the type returned by substituteForTypeName. - - - - - Describes the UXML attributes expected by the element. The attributes enumerated here will appear in the UXML schema. - - - - - Describes the types of element that can appear as children of this element in a UXML file. - - - - - The name of the UXML element read by the factory. - - - - - The namespace of the UXML element read by the factory. - - - - - The fully qualified name of the UXML element read by the factory. - - - - - Returns true if the factory accepts the content of the attribute bag. - - The attribute bag. - - True if the factory accepts the content of the attribute bag. False otherwise. - - - - - Instanciate and initialize an object of type T0. - - A bag of name-value pairs, one for each attribute of the UXML element. This can be used to initialize the properties of the created object. - When the element is created as part of a template instance inserted in another document, this contains information about the insertion point. - - The created object. - - - - - Represents a scheduled task created with a VisualElement's schedule interface. - - - - - Returns the VisualElement this object is associated with. - - - - - Will be true when this item is scheduled. Note that an item's callback will only be executed when it's VisualElement is attached to a panel. - - - - - Repeats this action after a specified time. - - Minimum amount of time in milliseconds between each action execution. - - This ScheduledItem. - - - - - Cancels any previously scheduled execution of this item and re-schedules the item. - - Minimum time in milliseconds before this item will be executed. - - - - After specified duration, the item will be automatically unscheduled. - - The total duration in milliseconds where this item will be active. - - This ScheduledItem. - - - - - Removes this item from its VisualElement's scheduler. - - - - - If not already active, will schedule this item on its VisualElement's scheduler. - - - - - Adds a delay to the first invokation. - - The minimum number of milliseconds after activation where this item's action will be executed. - - This ScheduledItem. - - - - - Item will be unscheduled automatically when specified condition is met. - - When condition returns true, the item will be unscheduled. - - This ScheduledItem. - - - - - A scheduler allows you to register actions to be executed at a later point. - - - - - Schedule this action to be executed later. - - The action to be executed. - The action to be executed. - - Reference to the scheduled action. - - - - - Schedule this action to be executed later. - - The action to be executed. - The action to be executed. - - Reference to the scheduled action. - - - - - Defines the alignment along the main axis, how is extra space distributed. - - - - - Items are centered along the line. - - - - - Items are packed toward the end line. - - - - - Items are packed toward the start line. Default Value. - - - - - Items are evenly distributed in the line with equal space around them. - - - - - Items are evenly distributed in the line; first item is on the start line, last item on the end line. - - - - - Base class for keyboard events. - - - - - Returns true if the platform-specific action key is pressed. This key is Cmd on macOS, and Ctrl on all other platforms. - - - - - Returns true if the Alt key is pressed. - - - - - The character. - - - - - Returns true if the Windows/Cmd key is pressed. - - - - - Returns true if the Ctrl key is pressed. - - - - - The key code. - - - - - Flags that hold pressed modifier keys (Alt, Ctrl, Shift, Windows/Cmd). - - - - - Returns true if the Shift key is pressed. - - - - - Gets a keyboard event from the event pool and initializes it with the given values. Use this function instead of creating new events. Events obtained using this method need to be released back to the pool. You can use `Dispose()` to release them. - - The character for this event. - The keyCode for this event. - Event modifier keys that are active for this event. - A keyboard IMGUI event. - - An initialized event. - - - - - Gets a keyboard event from the event pool and initializes it with the given values. Use this function instead of creating new events. Events obtained using this method need to be released back to the pool. You can use `Dispose()` to release them. - - The character for this event. - The keyCode for this event. - Event modifier keys that are active for this event. - A keyboard IMGUI event. - - An initialized event. - - - - - Resets the event members to their initial values. - - - - - Event sent when a key is pressed on the keyboard. This event trickles down and bubbles up. This event is cancellable. - - - - - Constructor. Avoid creating new event instances. Instead, use GetPooled() to get an instance from a pool of reusable event instances. - - - - - Event sent when a key is released on the keyboard. This event trickles down and bubbles up. This event is cancellable. - - - - - Constructor. Avoid creating new event instances. Instead, use GetPooled() to get an instance from a pool of reusable event instances. - - - - - Provides an Element displaying text. - - - - - USS class name of elements of this type. - - - - - Constructs a label. - - The text to be displayed. - - - - Constructs a label. - - The text to be displayed. - - - - Instantiates a Label using the data read from a UXML file. - - - - - Constructor. - - - - - Defines UxmlTraits for the Label. - - - - - Constructor. - - - - - Reprensents a distance value. - - - - - The unit of the value property. - - - - - The length value. - - - - - Creates from a float and an optionnal LengthUnit. - - - - - - - Creates from a float and an optionnal LengthUnit. - - - - - - - Creates a percentage Length from a float. - - - - The created length. - - - - - Describes how to interpret a Length value. - - - - - Interprets length as a percentage. - - - - - Interprets length as pixel. - - - - - A vertically scrollable area that only creates visual elements for visible items while allowing the binding of many more items. As the user scrolls, visual elements are recycled and re-bound to new data items. - - - - - Callback for binding a data item to the visual element. - - - - - The USS class name. Enable the showBorder property to apply this class to the ListView. - - - - - The USS class name of the drag hover bar. - - - - - This flag indicates whether the ListView should show a horizontal scroll bar when its content does not fit. The default value is False. - - - - - The USS class name for odd rows in the ListView. - - - - - The USS class name that is applied to the element on drag hover. - - - - - ListView requires all visual elements to have the same height so that it can calculate a sensible scroller size. This property must be set for the list view to function. - - - - - The USS class name of item elements in elements of this type, when they are selected. - - - - - The items data source. This property must be set for the list view to function. - - - - - The USS class name of item elements in elements of this type. - - - - - Callback for constructing the VisualElement that will serve as the template for each recycled and re-bound element in the list. This property must be set for the list view to function. - - - - - Callback for when an item is chosen (double-click). This is different from just a selection. - - The chosen item. - - - - Callback triggered when the user 'acts on' a selection of one or more items, for example by double-clicking or pressing Enter. - - - - - - Callback triggered when the selection changes. - - - - - - Callback triggered when the selection changes. - - List of selected items. - - - - Gets or sets a value that indicates whether the user can drag list items to reorder them. - - - - - Computed pixel aligned height for the list elements. This value will change depending on the current panel's dpi scaling. See Also: ListView.itemHeight. - - - - - Returns the selected item's index in the items source. If multiple items are selected, returns the first selected item's index. - - - - - The indices of selected items in the items source. - - - - - Returns the selected item from the items source. If multiple items are selected, returns the first selected item. - - - - - The selected items from the items source. - - - - - Controls the selection state. You can set the state to disable selections, have one selectable item, or have multiple selectable items. - - - - - Enable this property to display alternating background colors for rows in the ListView. - - - - - Enable this property to display a border around the ListView. - - - - - When you bind a list view to an array, this property controls whether the list view displays the collection size as the first list item. Set to true to display the collection size, false to omit it. Default is true. See Also: UnityEditor.UIElements.BindingExtensions.Bind - - - - - Callback for unbinding a data item from the visual element. - - - - - USS class name for elements of this type. - - - - - Adds an item to the collection of selected items. - - Item index. - - - - Unselects any selected items. - - - - - Clear, recreate all visible visual elements, and rebind all items. This should be called whenever the items source changes. - - - - - Removes an item from the collection of selected items. - - Item index. - - - - Scroll to a specific visual element. - - Element to scroll to. - - - - Scroll to a specific item index and make it visible. - - Item index to scroll to. Specify -1 to make the last item visible. - - - - Sets the currently selected item. - - Item index. - - - - Sets a collection of selected items. - - Collection of items to be selected. - - - - Sets a collection of selected items without triggering a selection change callback. - - Collection of items to be selected. - - - - Instantiates a ListView using the data read from a UXML file. - - - - - Constructor. - - - - - Defines UxmlTraits for the ListView. - - - - - Returns an empty enumerable, as list views generally do not have children. - - - - - Constructor. - - - - - Initialize ListView properties using values from the attribute bag. - - The object to initialize. - The attribute bag. - The creation context; unused. - - - - Base class for all Manipulator implementations. - - - - - VisualElement being manipulated. - - - - - Called to register event callbacks on the target element. - - - - - Called to unregister event callbacks from the target element. - - - - - Used by manipulators to match events against their requirements. - - - - - The button that activates the manipulation. - - - - - Number of mouse clicks required to activate the manipulator. - - - - - Any modifier keys (ie. ctrl, alt, ...) that are needed to activate the manipulation. - - - - - Checks whether the current mouse event satisfies the activation requirements. - - The mouse event. - - True if the event matches the requirements. False otherwise. - - - - - Checks whether the current pointer event satisfies the activation requirements. - - The pointer event. - - True if the event matches the requirements. False otherwise. - - - - - Offers functionality for generating visual content of a VisualElement during the generateVisualContent callback. - - - - - The element for which VisualElement.generateVisualContent was invoked. - - - - - Allocates the specified number of vertices and indices required to express geometry for drawing the content of a VisualElement. - - The number of vertices to allocate. The maximum is 65535 (or UInt16.MaxValue). - The number of triangle list indices to allocate. Each 3 indices represent one triangle, so this value should be multiples of 3. - An optional texture to be applied on the triangles allocated. Pass null to rely on vertex colors only. - - An object that gives access to the newely allocated data. If the returned vertex count is 0, then allocation failed (the system ran out of memory). - - - - - A class that represents the vertex and index data allocated for drawing the content of a VisualElement. - - - - - The number of indices successfully allocated for VisualElement content drawing. - - - - - A rectangle describing the UV region holding the texture passed to MeshGenerationContext.Allocate. - - - - - The number of vertices successfully allocated for VisualElement content drawing. - - - - - Fills the values of the allocated indices with values copied directly from an array. Each 3 consecutive indices form a single triangle. - - The array of indices to copy from. The length of the array must match the allocated index count. - - - - Fills the values of the allocated indices with values copied directly from a slice. Each 3 consecutive indices form a single triangle. -When this method is called, it is not possible to use SetNextIndex to fill the indices. - - The slice of indices to copy from. The length of the slice must match the allocated index count. - - - - Fills the values of the allocated vertices with values copied directly from an array. -When this method is called, it is not possible to use SetNextVertex to fill the allocated vertices array. - - The array of vertices to copy from. The length of the array must match the allocated vertex count. - - - - Fills the values of the allocated vertices with values copied directly from a slice. -When this method is called, it is not possible to use SetNextVertex to fill the vertices. - - The slice of vertices to copy from. The length of the slice must match the allocated vertex count. - - - - Assigns the value of the next index of the allocated indices list. - - The value of the next index. - - - - Assigns the value of the next vertex of the allocated vertices list. - - The value of the next vertex. - - - - A min/max slider containing a representation of a range. - - - - - USS class name of dragger elements in elements of this type. - - - - - This is the high limit of the slider. - - - - - USS class name of input elements in elements of this type. - - - - - USS class name of labels in elements of this type. - - - - - This is the low limit of the slider. - - - - - USS class name of the maximum thumb elements in elements of this type. - - - - - This is the high value of the range represented on the slider. - - - - - USS class name of the minimum thumb elements in elements of this type. - - - - - This is the low value of the range represented on the slider. - - - - - Returns the range of the low/high limits of the slider. - - - - - USS class name of tracker elements in elements of this type. - - - - - USS class name of elements of this type. - - - - - This is the value of the slider. This is a Vector2 where the x is the lower bound and the y is the higher bound. - - - - - Constructor. - - The minimum value in the range to be represented. - The maximum value in the range to be represented. - The minimum value of the slider limit. - The maximum value of the slider limit. - This is the sldier direction, for now, only Horizontal is supported. - - - - Constructor. - - The minimum value in the range to be represented. - The maximum value in the range to be represented. - The minimum value of the slider limit. - The maximum value of the slider limit. - This is the sldier direction, for now, only Horizontal is supported. - - - - Instantiates a MinMaxSlider using the data read from a UXML file. - - - - - Constructor. - - - - - Defines UxmlTraits for the MinMaxSlider. - - - - - Constructor. - - - - - Initialize MinMaxSlider properties using values from the attribute bag. - - The element to initialize. - The bag of attributes. - Creation Context, unused. - - - - Describes a MouseButton. - - - - - The Left Mouse Button. - - - - - The Middle Mouse Button. - - - - - The Right Mouse Button. - - - - - Class that manages capturing mouse events. - - - - - Assigns an event handler to capture mouse events. - - The event handler that captures mouse events. - - - - Checks if the event handler is capturing the mouse. - - Event handler to check. - - True if the handler captures the mouse. - - - - - Checks if there is a handler capturing the mouse. - - - True if a handler is capturing the mouse, false otherwise. - - - - - Stops an event handler from capturing the mouse. - - The event handler to stop capturing the mouse. If this handler is not assigned to capturing the mouse, nothing happens. - - - - Stops an event handler from capturing the mouse. - - The event handler to stop capturing the mouse. If this handler is not assigned to capturing the mouse, nothing happens. - - - - Event sent after a handler starts capturing the mouse. - - - - - Constructor. - - - - - Event sent when the handler capturing the mouse changes. - - - - - In the case of a MouseCaptureEvent, this property is the IEventHandler that loses the capture. In the case of a MouseCaptureOutEvent, this property is the IEventHandler that gains the capture. - - - - - Gets an event from the event pool and initializes it with the given values. Use this function instead of creating new events. Events obtained using this method need to be released back to the pool. You can use `Dispose()` to release them. - - The handler taking or releasing the mouse capture. - The related target. - - An initialized event. - - - - - Resets the event members to their initial values. - - - - - Event sent before a handler stops capturing the mouse. - - - - - Constructor. - - - - - Mouse down event. - - - - - Constructor. Avoid creating new event instances. Instead, use GetPooled() to get an instance from a pool of reusable event instances. - - - - - Gets an event from the event pool and initializes it with the given values. Use this function instead of creating new events. Events obtained using this method need to be released back to the pool. You can use `Dispose()` to release them. - - An IMGUI mouse event. - - An initialized event. - - - - - Event sent when the mouse pointer enters an element or one of its descendent elements. The event is cancellable, it does not trickle down, and it does not bubble up. - - - - - Constructor. Avoid creating new event instances. Instead, use GetPooled() to get an instance from a pool of reusable event instances. - - - - - Resets the event members to their initial values. - - - - - Event sent when the mouse pointer enters a window. The event is cancellable, it does not trickle down, and it does not bubble up. - - - - - Constructor. Avoid creating new event instances. Instead, use GetPooled() to get an instance from a pool of reusable event instances. - - - - - Resets the event members to their initial values. - - - - - The base class for mouse events. - - - - - Returns true if the platform-specific action key is pressed. This key is Cmd on macOS, and Ctrl on all other platforms. - - - - - Returns true if the Alt key is pressed. - - - - - Integer that indicates which mouse button is pressed: 0 is the left button, 1 is the right button, 2 is the middle button. - - - - - The number of times the button is pressed. - - - - - Returns true if the Windows/Cmd key is pressed. - - - - - Returns true if the Ctrl key is pressed. - - - - - The current target of the event. The current target is the element in the propagation path for which event handlers are currently being executed. - - - - - The mouse position in the current target coordinate system. - - - - - Flags that hold pressed modifier keys (Alt, Ctrl, Shift, Windows/Cmd). - - - - - The difference of the mouse position between the previous mouse event and the current mouse event. - - - - - The mouse position in the screen coordinate system. - - - - - A bitmask that describes the currently pressed buttons. - - - - - Returns true if the Shift key is pressed. - - - - - Gets an event from the event pool and initializes it with the given values. Use this function instead of creating new events. Events obtained using this method need to be released back to the pool. You can use `Dispose()` to release them. - - An IMGUI mouse event. - The event that sent this event. - The pointer event that sent this event. - The mouse position. - The mouse button pressed. - The number of consecutive mouse clicks received. - The relative movement of the mouse compared to the mouse position when the last event was received. - The modifier keys held down during the event. - - An initialized event. - - - - - Gets an event from the event pool and initializes it with the given values. Use this function instead of creating new events. Events obtained using this method need to be released back to the pool. You can use `Dispose()` to release them. - - An IMGUI mouse event. - The event that sent this event. - The pointer event that sent this event. - The mouse position. - The mouse button pressed. - The number of consecutive mouse clicks received. - The relative movement of the mouse compared to the mouse position when the last event was received. - The modifier keys held down during the event. - - An initialized event. - - - - - Gets an event from the event pool and initializes it with the given values. Use this function instead of creating new events. Events obtained using this method need to be released back to the pool. You can use `Dispose()` to release them. - - An IMGUI mouse event. - The event that sent this event. - The pointer event that sent this event. - The mouse position. - The mouse button pressed. - The number of consecutive mouse clicks received. - The relative movement of the mouse compared to the mouse position when the last event was received. - The modifier keys held down during the event. - - An initialized event. - - - - - Gets an event from the event pool and initializes it with the given values. Use this function instead of creating new events. Events obtained using this method need to be released back to the pool. You can use `Dispose()` to release them. - - An IMGUI mouse event. - The event that sent this event. - The pointer event that sent this event. - The mouse position. - The mouse button pressed. - The number of consecutive mouse clicks received. - The relative movement of the mouse compared to the mouse position when the last event was received. - The modifier keys held down during the event. - - An initialized event. - - - - - Resets the event members to their initial values. - - - - - Event sent when the mouse pointer exits an element and all its descendent elements. The event is cancellable, it does not trickle down, and it does not bubble up. - - - - - Constructor. Avoid creating new event instances. Instead, use GetPooled() to get an instance from a pool of reusable event instances. - - - - - Resets the event members to their initial values. - - - - - Event sent when the mouse pointer exits a window. The event is cancellable, it does not trickle down, and it does not bubble up. - - - - - Constructor. Avoid creating new event instances. Instead, use GetPooled() to get an instance from a pool of reusable event instances. - - - - - Gets an event from the event pool and initializes it with the given values. Use this function instead of creating new events. Events obtained using this method need to be released back to the pool. You can use `Dispose()` to release them. - - An IMGUI MouseLeaveWindow event. - - An initialized event. - - - - - Resets the event members to their initial values. - - - - - MouseManipulators have a list of activation filters. - - - - - List of Activationfilters. - - - - - Checks whether MouseEvent satisfies all of the ManipulatorActivationFilter requirements. - - The MouseEvent to validate. - - True if the event satisfies the requirements. False otherwise. - - - - - Checks whether the MouseEvent is related to this Manipulator. - - MouseEvent to validate. - - True if MouseEvent uses the current activator button. False otherwise. - - - - - Mouse move event. - - - - - Constructor. Avoid creating new event instances. Instead, use GetPooled() to get an instance from a pool of reusable event instances. - - - - - Gets an event from the event pool and initializes it with the given values. Use this function instead of creating new events. Events obtained using this method need to be released back to the pool. You can use `Dispose()` to release them. - - An IMGUI mouse event. - - An initialized event. - - - - - Event sent when the mouse pointer exits an element. The event trickles down, it bubbles up, and it is cancellable. - - - - - Constructor. Avoid creating new event instances. Instead, use GetPooled() to get an instance from a pool of reusable event instances. - - - - - Event sent when the mouse pointer enters an element. The event trickles down, it bubbles up, and it is cancellable. - - - - - Constructor. Avoid creating new event instances. Instead, use GetPooled() to get an instance from a pool of reusable event instances. - - - - - Mouse up event. - - - - - Constructor. Avoid creating new event instances. Instead, use GetPooled() to get an instance from a pool of reusable event instances. - - - - - Gets an event from the event pool and initializes it with the given values. Use this function instead of creating new events. Events obtained using this method need to be released back to the pool. You can use `Dispose()` to release them. - - An IMGUI mouse event. - - An initialized event. - - - - - Defines what should happend if content overflows an element bounds. - - - - - The overflow is clipped, and the rest of the content will be invisible. - - - - - The overflow is not clipped. It renders outside the element's box. Default Value. - - - - - Boxes against which the VisualElement content is clipped. - - - - - Clip the content against the box inside the padding areas. - - - - - Clip the content against the box outside the padding areas but inside the borders. - - - - - Abstract base class for events notifying of a panel change. - - - - - In the case of AttachToPanelEvent, the panel to which the event target element is now attached. In the case of DetachFromPanelEvent, the panel to which the event target element will be attached. - - - - - In the case of AttachToPanelEvent, the panel to which the event target element was attached. In the case of DetachFromPanelEvent, the panel from which the event target element is detached. - - - - - Gets an event from the event pool and initializes it with the given values. Use this function instead of creating new events. Events obtained using this method need to be released back to the pool. You can use `Dispose()` to release them. - - Sets the originPanel property of the event. - Sets the destinationPanel property of the event. - - An initialized event. - - - - - Resets the event members to their initial values. - - - - - Describes the picking behavior. - - - - - Disables picking. - - - - - Picking enabled. Default Value. - - - - - Event sent when pointer interaction is cancelled. - - - - - Constructor. Avoid creating new event instances. Instead, use GetPooled() to get an instance from a pool of reusable event instances. - - - - - Resets the event members to their initial values. - - - - - Event sent when a pointer is captured by a VisualElement. - - - - - Constructor. Avoid creating new event instances. Instead, use GetPooled() to get an instance from a pool of reusable event instances. - - - - - Base class for pointer capture events and mouse capture events. - - - - - Identifies the pointer that sends the event. - - - - - For PointerCaptureEvent and MouseCaptureEvent, returns the VisualElement that loses the pointer capture, if any. For PointerCaptureOutEvent and MouseCaptureOutEvent, returns the VisualElement that captures the pointer. - - - - - Gets an event from the event pool and initializes it with the given values. Use this function instead of creating new events. Events obtained using this method need to be released back to the pool. You can use `Dispose()` to release them. - - For PointerCapture and MouseCapture events, the element that captures the pointer. For PointerCaptureOut and MouseCaptureOut events, the element that releases the pointer. - For PointerCaptureEvent and MouseCaptureEvent, returns the element that loses the pointer capture, if any. For PointerCaptureOutEvent and MouseCaptureOutEvent, returns the element that captures the pointer. - The pointer that is captured or released. - - An initialized event. - - - - - Resets the event members to their initial values. - - - - - A static class to capture and release pointers. - - - - - Captures the pointer. - - The VisualElement that captures the pointer. - The pointer to capture. - - - - Returns the element that is capturing the pointer. - - The panel that holds the element. - The captured pointer. - - The element that is capturing the pointer. - - - - - Tests whether the element has captured the pointer. - - The VisualElement being tested. - The captured pointer. - - True if element captured the pointer. - - - - - Tests whether an element captured a pointer and, if so, tells the element to release the pointer. - - The element which potentially captured the pointer. - The captured pointer. - - - - Releases the pointer. - - The panel that holds the element that captured the pointer. - The captured pointer. - - - - Event sent when a VisualElement releases a pointer. - - - - - Constructor. Avoid creating new event instances. Instead, use GetPooled() to get an instance from a pool of reusable event instances. - - - - - Event sent when a pointer is pressed. - - - - - Constructor. Avoid creating new event instances. Instead, use GetPooled() to get an instance from a pool of reusable event instances. - - - - - Resets the event members to their initial values. - - - - - Event sent when a pointer enters a VisualElement or one of its descendant. - - - - - Constructor. Avoid creating new event instances. Instead, use GetPooled() to get an instance from a pool of reusable event instances. - - - - - Resets the event members to their initial values. - - - - - Base class for pointer events. - - - - - Returns true if the platform-specific action key is pressed. This key is Cmd on macOS, and Ctrl on all other platforms. - - - - - Angle of the stylus relative to the surface, in radians - - - - - Returns true if the Alt key is pressed. - - - - - Angle of the stylus relative to the x-axis, in radians. - - - - - Integer that indicates which mouse button is pressed: 0 is the left button, 1 is the right button, 2 is the middle button. - - - - - The number of times the button is pressed. - - - - - Returns true if the Windows/Cmd key is pressed. - - - - - Returns true if the Ctrl key is pressed. - - - - - The current target of the event. The current target is the element in the propagation path for which event handlers are currently being executed. - - - - - The difference between the pointer's position during the previous mouse event and its position during the current mouse event. - - - - - The amount of time that has passed since the last recorded change in pointer values, in seconds. - - - - - Returns true if the pointer is a primary pointer - - - - - The pointer position in the current target coordinate system. - - - - - Flags that hold pressed modifier keys (Alt, Ctrl, Shift, Windows/Cmd). - - - - - Identifies the pointer that sends the event. - - - - - The type of pointer that created this event. This value is taken from the value defined in `PointerType`. - - - - - The pointer position in the Screen or World coordinate system. - - - - - A bitmask that describes the currently pressed buttons. - - - - - The amount of pressure currently applied by a touch. If the device does not report pressure, the value of this property is 1.0f. - - - - - An estimate of the radius of a touch. Add `radiusVariance` to get the maximum touch radius, subtract it to get the minimum touch radius. - - - - - Determines the accuracy of the touch radius. Add this value to the radius to get the maximum touch radius, subtract it to get the minimum touch radius. - - - - - Returns true if the Shift key is pressed. - - - - - The pressure applied to an additional pressure-sensitive control on the stylus. - - - - - The rotation of the stylus around its axis, in radians. - - - - - Gets an event from the event pool and initializes it with the given values. Use this function instead of creating new events. Events obtained using this method need to be released back to the pool. You can use `Dispose()` to release them. - - An IMGUI mouse event. - A Touch structure from the InputManager. - The modifier keys held down during the event. - The event that sent this event. - - An initialized event. - - - - - Gets an event from the event pool and initializes it with the given values. Use this function instead of creating new events. Events obtained using this method need to be released back to the pool. You can use `Dispose()` to release them. - - An IMGUI mouse event. - A Touch structure from the InputManager. - The modifier keys held down during the event. - The event that sent this event. - - An initialized event. - - - - - Gets an event from the event pool and initializes it with the given values. Use this function instead of creating new events. Events obtained using this method need to be released back to the pool. You can use `Dispose()` to release them. - - An IMGUI mouse event. - A Touch structure from the InputManager. - The modifier keys held down during the event. - The event that sent this event. - - An initialized event. - - - - - Resets the event members to their initial values. - - - - - A static class that holds pointer ID values. - - - - - Represents an invalid pointer ID value. - - - - - The maximum number of pointers the implementation supports. - - - - - The mouse pointer ID. - - - - - The number of pen pointers the implementation supports. - - - - - The base ID for pen pointers. - - - - - The number of touch pointers the implementation supports. - - - - - The base ID for touch pointers. - - - - - Event sent when a pointer exits an element and all of its descendant. - - - - - Constructor. Avoid creating new event instances. Instead, use GetPooled() to get an instance from a pool of reusable event instances. - - - - - Resets the event members to their initial values. - - - - - PointerManipulators have a list of activation filters. - - - - - Checks whether PointerEvent satisfies all of the ManipulatorActivationFilter requirements. - - The PointerEvent to validate. - - True if the event satisfies the requirements. False otherwise. - - - - - Checks whether the PointerEvent is related to this Manipulator. - - PointerEvent to validate. - - True if PointerEvent uses the current activator button. False otherwise. - - - - - Event sent when a pointer changes state. - - - - - Constructor. Avoid creating new event instances. Instead, use GetPooled() to get an instance from a pool of reusable event instances. - - - - - Resets the event members to their initial values. - - - - - Event sent when a pointer exits an element. - - - - - Constructor. Avoid creating new event instances. Instead, use GetPooled() to get an instance from a pool of reusable event instances. - - - - - Event sent when a pointer enters a VisualElement. - - - - - Constructor. Avoid creating new event instances. Instead, use GetPooled() to get an instance from a pool of reusable event instances. - - - - - An event sent when a pointer does not change for a set amount of time determined by the operating system. - - - - - Constructor. Avoid creating new event instances. Instead, use GetPooled() to get an instance from a pool of reusable event instances. - - - - - Resets the event members to their initial values. - - - - - A static class that holds pointer type values. - - - - - The pointer type for mouse events. - - - - - The pointer type for pen events. - - - - - The pointer type for touch events. - - - - - The pointer type for events created by unknown devices. - - - - - Event sent when the last depressed button of a pointer is released. - - - - - Constructor. Avoid creating new event instances. Instead, use GetPooled() to get an instance from a pool of reusable event instances. - - - - - Resets the event members to their initial values. - - - - - Styled visual element that matches the EditorGUILayout.Popup IMGUI element. - - - - - USS class name of content elements in elements of this type. - - - - - USS class name of elements of this type. - - - - - Instantiates a PopupWindow using the data read from a UXML file. - - - - - Constructor. - - - - - Defines UxmlTraits for the PopupWindow. - - - - - Returns an empty enumerable, as popup windows generally do not have children. - - - - - Constructor. - - - - - Defaines how the position values are interpreted by the layout engine. - - - - - The element is positioned in relation to its parent box and does not contribute to the layout anymore. - - - - - The element is positioned in relation to its default box as calculated by layout. - - - - - The propagation phases of an event. - - - - - The event is sent to the target. - - - - - The event is sent from the target element's parent back to the panel's root element. - - - - - The event is sent to the target element, which can then execute its final default actions for the event. Event handlers do not receive the event in this phase. Instead, ExecuteDefaultAction is called on the target element. - - - - - The event is sent to the target element, which can then execute its default actions for the event at the target phase. Event handlers do not receive the event in this phase. Instead, ExecuteDefaultActionAtTarget is called on the target element. - - - - - The event is not propagated. - - - - - The event is sent from the panel's root element to the target element's parent. - - - - - A button that executes an action repeatedly while it is pressed. - - - - - USS class name of elements of this type. - - - - - Constructor. - - The action to execute when the button is pressed. - The initial delay before the action is executed for the first time. - The interval between each execution of the action. - - - - Constructor. - - The action to execute when the button is pressed. - The initial delay before the action is executed for the first time. - The interval between each execution of the action. - - - - Set the action that should be executed when the button is pressed. - - The action to execute. - The initial delay before the action is executed for the first time. - The interval between each execution of the action. - - - - Instantiates a RepeatButton using the data read from a UXML file. - - - - - Constructor. - - - - - Defines UxmlTraits for the RepeatButton. - - - - - Constructor. - - - - - Initialize RepeatButton properties using values from the attribute bag. - - The object to initialize. - The attribute bag. - The creation context; unused. - - - - A vertical or horizontal scrollbar. - - - - - Direction of this scrollbar. - - - - - Top or right scroll button. - - - - - USS class name of high buttons in elements of this type. - - - - - Maximum value. - - - - - USS class name of elements of this type, when they are displayed horizontally. - - - - - Bottom or left scroll button. - - - - - USS class name of low buttons in elements of this type. - - - - - Minimum value. - - - - - The slider used by this scroller. - - - - - USS class name of slider elements in elements of this type. - - - - - USS class name of elements of this type. - - - - - Value that defines the slider position. It lies between lowValue and highValue. - - - - - Event sent when the slider value has changed. - - - - - - USS class name of elements of this type, when they are displayed vertically. - - - - - Updates the slider element size as a ratio of total range. A value greater than 1 will disable the Scroller. - - Slider size ratio. - - - - Constructor. - - - - - - - - - Constructor. - - - - - - - - - Will change the value according to the current slider pageSize. - - - - - - Will change the value according to the current slider pageSize. - - - - - - Will change the value according to the current slider pageSize. - - - - - - Will change the value according to the current slider pageSize. - - - - - - Instantiates a Scroller using the data read from a UXML file. - - - - - Constructor. - - - - - Defines UxmlTraits for the Scroller. - - - - - Returns an empty enumerable, as scrollers do not have children. - - - - - Constructor. - - - - - Initialize Scroller properties using values from the attribute bag. - - The object to initialize. - The attribute bag. - The creation context; unused. - - - - Displays its contents inside a scrollable frame. - - - - - Contains full content, potentially partially visible. - - - - - USS class name of content elements in elements of this type. - - - - - Represents the visible part of contentContainer. - - - - - The amount of elasticity to use when a user tries to scroll past the boundaries of the scroll view. - - - - - This property is controlling the scrolling speed of the horizontal scroller. - - - - - Horizontal scrollbar. - - - - - USS class name of horizontal scrollers in elements of this type. - - - - - Controls the rate at which the scrolling movement slows after a user scrolls using a touch interaction. - - - - - The current scrolling position. - - - - - Should the horizontal scroller be visible. - - - - - Should the vertical scroller be visible. - - - - - The behavior to use when a user tries to scroll past the boundaries of the ScrollView content using a touch interaction. - - - - - USS class name of elements of this type. - - - - - This property is controlling the scrolling speed of the vertical scroller. - - - - - Vertical Scrollbar. - - - - - USS class name of viewport elements in elements of this type. - - - - - USS class name of vertical scrollers in elements of this type. - - - - - Constructor. - - - - - Scroll to a specific child element. - - The child to scroll to. - - - - The behavior to use when a user tries to scroll past the end of the ScrollView content using a touch interaction. - - - - - The content position is clamped to the ScrollView boundaries. - - - - - The content position can overshoot the ScrollView boundaries, but then "snaps" back within them. - - - - - The content position can move past the ScrollView boundaries. - - - - - Instantiates a ScrollView using the data read from a UXML file. - - - - - Constructor. - - - - - Defines UxmlTraits for the ScrollView. - - - - - Constructor. - - - - - Initialize ScrollView properties using values from the attribute bag. - - The object to initialize. - The attribute bag. - The creation context; unused. - - - - Mode configuring the ScrollView for the intended usage. - - - - - Configure ScrollView for horizontal scrolling. - - - - - Configure ScrollView for vertical scrolling. - - - - - Configure ScrollView for vertical and horizontal scrolling. - - - - - Controls how many items can be selected at once. - - - - - Multiple items are selectable at once. - - - - - Selections are disabled. - - - - - Only one item is selectable. - - - - - A slider containing floating point values. - - - - - USS class name of input elements in elements of this type. - - - - - USS class name of labels in elements of this type. - - - - - USS class name of elements of this type. - - - - - Constructor. - - - - - - - - - - Constructor. - - - - - - - - - - Constructor. - - - - - - - - - - Instantiates a Slider using the data read from a UXML file. - - - - - Constructor. - - - - - Defines UxmlTraits for the Slider. - - - - - Constructor. - - - - - Initialize Slider properties using values from the attribute bag. - - The object to initialize. - The attribute bag. - The creation context; unused. - - - - This is the direction of the Slider and SliderInt. - - - - - An horizontal slider is made with a SliderDirection Horizontal. - - - - - An vertical slider is made with a SliderDirection Vertical. - - - - - A slider containing Integer discrete values. - - - - - USS class name of input elements in elements of this type. - - - - - USS class name of labels in elements of this type. - - - - - The value to add or remove to the SliderInt.value when it is clicked. - - - - - USS class name of elements of this type. - - - - - Constructors for the SliderInt. - - This is the low value of the slider. - This is the high value of the slider. - This is the slider direction, horizontal or vertical. - This is the number of values to change when the slider is clicked. - - - - Constructors for the SliderInt. - - This is the low value of the slider. - This is the high value of the slider. - This is the slider direction, horizontal or vertical. - This is the number of values to change when the slider is clicked. - - - - Instantiates a SliderInt using the data read from a UXML file. - - - - - Constructor. - - - - - Defines UxmlTraits for the SliderInt. - - - - - Constructor. - - - - - Initialize SliderInt properties using values from the attribute bag. - - The object to initialize. - The bag of attributes. - The creation context; unused. - - - - Style value that can be either a Background or a StyleKeyword. - - - - - The style keyword. - - - - - The Background value. - - - - - Creates from either a Background or a StyleKeyword. - - - - - - - Creates from either a Background or a StyleKeyword. - - - - - - - Creates from either a Background or a StyleKeyword. - - - - - - - Style value that can be either a Color or a StyleKeyword. - - - - - The style keyword. - - - - - The Color value. - - - - - Creates from either a Color or StyleKeyword. - - - - - - - Creates from either a Color or StyleKeyword. - - - - - - - Style value that can be either a Cursor or a StyleKeyword. - - - - - The style keyword. - - - - - The Cursor value. - - - - - Creates from either a Cursor or StyleKeyword. - - - - - - - Creates from either a Cursor or StyleKeyword. - - - - - - - Style value that can be either an enum or a StyleKeyword. - - - - - The style keyword. - - - - - The style value. - - - - - Creates from either an enum or a StyleKeyword. - - - - - - - Creates from either an enum or a StyleKeyword. - - - - - - - Style value that can be either a float or a StyleKeyword. - - - - - The style keyword. - - - - - The float value. - - - - - Creates from either a float or a StyleKeyword. - - - - - - - Creates from either a float or a StyleKeyword. - - - - - - - Style value that can be either a Font or a StyleKeyword. - - - - - The style keyword. - - - - - The Font value. - - - - - Creates from a Font or StyleKeyword. - - - - - - - Creates from a Font or StyleKeyword. - - - - - - - Style value that can be either an integer or a StyleKeyword. - - - - - The style keyword. - - - - - The integer value. - - - - - Creates from either an integer or StyleKeyword. - - - - - - - Creates from either an integer or StyleKeyword. - - - - - - - Keyword that can be used on any style value types. - - - - - For style properties accepting auto. - - - - - The initial (or default) value of a style property. - - - - - For style properties accepting none. - - - - - Means that an inline style from IStyle has no value or keyword. - - - - - Means that there's no keyword defined for that property. - - - - - Style value that can be either a Length or a StyleKeyword. - - - - - The style keyword. - - - - - The Length value. - - - - - Creates from either a Length or a StyleKeyword. - - - - - - - Creates from either a Length or a StyleKeyword. - - - - - - - Creates from either a Length or a StyleKeyword. - - - - - - - Style sheets are applied to visual elements in order to control the layout and visual appearance of the user interface. - - - - - A hash value computed from the stylesheet content. - - - - - Template Container. - - - - - Instantiates and clones a TemplateContainer using the data read from a UXML file. - - - - - Constructor. - - - - - Defines UxmlTraits for the TemplateContainer. - - - - - Returns an empty enumerable, as template instance do not have children. - - - - - Constructor. - - - - - Initialize TemplateContainer properties using values from the attribute bag. - - The object to initialize. - The attribute bag. - The creation context; unused. - - - - Abstract base class for VisualElement containing text. - - - - - When true, a tooltip displays the full version of elided text. - - - - - Returns true if text is elided, false otherwise. - - - - - The text associated with the element. - - - - - USS class name of elements of this type. - - - - - Computes the size needed to display a text string based on element style values such as font, font-size, word-wrap, and so on. - - The text to measure. - Suggested width. Can be zero. - Width restrictions. - Suggested height. - Height restrictions. - - The horizontal and vertical size needed to display the text string. - - - - - Instantiates a TextElement using the data read from a UXML file. - - - - - Constructor. - - - - - Defines UxmlTraits for the TextElement. - - - - - Enumerator to get the child elements of the UxmlTraits of TextElement. - - - - - Constructor. - - - - - Initializer for the UxmlTraits for the TextElement. - - VisualElement to initialize. - Bag of attributes where to get the value from. - Creation Context, not used. - - - - A textfield is a rectangular area where the user can edit a string. - - - - - USS class name of input elements in elements of this type. - - - - - USS class name of labels in elements of this type. - - - - - Set this to true to allow multiple lines in the textfield and false if otherwise. - - - - - USS class name of elements of this type. - - - - - The string currently being exposed by the field. - - - - - Creates a new textfield. - - The maximum number of characters this textfield can hold. If 0, there is no limit. - Set this to true to allow multiple lines in the textfield and false if otherwise. - Set this to true to mask the characters and false if otherwise. - The character used for masking in a password field. - - - - Creates a new textfield. - - The maximum number of characters this textfield can hold. If 0, there is no limit. - Set this to true to allow multiple lines in the textfield and false if otherwise. - Set this to true to mask the characters and false if otherwise. - The character used for masking in a password field. - - - - Selects text in the textfield between cursorIndex and selectionIndex. - - The caret and selection start position. - The selection end position. - - - - - Instantiates a TextField using the data read from a UXML file. - - - - - Constructor. - - - - - Defines UxmlTraits for the TextField. - - - - - Constructor. - - - - - Initialize TextField properties using values from the attribute bag. - - The object to initialize. - The attribute bag. - The creation context; unused. - - - - Abstract base class used for all text-based fields. - - - - - Color of the cursor. - - - - - The current cursor position index in the text input field. - - - - - Controls whether double clicking selects the word under the mouse pointer or not. - - - - - USS class name of input elements in elements of this type. - - - - - If set to true, the value property is not updated until either the user presses Enter or the text field loses focus. - - - - - Returns true if the field is used to edit a password. - - - - - Returns true if the field is read only. - - - - - USS class name of labels in elements of this type. - - - - - The character used for masking in a password field. - - - - - Maximum number of characters for the field. - - - - - The current selection position index in the text input field. - - - - - Background color of selected text. - - - - - This is the text input visual element which presents the value in the field. - - - - - USS class name of input elements in elements of this type. - - - - - Controls whether triple clicking selects the entire line under the mouse pointer or not. - - - - - USS class name of elements of this type. - - - - - Selects all the text. - - - - - This is the input text base class visual representation. - - - - - Color of the cursor. - - - - - This is the cursor index in the text presented. - - - - - Indicates if a double click selects or not a word. - - - - - Returns true if the field is used to edit a password. - - - - - Returns true if the field is read only. - - - - - The character used for masking in a password field. - - - - - Maximum number of characters for the field. - - - - - This is the selection index in the text presented. - - - - - Background color of selected text. - - - - - Indicates if a double click selects or not a line. - - - - - Called to construct a menu to show different options. - - - - - - Selects all the text contained in the field. - - - - - Converts a string to a value type. - - The string to convert. - - The value parsed from the string. - - - - - Defines UxmlTraits for TextInputFieldBase. - - - - - Initialize the traits for this field. - - VisualElement to which to apply the attributes. - Bag of attributes where to get the attributes. - Creation context. - - - - Specifies how the text Element treats hidden overflow content. - - - - - The Element clips overflow content and hides it. This is the default value. - - - - - The Element clips overflow content and hides it, but displays an ellipsis ("...") to indicate that clipped content exists. - - - - - Specifies which part of the text the Element replaces with an ellipsis when textOverflow is set to TextOverflow.Ellipsis. - - - - - The ellipsis replaces content at the end of the text. This is the default value. - - - - - The ellipsis replaces content in the middle of the text. - - - - - The ellipsis replaces content at the beginning of the text. - - - - - The theme style sheet is a collection of themes, style sheets, and rules used to define default UI appearance. - - - - - Contains timing information of scheduler events. - - - - - Time difference in milliseconds between now and the previous callback. - - - - - Current time in milliseconds. - - - - - Start time in milliseconds, or last callback time for repeatable IScheduledItem. - - - - - Compare this object with another object and return true if they are equal. - - The object to compare with. - The object to compare with. - - True if the objects are equal. - - - - - Compare this object with another object and return true if they are equal. - - The object to compare with. - The object to compare with. - - True if the objects are equal. - - - - - Compare two TimerState objects and return true if they are equal. - - The first object. - The second object. - - - - Compare two TimerState objects and return true if they are not equal. - - The first object. - The second object. - - - - This is the Toggle field. - - - - - USS class name of elements of this type. - - - - - USS class name of input elements in elements of this type. - - - - - USS class name of labels in elements of this type. - - - - - USS class name of elements of this type, when there is no text. - - - - - Optional text after the toggle. - - - - - USS class name of text elements in elements of this type. - - - - - USS class name of elements of this type. - - - - - Instantiates a Toggle using the data read from a UXML file. - - - - - Constructor. - - - - - Defines UxmlTraits for the Toggle. - - - - - Constructor. - - - - - Initialize Toggle properties using values from the attribute bag. - - The object to initialize. - The attribute bag. - The creation context; unused. - - - - Event sent to find the first VisualElement that displays a tooltip. - - - - - Rectangle of the hovered VisualElement in the panel coordinate system. - - - - - Text to display inside the tooltip box. - - - - - Resets the event members to their initial values. - - - - - Use this enum to specify during which phases the event handler is executed. - - - - - The event handler should be executed during the AtTarget and BubbleUp phases. - - - - - The event handler should be executed during the TrickleDown and AtTarget phases. - - - - - Base class for all the uxml specific attributes. - - - - - The default value to be used for that specific attribute. - - - - - The string representation of the default value of the uxml attribute. - - - - - Use this method to obtain the actual value of the attribute. - - The bag of attributes where to get the actual value. - The creation context. - - The value of type T. - - - - - Use this method to obtain the actual value of the attribute. - - The bag of attributes where to get the actual value. - The creation context. - - The value of type T. - - - - - UQuery is a set of extension methods allowing you to select individual or collection of visualElements inside a complex hierarchy. - - - - - Utility Object that contructs a set of selection rules to be ran on a root visual element. - - - - - Selects all elements that are active. - - - A QueryBuilder with the selection rules. - - - - - Convenience overload, shorthand for Build().AtIndex(). - - - - - - Compiles the selection rules into a QueryState object. - - - - - Selects all elements that are checked. - - - - - Selects all direct child elements of elements matching the previous rules. - - - - - - - - Selects all direct child elements of elements matching the previous rules. - - - - - - - - Selects all elements with the given class. Not to be confused with Type (see OfType<>()). - - - - - - Initializes a QueryBuilder. - - The root element on which to condfuct the search query. - - - - Selects all elements that are descendants of currently matching ancestors. - - - - - - - - Selects all elements that are descendants of currently matching ancestors. - - - - - - - - Selects all elements that are enabled. - - - - - Convenience overload, shorthand for Build().First(). - - - The first element matching all the criteria, or null if none was found. - - - - - Selects all elements that are enabled. - - - - - Convenience overload, shorthand for Build().ForEach(). - - The function to be invoked with each matching element. - - - - Convenience overload, shorthand for Build().ForEach(). - - The function to be invoked with each matching element. - Each return value will be added to this list. - - - - Convenience overload, shorthand for Build().ForEach(). - - The function to be invoked with each matching element. - - A list of all the results of the function calls. - - - - - Selects all elements that are hovered. - - - - - Convenience overload, shorthand for Build().Last(). - - - The last element matching all the criteria, or null if none was found. - - - - - Selects element with this name. - - - - - - Selects all elements that are not active. - - - - - Selects all elements that npot checked. - - - - - Selects all elements that are not enabled. - - - - - Selects all elements that don't currently own the focus. - - - - - Selects all elements that are not hovered. - - - - - Selects all elements that are not selected. - - - - - Selects all elements that are not visible. - - - - - Selects all elements of the specified Type (eg: Label, Button, ScrollView, etc). - - If specified, will select elements with this name. - If specified, will select elements with the given class (not to be confused with Type). - If specified, will select elements with the given class (not to be confused with Type). - - QueryBuilder configured with the associated selection rules. - - - - - Selects all elements of the specified Type (eg: Label, Button, ScrollView, etc). - - If specified, will select elements with this name. - If specified, will select elements with the given class (not to be confused with Type). - If specified, will select elements with the given class (not to be confused with Type). - - QueryBuilder configured with the associated selection rules. - - - - - Compare two QueryBuilder objects and return true if they are equal. - - The first object. - The second object. - - - - Compare two QueryBuilder objects and return true if they are not equal. - - The first object. - The second object. - - - - Selects all elements that are selected. - - - - - Convenience method. shorthand for Build().ToList. - - - A list containing elements satisfying selection rules. - - - - - Convenience method. Shorthand gor Build().ToList(). - - Adds all elements satisfying selection rules to the list. - - - - Selects all elements that are visible. - - - - - Selects all elements satifying the predicate. - - Predicate that must return true for selected elements. - - QueryBuilder configured with the associated selection rules. - - - - - UQuery is a set of extension methods allowing you to select individual or collection of visualElements inside a complex hierarchy. - - - - - Convenience overload, shorthand for Query<T>.Build().First(). - - Root VisualElement on which the selector will be applied. - If specified, will select elements with this name. - If specified, will select elements with the given class (not to be confused with Type). - If specified, will select elements with the given class (not to be confused with Type). - - The first element matching all the criteria, or null if none was found. - - - - - Convenience overload, shorthand for Query<T>.Build().First(). - - Root VisualElement on which the selector will be applied. - If specified, will select elements with this name. - If specified, will select elements with the given class (not to be confused with Type). - If specified, will select elements with the given class (not to be confused with Type). - - The first element matching all the criteria, or null if none was found. - - - - - Initializes a QueryBuilder with the specified selection rules. - - Root VisualElement on which the selector will be applied. - If specified, will select elements with this name. - If specified, will select elements with the given class (not to be confused with Type). - If specified, will select elements with the given class (not to be confused with Type). - - QueryBuilder configured with the associated selection rules. - - - - - Initializes a QueryBuilder with the specified selection rules. - - Root VisualElement on which the selector will be applied. - If specified, will select elements with this name. - If specified, will select elements with the given class (not to be confused with Type). - If specified, will select elements with the given class (not to be confused with Type). - - QueryBuilder configured with the associated selection rules. - - - - - Initializes a QueryBuilder with the specified selection rules. Template parameter specifies the type of elements the selector applies to (ie: Label, Button, etc). - - Root VisualElement on which the selector will be applied. - If specified, will select elements with this name. - If specified, will select elements with the given class (not to be confused with Type). - If specified, will select elements with the given class (not to be confused with Type). - - QueryBuilder configured with the associated selection rules. - - - - - Initializes a QueryBuilder with the specified selection rules. Template parameter specifies the type of elements the selector applies to (ie: Label, Button, etc). - - Root VisualElement on which the selector will be applied. - If specified, will select elements with this name. - If specified, will select elements with the given class (not to be confused with Type). - If specified, will select elements with the given class (not to be confused with Type). - - QueryBuilder configured with the associated selection rules. - - - - - Initializes an empty QueryBuilder on a specified root element. - - Root VisualElement on which the selector will be applied. - - An empty QueryBuilder on a specified root element. - - - - - Query object containing all the selection rules. Can be saved and rerun later without re-allocating memory. - - - - - Selects the n th element matching all the criteria, or null if not enough elements were found. - - The index of the matched element. - - The match element at the specified index. - - - - - The first element matching all the criteria, or null if none was found. - - - The first element matching all the criteria, or null if none was found. - - - - - Invokes function on all elements matching the query. - - The action to be invoked with each matching element. - - - - Invokes function on all elements matching the query. - - Each return value will be added to this list. - The function to be invoked with each matching element. - - - - Invokes function on all elements matching the query. Overloaded for convenience. - - The function to be invoked with each matching element. - - A list of all the results of the function calls. - - - - - The last element matching all the criteria, or null if none was found. - - - The last element matching all the criteria, or null if none was found. - - - - - Compare two QueryState objects and return true if they are equal. - - The first object. - The second object. - - - - Compare two QueryState objects and return true if they are not equal. - - The first object. - The second object. - - - - Creates a new QueryState with the same selection rules, applied on another VisualElement. - - The element on which to apply the selection rules. - - A new QueryState with the same selection rules, applied on this element. - - - - - Returns a list containing elements satisfying selection rules. - - - A list containing elements satisfying selection rules. - - - - - Adds all elements satisfying selection rules to the list. - - Adds all elements satisfying selection rules to the list. - - - - Offers a set of values that describe the intended usage patterns of a specific VisualElement. - - - - - Marks a VisualElement that changes its transformation often (i.e. position, rotation or scale). -When specified, this flag hints the system to optimize rendering of the VisualElement for recurring transformation changes. The VisualElement's vertex transformation will be done by the GPU when possible on the target platform. -Please note that the number of VisualElements to which this hint effectively applies can be limited by target platform capabilities. For such platforms, it is recommended to prioritize use of this hint to only the VisualElements with the highest frequency of transformation changes. - - - - - Marks a VisualElement that hosts many children with DynamicTransform applied on them. -A common use-case of this hint is a VisualElement that represents a "viewport" within which there are many DynamicTransform VisualElements that can move individually in addition to the "viewport" element also often changing its transformation. However, if the contents of the aforementioned "viewport" element are mostly static (not moving) then it is enough to use the DynamicTransform hint on that element instead of GroupTransform. -Internally, an element hinted with GroupTransform will force a separate draw batch with its world transformation value, but in the same time it will avoid changing the transforms of all its descendants whenever a transformation change occurs on the GroupTransform element. - - - - - No particular hints applicable. - - - - - Base class for describing an XML attribute. - - - - - The default value for the attribute, as a string. - - - - - The attribute name. - - - - - A list of obsolete names for this attribute. - - - - - Restrictions on the possible values of the attribute. - - - - - Attribute type. - - - - - Attribute namespace. - - - - - Whether the attribute is optional, required or prohibited. - - - - - Get the attribute value from the attribute bag. - - A bag containg attributes and their values as strings. - The context in which the values are retrieved. - A function to convert a string value to type T. - The value to return if the attribute is not found in the bag. - - The attribute value from the bag, or defaultValue if the attribute is not found. - - - - - Tries to get the attribute value from the attribute bag. - - A bag containg attributes and their values as strings. - The context in which the values are retrieved. - A function to convert a string value to type T. - The value to return if the attribute is not found in the bag. - If the attribute could be retrieved, the retrieved value converted by the conversion function or the default value if the retrieved value could not de converted. - - True if the value could be retrieved, false otherwise. - - - - - An enum to describe attribute use. - - - - - There is no restriction on the use of this attribute with the element. - - - - - The attribute is optional for the element. - - - - - The attribute should not appear for the element. - - - - - The attribute must appear in the element tag. - - - - - Factory for the root AttributeOverrides element. - - - - - Constructor. - - - - - Defines UxmlTraits for the <AttributeOverrides> tag. - - - - - Returns an empty enumerable because <AttributeOverrides> cannot have children. - - - - - Constructor. - - - - - Describes a XML bool attribute. - - - - - The default value for the attribute, as a string. - - - - - Constructor. - - - - - Retrieves the value of this attribute from the attribute bag. Returns it if it is found, otherwise return defaultValue. - - The bag of attributes. - The context in which the values are retrieved. - - The value of the attribute. - - - - - Tries to retrieve the value of this attribute from the attribute bag. Returns true if it is found, otherwise returns false. - - The bag of attributes. - The context in which the values are retrieved. - The value of the attribute. - - True if the value could be retrieved, false otherwise. - - - - - Describe an allowed child element for an element. - - - - - The name of the allowed child element. - - - - - The namespace name of the allowed child element. - - - - - Constructor. - - - - - - Describes a XML attribute representing a Color as a string. - - - - - The default value for the attribute, as a string. - - - - - Constructor. - - - - - Retrieves the value of this attribute from the attribute bag. Returns it if it is found, otherwise return defaultValue. - - The bag of attributes. - The context in which the values are retrieved. - - The value of the attribute. - - - - - Tries to retrieve the value of this attribute from the attribute bag. Returns true if it is found, otherwise returns false. - - The bag of attributes. - The context in which the values are retrieved. - The value of the attribute. - - True if the value could be retrieved, false otherwise. - - - - - Describes a XML double attribute. - - - - - The default value for the attribute, as a string. - - - - - Constructor. - - - - - Retrieves the value of this attribute from the attribute bag. Returns it if it is found, otherwise return defaultValue. - - The bag of attributes. - The context in which the values are retrieved. - - The value of the attribute. - - - - - Tries to retrieve the value of this attribute from the attribute bag. Returns true if it is found, otherwise returns false. - - The bag of attributes. - The context in which the values are retrieved. - The value of the attribute. - - True if the value could be retrieved, false otherwise. - - - - - Describes a XML attribute representing an enum as a string. - - - - - The default value for the attribute, as a string. - - - - - Constructor. - - - - - Retrieves the value of this attribute from the attribute bag. Returns it if it is found, otherwise return defaultValue. - - The bag of attributes. - The context in which the values are retrieved. - - The value of the attribute. - - - - - Tries to retrieve the value of this attribute from the attribute bag. Returns true if it is found, otherwise returns false. - - The bag of attributes. - The context in which the values are retrieved. - The value of the attribute. - - True if the value could be retrieved, false otherwise. - - - - - Restricts the value of an attribute to be taken from a list of values. - - - - - The list of values the attribute can take. - - - - - Constructor. - - - - - Indicates whether the current UxmlEnumeration object is equal to another object of the same type. - - The object to compare with. - - True if the otheer object is equal to this one. - - - - - Indicates whether the current UxmlEnumeration object is equal to another object of the same type. - - The object to compare with. - - True if the otheer object is equal to this one. - - - - - UxmlFactory specialization for classes that derive from VisualElement and that shares its traits, VisualElementTraits. - - - - - Constructor. - - - - - Generic base class for UXML factories, which instantiate a VisualElement using the data read from a UXML file. - - - - - Returns UxmlTraits.canHaveAnyAttribute (where UxmlTraits is the argument for T1). - - - - - Returns an empty string if T0 is not VisualElement; otherwise, returns "VisualElement". - - - - - Returns the namespace for substituteForTypeName. - - - - - Returns the fully qualified name for substituteForTypeName. - - - - - Returns an empty enumerable. - - - - - Returns an empty enumerable. - - - - - Returns the type name of T0. - - - - - Returns the namespace name of T0. - - - - - Returns the typefully qualified name of T0. - - - - - Returns true. - - The attribute bag. - - Always true. - - - - - Instantiate an object of type T0 and initialize it by calling T1 UxmlTraits.Init method. - - A bag of name-value pairs, one for each attribute of the UXML element. This can be used to initialize the properties of the created object. - When the element is created as part of a template instance inserted in another document, this contains information about the insertion point. - - The created element. - - - - - Describes a XML float attribute. - - - - - The default value for the attribute, as a string. - - - - - Constructor. - - - - - Retrieves the value of this attribute from the attribute bag. Returns it if it is found, otherwise return defaultValue. - - The bag of attributes. - The context in which the values are retrieved. - - The value of the attribute. - - - - - Tries to retrieve the value of this attribute from the attribute bag. Returns true if it is found, otherwise returns false. - - The bag of attributes. - The context in which the values are retrieved. - The value of the attribute. - - True if the value could be retrieved, false otherwise. - - - - - Describes a XML int attribute. - - - - - The default value for the attribute, as a string. - - - - - Constructor. - - - - - Retrieves the value of this attribute from the attribute bag. Returns it if it is found, otherwise return defaultValue. - - The bag of attributes. - The context in which the values are retrieved. - - The value of the attribute. - - - - - Tries to retrieve the value of this attribute from the attribute bag. Returns true if it is found, otherwise returns false. - - The bag of attributes. - The context in which the values are retrieved. - The value of the attribute. - - True if the value could be retrieved, false otherwise. - - - - - Describes a XML long attribute. - - - - - The default value for the attribute, as a string. - - - - - Constructor. - - - - - Retrieves the value of this attribute from the attribute bag. Returns it if it is found, otherwise return defaultValue. - - The bag of attributes. - The context in which the values are retrieved. - - The value of the attribute. - - - - - Tries to retrieve the value of this attribute from the attribute bag. Returns true if it is found, otherwise returns false. - - The bag of attributes. - The context in which the values are retrieved. - The value of the attribute. - - True if the value could be retrieved, false otherwise. - - - - - Factory for the root UXML element. - - - - - Returns the empty string, as the root element can not appear anywhere else bit at the root of the document. - - - - - Returns the empty string, as the root element can not appear anywhere else bit at the root of the document. - - - - - Returns the empty string, as the root element can not appear anywhere else bit at the root of the document. - - - - - Returns "UXML". - - - - - Returns the qualified name for this element. - - - - - Returns null. - - - - - - - Constructor. - - - - - Defines UxmlTraits for the UXML root element. - - - - - Returns an enumerable containing UxmlChildElementDescription(typeof(VisualElement)), since the root element can contain VisualElements. - - - - - Constructor. - - - - - Describes a XML string attribute. - - - - - The default value for the attribute, as a string. - - - - - Constructor. - - - - - Retrieves the value of this attribute from the attribute bag. Returns it if it is found, otherwise return defaultValue. - - The bag of attributes. - The context in which the values are retrieved. - - The value of the attribute. - - - - - Tries to retrieve the value of this attribute from the attribute bag. Returns true if it is found, otherwise returns false. - - The bag of attributes. - The context in which the values are retrieved. - The value of the attribute. - - True if the value could be retrieved, false otherwise. - - - - - Factory for the root Style element. - - - - - Constructor. - - - - - Defines UxmlTraits for the <Style> tag. - - - - - Returns an empty enumerable because <Style> cannot have children. - - - - - Constructor. - - - - - Factory for the root Template element. - - - - - Constructor. - - - - - Defines UxmlTraits for the <Template> tag. - - - - - Returns an empty enumerable because <Template> cannot have children. - - - - - Constructor. - - - - - Describes a VisualElement derived class for the parsing of UXML files and the generation of UXML schema definition. - - - - - Must return true if the UXML element attributes are not restricted to the values enumerated by uxmlAttributesDescription. - - - - - Describes the UXML attributes expected by the element. The attributes enumerated here will appear in the UXML schema. - - - - - Describes the types of element that can appear as children of this element in a UXML file. - - - - - Initialize a VisualElement instance with values from the UXML element attributes. - - The VisualElement to initialize. - A bag of name-value pairs, one for each attribute of the UXML element. - When the element is created as part of a template instance inserted in another document, this contains information about the insertion point. - - - - Describes an XML System.Type attribute. - - - - - The default value for the attribute, as a string. - - - - - Constructor. - - - - - Method that retrieves an attribute's value from an attribute bag. Returns it if it is found, otherwise return defaultValue. - - The attribute bag. - The context in which the method retrieves attribute values. - - The attribute's value. If the method cannot find the value, returns defaultValue. - - - - - Method that tries to retrieve an attribute's value from an attribute bag.. Returns true if it is found, otherwise returns false. - - The attribute bag. - The context in which the method retrieves attribute values. - The attribute's value. - - True if the method can retrieve the attribute's value. False otherwise. - - - - - Base class to restricts the value of an attribute. - - - - - Indicates whether the current UxmlTypeRestriction object is equal to another object of the same type. - - The object to compare with. - - True if the otheer object is equal to this one. - - - - - Restricts the value of an attribute to be within the specified bounds. - - - - - True if the bounds exclude max. - - - - - True if the bounds exclude min. - - - - - The maximum value for the attribute. - - - - - The minimum value for the attribute. - - - - - Constructor. - - - - - Indicates whether the current UxmlValueBounds object is equal to another object of the same type. - - The object to compare with. - - True if the otheer object is equal to this one. - - - - - Restricts the value of an attribute to match a regular expression. - - - - - The regular expression that should be matched by the value. - - - - - Constructor. - - - - - Indicates whether the current UxmlValueMatches object is equal to another object of the same type. - - The object to compare with. - - True if the otheer object is equal to this one. - - - - - The event sent to probe which elements accepts a command. - - - - - Constructor. - - - - - An asset that represents a vector image. - - - - - Creates an empty VectorImage. - - - - - Represents a vertex of geometry for drawing content of VisualElement. - - - - - A special value representing the near clipping plane. Always use this value as the vertex position's z component when building 2D (flat) UI geometry. - - - - - Describes the vertex's position. - - - - - A color value for the vertex. - - - - - The UV coordinate of the vertex. - - - - - Specifies whether or not a VisualElement is visible. - - - - - The VisualElement is hidden. Hidden VisualElements will take up space in their parent layout if their positionType is set to PositionType.Relative. Use the display property to both hide and remove a VisualElement from the parent VisualElement layout. - - - - - The VisualElement is visible. Default Value. - - - - - Base class for objects that are part of the UIElements visual tree. - - - - - Number of child elements in this object's contentContainer - - - - - - child elements are added to this element, usually this - - - - - - Returns the custom style properties accessor for this element. - - - - - USS class name of local disabled elements. - - - - - Returns true if the VisualElement is enabled in its own hierarchy. - - - - - Returns true if the VisualElement is enabled locally. - - - - - Returns the UIElements experimental interfaces. - - - - - Called when the VisualElement visual contents need to be (re)generated. - - - - - Access to this element physical hierarchy - - - - - - Determines if this element can be pick during mouseEvents or IPanel.Pick queries. - - - - - Returns the VisualElement resolved style values. - - - - - Retrieves this VisualElement's IVisualElementScheduler - - - - - Reference to the style object of this element. - - - - - Returns a VisualElementStyleSheetSet that manipulates style sheets attached to this element. - - - - - Text to display inside an information box after the user hovers the element for a small amount of time. - - - - - A combination of hint values that specify high-level intended usage patterns for the VisualElement. -This property can only be set when the VisualElement is not yet part of a Panel. Once part of a Panel, this property becomes effectively read-only, and attempts to change it will throw an exception. -The specification of proper UsageHints drives the system to make better decisions on how to process or accelerate certain operations based on the anticipated usage pattern. -Note that those hints do not affect behavioral or visual results, but only affect the overall performance of the panel and the elements within. -Generally it advised to always consider specifying the proper UsageHints, but keep in mind that some UsageHints may be internally ignored under certain conditions (e.g. due to hardware limitations on the target platform). - - - - - This property can be used to associate application-specific user data with this VisualElement. - - - - - Used for view data persistence (ie. tree expanded states, scroll position, zoom level). - - - - - Add an element to this element's contentContainer - - - - - - Brings this element to the end of its parent children list. The element will be visually in front of any overlapping sibling elements. - - - - - Returns the elements from its contentContainer - - - - - Remove all child elements from this element's contentContainer - - - - - Returns true if the element is a direct child of this VisualElement - - - - - - Retrieves the child element at position - - - - - - Enables or disables the class with the given name. - - The name of the class to enable or disable. - A boolean flag that adds or removes the class name from the class list. If true, EnableInClassList adds the class name to the class list. If false, EnableInClassList removes the class name from the class list. - - - - Searchs up the hierachy of this VisualElement and retrieves stored userData, if any is found. - - - - - Finds the lowest commont ancestor between two VisualElements inside the VisualTree hierarchy - - - - - - Retrieve the classes for this element. - - - A class list. - - - - - Walks up the hierarchy, starting from this element's parent, and returns the first VisualElement of this type - - - - - Walks up the hierarchy, starting from this element, and returns the first VisualElement of this type - - - - - Hierarchy is a struct allowing access to the hierarchy of visual elements - - - - - Number of child elements in this object's contentContainer - - - - - - Access the physical parent of this element in the hierarchy - - - - - - Add an element to this element's contentContainer - - - - - - Returns the elements from its contentContainer - - - - - Remove all child elements from this element's contentContainer - - - - - Retrieves the child element at position - - - - - - Retrieves the index of the specified VisualElement in the Hierarchy. - - The element to return the index for. - - The index of the element, or -1 if the element is not found. - - - - - Insert an element into this element's contentContainer - - - - - Compare two Hierarchy objects and return true if they are equal. - - The first object. - The second object. - - - - Compare two Hierarchy objects and return true if they are not equal. - - The first object. - The second object. - - - - Removes this child from the hierarchy - - - - - - Remove the child element located at this position from this element's contentContainer - - - - - - Reorders child elements from this VisualElement contentContainer. - - Sorting criteria. - - - - Access to this element physical hierarchy - - - - - - Retrieves the child index of the specified VisualElement. - - The child to return the index for. - - The index of the child, or -1 if the child is not found. - - - - - Insert an element into this element's contentContainer - - - - - Triggers a repaint of the VisualElement on the next frame. - - - - - The modes available to measure VisualElement sizes. - - - - - At Most. The element should give its preferred width/height but no more than the value passed. - - - - - The element should give the width/height that is passed in and derive the opposite site from this value (for example, calculate text size from a fixed width). - - - - - The element should give its preferred width/height without any constraint. - - - - - Places this element right before the sibling element in their parent children list. If the element and the sibling position overlap, the element will be visually behind of its sibling. - - The sibling element. - - - - Places this element right after the sibling element in their parent children list. If the element and the sibling position overlap, the element will be visually in front of its sibling. - - The sibling element. - - - - Removes this child from the hierarchy - - - - - - Remove the child element located at this position from this element's contentContainer - - - - - - Removes this element from its parent hierarchy - - - - - Sends an event to the event handler. - - The event to send. - - - - Sends this element to the beginning of its parent children list. The element will be visually behind any overlapping sibling elements. - - - - - Changes the VisualElement enabled state. A disabled VisualElement does not receive most events. - - New enabled state - - - - Reorders child elements from this VisualElement contentContainer. - - Sorting criteria. - - - - Access to this element physical hierarchy - - - - - - Toggles between adding and removing the given class name from the class list. - - The class name to add or remove from the class list. - - - - Instantiates a VisualElement using the data read from a UXML file. - - - - - Constructor. - - - - - Defines UxmlTraits for the VisualElement. - - - - - The focusable attribute. - - - - - The focus index attribute. - - - - - Returns an enumerable containing UxmlChildElementDescription(typeof(VisualElement)), since VisualElements can contain other VisualElements. - - - - - Constructor. - - - - - Initialize VisualElement properties using values from the attribute bag. - - The object to initialize. - The attribute bag. - The creation context; unused. - - - - VisualElementExtensions is a set of extension methods useful for VisualElement. - - - - - Add a manipulator associated to a VisualElement. - - VisualElement associated to the manipulator. - Manipulator to be added to the VisualElement. - - - - Remove a manipulator associated to a VisualElement. - - VisualElement associated to the manipulator. - Manipulator to be removed from the VisualElement. - - - - The given VisualElement's left and right edges will be aligned with the corresponding edges of the parent element. - - - - - - Define focus change directions for the VisualElementFocusRing. - - - - - Last value for the direction defined by this class. - - - - - The focus is moving to the left. - - - - - The focus is moving to the right. - - - - - Implementation of a linear focus ring. Elements are sorted according to their focusIndex. - - - - - The focus order for elements having 0 has a focusIndex. - - - - - Constructor. - - The root of the element tree for which we want to build a focus ring. - Default ordering of the elements in the ring. - - - - Ordering of elements in the focus ring. - - - - - Order elements using a depth-first pre-order traversal of the element tree. - - - - - Order elements according to their position, first by X, then by Y. - - - - - Order elements according to their position, first by Y, then by X. - - - - - Get the direction of the focus change for the given event. For example, when the Tab key is pressed, focus should be given to the element to the right in the focus ring. - - - - - - - Get the next element in the given direction. - - - - - - - This structure manipulates the set of StyleSheet objects attached to the owner VisualElement. - - - - - Number of style sheets attached to the owner element. - - - - - - Adds a style sheet for the owner element. - - - - - - Removes all style sheets for the owner element. - - - - - Looks for the specified StyleSheet - - - - True if the style sheet is attached to the owner element, false otherwise. - - - - - Removes a style sheet for the owner element. - - - - - Accesses a StyleSheet at the specified index. - - - - - - An instance of this class holds a tree of `VisualElementAsset`s, created from a UXML file. Each node in the file corresponds to a `VisualElementAsset`. You can clone a `VisualTreeAsset` to yield a tree of `VisualElement`s. - - - - - A hash value computed from the template content. - - - - - The stylesheets used by this VisualTreeAsset. - - - - - The UXML templates used by this VisualTreeAsset. - - - - - Build a tree of VisualElements from the asset. - - The path to the property that you want to bind to the root of the cloned tree. - - The root of the tree of VisualElements that was just cloned. - - - - - Build a tree of VisualElements from the asset. - - The path to the property that you want to bind to the root of the cloned tree. - - The root of the tree of VisualElements that was just cloned. - - - - - Builds a tree of VisualElements from the asset. - - A VisualElement that will act as the root of the cloned tree. - - - - Constructor. - - - - - Build a tree of VisualElements from the asset. - - The path to the property that you want to bind to the root of the cloned tree. - - The root of the tree of VisualElements that was just cloned. - - - - - Build a tree of VisualElements from the asset. - - The path to the property that you want to bind to the root of the cloned tree. - - The root of the tree of VisualElements that was just cloned. - - - - - Mouse wheel event. - - - - - The amount of scrolling applied with the mouse wheel. - - - - - Constructor. Use GetPooled() to get an event from a pool of reusable events. - - - - - Gets an event from the event pool and initializes it with the given values. Use this function instead of creating new events. Events obtained using this method need to be released back to the pool. You can use `Dispose()` to release them. - - A wheel IMGUI event. - - An initialized event. - - - - - Resets the event members to their initial values. - - - - - Word wrapping over multiple lines if not enough space is available to draw the text of an element. - - - - - Text will wrap when necessary. - - - - - Text will never wrap to the next line. - - - - - By default, items will all try to fit onto one line. You can change that and allow the items to wrap as needed with this property. - - - - - All items will be on one line. Default Value. - - - - - Items will wrap onto multiple lines, from top to bottom. - - - - - Items will wrap onto multiple lines from bottom to top. - - - - - Information about a generated line of text. - - - - - Height of the line. - - - - - Space in pixels between this line and the next line. - - - - - Index of the first character in the line. - - - - - The upper Y position of the line in pixels. This is used for text annotation such as the caret and selection box in the InputField. - - - - - Vertex class used by a Canvas for managing vertices. - - - - - Vertex color. - - - - - Normal. - - - - - Vertex position. - - - - - Simple UIVertex with sensible settings for use in the UI system. - - - - - Tangent. - - - - - The first texture coordinate set of the mesh. Used by UI elements by default. - - - - - The second texture coordinate set of the mesh, if present. - - - - - The Third texture coordinate set of the mesh, if present. - - - - - The forth texture coordinate set of the mesh, if present. - - - - - The BurstDiscard attribute lets you remove a method or property from being compiled to native code by the burst compiler. - - - - - The BurstDiscard attribute lets you remove a method or property from being compiled to native code by the burst compiler. - - - - - Used to specify allocation type for NativeArray. - - - - - Allocation associated with a DSPGraph audio kernel. - - - - - Invalid allocation. - - - - - No allocation. - - - - - Persistent allocation. - - - - - Temporary allocation. - - - - - Temporary job allocation. - - - - - DeallocateOnJobCompletionAttribute. - - - - - Enumeration of AtomicSafetyHandle errors. - - - - - Corresponds to an error triggered when the object protected by this AtomicSafetyHandle is accessed on the main thread after it is deallocated. - - - - - Corresponds to an error triggered when the object protected by this AtomicSafetyHandle is accessed by a worker thread after it is deallocated. - - - - - Corresponds to an error triggered when the object protected by this AtomicSafetyHandle is accessed by a worker thread before it is allocated. - - - - - AtomicSafetyHandle is used by the job system to provide validation and full safety. - - - - - Checks if the handle can be deallocated. Throws an exception if it has already been destroyed or a job is currently accessing the data. - - Safety handle. - - - - Checks if the handle is still valid and throws an exception if it is already destroyed. - - Safety handle. - - - - CheckGetSecondaryDataPointerAndThrow. - - Safety handle. - - - - Checks if the handle can be read from. Throws an exception if already destroyed or a job is currently writing to the data. - - Safety handle. - - - - Performs CheckWriteAndThrow and then bumps the secondary version. - - Safety handle. - - - - Checks if the handle can be written to. Throws an exception if already destroyed or a job is currently reading or writing to the data. - - Safety handle. - - - - Creates a new AtomicSafetyHandle that is valid until AtomicSafetyHandle.Release is called. - - - Safety handle. - - - - - Waits for all jobs running against this AtomicSafetyHandle to complete. - - Safety handle. - - Result. - - - - - Waits for all jobs running against this AtomicSafetyHandle to complete and then disables the read and write access on this atomic safety handle. - - Safety handle. - - Result. - - - - - Waits for all jobs running against this AtomicSafetyHandle to complete and then releases the atomic safety handle. - - Safety handle. - - Result. - - - - - Returns true if the AtomicSafetyHandle is configured to allow reading or writing. - - Safety handle. - - True if the AtomicSafetyHandle is configured to allow reading or writing, false otherwise. - - - - - Fetch the job handles of all jobs reading from the safety handle. - - The atomic safety handle to return readers for. - The maximum number of handles to be written to the output array. - A buffer where the job handles will be written. - - The actual number of readers on the handle, which can be greater than the maximum count provided. - - - - - Return the name of the specified reading job. - - Safety handle. - Index of the reader. - - The debug name of the reader. - - - - - Returns the safety handle which should be used for all temp memory allocations in this temp memory scope. All temp memory allocations share the same safety handle since they are automatically disposed of at the same time. - - - The safety handle for temp memory allocations in the current scope. - - - - - Returns a single shared handle, that can be shared by for example NativeSlice pointing to stack memory. - - - Safety handle. - - - - - Return the writer (if any) on an atomic safety handle. - - Safety handle. - - The job handle of the writer. - - - - - Return the debug name of the current writer on an atomic safety handle. - - Safety handle. - - Name of the writer, if any. - - - - - Checks if an AtomicSafetyHandle is the temp memory safety handle for the currently active temp memory scope. - - Safety handle. - - True if the safety handle is the temp memory handle for the current scope. - - - - - Allocates a new static safety ID, to store information for the provided type T. - - The name of the scripting type that owns this AtomicSafetyHandle, to be embedded in error messages involving the handle. This is expected to be a UTF8-encoded byte array, and is not required to be null-terminated. - The number of bytes in the ownerTypeNameBytes array, excluding the optional null terminator. - - - - Allocates a new static safety ID, to store information for the provided type T. - - - - - Marks the AtomicSafetyHandle so that it cannot be disposed of. - - Safety handle. - - - - Releases a previously created AtomicSafetyHandle. - - Safety handle. - - - - Lets you prevent read or write access on the atomic safety handle. - - Safety handle. - Use false to disallow read or write access, or true otherwise. - - - - Switches the AtomicSafetyHandle to the secondary version number. - - Safety handle. - Allow writing. - - - - Lets you bump the secondary version when scheduling a job that has write access to the atomic safety handle. - - Safety handle. - Use true to bump secondary version on schedule. - - - - Provide a custom error message for a specific job debugger error type, in cases where additional context can be provided. - - The static safety ID with which the provided custom error message should be associated. This ID must have been allocated with NewStaticSafetyId. Passing 0 is invalid; this is the default static safety ID, and its error messages can not be modified. - The class of error that should use the provided custom error message instead of the default job debugger error message. - The error message to use for the specified error type. This is expected to be a UTF8-encoded byte array, and is not required to be null-terminated. - The number of bytes in the messageBytes array, excluding the optional null terminator. - - - - Assigns the provided static safety ID to an AtomicSafetyHandle. The ID's owner type name and any custom error messages are used by the job debugger when reporting errors involving the target handle. - - The AtomicSafetyHandle to modify. - The static safety ID to associate with the provided handle. This ID must have been allocated with NewStaticSafetyId. - - - - Switches the AtomicSafetyHandle to the secondary version number. - - Safety handle. - - - - DisposeSentinel is used to automatically detect memory leaks. - - - - - Clears the DisposeSentinel. - - The DisposeSentinel to clear. - - - - Creates a new AtomicSafetyHandle and a new DisposeSentinel, to be used to track safety and leaks on some native data. - - The AtomicSafetyHandle that can be used to control access to the data related to the DisposeSentinel being created. - The new DisposeSentinel. - The stack depth where to extract the logging information from. - - - - Releases the AtomicSafetyHandle and clears the DisposeSentinel. - - The AtomicSafetyHandle returned when invoking Create. - The DisposeSentinel. - - - - EnforceJobResult. - - - - - AllJobsAlreadySynced. - - - - - DidSyncRunningJobs. - - - - - HandleWasAlreadyDeallocated. - - - - - NativeArray Unsafe Utility. - - - - - Converts an existing buffer to a NativeArray. - - Pointer to the preallocated data. - Number of elements. The length of the data in bytes will be computed automatically from this. - Allocation strategy to use. - - A new NativeArray, allocated with the given strategy and wrapping the provided data. - - - - - Returns the AtomicSafetyHandle that is used for safety control on the NativeArray. - - NativeArray. - - Safety handle. - - - - - Gets the pointer to the data owner by the NativeArray, without performing checks. - - NativeArray. - - NativeArray memory buffer pointer. - - - - - Gets the pointer to the memory buffer owner by the NativeArray, performing checks on whether the native array can be written to. - - NativeArray. - - NativeArray memory buffer pointer. - - - - - Gets a pointer to the memory buffer of the NativeArray or NativeArray.ReadOnly. - - NativeArray. - - NativeArray memory buffer pointer. - - - - - Gets a pointer to the memory buffer of the NativeArray or NativeArray.ReadOnly. - - NativeArray. - - NativeArray memory buffer pointer. - - - - - Sets a new AtomicSafetyHandle for the provided NativeArray. - - NativeArray. - Safety handle. - - - - Allows you to create your own custom native container. - - - - - NativeContainerIsAtomicWriteOnlyAttribute. - - - - - NativeContainerIsReadOnlyAttribute. - - - - - NativeContainerSupportsDeallocateOnJobCompletionAttribute. - - - - - NativeContainerSupportsDeferredConvertListToArray. - - - - - NativeContainerSupportsMinMaxWriteRestrictionAttribute. - - - - - By default native containers are tracked by the safety system to avoid race conditions. The safety system encapsulates the best practices and catches many race condition bugs from the start. - - - - - By default unsafe Pointers are not allowed to be used in a job since it is not possible for the Job Debugger to gurantee race condition free behaviour. This attribute lets you explicitly disable the restriction on a job. - - - - - When this attribute is applied to a field in a job struct, the managed reference to the class will be set to null on the copy of the job struct that is passed to the job. - - - - - This attribute can inject a worker thread index into an int on the job struct. This is usually used in the implementation of atomic containers. The index is guaranteed to be unique to any other job that might be running in parallel. - - - - - NativeSlice unsafe utility class. - - - - - ConvertExistingDataToNativeSlice. - - Memory pointer. - Number of elements. - - - - Get safety handle for native slice. - - NativeSlice. - - Safety handle. - - - - - Get NativeSlice memory buffer pointer. Checks whether the native array can be written to. - - NativeSlice. - - Memory pointer. - - - - - Get NativeSlice memory buffer pointer. Checks whether the native array can be read from. - - NativeSlice. - - Memory pointer. - - - - - Set safetly handle on NativeSlice. - - NativeSlice. - Safety handle. - - - - Unsafe utility class. - - - - - The memory address of the struct. - - Struct. - - Memory pointer. - - - - - Minimum alignment of a struct. - - - Memory pointer. - - - - - Gets a reference to the array element at its current location in memory. - - The pointer to beginning of array of struct to reference. - Index of element in array. - - A reference to a value of type T. - - - - - Reinterprets the reference as a reference of a different type. - - The reference to reinterpret. - - A reference to a value of type T. - - - - - Gets a reference to the struct at its current location in memory. - - The pointer of struct to reference. - - A reference to a value of type T. - - - - - Assigns an Object reference to a struct or pinned class. See Also: UnsafeUtility.PinGCObjectAndGetAddress. - - - - - - - Copies sizeof(T) bytes from ptr to output. - - Memory pointer. - Struct. - - - - Copies sizeof(T) bytes from input to ptr. - - Memory pointer. - Struct. - - - - Determines whether the specified enums are equal without boxing. - - The first enum to compare. - The second enum to compare. - - True if equal, otherwise false. - - - - - Return integer representation of enum value without boxing. - - Enum value to convert. - - Returns the integer representation of the enum value. - - - - - Free memory. - - Memory pointer. - Allocator. - - - - Returns the offset of the field relative struct or class it is contained in. - - - - - - Returns whether the struct is blittable. - - The System.Type of a struct. - - True if struct is blittable, otherwise false. - - - - - Returns whether the struct is blittable. - - The System.Type of a struct. - - True if struct is blittable, otherwise false. - - - - - Returns whether the struct or type is unmanaged. An unmanaged type contains no managed fields, and can be freely copied in memory. - - The System.Type of a struct. - - True if struct is unmanaged, otherwise false. - - - - - Returns whether the struct or type is unmanaged. An unmanaged type contains no managed fields, and can be freely copied in memory. - - The System.Type of a struct. - - True if struct is unmanaged, otherwise false. - - - - - Returns true if the allocator label is valid and can be used to allocate or deallocate memory. - - - - - - Returns whether the type is acceptable as an element type in native containers. - - The System.Type to check. - - True if type is acceptable as a native container element. - - - - - Returns whether the type is acceptable as an element type in native containers. - - The System.Type to check. - - True if type is acceptable as a native container element. - - - - - Allocate memory. - - Size. - Alignment. - Allocator. - - Memory pointer. - - - - - Clear memory. - - Memory pointer. - Size. - - - - Checks to see whether two memory regions are identical or not by comparing a specified memory region in the first given memory buffer with the same region in the second given memory buffer. - - Pointer to the first memory buffer. - Pointer to the second memory buffer to compare the first one to. - Number of bytes to compare. - - 0 if the contents are identical, non-zero otherwise. - - - - - Copy memory. - - Destination memory pointer. - Source memory pointer. - Size. - - - - Copy memory and replicate. - - Destination memory pointer. - Source memory pointer. - Size. - Count. - - - - Similar to UnsafeUtility.MemCpy but can skip bytes via desinationStride and sourceStride. - - - - - - - - - - - Move memory. - - Destination memory pointer. - Source memory pointer. - Size. - - - - Set memory to specified value. - - Destination memory pointer. - Value to be set. - Size. - - - - Keeps a strong GC reference to the object and pins it. The object is guranteed to not move its memory location in a moving GC. Returns the address of the first element of the array. - -See Also: UnsafeUtility.ReleaseGCObject. - - - - - Keeps a strong GC reference to the object and pins it. The object is guranteed to not move its memory location in a moving GC. Returns the address of the memory location of the object. - -See Also: UnsafeUtility.ReleaseGCObject. - - - - - - - Read array element. - - Memory pointer. - Array index. - - Array Element. - - - - - Read array element with stride. - - Memory pointer. - Array index. - Stride. - - Array element. - - - - - Releases a GC Object Handle, previously aquired by UnsafeUtility.PinGCObjectAndGetAddress. - - - - - - Size of struct. - - - Size of struct. - - - - - Write array element. - - Memory pointer. - Array index. - Value to write. - - - - Write array element with stride. - - Memory pointer. - Array index. - Stride. - Value to write. - - - - Used in conjunction with the ReadOnlyAttribute, WriteAccessRequiredAttribute lets you specify which struct method and property require write access to be invoked. - - - - - A NativeArray exposes a buffer of native memory to managed code, making it possible to share data between managed and native without marshalling costs. - - - - - Cast NativeArray to read-only array. - - - Read-only array. - - - - - Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index. - - The data to copy. - The array that receives the data. - A 32-bit integer that represents the number of elements to copy. The integer must be equal or greater than zero. - A 32-bit integer that represents the index in the srcArray at which copying begins. - A 32-bit integer that represents the index in the dstArray at which storing begins. - - - - Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index. - - The data to copy. - The array that receives the data. - A 32-bit integer that represents the number of elements to copy. The integer must be equal or greater than zero. - A 32-bit integer that represents the index in the srcArray at which copying begins. - A 32-bit integer that represents the index in the dstArray at which storing begins. - - - - Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index. - - The data to copy. - The array that receives the data. - A 32-bit integer that represents the number of elements to copy. The integer must be equal or greater than zero. - A 32-bit integer that represents the index in the srcArray at which copying begins. - A 32-bit integer that represents the index in the dstArray at which storing begins. - - - - Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index. - - The data to copy. - The array that receives the data. - A 32-bit integer that represents the number of elements to copy. The integer must be equal or greater than zero. - A 32-bit integer that represents the index in the srcArray at which copying begins. - A 32-bit integer that represents the index in the dstArray at which storing begins. - - - - Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index. - - The data to copy. - The array that receives the data. - A 32-bit integer that represents the number of elements to copy. The integer must be equal or greater than zero. - A 32-bit integer that represents the index in the srcArray at which copying begins. - A 32-bit integer that represents the index in the dstArray at which storing begins. - - - - Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index. - - The data to copy. - The array that receives the data. - A 32-bit integer that represents the number of elements to copy. The integer must be equal or greater than zero. - A 32-bit integer that represents the index in the srcArray at which copying begins. - A 32-bit integer that represents the index in the dstArray at which storing begins. - - - - Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index. - - The data to copy. - The array that receives the data. - A 32-bit integer that represents the number of elements to copy. The integer must be equal or greater than zero. - A 32-bit integer that represents the index in the srcArray at which copying begins. - A 32-bit integer that represents the index in the dstArray at which storing begins. - - - - Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index. - - The data to copy. - The array that receives the data. - A 32-bit integer that represents the number of elements to copy. The integer must be equal or greater than zero. - A 32-bit integer that represents the index in the srcArray at which copying begins. - A 32-bit integer that represents the index in the dstArray at which storing begins. - - - - Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index. - - The data to copy. - The array that receives the data. - A 32-bit integer that represents the number of elements to copy. The integer must be equal or greater than zero. - A 32-bit integer that represents the index in the srcArray at which copying begins. - A 32-bit integer that represents the index in the dstArray at which storing begins. - - - - Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index. - - The data to copy. - The array that receives the data. - A 32-bit integer that represents the number of elements to copy. The integer must be equal or greater than zero. - A 32-bit integer that represents the index in the srcArray at which copying begins. - A 32-bit integer that represents the index in the dstArray at which storing begins. - - - - Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index. - - The data to copy. - The array that receives the data. - A 32-bit integer that represents the number of elements to copy. The integer must be equal or greater than zero. - A 32-bit integer that represents the index in the srcArray at which copying begins. - A 32-bit integer that represents the index in the dstArray at which storing begins. - - - - Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index. - - The data to copy. - The array that receives the data. - A 32-bit integer that represents the number of elements to copy. The integer must be equal or greater than zero. - A 32-bit integer that represents the index in the srcArray at which copying begins. - A 32-bit integer that represents the index in the dstArray at which storing begins. - - - - Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index. - - The data to copy. - The array that receives the data. - A 32-bit integer that represents the number of elements to copy. The integer must be equal or greater than zero. - A 32-bit integer that represents the index in the srcArray at which copying begins. - A 32-bit integer that represents the index in the dstArray at which storing begins. - - - - Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index. - - The data to copy. - The array that receives the data. - A 32-bit integer that represents the number of elements to copy. The integer must be equal or greater than zero. - A 32-bit integer that represents the index in the srcArray at which copying begins. - A 32-bit integer that represents the index in the dstArray at which storing begins. - - - - Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index. - - The data to copy. - The array that receives the data. - A 32-bit integer that represents the number of elements to copy. The integer must be equal or greater than zero. - A 32-bit integer that represents the index in the srcArray at which copying begins. - A 32-bit integer that represents the index in the dstArray at which storing begins. - - - - Copy all the elements from another NativeArray or managed array of the same length. - - Source array. - - - - Copy all the elements from another NativeArray or managed array of the same length. - - Source array. - - - - Copy all elements to another NativeArray or managed array of the same length. - - Destination array. - - - - Copy all elements to another NativeArray or managed array of the same length. - - Destination array. - - - - Creates a new NativeArray from an existing array of elements. - - An array to copy the data from. - The allocation strategy used for the data. - - - - Creates a new NativeArray from an existing NativeArray. - - NativeArray to copy the data from. - The allocation strategy used for the data. - - - - Creates a new NativeArray allocating enough memory to fit the provided amount of elements. - - Number of elements to be allocated. - The allocation strategy used for the data. - Options to control the behaviour of the NativeArray. - - - - Disposes the NativeArray. - - - - - Compares to NativeArray. - - NativeArray to compare against. - - True in case the two NativeArray are the same, false otherwise. - - - - - Compares to NativeArray. - - Object to compare against. - - True in case the two NativeArray are the same, false otherwise. - - - - - Get enumerator. - - - Enumerator. - - - - - Returns a hash code for the current instance. - - - Hash code. - - - - - Return a view into the array starting at the specified index. - - The start index of the sub array. - The length of the sub array. - - A view into the array that aliases the original array. Cannot be disposed. - - - - - Indicates that the NativeArray has an allocated memory buffer. - - - - - Number of elements in the NativeArray. - - - - - NativeArray interface constrained to read-only operation. - - - - - Copy all elements to a NativeArray or managed array of the same length. - - The destination array to copy to. - - - - Copy all elements to a NativeArray or managed array of the same length. - - The destination array to copy to. - - - - Number of elements in the NativeArray.ReadOnly. - - - - - Reinterpret the array as having a different data type (type punning). - - - An alias of the same array, but reinterpreted as the target type. - - - - - Read-only access to NativeArray.ReadOnly elements by index. - - - - - Convert the data in this NativeArray.ReadOnly to a managed array. - - - A new managed array with the same contents as this array. - - - - - Reinterpret the array as having a different data type (type punning). - - The expected size (in bytes, as given by sizeof) of the current element type of the array. - - An alias of the same array, but reinterpreted as the target type. - - - - - Reinterpret the array as having a different data type (type punning). - - The expected size (in bytes, as given by sizeof) of the current element type of the array. - - An alias of the same array, but reinterpreted as the target type. - - - - - Reinterpret and load data starting at underlying index as a different type. - - Index in underlying array where the load should start. - - The loaded data. - - - - - Reinterpret and store data starting at underlying index as a different type. - - Index in the underlying array where the data is to be stored. - The data to store. - - - - Access NativeArray elements by index. Notice that structs are returned by value and not by reference. - - - - - Convert NativeArray to array. - - - Array. - - - - - NativeArrayOptions lets you control if memory should be cleared on allocation or left uninitialized. - - - - - Clear NativeArray memory on allocation. - - - - - Uninitialized memory can improve performance, but results in the contents of the array elements being undefined. -In performance sensitive code it can make sense to use NativeArrayOptions.Uninitialized, if you are writing to the entire array right after creating it without reading any of the elements first. - - - - - - NativeDisableParallelForRestrictionAttribute. - - - - - The container has from start a size that will never change. - - - - - The specified number of elements will never change. - - The fixed number of elements in the container. - - - - The fixed number of elements in the container. - - - - - Static class for native leak detection settings. - - - - - Set whether native memory leak detection should be enabled or disabled. - - - - - Native leak memory leak detection mode enum. - - - - - Indicates that native memory leak detection is disabled. - - - - - Indicates that native memory leak detection is enabled. It is lightweight and will not collect any stacktraces. - - - - - Indicates that native memory leak detection is enabled with full stack trace extraction & logging. - - - - - Native Slice. - - - - - Copy all the elements from a NativeSlice or managed array of the same length. - - NativeSlice. - Array. - - - - Copy all the elements from a NativeSlice or managed array of the same length. - - NativeSlice. - Array. - - - - Copy all the elements of the slice to a NativeArray or managed array of the same length. - - Array. - - - - Copy all the elements of the slice to a NativeArray or managed array of the same length. - - Array. - - - - Constructor. - - NativeArray. - Start index. - Memory pointer. - Length. - - - - Constructor. - - NativeArray. - Start index. - Memory pointer. - Length. - - - - Constructor. - - NativeArray. - Start index. - Memory pointer. - Length. - - - - Constructor. - - NativeArray. - Start index. - Memory pointer. - Length. - - - - GetEnumerator. - - - Enumerator. - - - - - Implicit operator for creating a NativeSlice from a NativeArray. - - NativeArray. - - - - Number of elements in the slice. - - - - - SliceConvert. - - - NativeSlice. - - - - - SliceWithStride. - - Stride offset. - Field name whos offset should be used as stride. - - NativeSlice. - - - - - SliceWithStride. - - Stride offset. - Field name whos offset should be used as stride. - - NativeSlice. - - - - - SliceWithStride. - - Stride offset. - Field name whos offset should be used as stride. - - NativeSlice. - - - - - Returns stride set for Slice. - - - - - Access NativeSlice elements by index. Notice that structs are returned by value and not by reference. - - - - - Convert NativeSlice to array. - - - Array. - - - - - The ReadOnly attribute lets you mark a member of a struct used in a job as read-only. - - - - - The ReadOnly attribute lets you mark a member of a struct used in a job as read-only. - - - - - The WriteOnly attribute lets you mark a member of a struct used in a job as write-only. - - - - - Subsystem tags for the read request, describing broad asset type or subsystem that triggered the read request. - - - - - The read request originated from an audio subsystem. - - - - - The read request originated in a Unity.Entities scene loading subsystem. - - - - - The read request originated in a Unity.Entities.Serialization binary reader subsystem. - - - - - The read request originated in mesh loading. - - - - - The subsystem where the read request originated is unknown. - - - - - The read request originated in scripts. - - - - - The read request originated in texture loading. - - - - - The read request originated in Virtual Texturing. - - - - - With the AsyncReadManager, you can perform asynchronous I/O operations through Unity's virtual file system. You can perform these operations on any thread or job. - - - - - Issues an asynchronous file read operation. Returns a ReadHandle. - - The filename to read from. - A pointer to an array of ReadCommand structs that specify offset, size, and destination buffer. - The number of read commands pointed to by readCmds. - (Optional) The name of the object being read, for metrics purposes. - (Optional) The of the object being read, for metrics purposes. - (Optional) The AssetLoadingSubsystem|Subsystem tag for the read operation, for metrics purposes. - - Used to monitor the progress and status of the read command. - - - - - Manages the recording and retrieval of metrics from the AsyncReadManager. - - - - - Clears the metrics for all completed requests, including failed and canceled requests. - - - - - Flags controlling the behaviour of AsyncReadManagerMetrics.GetMetrics and AsyncReadManagerMetrics.GetCurrentSummaryMetrics. - - - - - Clear metrics for completed read requests after returning. - - - - - Pass no flags. - - - - - Gets a summary of the metrics collected for AsyncReadManager read operations since you started data collection or last cleared the metrics data. - - Flags to control the behavior, including clearing the underlying completed metrics after reading. - - A summary of the current metrics data. - - - - - Gets a filtered summary of the metrics collected for AsyncReadManager read operations since you started data collection or last cleared the metrics data. - - The filters to apply to the metrics before calculating the summary. - Flags to control the behavior, including clearing the underlying completed metrics after reading. - - A summary of the current metric data, filtered by the specified metricsFilters. - - - - - Returns the current AsyncReadManager metrics. - - Flags to control the behaviour, including clearing the underlying completed metrics after reading. - (Optional) The AsyncReadManagerMetricsFilters|filters to control the data returned. - - Array of AsyncReadManagerRequestMetric|read request metrics currently stored in the AsyncReadManager, which can be filtered by passing AsyncReadManagerMetricsFilters. - - - - - Returns the current AsyncReadManager metrics. - - Flags to control the behaviour, including clearing the underlying completed metrics after reading. - (Optional) The AsyncReadManagerMetricsFilters|filters to control the data returned. - - Array of AsyncReadManagerRequestMetric|read request metrics currently stored in the AsyncReadManager, which can be filtered by passing AsyncReadManagerMetricsFilters. - - - - - Writes the current AsyncReadManager metrics into the given List. - - The pre-allocated list to store the metrics in. - Flags to control the behaviour, including clearing the underlying completed metrics after reading. - (Optional) The AsyncReadManagerMetricsFilters|filters to control the data returned. - - - - Writes the current AsyncReadManager metrics into the given List. - - The pre-allocated list to store the metrics in. - Flags to control the behaviour, including clearing the underlying completed metrics after reading. - (Optional) The AsyncReadManagerMetricsFilters|filters to control the data returned. - - - - Summarizes an array containing AsyncReadManagerRequestMetric records. - - Array of previously collected AsyncReadManagerRequestMetrics. - - Calculated summary of the given metrics. - - - - - Summarizes an array containing AsyncReadManagerRequestMetric records. - - Array of previously collected AsyncReadManagerRequestMetrics. - - Calculated summary of the given metrics. - - - - - Summarizes AsyncReadManagerRequestMetric records that match the specified filter. - - List of previously collected AsyncReadManagerRequestMetrics. - AsyncReadManagerMetricsFilters|Filters to apply to the data used in calculating the summary. - - Calculated summary of given metrics that match the filters. - - - - - Summarizes AsyncReadManagerRequestMetric records that match the specified filter. - - List of previously collected AsyncReadManagerRequestMetrics. - AsyncReadManagerMetricsFilters|Filters to apply to the data used in calculating the summary. - - Calculated summary of given metrics that match the filters. - - - - - Returns the amount of data (in bytes) read through systems other than the AsyncReadManager. - - Set to true to reset the underlying data counter to zero after calling this function. Set to false if you want each call to this function to return the running, cumulative total. - - Number of bytes of data read through systems other than the AsyncReadManager since you started metrics collection or you cleared this data counter by setting emptyAfterRead to true. - - - - - Reports whether the metrics system for the AsyncReadManager is currently recording data. - - - True, if the metrics system of the AsyncReadManager is currently recording data; false, otherwise. - - - - - Begin recording metrics data for AsyncReadManager read operations. - - - - - Stop recording metrics data for AsyncReadManager read operations. - - - - - Defines a filter for selecting specific categories of data when summarizing AsyncReadManager metrics. - - - - - Clears all the filters on an existing AsyncReadManagerMetricsFilters instance. - - - - - Constructor for an instance of the Summary Metrics Filters, used to filter the metrics data that is included in the calculation of a summary. - - The YAML Class ID for the asset type to include in the summary calculations. See the page. - The Processing State to include in the summary calculations. - The type of file read (async or sync) to include in the summary calculations. - The priority level to include in the summary calculations. - The Subsystem 'tag' to include in the summary calculations. - - - - Constructor for an instance of the Summary Metrics Filters, used to filter the metrics data that is included in the calculation of a summary. - - The YAML Class ID for the asset type to include in the summary calculations. See the page. - The Processing State to include in the summary calculations. - The type of file read (async or sync) to include in the summary calculations. - The priority level to include in the summary calculations. - The Subsystem 'tag' to include in the summary calculations. - - - - Constructor for an instance of the Summary Metrics Filters, used to filter the metrics data that is included in the calculation of a summary. - - The YAML Class ID for the asset type to include in the summary calculations. See the page. - The Processing State to include in the summary calculations. - The type of file read (async or sync) to include in the summary calculations. - The priority level to include in the summary calculations. - The Subsystem 'tag' to include in the summary calculations. - - - - Constructor for an instance of the Summary Metrics Filters, used to filter the metrics data that is included in the calculation of a summary. - - The YAML Class ID for the asset type to include in the summary calculations. See the page. - The Processing State to include in the summary calculations. - The type of file read (async or sync) to include in the summary calculations. - The priority level to include in the summary calculations. - The Subsystem 'tag' to include in the summary calculations. - - - - Constructor for an instance of the Summary Metrics Filters, used to filter the metrics data that is included in the calculation of a summary. - - The YAML Class ID for the asset type to include in the summary calculations. See the page. - The Processing State to include in the summary calculations. - The type of file read (async or sync) to include in the summary calculations. - The priority level to include in the summary calculations. - The Subsystem 'tag' to include in the summary calculations. - - - - Constructor for an instance of the Summary Metrics Filters, used to filter the metrics data that is included in the calculation of a summary. - - The YAML Class ID for the asset type to include in the summary calculations. See the page. - The Processing State to include in the summary calculations. - The type of file read (async or sync) to include in the summary calculations. - The priority level to include in the summary calculations. - The Subsystem 'tag' to include in the summary calculations. - - - - Constructor for an instance of the Summary Metrics Filters, used to filter the metrics data that is included in the calculation of a summary. - - An array of all the to include in the summary calculations. - An array of all the ProcessingStates to include in the summary calculations. - An array of all the FileReadTypes to include in the summary calculations. As there are only two options, this is generally unnecesary. - An array of all the Priority levels to include in the summary calculations. As there are only two options, this is generally unnecesary. - An array of all the Subsystem 'tags' to include in the summary calculations. - - - - Constructor for an instance of the Summary Metrics Filters, used to filter the metrics data that is included in the calculation of a summary. - - An array of all the to include in the summary calculations. - An array of all the ProcessingStates to include in the summary calculations. - An array of all the FileReadTypes to include in the summary calculations. As there are only two options, this is generally unnecesary. - An array of all the Priority levels to include in the summary calculations. As there are only two options, this is generally unnecesary. - An array of all the Subsystem 'tags' to include in the summary calculations. - - - - Constructor for an instance of the Summary Metrics Filters, used to filter the metrics data that is included in the calculation of a summary. - - An array of all the to include in the summary calculations. - An array of all the ProcessingStates to include in the summary calculations. - An array of all the FileReadTypes to include in the summary calculations. As there are only two options, this is generally unnecesary. - An array of all the Priority levels to include in the summary calculations. As there are only two options, this is generally unnecesary. - An array of all the Subsystem 'tags' to include in the summary calculations. - - - - Constructor for an instance of the Summary Metrics Filters, used to filter the metrics data that is included in the calculation of a summary. - - An array of all the to include in the summary calculations. - An array of all the ProcessingStates to include in the summary calculations. - An array of all the FileReadTypes to include in the summary calculations. As there are only two options, this is generally unnecesary. - An array of all the Priority levels to include in the summary calculations. As there are only two options, this is generally unnecesary. - An array of all the Subsystem 'tags' to include in the summary calculations. - - - - Constructor for an instance of the Summary Metrics Filters, used to filter the metrics data that is included in the calculation of a summary. - - An array of all the to include in the summary calculations. - An array of all the ProcessingStates to include in the summary calculations. - An array of all the FileReadTypes to include in the summary calculations. As there are only two options, this is generally unnecesary. - An array of all the Priority levels to include in the summary calculations. As there are only two options, this is generally unnecesary. - An array of all the Subsystem 'tags' to include in the summary calculations. - - - - Constructor for an instance of the Summary Metrics Filters, used to filter the metrics data that is included in the calculation of a summary. - - An array of all the to include in the summary calculations. - An array of all the ProcessingStates to include in the summary calculations. - An array of all the FileReadTypes to include in the summary calculations. As there are only two options, this is generally unnecesary. - An array of all the Priority levels to include in the summary calculations. As there are only two options, this is generally unnecesary. - An array of all the Subsystem 'tags' to include in the summary calculations. - - - - Remove the Priority filters from an existing SummaryMetricsFilters instance. - - - - - Remove the ReadType filters from an existing SummaryMetricsFilters instance. - - - - - Remove the State filters from an existing SummaryMetricsFilters instance. - - - - - Remove the Subsystem filters from an existing SummaryMetricsFilters instance. - - - - - Remove the TypeID filters from an existing SummaryMetricsFilters instance. - - - - - Set Priority filters on an existing SummaryMetricsFilters instance. - - Priority level to filter by. Summary will include reads that had this priority level only. - Array of priority levels to filter by. Summary will include reads that have any of these priority levels. - - - - Set Priority filters on an existing SummaryMetricsFilters instance. - - Priority level to filter by. Summary will include reads that had this priority level only. - Array of priority levels to filter by. Summary will include reads that have any of these priority levels. - - - - Set FileReadType filters on an existing SummaryMetricsFilters instance. - - FileReadType to filter by. Summary will include reads that had this read type only. - Array of FileReadType|FileReadTypes to filter by. Summary will include reads that have any of these read types. - - - - Set FileReadType filters on an existing SummaryMetricsFilters instance. - - FileReadType to filter by. Summary will include reads that had this read type only. - Array of FileReadType|FileReadTypes to filter by. Summary will include reads that have any of these read types. - - - - Set ProcessingState filters on an existing SummaryMetricsFilters instance. - - ProcessingState to filter by. Summary will include reads that have this state only. - Array of ProcessingState|ProcessingStates to filter by. Summary will include reads that have any of these states. - - - - Set ProcessingState filters on an existing SummaryMetricsFilters instance. - - ProcessingState to filter by. Summary will include reads that have this state only. - Array of ProcessingState|ProcessingStates to filter by. Summary will include reads that have any of these states. - - - - Set AssetLoadingSubsystem filters on an existing SummaryMetricsFilters instance. - - AssetLoadingSubsystem to filter by. Summary will include reads that have this subsystem tag only. - Array of AssetLoadingSubsystem|AssetLoadingSubsystems to filter by. Summary will include reads that have any of these subsystem tags. - - - - Set AssetLoadingSubsystem filters on an existing SummaryMetricsFilters instance. - - AssetLoadingSubsystem to filter by. Summary will include reads that have this subsystem tag only. - Array of AssetLoadingSubsystem|AssetLoadingSubsystems to filter by. Summary will include reads that have any of these subsystem tags. - - - - Set TypeID filters on an existing SummaryMetricsFilters instance. - - to filter by. Summary will include reads that have this type ID only. - Array of to filter by. Summary will include reads that have any of these Type IDs. - - - - Set TypeID filters on an existing SummaryMetricsFilters instance. - - to filter by. Summary will include reads that have this type ID only. - Array of to filter by. Summary will include reads that have any of these Type IDs. - - - - Metrics for an individual read request. - - - - - The name of the asset being read. - - - - - The of the asset being read in the read request. - - - - - The number of batch read commands contained in the read request. - - - - - Total number of bytes of the read request read so far. - - - - - The filename the read request is reading from. - - - - - Returns whether this read request contained batch read commands. - - - - - The offset of the read request from the start of the file, in bytes. - - - - - The Priority|priority level of the read request. - - - - - The FileReadType|read type (sync or async) of the read request. - - - - - The time at which the read request was made, in microseconds elapsed since application startup. - - - - - The size of the read request, in bytes. - - - - - The ProcessingState|state of the read request at the time of retrieving the metrics. - - - - - The AssetLoadingSubsystem|Subsystem tag assigned to the read operation. - - - - - The amount of time the read request waited in the AsyncReadManager queue, in microseconds. - - - - - The total time in microseconds from the read request being added until its completion, or the time of metrics retrieval, depending whether the read has completed or not. - - - - - A summary of the metrics collected for AsyncReadManager read operations. - - - - - The mean rate of reading of data (bandwidth), in Mbps, for read request metrics included in the summary calculation. - - - - - The mean size of data read, in bytes, for read request metrics included in the summary calculation. - - - - - The mean time taken for reading (excluding queue time), in microseconds, for read request metrics included in the summary calculation. - - - - - The mean rate of request throughput, in Mbps, for read request metrics included in the summary calculation. - - - - - The mean time taken from request to completion, in microseconds, for completed read request metrics included in the summary calculation. - - - - - The mean time taken from request to the start of reading, in microseconds, for read request metrics included in the summary calculation. - - - - - The for the longest read included in the summary calculation. - - - - - The Subsystem tag for the longest read included in the summary calculation. - - - - - The longest read time (not including time in queue) included in the summary calculation in microseconds. - - - - - The for the longest wait time included in the summary calculation. - - - - - The Subsystem tag for the longest wait time included in the summary calculation. - - - - - The longest time spent waiting of metrics included in the summary calculation, in microseconds. - - - - - The total number of Async reads in the metrics included in the summary calculation. - - - - - The total number of cached reads (so read time was zero) in the metrics included in the summary calculation. - - - - - The total number of canceled requests in the metrics included in the summary calculation. - - - - - The total number of completed requests in the metrics included in the summary calculation. - - - - - The total number of failed requests in the metrics included in the summary calculation. - - - - - The total number of in progress requests in the metrics included in the summary calculation. - - - - - The total number of Sync reads in the metrics included in the summary calculation. - - - - - The total number of waiting requests in the metrics included in the summary calculation. - - - - - The total number of bytes read in the metrics included in the summary calculation. - - - - - The total number of read requests included in the summary calculation. - - - - - The type of FileReadType|file read requested from the AsyncReadManager. - - - - - Async Read Request. - - - - - Sync Read Request. - - - - - The priority level attached to the AsyncReadManager read request. - - - - - High priority request. - - - - - Low priority request. - - - - - The state of the read request at the time of retrieval of AsyncReadManagerMetrics. - - - - - The read was canceled before completion. - - - - - The read request had fully completed. - - - - - The read request had failed before completion. - - - - - The read request was waiting in the queue to be read. - - - - - The read request was in the process of being read. - - - - - The read request status was unknown. - - - - - Describes the offset, size, and destination buffer of a single read operation. - - - - - The buffer that receives the read data. - - - - - The offset where the read begins, within the file. - - - - - The size of the read in bytes. - - - - - You can use this handle to query the status of an asynchronous read operation. Note: To avoid a memory leak, you must call Dispose. - - - - - Disposes the ReadHandle. Use this to free up internal resources for reuse. - - - - - Check if the ReadHandle is valid. - - - True if the ReadHandle is valid. - - - - - JobHandle that completes when the read operation completes. - - - - - Current state of the read operation. - - - - - State of the read operation. - - - - - All the ReadCommand operations completed successfully. - - - - - One or more of the ReadCommand operations failed. - - - - - The read operation is in progress. - - - - - Class that provides access to some of the Unity low level virtual file system APIs. - - - - - This method looks up the virtual file entry specified, and returns the details of that file within the file on the local filesystem. - - Virtual file entry to find. - Out parameter containing the file on the local filesystem. - Out parameter containing the offset inside of file on the local filesystem. - Out parameter containing the size inside of file on the local filesystem. - - Details were successfully found. - - - - - Use IJob to schedule a single job that runs in parallel to other jobs and the main thread. - - - - - Implement this method to perform work on a worker thread. - - - - - Extension methods for Jobs using the IJob interface. - - - - - Perform the job's Execute method immediately on the same thread. - - The job and data to Run. - - - - Schedule the job for execution on a worker thread. - - The job and data to schedule. - Dependencies are used to ensure that a job executes on workerthreads after the dependency has completed execution. Making sure that two jobs reading or writing to same data do not run in parallel. - - The handle identifying the scheduled job. Can be used as a dependency for a later job or ensure completion on the main thread. - - - - - For jobs allow you to perform the same independent operation for each element of a native container or for a fixed number of iterations. -This Job type gives you the most flexibility over how you want your job scheduled. - - - - - Implement this method to perform work against a specific iteration index. - - The index of the for loop at which to perform work. - - - - Extension methods for Jobs using the IJobFor. - - - - - Perform the job's Execute method immediately on the main thread. - - The job and data to Run. - The number of iterations the for loop will execute. - - - - Schedule the job for execution on a single worker thread. - - The job and data to Schedule. - The number of iterations the for loop will execute. - Dependencies are used to ensure that a job executes on worker threads after the dependency has completed execution. Making sure that two jobs reading or writing to same data do not run in parallel. - - The handle identifying the scheduled job. Can be used as a dependency for a later job or ensure completion on the main thread. - - - - - Schedule the job for concurrent execution on a number of worker threads. - - The job and data to Schedule. - The number of iterations the for loop will execute. - Granularity in which workstealing is performed. A value of 32, means the job queue will steal 32 iterations and then perform them in an efficient inner loop. - Dependencies are used to ensure that a job executes on worker threads after the dependency has completed execution. Making sure that two jobs reading or writing to same data do not run in parallel. - - The handle identifying the scheduled job. Can be used as a dependency for a later job or ensure completion on the main thread. - - - - - Parallel-for jobs allow you to perform the same independent operation for each element of a native container or for a fixed number of iterations. - - - - - Implement this method to perform work against a specific iteration index. - - The index of the Parallel for loop at which to perform work. - - - - Extension methods for Jobs using the IJobParallelFor. - - - - - Perform the job's Execute method immediately on the same thread. - - The job and data to Run. - The number of iterations the for loop will execute. - - - - Schedule the job for execution on a worker thread. - - The job and data to Schedule. - The number of iterations the for loop will execute. - Granularity in which workstealing is performed. A value of 32, means the job queue will steal 32 iterations and then perform them in an efficient inner loop. - Dependencies are used to ensure that a job executes on workerthreads after the dependency has completed execution. Making sure that two jobs reading or writing to same data do not run in parallel. - - The handle identifying the scheduled job. Can be used as a dependency for a later job or ensure completion on the main thread. - - - - - JobHandle. - - - - - CheckFenceIsDependencyOrDidSyncFence. - - Job handle. - Job handle dependency. - - Return value. - - - - - Combines multiple dependencies into a single one. - - - - - - - - - Combines multiple dependencies into a single one. - - - - - - - - - Combines multiple dependencies into a single one. - - - - - - - - - Combines multiple dependencies into a single one. - - - - - - - - - Ensures that the job has completed. - - - - - Ensures that all jobs have completed. - - - - - - - - - Ensures that all jobs have completed. - - - - - - - - - Ensures that all jobs have completed. - - - - - - - - - Returns false if the task is currently running. Returns true if the task has completed. - - - - - By default jobs are only put on a local queue when using Job Schedule functions, this actually makes them available to the worker threads to execute them. - - - - - Struct used to implement batch query jobs. - - - - - Create BatchQueryJob. - - NativeArray containing the commands to execute during a batch. The job executing the query will only read from the array, not write to it. - NativeArray which can contain the results from the commands. The job executing the query will write to the array. - - - - Struct used to schedule batch query jobs. - - - - - Initializes a BatchQueryJobStruct and returns a pointer to an internal structure (System.IntPtr) which should be passed to JobsUtility.JobScheduleParameters. - - - - - JobHandle Unsafe Utilities. - - - - - Combines multiple dependencies into a single one using an unsafe array of job handles. -See Also: JobHandle.CombineDependencies. - - - - - - - All job interface types must be marked with the JobProducerType. This is used to compile the Execute method by the Burst ASM inspector. - - - - - - - The type containing a static method named "Execute" method which is the method invokes by the job system. - - - - ProducerType is the type containing a static method named "Execute" method which is the method invokes by the job system. - - - - - Struct containing information about a range the job is allowed to work on. - - - - - Total iteration count. - - - - - Static class containing functionality to create, run and debug jobs. - - - - - Size of a cache line. - - - - - Creates job reflection data. - - - - - - - - - Returns pointer to internal JobReflectionData. - - - - - Creates job reflection data. - - - - - - - - - Returns pointer to internal JobReflectionData. - - - - - Returns the begin index and end index of the range. - - - - - - - - - Returns the work stealing range. - - - - - - - Returns true if successful. - - - - - Returns true if we this is called from inside of a C# job. - - - - - When disabled, forces jobs that have already been compiled with burst to run in mono instead. For example if you want to debug the C# jobs or just want to compare behaviour or performance. - - - - - Enables and disables the job debugger at runtime. Note that currently the job debugger is only supported in the Editor. Thus this only has effect in the editor. - - - - - Struct containing job parameters for scheduling. - - - - - Constructor. - - - - - - - - - A JobHandle to any dependency this job would have. - - - - - Pointer to the job data. - - - - - Pointer to the reflection data. - - - - - ScheduleMode option. - - - - - Current number of worker threads available to the Unity JobQueue. - - - - - Maximum number of worker threads available to the Unity JobQueue (Read Only). - - - - - Maximum job thread count. - - - - - Injects debug checks for min and max ranges of native array. - - - - - Reset JobWorkerCount to the Unity adjusted value. - - - - - Schedule a single IJob. - - - - Returns a JobHandle to the newly created Job. - - - - - Schedule a IJobParallelFor job. - - - - - - Returns a JobHandle to the newly created Job. - - - - - Schedule a IJobParallelFor job. - - - - - - - Returns a JobHandle to the newly created Job. - - - - - Schedule an IJobParallelForTransform job. - - - - - Returns a JobHandle to the newly created Job. - - - - - Schedule an IJobParallelForTransform job with read-only access to the transform data. This method provides better parallelization because it can read all transforms in parallel instead of just parallelizing across transforms in different hierarchies. - - - - - - Returns a JobHandle to the newly created Job. - - - - - Determines what the job is used for (ParallelFor or a single job). - - - - - A parallel for job. - - - - - A single job. - - - - - ScheduleMode options for scheduling a manage job. - - - - - Schedule job as batched (ScheduleMode.Batched is the same as ScheduleMode.Parallel; this enumeration value is retained to support legacy code) - - - - - Schedule job to run on multiple worker threads if possible. Jobs that cannot run concurrently will run on one thread only. - - - - - Run job immediately on calling thread. - - - - - Schedule job to run on a single worker thread. - - - - - Profiler marker usage flags. - - - - - Specifies that marker is present only in the Editor. - - - - - Marker represents a counter. - - - - - Default value for markers created in native code. - - - - - Marker is created by scripting code. - - - - - Specifies that marker is generated by deep profiling. - - - - - Specifies that marker is generated by invocation of scripting method from native code. - - - - - Specifies that marker highlights performance suboptimal behavior. - - - - - Options for the Profiler metadata type. - - - - - Signifies that ProfilerMarkerData.Ptr points to a raw byte array. - - - - - Signifies that ProfilerMarkerData.Ptr points to a value of type double. - - - - - Signifies that ProfilerMarkerData.Ptr points to a value of type float. - - - - - Signifies that ProfilerMarkerData.Ptr points to a value of type int. - - - - - Signifies that ProfilerMarkerData.Ptr points to a value of type long. - - - - - Signifies that ProfilerMarkerData.Ptr points to a char*. - - - - - Signifies that ProfilerMarkerData.Ptr points to a value of type uint. - - - - - Signifies that ProfilerMarkerData.Ptr points to a value of type ulong. - - - - - Provides information about Profiler category. - - - - - Profiler category color. - - - - - Profiler category identifier. - - - - - Gets Profiler category name as string. - - - - - Profiler category name pointer. - - - - - Profiler category name length. - - - - - Describes Profiler metadata parameter that can be associated with a sample. - - - - - Raw pointer to the metadata value. - - - - - Size of the metadata value in bytes. - - - - - Metadata type. - - - - - Gets the description of a Profiler metric. - - - - - Gets the ProfilerCategory value of the Profiler metric. - - - - - Gets the data value type of the Profiler metric. - - - - - Profiler marker flags of the metric. - - - - - The name of the Profiler metric. - - - - - The name of the Profiler metric as a pointer to UTF-8 byte array. - - - - - Name length excluding null terminator. - - - - - Gets the data unit type of the Profiler metric. - - - - - Gets the handle of a Profiler metric. - - - - - Gets all available handles which can be accessed with ProfilerRecorder. - - - - - - Gets description of Profiler marker or counter handle. - - - - - - Indicates if a handle is valid and can be used with ProfilerRecorder. - - - - - Utility class which provides access to low level Profiler API. - - - - - Starts profiling a piece of code marked with a custom name that the markerPtr handle has defined. - - Profiler marker handle. - - - - Starts profiling a piece of code marked with a custom name that the markerPtr handle and metadata parameters has defined. - - Profiler marker handle. - Metadata parameters count. - Unsafe pointer to the ProfilerMarkerData array. - - - - AI and NavMesh Profiler category. - - - - - Memory allocation Profiler category. - - - - - Animation Profiler category. - - - - - Audio system Profiler category. - - - - - UI Profiler category. - - - - - Input system Profiler category. - - - - - Internal Unity systems Profiler category. - - - - - Global Illumination Profiler category. - - - - - Loading system Profiler category. - - - - - Networking system Profiler category. - - - - - Uncategorized Profiler category. - - - - - Particle system Profiler category. - - - - - Physics system Profiler category. - - - - - Rendering system Profiler category. - - - - - Generic C# code Profiler category. - - - - - Video system Profiler category. - - - - - Virtual Texturing system Profiler category. - - - - - VR systen Profiler category. - - - - - Create a new Profiler flow identifier. - - - - Returns flow identifier. - - - - - Constructs a new Profiler marker handle for code instrumentation. - - A marker name. - A profiler category identifier. - The marker flags. - The metadata parameters count, or 0 if no parameters are expected. - Marker name string length. - - Returns the marker native handle. - - - - - Constructs a new Profiler marker handle for code instrumentation. - - A marker name. - A profiler category identifier. - The marker flags. - The metadata parameters count, or 0 if no parameters are expected. - Marker name string length. - - Returns the marker native handle. - - - - - End profiling a piece of code marked with a custom name defined by this instance of ProfilerMarker. - - Marker handle. - - - - Add flow event to a Profiler sample. - - Profiler flow identifier. - Flow event type. - - - - Gets the Profiler category identifier. - - Category name. - Category name length. - - Returns Profiler category identifier. - - - - - Retrieves Profiler category information such as name or color. - - Profiler category identifier. - - Returns description of the category. - - - - - Set Profiler marker metadata name and type. - - Profiler marker handle. - Metadata parameter index. - Metadata parameter name. - Metadata type. Must be one of ProfilerMarkerDataType values. - Metadata unit. Must be one of ProfilerMarkerDataUnit values. - Metadata parameter name length. - - - - Set Profiler marker metadata name and type. - - Profiler marker handle. - Metadata parameter index. - Metadata parameter name. - Metadata type. Must be one of ProfilerMarkerDataType values. - Metadata unit. Must be one of ProfilerMarkerDataUnit values. - Metadata parameter name length. - - - - Creates profiling sample with a custom name that the markerPtr handle and metadata parameters has defined. - - Profiler marker handle. - Metadata parameters count. - Unsafe pointer to the ProfilerMarkerData array. - - - - Gets Profiler timestamp. - - - - - Fraction that converts the Profiler timestamp to nanoseconds. - - - - - Denominator of timestamp to nanoseconds conversion fraction. - - - - - Numerator of timestamp to nanoseconds conversion fraction. - - - - - Gets conversion ratio from Profiler timestamp to nanoseconds. - - - - - Use to specify category for instrumentation Profiler markers. - - - - - AI and NavMesh Profiler category. - - - - - Animation Profiler category. - - - - - Audio system Profiler category. - - - - - Gets Profiler category color. - - - - - Use to construct ProfilerCategory by category name. - - Profiler category name. - - - - UI Profiler category. - - - - - Input system Profiler category. - - - - - Internal Unity systems Profiler category. - - - - - Global Illumination Profiler category. - - - - - Loading system Profiler category. - - - - - Memory allocation Profiler category. - - - - - Gets Profiler category name. - - - - - Networking system Profiler category. - - - - - Particle system Profiler category. - - - - - Physics system Profiler category. - - - - - Rendering system Profiler category. - - - - - Generic C# code Profiler category. - - - - - Video system Profiler category. - - - - - Virtual Texturing system Profiler category. - - - - - VR systen Profiler category. - - - - - Options for determining if a Profiler category is built into Unity by default. - - - - - Use this flag to determine that a Profiler category is built into the Unity Editor by default. - - - - - Use this flag to determine that a Profiler category is not built into Unity by default. - - - - - Defines Profiler flow event type. - - - - - Use for the flow start point. - - - - - Use for the flow end point. - - - - - Use for the flow continuation point. - - - - - Use for the parallel flow continuation point. - - - - - Performance marker used for profiling arbitrary code blocks. - - - - - Creates a helper struct for the scoped using blocks. - - - IDisposable struct which calls Begin and End automatically. - - - - - Helper IDisposable struct for use with ProfilerMarker.Auto. - - - - - Begin profiling a piece of code marked with a custom name defined by this instance of ProfilerMarker. - - Object associated with the operation. - - - - Begin profiling a piece of code marked with a custom name defined by this instance of ProfilerMarker. - - Object associated with the operation. - - - - Constructs a new performance marker for code instrumentation. - - Marker name. - Profiler category. - Marker name length. - - - - Constructs a new performance marker for code instrumentation. - - Marker name. - Profiler category. - Marker name length. - - - - Constructs a new performance marker for code instrumentation. - - Marker name. - Profiler category. - Marker name length. - - - - Constructs a new performance marker for code instrumentation. - - Marker name. - Profiler category. - Marker name length. - - - - End profiling a piece of code marked with a custom name defined by this instance of ProfilerMarker. - - - - - Gets native handle of the ProfilerMarker. - - - - - Options for Profiler marker data unit types. - - - - - Display data value as a size, specified in bytes. - - - - - Display data value as a simple number without any unit abbreviations. - - - - - Display data value as a frequency, specified in hertz. - - - - - Display data value as a percentage value with % postfix. - - - - - Display data value as a time, specified in nanoseconds. - - - - - Use to display data value as string if ProfilerMarkerDataTypes.String16 or as a simple number without any unit abbreviations. Also use Undefined in combination with ProfilerMarkerDataTypes.Blob8 which won't be visualized. - - - - - Records the Profiler metric data that a Profiler marker or counter produces. - - - - - Maximum amount of samples ProfilerRecorder can capture. - - - - - Copies collected samples to the destination array. - - Pointer to the destination samples array. - Destination samples array size. - Reset ProfilerRecorder. - - Returns the count of the copied elements. - - - - - Copies all collected samples to the destination list. - - Destination list. - Reset ProfilerRecorder. - - - - Collected samples count. - - - - - Constructs ProfilerRecorder instance with a Profiler metric name and category. - - Profiler category name. - Profiler marker or counter name. - Maximum amount of samples to be collected. - Profiler recorder options. - Profiler category identifier. - - - - Constructs ProfilerRecorder instance with a Profiler metric name and category. - - Profiler category name. - Profiler marker or counter name. - Maximum amount of samples to be collected. - Profiler recorder options. - Profiler category identifier. - - - - Constructs ProfilerRecorder instance with a Profiler metric name. - - Profiler marker or counter name. - Maximum amount of samples to be collected. - Profiler recorder options. - - - - Constructs ProfilerRecorder instance with a Profiler metric name pointer or other unsafe handles. - - Profiler category identifier. - Profiler marker or counter name pointer. - Profiler marker or counter name length. - Maximum amount of samples to be collected. - Profiler recorder options. - Profiler marker instance. - Profiler recorder handle. - - - - Constructs ProfilerRecorder instance with a Profiler metric name pointer or other unsafe handles. - - Profiler category identifier. - Profiler marker or counter name pointer. - Profiler marker or counter name length. - Maximum amount of samples to be collected. - Profiler recorder options. - Profiler marker instance. - Profiler recorder handle. - - - - Constructs ProfilerRecorder instance with a Profiler metric name pointer or other unsafe handles. - - Profiler category identifier. - Profiler marker or counter name pointer. - Profiler marker or counter name length. - Maximum amount of samples to be collected. - Profiler recorder options. - Profiler marker instance. - Profiler recorder handle. - - - - Gets current value of the Profiler metric. - - - - - Gets current value of the Profiler metric as double value. - - - - - Value data type of the Profiler metric. - - - - - Releases unmanaged instance of the ProfilerRecorder. - - - - - Gets sample data. - - - - - - Indicates if ProfilerRecorder is attached to the Profiler metric. - - - - - Gets the last value collected by the ProfilerRecorder. - - - - - Gets the last value collected by the ProfilerRecorder as double. - - - - - Clears collected samples. - - - - - Start data collection. - - - - - Initialize a new instance of ProfilerRecorder and start data collection. - - Profiler category. - Profiler marker or counter name. - Maximum amount of samples to collect. - ProfilerRecorder options. - - Returns new enabled recorder instance. - - - - - Initialize a new instance of ProfilerRecorder for ProfilerMarker and start data collection. - - Maximum amount of samples to be collected. - Profiler recorder options. - Profiler marker instance. - - Returns new enabled recorder instance. - - - - - Stops data collection. - - - - - Use to convert collected samples to an array. - - - - - Unit type. - - - - - Indicates whether ProfilerRecorder is associated with a valid Profiler marker or counter. - - - - - Indicates if ProfilerRecorder capacity has been exceeded. - - - - - ProfilerRecorder lifecycle and collection options. - - - - - Use to collect samples only on the thread ProfilerRecorder was initialized on. - - - - - Default initialization options. Equivalent to (SumSamplesInFrame | WrapAroundWhenCapacityReached). - - - - - Use to keep the ProfilerRecorder unmanaged instance running across a Unity domain reload. - - - - - Use to start data collection immediately upon ProfilerRecorder initialization. - - - - - Use to sum all samples within a frame and collect those as one sample per frame. - - - - - Use to allow sample value overwrite when ProfilerRecorder capacity is exceeded. - - - - - Sample value structure. - - - - - Sample count. - - - - - Raw sample value. - - - - - Reflection data for a DOTS instancing constant buffer. - - - - - The index of this constant buffer in the list of constant buffers returned by HybridV2ShaderReflection.GetDOTSInstancingCbuffers. - - - - - The value returned by Shader.PropertyToID for the name of this constant buffer. - - - - - The size of this constant buffer in bytes. - - - - - Reflection data for a DOTS instancing property. - - - - - The index of the constant buffer that contains this property in the list of constant buffers returned by HybridV2ShaderReflection.GetDOTSInstancingCbuffers. - - - - - The amount of columns or elements of this property if it's a matrix or a vector, respectively. - - - - - The value returned by Shader.PropertyToID for the name of this property. - - - - - The type of this property. - - - - - The value returned by Shader.PropertyToID for the DOTS instancing metadata constant of this property. - - - - - The offset of the metadata constant of this property in its DOTS instancing metadata constant buffer. - - - - - The amount of rows of this property if it's a matrix. - - - - - The size of this property in bytes. - - - - - Describes the type of a DOTS instancing property. - - - - - The property has type bool. - - - - - The property has type float. - - - - - The property has type half. - - - - - The property has type int. - - - - - The property has type short. - - - - - The property has a structure type. - - - - - The property has type uint. - - - - - The property has an unknown type. - - - - - Contains methods for reading Hybrid Renderer specific reflection data from shaders. - - - - - Returns the list of detected Hybrid Renderer DOTS instancing constant buffers for the given shader. - - Shader to get reflection data from. - - List of detected DOTS instancing constant buffers. - - - - - Returns the list of detected DOTS instancing properties for the given shader. - - Shader to get reflection data from. - - List of detected DOTS instancing properties. - - - - - Returns a monotonically increasing DOTS reflection data version number, which is incremented whenever a shader is loaded that contains DOTS instancing properties. - - - DOTS reflection data version number. - - - - - Declares an assembly to be compatible (API wise) with a specific Unity API. Used by internal tools to avoid processing the assembly in order to decide whether assemblies may be using old Unity API. - - - - - Version of Unity API. - - - - - Initializes a new instance of UnityAPICompatibilityVersionAttribute. - - Unity version that this assembly is compatible with. - Must be set to true. - - - - Initializes a new instance of UnityAPICompatibilityVersionAttribute. This overload has been deprecated. - - Unity version that this assembly is compatible with. - - - - Initializes a new instance of UnityAPICompatibilityVersionAttribute. This constructor is used by internal tooling. - - Unity version that this assembly is compatible with. - A comma-separated list comprised of the assembly name and attribute hash pairs. For example, assemblyname:hash,assemblyname:hash. - - - - Constants to pass to Application.RequestUserAuthorization. - - - - - Request permission to use any audio input sources attached to the computer. - - - - - Request permission to use any video input sources attached to the computer. - - - - - Representation of 2D vectors and points. - - - - - Shorthand for writing Vector2(0, -1). - - - - - Shorthand for writing Vector2(-1, 0). - - - - - Returns the length of this vector (Read Only). - - - - - Shorthand for writing Vector2(float.NegativeInfinity, float.NegativeInfinity). - - - - - Returns this vector with a magnitude of 1 (Read Only). - - - - - Shorthand for writing Vector2(1, 1). - - - - - Shorthand for writing Vector2(float.PositiveInfinity, float.PositiveInfinity). - - - - - Shorthand for writing Vector2(1, 0). - - - - - Returns the squared length of this vector (Read Only). - - - - - Shorthand for writing Vector2(0, 1). - - - - - X component of the vector. - - - - - Y component of the vector. - - - - - Shorthand for writing Vector2(0, 0). - - - - - Returns the unsigned angle in degrees between from and to. - - The vector from which the angular difference is measured. - The vector to which the angular difference is measured. - - - - Returns a copy of vector with its magnitude clamped to maxLength. - - - - - - - Constructs a new vector with given x, y components. - - - - - - - Returns the distance between a and b. - - - - - - - Dot Product of two vectors. - - - - - - - Returns true if the given vector is exactly equal to this vector. - - - - - - Converts a Vector3 to a Vector2. - - - - - - Converts a Vector2 to a Vector3. - - - - - - Linearly interpolates between vectors a and b by t. - - - - - - - - Linearly interpolates between vectors a and b by t. - - - - - - - - Returns a vector that is made from the largest components of two vectors. - - - - - - - Returns a vector that is made from the smallest components of two vectors. - - - - - - - Moves a point current towards target. - - - - - - - - Makes this vector have a magnitude of 1. - - - - - Divides a vector by a number. - - - - - - - Divides a vector by another vector. - - - - - - - Returns true if two vectors are approximately equal. - - - - - - - Subtracts one vector from another. - - - - - - - Negates a vector. - - - - - - Multiplies a vector by a number. - - - - - - - Multiplies a vector by a number. - - - - - - - Multiplies a vector by another vector. - - - - - - - Adds two vectors. - - - - - - - Returns the 2D vector perpendicular to this 2D vector. The result is always rotated 90-degrees in a counter-clockwise direction for a 2D coordinate system where the positive Y axis goes up. - - The input direction. - - The perpendicular direction. - - - - - Reflects a vector off the vector defined by a normal. - - - - - - - Multiplies two vectors component-wise. - - - - - - - Multiplies every component of this vector by the same component of scale. - - - - - - Set x and y components of an existing Vector2. - - - - - - - Returns the signed angle in degrees between from and to. - - The vector from which the angular difference is measured. - The vector to which the angular difference is measured. - - - - Gradually changes a vector towards a desired goal over time. - - The current position. - The position we are trying to reach. - The current velocity, this value is modified by the function every time you call it. - Approximately the time it will take to reach the target. A smaller value will reach the target faster. - Optionally allows you to clamp the maximum speed. - The time since the last call to this function. By default Time.deltaTime. - - - - Gradually changes a vector towards a desired goal over time. - - The current position. - The position we are trying to reach. - The current velocity, this value is modified by the function every time you call it. - Approximately the time it will take to reach the target. A smaller value will reach the target faster. - Optionally allows you to clamp the maximum speed. - The time since the last call to this function. By default Time.deltaTime. - - - - Gradually changes a vector towards a desired goal over time. - - The current position. - The position we are trying to reach. - The current velocity, this value is modified by the function every time you call it. - Approximately the time it will take to reach the target. A smaller value will reach the target faster. - Optionally allows you to clamp the maximum speed. - The time since the last call to this function. By default Time.deltaTime. - - - - Access the x or y component using [0] or [1] respectively. - - - - - Returns a formatted string for this vector. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Returns a formatted string for this vector. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Returns a formatted string for this vector. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Representation of 2D vectors and points using integers. - - - - - Shorthand for writing Vector2Int(0, -1). - - - - - Shorthand for writing Vector2Int(-1, 0). - - - - - Returns the length of this vector (Read Only). - - - - - Shorthand for writing Vector2Int(1, 1). - - - - - Shorthand for writing Vector2Int(1, 0). - - - - - Returns the squared length of this vector (Read Only). - - - - - Shorthand for writing Vector2Int(0, 1). - - - - - X component of the vector. - - - - - Y component of the vector. - - - - - Shorthand for writing Vector2Int(0, 0). - - - - - Converts a Vector2 to a Vector2Int by doing a Ceiling to each value. - - - - - - Clamps the Vector2Int to the bounds given by min and max. - - - - - - - Returns the distance between a and b. - - - - - - - Returns true if the objects are equal. - - - - - - Converts a Vector2 to a Vector2Int by doing a Floor to each value. - - - - - - Gets the hash code for the Vector2Int. - - - The hash code of the Vector2Int. - - - - - Converts a Vector2Int to a Vector2. - - - - - - Returns a vector that is made from the largest components of two vectors. - - - - - - - Returns a vector that is made from the smallest components of two vectors. - - - - - - - Divides a vector by a number. - - - - - - - Returns true if the vectors are equal. - - - - - - - Converts a Vector2Int to a Vector3Int. - - - - - - Subtracts one vector from another. - - - - - - - Multiplies a vector by a number. - - - - - - - Multiplies a vector by a number. - - - - - - - Returns true if vectors different. - - - - - - - Adds two vectors. - - - - - - - Converts a Vector2 to a Vector2Int by doing a Round to each value. - - - - - - Multiplies two vectors component-wise. - - - - - - - Multiplies every component of this vector by the same component of scale. - - - - - - Set x and y components of an existing Vector2Int. - - - - - - - Access the x or y component using [0] or [1] respectively. - - - - - Returns a formatted string for this vector. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Returns a formatted string for this vector. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Returns a formatted string for this vector. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Representation of 3D vectors and points. - - - - - Shorthand for writing Vector3(0, 0, -1). - - - - - Shorthand for writing Vector3(0, -1, 0). - - - - - Shorthand for writing Vector3(0, 0, 1). - - - - - Shorthand for writing Vector3(-1, 0, 0). - - - - - Returns the length of this vector (Read Only). - - - - - Shorthand for writing Vector3(float.NegativeInfinity, float.NegativeInfinity, float.NegativeInfinity). - - - - - Returns this vector with a magnitude of 1 (Read Only). - - - - - Shorthand for writing Vector3(1, 1, 1). - - - - - Shorthand for writing Vector3(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity). - - - - - Shorthand for writing Vector3(1, 0, 0). - - - - - Returns the squared length of this vector (Read Only). - - - - - Shorthand for writing Vector3(0, 1, 0). - - - - - X component of the vector. - - - - - Y component of the vector. - - - - - Z component of the vector. - - - - - Shorthand for writing Vector3(0, 0, 0). - - - - - Returns the angle in degrees between from and to. - - The vector from which the angular difference is measured. - The vector to which the angular difference is measured. - - The angle in degrees between the two vectors. - - - - - Returns a copy of vector with its magnitude clamped to maxLength. - - - - - - - Cross Product of two vectors. - - - - - - - Creates a new vector with given x, y, z components. - - - - - - - - Creates a new vector with given x, y components and sets z to zero. - - - - - - - Returns the distance between a and b. - - - - - - - Dot Product of two vectors. - - - - - - - Returns true if the given vector is exactly equal to this vector. - - - - - - Linearly interpolates between two points. - - Start value, returned when t = 0. - End value, returned when t = 1. - Value used to interpolate between a and b. - - Interpolated value, equals to a + (b - a) * t. - - - - - Linearly interpolates between two vectors. - - - - - - - - Returns a vector that is made from the largest components of two vectors. - - - - - - - Returns a vector that is made from the smallest components of two vectors. - - - - - - - Calculate a position between the points specified by current and target, moving no farther than the distance specified by maxDistanceDelta. - - The position to move from. - The position to move towards. - Distance to move current per call. - - The new position. - - - - - Makes this vector have a magnitude of 1. - - - - - - Divides a vector by a number. - - - - - - - Returns true if two vectors are approximately equal. - - - - - - - Subtracts one vector from another. - - - - - - - Negates a vector. - - - - - - Multiplies a vector by a number. - - - - - - - Multiplies a vector by a number. - - - - - - - Returns true if vectors different. - - - - - - - Adds two vectors. - - - - - - - Makes vectors normalized and orthogonal to each other. - - - - - - - Makes vectors normalized and orthogonal to each other. - - - - - - - - Projects a vector onto another vector. - - - - - - - Projects a vector onto a plane defined by a normal orthogonal to the plane. - - The direction from the vector towards the plane. - The location of the vector above the plane. - - The location of the vector on the plane. - - - - - Reflects a vector off the plane defined by a normal. - - - - - - - Rotates a vector current towards target. - - The vector being managed. - The vector. - The maximum angle in radians allowed for this rotation. - The maximum allowed change in vector magnitude for this rotation. - - The location that RotateTowards generates. - - - - - Multiplies two vectors component-wise. - - - - - - - Multiplies every component of this vector by the same component of scale. - - - - - - Set x, y and z components of an existing Vector3. - - - - - - - - Returns the signed angle in degrees between from and to. - - The vector from which the angular difference is measured. - The vector to which the angular difference is measured. - A vector around which the other vectors are rotated. - - - - Spherically interpolates between two vectors. - - - - - - - - Spherically interpolates between two vectors. - - - - - - - - Gradually changes a vector towards a desired goal over time. - - The current position. - The position we are trying to reach. - The current velocity, this value is modified by the function every time you call it. - Approximately the time it will take to reach the target. A smaller value will reach the target faster. - Optionally allows you to clamp the maximum speed. - The time since the last call to this function. By default Time.deltaTime. - - - - Gradually changes a vector towards a desired goal over time. - - The current position. - The position we are trying to reach. - The current velocity, this value is modified by the function every time you call it. - Approximately the time it will take to reach the target. A smaller value will reach the target faster. - Optionally allows you to clamp the maximum speed. - The time since the last call to this function. By default Time.deltaTime. - - - - Gradually changes a vector towards a desired goal over time. - - The current position. - The position we are trying to reach. - The current velocity, this value is modified by the function every time you call it. - Approximately the time it will take to reach the target. A smaller value will reach the target faster. - Optionally allows you to clamp the maximum speed. - The time since the last call to this function. By default Time.deltaTime. - - - - Access the x, y, z components using [0], [1], [2] respectively. - - - - - Returns a formatted string for this vector. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Returns a formatted string for this vector. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Returns a formatted string for this vector. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Representation of 3D vectors and points using integers. - - - - - Shorthand for writing Vector3Int(0, 0, -1). - - - - - Shorthand for writing Vector3Int(0, -1, 0). - - - - - Shorthand for writing Vector3Int(0, 0, 1). - - - - - Shorthand for writing Vector3Int(-1, 0, 0). - - - - - Returns the length of this vector (Read Only). - - - - - Shorthand for writing Vector3Int(1, 1, 1). - - - - - Shorthand for writing Vector3Int(1, 0, 0). - - - - - Returns the squared length of this vector (Read Only). - - - - - Shorthand for writing Vector3Int(0, 1, 0). - - - - - X component of the vector. - - - - - Y component of the vector. - - - - - Z component of the vector. - - - - - Shorthand for writing Vector3Int(0, 0, 0). - - - - - Converts a Vector3 to a Vector3Int by doing a Ceiling to each value. - - - - - - Clamps the Vector3Int to the bounds given by min and max. - - - - - - - Returns the distance between a and b. - - - - - - - Returns true if the objects are equal. - - - - - - Converts a Vector3 to a Vector3Int by doing a Floor to each value. - - - - - - Gets the hash code for the Vector3Int. - - - The hash code of the Vector3Int. - - - - - Converts a Vector3Int to a Vector3. - - - - - - Returns a vector that is made from the largest components of two vectors. - - - - - - - Returns a vector that is made from the smallest components of two vectors. - - - - - - - Divides a vector by a number. - - - - - - - Returns true if the vectors are equal. - - - - - - - Converts a Vector3Int to a Vector2Int. - - - - - - Subtracts one vector from another. - - - - - - - Multiplies a vector by a number. - - - - - - - Multiplies a vector by a number. - - - - - - - Returns true if vectors different. - - - - - - - Adds two vectors. - - - - - - - Converts a Vector3 to a Vector3Int by doing a Round to each value. - - - - - - Multiplies two vectors component-wise. - - - - - - - Multiplies every component of this vector by the same component of scale. - - - - - - Set x, y and z components of an existing Vector3Int. - - - - - - - - Access the x, y or z component using [0], [1] or [2] respectively. - - - - - Returns a formatted string for this vector. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Returns a formatted string for this vector. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Returns a formatted string for this vector. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Representation of four-dimensional vectors. - - - - - Returns the length of this vector (Read Only). - - - - - Shorthand for writing Vector4(float.NegativeInfinity, float.NegativeInfinity, float.NegativeInfinity, float.NegativeInfinity). - - - - - Returns this vector with a magnitude of 1 (Read Only). - - - - - Shorthand for writing Vector4(1,1,1,1). - - - - - Shorthand for writing Vector4(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity). - - - - - Returns the squared length of this vector (Read Only). - - - - - W component of the vector. - - - - - X component of the vector. - - - - - Y component of the vector. - - - - - Z component of the vector. - - - - - Shorthand for writing Vector4(0,0,0,0). - - - - - Creates a new vector with given x, y, z, w components. - - - - - - - - - Creates a new vector with given x, y, z components and sets w to zero. - - - - - - - - Creates a new vector with given x, y components and sets z and w to zero. - - - - - - - Returns the distance between a and b. - - - - - - - Dot Product of two vectors. - - - - - - - Returns true if the given vector is exactly equal to this vector. - - - - - - Converts a Vector4 to a Vector2. - - - - - - Converts a Vector4 to a Vector3. - - - - - - Converts a Vector2 to a Vector4. - - - - - - Converts a Vector3 to a Vector4. - - - - - - Linearly interpolates between two vectors. - - - - - - - - Linearly interpolates between two vectors. - - - - - - - - Returns a vector that is made from the largest components of two vectors. - - - - - - - Returns a vector that is made from the smallest components of two vectors. - - - - - - - Moves a point current towards target. - - - - - - - - - - - - - - Makes this vector have a magnitude of 1. - - - - - Divides a vector by a number. - - - - - - - Returns true if two vectors are approximately equal. - - - - - - - Subtracts one vector from another. - - - - - - - Negates a vector. - - - - - - Multiplies a vector by a number. - - - - - - - Multiplies a vector by a number. - - - - - - - Adds two vectors. - - - - - - - Projects a vector onto another vector. - - - - - - - Multiplies two vectors component-wise. - - - - - - - Multiplies every component of this vector by the same component of scale. - - - - - - Set x, y, z and w components of an existing Vector4. - - - - - - - - - Access the x, y, z, w components using [0], [1], [2], [3] respectively. - - - - - Returns a formatted string for this vector. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Returns a formatted string for this vector. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Returns a formatted string for this vector. - - A numeric format string. - An object that specifies culture-specific formatting. - - - - Wrapping modes for text that reaches the vertical boundary. - - - - - Text well continue to generate when reaching vertical boundary. - - - - - Text will be clipped when reaching the vertical boundary. - - - - - This enumeration describes Camera buffer types. - - - - - The Camera's color buffer. - - - - - The Camera's depth buffer. - - - - - No Buffer. - - - - - The Camera's normal buffer. - - - - - This class handles the properties that you transmit to a system using a VFX.VisualEffect.SendEvent. - - - - - Copies the values from a VFXEventAttribute to the one you call this function from. - - The source event attribute. - - - - The copy constructor for the VFXEventAttribute class. - - The source VFXEventAttribute to copy from. - - - - Use this method to get the value of a named bool property from the VFXEventAttribute. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the bool you specify. Returns false if VFX.VFXEventAttribute.HasBool returns false. - - - - - Use this method to get the value of a named bool property from the VFXEventAttribute. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the bool you specify. Returns false if VFX.VFXEventAttribute.HasBool returns false. - - - - - Use this method to get the value of a named float property from the VFXEventAttribute. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the float you specify. Returns 0.0f if VFX.VFXEventAttribute.HasFloat returns false. - - - - - Use this method to get the value of a named float property from the VFXEventAttribute. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the float you specify. Returns 0.0f if VFX.VFXEventAttribute.HasFloat returns false. - - - - - Use this method to get the value of a named integer property from the VFXEventAttribute. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the integer you specify. Returns 0 if VFX.VFXEventAttribute.HasInt returns false. - - - - - Use this method to get the value of a named integer property from the VFXEventAttribute. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the integer you specify. Returns 0 if VFX.VFXEventAttribute.HasInt returns false. - - - - - Use this method to get the value of a named Matrix4x4 property from the VFXEventAttribute. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the Matrix4x4 you specify. Returns Matrix4x4.identity if VFX.VFXEventAttribute.HasMatrix4x4 returns false. - - - - - Use this method to get the value of a named Matrix4x4 property from the VFXEventAttribute. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the Matrix4x4 you specify. Returns Matrix4x4.identity if VFX.VFXEventAttribute.HasMatrix4x4 returns false. - - - - - Use this method to get the value of a named unsigned integer property from the VFXEventAttribute. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the int you specify. Returns 0 if VFX.VFXEventAttribute.HasUint returns false. - - - - - Use this method to get the value of a named unsigned integer property from the VFXEventAttribute. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the int you specify. Returns 0 if VFX.VFXEventAttribute.HasUint returns false. - - - - - Use this method to get the value of a named Vector2 property from the VFXEventAttribute. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the Vector2 you specify. Returns Vector2.zero if VFX.VFXEventAttribute.HasVector2 returns false. - - - - - Use this method to get the value of a named Vector2 property from the VFXEventAttribute. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the Vector2 you specify. Returns Vector2.zero if VFX.VFXEventAttribute.HasVector2 returns false. - - - - - Use this method to get the value of a named Vector3 property from the VFXEventAttribute. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the Vector3 you specify. Returns Vector3.zero if VFX.VFXEventAttribute.HasVector3 returns false. - - - - - Use this method to get the value of a named Vector3 property from the VFXEventAttribute. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the Vector3 you specify. Returns Vector3.zero if VFX.VFXEventAttribute.HasVector3 returns false. - - - - - Use this method to get the value of a named Vector4 property from the VFXEventAttribute. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the Vector4 you specify. Returns Vector4.zero if VFX.VFXEventAttribute.HasVector4 returns false. - - - - - Use this method to get the value of a named Vector4 property from the VFXEventAttribute. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the Vector4 you specify. Returns Vector4.zero if VFX.VFXEventAttribute.HasVector4 returns false. - - - - - Use this method to check if the VFXEventAttribute stores a bool with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the VFXEventAttribute stores a bool with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the VFXEventAttribute stores a float with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the VFXEventAttribute stores a float with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the VFXEventAttribute stores a integer with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the VFXEventAttribute stores a integer with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the VFXEventAttribute stores a Matrix4x4 with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the VFXEventAttribute stores a Matrix4x4 with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the VFXEventAttribute stores a unsigned integer with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the VFXEventAttribute stores a unsigned integer with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the VFXEventAttribute stores a Vector2 with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the VFXEventAttribute stores a Vector2 with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the VFXEventAttribute stores a Vector3 with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the VFXEventAttribute stores a Vector3 with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the VFXEventAttribute stores a Vector4 with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the VFXEventAttribute stores a Vector4 with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to set the value of a bool with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new bool value. - - - - Use this method to set the value of a bool with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new bool value. - - - - Use this method to set the value of a float with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new float value. - - - - Use this method to set the value of a float with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new float value. - - - - Use this method to set the value of an integer with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new integer value. - - - - Use this method to set the value of an integer with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new integer value. - - - - Use this method to set the value of a Matrix4x4 with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new Matrix4x4 value. - - - - Use this method to set the value of a Matrix4x4 with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new Matrix4x4 value. - - - - Use this method to set the value of an unsigned integer with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new unsigned integer value. - - - - Use this method to set the value of an unsigned integer with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new unsigned integer value. - - - - Use this method to set the value of a Vector2 with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new Vector2 value. - - - - Use this method to set the value of a Vector2 with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new Vector2 value. - - - - Use this method to set the value of a Vector3 with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new Vector3 value. - - - - Use this method to set the value of a Vector3 with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new Vector3 value. - - - - Use this method to set the value of a Vector4 with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new Vector4 value. - - - - Use this method to set the value of a Vector4 with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new Vector4 value. - - - - This structure describes an exposed property on a VisualEffectAsset. - - - - - The name of the exposed property. - - - - - The type of the exposed property. - - - - - This class is a wrapper to the set of expression values. - - - - - Returns a an animation curve that corresponds to the bound named expression. If this entry is not available, or the type doesn't match, an exception is thrown. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Returns a an animation curve that corresponds to the bound named expression. If this entry is not available, or the type doesn't match, an exception is thrown. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Returns a boolean that corresponds to the bound named expression. If this entry is not available, or the type doesn't match, an exception is thrown. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Returns a boolean that corresponds to the bound named expression. If this entry is not available, or the type doesn't match, an exception is thrown. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Returns a float that corresponds to the bound named expression. If this entry is not available, or the type doesn't match, an exception is thrown. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Returns a float that corresponds to the bound named expression. If this entry is not available, or the type doesn't match, an exception is thrown. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Returns a gradient that corresponds to the bound named expression. If this entry is not available, or the type doesn't match, an exception is thrown. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Returns a gradient that corresponds to the bound named expression. If this entry is not available, or the type doesn't match, an exception is thrown. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Returns an integer that corresponds to the bound named expression. IF this entry is not available, or the type doesn't match, an exception is thrown. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Returns an integer that corresponds to the bound named expression. IF this entry is not available, or the type doesn't match, an exception is thrown. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Returns a Matrix4 that corresponds to the bound named expression. If this entry is not available, or the type doesn't match, an exception is thrown. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Returns a Matrix4 that corresponds to the bound named expression. If this entry is not available, or the type doesn't match, an exception is thrown. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Returns a mesh that corresponds to the bound named expression. If this entry is not available, or the type doesn't match, an exception is thrown. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Returns a mesh that corresponds to the bound named expression. If this entry is not available, or the type doesn't match, an exception is thrown. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Returns a texture that corresponds to the bound named expression. If this entry is not available, or the type doesn't match, an exception is thrown. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Returns a texture that corresponds to the bound named expression. If this entry is not available, or the type doesn't match, an exception is thrown. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Returns an unsigned integer that corresponds to the bound named expression. If this entry is not available, or the type doesn't match, an exception is thrown. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Returns an unsigned integer that corresponds to the bound named expression. If this entry is not available, or the type doesn't match, an exception is thrown. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Returns a Vector2 that corresponds to the bound named expression. If this entry is not available, or the type doesn't match, an exception is thrown. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Returns a Vector2 that corresponds to the bound named expression. If this entry is not available, or the type doesn't match, an exception is thrown. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Returns a Vector3 that corresponds to the bound named expression. If this entry is not available, or the type doesn't match, an exception is thrown. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Returns a Vector3 that corresponds to the bound named expression. If this entry is not available, or the type doesn't match, an exception is thrown. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Returns a Vector4 that corresponds to the bound named expression. If this entry is not available, or the type doesn't match, an exception is thrown. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Returns a Vector4 that corresponds to the bound named expression. If this entry is not available, or the type doesn't match, an exception is thrown. - - The name ID of the property retrieved by Shader.PropertyToID. - The name of the property. - - - - Use this class to set a number of properties that control VisualEffect behavior within your Unity Project. - - - - - The fixed interval in which the frame rate updates. The tick rate is in seconds. - - - - - The maximum allowed delta time for an update interval. This limit affects fixedDeltaTime and deltaTime. The tick rate is in seconds. - - - - - Queries which buffers the VFX Manager needs for the given Camera. - - The Camera for which to query needed buffers. - - A list of all needed buffer flags. - - - - - Use this method to prepare per-Camera VFX commands for this frame. - - The Camera to prepare for processing VFX commands. - - - - Use this method to prepare and process per-Camera VFX commands for this frame. - - The Camera to prepare for processing VFX commands. - - - - Use this method to process per-Camera VFX commands for the current frame. - - The Camera to process the VFX commands for. - The CommandBuffer to push commands to (can be null). - - - - Use this method to set the buffer of a given type for this Camera. This allows the VFX Manager to use the buffer. - - The Camera to set the buffer for. - The type of buffer to set. - The buffer to set. - X offset of the viewport in the buffer. - Y offset of the viewport in the buffer. - Width of the viewport in the buffer. - Height of the viewport in the buffer. - - - - This struct holds information about an output event. - - - - - Stores the current event attribute. - - - - - Stores the nameId of the source output event context that triggered this event. - - - - - This structure provides information data on a particle system. - - - - - Number of alive particles within the particle system, the value is lower than [[VFXParticleSystemInfo._capacity]. - - - - - The rendering bound of this particle system. - - - - - The capacity (maximum VFXParticleSystemInfo._aliveCount) of the particle system. - - - - - The sleep state of the particle system. - - - - - This abstract class provides a way to implement custom spawner block in C#. - - - - - Unity invokes this method when a parent spawner system triggers Play. - - The spawner state. - The values of expression (input properties for a spawner block). - The visual effect. - - - - Unity invokes this method when a parent spawner system triggers Stop. - - The spawner state. - The values of expression (input properties for a spawner block). - The visual effect. - - - - Unity invokes this method when a parent spawner system triggers Update. - - The spawner state. - The values of expression (input properties for a spawner block). - The visual effect. - - - - This enum describes the state of VFXSpawner. - - - - - If the VFXSpawner is in this state, then it is waiting after a loop has reached the end. - - - - - If the VFXSpawner is in this state, then it is waiting before it starts a loop. - - - - - If the VFXSpawner is in this state then it has finished and is currently awaiting a Play invocation. This is the default and final state. - - - - - If the VFXSpawner is in this state, then it is currently looping. When in this state, VFX.VFXSpawnerState._playing is true. - - - - - The spawn state of a Spawn system. - - - - - The current delay time that the VFXSpawner waits for after it finishes a loop. - - - - - The current delay time that the VFXSpawner waits for before it starts a loop. - - - - - The current delta time. - - - - - The current loop count. - - - - - The duration of the looping state. - - - - - The current index of loop. - - - - - The current state of VFXSpawnerState. - - - - - This boolean indicates if a new loop has just started. - - - - - The current playing state. - - - - - The current Spawn count. - - - - - The accumulated delta time since the last Play event. - - - - - Gets the modifiable current event attribute (Read Only). - - - - - The visual effect class that references an VFX.VisualEffectAsset instance within the Scene. - - - - - Returns the sum of all alive particles within the visual effect. - - - - - Use this property to determine if this visual effect is not visible from any Camera. (Read Only) - - - - - The default event name ID. To retrieve this value, use the Shader.PropertyID after VisualEffect has awakened or after you've invoked VFX.VisualEffect.Reinit. - - - - - The default event name. Unity calls this event when the VisualEffect awakes, or when you call VisualEffect.Reinit. - - - - - Output event are reported trough this callback. - - - - - Use this property to set the pause state of the visual effect. - - - - - A multiplier that Unity applies to the delta time when it updates the VisualEffect. The default value is 1.0f. - - - - - This property controls whether the visual effect generates a new seed for the random number generator with each call to VFX.VisualEffect.Play function. - - - - - The initial seed used for internal random number generator. - - - - - The VisualEffectAsset that the VisualEffect uses. - - - - - If VFX.VisualEffect._pause is true, this method processes the next visual effect update for exactly one frame with the current delta time. - - - - - Use this method to create a new VFXEventAttribute. - - - - - The VisualEffect constructor. - - - - - Gets the value of a named animation curve property - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the animation curve you specify. Returns an empty animation curve if VFX.VisualEffect.HasAnimationCurve returns false. - - - - - Gets the value of a named animation curve property - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the animation curve you specify. Returns an empty animation curve if VFX.VisualEffect.HasAnimationCurve returns false. - - - - - Gets the value of a named bool property - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the bool you specify. Returns false if VFX.VisualEffect.HasBool returns false. - - - - - Gets the value of a named bool property - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the bool you specify. Returns false if VFX.VisualEffect.HasBool returns false. - - - - - Gets the value of a named float property - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the float you specify. Returns 0.0f if VFX.VisualEffect.HasFloat returns false. - - - - - Gets the value of a named float property - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the float you specify. Returns 0.0f if VFX.VisualEffect.HasFloat returns false. - - - - - Gets the value of a named gradient property - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the gradient you specify. Returns an empty gradient if VFX.VisualEffect.HasGradient returns false. - - - - - Gets the value of a named gradient property - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the gradient you specify. Returns an empty gradient if VFX.VisualEffect.HasGradient returns false. - - - - - Get a named exposed integer. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the integer you specify. Returns 0 if VFX.VisualEffect.HasInt returns false. - - - - - Get a named exposed integer. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the integer you specify. Returns 0 if VFX.VisualEffect.HasInt returns false. - - - - - Gets the value of a named Matrix4x4 property - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the Matrix4x4 you specify. Returns Matrix4x4.identity if VFX.VisualEffect.HasMatrix4x4 returns false. - - - - - Gets the value of a named Matrix4x4 property - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the Matrix4x4 you specify. Returns Matrix4x4.identity if VFX.VisualEffect.HasMatrix4x4 returns false. - - - - - Gets the value of a named mesh property - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the mesh you specify. Returns null if VFX.VisualEffect.HasMesh returns false. - - - - - Gets the value of a named mesh property - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the mesh you specify. Returns null if VFX.VisualEffect.HasMesh returns false. - - - - - Gets the name of every output event system. - - The List that this function populates with the output event system names. - - - - Gets information on a particle system. - - The system ID. This is the same ID that Shader.PropertyToID returns. - The name of the particle system. - - A VFXSystemInfo instance. - - - - - Gets information on a particle system. - - The system ID. This is the same ID that Shader.PropertyToID returns. - The name of the particle system. - - A VFXSystemInfo instance. - - - - - Gets the name of every particle system. - - The List that this function populates with the particle system names. - - - - Gets state on a spawn system. - - The system ID. This is the same ID that Shader.PropertyToID returns. - The name of the spawn system. - - A VFXSpawnerState instance. - - - - - Gets state on a spawn system. - - The system ID. This is the same ID that Shader.PropertyToID returns. - The name of the spawn system. - - A VFXSpawnerState instance. - - - - - Gets state on a spawn system. - - The system ID. This is the same ID that Shader.PropertyToID returns. - A modified VFXSpawnerState instance. - - - - Gets the name of every spawn system. - - The List that this function populates with the spawn system names. - - - - Gets the name of every system. - - The List that this function populates with the system names. - - - - Gets the value of a named texture property - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the texture you specify. Returns null if VFX.VisualEffect.HasTexture returns false. - - - - - Gets the value of a named texture property - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the texture you specify. Returns null if VFX.VisualEffect.HasTexture returns false. - - - - - Gets expected texture dimension for a named exposed texture. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Gets expected texture dimension for a named exposed texture. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Gets the value of a named unsigned integer property - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the unsigned integer you specify. Returns 0 if VFX.VisualEffect.HasUInt returns false. - - - - - Gets the value of a named unsigned integer property - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the unsigned integer you specify. Returns 0 if VFX.VisualEffect.HasUInt returns false. - - - - - Gets the value of a named Vector2 property - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the Vector2 you specify. Returns Vector2.zero if VFX.VisualEffect.HasVector2 returns false. - - - - - Gets the value of a named Vector2 property - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the Vector2 you specify. Returns Vector2.zero if VFX.VisualEffect.HasVector2 returns false. - - - - - Gets the value of a named Vector3 property - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the Vector3 you specify. Returns Vector3.zero if VFX.VisualEffect.HasVector3 returns false. - - - - - Gets the value of a named Vector3 property - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the Vector3 you specify. Returns Vector3.zero if VFX.VisualEffect.HasVector3 returns false. - - - - - Gets the value of a named Vector4 property - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the Vector4 you specify. Returns Vector4.zero if VFX.VisualEffect.HasVector4 returns false. - - - - - Gets the value of a named Vector4 property - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - The value for the Vector4 you specify. Returns Vector4.zero if VFX.VisualEffect.HasVector4 returns false. - - - - - Use this method to check if the visual effect can override an animation curve with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the visual effect can override an animation curve with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the visual effect can override a bool with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the visual effect can override a bool with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the visual effect can override a float with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the visual effect can override a float with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the visual effect can override a gradient with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the visual effect can override a gradient with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the visual effect can override an integer with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the visual effect can override an integer with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the visual effect can override a Matrix4x4 with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the visual effect can override a Matrix4x4 with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the visual effect can override a Mesh with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the visual effect can override a Mesh with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this function to determine if the VisualEffect has the system you pass in. - - The system ID. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - true if the VisualEffect has the system you pass in. Returns false otherwise. - - - - - Use this function to determine if the VisualEffect has the system you pass in. - - The system ID. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - true if the VisualEffect has the system you pass in. Returns false otherwise. - - - - - Use this method to check if the visual effect can override a texture with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the visual effect can override a texture with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the visual effect can override an unsigned integer with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the visual effect can override an unsigned integer with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the visual effect can override a Vector2 with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the visual effect can override a Vector2 with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the visual effect can override a Vector3 with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the visual effect can override a Vector3 with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the visual effect can override a Vector4 with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to check if the visual effect can override a Vector4 with the name you pass in. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to send a play event to every Spawn system. - - Can be null or a VFXEventAttribute. To create a VFXEventAttribute, use VFX.VisualEffect.CreateVFXEventAttribute. - - - - Use this method to send a play event to every Spawn system. - - Can be null or a VFXEventAttribute. To create a VFXEventAttribute, use VFX.VisualEffect.CreateVFXEventAttribute. - - - - Reintialize visual effect. - - - - - Use this method to set the overridden state to false. This restores the default value that the Visual Effect Asset specifies. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to set the overridden state to false. This restores the default value that the Visual Effect Asset specifies. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Use this method to send a custom named event. - - The name of the event. - The ID of the event. This is the same ID that Shader.PropertyToID returns. - Can be null or a VFXEventAttribute. To create a VFXEventAttribute, use VFX.VisualEffect.CreateVFXEventAttribute. - - - - Use this method to send a custom named event. - - The name of the event. - The ID of the event. This is the same ID that Shader.PropertyToID returns. - Can be null or a VFXEventAttribute. To create a VFXEventAttribute, use VFX.VisualEffect.CreateVFXEventAttribute. - - - - Use this method to send a custom named event. - - The name of the event. - The ID of the event. This is the same ID that Shader.PropertyToID returns. - Can be null or a VFXEventAttribute. To create a VFXEventAttribute, use VFX.VisualEffect.CreateVFXEventAttribute. - - - - Use this method to send a custom named event. - - The name of the event. - The ID of the event. This is the same ID that Shader.PropertyToID returns. - Can be null or a VFXEventAttribute. To create a VFXEventAttribute, use VFX.VisualEffect.CreateVFXEventAttribute. - - - - The new animation curve value. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The new animation curve. - The name of the property. - - - - The new animation curve value. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The new animation curve. - The name of the property. - - - - The new bool value. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new boolean value. - - - - The new bool value. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new boolean value. - - - - The new float value. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new float value. - - - - The new float value. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new float value. - - - - The new gradient value. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new gradient value. - - - - The new gradient value. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new gradient value. - - - - The new integer value. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new integer value. - - - - The new integer value. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new integer value. - - - - The new Matrix4x4 value. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new Matrix4x4 value. - - - - The new Matrix4x4 value. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new Matrix4x4 value. - - - - The new mesh value. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new mesh value. - - - - The new mesh value. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new mesh value. - - - - The new texture value. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new texture value. - - - - The new texture value. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new texture value. - - - - The new unsigned integer value. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new unsigned integer value. - - - - The new unsigned integer value. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new unsigned integer value. - - - - The new Vector2 value. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new Vector2 value. - - - - The new Vector2 value. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new Vector2 value. - - - - The new Vector3 value. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new Vector3 value. - - - - The new Vector3 value. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new Vector3 value. - - - - The new Vector4 value. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new Vector4 value. - - - - The new Vector4 value. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - The new Vector4 value. - - - - Use this method to fast-forward the visual effect by simulating all systems for several step counts using the specified delta time. - - The delta time, in seconds, the simulation applies to each step. - Number of steps to proceed. - - - - Use this method to send a stop event to all Spawn systems. - - Can be null or a VFXEventAttribute. To create a VFXEventAttribute, use VFX.VisualEffect.CreateVFXEventAttribute. - - - - Use this method to send a stop event to all Spawn systems. - - Can be null or a VFXEventAttribute. To create a VFXEventAttribute, use VFX.VisualEffect.CreateVFXEventAttribute. - - - - This class contains a graph of the elements needed to describe a visual effect. These include: the visual effects system, generated shaders, and compiled data. - - - - - The visual effect Asset constructor. - - - - - Gets the name of every Event connected to a system. - - The List that this function populates with the event system names. - - - - Gets the name and type of every exposed property. - - The List that this function populates with exposed properties. - - - - Gets the TextureDimension of a named exposed Texture. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - Gets the TextureDimension of a named exposed Texture. - - The ID of the property. This is the same ID that Shader.PropertyToID returns. - The name of the property. - - - - The default name ID of the play event. - - - - - The default name of the play event. - - - - - The default name ID of the stop event. - - - - - The default name of the stop event. - - - - - This class is the base for VFX.VisualEffectAsset and VFX.VisualEffectSubgraph. - - - - - Types of 3D content layout within a video. - - - - - Video does not have any 3D content. - - - - - Video contains 3D content where the left eye occupies the upper half and right eye occupies the lower half of video frames. - - - - - Video contains 3D content where the left eye occupies the left half and right eye occupies the right half of video frames. - - - - - Methods used to fit a video in the target area. - - - - - Resize proportionally so that width fits the target area, cropping or adding black bars above and below if needed. - - - - - Resize proportionally so that content fits the target area, adding black bars if needed. - - - - - Resize proportionally so that content fits the target area, cropping if needed. - - - - - Resize proportionally so that height fits the target area, cropping or adding black bars on each side if needed. - - - - - Preserve the pixel size without adjusting for target area. - - - - - Resize non-proportionally to fit the target area. - - - - - Places where the audio embedded in a video can be sent. - - - - - Send the embedded audio to the associated AudioSampleProvider. - - - - - Send the embedded audio into a specified AudioSource. - - - - - Send the embedded audio direct to the platform's audio hardware. - - - - - Disable the embedded audio. - - - - - A container for video data. - - - - - Number of audio tracks in the clip. - - - - - The length of the VideoClip in frames. (Read Only). - - - - - The frame rate of the clip in frames/second. (Read Only). - - - - - The height of the images in the video clip in pixels. (Read Only). - - - - - The length of the video clip in seconds. (Read Only). - - - - - The video clip path in the project's assets. (Read Only). - - - - - Denominator of the pixel aspect ratio (num:den). (Read Only). - - - - - Numerator of the pixel aspect ratio (num:den). (Read Only). - - - - - Whether the imported clip contains sRGB color data (Read Only). - - - - - The width of the images in the video clip in pixels. (Read Only). - - - - - The number of channels in the audio track. E.g. 2 for a stereo track. - - Index of the audio queried audio track. - - The number of channels. - - - - - Get the audio track language. Can be unknown. - - Index of the audio queried audio track. - - The abbreviated name of the language. - - - - - Get the audio track sampling rate in Hertz. - - Index of the audio queried audio track. - - The sampling rate in Hertz. - - - - - Plays video content onto a target. - - - - - Defines how the video content will be stretched to fill the target area. - - - - - Destination for the audio embedded in the video. - - - - - Number of audio tracks found in the data source currently configured. (Read Only) - - - - - Whether direct-output volume controls are supported for the current platform and video format. (Read Only) - - - - - Whether the playback speed can be changed. (Read Only) - - - - - Whether frame-skipping to maintain synchronization can be controlled. (Read Only) - - - - - Whether current time can be changed using the time or timeFrames property. (Read Only) - - - - - Whether the time source followed by the VideoPlayer can be changed. (Read Only) - - - - - Returns true if the VideoPlayer can step forward through the video content. (Read Only) - - - - - The clip being played by the VideoPlayer. - - - - - Invoked when the VideoPlayer clock is synced back to its Video.VideoTimeReference. - - - - - - The clock time that the VideoPlayer follows to schedule its samples. The clock time is expressed in seconds. (Read Only) - - - - - Number of audio tracks that this VideoPlayer will take control of. - - - - - Maximum number of audio tracks that can be controlled. (Read Only) - - - - - Errors such as HTTP connection problems are reported through this callback. - - - - - - Reference time of the external clock the Video.VideoPlayer uses to correct its drift. - - - - - The frame index of the currently available frame in VideoPlayer.texture. - - - - - Number of frames in the current video content. (Read Only) - - - - - [NOT YET IMPLEMENTED] Invoked when the video decoder does not produce a frame as per the time source during playback. - - - - - - The frame rate of the clip or URL in frames/second. (Read Only) - - - - - Invoked when a new frame is ready. - - - - - - The height of the images in the VideoClip, or URL, in pixels. (Read Only) - - - - - Determines whether the VideoPlayer restarts from the beginning when it reaches the end of the clip. - - - - - Whether playback is paused. (Read Only) - - - - - Whether content is being played. (Read Only) - - - - - Whether the VideoPlayer has successfully prepared the content to be played. (Read Only) - - - - - The length of the VideoClip, or the URL, in seconds. (Read Only) - - - - - Invoked when the VideoPlayer reaches the end of the content to play. - - - - - - Denominator of the pixel aspect ratio (num:den) for the VideoClip or the URL. (Read Only) - - - - - Numerator of the pixel aspect ratio (num:den) for the VideoClip or the URL. (Read Only) - - - - - Factor by which the basic playback rate will be multiplied. - - - - - Whether the content will start playing back as soon as the component awakes. - - - - - Invoked when the VideoPlayer preparation is complete. - - - - - - Where the video content will be drawn. - - - - - Invoke after a seek operation completes. - - - - - - Enables the frameReady events. - - - - - Whether the VideoPlayer is allowed to skip frames to catch up with current time. - - - - - The source that the VideoPlayer uses for playback. - - - - - Invoked immediately after Play is called. - - - - - - Camera component to draw to when Video.VideoPlayer.renderMode is set to either Video.VideoRenderMode.CameraFarPlane or Video.VideoRenderMode.CameraNearPlane. - - - - - Type of 3D content contained in the source video media. - - - - - Overall transparency level of the target camera plane video. - - - - - Material texture property which is targeted when Video.VideoPlayer.renderMode is set to Video.VideoTarget.MaterialOverride. - - - - - Renderer which is targeted when Video.VideoPlayer.renderMode is set to Video.VideoTarget.MaterialOverride - - - - - RenderTexture to draw to when Video.VideoPlayer.renderMode is set to Video.VideoTarget.RenderTexture. - - - - - Internal texture in which video content is placed. (Read Only) - - - - - The presentation time of the currently available frame in VideoPlayer.texture. - - - - - The clock that the Video.VideoPlayer observes to detect and correct drift. - - - - - [NOT YET IMPLEMENTED] The source used used by the VideoPlayer to derive its current time. - - - - - The file or HTTP URL that the VideoPlayer reads content from. - - - - - Determines whether the VideoPlayer will wait for the first frame to be loaded into the texture before starting playback when Video.VideoPlayer.playOnAwake is on. - - - - - The width of the images in the VideoClip, or URL, in pixels. (Read Only) - - - - - Enable/disable audio track decoding. Only effective when the VideoPlayer is not currently playing. - - Index of the audio track to enable/disable. - True for enabling the track. False for disabling the track. - - - - Delegate type for VideoPlayer events that contain an error message. - - The VideoPlayer that is emitting the event. - Message describing the error just encountered. - - - - Delegate type for all parameterless events emitted by VideoPlayers. - - The VideoPlayer that is emitting the event. - - - - Delegate type for VideoPlayer events that carry a frame number. - - The VideoPlayer that is emitting the event. - The current frame of the VideoPlayer. - - - - - The number of audio channels in the specified audio track. - - Index for the audio track being queried. - - Number of audio channels. - - - - - Returns the language code, if any, for the specified track. - - Index of the audio track to query. - - Language code. - - - - - Gets the audio track sampling rate in Hertz. - - Index of the audio track to query. - - The sampling rate in Hertz. - - - - - Gets the direct-output audio mute status for the specified track. - - - - - - Return the direct-output volume for specified track. - - Track index for which the volume is queried. - - Volume, between 0 and 1. - - - - - Gets the AudioSource that will receive audio samples for the specified track if Video.VideoPlayer.audioOutputMode is set to Video.VideoAudioOutputMode.AudioSource. - - Index of the audio track for which the AudioSource is wanted. - - The source associated with the audio track. - - - - - Whether decoding for the specified audio track is enabled. See Video.VideoPlayer.EnableAudioTrack for distinction with mute. - - Index of the audio track being queried. - - Returns true if decoding for the specified audio track is enabled. - - - - - Pauses the playback and leaves the current time intact. - - - - - Starts playback. - - - - - Initiates playback engine preparation. - - - - - Set the direct-output audio mute status for the specified track. - - Track index for which the mute is set. - Mute on/off. - - - - Set the direct-output audio volume for the specified track. - - Track index for which the volume is set. - New volume, between 0 and 1. - - - - Sets the AudioSource that will receive audio samples for the specified track if this audio target is selected with Video.VideoPlayer.audioOutputMode. - - Index of the audio track to associate with the specified AudioSource. - AudioSource to associate with the audio track. - - - - Advances the current time by one frame immediately. - - - - - Stops the playback and sets the current time to 0. - - - - - Delegate type for VideoPlayer events that carry a time position. - - The VideoPlayer that is emitting the event. - Time position. - - - - Type of destination for the images read by a VideoPlayer. - - - - - Don't draw the video content anywhere, but still make it available via the VideoPlayer's texture property in the API. - - - - - Draw video content behind a camera's Scene. - - - - - Draw video content in front of a camera's Scene. - - - - - Draw the video content into a user-specified property of the current GameObject's material. - - - - - Draw video content into a RenderTexture. - - - - - Source of the video content for a VideoPlayer. - - - - - Use the current URL as the video content source. - - - - - Use the current clip as the video content source. - - - - - The clock that the Video.VideoPlayer observes to detect and correct drift. - - - - - External reference clock the Video.VideoPlayer observes to detect and correct drift. - - - - - Disables the drift detection. - - - - - Internal reference clock the Video.VideoPlayer observes to detect and correct drift. - - - - - Time source followed by the Video.VideoPlayer when reading content. - - - - - The audio hardware clock. - - - - - The unscaled game time as defined by Time.realtimeSinceStartup. - - - - - This enum describes how the RenderTexture is used as a VR eye texture. Instead of using the values of this enum manually, use the value returned by XR.XRSettings.eyeTextureDesc|eyeTextureDesc or other VR functions returning a RenderTextureDescriptor. - - - - - The texture used by an external XR provider. The provider is responsible for defining the texture's layout and use. - - - - - The RenderTexture is not a VR eye texture. No special rendering behavior will occur. - - - - - This texture corresponds to a single eye on a stereoscopic display. - - - - - This texture corresponds to two eyes on a stereoscopic display. This will be taken into account when using Graphics.Blit and other rendering functions. - - - - - Waits until the end of the frame after Unity has rendererd every Camera and GUI, just before displaying the frame on screen. - - - - - Waits until next fixed frame rate update function. See Also: MonoBehaviour.FixedUpdate. - - - - - Suspends the coroutine execution for the given amount of seconds using scaled time. - - - - - Suspends the coroutine execution for the given amount of seconds using scaled time. - - Delay execution by the amount of time in seconds. - - - - Suspends the coroutine execution for the given amount of seconds using unscaled time. - - - - - The given amount of seconds that the yield instruction will wait for. - - - - - Creates a yield instruction to wait for a given number of seconds using unscaled time. - - - - - - Suspends the coroutine execution until the supplied delegate evaluates to true. - - - - - Initializes a yield instruction with a given delegate to be evaluated. - - Supplied delegate will be evaluated each frame after MonoBehaviour.Update and before MonoBehaviour.LateUpdate until delegate returns true. - - - - Suspends the coroutine execution until the supplied delegate evaluates to false. - - - - - Initializes a yield instruction with a given delegate to be evaluated. - - The supplied delegate will be evaluated each frame after MonoBehaviour.Update and before MonoBehaviour.LateUpdate until delegate returns false. - - - - A structure describing the webcam device. - - - - - Possible WebCamTexture resolutions for this device. - - - - - A string identifier used to create a depth data based WebCamTexture. - - - - - Returns true if the camera supports automatic focusing on points of interest and false otherwise. - - - - - True if camera faces the same direction a screen does, false otherwise. - - - - - Property of type WebCamKind denoting the kind of webcam device. - - - - - A human-readable name of the device. Varies across different systems. - - - - - Enum representing the different types of web camera device. - - - - - Camera which supports synchronized color and depth data (currently these are only dual back and true depth cameras on latest iOS devices). - - - - - A Telephoto camera device. These devices have a longer focal length than a wide-angle camera. - - - - - Ultra wide angle camera. These devices have a shorter focal length than a wide-angle camera. - - - - - Wide angle (default) camera. - - - - - WebCam Textures are textures onto which the live video input is rendered. - - - - - This property allows you to set/get the auto focus point of the camera. This works only on Android and iOS devices. - - - - - Set this to specify the name of the device to use. - - - - - Return a list of available devices. - - - - - Did the video buffer update this frame? - - - - - This property is true if the texture is based on depth data. - - - - - Returns if the camera is currently playing. - - - - - Set the requested frame rate of the camera device (in frames per second). - - - - - Set the requested height of the camera device. - - - - - Set the requested width of the camera device. - - - - - Returns an clockwise angle (in degrees), which can be used to rotate a polygon so camera contents are shown in correct orientation. - - - - - Returns if the texture image is vertically flipped. - - - - - Create a WebCamTexture. - - The name of the video input device to be used. - The requested width of the texture. - The requested height of the texture. - The requested frame rate of the texture. - - - - Create a WebCamTexture. - - The name of the video input device to be used. - The requested width of the texture. - The requested height of the texture. - The requested frame rate of the texture. - - - - Create a WebCamTexture. - - The name of the video input device to be used. - The requested width of the texture. - The requested height of the texture. - The requested frame rate of the texture. - - - - Create a WebCamTexture. - - The name of the video input device to be used. - The requested width of the texture. - The requested height of the texture. - The requested frame rate of the texture. - - - - Create a WebCamTexture. - - The name of the video input device to be used. - The requested width of the texture. - The requested height of the texture. - The requested frame rate of the texture. - - - - Create a WebCamTexture. - - The name of the video input device to be used. - The requested width of the texture. - The requested height of the texture. - The requested frame rate of the texture. - - - - Returns pixel color at coordinates (x, y). - - - - - - - Get a block of pixel colors. - - - - - Get a block of pixel colors. - - - - - - - - - Returns the pixels data in raw format. - - Optional array to receive pixel data. - - - - Returns the pixels data in raw format. - - Optional array to receive pixel data. - - - - Pauses the camera. - - - - - Starts the camera. - - - - - Stops the camera. - - - - - Sets which weights to use when calculating curve segments. - - - - - Include inWeight and outWeight when calculating curve segments. - - - - - Include inWeight when calculating the previous curve segment. - - - - - Exclude both inWeight or outWeight when calculating curve segments. - - - - - Include outWeight when calculating the next curve segment. - - - - - A special collider for vehicle wheels. - - - - - Brake torque expressed in Newton metres. - - - - - The center of the wheel, measured in the object's local space. - - - - - Application point of the suspension and tire forces measured from the base of the resting wheel. - - - - - Properties of tire friction in the direction the wheel is pointing in. - - - - - Indicates whether the wheel currently collides with something (Read Only). - - - - - The mass of the wheel, expressed in kilograms. Must be larger than zero. Typical values would be in range (20,80). - - - - - Motor torque on the wheel axle expressed in Newton metres. Positive or negative depending on direction. - - - - - The radius of the wheel, measured in local space. - - - - - Current wheel axle rotation speed, in rotations per minute (Read Only). - - - - - Properties of tire friction in the sideways direction. - - - - - The mass supported by this WheelCollider. - - - - - Steering angle in degrees, always around the local y-axis. - - - - - Maximum extension distance of wheel suspension, measured in local space. - - - - - Limits the expansion velocity of the Wheel Collider's suspension. If you set this property on a Rigidbody that has several Wheel Colliders, such as a vehicle, then it affects all other Wheel Colliders on the Rigidbody. - - Turns on/off the property - - - - The parameters of wheel's suspension. The suspension attempts to reach a target position by applying a linear force and a damping force. - - - - - The damping rate of the wheel. Must be larger than zero. - - - - - Configure vehicle sub-stepping parameters. - - The speed threshold of the sub-stepping algorithm. - Amount of simulation sub-steps when vehicle's speed is below speedThreshold. - Amount of simulation sub-steps when vehicle's speed is above speedThreshold. - - - - Gets ground collision data for the wheel. - - - - - - Gets the world space pose of the wheel accounting for ground contact, suspension limits, steer angle, and rotation angle (angles in degrees). - - Position of the wheel in world space. - Rotation of the wheel in world space. - - - - Reset the sprung masses of the vehicle. - - - - - WheelFrictionCurve is used by the WheelCollider to describe friction properties of the wheel tire. - - - - - Asymptote point slip (default 2). - - - - - Force at the asymptote slip (default 10000). - - - - - Extremum point slip (default 1). - - - - - Force at the extremum slip (default 20000). - - - - - Multiplier for the extremumValue and asymptoteValue values (default 1). - - - - - Contact information for the wheel, reported by WheelCollider. - - - - - The other Collider the wheel is hitting. - - - - - The magnitude of the force being applied for the contact. - - - - - The direction the wheel is pointing in. - - - - - Tire slip in the rolling direction. Acceleration slip is negative, braking slip is positive. - - - - - The normal at the point of contact. - - - - - The point of contact between the wheel and the ground. - - - - - The sideways direction of the wheel. - - - - - Tire slip in the sideways direction. - - - - - The wheel joint allows the simulation of wheels by providing a constraining suspension motion with an optional motor. - - - - - The current joint angle (in degrees) defined as the relative angle between the two Rigidbody2D that the joint connects to. - - - - - The current joint linear speed in meters/sec. - - - - - The current joint rotational speed in degrees/sec. - - - - - The current joint translation. - - - - - Parameters for a motor force that is applied automatically to the Rigibody2D along the line. - - - - - Set the joint suspension configuration. - - - - - Should a motor force be applied automatically to the Rigidbody2D? - - - - - Gets the motor torque of the joint given the specified timestep. - - The time to calculate the motor torque for. - - - - Exposes useful information related to crash reporting on Windows platforms. - - - - - Returns the path to the crash report folder on Windows. - - - - - Class representing cryptography algorithms. - - - - - Computes MD5 hash value for the specified byte array. - - The input to compute the hash code for. - - - - Computes SHA1 hash value for the specified byte array. - - The input to compute the hash code for. - - - - Exposes static methods for directory operations. - - - - - Returns a path to local folder. - - - - - Returns a path to roaming folder. - - - - - Returns a path to temporary folder. - - - - - Creates directory in the specified path. - - The directory path to create. - - - - Deletes a directory from a specified path. - - The name of the directory to remove. - - - - Determines whether the given path refers to an existing directory. - - The path to test. - - - - Provides static methods for file operations. - - - - - Deletes the specified file. - - The name of the file to be deleted. - - - - Determines whether the specified file exists. - - The file to check. - - - - Opens a binary file, reads the contents of the file into a byte array, and then closes the file. - - The file to open for reading. - - - - Creates a new file, writes the specified byte array to the file, and then closes the file. If the target file already exists, it is overwritten. - - The file to write to. - The bytes to write to the file. - - - - This class provides information regarding application's trial status and allows initiating application purchase. - - - - - Checks whether the application is installed in trial mode. - - - - - Attempts to purchase the app if it is in installed in trial mode. - - - Purchase receipt. - - - - - Used by KeywordRecognizer, GrammarRecognizer, DictationRecognizer. Phrases under the specified minimum level will be ignored. - - - - - High confidence level. - - - - - Low confidence level. - - - - - Medium confidence level. - - - - - Everything is rejected. - - - - - Represents the reason why dictation session has completed. - - - - - Dictation session completion was caused by bad audio quality. - - - - - Dictation session was either cancelled, or the application was paused while dictation session was in progress. - - - - - Dictation session has completed successfully. - - - - - Dictation session has finished because a microphone was not available. - - - - - Dictation session has finished because network connection was not available. - - - - - Dictation session has reached its timeout. - - - - - Dictation session has completed due to an unknown error. - - - - - DictationRecognizer listens to speech input and attempts to determine what phrase was uttered. - - - - - The time length in seconds before dictation recognizer session ends due to lack of audio input. - - - - - Create a DictationRecognizer with the specified minimum confidence and dictation topic constraint. Phrases under the specified minimum level will be ignored. - - The confidence level at which the recognizer will begin accepting phrases. - The dictation topic that this dictation recognizer should optimize its recognition for. - - - - - Create a DictationRecognizer with the specified minimum confidence and dictation topic constraint. Phrases under the specified minimum level will be ignored. - - The confidence level at which the recognizer will begin accepting phrases. - The dictation topic that this dictation recognizer should optimize its recognition for. - - - - - Create a DictationRecognizer with the specified minimum confidence and dictation topic constraint. Phrases under the specified minimum level will be ignored. - - The confidence level at which the recognizer will begin accepting phrases. - The dictation topic that this dictation recognizer should optimize its recognition for. - - - - - Create a DictationRecognizer with the specified minimum confidence and dictation topic constraint. Phrases under the specified minimum level will be ignored. - - The confidence level at which the recognizer will begin accepting phrases. - The dictation topic that this dictation recognizer should optimize its recognition for. - - - - - Event that is triggered when the recognizer session completes. - - Delegate that is to be invoked on DictationComplete event. - - - - Delegate for DictationComplete event. - - The cause of dictation session completion. - - - - Event that is triggered when the recognizer session encouters an error. - - Delegate that is to be invoked on DictationError event. - - - - Delegate for DictationError event. - - The error mesage. - HRESULT code that corresponds to the error. - - - - Event that is triggered when the recognizer changes its hypothesis for the current fragment. - - Delegate to be triggered in the event of a hypothesis changed event. - - - - Callback indicating a hypothesis change event. You should register with DictationHypothesis event. - - The text that the recognizer believes may have been recognized. - - - - Event indicating a phrase has been recognized with the specified confidence level. - - The delegate to be triggered when this event is triggered. - - - - Callback indicating a phrase has been recognized with the specified confidence level. You should register with DictationResult event. - - The recognized text. - The confidence level at which the text was recognized. - - - - Disposes the resources this dictation recognizer uses. - - - - - The time length in seconds before dictation recognizer session ends due to lack of audio input in case there was no audio heard in the current session. - - - - - Starts the dictation recognization session. Dictation recognizer can only be started if PhraseRecognitionSystem is not running. - - - - - Indicates the status of dictation recognizer. - - - - - Stops the dictation recognization session. - - - - - DictationTopicConstraint enum specifies the scenario for which a specific dictation recognizer should optimize. - - - - - Dictation recognizer will optimize for dictation scenario. - - - - - Dictation recognizer will optimize for form-filling scenario. - - - - - Dictation recognizer will optimize for web search scenario. - - - - - The GrammarRecognizer is a complement to the KeywordRecognizer. In many cases developers will find the KeywordRecognizer fills all their development needs. However, in some cases, more complex grammars will be better expressed in the form of an xml file on disk. -The GrammarRecognizer uses Extensible Markup Language (XML) elements and attributes, as specified in the World Wide Web Consortium (W3C) Speech Recognition Grammar Specification (SRGS) Version 1.0. These XML elements and attributes represent the rule structures that define the words or phrases (commands) recognized by speech recognition engines. - - - - - Creates a grammar recognizer using specified file path and minimum confidence. - - Path of the grammar file. - The confidence level at which the recognizer will begin accepting phrases. - - - - Creates a grammar recognizer using specified file path and minimum confidence. - - Path of the grammar file. - The confidence level at which the recognizer will begin accepting phrases. - - - - Returns the grammar file path which was supplied when the grammar recognizer was created. - - - - - KeywordRecognizer listens to speech input and attempts to match uttered phrases to a list of registered keywords. - - - - - Create a KeywordRecognizer which listens to specified keywords with the specified minimum confidence. Phrases under the specified minimum level will be ignored. - - The keywords that the recognizer will listen to. - The minimum confidence level of speech recognition that the recognizer will accept. - - - - Create a KeywordRecognizer which listens to specified keywords with the specified minimum confidence. Phrases under the specified minimum level will be ignored. - - The keywords that the recognizer will listen to. - The minimum confidence level of speech recognition that the recognizer will accept. - - - - Returns the list of keywords which was supplied when the keyword recognizer was created. - - - - - Phrase recognition system is responsible for managing phrase recognizers and dispatching recognition events to them. - - - - - Returns whether speech recognition is supported on the machine that the application is running on. - - - - - Delegate for OnError event. - - Error code for the error that occurred. - - - - Event that gets invoked when phrase recognition system encounters an error. - - Delegate that will be invoked when the event occurs. - - - - Event which occurs when the status of the phrase recognition system changes. - - Delegate that will be invoked when the event occurs. - - - - Attempts to restart the phrase recognition system. - - - - - Shuts phrase recognition system down. - - - - - Returns the current status of the phrase recognition system. - - - - - Delegate for OnStatusChanged event. - - The new status of the phrase recognition system. - - - - Provides information about a phrase recognized event. - - - - - A measure of correct recognition certainty. - - - - - The time it took for the phrase to be uttered. - - - - - The moment in time when uttering of the phrase began. - - - - - A semantic meaning of recognized phrase. - - - - - The text that was recognized. - - - - - A common base class for both keyword recognizer and grammar recognizer. - - - - - Disposes the resources used by phrase recognizer. - - - - - Tells whether the phrase recognizer is listening for phrases. - - - - - Event that gets fired when the phrase recognizer recognizes a phrase. - - Delegate that will be invoked when the event occurs. - - - - Delegate for OnPhraseRecognized event. - - Information about a phrase recognized event. - - - - Makes the phrase recognizer start listening to phrases. - - - - - Stops the phrase recognizer from listening to phrases. - - - - - Semantic meaning is a collection of semantic properties of a recognized phrase. These semantic properties can be specified in SRGS grammar files. - - - - - A key of semantic meaning. - - - - - Values of semantic property that the correspond to the semantic meaning key. - - - - - Represents an error in a speech recognition system. - - - - - Speech recognition engine failed because the audio quality was too low. - - - - - Speech recognition engine failed to compiled specified grammar. - - - - - Speech error occurred because a microphone was not available. - - - - - Speech error occurred due to a network failure. - - - - - No error occurred. - - - - - A speech recognition system has timed out. - - - - - Supplied grammar file language is not supported. - - - - - A speech recognition system has encountered an unknown error. - - - - - Represents the current status of the speech recognition system or a dictation recognizer. - - - - - Speech recognition system has encountered an error and is in an indeterminate state. - - - - - Speech recognition system is running. - - - - - Speech recognition system is stopped. - - - - - When calling PhotoCapture.StartPhotoModeAsync, you must pass in a CameraParameters object that contains the various settings that the web camera will use. - - - - - A valid height resolution for use with the web camera. - - - - - A valid width resolution for use with the web camera. - - - - - The framerate at which to capture video. This is only for use with VideoCapture. - - - - - The opacity of captured holograms. - - - - - The pixel format used to capture and record your image data. - - - - - The encoded image or video pixel format to use for PhotoCapture and VideoCapture. - - - - - 8 bits per channel (blue, green, red, and alpha). - - - - - Encode photo in JPEG format. - - - - - 8-bit Y plane followed by an interleaved U/V plane with 2x2 subsampling. - - - - - Portable Network Graphics Format. - - - - - Captures a photo from the web camera and stores it in memory or on disk. - - - - - Contains the result of the capture request. - - - - - Specifies that the desired operation was successful. - - - - - Specifies that an unknown error occurred. - - - - - Asynchronously creates an instance of a PhotoCapture object that can be used to capture photos. - - Will allow you to capture holograms in your photo. - This callback will be invoked when the PhotoCapture instance is created and ready to be used. - - - - Asynchronously creates an instance of a PhotoCapture object that can be used to capture photos. - - Will allow you to capture holograms in your photo. - This callback will be invoked when the PhotoCapture instance is created and ready to be used. - - - - Dispose must be called to shutdown the PhotoCapture instance. - - - - - Provides a COM pointer to the native IVideoDeviceController. - - - A native COM pointer to the IVideoDeviceController. - - - - - Called when a photo has been saved to the file system. - - Indicates whether or not the photo was successfully saved to the file system. - - - - Called when a photo has been captured to memory. - - Indicates whether or not the photo was successfully captured to memory. - Contains the target texture. If available, the spatial information will be accessible through this structure as well. - - - - Called when a PhotoCapture resource has been created. - - The PhotoCapture instance. - - - - Called when photo mode has been started. - - Indicates whether or not photo mode was successfully activated. - - - - Called when photo mode has been stopped. - - Indicates whether or not photo mode was successfully deactivated. - - - - A data container that contains the result information of a photo capture operation. - - - - - The specific HResult value. - - - - - A generic result that indicates whether or not the PhotoCapture operation succeeded. - - - - - Indicates whether or not the operation was successful. - - - - - Asynchronously starts photo mode. - - The various settings that should be applied to the web camera. - This callback will be invoked once photo mode has been activated. - - - - Asynchronously stops photo mode. - - This callback will be invoked once photo mode has been deactivated. - - - - A list of all the supported device resolutions for taking pictures. - - - - - Asynchronously captures a photo from the web camera and saves it to disk. - - The location where the photo should be saved. The filename must end with a png or jpg file extension. - The encoding format that should be used. - Invoked once the photo has been saved to disk. - Invoked once the photo has been copied to the target texture. - - - - Asynchronously captures a photo from the web camera and saves it to disk. - - The location where the photo should be saved. The filename must end with a png or jpg file extension. - The encoding format that should be used. - Invoked once the photo has been saved to disk. - Invoked once the photo has been copied to the target texture. - - - - Image Encoding Format. - - - - - JPEG Encoding. - - - - - PNG Encoding. - - - - - Contains information captured from the web camera. - - - - - The length of the raw IMFMediaBuffer which contains the image captured. - - - - - Specifies whether or not spatial data was captured. - - - - - The raw image data pixel format. - - - - - Will copy the raw IMFMediaBuffer image data into a byte list. - - The destination byte list to which the raw captured image data will be copied to. - - - - Disposes the PhotoCaptureFrame and any resources it uses. - - - - - Provides a COM pointer to the native IMFMediaBuffer that contains the image data. - - - A native COM pointer to the IMFMediaBuffer which contains the image data. - - - - - This method will return the camera to world matrix at the time the photo was captured if location data if available. - - A matrix to be populated by the Camera to world Matrix. - - True if a valid matrix is returned or false otherwise. This will be false if the frame has no location data. - - - - - This method will return the projection matrix at the time the photo was captured if location data if available. - - The near clip plane distance. - The far clip plane distance. - A matrix to be populated by the Projection Matrix. - - True if a valid matrix is returned or false otherwise. This will be false if the frame has no location data. - - - - - This method will return the projection matrix at the time the photo was captured if location data if available. - - The near clip plane distance. - The far clip plane distance. - A matrix to be populated by the Projection Matrix. - - True if a valid matrix is returned or false otherwise. This will be false if the frame has no location data. - - - - - This method will copy the captured image data into a user supplied texture for use in Unity. - - The target texture that the captured image data will be copied to. - - - - Records a video from the web camera directly to disk. - - - - - Specifies what audio sources should be recorded while recording the video. - - - - - Include both the application audio as well as the mic audio in the video recording. - - - - - Only include the application audio in the video recording. - - - - - Only include the mic audio in the video recording. - - - - - Do not include any audio in the video recording. - - - - - Contains the result of the capture request. - - - - - Specifies that the desired operation was successful. - - - - - Specifies that an unknown error occurred. - - - - - Asynchronously creates an instance of a VideoCapture object that can be used to record videos from the web camera to disk. - - Allows capturing holograms in your video. -Note: Capturing holograms is currently disabled and this parameter is ignored. - This callback will be invoked when the VideoCapture instance is created and ready to be used. - - - - Asynchronously creates an instance of a VideoCapture object that can be used to record videos from the web camera to disk. - - Allows capturing holograms in your video. -Note: Capturing holograms is currently disabled and this parameter is ignored. - This callback will be invoked when the VideoCapture instance is created and ready to be used. - - - - You must call Dispose to shutdown the VideoCapture instance and release the native WinRT objects. - - - - - Returns the supported frame rates at which a video can be recorded given a resolution. - - A recording resolution. - - The frame rates at which the video can be recorded. - - - - - Provides a COM pointer to the native IVideoDeviceController. - - - A native COM pointer to the IVideoDeviceController. - - - - - Indicates whether or not the VideoCapture instance is currently recording video. - - - - - Called when the web camera begins recording the video. - - Indicates whether or not video recording started successfully. - - - - Called when the video recording has been saved to the file system. - - Indicates whether or not video recording was saved successfully to the file system. - - - - Called when a VideoCapture resource has been created. - - The VideoCapture instance. - - - - Called when video mode has been started. - - Indicates whether or not video mode was successfully activated. - - - - Called when video mode has been stopped. - - Indicates whether or not video mode was successfully deactivated. - - - - Asynchronously records a video from the web camera to the file system. - - The name of the video to be recorded to. - Invoked as soon as the video recording begins. - - - - Asynchronously starts video mode. - - The various settings that should be applied to the web camera. - Indicates how audio should be recorded. - This callback will be invoked once video mode has been activated. - - - - Asynchronously stops recording a video from the web camera to the file system. - - Invoked as soon as video recording has finished. - - - - Asynchronously stops video mode. - - This callback will be invoked once video mode has been deactivated. - - - - A list of all the supported device resolutions for recording videos. - - - - - A data container that contains the result information of a video recording operation. - - - - - The specific Windows HRESULT code. - - - - - A generic result that indicates whether or not the VideoCapture operation succeeded. - - - - - Indicates whether or not the operation was successful. - - - - - Contains general information about the current state of the web camera. - - - - - Specifies what mode the Web Camera is currently in. - - - - - Describes the active mode of the Web Camera resource. - - - - - Resource is not in use. - - - - - Resource is in Photo Mode. - - - - - Resource is in Video Mode. - - - - - Wind Zones add realism to the trees you create by making them wave their branches and leaves as if blown by the wind. - - - - - Defines the type of wind zone to be used (Spherical or Directional). - - - - - Radius of the Spherical Wind Zone (only active if the WindZoneMode is set to Spherical). - - - - - The primary wind force. - - - - - Defines the frequency of the wind changes. - - - - - Defines how much the wind changes over time. - - - - - The turbulence wind force. - - - - - The constructor. - - - - - Modes a Wind Zone can have, either Spherical or Directional. - - - - - Wind zone affects the entire Scene in one direction. - - - - - Wind zone only has an effect inside the radius, and has a falloff from the center towards the edge. - - - - - Determines how time is treated outside of the keyframed range of an AnimationClip or AnimationCurve. - - - - - Plays back the animation. When it reaches the end, it will keep playing the last frame and never stop playing. - - - - - Reads the default repeat mode set higher up. - - - - - When time reaches the end of the animation clip, time will continue at the beginning. - - - - - When time reaches the end of the animation clip, the clip will automatically stop playing and time will be reset to beginning of the clip. - - - - - When time reaches the end of the animation clip, time will ping pong back between beginning and end. - - - - - Delegate that can be invoked on specific thread. - - - - - Provides essential methods related to Window Store application. - - - - - Advertising ID. - - - - - Arguments passed to application. - - - - - Fired when application window is activated. - - - - - - Fired when window size changes. - - - - - - Executes callback item on application thread. - - Item to execute. - Wait until item is executed. - - - - Executes callback item on UI thread. - - Item to execute. - Wait until item is executed. - - - - Returns true if you're running on application thread. - - - - - Returns true if you're running on UI thread. - - - - - Cursor API for Windows Store Apps. - - - - - Set a custom cursor. - - The cursor resource id. - - - - List of accessible folders on Windows Store Apps. - - - - - Class which is capable of launching user's default app for file type or a protocol. See also PlayerSettings where you can specify file or URI associations. - - - - - Launches the default app associated with specified file. - - Folder type where the file is located. - Relative file path inside the specified folder. - Shows user a warning that application will be switched. - - - - Opens a dialog for picking the file. - - File extension. - - - - Starts the default app associated with the URI scheme name for the specified URI, using the specified options. - - The URI. - Displays a warning that the URI is potentially unsafe. - - - - Defines the default look of secondary tile. - - - - - - Arguments to be passed for application when secondary tile is activated. - - - - - Defines background color for secondary tile. - - - - - - Defines, whether backgroundColor should be used. - - - - - - Display name for secondary tile. - - - - - - Defines the style for foreground text on a secondary tile. - - - - - - Uri to logo, shown for secondary tile on lock screen. - - - - - - Whether to show secondary tile on lock screen. - - - - - - Phonetic name for secondary tile. - - - - - - Defines whether secondary tile is copied to another device when application is installed by the same users account. - - - - - - Defines whether the displayName should be shown on a medium secondary tile. - - - - - - Defines whether the displayName should be shown on a large secondary tile. - - - - - - Defines whether the displayName should be shown on a wide secondary tile. - - - - - - Uri to the logo for medium size tile. - - - - - Uri to the logo shown on tile - - - - - - Uri to the logo for large size tile. - - - - - - Uri to the logo for small size tile. - - - - - - Unique identifier within application for a secondary tile. - - - - - - Uri to the logo for wide tile. - - - - - Constructor for SecondaryTileData, sets default values for all members. - - Unique identifier for secondary tile. - A display name for a tile. - - - - Represents tile on Windows start screen - - - - - - Whether secondary tile is pinned to start screen. - - - - - - Whether secondary tile was approved (pinned to start screen) or rejected by user. - - - - - - A unique string, identifying secondary tile - - - - - Returns applications main tile - - - - - - Creates new or updates existing secondary tile. - - The data used to create or update secondary tile. - The coordinates for a request to create new tile. - The area on the screen above which the request to create new tile will be displayed. - - New Tile object, that can be used for further work with the tile. - - - - - Creates new or updates existing secondary tile. - - The data used to create or update secondary tile. - The coordinates for a request to create new tile. - The area on the screen above which the request to create new tile will be displayed. - - New Tile object, that can be used for further work with the tile. - - - - - Creates new or updates existing secondary tile. - - The data used to create or update secondary tile. - The coordinates for a request to create new tile. - The area on the screen above which the request to create new tile will be displayed. - - New Tile object, that can be used for further work with the tile. - - - - - Show a request to unpin secondary tile from start screen. - - The coordinates for a request to unpin tile. - The area on the screen above which the request to unpin tile will be displayed. - - - - Show a request to unpin secondary tile from start screen. - - The coordinates for a request to unpin tile. - The area on the screen above which the request to unpin tile will be displayed. - - - - Show a request to unpin secondary tile from start screen. - - The coordinates for a request to unpin tile. - The area on the screen above which the request to unpin tile will be displayed. - - - - Show a request to unpin secondary tile from start screen. - - An identifier for secondary tile. - The coordinates for a request to unpin tile. - The area on the screen above which the request to unpin tile will be displayed. - - - - Show a request to unpin secondary tile from start screen. - - An identifier for secondary tile. - The coordinates for a request to unpin tile. - The area on the screen above which the request to unpin tile will be displayed. - - - - Show a request to unpin secondary tile from start screen. - - An identifier for secondary tile. - The coordinates for a request to unpin tile. - The area on the screen above which the request to unpin tile will be displayed. - - - - Whether secondary tile is pinned to start screen. - - An identifier for secondary tile. - - - - Gets all secondary tiles. - - - An array of Tile objects. - - - - - Returns the secondary tile, identified by tile id. - - A tile identifier. - - A Tile object or null if secondary tile does not exist (not pinned to start screen and user request is complete). - - - - - Get template XML for tile notification. - - A template identifier. - - String, which is an empty XML document to be filled and used for tile notification. - - - - - Starts periodic update of a badge on a tile. - - - A remote location from where to retrieve tile update - A time interval in minutes, will be rounded to a value, supported by the system - - - - Starts periodic update of a tile. - - - a remote location fromwhere to retrieve tile update - a time interval in minutes, will be rounded to a value, supported by the system - - - - Remove badge from tile. - - - - - Stops previously started periodic update of a tile. - - - - - Stops previously started periodic update of a tile. - - - - - Send a notification for tile (update tiles look). - - A string containing XML document for new tile look. - An uri to 150x150 image, shown on medium tile. - An uri to a 310x150 image to be shown on a wide tile (if such issupported). - An uri to a 310x310 image to be shown on a large tile (if such is supported). - A text to shown on a tile. - - - - Send a notification for tile (update tiles look). - - A string containing XML document for new tile look. - An uri to 150x150 image, shown on medium tile. - An uri to a 310x150 image to be shown on a wide tile (if such issupported). - An uri to a 310x310 image to be shown on a large tile (if such is supported). - A text to shown on a tile. - - - - Sets or updates badge on a tile to an image. - - Image identifier. - - - - Set or update a badge on a tile to a number. - - Number to be shown on a badge. - - - - Style for foreground text on a secondary tile. - - - - - Templates for various tile styles. - - - - - - Represents a toast notification in Windows Store Apps. - - - - - - true if toast was activated by user. - - - - - Arguments to be passed for application when toast notification is activated. - - - - - true if toast notification was dismissed (for any reason). - - - - - true if toast notification was explicitly dismissed by user. - - - - - Create toast notification. - - XML document with tile data. - Uri to image to show on a toast, can be empty, in that case text-only notification will be shown. - A text to display on a toast notification. - - A toast object for further work with created notification or null, if creation of toast failed. - - - - - Create toast notification. - - XML document with tile data. - Uri to image to show on a toast, can be empty, in that case text-only notification will be shown. - A text to display on a toast notification. - - A toast object for further work with created notification or null, if creation of toast failed. - - - - - Get template XML for toast notification. - - - A template identifier. - - string, which is an empty XML document to be filled and used for toast notification. - - - - - Hide displayed toast notification. - - - - - Show toast notification. - - - - - Templates for various toast styles. - - - - - - This event occurs when window completes activation or deactivation, it also fires up when you snap and unsnap the application. - - - - - - Specifies the set of reasons that a windowActivated event was raised. - - - - - The window was activated. - - - - - The window was deactivated. - - - - - The window was activated by pointer interaction. - - - - - This event occurs when window rendering size changes. - - - - - - - Simple access to web pages. - - - - - Streams an AssetBundle that can contain any kind of asset from the project folder. - - - - - Returns a AudioClip generated from the downloaded data (Read Only). - - - - - Returns the contents of the fetched web page as a byte array (Read Only). - - - - - The number of bytes downloaded by this WWW query (read only). - - - - - Returns an error message if there was an error during the download (Read Only). - - - - - Is the download already finished? (Read Only) - - - - - MovieTexture has been removed. Use VideoPlayer instead. - - - - - Load an Ogg Vorbis file into the audio clip. - - - - - How far has the download progressed (Read Only). - - - - - Dictionary of headers returned by the request. - - - - - Returns the contents of the fetched web page as a string (Read Only). - - - - - Returns a Texture2D generated from the downloaded data (Read Only). - - - - - Returns a non-readable Texture2D generated from the downloaded data (Read Only). - - - - - Obsolete, has no effect. - - - - - How far has the upload progressed (Read Only). - - - - - The URL of this WWW request (Read Only). - - - - - Creates a WWW request with the given URL. - - The url to download. Must be '%' escaped. - - A new WWW object. When it has been downloaded, the results can be fetched from the returned object. - - - - - Creates a WWW request with the given URL. - - The url to download. Must be '%' escaped. - A WWWForm instance containing the form data to post. - - A new WWW object. When it has been downloaded, the results can be fetched from the returned object. - - - - - Creates a WWW request with the given URL. - - The url to download. Must be '%' escaped. - A byte array of data to be posted to the url. - - A new WWW object. When it has been downloaded, the results can be fetched from the returned object. - - - - - Creates a WWW request with the given URL. - - The url to download. Must be '%' escaped. - A byte array of data to be posted to the url. - A hash table of custom headers to send with the request. - - A new WWW object. When it has been downloaded, the results can be fetched from the returned object. - - - - - Creates a WWW request with the given URL. - - The url to download. Must be '%' escaped. - A byte array of data to be posted to the url. - A dictionary that contains the header keys and values to pass to the server. - - A new WWW object. When it has been downloaded, the results can be fetched from the returned object. - - - - - Disposes of an existing WWW object. - - - - - Escapes characters in a string to ensure they are URL-friendly. - - A string with characters to be escaped. - The text encoding to use. - - - - Escapes characters in a string to ensure they are URL-friendly. - - A string with characters to be escaped. - The text encoding to use. - - - - OBSOLETE. Use UnityWebRequestMultimedia.GetAudioClip(). - - - - - - - - OBSOLETE. Use UnityWebRequestMultimedia.GetAudioClip(). - - - - - - - - OBSOLETE. Use UnityWebRequestMultimedia.GetAudioClip(). - - - - - - - - OBSOLETE. Use UnityWebRequestMultimedia.GetAudioClip(). - - - - - - - - OBSOLETE. Use UnityWebRequestMultimedia.GetAudioClip(). - - - - - - - OBSOLETE. Use UnityWebRequestMultimedia.GetAudioClip(). - - - - - - - OBSOLETE. Use UnityWebRequestMultimedia.GetAudioClip(). - - - - - - - MovieTexture has been removed. Use VideoPlayer instead. - - - - - Loads an AssetBundle with the specified version number from the cache. If the AssetBundle is not currently cached, it will automatically be downloaded and stored in the cache for future retrieval from local storage. - - The URL to download the AssetBundle from, if it is not present in the cache. Must be '%' escaped. - Version of the AssetBundle. The file will only be loaded from the disk cache if it has previously been downloaded with the same version parameter. By incrementing the version number requested by your application, you can force Caching to download a new copy of the AssetBundle from url. - Hash128 which is used as the version of the AssetBundle. - A structure used to download a given version of AssetBundle to a customized cache path. - -Analogous to the cachedAssetBundle parameter for UnityWebRequestAssetBundle.GetAssetBundle.</param> - An optional CRC-32 Checksum of the uncompressed contents. If this is non-zero, then the content will be compared against the checksum before loading it, and give an error if it does not match. You can use this to avoid data corruption from bad downloads or users tampering with the cached files on disk. If the CRC does not match, Unity will try to redownload the data, and if the CRC on the server does not match it will fail with an error. Look at the error string returned to see the correct CRC value to use for an AssetBundle. - - A WWW instance, which can be used to access the data once the load/download operation is completed. - - - - - Loads an AssetBundle with the specified version number from the cache. If the AssetBundle is not currently cached, it will automatically be downloaded and stored in the cache for future retrieval from local storage. - - The URL to download the AssetBundle from, if it is not present in the cache. Must be '%' escaped. - Version of the AssetBundle. The file will only be loaded from the disk cache if it has previously been downloaded with the same version parameter. By incrementing the version number requested by your application, you can force Caching to download a new copy of the AssetBundle from url. - Hash128 which is used as the version of the AssetBundle. - A structure used to download a given version of AssetBundle to a customized cache path. - -Analogous to the cachedAssetBundle parameter for UnityWebRequestAssetBundle.GetAssetBundle.</param> - An optional CRC-32 Checksum of the uncompressed contents. If this is non-zero, then the content will be compared against the checksum before loading it, and give an error if it does not match. You can use this to avoid data corruption from bad downloads or users tampering with the cached files on disk. If the CRC does not match, Unity will try to redownload the data, and if the CRC on the server does not match it will fail with an error. Look at the error string returned to see the correct CRC value to use for an AssetBundle. - - A WWW instance, which can be used to access the data once the load/download operation is completed. - - - - - Loads an AssetBundle with the specified version number from the cache. If the AssetBundle is not currently cached, it will automatically be downloaded and stored in the cache for future retrieval from local storage. - - The URL to download the AssetBundle from, if it is not present in the cache. Must be '%' escaped. - Version of the AssetBundle. The file will only be loaded from the disk cache if it has previously been downloaded with the same version parameter. By incrementing the version number requested by your application, you can force Caching to download a new copy of the AssetBundle from url. - Hash128 which is used as the version of the AssetBundle. - A structure used to download a given version of AssetBundle to a customized cache path. - -Analogous to the cachedAssetBundle parameter for UnityWebRequestAssetBundle.GetAssetBundle.</param> - An optional CRC-32 Checksum of the uncompressed contents. If this is non-zero, then the content will be compared against the checksum before loading it, and give an error if it does not match. You can use this to avoid data corruption from bad downloads or users tampering with the cached files on disk. If the CRC does not match, Unity will try to redownload the data, and if the CRC on the server does not match it will fail with an error. Look at the error string returned to see the correct CRC value to use for an AssetBundle. - - A WWW instance, which can be used to access the data once the load/download operation is completed. - - - - - Loads an AssetBundle with the specified version number from the cache. If the AssetBundle is not currently cached, it will automatically be downloaded and stored in the cache for future retrieval from local storage. - - The URL to download the AssetBundle from, if it is not present in the cache. Must be '%' escaped. - Version of the AssetBundle. The file will only be loaded from the disk cache if it has previously been downloaded with the same version parameter. By incrementing the version number requested by your application, you can force Caching to download a new copy of the AssetBundle from url. - Hash128 which is used as the version of the AssetBundle. - A structure used to download a given version of AssetBundle to a customized cache path. - -Analogous to the cachedAssetBundle parameter for UnityWebRequestAssetBundle.GetAssetBundle.</param> - An optional CRC-32 Checksum of the uncompressed contents. If this is non-zero, then the content will be compared against the checksum before loading it, and give an error if it does not match. You can use this to avoid data corruption from bad downloads or users tampering with the cached files on disk. If the CRC does not match, Unity will try to redownload the data, and if the CRC on the server does not match it will fail with an error. Look at the error string returned to see the correct CRC value to use for an AssetBundle. - - A WWW instance, which can be used to access the data once the load/download operation is completed. - - - - - Replaces the contents of an existing Texture2D with an image from the downloaded data. - - An existing texture object to be overwritten with the image data. - - - - - Converts URL-friendly escape sequences back to normal text. - - A string containing escaped characters. - The text encoding to use. - - - - Converts URL-friendly escape sequences back to normal text. - - A string containing escaped characters. - The text encoding to use. - - - - Helper class to generate form data to post to web servers using the UnityWebRequest or WWW classes. - - - - - (Read Only) The raw data to pass as the POST request body when sending the form. - - - - - (Read Only) Returns the correct request headers for posting the form using the WWW class. - - - - - Add binary data to the form. - - - - - - - - - Add binary data to the form. - - - - - - - - - Add binary data to the form. - - - - - - - - - Add a simple field to the form. - - - - - - - - Add a simple field to the form. - - - - - - - - Adds a simple field to the form. - - - - - - - Creates an empty WWWForm object. - - - - - A tracked bone on the device at an XR.XRNode in the XR input subsystem. - - - - - Get the child bones of this bone. - - A list of bones that will be filled out with the children bones of this bone. - - true if bone can be queried for child bones; otherwise false. - - - - - Gets the parent of this bone. - - Bone struct that receives the parent bone of this bone. - - true if the rotation was retrieved, false otherwise. - - - - - Gets the world position of the bone - - Vector3 to receive the position of the bone in Unity world space. - - true if the rotation was retrieved, false otherwise. - - - - - Gets the world rotation of the bone. - - Quaternion to receive the rotation of the bone in Unity world space. - - true if the rotation was retrieved, false otherwise. - - - - - Defines static variables that are used to retrieve input features from XR.InputDevice.TryGetFeatureValue. - - - - - Value representing the current battery life of this device. - - - - - The acceleration of the center eye on this device. - - - - - The angular acceleration of the center eye on this device, formatted as euler angles. - - - - - The angular velocity of the center eye on this device, formatted as euler angles. - - - - - The position of the center eye on this device. - - - - - The rotation of the center eye on this device. - - - - - The velocity of the center eye on this device. - - - - - The acceleration of the color camera on this device. - - - - - The angular acceleration of the color camera on this device, formatted as euler angles. - - - - - The angular velocity of the color camera on this device, formatted as euler angles. - - - - - The position of the color camera on this device. - - - - - The rotation of the color camera on this device. - - - - - The velocity of the color camera on this device. - - - - - The acceleration of the device. - - - - - The angular acceleration of this device, formatted as euler angles. - - - - - The angular velocity of this device, formatted as euler angles. - - - - - The position of the device. - - - - - The rotation of this device. - - - - - The velocity of the device. - - - - - A non-handed 2D axis. - - - - - An Eyes struct containing eye tracking data collected from the device. - - - - - Represents the users grip on the controller. - - - - - A binary measure of whether the device is being gripped. - - - - - Value representing the hand data for this device. - - - - - Represents the grip pressure or angle of the index finger. - - - - - Represents a touch of the trigger or index finger. - - - - - Informs to the developer whether the device is currently being tracked. - - - - - The acceleration of the left eye on this device. - - - - - The angular acceleration of the left eye on this device, formatted as euler angles. - - - - - The angular velocity of the left eye on this device, formatted as euler angles. - - - - - The position of the left eye on this device. - - - - - The rotation of the left eye on this device. - - - - - The velocity of the left eye on this device. - - - - - Represents a menu button, used to pause, go back, or otherwise exit gameplay. - - - - - Represents the grip pressure or angle of the middle finger. - - - - - Represents the grip pressure or angle of the pinky finger. - - - - - The primary touchpad or joystick on a device. - - - - - Represents the primary 2D axis being clicked or otherwise depressed. - - - - - Represents the primary 2D axis being touched. - - - - - The primary face button being pressed on a device, or sole button if only one is available. - - - - - The primary face button being touched on a device. - - - - - The acceleration of the right eye on this device. - - - - - The angular acceleration of the right eye on this device, formatted as euler angles. - - - - - The angular velocity of the right eye on this device, formatted as euler angles. - - - - - The position of the right eye on this device. - - - - - The rotation of the right eye on this device. - - - - - The velocity of the right eye on this device. - - - - - Represents the grip pressure or angle of the ring finger. - - - - - A secondary touchpad or joystick on a device. - - - - - Represents the secondary 2D axis being clicked or otherwise depressed. - - - - - Represents the secondary 2D axis being touched. - - - - - The secondary face button being pressed on a device. - - - - - The secondary face button being touched on a device. - - - - - Represents a thumbrest or light thumb touch. - - - - - Represents the thumb pressing any input or feature. - - - - - Represents the values being tracked for this device. - - - - - A trigger-like control, pressed with the index finger. - - - - - A binary measure of whether the index finger is activating the trigger. - - - - - Use this property to test whether the user is currently wearing and/or interacting with the XR device. The exact behavior of this property varies with each type of device: some devices have a sensor specifically to detect user proximity, however you can reasonably infer that a user is present with the device when the property is UserPresenceState.Present. - - - - - Contains eye tracking data from the device at an XR.XRNode in the XR input subsystem. - - - - - Gets the point represents the convergence of the line of sight for both eyes. - - A Vector3 struct that is filled in with the fixation position. - - true if eyes can be queried for the fixation point; otherwise false. - - - - - Gets a value that represents the how far the left eye is open. - - A float value, with a range of 0.0 to 1.0, that indicates how open the left eye is. A value of 0.0 indicates that the eye is fully closed, while a value of 1.0 indicates that the eye is fully open. - - - true if eyes can be queried for the amount that the left eye is open; otherwise false. - - - - - Gets the Vector3 that describes the position of the left eye. - - A Vector3 struct to receive the left eye position. - - - true if eyes can be queried for the left eye position; otherwise false. - - - - - Gets the Quaternion that describes the rotation of the left eye. - - A Quaternion struct to receive the left eye rotation. - - - true if eyes can be queried for the left eye rotation; otherwise false. - - - - - Gets a value that represents the how far the right eye is open. - - A float value, with a range of 0.0 to 1.0, that indicates how open the right eye is. A value of 0.0 indicates that the eye is fully closed, while a value of 1.0 indicates that the eye is fully open. - - - true if eyes can be queried for the amount that the right eye is open; otherwise false. - - - - - Gets the Vector3 that describes the position of the right eye. - - A Vector3 struct to receive the right eye position. - - - true if eyes can be queried for the right eye position; otherwise false. - - - - - Gets the Quaternion that describes the rotation of the right eye. - - A Quaternion struct to receive the right eye rotation. - - - true if eyes can be queried for the right eye rotation; otherwise false. - - - - - Enumeration of available modes for XR rendering in the Game view or in the main window on a host PC. XR rendering only occurs when the Unity Editor is in Play Mode. - - - - - Renders both eyes of the XR device side-by-side in the Game view or in the main window on a host PC. - - - - - Renders the left eye of the XR device in the Game View window or in main window on a host PC. - - - - - Disables rendering of any eyes in the Game view or in the main window on a host PC. - - - - - Renders both eyes of the XR device, and the occlusion mesh, side-by-side in the Game view or in the main window on a host PC. - - - - - Renders the right eye of the XR device in the Game View window or in main window on a host PC. - - - - - A tracked hand on the device at an XR.XRNode in the XR input subsystem. - - - - - Gets a list of the finger bones for a finger on this hand. - - HandFinger enum value for this finger. - A list of bones that will be filled out for this finger. - - true if hand can be queried for this finger; otherwise false. - - - - - Gets the root bone for this hand. - - A Bone struct to receive the root bone. - - true if hand can be queried for the root bone; otherwise false. - - - - - Enumeration describing the AR rendering mode used with XR.Hand. - - - - - Index finger on a hand. - - - - - Middle finger on a hand. - - - - - Pinky finger on a hand. - - - - - Ring finger on a hand. - - - - - Thumb finger on a hand. - - - - - Describes the haptic capabilities of the device at an XR.XRNode in the XR input subsystem. - - - - - The frequency (in Hz) that this device plays back buffered haptic data. - - - - - The maximum amount of data that can be sent to an InputDevice via InputDevice.SendHapticBuffer. - - - - - The optimal buffer size an InputDevice expects to be sent via InputDevice.SendHapticBuffer in order to provide a continuous rumble between individual frames. - - - - - The number of channels that this device plays back haptic data. - - - - - True if this device supports sending a haptic buffer. - - - - - True if this device supports sending a haptic impulse. - - - - - Defines an input device in the XR input subsystem. - - - - - Read Only. A bitmask of enumerated flags describing the characteristics of this InputDevice. - - - - - Read Only. True if the device is currently a valid input device; otherwise false. - - - - - The manufacturer of the connected Input Device. - - - - - Read Only. The name of the device in the XR system. This is a platform provided unique identifier for the device. - - - - - Read Only. The InputDeviceRole of the device in the XR system. This is a platform provided description of how the device is used. - - - - - The serial number of the connected Input Device. Blank if no serial number is available. - - - - - Gets the XRInputSubsystem that reported this InputDevice. - - - - - Sends a raw buffer of haptic data to the device. - - The channel to receive the data. - A raw byte buffer that contains the haptic data to send to the device. - - Returns true if successful. Returns false otherwise. - - - - - Sends a haptic impulse to a device. - - The channel to receive the impulse. - The normalized (0.0 to 1.0) amplitude value of the haptic impulse to play on the device. - The duration in seconds that the haptic impulse will play. Only supported on Oculus. - - Returns true if successful. Returns false otherwise. - - - - - Stop all haptic playback for a device. - - - - - Gets a list of all the input feature usages available on this device. For example, "Trigger" or "Device Position". - - A List of InputFeatureUsage structures to receive the available features on this device. - - true if device can be queried; otherwise false. - - - - - Retrieves information about the input feature specified by the Usage parameter. Those functions which take a time parameter allow querying for that feature at a particular point in time - - Usage that describes the feature to retrieve. - A DateTime struct with the local time at which to query for data. - A variable of the appropriate type to receive the information about the feature. - - True if the feature information is retrieved; otherwise false. - - - - - Retrieves information about the input feature specified by the Usage parameter. Those functions which take a time parameter allow querying for that feature at a particular point in time - - Usage that describes the feature to retrieve. - A DateTime struct with the local time at which to query for data. - A variable of the appropriate type to receive the information about the feature. - - True if the feature information is retrieved; otherwise false. - - - - - Retrieves information about the input feature specified by the Usage parameter. Those functions which take a time parameter allow querying for that feature at a particular point in time - - Usage that describes the feature to retrieve. - A DateTime struct with the local time at which to query for data. - A variable of the appropriate type to receive the information about the feature. - - True if the feature information is retrieved; otherwise false. - - - - - Retrieves information about the input feature specified by the Usage parameter. Those functions which take a time parameter allow querying for that feature at a particular point in time - - Usage that describes the feature to retrieve. - A DateTime struct with the local time at which to query for data. - A variable of the appropriate type to receive the information about the feature. - - True if the feature information is retrieved; otherwise false. - - - - - Retrieves information about the input feature specified by the Usage parameter. Those functions which take a time parameter allow querying for that feature at a particular point in time - - Usage that describes the feature to retrieve. - A DateTime struct with the local time at which to query for data. - A variable of the appropriate type to receive the information about the feature. - - True if the feature information is retrieved; otherwise false. - - - - - Retrieves information about the input feature specified by the Usage parameter. Those functions which take a time parameter allow querying for that feature at a particular point in time - - Usage that describes the feature to retrieve. - A DateTime struct with the local time at which to query for data. - A variable of the appropriate type to receive the information about the feature. - - True if the feature information is retrieved; otherwise false. - - - - - Retrieves information about the input feature specified by the Usage parameter. Those functions which take a time parameter allow querying for that feature at a particular point in time - - Usage that describes the feature to retrieve. - A DateTime struct with the local time at which to query for data. - A variable of the appropriate type to receive the information about the feature. - - True if the feature information is retrieved; otherwise false. - - - - - Retrieves information about the input feature specified by the Usage parameter. Those functions which take a time parameter allow querying for that feature at a particular point in time - - Usage that describes the feature to retrieve. - A DateTime struct with the local time at which to query for data. - A variable of the appropriate type to receive the information about the feature. - - True if the feature information is retrieved; otherwise false. - - - - - Retrieves information about the input feature specified by the Usage parameter. Those functions which take a time parameter allow querying for that feature at a particular point in time - - Usage that describes the feature to retrieve. - A DateTime struct with the local time at which to query for data. - A variable of the appropriate type to receive the information about the feature. - - True if the feature information is retrieved; otherwise false. - - - - - Retrieves information about the input feature specified by the Usage parameter. Those functions which take a time parameter allow querying for that feature at a particular point in time - - Usage that describes the feature to retrieve. - A DateTime struct with the local time at which to query for data. - A variable of the appropriate type to receive the information about the feature. - - True if the feature information is retrieved; otherwise false. - - - - - Retrieves information about the input feature specified by the Usage parameter. Those functions which take a time parameter allow querying for that feature at a particular point in time - - Usage that describes the feature to retrieve. - A DateTime struct with the local time at which to query for data. - A variable of the appropriate type to receive the information about the feature. - - True if the feature information is retrieved; otherwise false. - - - - - Retrieves information about the input feature specified by the Usage parameter. Those functions which take a time parameter allow querying for that feature at a particular point in time - - Usage that describes the feature to retrieve. - A DateTime struct with the local time at which to query for data. - A variable of the appropriate type to receive the information about the feature. - - True if the feature information is retrieved; otherwise false. - - - - - Retrieves information about the input feature specified by the Usage parameter. Those functions which take a time parameter allow querying for that feature at a particular point in time - - Usage that describes the feature to retrieve. - A DateTime struct with the local time at which to query for data. - A variable of the appropriate type to receive the information about the feature. - - True if the feature information is retrieved; otherwise false. - - - - - Retrieves information about the input feature specified by the Usage parameter. Those functions which take a time parameter allow querying for that feature at a particular point in time - - Usage that describes the feature to retrieve. - A DateTime struct with the local time at which to query for data. - A variable of the appropriate type to receive the information about the feature. - - True if the feature information is retrieved; otherwise false. - - - - - Retrieves information about the input feature specified by the Usage parameter. Those functions which take a time parameter allow querying for that feature at a particular point in time - - Usage that describes the feature to retrieve. - A DateTime struct with the local time at which to query for data. - A variable of the appropriate type to receive the information about the feature. - - True if the feature information is retrieved; otherwise false. - - - - - Retrieves information about the input feature specified by the Usage parameter. Those functions which take a time parameter allow querying for that feature at a particular point in time - - Usage that describes the feature to retrieve. - A DateTime struct with the local time at which to query for data. - A variable of the appropriate type to receive the information about the feature. - - True if the feature information is retrieved; otherwise false. - - - - - Retrieves information about the input feature specified by the Usage parameter. Those functions which take a time parameter allow querying for that feature at a particular point in time - - Usage that describes the feature to retrieve. - A DateTime struct with the local time at which to query for data. - A variable of the appropriate type to receive the information about the feature. - - True if the feature information is retrieved; otherwise false. - - - - - Gets the haptic capabilities of the device. - - A HapticCapabilities struct to receive the capabilities of this device. - - Returns true if the device supports any form of haptics. Returns false otherwise. - - - - - A set of bit flags describing XR.InputDevice characteristics. - - - - - The InputDevice has a camera and associated camera tracking information. - - - - - The InputDevice is a game controller. - - - - - The InputDevice provides eye tracking information via an Eyes input feature. - - - - - The InputDevice provides hand tracking information via a Hand input feature. - - - - - The InputDevice is attached to the head. - - - - - The InputDevice is held in the user's hand. Typically, a tracked controller. - - - - - The InputDevice is associated with the left side of the user. - - - - - A default value specifying no flags. - - - - - The InputDevice is associated with the right side of the user. - - - - - The InputDevice reports software approximated, positional data. - - - - - The InputDevice provides 3DOF or 6DOF tracking data. - - - - - The InputDevice is an unmoving reference object used to locate and track other objects in the world. - - - - - Enumeration describing the role of a XR.InputDevice in providing input. - - - - - This device is a game controller. - - - - - This device is typically a HMD or Camera. - - - - - This device is a hardware tracker. - - - - - This device is a controller that represents the left hand. - - - - - This device is a legacy controller. - - - - - This device is a controller that represents the right hand. - - - - - This device is a tracking reference used to track other devices in 3D. - - - - - This device does not have a known role. - - - - - An interface for accessing devices in the XR input subsytem. - - - - - Defines the delegate to use to register events when an InputDevice's configuration changes. - - The InputDevice whose configuration has changed. - - - - Defines the delegate to use to register events when an InputDevice is connected. - - The InputDevice that just connected. - - - - Defines the delegate to use to register events when an InputDevice is disconnected. - - The InputDevice that just disconnected. - - - - Gets the input device at a given XR.XRNode endpoint. - - The XRNode that owns the requested device. - - An XR.InputDevice at this [[XR.XRNode]. - - - - - Gets a list of active input devices available to the XR Input Subsystem. - - A List of type InputDevices to receive the available input devices. - - - - Gets a list of active input devices available to the XR Input Subsystem at a given XR.XRNode endpoint. - - The XRNode that owns the requested device. - A List of type InputDevices to receive the available input devices. - - - - Gets the list of active XR input devices that match the specified InputDeviceCharacteristics. - - A bitwise combination of the characteristics you are looking for. - A List<InputDevice> object to receive the available input devices. - - - - Gets a list of active input devices available to the XR Input Subsystem that match the specified role. - - XR.InputDeviceRole that is defined for the devices returned. - A List of type InputDevices to receive the available input devices. - - - - Defines a generic usage that maps to an input feature on a device. Use the As method to turn into a generic usage. - - - - - The string name of this usage feature; used internally to map to an input feature on a device. - - - - - The type of this usage feature; used internally to map to an input feature on a device. - - - - - Returns the generic version of this type for retrieving a feature value from a device. - - - - - Defines a generic usage that maps to an input feature on a device. - - - - - The string name of this usage feature; used internally to map to an input feature on a device. - - - - - Construct a usage from a usage name. - - The name of the feature usage to query for. - - - - Converts a generic InputFeatureUsage<T> into an InputFeatureUsage. - - - - - - A collection of methods and properties for accessing XR input devices by their XR Node representation. - - - - - Disables positional tracking in XR. This takes effect the next time the head pose is sampled. If set to true the camera only tracks headset rotation state. - - - - - Called when a tracked node is added to the underlying XR system. - - Describes the node that has been added. - - - - - Called when a tracked node is removed from the underlying XR system. - - Describes the node that has been removed. - - - - - Called when a tracked node begins reporting tracking information. - - Describes the node that has begun being tracked. - - - - - Called when a tracked node stops reporting tracking information. - - Describes the node that has lost tracking. - - - - - Note: This API has been marked as obsolete in code, and is no longer in use. Please use InputTracking.GetNodeStates and look for the XRNodeState with the corresponding XRNode type instead. -Gets the position of a specific node. - - Specifies which node's position should be returned. - - The position of the node in its local tracking space. - - - - - Note: This API has been marked as obsolete in code, and is no longer in use. Please use InputTracking.GetNodeStates and look for the XRNodeState with the corresponding XRNode type instead. -Gets the rotation of a specific node. - - Specifies which node's rotation should be returned. - - The rotation of the node in its local tracking space. - - - - - Accepts the unique identifier for a tracked node and returns a friendly name for it. - - The unique identifier for the Node index. - - - The name of the tracked node if the given 64-bit identifier maps to a currently tracked node. Empty string otherwise. - - - - - Describes all currently connected XRNodes and provides available tracking states for each. - - A list that is populated with XR.XRNodeState objects. - - - - Center tracking to the current position and orientation of the HMD. - - - - - Represents the values being tracked for this device. - - - - - Represents acceleration being tracked for this device. - - - - - Represents all InputTrackingState values being tracked for this device. - - - - - Represents angular acceleration being tracked for this device. - - - - - Represents no angular velocity being tracked for this device. - - - - - Represents no values being tracked for this device. - - - - - Represents position being tracked for this device. - - - - - Represents rotation being tracked for this device. - - - - - Represents velocity being tracked for this device. - - - - - The state of a tracked mesh since the last query. - - - - - The mesh has been added since the last call to XRMeshSubsystem.TryGetMeshInfos. - - - - - The mesh has been removed since the last call to XRMeshSubsystem.TryGetMeshInfos. - - - - - The mesh has not changed since the last call to XRMeshSubsystem.TryGetMeshInfos. - - - - - The mesh has been updated since the last call to XRMeshSubsystem.TryGetMeshInfos. - - - - - Contains event information related to a generated mesh. - - - - - The MeshVertexAttributes that were written to the MeshGenerationResult.Mesh. - - - - - If the generation was successful, data has been written to this Mesh. - - - - - If the generation was successful, physics data has been written to this MeshCollider. - - - - - The MeshId of the tracked mesh that was generated. - - - - - The MeshGenerationStatus of the mesh generation task. - - - - - The status of a XRMeshSubsystem.GenerateMeshAsync. - - - - - The mesh generation was canceled. - - - - - The XRMeshSubsystem was already generating the requested mesh. - - - - - The mesh generation failed because the mesh does not exist. - - - - - The mesh generation was successful. - - - - - The mesh generation failed for unknown reasons. - - - - - A session-unique identifier for trackables in the environment, e.g., planes and feature points. - - - - - Represents an invalid id. - - - - - Generates a nicely formatted version of the id. - - - A string unique to this id - - - - - Contains state information related to a tracked mesh. - - - - - The change state (e.g., Added, Removed) of the tracked mesh. - - - - - The MeshId of the tracked mesh. - - - - - A hint that can be used to determine when this mesh should be processed. - - - - - A set of vertex attributes. - - - - - Vertex normals - - - - - No vertex attributes - - - - - Vertex normals - - - - - Vertex tangents - - - - - Vertex UVs - - - - - Provides timing and other statistics from XR subsystems. - - - - - Retrieve a statistic for an XR subsystem. - - The subsystem with which the stat is registered. - The tag used to query for a statistic. - Receives the current value of the requested statistic. Contains a valid value when this method returns true. - - True, if the requested statistic is available, false otherwise. - - - - - This enum provides context to where the 0,0,0 point of tracking for InputDevices is. - - - - - XRInputSubsystem tracks all InputDevices in reference to the first known location of a specific InputDevice when set to TrackingOriginModeFlags.Device. - - - - - XRInputSubsystem tracks all InputDevices in reference to a point on the floor when set to TrackingOriginModeFlags.Floor. - - - - - XRInputSubsystem tracks all InputDevices in reference to an InputDevice with the InputDeviceCharacteristics.TrackingReference flag set when set to TrackingOriginModeFlags.TrackingReference. - - - - - XRInputSubsystem tracks all InputDevices in relation to a world anchor. This world anchor can change at any time, and is chosen by the runtime. - - - - - TrackingOriginModeFlags.Unknown enumerates when the XRInputSubsystem was not able to set its tracking origin or has no tracking. - - - - - Represents the size of physical space available for XR. - - - - - Represents a space large enough for free movement. - - - - - Represents a small space where movement may be constrained or positional tracking is unavailable. - - - - - Contains all functionality related to a XR device. - - - - - Subscribe a delegate to this event to get notified when an XRDevice is successfully loaded. - - - - - - Zooms the XR projection. - - - - - Successfully detected a XR device in working order. - - - - - Refresh rate of the display in Hertz. - - - - - Sets whether the camera passed in the first parameter is controlled implicitly by the XR Device - - The camera that we wish to change behavior on - True if the camera's transform is set externally. False if the camera is to be driven implicitly by XRDevice, - - Nothing. - - - - - This method returns an IntPtr representing the native pointer to the XR device if one is available, otherwise the value will be IntPtr.Zero. - - - The native pointer to the XR device. - - - - - Returns the device's current TrackingSpaceType. This value determines how the camera is positioned relative to its starting position. For more, see the section "Understanding the camera" in. - - - The device's current TrackingSpaceType. - - - - - Sets the device's current TrackingSpaceType. Returns true on success. Returns false if the given TrackingSpaceType is not supported or the device fails to switch. - - The TrackingSpaceType the device should switch to. - - - True on success. False if the given TrackingSpaceType is not supported or the device fails to switch. - - - - - Recreates the XR platform's eye texture swap chain with the appropriate anti-aliasing sample count. The reallocation of the eye texture will only occur if the MSAA quality setting's sample count is different from the sample count of the current eye texture. Reallocations of the eye textures will happen at the beginning of the next frame. This is an expensive operation and should only be used when necessary. - - - Nothing. - - - - - An XRDisplaySubsystem controls rendering to a head tracked display. - - - - - Sets or gets the state of content protection for the current active provider. - - For most providers, content protection allows you to use write only textures for rendering. This stops the ability for apps to read textures from the graphics card and view/record images that may be protected in some way. - - - - - - Disables the legacy renderer while this XRDisplaySubsystem is active. - - - - - Event sent when XR display focus changes. - - Delegate method to call when the event is sent. - - - - Determines if the current attached device has an opaque display. - - Most VR devices are opaque in order to increase the immersive experience, AR devices are transparent to allow for interaction with an augmentation of the current environment. - - - - - - The kind of reprojection the app requests to stabilize its holographic rendering relative to the user's head motion. - - - - - Controls the size of the textures submitted to the display as a multiplier of the display's default resolution. - - - - - Controls how much of the allocated display texture should be used for rendering. - - - - - Returns true when single pass stereo rendering is disabled and returns false if otherwise. - - - - - Specifies all texture layouts supported by this display subsystem. This var is a bit field that could be combination of XRDisplaySubsystem.TextureLayout. - - - - - Set DisplaySubsystem to use certain texture layout. Should query supported texture layout through XRDisplaySubsystem.supportedTextureLayouts - first for the capabilities. - - - - - Set DisplaySubsystem to use zFar for rendering. - - - - - Set DisplaySubsystem to use zNear for rendering. - - - - - This function records the display subsystem's native blit event to the target command buffer. This function is typically called by a scriptable rendering pipeline. - - The target CommandBuffer that records the native blit event. - True causes the graphics device to invalidate internal states before and after calling into the provider's native blit. This ensures the GFX internal states' consistency with the cost of some runtime performance. - The XRMirrorViewBlitMode XR display should perform. - - Returns true if native blit event is successfully recorded. Returns false otherwise. - - - - - This function records the display subsystem's native blit event to the target command buffer. This function is typically called by a scriptable rendering pipeline. - - The target CommandBuffer that records the native blit event. - True causes the graphics device to invalidate internal states before and after calling into the provider's native blit. This ensures the GFX internal states' consistency with the cost of some runtime performance. - The XRMirrorViewBlitMode XR display should perform. - - Returns true if native blit event is successfully recorded. Returns false otherwise. - - - - - Gets culling parameters for a specific culling pass index. - - Camera for the basis of the culling view and frustum. - Index of the culling pass obtained from XR.XRDisplaySubsystem.XRRenderPass.cullingPassIndex|XRRenderPass.cullingPassIndex. - Scriptable culling parameters to populate. - - - - Get a mirror view blit operation descriptor from the current display subsystem. - - A render texture representing mirror view's render target. - Information that describes desired mirror view blit operation. - The XRMirrorViewBlitMode XR display should perform. - - Return true if information is retrieved successfully, false otherwise. - - - - - Get a mirror view blit operation descriptor from the current display subsystem. - - A render texture representing mirror view's render target. - Information that describes desired mirror view blit operation. - The XRMirrorViewBlitMode XR display should perform. - - Return true if information is retrieved successfully, false otherwise. - - - - - Returns the XR display's preferred mirror blit mode. - - - Display subsystem's preferred blit mode. - - - - - Gets an XRRenderPass of a specific index. - - The index of the render pass to get. Must be less than GetRenderPassCount. - Render pass to populate. - - - - The number of XRRenderPass entries for this XR Display. - - - Count of render passes. - - - - - Given a render pass, return the RenderTexture instance backing that render pass. If the render pass is invalid, or if the render texture does not exist, return null. - - The render pass index to get the render texture for. - - The render texture associated with that render pass, or null if not found. - - - - - Type of node to be late latched. - - - - - Head node type for late latching. This represents the camera node in the pose hierarchy. - - - - - Left hand node type for late latching. This represents the left hand anchor node in the pose hierarchy. - - - - - Right hand node type for late latching. This represents the right hand anchor node in the pose hierarchy. - - - - - This marks a given GameObject's transform to be late latched in the next frame. Once marked for late latching, the GameObject transform and its descendants will be updated with the latest VR pose updates before rendering is submitted to the GPU. - - The transform of the GameObject to be late latched. - The late latch node type to be associated with the transform. - - - - The kind of reprojection the app requests to stabilize its holographic rendering relative to the user's head motion. - - - - - Does not stabalize the image for the user's head motion and instead fixes it in the display. Note that this is only comfortable for users when you use it sparingly, for example when the only visible content is a small cursor. - - - - - Stabalizes the image only for changes to the user's head orientation, ignores changes in position. This is best for body-locked content that you want to move with the user as they walk around, such as a 360-degree video. - - - - - Stabalizes the image for changes to both the user's head position and orientation. This is best for world-locked content that you want to remain stationary as the user walks around. - - - - - Does not specify the type of reprojection mode to use. - - - - - Sets a point in 3D space that acts as the focal point of the Scene for this frame. This helps to improve the visual fidelity of content around this point. You must set this value every frame. - - Note that specifying body-locked content in focus improves the fidelity of body-locked content at the expense of content not locked to the body. This is especially apparent when the user moves. - - - The position of the focal point in the Scene, relative to the Camera. - Surface normal of the plane being viewed at the focal point. - A vector that describes how the focus point moves in the Scene at this point in time. This allows the device to compensate for both your head movement and the movement of the object in the Scene. - - - - Set MSAA level for the DisplaySubsystem's render texture. - - The MSAA level. - - - - Override the XR display's preferred mirror blit mode from the script. - - XRMirrorViewBlitMode to set. - - - - Flags that represents supported texture layout. - - - - - Textures could be configured to multiple texture2D type. - - - - - Textures could be configured to a texture2D that represents multiple views. - - - - - Textures could be configured to a texture2DArray type. - - - - - Retrieves the time the GPU has spent on executing commands from the application's last frame, as reported by the XR Plugin. Measured in seconds. - - Outputs the time spent by the GPU during the last frame. - - Returns true if the GPU time spent on the last frame is available. Returns false if that time is unavailable. - - - - - Retrieves the amount of time that the GPU spent executing the compositor renderer during the last frame, as reported by the XR Plugin. Measured in seconds. - - Outputs the time spent by the GPU for the compositor during the last frame. - - Returns true if the GPU time spent on the last frame is available. Returns false if that time is unavailable. - - - - - Retrieves the amount of time that the GPU spent executing the compositor renderer during the last frame, as reported by the XR Plugin. Measured in seconds. - - Outputs the time spent by the GPU for the compositor during the last frame. - - Returns true if the GPU time spent on the last frame is available. Returns false if that time is unavailable. - - - - - Retrieves the refresh rate of the display as reported by the XR Plugin. - - Outputs the display refresh rate in Hz. - - - Returns true if the display refresh rate is available. Returns false if that rate is unavailable. - - - - - Retrieves the number of dropped frames reported by the XR Plugin. - - Outputs the number of frames dropped since the last update. - - Returns true if the dropped frame count is available. Returns false otherwise. - - - - - Retrieves the number of times the current frame has been drawn to the device as reported by the XR Plugin. - - Outputs the number of times the current frame has been presented. - - Returns true if the current frame count is available. Returns false otherwise. - - - - - Retrieves the motion-to-photon value as reported by the XR Plugin. - - Outputs the motion-to-photon value. - - Returns true if the motion-to-photon value is available. Returns false otherwise. - - - - - This struct holds data for a single blit operation. - - - - - Destination Rect area that the blit operation wants to blit to. - - - - - Source Rect area that the blit operation wants to blit from. - - - - - Source render texture that the blit operation wants to blit from. - - - - - Describes source texture's desired array slice. Texture2D will have array slice 1. - - - - - All information in this struct describes the desired mirror view blit operation. - - - - - The number of XRBlitParams entries for this XRMirrorViewBlitDesc. - - - - - When this is true, the current display subsystem supports native blit and AddGraphicsThreadMirrorViewBlit must be called to perform native blit. - - - - - When this is true, display subsystem will modifiy the graphics state. - - - - - Gets an XRBlitParams for a specific XRMirrorViewBlitDesc. - - Index of the blit parameter to get. - XRBlitParams to populate. - - - - A single viewpoint that must be rendered by the render pipeline. Contains a target viewport and texture array slice within a corresponding XR.XRDisplaySubsystem.XRRenderPass.renderTarget|renderTarget. - - - - - Represents the area in screen-space that is not visible on the XR Display. - - - - - The projection matrix that the render pipeline should use to render to the XR.XRDisplaySubsystem.XRRenderPass.renderTarget|renderTarget. - - - - - The slice of the output texture array that the render pipeline should render to. - - - - - World transform that the render pipeline should use to render to the XR.XRDisplaySubsystem.XRRenderPass.renderTarget|renderTarget. - - - - - Selects the viewport of the output texture XR.XRDisplaySubsystem.XRRenderPass.renderTarget|renderTarget. - - - - - Contains configuration parameters about which view into the Scene the renderer should rasterize, and a render target (which can be a texture array) for the result of the rasterization. - - - - - An index that a render pipeline can pass to XR.XRDisplaySubsystem.GetCullingParameters to obtain culling information. - - - - - The index of the render pass (originally passed in to XRDisplaySubsystem.GetRenderPass). - - - - - The output target for the render pass. - - - - - Descriptor that can be passed to RenderTexture.GetTemporary to create temporary textures that match the XR Display render target. - - - - - When this is false an optimal renderer can avoid resolving the depth buffer. - - - - - Gets an XRRenderParameter for a specific XRRenderPass. - - Camera for the basis of the view and projection. - Index of the render parameter to get. Must be less than GetRenderParameterCount. - XRRenderParameter to populate. - - - - The number of XRRenderParameter entries for this XRRenderPass. - - - Count of render parameters. - - - - - Class providing information about XRDisplaySubsystem registration. - - - - - Indicates whether legacy VR settings must be disabled for the subsystem. Set to true if the Editor must disable the legacy VR settings disabled; otherwise false. - - - - - Indicates whether MSAA must be resolved in the back buffer. Set to true if MSAA needs to be resolved in the back buffer; otherwise false. - - - - - Get current display subsystem's total number of supported mirror blit modes. - - - Number of supported mirror blit modes. - - - - - Get a supported mirror view blit mode from the current display subsystem descriptor. - - XRMirrorViewBlitMode to populate. - Index of the mirror blit mode to get. - - - - XRInputSubsystem -Instance is used to enable and disable the inputs coming from a specific plugin. - - - - - An event that takes the delegate instance that the XRInputSubsystem calls when it changes its tracking boundary. - - Unity calls this delegate when the tracking boundary changes. - - - - An event that takes the delegate instance that the XRInputSubsystem calls when it changes the origin it reports devices at. - - Unity calls this delegate when the TrackingOriginFlags changes. - - - - Gets all TrackingOriginModeFlags that this subsystem supports. - - - A single series of flags that contains all supported TrackingOriginModeFlags. - - - - - Gets the Tracking Origin Mode. - - - The Tracking Origin Mode that this subsystem is in. - - - - - Gets the list of 3D position values that represents the SDK-set boundary. - - The list of boundary points. - - True if this XRInputSubsystem supports boundary points and they are available. Returns false otherwise. - - - - - Gets a list of all connected InputDevices reported by this XRInputSubsystem. - - The list of devices reported by this subsystem. - - True, if the XRInputSubsystem retrieves any devices. Returns false otherwise. - - - - - Centers the tracking features on all InputDevices to the current position and orientation of the head-mounted device. - - - True if the method recenters the XRInputSubsystem. Returns false otherwise. - - - - - Attempts to set the TrackingOriginModeFlags of the subsystem. - - The new TrackingOriginModeFlags that you'd like to change to. - - True if the method changes the origin. Returns false otherwise. - - - - - Information about an Input subsystem. - - - - - When true, will suppress legacy support for Daydream, Oculus, OpenVR, and Windows MR built directly into the Unity runtime from generating input. This is useful when adding an XRInputSubsystem that supports these devices. - - - - - Allows external systems to provide dynamic meshes to Unity. - - - - - Call this function to request a change in the density of the generated Meshes. Unity gives the density level as a value within the range 0.0 to 1.0 and the provider determines how to map that value to their implementation. -Setting this value does not guarantee an immediate change in the density of any currently created Mesh and may only change the density for new or updated Meshes. - - - - - Requests the generation of the Mesh with MeshId meshId. Unity calls onMeshGenerationComplete when generation finishes. - - The MeshId of the mesh you wish to generate. - The Mesh to write the results into. - (Optional) The MeshCollider to populate with physics data. This may be null. - The vertex attributes you'd like to use. - The delegate to invoke when the generation completes. - - - - Set the bounding volume to restrict the space in which Unity generates and tracks Meshes. - -The bounding volume is an Axis Aligned Bounding Box (AABB) centered at the origin and extends in each dimension as defined in extents. - -The units of measurement depend on the provider. - - - - - - - Gets information about every Mesh the system currently tracks. - - A List of MeshInfos to be filled. Passing null will throw an ArgumentNullException. - - True if the List was populated. - - - - - Information about an XRMeshSubsystem. - - - - - Engine reserved blit modes. Blit mode capabilities should be queried from XRDisplaySubsystemDescriptor.GetAvailableMirrorBlitModeCount and XRDisplaySubsystemDescriptor.GetMirrorBlitModeByIndex. - - - - - Mirror view pass should blit platform default image to the mirror target. - - - - - Mirror view pass should blit after distortion pass image to the mirror target. - - - - - Mirror view pass should blit left eye image to the mirror target. - - - - - Mirror view pass should not be performed. - - - - - Mirror view pass should blit right eye image to the mirror target. - - - - - Mirror view pass should blit left eye image and right eye image in a side-by-side fashion to the mirror target. - - - - - Mirror view pass should blit similar to side-by-side mode, but also showing not rendered pixels saved by the occlusion mesh. - - - - - Struct that describes the mirror view blit mode. - - - - - Mirror view blit mode Id. For details, see XRMirrorViewBlitMode. In case of provider's custom blit mode, the value wouldn't be the reserved XRMirrorViewBlitMode. - - - - - String that describes the mirror view blit mode. - - - - - Enumeration of XR nodes which can be updated by XR input or sent haptic data. - - - - - Node representing a point between the left and right eyes. - - - - - Represents a tracked game Controller not associated with a specific hand. - - - - - Represents a physical device that provides tracking data for objects to which it is attached. - - - - - Node representing the user's head. - - - - - Node representing the left eye. - - - - - Node representing the left hand. - - - - - Node representing the right eye. - - - - - Node representing the right hand. - - - - - Represents a stationary physical device that can be used as a point of reference in the tracked area. - - - - - Sets the vector representing the current acceleration of the tracked node. - - - - - Sets the vector representing the current angular acceleration of the tracked node. - - - - - Sets the vector representing the current angular velocity of the tracked node. - - - - - The type of the tracked node as specified in XR.XRNode. - - - - - Sets the vector representing the current position of the tracked node. - - - - - Sets the quaternion representing the current rotation of the tracked node. - - - - - - Set to true if the node is presently being tracked by the underlying XR system, -and false if the node is not presently being tracked by the underlying XR system. - - - - - The unique identifier of the tracked node. - - - - - Sets the vector representing the current velocity of the tracked node. - - - - - Attempt to retrieve a vector representing the current acceleration of the tracked node. - - - - True if the acceleration was set in the output parameter. False if the acceleration is not available due to limitations of the underlying platform or if the node is not presently tracked. - - - - - Attempt to retrieve a Vector3 representing the current angular acceleration of the tracked node. - - - - True if the angular acceleration was set in the output parameter. False if the angular acceleration is not available due to limitations of the underlying platform or if the node is not presently tracked. - - - - - Attempt to retrieve a Vector3 representing the current angular velocity of the tracked node. - - - - True if the angular velocity was set in the output parameter. False if the angular velocity is not available due to limitations of the underlying platform or if the node is not presently tracked. - - - - - Attempt to retrieve a vector representing the current position of the tracked node. - - - - True if the position was set in the output parameter. False if the position is not available due to limitations of the underlying platform or if the node is not presently tracked. - - - - - Attempt to retrieve a quaternion representing the current rotation of the tracked node. - - - - True if the rotation was set in the output parameter. False if the rotation is not available due to limitations of the underlying platform or if the node is not presently tracked. - - - - - Attempt to retrieve a vector representing the current velocity of the tracked node. - - - - True if the velocity was set in the output parameter. False if the velocity is not available due to limitations of the underlying platform or if the node is not presently tracked. - - - - - Global XR related settings. - - - - - Fetch the device eye texture dimension from the active stereo device. - - - - - Globally enables or disables XR for the application. - - - - - Fetch the eye texture RenderTextureDescriptor from the active stereo device. - - - - - The current height of an eye texture for the loaded device. - - - - - Controls the actual size of eye textures as a multiplier of the device's default resolution. - - - - - The current width of an eye texture for the loaded device. - - - - - Sets the render mode for the XR device. The render mode controls how the view of the XR device renders in the Game view and in the main window on a host PC. - - - - - Read-only value that can be used to determine if the XR device is active. - - - - - Type of XR device that is currently loaded. - - - - - A scale applied to the standard occulsion mask for each platform. - - - - - Controls how much of the allocated eye texture should be used for rendering. - - - - - This property has been deprecated. Use XRSettings.gameViewRenderMode instead. - - - - - The stereo rendering mode that is currently in use. - - - - - Returns a list of supported XR devices that were included at build time. - - - - - Specifies whether or not the occlusion mesh should be used when rendering. Enabled by default. - - - - - Loads the requested device at the beginning of the next frame. - - Name of the device from XRSettings.supportedDevices. - Prioritized list of device names from XRSettings.supportedDevices. - - - - Loads the requested device at the beginning of the next frame. - - Name of the device from XRSettings.supportedDevices. - Prioritized list of device names from XRSettings.supportedDevices. - - - - Enum type signifying the different stereo rendering modes available. - - - - - This is the reference stereo rendering path for VR. - - - - - This is a faster rendering path for VR than XRSettings.StereoRenderingMode.MultiPass. - - - - - This is an optimized version of the XRSettings.StereoRenderingMode.SinglePass mode. - - - - - This is a OpenGL optimized version of the XRSettings.StereoRenderingMode.SinglePassInstanced mode. - - - - - Timing and other statistics from the XR subsystem. - - - - - Retrieves the number of dropped frames reported by the XR SDK. - - Outputs the number of frames dropped since the last update. - - True if the dropped frame count is available, false otherwise. - - - - - Retrieves the number of times the current frame has been drawn to the device as reported by the XR SDK. - - Outputs the number of times the current frame has been presented. - - True if the frame present count is available, false otherwise. - - - - - Retrieves the time spent by the GPU last frame, in seconds, as reported by the XR SDK. - - Outputs the time spent by the GPU last frame. - - True if the GPU time spent last frame is available, false otherwise. - - - - - Base class for all yield instructions. - - - - diff --git a/docs/.nojekyll b/docs/.nojekyll deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/docs/_coverpage.md b/docs/_coverpage.md deleted file mode 100644 index dc7903f960..0000000000 --- a/docs/_coverpage.md +++ /dev/null @@ -1,10 +0,0 @@ -# Synthesis An Autodesk Software - -> A foundation for creating better robotics simulation - -- Fusion 360 -- Unity -- GRPC - -[Getting Started](#Synthesis) -[Synthesis](https://synthesis.autodesk.com/) \ No newline at end of file diff --git a/docs/custom-theme.css b/docs/custom-theme.css deleted file mode 100644 index e84f4302b4..0000000000 --- a/docs/custom-theme.css +++ /dev/null @@ -1,27 +0,0 @@ -:root { - --base-font-size: 14px; - --theme-color : green; -} - -::-webkit-scrollbar { - width: 12px; -} - -::-webkit-scrollbar-track { - display: none; -} - -::-webkit-scrollbar-thumb { - - -moz-transition: all .2s ease-in; - -o-transition: all .2s ease-in; - -webkit-transition: all .2s ease-in; - transition: all .2s ease-in; - - border-radius: 0px; - background-color: green; -} - -::-webkit-scrollbar-thumb:hover { - background-color:darkgreen !important; -} \ No newline at end of file diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index 83f3f364cf..0000000000 --- a/docs/index.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - Synthesis Docs - - - - - - - - -
Please wait...
-
- - - - - - - - - - - \ No newline at end of file diff --git a/emulation/EmulationCommunication/.gitignore b/emulation/EmulationCommunication/.gitignore deleted file mode 100644 index a049b6f89c..0000000000 --- a/emulation/EmulationCommunication/.gitignore +++ /dev/null @@ -1 +0,0 @@ -packages/* diff --git a/emulation/EmulationCommunication/EmulationCommunication.sln b/emulation/EmulationCommunication/EmulationCommunication.sln deleted file mode 100644 index 8e5135313e..0000000000 --- a/emulation/EmulationCommunication/EmulationCommunication.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28307.705 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EmulationCommunication", "EmulationCommunication\EmulationCommunication.csproj", "{DED98240-B00B-4053-ADEE-4D717AA7339D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DED98240-B00B-4053-ADEE-4D717AA7339D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DED98240-B00B-4053-ADEE-4D717AA7339D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DED98240-B00B-4053-ADEE-4D717AA7339D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DED98240-B00B-4053-ADEE-4D717AA7339D}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {AC7030FD-3C34-4BB7-9581-1206B1410D83} - EndGlobalSection -EndGlobal diff --git a/emulation/EmulationCommunication/EmulationCommunication/.gitignore b/emulation/EmulationCommunication/EmulationCommunication/.gitignore deleted file mode 100644 index c6e49efc97..0000000000 --- a/emulation/EmulationCommunication/EmulationCommunication/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -obj/ -bin/ diff --git a/emulation/EmulationCommunication/EmulationCommunication/EmulationCommunication.csproj b/emulation/EmulationCommunication/EmulationCommunication/EmulationCommunication.csproj deleted file mode 100644 index 2f02ccdbee..0000000000 --- a/emulation/EmulationCommunication/EmulationCommunication/EmulationCommunication.csproj +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - Debug - AnyCPU - {DED98240-B00B-4053-ADEE-4D717AA7339D} - Library - Properties - EmulationCommunication - EmulationCommunication - v4.6.1 - 512 - true - - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\packages\Google.Apis.1.40.2\lib\net45\Google.Apis.dll - - - ..\packages\Google.Apis.Auth.1.40.2\lib\net45\Google.Apis.Auth.dll - - - ..\packages\Google.Apis.Auth.1.40.2\lib\net45\Google.Apis.Auth.PlatformServices.dll - - - ..\packages\Google.Apis.Core.1.40.2\lib\net45\Google.Apis.Core.dll - - - ..\packages\Google.Apis.1.40.2\lib\net45\Google.Apis.PlatformServices.dll - - - ..\packages\Google.Protobuf.3.19.4\lib\net45\Google.Protobuf.dll - - - ..\packages\Grpc.Auth.1.22.0\lib\net45\Grpc.Auth.dll - - - ..\packages\Grpc.Core.1.22.0\lib\net45\Grpc.Core.dll - - - ..\packages\Grpc.Core.Api.1.22.0\lib\net45\Grpc.Core.Api.dll - - - ..\packages\Grpc.Reflection.1.22.0\lib\net45\Grpc.Reflection.dll - - - ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll - - - - ..\packages\System.Buffers.4.4.0\lib\netstandard2.0\System.Buffers.dll - - - - ..\packages\System.Interactive.Async.3.2.0\lib\net46\System.Interactive.Async.dll - - - ..\packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll - - - - ..\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll - - - ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll - - - - - - - - - ..\packages\Zlib.Portable.Signed.1.11.0\lib\portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid\Zlib.Portable.dll - - - - - - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - - \ No newline at end of file diff --git a/emulation/EmulationCommunication/EmulationCommunication/Properties/AssemblyInfo.cs b/emulation/EmulationCommunication/EmulationCommunication/Properties/AssemblyInfo.cs deleted file mode 100644 index 3e4553abb0..0000000000 --- a/emulation/EmulationCommunication/EmulationCommunication/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("EmulationCommunication")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("EmulationCommunication")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("ded98240-b00b-4053-adee-4d717aa7339d")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/emulation/EmulationCommunication/EmulationCommunication/app.config b/emulation/EmulationCommunication/EmulationCommunication/app.config deleted file mode 100644 index c1d975be7b..0000000000 --- a/emulation/EmulationCommunication/EmulationCommunication/app.config +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/emulation/EmulationCommunication/EmulationCommunication/packages.config b/emulation/EmulationCommunication/EmulationCommunication/packages.config deleted file mode 100644 index 81f6b074c2..0000000000 --- a/emulation/EmulationCommunication/EmulationCommunication/packages.config +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/emulation/README.md b/emulation/README.md deleted file mode 100644 index 478c1a2b6e..0000000000 --- a/emulation/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# FRC Robot Code Emulation - -## Overview -The emulator is the Synthesis tool designed to help users test their FRC robot code ([Getting started with FRC control system](https://docs.wpilib.org "FRC Control System")). Users can upload their own user code as the FRC user programs they would normally deploy to the RoboRIO. Its normal communication with hardware is then redirected to the [engine](../engine "Engine Source") for simulation and testing. - -## HEL - Hardware Emulation Layer -The core of Synthesis's emulator is HEL. HEL is a reimplementation of the NI FPGA, which normally runs on the RoboRIO, that instead runs in an [ARM](./emulator_building.md "Building the Emulator") or x86 virtual environment and interfaces with a simulation. This allows robot code to run on users' computers as a normal application and to communicates with Synthesis. Emulating this low layer of robot code runtime enables compatibility across new releases of WPILib and other external solutions. Read more [here](./hel/README.md "HEL README"). - -#### Engine and Exporter Integration - -Although HEL may support emulation of a given input or output, it must interface with the engine simulation, which uses the user program to control the robot model and emulate RoboRIO inputs. This robot model was generated using Synthesis's [robot exporter tool](../exporters/robot_exporter "Robot Exporter Source"). In terms of emulation, the robot exporter tool is used to specify which inputs and outputs are attached to which parts of the robot. This means that as features are added to HEL, they must must also be added to the engine and robot exporter. - -# Emulation Bridge and API - -HEL communicates with the engine using [gRPC](https://grpc.io/ "gRPC Home Page"), an RPC framework utilizing [Google Protocol Buffers](https://developers.google.com/protocol-buffers/ "Google Protocol Buffers"). The definition of this API is located in the `api/v1` directory. HEL's CMake script automatically builds its own gRPC interface, while the C# solution in `EmulationCommunication` builds the interface used by the engine. The gRPC bridge application located in the `bridge` directory routes the connection from the engine to the correct virtual machine (x86 for Java; ARM for C++) and its running HEL instance. - -# x86 Cross-Compilation - -Due to recent updates to [WPILib](https://github.com/wpilibsuite/allwpilib "WPILib Source"), a separate virtual machine using an x86 architecture is now required to emulate Java and other JVM user programs. [Docker](https://www.docker.com/ "Docker Home Page") is used with [Buildroot](https://buildroot.org/ "Buildroot Home Page") to generate this x86 virtual machine. To compile WPILib's hardware abstraction layer (the HAL Athena implementation) for x86 instead of ARM, two shim files were needed, which are located in the `wpi_cross` folder. diff --git a/emulation/api/v1/proto/emulator_service.proto b/emulation/api/v1/proto/emulator_service.proto deleted file mode 100644 index 8122bcce08..0000000000 --- a/emulation/api/v1/proto/emulator_service.proto +++ /dev/null @@ -1,197 +0,0 @@ -syntax = "proto3"; - -package EmulationService; - -option go_package = "v1"; - -enum TargetPlatform { - NATIVE = 0; - JAVA = 1; - OTHER = 2; -} - -message DIOData{ - enum Config { - DI = 0; - DO = 1; - } - - Config config = 1; - bool value = 2; -} - -message MXPData { - enum Config { - DI = 0; - DO = 1; - PWM = 2; - SPI = 3; - I2C = 4; - INVALID_CONFIG = 5; - } - - Config config = 1; - double value = 2; -} - - -message RobotOutputs { - enum RelayState { - OFF = 0; - REVERSE = 1; - FORWARD = 2; - INVALID_STATE = 3; - } - enum CANType { - TALON_SRX = 0; - VICTOR_SPX = 1; - SPARK_MAX = 2; - PCM = 3; - PDP = 4; - UNKNOWN = 5; - INVALID_CAN_TYPE = 6; - } - - message CANMotorController { - CANType can_type = 1; - int32 id = 2; - float percent_output = 3; - } - string api = 1; - repeated double pwm_headers = 2; - repeated RelayState relays = 3; - repeated float analog_outputs = 4; - repeated MXPData mxp_data = 5; - repeated DIOData digital_headers = 6; - repeated CANMotorController can_motor_controllers = 7; -} - -message RobotInputs { - message MatchInfo { - enum MatchType { - NONE = 0; - PRACTICE = 1; - QUALIFICATION = 2; - ELIMINATION = 3; - } - - enum AllianceStationID { - RED1 = 0; - RED2 = 1; - RED3 = 2; - BLUE1 = 3; - BLUE2 = 4; - BLUE3 = 5; - } - - string game_specific_message = 1; - MatchType match_type = 2; - string event_name = 3; - uint32 match_number = 4; - uint32 replay_number = 5; - AllianceStationID alliance_station_id = 6; - double match_time = 7; - - } - - message Joystick { - bool is_xbox = 1; - sint32 type = 2; - string name = 3; - uint32 buttons = 4; - sint32 button_count = 5; - repeated sint32 axes = 6; - sint32 axis_count = 7; - repeated uint32 axis_types = 8; - repeated sint32 povs = 9; - int32 pov_count = 10; - int32 outputs = 11; - int32 left_rumble = 12; - int32 right_rumble = 13; - } - - message RobotMode { - enum Mode { - AUTONOMOUS = 0; - TELEOP = 1; - TEST = 2; - } - bool enabled = 1; - bool is_emergency_stopped = 2; - bool is_fms_attached = 3; - bool is_ds_attached = 4; - Mode mode = 5; - } - - message EncoderManager { - enum PortType { - DI = 0; - AI = 1; - } - enum EncoderType { - INVALID = 0; - FPGA_ENCODER = 1; - COUNTER = 2; - } - - EncoderType type = 1; - uint32 index = 2; - uint32 a_channel = 3; - PortType a_type = 4; - uint32 b_channel = 5; - PortType b_type = 6; - sint32 ticks = 7; - } - - repeated DIOData digital_headers = 1; - repeated MXPData mxp_data = 2; - repeated Joystick joysticks = 3; - MatchInfo match_info = 4; - RobotMode robot_mode = 5; - repeated EncoderManager encoder_managers = 6; - repeated float analog_inputs = 7; - bool user_button = 8; -} - -message UpdateRobotInputsRequest { - string api = 1; - TargetPlatform target_platform = 2; - RobotInputs input_data = 3; -} - -message UpdateRobotInputsResponse { - enum ErrorCode { - INTERAL_ERROR = 0; - } - - string api = 1; - TargetPlatform target_platform = 2; - ErrorCode error_code = 3; - bool success = 4; -} - -message RobotOutputsRequest { - string api = 1; - TargetPlatform target_platform = 2; -} - -message RobotOutputsResponse { - enum ErrorCode { - INTERAL_ERROR = 0; - } - - string api = 1; - TargetPlatform target_platform = 2; - ErrorCode error_code = 3; - bool success = 4; - RobotOutputs output_data = 5; -} - -service EmulationWriter { - rpc RobotInputs(stream UpdateRobotInputsRequest) returns (UpdateRobotInputsResponse) {} -} - -service EmulationReader { - rpc RobotOutputs(RobotOutputsRequest) returns (stream RobotOutputsResponse) {} -} - diff --git a/emulation/emulator_building.md b/emulation/emulator_building.md deleted file mode 100644 index 6fdd73c276..0000000000 --- a/emulation/emulator_building.md +++ /dev/null @@ -1,185 +0,0 @@ -# Building the VM Image - -This is the process for building the emulator virtual machine in which user code will run as a part of Synthesis's emulation. - -WARNING: This is not a simple process. It requires a Linux environment and knowledge of Linux command line utilities. - -* [Preface and Set-Up](#preface-and-set-up) -* [Phase 1: Downloads](#phase-1-downloads) -* [Phase 2: Building Linux](#phase-2-building-linux) -* [Phase 3: Building the Initial RAM Disk](#phase-3-building-the-initial-ram-disk) -* [Phase 4: Setting up WPILib and CTRE Phoenix Libraries](#phase-4-setting-up-wpilib-and-ctre-phoenix-libraries) -* [Phase 5: Adding HEL](#phase-5-adding-hel) -* [Phase 6: Making the Core VM Image](#phase-6-making-the-core-vm-image) -* [Phase 7: VM Set-Up](#phase-7-vm-set-up) - -## Preface and Set-Up - -This process assumes you are working off a Linux machine of some sort. A virtual machine will suffice for this example. For those who wish to build the image from source but do not have access to a Linux environment, VirtualBox is a good free virtual machine software, and Ubuntu Linux is a user-friendly option for the Linux distribution. - -The amount of space required to make the image is rather large. Due to the number of tools and software needed to build the image, it could take upwards of 5 GB of disk space. However, the result should be no more than 530 MB, and most of the folders can be deleted once building is complete. - -There are several tools required to build the image. Most of the utilities involved are core Linux/Unix utilities (i.e. tar, zcat, mkfs, dd). The tools involved that are not core are GCC, G++, GNU Make, the official FRC GCC Compiler for Linux, QEMU (with ARM extension) and (...). Once you have all of those installed, you can proceed to phase 1. - -Please note that this is not a fast process, as during this you are going to download roughly 4 GB of git repositories and build a large amount of code. The process can take anywhere between 30 minutes and 2 hours depending on internet and computer speed. With all this in mind, please move on to phase 1. - -## Phase 1: Downloads - -Enter your Linux environment of choice and open a terminal. Create a temporary folder for all the git repositories, typically something like `git`. Enter that directory and run the following commands. Note these will both take quite a bit of time. - -```shell -$ mkdir git -$ mkdir -p vm-package/wpilib vm-package/java vm-package/root -$ cd git -$ git clone https://www.github.com/autodesk/synthesis -$ git clone https://www.github.com/Xilinx/linux-xlnx -$ git clone https://git.buildroot.net/buildroot -$ git clone https://www.github.com/wpilibsuite/allwpilib -$ git clone https://www.github.com/CrossTheRoadElec/Phoenix-frc-lib -``` - -## Phase 2: Building Linux - -After the downloads complete, copy the configuration files from the ~/git/synthesis/emulation/hel/external_configs folder into -their respective folders - -```shell -$ cp ~/git/synthesis/emulation/hel/external_configs/.linux-config ~/git/linux-xlnx/.config -$ cp ~/git/synthesis/emulation/hel/external_configs/.buildroot-config ~/git/buildroot/.config -``` - -After you have copied the files, move into the Linux directory. After you are in, run the following make commands (replace 8 in -j8 -with 2 times the number of CPU cores you have). The build process can take several minutes. - -```shell -$ make -j8 ARCH=arm zImage CROSS_COMPILE=arm-frc-linux-gnueabi- -$ make -j8 ARCH=arm UIMAGE_LOADADDR=0x8000 dtbs CROSS_COMPILE=arm-frc-linux-gnueabi- -``` - -After building, copy those files to the location you wish your VM to be built in (~/vm-package in this example). - -```shell -$ mkdir ~/vm-package -$ cp arch/arm/boot/zImage ~/vm-package -$ cp arch/arm/boot/dts/zynq-zed.dtb ~/vm-package -``` - -After this is complete, move on to building buildroot. - -## Phase 3: Building the Initial RAM Disk - -Move into the buildroot directory. This process is much simpler as it is one make command; however it is much longer time-wise. - -```shell -$ cd ~/git/build && make -$ cp ~/git/buildroot/output/images/rootfs.cpio.gz ~/vm-package -``` - -This process can take upwards of 1 hours, so it is recommended you do something else to pass time. After this is complete, move on to phase 3. - -## Phase 4: Setting up WPILib and CTRE Phoenix Libraries - -Build WPILib libraries, download CTRE Phoenix library, and copy them to the VM. - -```shell -$ cd ~/allwpilib -$ git checkout v2018.4.1 # Substitute your WPILib release version -$ ./gradlew wpilibc:build -$ ./gradlew wpilibj:build -$ cp wpilibc/build/libs/wpilibc/shared/athena/libwpilibc.so ~/vm-package/wpilib -$ cp hal/build/libs/halAthena/libhal.so ~/vm-package/wpilib -$ cp build/dependencies/wpiutil-cpp/linuxathena/linux/athena/shared/libwpiutil.so ~/vm-package/wpilib -$ cp build/dependencies/ntcore-cpp/linuxathena/linux/athena/shared/libntcore.so ~/vm-package/wpilib -$ cp build/dependencies/cscore-cpp/linuxathena/linux/athena/shared/libcscore.so ~/vm-package/wpilib -$ cp build/tmp/expandedArchives/opencv-cpp-3.2.0-linuxathena.zip_882ce6d6786024fd1378ddee15c75ec3/linux/athena/shared/*.so* ~/vm-package/wpilib -$ find -name wpilibJNI.jar -exec cp {} ~/vm-packages/wpilib \; -$ find -name ntcore.jar -exec cp {} ~/vm-packages/wpilib \; -$ find -name cscore.jar -exec cp {} ~/vm-packages/wpilib \; -$ find -name hal.jar -exec cp {} ~/vm-packages/wpilib \; -$ find -name wpilibj.jar -exec cp {} ~/vm-packages/wpilib \; -$ cd ~/Phoenix-frc-lib -$ git checkout v2018.19.0 # Substitute your Phoenix release version -$ cp libraries/java/lib/libCTRE_PhoenixCCI.so ~/vm-package -``` - -## Phase 5: Adding HEL - -Build and copy HEL to the VM file system along with a script to run user code. - -```shell -$ cd ~/synthesis/emulation/hel -$ cmake . -DCMAKE_BUILD_TYPE=RELEASE -DARCH=ARM -$ make -j16 hel -$ cp lib/libhel.so ~/vm-package -$ cp scripts/frc_program_shooser.sh ~/vm-package -$ cp scripts/S90FRCUserProgram /etc/init.d -``` - -## Phase 6: Making the Core VM Image - -Finish constructing the VM image. This is the most terminal intensive part. - -```shell -$ wget -O - http://fl.us.mirror.archlinuxarm.org/arm/extra/jdk8-openjdk-8.u172-2-arm.pkg.tar.xz -$ wget -O - http://ca.us.mirror.archlinuxarm.org/arm/extra/jre8-openjdk-headless-8.u172-2-arm.pkg.tar.xz -$ wget -O - http://il.us.mirror.archlinuxarm.org/aarch64/extra/java-runtime-common-3-1-any.pkg.tar.xz -$ wget -O - http://fl.us.mirror.archlinuxarm.org/aarch64/core/ca-certificates-utils-20170307-1-any.pkg.tar.xz -$ find . -name \*.xz -exec tar -xvf {} -C ./java \; -$ dd if=/dev/zero of=./rootfs.ext4 -$ mkfs.ext4 ./rootfs.ext4 -$ sudo losetup /dev/loop0 ./rootfs.ext4 -$ sudo mount -t ext4 /dev/loop ./root -$ cd root -$ sudo mkdir -p ./home/lvuser -$ sudo zcat ../rootfs.cpio.gz | sudo cpio -imdv -$ sudo cp ../java/* -r . -$ sudo cp ../wpilib/* -r ./home/lvuser -$ sudo cp ../libhel.so ./home/lvuser -$ sudo cp /usr/arm-frc-linux-gnueabi/lib/libstdc++.so.6 ./usr/lib -$ cd .. -$ sudo umount ./root && sudo losetup -d -``` - -## Phase 7: VM Set-Up - -Run and configure the VM with the date and users and set up HEL and support files to run user code. - -```shell -qemu-system-arm -machine xilinx-zynq-a9 -cpu cortex-a9 -m 2048 -kernel ../zImage -dtb ../zynq-zed.dtb -display none -serial null -serial mon:stdio -localtime -append "console=ttyPS0,115200 earlyprintk root=/dev/mmcblk0" -redir tcp:10022::22 -redir tcp:11000::11000 -redir tcp:11001::11001 -sd ../rootfs.ext4 # You will be inside of the VM now -# When it asks for the username, enter the word root -# When it prompts for the password, enter the word synthesis -# You are now **inside** the VM - -$ date %Y%m%d -s "20180815" # Todays date in a Year/Month/Day format -$ useradd lvuser # Press enter 3 times to ensure the command executes and has no password -$ sed -i 's/PermitRootLogin\ no/PermitRootLogin\ yes/' /etc/ssh/sshd_config -$ sed -i 's/PasswordAuthentication\ no/PasswordAuthentication\ yes/' /etc/ssh/sshd_config -$ sed -i 's/PermitEmptyPasswords\ no/PermitEmptyPasswords\ yes/' /etc/ssh/sshd_config -$ /etc/init.d/S50sshd restart -$ sed -i 's/root\ ALL=(ALL)\ ALL/&'$'\nlvuser\ ALL=(ALL)\ NOPASSWD:ALL/' /etc/sudoers # NEVER DO THIS UNLESS YOU KNOW EXACTLY WHAT YOU ARE DOING -$ cd ./home/lvuser -$ ln -s libhel.so libNiFpgaLv.so.13 -$ ln -s libhel.so libvisa.so -$ ln -s libhel.so libNiRioSrv.so.13 -$ ln -s libhel.so libniriodevunum.so.1 -$ ln -s libhel.so libniriosession.so.1 -$ ln -s libhel.so libRoboRIO_FRC_ChipObject.so.18 -$ ln -s libhel.so libNiFpga.so.13 -$ ln -s libFRC_NetworkCommunication.so.18 -$ cat > .vminfo < .profile < /dev/null; - rm -rf vm-package vm-package.zip vm-package.tar.gz vm_lock; - ;; - "cmake") - rm -rf CMakeFiles CMakeCache.txt cmake_install.cmake Makefile CMakeDoxyfile.in CMakeDoxygenDefaults.cmake; - ;; - "gtest") - rm -rf GoogleTest-prefix bin/benchmarks/* bin/tests/* lib/lib lib/lib64 lib/google_test lib/GoogleBench lib/include; - ;; - "wpilib") - rm -rf lib/wpilib; - ;; - "ni-libraries") - rm -rf lib/ni-libraries; - ;; - "ctre") - rm -rf lib/ctre; - ;; - "asio") - rm -rf lib/ASIO; - ;; - "grpc") - rm -rf lib/grpc; - ;; - "gen_grpc") - rm -rf lib/gen; - ;; - "hel") - rm -rf build/* lib/libhel.so; - ;; - "user-code") - rm -rf user-code/*; - ;; - "docs") - rm -rf docs/html/* docs/latex/*; - ;; - "all") - killall qemu-system-arm &> /dev/null; - rm -rf vm-package vm-package.zip vm-package.tar.gz vm_lock CMakeFiles CMakeCache.txt cmake_install.cmake Makefile CMakeDoxyfile.in CMakeDoxygenDefaults.cmake GoogleTest-prefix bin/benchmarks/* bin/tests/* lib/lib lib/lib64 lib/google_test lib/GoogleBench lib/include lib/wpilib lib/ni-libraries lib/ctre lib/grpc lib/gen lib/ASIO build/* lib/libhel.so docs/html/* docs/latex/* - ;; - *) - printf "Skipping clean. No target specified.\n" - ;; -esac diff --git a/emulation/hel/docs/Doxyfile b/emulation/hel/docs/Doxyfile deleted file mode 100644 index 030e57c2c5..0000000000 --- a/emulation/hel/docs/Doxyfile +++ /dev/null @@ -1,2486 +0,0 @@ -# Doxyfile 1.8.14 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. -# -# All text after a double hash (##) is considered a comment and is placed in -# front of the TAG it is preceding. -# -# All text after a single hash (#) is considered a comment and will be ignored. -# The format is: -# TAG = value [value, ...] -# For lists, items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (\" \"). - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all text -# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv -# built into libc) for the transcoding. See -# https://www.gnu.org/software/libiconv/ for the list of possible encodings. -# The default value is: UTF-8. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by -# double-quotes, unless you are using Doxywizard) that should identify the -# project for which the documentation is generated. This name is used in the -# title of most generated pages and in a few other places. -# The default value is: My Project. - -PROJECT_NAME = HEL - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. This -# could be handy for archiving the generated documentation or if some version -# control system is used. - -PROJECT_NUMBER = v1.0 - -# Using the PROJECT_BRIEF tag one can provide an optional one line description -# for a project that appears at the top of each page and should give viewer a -# quick idea about the purpose of the project. Keep the description short. - -PROJECT_BRIEF = "Synthesis software emulation runtime environment" - -# With the PROJECT_LOGO tag one can specify a logo or an icon that is included -# in the documentation. The maximum height of the logo should not exceed 55 -# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy -# the logo to the output directory. - -PROJECT_LOGO = - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path -# into which the generated documentation will be written. If a relative path is -# entered, it will be relative to the location where doxygen was started. If -# left blank the current directory will be used. - -OUTPUT_DIRECTORY = ./docs - -# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- -# directories (in 2 levels) under the output directory of each output format and -# will distribute the generated files over these directories. Enabling this -# option can be useful when feeding doxygen a huge amount of source files, where -# putting all generated files in the same directory would otherwise causes -# performance problems for the file system. -# The default value is: NO. - -CREATE_SUBDIRS = NO - -# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII -# characters to appear in the names of generated files. If set to NO, non-ASCII -# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode -# U+3044. -# The default value is: NO. - -ALLOW_UNICODE_NAMES = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, -# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), -# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, -# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), -# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, -# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, -# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, -# Ukrainian and Vietnamese. -# The default value is: English. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member -# descriptions after the members that are listed in the file and class -# documentation (similar to Javadoc). Set to NO to disable this. -# The default value is: YES. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief -# description of a member or function before the detailed description -# -# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. -# The default value is: YES. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator that is -# used to form the text in various listings. Each string in this list, if found -# as the leading text of the brief description, will be stripped from the text -# and the result, after processing the whole list, is used as the annotated -# text. Otherwise, the brief description is used as-is. If left blank, the -# following values are used ($name is automatically replaced with the name of -# the entity):The $name class, The $name widget, The $name file, is, provides, -# specifies, contains, represents, a, an and the. - -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# doxygen will generate a detailed section even if there is only a brief -# description. -# The default value is: NO. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. -# The default value is: NO. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path -# before files name in the file list and in the header files. If set to NO the -# shortest path that makes the file name unique will be used -# The default value is: YES. - -FULL_PATH_NAMES = YES - -# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. -# Stripping is only done if one of the specified strings matches the left-hand -# part of the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the path to -# strip. -# -# Note that you can specify absolute paths here, but also relative paths, which -# will be relative from the directory where doxygen is started. -# This tag requires that the tag FULL_PATH_NAMES is set to YES. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the -# path mentioned in the documentation of a class, which tells the reader which -# header file to include in order to use a class. If left blank only the name of -# the header file containing the class definition is used. Otherwise one should -# specify the list of include paths that are normally passed to the compiler -# using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but -# less readable) file names. This can be useful is your file systems doesn't -# support long names like on DOS, Mac, or CD-ROM. -# The default value is: NO. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the -# first line (until the first dot) of a Javadoc-style comment as the brief -# description. If set to NO, the Javadoc-style will behave just like regular Qt- -# style comments (thus requiring an explicit @brief command for a brief -# description.) -# The default value is: NO. - -JAVADOC_AUTOBRIEF = NO - -# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first -# line (until the first dot) of a Qt-style comment as the brief description. If -# set to NO, the Qt-style will behave just like regular Qt-style comments (thus -# requiring an explicit \brief command for a brief description.) -# The default value is: NO. - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a -# multi-line C++ special comment block (i.e. a block of //! or /// comments) as -# a brief description. This used to be the default behavior. The new default is -# to treat a multi-line C++ comment block as a detailed description. Set this -# tag to YES if you prefer the old behavior instead. -# -# Note that setting this tag to YES also means that rational rose comments are -# not recognized any more. -# The default value is: NO. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the -# documentation from any documented member that it re-implements. -# The default value is: YES. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new -# page for each member. If set to NO, the documentation of a member will be part -# of the file/class/namespace that contains it. -# The default value is: NO. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen -# uses this value to replace tabs by spaces in code fragments. -# Minimum value: 1, maximum value: 16, default value: 4. - -TAB_SIZE = 4 - -# This tag can be used to specify a number of aliases that act as commands in -# the documentation. An alias has the form: -# name=value -# For example adding -# "sideeffect=@par Side Effects:\n" -# will allow you to put the command \sideeffect (or @sideeffect) in the -# documentation, which will result in a user-defined paragraph with heading -# "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines (in the resulting output). You can put ^^ in the value part of an -# alias to insert a newline as if a physical newline was in the original file. - -ALIASES = - -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding "class=itcl::class" -# will allow you to use the command class in the itcl::class meaning. - -TCL_SUBST = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources -# only. Doxygen will then generate output that is more tailored for C. For -# instance, some of the names that are used will be different. The list of all -# members will be omitted, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or -# Python sources only. Doxygen will then generate output that is more tailored -# for that language. For instance, namespaces will be presented as packages, -# qualified scopes will look different, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources. Doxygen will then generate output that is tailored for Fortran. -# The default value is: NO. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for VHDL. -# The default value is: NO. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given -# extension. Doxygen has a built-in mapping, but you can override or extend it -# using this tag. The format is ext=language, where ext is a file extension, and -# language is one of the parsers supported by doxygen: IDL, Java, Javascript, -# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: -# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: -# Fortran. In the later case the parser tries to guess whether the code is fixed -# or free formatted code, this is the default for Fortran type files), VHDL. For -# instance to make doxygen treat .inc files as Fortran files (default is PHP), -# and .f files as C (default is Fortran), use: inc=Fortran f=C. -# -# Note: For files without extension you can use no_extension as a placeholder. -# -# Note that for custom extensions you also need to set FILE_PATTERNS otherwise -# the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments -# according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. -# The output of markdown processing is further processed by doxygen, so you can -# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in -# case of backward compatibilities issues. -# The default value is: YES. - -MARKDOWN_SUPPORT = YES - -# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up -# to that level are automatically included in the table of contents, even if -# they do not have an id attribute. -# Note: This feature currently applies only to Markdown headings. -# Minimum value: 0, maximum value: 99, default value: 0. -# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. - -TOC_INCLUDE_HEADINGS = 0 - -# When enabled doxygen tries to link words that correspond to documented -# classes, or namespaces to their corresponding documentation. Such a link can -# be prevented in individual cases by putting a % sign in front of the word or -# globally by setting AUTOLINK_SUPPORT to NO. -# The default value is: YES. - -AUTOLINK_SUPPORT = YES - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should set this -# tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); -# versus func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. -# The default value is: NO. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. -# The default value is: NO. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen -# will parse them like normal C++ but will assume all classes use public instead -# of private inheritance when no explicit protection keyword is present. -# The default value is: NO. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate -# getter and setter methods for a property. Setting this option to YES will make -# doxygen to replace the get and set methods by a property in the documentation. -# This will only work if the methods are indeed getting or setting a simple -# type. If this is not the case, or you want to show the methods anyway, you -# should set this option to NO. -# The default value is: YES. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. -# The default value is: NO. - -DISTRIBUTE_GROUP_DOC = NO - -# If one adds a struct or class to a group and this option is enabled, then also -# any nested class or struct is added to the same group. By default this option -# is disabled and one has to add nested compounds explicitly via \ingroup. -# The default value is: NO. - -GROUP_NESTED_COMPOUNDS = NO - -# Set the SUBGROUPING tag to YES to allow class member groups of the same type -# (for instance a group of public functions) to be put as a subgroup of that -# type (e.g. under the Public Functions section). Set it to NO to prevent -# subgrouping. Alternatively, this can be done per class using the -# \nosubgrouping command. -# The default value is: YES. - -SUBGROUPING = YES - -# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions -# are shown inside the group in which they are included (e.g. using \ingroup) -# instead of on a separate page (for HTML and Man pages) or section (for LaTeX -# and RTF). -# -# Note that this feature does not work in combination with -# SEPARATE_MEMBER_PAGES. -# The default value is: NO. - -INLINE_GROUPED_CLASSES = NO - -# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions -# with only public data fields or simple typedef fields will be shown inline in -# the documentation of the scope in which they are defined (i.e. file, -# namespace, or group documentation), provided this scope is documented. If set -# to NO, structs, classes, and unions are shown on a separate page (for HTML and -# Man pages) or section (for LaTeX and RTF). -# The default value is: NO. - -INLINE_SIMPLE_STRUCTS = NO - -# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or -# enum is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically be -# useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. -# The default value is: NO. - -TYPEDEF_HIDES_STRUCT = NO - -# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This -# cache is used to resolve symbols given their name and scope. Since this can be -# an expensive process and often the same symbol appears multiple times in the -# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small -# doxygen will become slower. If the cache is too large, memory is wasted. The -# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range -# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 -# symbols. At the end of a run doxygen will report the cache usage and suggest -# the optimal cache size from a speed point of view. -# Minimum value: 0, maximum value: 9, default value: 0. - -LOOKUP_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in -# documentation are documented, even if no documentation was available. Private -# class members and static file members will be hidden unless the -# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. -# Note: This will also disable the warnings about undocumented members that are -# normally produced when WARNINGS is set to YES. -# The default value is: NO. - -EXTRACT_ALL = NO - -# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will -# be included in the documentation. -# The default value is: NO. - -EXTRACT_PRIVATE = YES - -# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal -# scope will be included in the documentation. -# The default value is: NO. - -EXTRACT_PACKAGE = NO - -# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be -# included in the documentation. -# The default value is: NO. - -EXTRACT_STATIC = NO - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined -# locally in source files will be included in the documentation. If set to NO, -# only classes defined in header files are included. Does not have any effect -# for Java sources. -# The default value is: YES. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. If set to YES, local methods, -# which are defined in the implementation section but not in the interface are -# included in the documentation. If set to NO, only methods in the interface are -# included. -# The default value is: NO. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base name of -# the file that contains the anonymous namespace. By default anonymous namespace -# are hidden. -# The default value is: NO. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all -# undocumented members inside documented classes or files. If set to NO these -# members will be included in the various overviews, but no documentation -# section is generated. This option has no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. If set -# to NO, these classes will be included in the various overviews. This option -# has no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# (class|struct|union) declarations. If set to NO, these declarations will be -# included in the documentation. -# The default value is: NO. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any -# documentation blocks found inside the body of a function. If set to NO, these -# blocks will be appended to the function's detailed documentation block. -# The default value is: NO. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation that is typed after a -# \internal command is included. If the tag is set to NO then the documentation -# will be excluded. Set it to YES to include the internal documentation. -# The default value is: NO. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES, upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. -# The default value is: system dependent. - -CASE_SENSE_NAMES = NO - -# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with -# their full class and namespace scopes in the documentation. If set to YES, the -# scope will be hidden. -# The default value is: NO. - -HIDE_SCOPE_NAMES = NO - -# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will -# append additional text to a page's title, such as Class Reference. If set to -# YES the compound reference will be hidden. -# The default value is: NO. - -HIDE_COMPOUND_REFERENCE= NO - -# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of -# the files that are included by a file in the documentation of that file. -# The default value is: YES. - -SHOW_INCLUDE_FILES = YES - -# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each -# grouped member an include statement to the documentation, telling the reader -# which file to include in order to use the member. -# The default value is: NO. - -SHOW_GROUPED_MEMB_INC = NO - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include -# files with double quotes in the documentation rather than with sharp brackets. -# The default value is: NO. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the -# documentation for inline members. -# The default value is: YES. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the -# (detailed) documentation of file and class members alphabetically by member -# name. If set to NO, the members will appear in declaration order. -# The default value is: YES. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief -# descriptions of file, namespace and class members alphabetically by member -# name. If set to NO, the members will appear in declaration order. Note that -# this will also influence the order of the classes in the class list. -# The default value is: NO. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the -# (brief and detailed) documentation of class members so that constructors and -# destructors are listed first. If set to NO the constructors will appear in the -# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. -# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief -# member documentation. -# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting -# detailed member documentation. -# The default value is: NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy -# of group names into alphabetical order. If set to NO the group names will -# appear in their defined order. -# The default value is: NO. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by -# fully-qualified names, including namespaces. If set to NO, the class list will -# be sorted only by class name, not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the alphabetical -# list. -# The default value is: NO. - -SORT_BY_SCOPE_NAME = NO - -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper -# type resolution of all parameters of a function it will reject a match between -# the prototype and the implementation of a member function even if there is -# only one candidate or it is obvious which candidate to choose by doing a -# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still -# accept a match between prototype and implementation in such cases. -# The default value is: NO. - -STRICT_PROTO_MATCHING = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo -# list. This list is created by putting \todo commands in the documentation. -# The default value is: YES. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test -# list. This list is created by putting \test commands in the documentation. -# The default value is: YES. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug -# list. This list is created by putting \bug commands in the documentation. -# The default value is: YES. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) -# the deprecated list. This list is created by putting \deprecated commands in -# the documentation. -# The default value is: YES. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional documentation -# sections, marked by \if ... \endif and \cond -# ... \endcond blocks. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the -# initial value of a variable or macro / define can have for it to appear in the -# documentation. If the initializer consists of more lines than specified here -# it will be hidden. Use a value of 0 to hide initializers completely. The -# appearance of the value of individual variables and macros / defines can be -# controlled using \showinitializer or \hideinitializer command in the -# documentation regardless of this setting. -# Minimum value: 0, maximum value: 10000, default value: 30. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at -# the bottom of the documentation of classes and structs. If set to YES, the -# list will mention the files that were used to generate the documentation. -# The default value is: YES. - -SHOW_USED_FILES = YES - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This -# will remove the Files entry from the Quick Index and from the Folder Tree View -# (if specified). -# The default value is: YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces -# page. This will remove the Namespaces entry from the Quick Index and from the -# Folder Tree View (if specified). -# The default value is: YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command command input-file, where command is the value of the -# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided -# by doxygen. Whatever the program writes to standard output is used as the file -# version. For an example see the documentation. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. To create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. You can -# optionally specify a file name after the option, if omitted DoxygenLayout.xml -# will be used as the name of the layout file. -# -# Note that if you run doxygen from a directory containing a file called -# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE -# tag is left empty. - -LAYOUT_FILE = - -# The CITE_BIB_FILES tag can be used to specify one or more bib files containing -# the reference definitions. This must be a list of .bib files. The .bib -# extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. -# For LaTeX the style of the bibliography can be controlled using -# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the -# search path. See also \cite for info how to create references. - -CITE_BIB_FILES = - -#--------------------------------------------------------------------------- -# Configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated to -# standard output by doxygen. If QUIET is set to YES this implies that the -# messages are off. -# The default value is: NO. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES -# this implies that the warnings are on. -# -# Tip: Turn warnings on while writing the documentation. -# The default value is: YES. - -WARNINGS = YES - -# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate -# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag -# will automatically be disabled. -# The default value is: YES. - -WARN_IF_UNDOCUMENTED = YES - -# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some parameters -# in a documented function, or documenting parameters that don't exist or using -# markup commands wrongly. -# The default value is: YES. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that -# are documented, but have no documentation for their parameters or return -# value. If set to NO, doxygen will only warn about wrong or incomplete -# parameter documentation, but not about the absence of documentation. -# The default value is: NO. - -WARN_NO_PARAMDOC = NO - -# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when -# a warning is encountered. -# The default value is: NO. - -WARN_AS_ERROR = NO - -# The WARN_FORMAT tag determines the format of the warning messages that doxygen -# can produce. The string should contain the $file, $line, and $text tags, which -# will be replaced by the file and line number from which the warning originated -# and the warning text. Optionally the format may contain $version, which will -# be replaced by the version of the file (if it could be obtained via -# FILE_VERSION_FILTER) -# The default value is: $file:$line: $text. - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning and error -# messages should be written. If left blank the output is written to standard -# error (stderr). - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# Configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag is used to specify the files and/or directories that contain -# documented source files. You may enter file names like myfile.cpp or -# directories like /usr/src/myproject. Separate the files or directories with -# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING -# Note: If this tag is empty the current directory is searched. - -INPUT = ./include - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses -# libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: https://www.gnu.org/software/libiconv/) for the list of -# possible encodings. -# The default value is: UTF-8. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and -# *.h) to filter out the source-files in the directories. -# -# Note that for custom extensions or not directly supported extensions you also -# need to set EXTENSION_MAPPING for the extension otherwise the files are not -# read by doxygen. -# -# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, -# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, -# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, -# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, -# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf. - -FILE_PATTERNS = *.c \ - *.cc \ - *.cxx \ - *.cpp \ - *.c++ \ - *.java \ - *.ii \ - *.ixx \ - *.ipp \ - *.i++ \ - *.inl \ - *.idl \ - *.ddl \ - *.odl \ - *.h \ - *.hh \ - *.hxx \ - *.hpp \ - *.h++ \ - *.cs \ - *.d \ - *.php \ - *.php4 \ - *.php5 \ - *.phtml \ - *.inc \ - *.m \ - *.markdown \ - *.md \ - *.mm \ - *.dox \ - *.py \ - *.pyw \ - *.f90 \ - *.f95 \ - *.f03 \ - *.f08 \ - *.f \ - *.for \ - *.tcl \ - *.vhd \ - *.vhdl \ - *.ucf \ - *.qsf - -# The RECURSIVE tag can be used to specify whether or not subdirectories should -# be searched for input files as well. -# The default value is: NO. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should be -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. -# -# Note that relative paths are relative to the directory from which doxygen is -# run. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or -# directories that are symbolic links (a Unix file system feature) are excluded -# from the input. -# The default value is: NO. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories for example use the pattern */test/* - -EXCLUDE_PATTERNS = */GoogleTest-prefix/* \ - */lib/* \ - */build/* \ - */bin/* \ - */tests/test_project/* - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories use the pattern */test/* - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or directories -# that contain example code fragments that are included (see the \include -# command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank all -# files are included. - -EXAMPLE_PATTERNS = * - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude commands -# irrespective of the value of the RECURSIVE tag. -# The default value is: NO. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or directories -# that contain images that are to be included in the documentation (see the -# \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command: -# -# -# -# where is the value of the INPUT_FILTER tag, and is the -# name of an input file. Doxygen will then use the output that the filter -# program writes to standard output. If FILTER_PATTERNS is specified, this tag -# will be ignored. -# -# Note that the filter must not add or remove lines; it is applied before the -# code is scanned, but not when the output code is generated. If lines are added -# or removed, the anchors will not be placed correctly. -# -# Note that for custom extensions or not directly supported extensions you also -# need to set EXTENSION_MAPPING for the extension otherwise the files are not -# properly processed by doxygen. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: pattern=filter -# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how -# filters are used. If the FILTER_PATTERNS tag is empty or if none of the -# patterns match the file name, INPUT_FILTER is applied. -# -# Note that for custom extensions or not directly supported extensions you also -# need to set EXTENSION_MAPPING for the extension otherwise the files are not -# properly processed by doxygen. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will also be used to filter the input files that are used for -# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). -# The default value is: NO. - -FILTER_SOURCE_FILES = NO - -# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file -# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and -# it is also possible to disable source filtering for a specific pattern using -# *.ext= (so without naming a filter). -# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. - -FILTER_SOURCE_PATTERNS = - -# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that -# is part of the input, its contents will be placed on the main page -# (index.html). This can be useful if you have a project on for instance GitHub -# and want to reuse the introduction page also for the doxygen output. - -USE_MDFILE_AS_MAINPAGE = - -#--------------------------------------------------------------------------- -# Configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will be -# generated. Documented entities will be cross-referenced with these sources. -# -# Note: To get rid of all source code in the generated output, make sure that -# also VERBATIM_HEADERS is set to NO. -# The default value is: NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body of functions, -# classes and enums directly into the documentation. -# The default value is: NO. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any -# special comment blocks from generated source code fragments. Normal C, C++ and -# Fortran comments will always remain visible. -# The default value is: YES. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES then for each documented -# function all documented functions referencing it will be listed. -# The default value is: NO. - -REFERENCED_BY_RELATION = NO - -# If the REFERENCES_RELATION tag is set to YES then for each documented function -# all documented entities called/used by that function will be listed. -# The default value is: NO. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set -# to YES then the hyperlinks from functions in REFERENCES_RELATION and -# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will -# link to the documentation. -# The default value is: YES. - -REFERENCES_LINK_SOURCE = YES - -# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the -# source code will show a tooltip with additional information such as prototype, -# brief description and links to the definition and documentation. Since this -# will make the HTML file larger and loading of large files a bit slower, you -# can opt to disable this feature. -# The default value is: YES. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -SOURCE_TOOLTIPS = YES - -# If the USE_HTAGS tag is set to YES then the references to source code will -# point to the HTML generated by the htags(1) tool instead of doxygen built-in -# source browser. The htags tool is part of GNU's global source tagging system -# (see https://www.gnu.org/software/global/global.html). You will need version -# 4.8.6 or higher. -# -# To use it do the following: -# - Install the latest version of global -# - Enable SOURCE_BROWSER and USE_HTAGS in the config file -# - Make sure the INPUT points to the root of the source tree -# - Run doxygen as normal -# -# Doxygen will invoke htags (and that will in turn invoke gtags), so these -# tools must be available from the command line (i.e. in the search path). -# -# The result: instead of the source browser generated by doxygen, the links to -# source code will now point to the output of htags. -# The default value is: NO. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a -# verbatim copy of the header file for each class for which an include is -# specified. Set to NO to disable this. -# See also: Section \class. -# The default value is: YES. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# Configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all -# compounds will be generated. Enable this if the project contains a lot of -# classes, structs, unions or interfaces. -# The default value is: YES. - -ALPHABETICAL_INDEX = YES - -# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in -# which the alphabetical index list will be split. -# Minimum value: 1, maximum value: 20, default value: 5. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all classes will -# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag -# can be used to specify a prefix (or a list of prefixes) that should be ignored -# while generating the index headers. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output -# The default value is: YES. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a -# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of -# it. -# The default directory is: html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each -# generated HTML page (for example: .htm, .php, .asp). -# The default value is: .html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a user-defined HTML header file for -# each generated HTML page. If the tag is left blank doxygen will generate a -# standard header. -# -# To get valid HTML the header file that includes any scripts and style sheets -# that doxygen needs, which is dependent on the configuration options used (e.g. -# the setting GENERATE_TREEVIEW). It is highly recommended to start with a -# default header using -# doxygen -w html new_header.html new_footer.html new_stylesheet.css -# YourConfigFile -# and then modify the file new_header.html. See also section "Doxygen usage" -# for information on how to generate the default header that doxygen normally -# uses. -# Note: The header is subject to change so you typically have to regenerate the -# default header when upgrading to a newer version of doxygen. For a description -# of the possible markers and block names see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each -# generated HTML page. If the tag is left blank doxygen will generate a standard -# footer. See HTML_HEADER for more information on how to generate a default -# footer and what special commands can be used inside the footer. See also -# section "Doxygen usage" for information on how to generate the default footer -# that doxygen normally uses. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style -# sheet that is used by each HTML page. It can be used to fine-tune the look of -# the HTML output. If left blank doxygen will generate a default style sheet. -# See also section "Doxygen usage" for information on how to generate the style -# sheet that doxygen normally uses. -# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as -# it is more robust and this tag (HTML_STYLESHEET) will in the future become -# obsolete. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_STYLESHEET = - -# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined -# cascading style sheets that are included after the standard style sheets -# created by doxygen. Using this option one can overrule certain style aspects. -# This is preferred over using HTML_STYLESHEET since it does not replace the -# standard style sheet and is therefore more robust against future updates. -# Doxygen will copy the style sheet files to the output directory. -# Note: The order of the extra style sheet files is of importance (e.g. the last -# style sheet in the list overrules the setting of the previous ones in the -# list). For an example see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_STYLESHEET = - -# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or -# other source files which should be copied to the HTML output directory. Note -# that these files will be copied to the base HTML output directory. Use the -# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these -# files. In the HTML_STYLESHEET file, use the file name only. Also note that the -# files will be copied as-is; there are no commands or markers available. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_FILES = - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen -# will adjust the colors in the style sheet and background images according to -# this color. Hue is specified as an angle on a colorwheel, see -# https://en.wikipedia.org/wiki/Hue for more information. For instance the value -# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 -# purple, and 360 is red again. -# Minimum value: 0, maximum value: 359, default value: 220. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors -# in the HTML output. For a value of 0 the output will use grayscales only. A -# value of 255 will produce the most vivid colors. -# Minimum value: 0, maximum value: 255, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the -# luminance component of the colors in the HTML output. Values below 100 -# gradually make the output lighter, whereas values above 100 make the output -# darker. The value divided by 100 is the actual gamma applied, so 80 represents -# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not -# change the gamma. -# Minimum value: 40, maximum value: 240, default value: 80. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting this -# to YES can help to show when doxygen was last run and thus if the -# documentation is up to date. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_TIMESTAMP = NO - -# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML -# documentation will contain a main index with vertical navigation menus that -# are dynamically created via Javascript. If disabled, the navigation index will -# consists of multiple levels of tabs that are statically embedded in every HTML -# page. Disable this option to support browsers that do not have Javascript, -# like the Qt help browser. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_DYNAMIC_MENUS = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_DYNAMIC_SECTIONS = NO - -# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries -# shown in the various tree structured indices initially; the user can expand -# and collapse entries dynamically later on. Doxygen will expand the tree to -# such a level that at most the specified number of entries are visible (unless -# a fully collapsed tree already exceeds this amount). So setting the number of -# entries 1 will produce a full collapsed tree by default. 0 is a special value -# representing an infinite number of entries and will result in a full expanded -# tree by default. -# Minimum value: 0, maximum value: 9999, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_INDEX_NUM_ENTRIES = 100 - -# If the GENERATE_DOCSET tag is set to YES, additional index files will be -# generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: https://developer.apple.com/tools/xcode/), introduced with -# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a -# Makefile in the HTML output directory. Running make will produce the docset in -# that directory and running make install will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See https://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_DOCSET = NO - -# This tag determines the name of the docset feed. A documentation feed provides -# an umbrella under which multiple documentation sets from a single provider -# (such as a company or product suite) can be grouped. -# The default value is: Doxygen generated docs. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# This tag specifies a string that should uniquely identify the documentation -# set bundle. This should be a reverse domain-name style string, e.g. -# com.mycompany.MyDocSet. Doxygen will append .docset to the name. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify -# the documentation publisher. This should be a reverse domain-name style -# string, e.g. com.mycompany.MyDocSet.documentation. -# The default value is: org.doxygen.Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. -# The default value is: Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three -# additional HTML index files: index.hhp, index.hhc, and index.hhk. The -# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on -# Windows. -# -# The HTML Help Workshop contains a compiler that can convert all HTML output -# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML -# files are now used as the Windows 98 help format, and will replace the old -# Windows help format (.hlp) on all Windows platforms in the future. Compressed -# HTML files also contain an index, a table of contents, and you can search for -# words in the documentation. The HTML workshop also contains a viewer for -# compressed HTML files. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_HTMLHELP = NO - -# The CHM_FILE tag can be used to specify the file name of the resulting .chm -# file. You can add a path in front of the file if the result should not be -# written to the html output directory. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_FILE = - -# The HHC_LOCATION tag can be used to specify the location (absolute path -# including file name) of the HTML help compiler (hhc.exe). If non-empty, -# doxygen will try to run the HTML help compiler on the generated index.hhp. -# The file has to be specified with full path. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -HHC_LOCATION = - -# The GENERATE_CHI flag controls if a separate .chi index file is generated -# (YES) or that it should be included in the master .chm file (NO). -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -GENERATE_CHI = NO - -# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) -# and project file content. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_INDEX_ENCODING = - -# The BINARY_TOC flag controls whether a binary table of contents is generated -# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it -# enables the Previous and Next buttons. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members to -# the table of contents of the HTML help documentation and to the tree view. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that -# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help -# (.qch) of the generated HTML documentation. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify -# the file name of the resulting .qch file. The path specified is relative to -# the HTML output folder. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help -# Project output. For more information please see Qt Help Project / Namespace -# (see: http://doc.qt.io/qt-4.8/qthelpproject.html#namespace). -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt -# Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: http://doc.qt.io/qt-4.8/qthelpproject.html#virtual-folders). -# The default value is: doc. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_VIRTUAL_FOLDER = doc - -# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom -# filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://doc.qt.io/qt-4.8/qthelpproject.html#custom-filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://doc.qt.io/qt-4.8/qthelpproject.html#custom-filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's filter section matches. Qt Help Project / Filter Attributes (see: -# http://doc.qt.io/qt-4.8/qthelpproject.html#filter-attributes). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_SECT_FILTER_ATTRS = - -# The QHG_LOCATION tag can be used to specify the location of Qt's -# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the -# generated .qhp file. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be -# generated, together with the HTML files, they form an Eclipse help plugin. To -# install this plugin and make it available under the help contents menu in -# Eclipse, the contents of the directory containing the HTML and XML files needs -# to be copied into the plugins directory of eclipse. The name of the directory -# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. -# After copying Eclipse needs to be restarted before the help appears. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the Eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have this -# name. Each documentation set should have its own identifier. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# If you want full control over the layout of the generated HTML pages it might -# be necessary to disable the index and replace it with your own. The -# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top -# of each HTML page. A value of NO enables the index and the value YES disables -# it. Since the tabs in the index contain the same information as the navigation -# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -DISABLE_INDEX = NO - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. If the tag -# value is set to YES, a side panel will be generated containing a tree-like -# index structure (just like the one that is generated for HTML Help). For this -# to work a browser that supports JavaScript, DHTML, CSS and frames is required -# (i.e. any modern browser). Windows users are probably better off using the -# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can -# further fine-tune the look of the index. As an example, the default style -# sheet generated by doxygen has an example that shows how to put an image at -# the root of the tree instead of the PROJECT_NAME. Since the tree basically has -# the same information as the tab index, you could consider setting -# DISABLE_INDEX to YES when enabling this option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_TREEVIEW = YES - -# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that -# doxygen will group on one line in the generated HTML documentation. -# -# Note that a value of 0 will completely suppress the enum values from appearing -# in the overview section. -# Minimum value: 0, maximum value: 20, default value: 4. -# This tag requires that the tag GENERATE_HTML is set to YES. - -ENUM_VALUES_PER_LINE = 4 - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used -# to set the initial width (in pixels) of the frame in which the tree is shown. -# Minimum value: 0, maximum value: 1500, default value: 250. -# This tag requires that the tag GENERATE_HTML is set to YES. - -TREEVIEW_WIDTH = 250 - -# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to -# external symbols imported via tag files in a separate window. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -EXT_LINKS_IN_WINDOW = NO - -# Use this tag to change the font size of LaTeX formulas included as images in -# the HTML documentation. When you change the font size after a successful -# doxygen run you need to manually remove any form_*.png images from the HTML -# output directory to force them to be regenerated. -# Minimum value: 8, maximum value: 50, default value: 10. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANSPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are not -# supported properly for IE 6.0, but are supported on all modern browsers. -# -# Note that when changing this option you need to delete any form_*.png files in -# the HTML output directory before the changes have effect. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_TRANSPARENT = YES - -# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# https://www.mathjax.org) which uses client side Javascript for the rendering -# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX -# installed or if you want to formulas look prettier in the HTML output. When -# enabled you may also need to install MathJax separately and configure the path -# to it using the MATHJAX_RELPATH option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -USE_MATHJAX = NO - -# When MathJax is enabled you can set the default output format to be used for -# the MathJax output. See the MathJax site (see: -# http://docs.mathjax.org/en/latest/output.html) for more details. -# Possible values are: HTML-CSS (which is slower, but has the best -# compatibility), NativeMML (i.e. MathML) and SVG. -# The default value is: HTML-CSS. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_FORMAT = HTML-CSS - -# When MathJax is enabled you need to specify the location relative to the HTML -# output directory using the MATHJAX_RELPATH option. The destination directory -# should contain the MathJax.js script. For instance, if the mathjax directory -# is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax -# Content Delivery Network so you can quickly see the result without installing -# MathJax. However, it is strongly recommended to install a local copy of -# MathJax from https://www.mathjax.org before deployment. -# The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_RELPATH = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/ - -# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax -# extension names that should be enabled during MathJax rendering. For example -# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_EXTENSIONS = - -# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces -# of code that will be used on startup of the MathJax code. See the MathJax site -# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an -# example see the documentation. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_CODEFILE = - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box for -# the HTML output. The underlying search engine uses javascript and DHTML and -# should work on any modern browser. Note that when using HTML help -# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) -# there is already a search function so this one should typically be disabled. -# For large projects the javascript based search engine can be slow, then -# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to -# search using the keyboard; to jump to the search box use + S -# (what the is depends on the OS and browser, but it is typically -# , /
Unity services not yet initialized. Call UnityServices.InitializeAsync() before starting data collection"); - return; - } - - if (!Application.isEditor) - AnalyticsService.Instance.StartDataCollection(); - -#if DEBUG_ANALYTICS - AnalyticsDebug("Data collection started"); -#endif - } - - /// Tells unity analytics to stop collecting data - public static void StopDataCollection() { - if (UnityServices.State != ServicesInitializationState.Initialized) { - Debug.LogError( - "ANALYTICS:
Unity services not yet initialized. Call UnityServices.InitializeAsync() before starting data collection"); - return; - } - - if (!Application.isEditor) - AnalyticsService.Instance.StopDataCollection(); - -#if DEBUG_ANALYTICS - AnalyticsDebug("Data collection stopped"); -#endif - } - - /// Records a custom event - /// The name of the event - /// The parameters sent with the event - public static async void LogCustomEvent(AnalyticsEvent name, params(string name, object data)[] parameters) { - if (!_useAnalytics) - return; - - Dictionary parameterDictionary = null; - if (parameters.Length > 0) - parameterDictionary = parameters.ToDictionary(x => x.name, x => x.data); - - // Wait until unity services are initialized - while (UnityServices.State != ServicesInitializationState.Initialized) - await Task.Delay(1000); - -#if DEBUG_ANALYTICS - AnalyticsDebug( - $"Logged custom event \"{name}\"{((parameterDictionary != null) ? $" with parameters: {string.Join(", ", parameterDictionary)}" : "")}"); -#endif - - if (Application.isEditor) - return; - - if (parameterDictionary == null) - AnalyticsService.Instance.CustomData(name.ToString()); - else - AnalyticsService.Instance.CustomData(name.ToString(), parameterDictionary); - } - - /// Debug.Log with a template, checks if DEBUG_ANALYTICS is #defined - private static void AnalyticsDebug(string message) { -#if DEBUG_ANALYTICS - Debug.Log($"ANALYTICS:
{message}"); -#endif - } - } - - /// - /// A specific custom event. Make sure to add new events to the event manager on the - /// Unity Dashboard - /// - public enum AnalyticsEvent { - ModalCreated, - PanelCreated, - ActiveModalClosed, - PanelClosed, - ExitedToMenu, - SettingsSaved, - SettingsReset, - RobotSpawned, - FieldSpawned, - MatchStarted, - MatchEnded, - DrivetrainSwitched, - ScoringZoneUpdated - } -} diff --git a/engine/Assets/Scripts/Analytics/AnalyticsManager.cs.meta b/engine/Assets/Scripts/Analytics/AnalyticsManager.cs.meta deleted file mode 100644 index ca7f0f66d3..0000000000 --- a/engine/Assets/Scripts/Analytics/AnalyticsManager.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: a18b9f7fdfab4fcbb77b067208431e5c -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Attributes.meta b/engine/Assets/Scripts/Attributes.meta deleted file mode 100644 index 483e24926e..0000000000 --- a/engine/Assets/Scripts/Attributes.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 714aa0edfe854a74a35f512e702398b8 -timeCreated: 1624312288 \ No newline at end of file diff --git a/engine/Assets/Scripts/Attributes.meta~HEAD b/engine/Assets/Scripts/Attributes.meta~HEAD deleted file mode 100644 index a1baa41fea..0000000000 --- a/engine/Assets/Scripts/Attributes.meta~HEAD +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: db5b3c88a9112df48b6933542daf5e1e -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Attributes.meta~HEAD.meta b/engine/Assets/Scripts/Attributes.meta~HEAD.meta deleted file mode 100644 index 8a53c4364b..0000000000 --- a/engine/Assets/Scripts/Attributes.meta~HEAD.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: ccba97665fe5e194a93b3dca5d655660 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Attributes/ContextMenuOptionAttribute.cs b/engine/Assets/Scripts/Attributes/ContextMenuOptionAttribute.cs deleted file mode 100644 index b245a34ea0..0000000000 --- a/engine/Assets/Scripts/Attributes/ContextMenuOptionAttribute.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.UI; -using Synthesis.UI; - -namespace Synthesis.Attributes { - public class ContextMenuOptionAttribute : Attribute { - public string Title { get; private set; } = string.Empty; - public Action Callback { get; private set; } = null; - public Sprite Icon { get; private set; } = null; - - public ContextMenuOptionAttribute() {} - - public ContextMenuOptionAttribute(string title) { - Title = title; - } - - public ContextMenuOptionAttribute(string title, string icon) { - Title = title; - Icon = (Sprite) typeof(ImageManager).GetProperty(icon).GetValue(null); - } - - public ContextMenuOptionAttribute(string title, Action callback) { - Title = title; - Callback = callback; - } - - public ContextMenuOptionAttribute(string title, string icon, Action callback) { - Title = title; - Icon = (Sprite) typeof(ImageManager).GetProperty(icon).GetValue(null); - Callback = callback; - } - } -} diff --git a/engine/Assets/Scripts/Attributes/ContextMenuOptionAttribute.cs.meta b/engine/Assets/Scripts/Attributes/ContextMenuOptionAttribute.cs.meta deleted file mode 100644 index 8a058e10e2..0000000000 --- a/engine/Assets/Scripts/Attributes/ContextMenuOptionAttribute.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: edd982ecb8bf9a94c88704c85f24987b -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Attributes/ControllableInputAttribute.cs b/engine/Assets/Scripts/Attributes/ControllableInputAttribute.cs deleted file mode 100644 index 0ca507a7b4..0000000000 --- a/engine/Assets/Scripts/Attributes/ControllableInputAttribute.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -namespace Synthesis.Attributes { - [AttributeUsage(AttributeTargets.Property)] - public class ControllableInputAttribute : Attribute { - public string Name { get; private set; } = string.Empty; - - public ControllableInputAttribute() {} - - public ControllableInputAttribute(string name) { - Name = name; - } - } -} diff --git a/engine/Assets/Scripts/Attributes/ControllableInputAttribute.cs.meta b/engine/Assets/Scripts/Attributes/ControllableInputAttribute.cs.meta deleted file mode 100644 index a1e1dfff06..0000000000 --- a/engine/Assets/Scripts/Attributes/ControllableInputAttribute.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 8a370755af4b7ac47afdfcd41f9061e3 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/AudioManager.cs b/engine/Assets/Scripts/AudioManager.cs deleted file mode 100644 index 5cc7c8dd03..0000000000 --- a/engine/Assets/Scripts/AudioManager.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using Modes.MatchMode; -using SynthesisAPI.EventBus; -using UnityEngine; - -public class AudioManager : MonoBehaviour { - private AudioSource source; - private EventBus.EventCallback startCallback; - private EventBus.EventCallback endCallback; - - public void Start() { - source = gameObject.GetComponent(); - - startCallback = e => { - MatchStateMachine.OnStateStarted onStateStarted = (MatchStateMachine.OnStateStarted) e; - Type stateType = onStateStarted.state.GetType(); - if (stateType == typeof(MatchStateMachine.Auto)) { - source.clip = SynthesisAssetCollection.GetAudioClip("Start_Auto"); - source.Play(); - } else if (stateType == typeof(MatchStateMachine.Teleop)) { - source.clip = SynthesisAssetCollection.GetAudioClip("Start_Teleop"); - source.Play(); - } else if (stateType == typeof(MatchStateMachine.Endgame)) { - source.clip = SynthesisAssetCollection.GetAudioClip("Start_of_End_Game"); - source.Play(); - } - }; - - endCallback = e => { - MatchStateMachine.OnStateEnded onStateEnded = (MatchStateMachine.OnStateEnded) e; - Type stateType = onStateEnded.state.GetType(); - if (stateType == typeof(MatchStateMachine.Endgame)) { - source.clip = SynthesisAssetCollection.GetAudioClip("Match_End"); - source.Play(); - } - }; - - EventBus.NewTypeListener(startCallback); - EventBus.NewTypeListener(endCallback); - } - - public void OnDestroy() { - EventBus.RemoveTypeListener(startCallback); - EventBus.RemoveTypeListener(endCallback); - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/AudioManager.cs.meta b/engine/Assets/Scripts/AudioManager.cs.meta deleted file mode 100644 index 36ace4a29a..0000000000 --- a/engine/Assets/Scripts/AudioManager.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: e58fd050210f4362b97ef477a5d9c134 -timeCreated: 1688582090 \ No newline at end of file diff --git a/engine/Assets/Scripts/AutoUpdater.cs b/engine/Assets/Scripts/AutoUpdater.cs deleted file mode 100644 index ae711c9099..0000000000 --- a/engine/Assets/Scripts/AutoUpdater.cs +++ /dev/null @@ -1,76 +0,0 @@ -using Assets.Scripts; -using Newtonsoft.Json; -using System.Net; -using UnityEngine; -using UnityEngine.UI; -using System.Security.Cryptography.X509Certificates; -using System; -using System.Net.Security; -using System.Diagnostics; -using Synthesis.UI.Panels; -using Debug = UnityEngine.Debug; -using Synthesis.UI.Dynamic; - -public class AutoUpdater : MonoBehaviour { - public static bool UpdateAvailable { get; private set; } = false; - public static string UpdaterLink { get; private set; } - - public const string LocalVersion = "6.1.0.0"; // must be a version value - - private void Start() { - if (CheckConnection()) { - WebClient client = new WebClient(); - ServicePointManager.ServerCertificateValidationCallback = MyRemoteCertificateValidationCallback; - var json = new WebClient().DownloadString( - "https://raw.githubusercontent.com/Autodesk/synthesis/master/VersionManager.json"); - VersionManager update = JsonConvert.DeserializeObject(json); - var updater = update.URL; - - var localVersion = new Version(LocalVersion); - var globalVersion = new Version(update.Version); - - var check = localVersion.CompareTo(globalVersion); - - if (check < 0) { // if outdated, set update prompt to true - Debug.Log($"Version {globalVersion.ToString()} available"); - UpdateAvailable = true; - UpdaterLink = updater; - DynamicUIManager.CreateModal(); - } - } - } - - public bool CheckConnection() { - try { - WebClient client = new WebClient(); - ServicePointManager.ServerCertificateValidationCallback = MyRemoteCertificateValidationCallback; - - using (client.OpenRead("https://raw.githubusercontent.com/Autodesk/synthesis/master/VersionManager.json")) { - return true; - } - } catch { - return false; - } - } - - public bool MyRemoteCertificateValidationCallback( - System.Object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { - bool isOk = true; - // If there are errors in the certificate chain, look at each error to determine the cause. - if (sslPolicyErrors != SslPolicyErrors.None) { - for (int i = 0; i < chain.ChainStatus.Length; i++) { - if (chain.ChainStatus[i].Status != X509ChainStatusFlags.RevocationStatusUnknown) { - chain.ChainPolicy.RevocationFlag = X509RevocationFlag.EntireChain; - chain.ChainPolicy.RevocationMode = X509RevocationMode.Online; - chain.ChainPolicy.UrlRetrievalTimeout = new TimeSpan(0, 1, 0); - chain.ChainPolicy.VerificationFlags = X509VerificationFlags.AllFlags; - bool chainIsValid = chain.Build((X509Certificate2) certificate); - if (!chainIsValid) { - isOk = false; - } - } - } - } - return isOk; - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/AutoUpdater.cs.meta b/engine/Assets/Scripts/AutoUpdater.cs.meta deleted file mode 100644 index 850a49e897..0000000000 --- a/engine/Assets/Scripts/AutoUpdater.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 9672af1c048041c49873cb09e0b71584 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Behaviors.meta b/engine/Assets/Scripts/Behaviors.meta deleted file mode 100644 index c430847b30..0000000000 --- a/engine/Assets/Scripts/Behaviors.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: f0d53982ca164d35b4dfcff21864ad2a -timeCreated: 1629439164 \ No newline at end of file diff --git a/engine/Assets/Scripts/Behaviors/ArcadeDriveBehaviour.cs b/engine/Assets/Scripts/Behaviors/ArcadeDriveBehaviour.cs deleted file mode 100644 index 09c1cc425c..0000000000 --- a/engine/Assets/Scripts/Behaviors/ArcadeDriveBehaviour.cs +++ /dev/null @@ -1,162 +0,0 @@ -using System.Collections.Generic; -using Synthesis.PreferenceManager; -using Synthesis.UI.Dynamic; -using SynthesisAPI.EventBus; -using SynthesisAPI.InputManager; -using SynthesisAPI.InputManager.Inputs; -using SynthesisAPI.Simulation; -using UnityEngine; -using Math = SynthesisAPI.Utilities.Math; - -#nullable enable - -namespace Synthesis { - public class ArcadeDriveBehaviour : SimBehaviour { - internal const string FORWARD = "Arcade Forward"; - internal const string BACKWARD = "Arcade Backward"; - internal const string LEFT = "Arcade Left"; - internal const string RIGHT = "Arcade Right"; - private readonly string forward = FORWARD; - private readonly string backward = BACKWARD; - private readonly string left = LEFT; - private readonly string right = RIGHT; - - private readonly List _leftWheels; - private readonly List _rightWheels; - - private double _leftSpeed; - private double _rightSpeed; - - private float _xSpeed; - private float _zRot; - - private bool _squareInputs; // TODO: Add ability to modify this - - private bool _didUpdate; - - private byte _keyMask; - - private const double DEADBAND = 0.1; - - public double speedMult = 1.0f; - - private RobotSimObject _robot; - - public ArcadeDriveBehaviour( - string simObjectId, List leftWheels, List rightWheels, string inputName = "") - : base(simObjectId) { - if (inputName == "") - inputName = simObjectId; - - _robot = (SimulationManager.SimulationObjects[SimObjectId] as RobotSimObject)!; - - _leftWheels = leftWheels; - _rightWheels = rightWheels; - - forward = _robot.RobotGUID + FORWARD; - backward = _robot.RobotGUID + BACKWARD; - left = _robot.RobotGUID + LEFT; - right = _robot.RobotGUID + RIGHT; - - InitInputs(GetInputs()); - - EventBus.NewTypeListener(OnValueInputAssigned); - } - - public (string key, string displayName, Analog input)[] GetInputs() { - return new(string key, string displayName, - Analog input)[] { (forward, FORWARD, TryLoadInput(forward, new Digital("W"))), - (backward, BACKWARD, TryLoadInput(backward, new Digital("S"))), - (left, LEFT, TryLoadInput(left, new Digital("A"))), - (right, RIGHT, TryLoadInput(right, new Digital("D"))) }; - } - - public Analog TryLoadInput(string key, Analog defaultInput) { - // return SimulationPreferences.GetRobotInput(_robot.RobotGUID, key) ?? defaultInput; - - Analog input; - if (InputManager.MappedValueInputs.ContainsKey(key)) { - input = InputManager.GetAnalog(key); - input.ContextBitmask = defaultInput.ContextBitmask; - return input; - } - input = SimulationPreferences.GetRobotInput(MiraId, key); - if (input == null) { - SimulationPreferences.SetRobotInput(MiraId, key, defaultInput); - return defaultInput; - } - return input; - } - - private void OnValueInputAssigned(IEvent tmp) { - ValueInputAssignedEvent args = (tmp as ValueInputAssignedEvent)!; - - if (args.InputKey.Length > MiraId.Length) { - string s = args.InputKey.Remove(0, MiraId.Length); - switch (s) { - case FORWARD: - case BACKWARD: - case LEFT: - case RIGHT: - if (base.MiraId != (MainHUD.SelectedRobot?.RobotGUID ?? string.Empty) || - !((DynamicUIManager.ActiveModal as ChangeInputsModal)?.isSave ?? false)) - return; - SimulationPreferences.SetRobotInput(MiraId, args.InputKey, args.Input); - break; - } - } - } - - public override void Update() { - var forwardInput = InputManager.MappedValueInputs[forward]; - var backwardInput = InputManager.MappedValueInputs[backward]; - var leftInput = InputManager.MappedValueInputs[left]; - var rightInput = InputManager.MappedValueInputs[right]; - - _xSpeed = Mathf.Abs(forwardInput.Value) - Mathf.Abs(backwardInput.Value); - _zRot = Mathf.Abs(rightInput.Value) - Mathf.Abs(leftInput.Value); - - // Deadbanding - _xSpeed = Math.Abs(_xSpeed) > DEADBAND ? _xSpeed : 0; - _zRot = Math.Abs(_zRot) > DEADBAND ? _zRot : 0; - - (_leftSpeed, _rightSpeed) = SolveSpeed(_xSpeed, _zRot, _squareInputs); - foreach (var wheel in _leftWheels) { - wheel.MainInput = _leftSpeed * speedMult; - /* - wheel.MainInput = 1; - */ - } - foreach (var wheel in _rightWheels) { - wheel.MainInput = _rightSpeed * speedMult; - /* - wheel.MainInput = 1; - */ - } - } - - protected override void OnDisable() { - _leftWheels.ForEach(w => w.MainInput = 0); - _rightWheels.ForEach(w => w.MainInput = 0); - } - - // Implementation derived from - // https://github.com/wpilibsuite/allwpilib/blob/362066a9b77f38a2862e306b8119e753b199d4ae/wpilibc/src/main/native/cpp/drive/DifferentialDrive.cpp - protected static (float lSpeed, float rSpeed) SolveSpeed(float xSpeed, float zRot, bool squareInputs) { - if (xSpeed == 0 && zRot == 0) { - return (0, 0); - } - xSpeed = Math.Clamp(xSpeed, -1, 1); - zRot = Math.Clamp(zRot, -1, 1); - - if (squareInputs) { - xSpeed = xSpeed * xSpeed * (xSpeed < 0 ? -1 : 1); - zRot = zRot * zRot * (zRot < 0 ? -1 : 1); - } - - float lSpeed = Mathf.Clamp(xSpeed + zRot, -1f, 1f), rSpeed = Mathf.Clamp(xSpeed - zRot, -1f, 1f); - - return (lSpeed, rSpeed); - } - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/Behaviors/ArcadeDriveBehaviour.cs.meta b/engine/Assets/Scripts/Behaviors/ArcadeDriveBehaviour.cs.meta deleted file mode 100644 index 7b1cec0003..0000000000 --- a/engine/Assets/Scripts/Behaviors/ArcadeDriveBehaviour.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: e8c65bd4866f4f91bfa6f5a5b019134f -timeCreated: 1629675315 \ No newline at end of file diff --git a/engine/Assets/Scripts/Behaviors/GeneralArmBehaviour.cs b/engine/Assets/Scripts/Behaviors/GeneralArmBehaviour.cs deleted file mode 100644 index a2722ff0b0..0000000000 --- a/engine/Assets/Scripts/Behaviors/GeneralArmBehaviour.cs +++ /dev/null @@ -1,97 +0,0 @@ -using System; -using Synthesis.PreferenceManager; -using Synthesis.UI.Dynamic; -using SynthesisAPI.EventBus; -using SynthesisAPI.InputManager; -using SynthesisAPI.InputManager.Inputs; -using SynthesisAPI.Simulation; -using UnityEngine; - -#nullable enable - -namespace Synthesis { - public class GeneralArmBehaviour : SimBehaviour { - private string _forwardInputKey = "_forward"; - private string _reverseInputKey = "_reverse"; - private string _forwardDisplayName = " Forward"; - private string _reverseDisplayName = " Reverse"; - - private RotationalDriver _armDriver; - private float _speedMod = 0.4f; - - private RobotSimObject _robot; - - public GeneralArmBehaviour(string simObjectId, RotationalDriver armDriver) - : base(simObjectId) { // base(simObjectId, GetInputs(this, armSignal)) - - if (armDriver.IsReserved) - throw new Exception("Rotational Driver already reserved"); - armDriver.Reserve(this); - _armDriver = armDriver; - - _robot = (SimulationManager.SimulationObjects[SimObjectId] as RobotSimObject)!; - - _forwardInputKey = _robot.RobotGUID + _armDriver.Signal + _forwardInputKey; - _reverseInputKey = _robot.RobotGUID + _armDriver.Signal + _reverseInputKey; - var name = _armDriver.Name; - _forwardDisplayName = name + _forwardDisplayName; - _reverseDisplayName = name + _reverseDisplayName; - - InitInputs(GetInputs()); - - EventBus.NewTypeListener(OnValueInputAssigned); - } - - public (string key, string displayName, Analog input)[] GetInputs() { - var key = ((RobotSimObject.ControllableJointCounter + 1) % 10).ToString(); - RobotSimObject.ControllableJointCounter++; - return new(string key, string displayName, Analog input)[] { - (_forwardInputKey, _forwardDisplayName, TryLoadInput(_forwardInputKey, new Digital("Alpha" + key))), - (_reverseInputKey, _reverseDisplayName, - TryLoadInput(_reverseInputKey, new Digital("Alpha" + key, (int) ModKey.LeftShift))) - }; - } - - public Analog TryLoadInput(string key, Analog defaultInput) { - Analog input; - if (InputManager.MappedValueInputs.ContainsKey(key)) { - input = InputManager.GetAnalog(key); - input.ContextBitmask = defaultInput.ContextBitmask; - return input; - } - input = SimulationPreferences.GetRobotInput(_robot.RobotGUID, key); - if (input == null) { - SimulationPreferences.SetRobotInput(_robot.RobotGUID, key, defaultInput); - return defaultInput; - } - return input; - } - - private void OnValueInputAssigned(IEvent tmp) { - ValueInputAssignedEvent args = (tmp as ValueInputAssignedEvent)!; - if (args.InputKey.Equals(_forwardInputKey) || args.InputKey.Equals(_reverseInputKey)) { - if (_robot.RobotGUID != (MainHUD.SelectedRobot?.RobotGUID ?? string.Empty) || - !((DynamicUIManager.ActiveModal as ChangeInputsModal)?.isSave ?? false)) - return; - SimulationPreferences.SetRobotInput(_robot.RobotGUID, args.InputKey, args.Input); - } - } - - public override void Update() { - var forw = InputManager.MappedValueInputs[_forwardInputKey]; - var rev = InputManager.MappedValueInputs[_reverseInputKey]; - float val = Mathf.Abs(forw.Value) - Mathf.Abs(rev.Value); - - _armDriver.MainInput = val * _speedMod; - } - - public override void OnRemove() { - _armDriver.MainInput = 0f; - _armDriver.Unreserve(); - } - - protected override void OnDisable() { - _armDriver.MainInput = 0f; - } - } -} diff --git a/engine/Assets/Scripts/Behaviors/GeneralArmBehaviour.cs.meta b/engine/Assets/Scripts/Behaviors/GeneralArmBehaviour.cs.meta deleted file mode 100644 index 31f58dcd57..0000000000 --- a/engine/Assets/Scripts/Behaviors/GeneralArmBehaviour.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 3fac755a57666494db589a93292e8d4e -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Behaviors/GeneralSliderBehaviour.cs b/engine/Assets/Scripts/Behaviors/GeneralSliderBehaviour.cs deleted file mode 100644 index 034b889328..0000000000 --- a/engine/Assets/Scripts/Behaviors/GeneralSliderBehaviour.cs +++ /dev/null @@ -1,86 +0,0 @@ -using Synthesis.PreferenceManager; -using Synthesis.UI.Dynamic; -using SynthesisAPI.EventBus; -using SynthesisAPI.InputManager; -using SynthesisAPI.InputManager.Inputs; -using SynthesisAPI.Simulation; -using UnityEngine; - -#nullable enable - -namespace Synthesis { - public class GeneralSliderBehaviour : SimBehaviour { - private string _forwardInputKey = "_forward"; - private string _reverseInputKey = "_reverse"; - private string _forwardDisplayName = " Forward"; - private string _reverseDisplayName = " Reverse"; - - private LinearDriver _driver; - private RobotSimObject _robot; - - public GeneralSliderBehaviour(string simObjectId, LinearDriver driver) : base(simObjectId) { - _driver = driver; - _robot = (SimulationManager.SimulationObjects[SimObjectId] as RobotSimObject)!; - - _forwardInputKey = _robot.RobotGUID + driver.Signal + _forwardInputKey; - _reverseInputKey = _robot.RobotGUID + driver.Signal + _reverseInputKey; - var name = driver.Name; - _forwardDisplayName = name + _forwardDisplayName; - _reverseDisplayName = name + _reverseDisplayName; - - InitInputs(GetInputs()); - - EventBus.NewTypeListener(OnValueInputAssigned); - } - - public (string key, string displayName, Analog input)[] GetInputs() { - var key = ((RobotSimObject.ControllableJointCounter + 1) % 10).ToString(); - RobotSimObject.ControllableJointCounter++; - return new(string key, string displayName, Analog input)[] { - (_forwardInputKey, _forwardDisplayName, TryLoadInput(_forwardInputKey, new Digital("Alpha" + key))), - (_reverseInputKey, _reverseDisplayName, - TryLoadInput(_reverseInputKey, new Digital("Alpha" + key, (int) ModKey.LeftShift))) - }; - } - - public Analog TryLoadInput(string key, Analog defaultInput) { - Analog input; - if (InputManager.MappedValueInputs.ContainsKey(key)) { - input = InputManager.GetAnalog(key); - input.ContextBitmask = defaultInput.ContextBitmask; - return input; - } - input = SimulationPreferences.GetRobotInput(_robot.RobotGUID, key); - if (input == null) { - SimulationPreferences.SetRobotInput(_robot.RobotGUID, key, defaultInput); - return defaultInput; - } - return input; - } - - private void OnValueInputAssigned(IEvent tmp) { - ValueInputAssignedEvent args = (tmp as ValueInputAssignedEvent)!; - if (args.InputKey.Equals(_forwardInputKey) || args.InputKey.Equals(_reverseInputKey)) { - if (_robot.RobotGUID != (MainHUD.SelectedRobot?.RobotGUID ?? string.Empty) || - !((DynamicUIManager.ActiveModal as ChangeInputsModal)?.isSave ?? false)) - return; - - SimulationPreferences.SetRobotInput(_robot.RobotGUID, args.InputKey, args.Input); - } - - PreferenceManager.PreferenceManager.Save(); - } - - public override void Update() { - var forw = InputManager.MappedValueInputs[_forwardInputKey]; - var rev = InputManager.MappedValueInputs[_reverseInputKey]; - float val = Mathf.Abs(forw.Value) - Mathf.Abs(rev.Value); - - _driver.MainInput = val; - } - - protected override void OnDisable() { - _driver.MainInput = 0f; - } - } -} diff --git a/engine/Assets/Scripts/Behaviors/GeneralSliderBehaviour.cs.meta b/engine/Assets/Scripts/Behaviors/GeneralSliderBehaviour.cs.meta deleted file mode 100644 index 164ee586e0..0000000000 --- a/engine/Assets/Scripts/Behaviors/GeneralSliderBehaviour.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: c42d6ef8187b6794796660ccca1bacfa -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Behaviors/MecanumDriveBehaviour.cs b/engine/Assets/Scripts/Behaviors/MecanumDriveBehaviour.cs deleted file mode 100644 index 111d4be870..0000000000 --- a/engine/Assets/Scripts/Behaviors/MecanumDriveBehaviour.cs +++ /dev/null @@ -1,224 +0,0 @@ -using System.Collections.Generic; -using Google.Protobuf.WellKnownTypes; -using Synthesis.PreferenceManager; -using SynthesisAPI.EventBus; -using SynthesisAPI.InputManager; -using SynthesisAPI.InputManager.Inputs; -using SynthesisAPI.Simulation; -using UnityEngine; - -using Math = System.Math; - -#nullable enable - -namespace Synthesis { - public class MecanumDriveBehaviour : SimBehaviour { - internal const string FORWARD = "Mecanum Forward"; - internal const string BACKWARD = "Mecanum Backward"; - internal const string LEFT = "Mecanum Left"; - internal const string RIGHT = "Mecanum Right"; - internal const string TURN_LEFT = "Mecanum Turn Left"; - internal const string TURN_RIGHT = "Mecanum Turn Right"; - internal const string RESET_FIELD_FORWARD = "Mecanum Reset Forward"; - internal const string TOGGLE_FIELD_CENTRIC = "Toggle Field Centric"; - - private readonly string forward = FORWARD; - private readonly string backward = BACKWARD; - private readonly string left = LEFT; - private readonly string right = RIGHT; - private readonly string turn_left = TURN_LEFT; - private readonly string turn_right = TURN_RIGHT; - private readonly string reset_field_forward = RESET_FIELD_FORWARD; - private readonly string toggle_field_centric = TOGGLE_FIELD_CENTRIC; - - private List _frontLeftWheels; - private List _frontRightWheels; - private List _backRightWheels; - private List _backLeftWheels; - private readonly RobotSimObject _robot; - - private Vector3 _fieldForward; - private bool _fieldCentric = true; - private bool _fieldCentricDown = false; - - /// - /// Create a mecanum drivetrain. - /// - /// Owning SimObject - /// Front-Left wheels - /// Front-Right wheels - /// Back-Right wheels - /// Back-Left wheels - public MecanumDriveBehaviour(RobotSimObject robot, List frontLeft, List frontRight, - List backRight, List backLeft) - : base(robot.Name, false) { - _frontLeftWheels = frontLeft; - _frontRightWheels = frontRight; - _backRightWheels = backRight; - _backLeftWheels = backLeft; - - _robot = robot; - _fieldForward = Vector3.forward; - - forward = _robot.RobotGUID + "Mecanum Forward"; - backward = _robot.RobotGUID + "Mecanum Backward"; - left = _robot.RobotGUID + "Mecanum Left"; - right = _robot.RobotGUID + "Mecanum Right"; - turn_left = _robot.RobotGUID + "Mecanum Turn Left"; - turn_right = _robot.RobotGUID + "Mecanum Turn Right"; - reset_field_forward = _robot.RobotGUID + "Mecanum Reset Forward"; - toggle_field_centric = _robot.RobotGUID + "Toggle Field Centric"; - - InitInputs(GetInputs()); - EventBus.NewTypeListener(OnValueInputAssigned); - - Enabled = true; - } - - public (string key, string name, Analog input)[] GetInputs() { - return new( - string key, string name, Analog input)[] { (forward, FORWARD, TryLoadInput(forward, new Digital("W"))), - (backward, BACKWARD, TryLoadInput(backward, new Digital("S"))), - (left, LEFT, TryLoadInput(left, new Digital("A"))), - (right, RIGHT, TryLoadInput(right, new Digital("D"))), - (turn_left, TURN_LEFT, TryLoadInput(turn_left, new Digital("LeftArrow"))), - (turn_right, TURN_RIGHT, TryLoadInput(turn_right, new Digital("RightArrow"))), - (reset_field_forward, RESET_FIELD_FORWARD, TryLoadInput(reset_field_forward, new Digital("R"))), - (toggle_field_centric, TOGGLE_FIELD_CENTRIC, TryLoadInput(toggle_field_centric, new Digital("T"))) }; - } - - public Analog TryLoadInput(string key, Analog defaultInput) { - Analog input; - if (InputManager.MappedValueInputs.ContainsKey(key)) { - input = InputManager.GetAnalog(key); - input.ContextBitmask = defaultInput.ContextBitmask; - return input; - } - input = SimulationPreferences.GetRobotInput(_robot.RobotGUID, key); - if (input == null) { - SimulationPreferences.SetRobotInput(_robot.RobotGUID, key, defaultInput); - return defaultInput; - } - return input; - } - - private void OnValueInputAssigned(IEvent tmp) { - ValueInputAssignedEvent args = (tmp as ValueInputAssignedEvent)!; - - if (args.InputKey.Length > _robot.RobotGUID.Length) { - string s = args.InputKey.Remove(0, _robot.RobotGUID.Length); - switch (s) { - case FORWARD: - case BACKWARD: - case LEFT: - case RIGHT: - case TURN_LEFT: - case TURN_RIGHT: - case RESET_FIELD_FORWARD: - case TOGGLE_FIELD_CENTRIC: - SimulationPreferences.SetRobotInput(_robot.RobotGUID, args.InputKey, args.Input); - break; - } - } - } - - /// - /// A difference comparison with some wiggle room between the values - /// - /// Value A - /// Value B - /// Allowed difference between them to be considered the same essentially. - /// Exclusive - private bool Diff(float a, float b, float acceptableDelta) { - return Math.Abs(a - b) < acceptableDelta; - } - - public override void Update() { - if (Mathf.Abs(InputManager.MappedValueInputs[reset_field_forward].Value) > 0.5f) - _fieldForward = _robot.GroundedNode.transform.forward; - - var fieldCentricInput = Mathf.Abs(InputManager.MappedValueInputs[toggle_field_centric].Value); - if (_fieldCentricDown ^ (fieldCentricInput > 0.5f)) { - _fieldCentricDown = !_fieldCentricDown; - if (_fieldCentricDown) { - _fieldCentric = !_fieldCentric; - } - } - - Vector3 headingVector = _robot.GroundedNode.transform.forward - - (Vector3.up * Vector3.Dot(Vector3.up, _robot.GroundedNode.transform.forward)); - float headingVectorY = Vector3.Dot(_fieldForward, headingVector); - float headingVectorX = Vector3.Dot(Vector3.Cross(_fieldForward, Vector3.up), headingVector); - float chassisAngle = Mathf.Atan2(headingVectorX, headingVectorY) * Mathf.Rad2Deg; - - var forwardInput = InputManager.MappedValueInputs[forward]; - var backwardInput = InputManager.MappedValueInputs[backward]; - var leftInput = InputManager.MappedValueInputs[left]; - var rightInput = InputManager.MappedValueInputs[right]; - var turnLeftInput = InputManager.MappedValueInputs[turn_left]; - var turnRightInput = InputManager.MappedValueInputs[turn_right]; - - float moveForward = Mathf.Abs(forwardInput.Value) - Mathf.Abs(backwardInput.Value); - float moveStrafe = Mathf.Abs(rightInput.Value) - Mathf.Abs(leftInput.Value); - float moveTurn = Mathf.Abs(turnLeftInput.Value) - Mathf.Abs(turnRightInput.Value); - - moveForward = Diff(moveForward, 0f, 0.1f) ? 0f : moveForward; - moveStrafe = Diff(moveStrafe, 0f, 0.1f) ? 0f : moveStrafe; - moveTurn = Diff(moveTurn, 0f, 0.1f) ? 0f : moveTurn; - - if (_fieldCentric) { - var vec = Quaternion.AngleAxis(chassisAngle, Vector3.up) * new Vector3(moveStrafe, 0f, moveForward); - moveForward = vec.z; - moveStrafe = vec.x; - } - - // Are the inputs basically zero - if (moveForward == 0f && moveTurn == 0f && moveStrafe == 0f) { - _frontLeftWheels.ForEach(x => x.MainInput = 0f); - _frontRightWheels.ForEach(x => x.MainInput = 0f); - _backRightWheels.ForEach(x => x.MainInput = 0f); - _backLeftWheels.ForEach(x => x.MainInput = 0f); - return; - } - - var frontLeftSpeed = moveForward + moveStrafe - moveTurn; - var frontRightSpeed = moveForward - moveStrafe + moveTurn; - var backLeftSpeed = moveForward - moveStrafe - moveTurn; - var backRightSpeed = moveForward + moveStrafe + moveTurn; - - _frontLeftWheels.ForEach(x => x.MainInput = frontLeftSpeed); - _frontRightWheels.ForEach(x => x.MainInput = frontRightSpeed); - _backRightWheels.ForEach(x => x.MainInput = backRightSpeed); - _backLeftWheels.ForEach(x => x.MainInput = backLeftSpeed); - } - - protected override void OnEnable() { - Vector3 northWest = new Vector3(-1, 0, 1).normalized; - Vector3 northEast = new Vector3(1, 0, 1).normalized; - - _frontLeftWheels.ForEach(x => x.LocalRoller = northWest); - _frontRightWheels.ForEach(x => x.LocalRoller = northEast); - _backRightWheels.ForEach(x => x.LocalRoller = northWest); - _backLeftWheels.ForEach(x => x.LocalRoller = northEast); - } - - protected override void OnDisable() { - _frontLeftWheels.ForEach(x => { - x.MainInput = 0f; - x.MatchRollerToWheelType(); - }); - _frontRightWheels.ForEach(x => { - x.MainInput = 0f; - x.MatchRollerToWheelType(); - }); - _backRightWheels.ForEach(x => { - x.MainInput = 0f; - x.MatchRollerToWheelType(); - }); - _backLeftWheels.ForEach(x => { - x.MainInput = 0f; - x.MatchRollerToWheelType(); - }); - } - } -} diff --git a/engine/Assets/Scripts/Behaviors/MecanumDriveBehaviour.cs.meta b/engine/Assets/Scripts/Behaviors/MecanumDriveBehaviour.cs.meta deleted file mode 100644 index 057df72525..0000000000 --- a/engine/Assets/Scripts/Behaviors/MecanumDriveBehaviour.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 1fd5b2e0370614ba0b7a2194a613b593 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Behaviors/OmniDriveBehaviour.cs b/engine/Assets/Scripts/Behaviors/OmniDriveBehaviour.cs deleted file mode 100644 index 99497d9381..0000000000 --- a/engine/Assets/Scripts/Behaviors/OmniDriveBehaviour.cs +++ /dev/null @@ -1,227 +0,0 @@ -using System.Collections.Generic; -using Synthesis.PreferenceManager; -using SynthesisAPI.EventBus; -using SynthesisAPI.InputManager; -using SynthesisAPI.InputManager.Inputs; -using SynthesisAPI.Simulation; -using UnityEngine; -using Logger = SynthesisAPI.Utilities.Logger; -using LogLevel = SynthesisAPI.Utilities.LogLevel; -using Math = System.Math; - -#nullable enable - -namespace Synthesis { - public class OmniDriveBehaviour : SimBehaviour { - internal const string FORWARD = "Omni Forward"; - internal const string BACKWARD = "Omni Backward"; - internal const string LEFT = "Omni Left"; - internal const string RIGHT = "Omni Right"; - internal const string TURN_LEFT = "Omni Turn Left"; - internal const string TURN_RIGHT = "Omni Turn Right"; - internal const string RESET_FIELD_FORWARD = "Omni Reset Forward"; - internal const string TOGGLE_FIELD_CENTRIC = "Toggle Field Centric"; - - private readonly string forward = FORWARD; - private readonly string backward = BACKWARD; - private readonly string left = LEFT; - private readonly string right = RIGHT; - private readonly string turn_left = TURN_LEFT; - private readonly string turn_right = TURN_RIGHT; - private readonly string reset_field_forward = RESET_FIELD_FORWARD; - private readonly string toggle_field_centric = TOGGLE_FIELD_CENTRIC; - - private List _wheels; - private readonly RobotSimObject _robot; - - private Vector3 _fieldForward; - private bool _fieldCentric = true; - private bool _fieldCentricDown = false; - - private float _turnFavor = 1.5f; - - /// - /// Create a mecanum drivetrain. - /// - /// Owning SimObject - /// Front-Left wheels - /// Front-Right wheels - /// Back-Right wheels - /// Back-Left wheels - public OmniDriveBehaviour(RobotSimObject robot, List wheels) : base(robot.Name, false) { - _wheels = wheels; - - _robot = robot; - _fieldForward = Vector3.forward; - - forward = _robot.RobotGUID + "Omni Forward"; - backward = _robot.RobotGUID + "Omni Backward"; - left = _robot.RobotGUID + "Omni Left"; - right = _robot.RobotGUID + "Omni Right"; - turn_left = _robot.RobotGUID + "Omni Turn Left"; - turn_right = _robot.RobotGUID + "Omni Turn Right"; - reset_field_forward = _robot.RobotGUID + "Omni Reset Forward"; - toggle_field_centric = _robot.RobotGUID + "Toggle Field Centric"; - - InitInputs(GetInputs()); - EventBus.NewTypeListener(OnValueInputAssigned); - - Enabled = true; - } - - public (string key, string name, Analog input)[] GetInputs() { - return new( - string key, string name, Analog input)[] { (forward, FORWARD, TryLoadInput(forward, new Digital("W"))), - (backward, BACKWARD, TryLoadInput(backward, new Digital("S"))), - (left, LEFT, TryLoadInput(left, new Digital("A"))), - (right, RIGHT, TryLoadInput(right, new Digital("D"))), - (turn_left, TURN_LEFT, TryLoadInput(turn_left, new Digital("LeftArrow"))), - (turn_right, TURN_RIGHT, TryLoadInput(turn_right, new Digital("RightArrow"))), - (reset_field_forward, RESET_FIELD_FORWARD, TryLoadInput(reset_field_forward, new Digital("R"))), - (toggle_field_centric, TOGGLE_FIELD_CENTRIC, TryLoadInput(toggle_field_centric, new Digital("T"))) }; - } - - public Analog TryLoadInput(string key, Analog defaultInput) { - Analog input; - if (InputManager.MappedValueInputs.ContainsKey(key)) { - input = InputManager.GetAnalog(key); - input.ContextBitmask = defaultInput.ContextBitmask; - return input; - } - input = SimulationPreferences.GetRobotInput(_robot.RobotGUID, key); - if (input == null) { - SimulationPreferences.SetRobotInput(_robot.RobotGUID, key, defaultInput); - return defaultInput; - } - return input; - } - - private void OnValueInputAssigned(IEvent tmp) { - ValueInputAssignedEvent args = (tmp as ValueInputAssignedEvent)!; - - if (args.InputKey.Length > _robot.RobotGUID.Length) { - string s = args.InputKey.Remove(0, _robot.RobotGUID.Length); - switch (s) { - case FORWARD: - case BACKWARD: - case LEFT: - case RIGHT: - case TURN_LEFT: - case TURN_RIGHT: - case RESET_FIELD_FORWARD: - case TOGGLE_FIELD_CENTRIC: - SimulationPreferences.SetRobotInput(_robot.RobotGUID, args.InputKey, args.Input); - break; - } - } - } - - /// - /// A difference comparison with some wiggle room between the values - /// - /// Value A - /// Value B - /// Allowed difference between them to be considered the same essentially. - /// Exclusive - private bool Diff(float a, float b, float acceptableDelta) { - return Math.Abs(a - b) < acceptableDelta; - } - - public override void Update() { - if (Mathf.Abs(InputManager.MappedValueInputs[reset_field_forward].Value) > 0.5f) - _fieldForward = _robot.GroundedNode.transform.forward; - - var fieldCentricInput = Mathf.Abs(InputManager.MappedValueInputs[toggle_field_centric].Value); - if (_fieldCentricDown ^ (fieldCentricInput > 0.5f)) { - _fieldCentricDown = !_fieldCentricDown; - if (_fieldCentricDown) { - _fieldCentric = !_fieldCentric; - } - } - - var forwardInput = InputManager.MappedValueInputs[forward]; - var backwardInput = InputManager.MappedValueInputs[backward]; - var leftInput = InputManager.MappedValueInputs[left]; - var rightInput = InputManager.MappedValueInputs[right]; - var turnLeftInput = InputManager.MappedValueInputs[turn_left]; - var turnRightInput = InputManager.MappedValueInputs[turn_right]; - - float moveForward = Mathf.Abs(forwardInput.Value) - Mathf.Abs(backwardInput.Value); - float moveStrafe = Mathf.Abs(rightInput.Value) - Mathf.Abs(leftInput.Value); - float moveTurn = Mathf.Abs(turnRightInput.Value) - Mathf.Abs(turnLeftInput.Value); - - moveForward = Diff(moveForward, 0f, 0.1f) ? 0f : moveForward; - moveStrafe = Diff(moveStrafe, 0f, 0.1f) ? 0f : moveStrafe; - moveTurn = Diff(moveTurn, 0f, 0.1f) ? 0f : moveTurn; - - // Are the inputs basically zero - if (moveForward == 0f && moveTurn == 0f && moveStrafe == 0f) { - _wheels.ForEach(x => x.MainInput = 0f); - return; - } - - // Adjusts how much turning verse translation is favored - moveTurn *= _turnFavor; - - var robotTransform = _robot.GroundedNode.transform; - - Vector3 chassisVelocity = robotTransform.forward * moveForward + robotTransform.right * moveStrafe; - Vector3 chassisAngularVelocity = robotTransform.up * moveTurn; - - if (chassisVelocity.magnitude > 1) - chassisVelocity = chassisVelocity.normalized; - - // Rotate chassis velocity by chassis angle - if (_fieldCentric) { - Vector3 headingVector = _robot.GroundedNode.transform.forward - - (Vector3.up * Vector3.Dot(Vector3.up, _robot.GroundedNode.transform.forward)); - float headingVectorY = Vector3.Dot(_fieldForward, headingVector); - float headingVectorX = Vector3.Dot(Vector3.Cross(_fieldForward, Vector3.up), headingVector); - float chassisAngle = Mathf.Atan2(headingVectorX, headingVectorY) * Mathf.Rad2Deg; - chassisVelocity = Quaternion.AngleAxis(chassisAngle, robotTransform.up) * chassisVelocity; - } - - var maxVelocity = 1.0f; - float[] velocities = new float[_wheels.Count]; - for (int i = 0; i < velocities.Length; i++) { - var wheel = _wheels[i]; - var com = robotTransform.localToWorldMatrix.MultiplyPoint3x4( - robotTransform.GetComponent().centerOfMass); - var radius = wheel.Anchor - com; - - // Remove axis component of radius - radius -= Vector3.Dot(robotTransform.up, radius) * robotTransform.up; - - velocities[i] = Vector3.Dot(Vector3.Cross(wheel.Axis, robotTransform.up).normalized, - Vector3.Cross(chassisAngularVelocity, radius) + chassisVelocity); - if (Mathf.Abs(velocities[i]) > maxVelocity) - maxVelocity = Mathf.Abs(velocities[i]); - } - - for (int i = 0; i < velocities.Length; i++) { - _wheels[i].MainInput = velocities[i] / maxVelocity; - } - } - - protected override void OnEnable() { - bool wheelTypeWarning = false; - _wheels.ForEach(x => { - if (x.LocalRoller == null) { - wheelTypeWarning = true; - x.LocalRoller = Vector3.right; - } - }); - - if (wheelTypeWarning) { - Logger.Log("Switching standard wheels to omni while using omni drive", LogLevel.Warning); - } - } - - protected override void OnDisable() { - _wheels.ForEach(x => { - x.MainInput = 0.0f; - x.MatchRollerToWheelType(); - }); - } - } -} diff --git a/engine/Assets/Scripts/Behaviors/OmniDriveBehaviour.cs.meta b/engine/Assets/Scripts/Behaviors/OmniDriveBehaviour.cs.meta deleted file mode 100644 index 5ce707a64b..0000000000 --- a/engine/Assets/Scripts/Behaviors/OmniDriveBehaviour.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 8f502ecb079ac41b1b5c7802ef977aa6 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Behaviors/SwerveDriveBehaviour.cs b/engine/Assets/Scripts/Behaviors/SwerveDriveBehaviour.cs deleted file mode 100644 index 32b155d21e..0000000000 --- a/engine/Assets/Scripts/Behaviors/SwerveDriveBehaviour.cs +++ /dev/null @@ -1,217 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using Google.Protobuf.WellKnownTypes; -using Synthesis.PreferenceManager; -using Synthesis.UI.Dynamic; -using SynthesisAPI.EventBus; -using SynthesisAPI.InputManager; -using SynthesisAPI.InputManager.Inputs; -using SynthesisAPI.Simulation; -using UnityEngine; - -#nullable enable - -namespace Synthesis { - public class SwerveDriveBehaviour : SimBehaviour { - internal const string FORWARD = "Swerve Forward"; - internal const string BACKWARD = "Swerve Backward"; - internal const string LEFT = "Swerve Left"; - internal const string RIGHT = "Swerve Right"; - internal const string TURN_LEFT = "Swerve Turn Left"; - internal const string TURN_RIGHT = "Swerve Turn Right"; - internal const string RESET_FIELD_FORWARD = "Swerve Reset Forward"; - - private readonly string forward = FORWARD; - private readonly string backward = BACKWARD; - private readonly string left = LEFT; - private readonly string right = RIGHT; - private readonly string turn_left = TURN_LEFT; - private readonly string turn_right = TURN_RIGHT; - private readonly string reset_field_forward = RESET_FIELD_FORWARD; - - private (RotationalDriver azimuth, WheelDriver drive)[] _moduleDrivers; - private readonly RobotSimObject _robot; - - private float _turnFavor = 1.5f; - - private Vector3 _fieldForward; - - public SwerveDriveBehaviour(RobotSimObject robot, (RotationalDriver azimuth, WheelDriver drive)[] moduleDrivers) - : base(robot.Name) { - _moduleDrivers = moduleDrivers; - - _robot = robot; - _fieldForward = Vector3.forward; - - _moduleDrivers.ForEach(x => { - if (x.azimuth.Reservee != null) { - SimulationManager.RemoveBehaviour(_robot.Name, x.azimuth.Reservee); - } - - x.azimuth.Reserve(this); - x.azimuth.ControlMode = RotationalDriver.RotationalControlMode.Position; - x.azimuth.SetAxis(robot.GroundedNode.transform.up); - }); - - forward = _robot.RobotGUID + "Swerve Forward"; - backward = _robot.RobotGUID + "Swerve Backward"; - left = _robot.RobotGUID + "Swerve Left"; - right = _robot.RobotGUID + "Swerve Right"; - turn_left = _robot.RobotGUID + "Swerve Turn Left"; - turn_right = _robot.RobotGUID + "Swerve Turn Right"; - reset_field_forward = _robot.RobotGUID + "Swerve Reset Forward"; - - InitInputs(GetInputs()); - EventBus.NewTypeListener(OnValueInputAssigned); - } - - public (string key, string name, Analog input)[] GetInputs() { - return new( - string key, string name, Analog input)[] { (forward, FORWARD, TryLoadInput(forward, new Digital("W"))), - (backward, BACKWARD, TryLoadInput(backward, new Digital("S"))), - (left, LEFT, TryLoadInput(left, new Digital("A"))), - (right, RIGHT, TryLoadInput(right, new Digital("D"))), - (turn_left, TURN_LEFT, TryLoadInput(turn_left, new Digital("LeftArrow"))), - (turn_right, TURN_RIGHT, TryLoadInput(turn_right, new Digital("RightArrow"))), - (reset_field_forward, RESET_FIELD_FORWARD, TryLoadInput(reset_field_forward, new Digital("R"))) }; - } - - public Analog TryLoadInput(string key, Analog defaultInput) { - Analog input; - if (InputManager.MappedValueInputs.ContainsKey(key)) { - input = InputManager.GetAnalog(key); - input.ContextBitmask = defaultInput.ContextBitmask; - return input; - } - input = SimulationPreferences.GetRobotInput(_robot.RobotGUID, key); - if (input == null) { - SimulationPreferences.SetRobotInput(_robot.RobotGUID, key, defaultInput); - return defaultInput; - } - return input; - } - - private void OnValueInputAssigned(IEvent tmp) { - ValueInputAssignedEvent args = (tmp as ValueInputAssignedEvent)!; - - if (args.InputKey.Length > _robot.RobotGUID.Length) { - string s = args.InputKey.Remove(0, _robot.RobotGUID.Length); - switch (s) { - case FORWARD: - case BACKWARD: - case LEFT: - case RIGHT: - case TURN_LEFT: - case TURN_RIGHT: - case RESET_FIELD_FORWARD: - SimulationPreferences.SetRobotInput(_robot.RobotGUID, args.InputKey, args.Input); - break; - } - } - } - - /// - /// A difference comparison with some wiggle room between the values - /// - /// Value A - /// Value B - /// Allowed difference between them to be considered the same essentially. - /// Exclusive - private bool Diff(float a, float b, float acceptableDelta) { - return Math.Abs(a - b) < acceptableDelta; - } - - public override void Update() { - if (Mathf.Abs(InputManager.MappedValueInputs[reset_field_forward].Value) > 0.5f) - _fieldForward = _robot.GroundedNode.transform.forward; - - Vector3 headingVector = _robot.GroundedNode.transform.forward - - (Vector3.up * Vector3.Dot(Vector3.up, _robot.GroundedNode.transform.forward)); - float headingVectorY = Vector3.Dot(_fieldForward, headingVector); - float headingVectorX = Vector3.Dot(Vector3.Cross(_fieldForward, Vector3.up), headingVector); - float chassisAngle = Mathf.Atan2(headingVectorX, headingVectorY) * Mathf.Rad2Deg; - - var forwardInput = InputManager.MappedValueInputs[forward]; - var backwardInput = InputManager.MappedValueInputs[backward]; - var leftInput = InputManager.MappedValueInputs[left]; - var rightInput = InputManager.MappedValueInputs[right]; - var turnLeftInput = InputManager.MappedValueInputs[turn_left]; - var turnRightInput = InputManager.MappedValueInputs[turn_right]; - - float _forward = Mathf.Abs(forwardInput.Value) - Mathf.Abs(backwardInput.Value); - float strafe = Mathf.Abs(rightInput.Value) - Mathf.Abs(leftInput.Value); - float turn = Mathf.Abs(turnRightInput.Value) - Mathf.Abs(turnLeftInput.Value); - - _forward = Diff(_forward, 0f, 0.1f) ? 0f : _forward; - strafe = Diff(strafe, 0f, 0.1f) ? 0f : strafe; - turn = Diff(turn, 0f, 0.1f) ? 0f : turn; - - // Are the inputs basically zero - if (_forward == 0f && turn == 0f && strafe == 0f) { - _moduleDrivers.ForEach(x => x.drive.MainInput = 0f); - return; - } - - // Adjusts how much turning verse translation is favored - turn *= _turnFavor; - - var robotTransform = _robot.GroundedNode.transform; - - Vector3 chassisVelocity = robotTransform.forward * _forward + robotTransform.right * strafe; - Vector3 chassisAngularVelocity = robotTransform.up * turn; - - // Normalize velocity so its between 1 and 0. Should only max out at like 1 sqrt(2), but still - if (chassisVelocity.magnitude > 1) - chassisVelocity = chassisVelocity.normalized; - - // Rotate chassis velocity by chassis angle - chassisVelocity = Quaternion.AngleAxis(chassisAngle, robotTransform.up) * chassisVelocity; - - var maxVelocity = Vector3.zero; - Vector3[] velocities = new Vector3[_moduleDrivers.Length]; - for (int i = 0; i < velocities.Length; i++) { - // TODO: We should do this only once for all azimuth drivers, but whatever for now - var driver = _moduleDrivers[i].azimuth; - var com = robotTransform.localToWorldMatrix.MultiplyPoint3x4( - robotTransform.GetComponent().centerOfMass); - var radius = driver.Anchor - com; - // Remove axis component of radius - radius -= Vector3.Dot(driver.Axis, radius) * driver.Axis; - - velocities[i] = Vector3.Cross(chassisAngularVelocity, radius) + chassisVelocity; - if (velocities[i].magnitude > maxVelocity.magnitude) - maxVelocity = velocities[i]; - } - - // Normalize all if a velocity exceeds 1 - if (maxVelocity.magnitude > 1) { - for (int i = 0; i < velocities.Length; i++) { - velocities[i] /= maxVelocity.magnitude; - } - } - - for (int i = 0; i < velocities.Length; i++) { - float speed = velocities[i].magnitude; - var yComponent = Vector3.Dot(robotTransform.forward, velocities[i]); - var xComponent = Vector3.Dot(robotTransform.right, velocities[i]); - float angle = Mathf.Atan2(xComponent, yComponent) * Mathf.Rad2Deg; - _moduleDrivers[i].azimuth.MainInput = angle; - _moduleDrivers[i].drive.MainInput = speed; - } - } - - public override void OnRemove() { - for (int i = 0; i < _moduleDrivers.Length; i++) { - _moduleDrivers[i].azimuth.ControlMode = RotationalDriver.RotationalControlMode.Velocity; - _moduleDrivers[i].azimuth.MainInput = 0f; - _moduleDrivers[i].azimuth.Unreserve(); - } - } - - protected override void OnDisable() { - _moduleDrivers.ForEach(x => x.drive.MainInput = x.azimuth.MainInput = 0f); - } - } -} diff --git a/engine/Assets/Scripts/Behaviors/SwerveDriveBehaviour.cs.meta b/engine/Assets/Scripts/Behaviors/SwerveDriveBehaviour.cs.meta deleted file mode 100644 index 0a381e0e3e..0000000000 --- a/engine/Assets/Scripts/Behaviors/SwerveDriveBehaviour.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 39d1b279b368c164e86daf0adc6f2097 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Behaviors/TankDriveBehavior.cs b/engine/Assets/Scripts/Behaviors/TankDriveBehavior.cs deleted file mode 100644 index 3d6f9174d8..0000000000 --- a/engine/Assets/Scripts/Behaviors/TankDriveBehavior.cs +++ /dev/null @@ -1,125 +0,0 @@ -using System.Collections.Generic; -using Synthesis.PreferenceManager; -using Synthesis.UI.Dynamic; -using SynthesisAPI.EventBus; -using SynthesisAPI.InputManager; -using SynthesisAPI.InputManager.Inputs; -using SynthesisAPI.Simulation; -using UnityEngine; - -#nullable enable - -namespace Synthesis { - public class TankDriveBehavior : SimBehaviour { - internal const string LEFT_FORWARD = "Tank Left-Forward"; - internal const string LEFT_REVERSE = "Tank Left-Reverse"; - internal const string RIGHT_FORWARD = "Tank Right-Forward"; - internal const string RIGHT_REVERSE = "Tank Right-Reverse"; - - private readonly string left_forward = LEFT_FORWARD; - private readonly string left_reverse = LEFT_REVERSE; - private readonly string right_forward = RIGHT_FORWARD; - private readonly string right_reverse = RIGHT_REVERSE; - - private List _leftWheels; - private List _rightWheels; - - private double _leftSpeed; - private double _rightSpeed; - - private float _xSpeed; - private float _zRot; - - private bool _squareInputs; // TODO: Add ability to modify this - - private bool _didUpdate; - - private byte _keyMask; - - private const double DEADBAND = 0.1; - - public double speedMult = 1.0f; - - private RobotSimObject _robot; - - public TankDriveBehavior( - string simObjectId, List leftWheels, List rightWheels, string inputName = "") - : base(simObjectId) { - if (inputName == "") - inputName = simObjectId; - - _leftWheels = leftWheels; - _rightWheels = rightWheels; - - left_forward = MiraId + "Tank Left-Forward"; - left_reverse = MiraId + "Tank Left-Reverse"; - right_forward = MiraId + "Tank Right-Forward"; - right_reverse = MiraId + "Tank Right-Reverse"; - - InitInputs(GetInputs()); - - EventBus.NewTypeListener(OnValueInputAssigned); - } - - public (string key, string displayName, Analog input)[] GetInputs() { - return new(string key, string displayName, - Analog input)[] { (left_forward, LEFT_FORWARD, TryLoadInput(left_forward, new Digital("W"))), - (left_reverse, LEFT_REVERSE, TryLoadInput(left_reverse, new Digital("S"))), - (right_forward, RIGHT_FORWARD, TryLoadInput(right_forward, new Digital("I"))), - (right_reverse, RIGHT_REVERSE, TryLoadInput(right_reverse, new Digital("K"))) }; - } - - public Analog TryLoadInput(string key, Analog defaultInput) { - Analog input; - if (InputManager.MappedValueInputs.ContainsKey(key)) { - input = InputManager.GetAnalog(key); - input.ContextBitmask = defaultInput.ContextBitmask; - return input; - } - input = SimulationPreferences.GetRobotInput(MiraId, key); - if (input == null) { - SimulationPreferences.SetRobotInput(MiraId, key, defaultInput); - return defaultInput; - } - return input; - } - - private void OnValueInputAssigned(IEvent tmp) { - ValueInputAssignedEvent args = tmp as ValueInputAssignedEvent; - - if (args.InputKey.Length > MiraId.Length) { - string s = args.InputKey.Remove(0, MiraId.Length); - switch (s) { - case LEFT_FORWARD: - case LEFT_REVERSE: - case RIGHT_FORWARD: - case RIGHT_REVERSE: - SimulationPreferences.SetRobotInput(MiraId, args.InputKey, args.Input); - break; - } - } - } - - public override void Update() { - var leftForwardInput = InputManager.MappedValueInputs[left_forward]; - var leftBackwardInput = InputManager.MappedValueInputs[left_reverse]; - var rightForwardInput = InputManager.MappedValueInputs[right_forward]; - var rightBackwardInput = InputManager.MappedValueInputs[right_reverse]; - - var leftSpeed = Mathf.Abs(leftForwardInput.Value) - Mathf.Abs(leftBackwardInput.Value); - var rightSpeed = Mathf.Abs(rightForwardInput.Value) - Mathf.Abs(rightBackwardInput.Value); - - foreach (var wheel in _leftWheels) { - wheel.MainInput = leftSpeed * speedMult; - } - foreach (var wheel in _rightWheels) { - wheel.MainInput = rightSpeed * speedMult; - } - } - - protected override void OnDisable() { - _leftWheels.ForEach(w => w.MainInput = 0); - _rightWheels.ForEach(w => w.MainInput = 0); - } - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/Behaviors/TankDriveBehavior.cs.meta b/engine/Assets/Scripts/Behaviors/TankDriveBehavior.cs.meta deleted file mode 100644 index 5453439529..0000000000 --- a/engine/Assets/Scripts/Behaviors/TankDriveBehavior.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 01c8c15f878f45bbb826ad5553e1ef5a -timeCreated: 1629439314 \ No newline at end of file diff --git a/engine/Assets/Scripts/Behaviors/WSSimBehavior.cs b/engine/Assets/Scripts/Behaviors/WSSimBehavior.cs deleted file mode 100644 index c846dd8ee2..0000000000 --- a/engine/Assets/Scripts/Behaviors/WSSimBehavior.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using Google.Protobuf.WellKnownTypes; -using Synthesis.WS; -using Synthesis.WS.Translation; -using SynthesisAPI.RoboRIO; -using SynthesisAPI.Simulation; -using UnityEngine; - -public class WSSimBehavior : SimBehaviour { - private RioTranslationLayer _translation; - public RioTranslationLayer Translation { - get => _translation; - set { _translation = value; } - } - - public WSSimBehavior(string simObjectId, RioTranslationLayer translation) : base(simObjectId) { - _translation = translation; - - WebSocketManager.Init(); - } - - public override void Update() { - var signalState = SimulationManager.SimulationObjects[SimObjectId].State; - - // Motor Groups - _translation.PWMGroups.ForEach(group => group.Update(WebSocketManager.RioState, signalState)); - - // Encoders - _translation.Encoders.ForEach(x => x.Update(signalState)); - } -} diff --git a/engine/Assets/Scripts/Behaviors/WSSimBehavior.cs.meta b/engine/Assets/Scripts/Behaviors/WSSimBehavior.cs.meta deleted file mode 100644 index 13c760d20e..0000000000 --- a/engine/Assets/Scripts/Behaviors/WSSimBehavior.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 656f619cee88afb4ab9fbdfbfb617361 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/CEF.meta b/engine/Assets/Scripts/CEF.meta deleted file mode 100644 index f5057abaae..0000000000 --- a/engine/Assets/Scripts/CEF.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: dacc8de941e53714eae8f63ad55c31a4 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Camera.meta b/engine/Assets/Scripts/Camera.meta deleted file mode 100644 index 7549ef54ec..0000000000 --- a/engine/Assets/Scripts/Camera.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 87dedae29a5148b48da590d4adfe40ec -timeCreated: 1624312288 \ No newline at end of file diff --git a/engine/Assets/Scripts/Camera/CameraController.cs b/engine/Assets/Scripts/Camera/CameraController.cs deleted file mode 100644 index f60ad47d7e..0000000000 --- a/engine/Assets/Scripts/Camera/CameraController.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; -using Synthesis.UI.Panels.Variant; -using Synthesis.PreferenceManager; - -public class CameraController : MonoBehaviour { - private ICameraMode _cameraMode; - public ICameraMode CameraMode { - get { return _cameraMode; } - set { - if (_cameraMode != null && _cameraMode != value) { - _cameraMode.End(this); - } - - var previous = _cameraMode; - _cameraMode = value; - _cameraMode.Start(this, previous); - } - } - - public static Dictionary CameraModes = new Dictionary(); - - static CameraController() { - CameraModes.Add("Orbit", new OrbitCameraMode()); - CameraModes.Add("Freecam", new FreeCameraMode()); - CameraModes.Add("Overview", new OverviewCameraMode()); - CameraModes.Add("Driver Station", new DriverStationCameraMode()); - } - - public static bool isOverGizmo = false; - - public const string ZOOM_SENSITIVITY_PREF = "Zoom Sensitivity"; // camera settings - public const string YAW_SENSITIVITY_PREF = "Yaw Sensitivity"; - public const string PITCH_SENSITIVITY_PREF = "Pitch Sensitivity"; - public const int ZOOM_SENSITIVITY_DEFAULT = 5; - public const int YAW_SENSITIVITY_DEFAULT = 10; - public const int PITCH_SENSITIVITY_DEFAULT = 3; - [SerializeField, Range(1f, 15.0f)] - public static float PitchSensitivity; - [SerializeField, Range(1f, 15.0f)] - public static float YawSensitivity; - [SerializeField, Range(0.1f, 5f)] - public static float ZoomSensitivity; - [SerializeField] - public float PitchLowerLimit; - [SerializeField] - public float PitchUpperLimit; - [SerializeField] - public float ZoomLowerLimit; - [SerializeField] - public float ZoomUpperLimit; - [SerializeField, Range(0.005f, 1.0f)] - public float OrbitalAcceleration; - [SerializeField, Range(0.005f, 1.0f)] - public float ZoomAcceleration; - - [SerializeField] - public Renderer GroundRenderer; - - private void Start() { - // Set Camera and Screen Settings - CameraMode = CameraModes["Orbit"]; - - PitchSensitivity = TryGetPref(PITCH_SENSITIVITY_PREF, PITCH_SENSITIVITY_DEFAULT); - YawSensitivity = TryGetPref(YAW_SENSITIVITY_PREF, YAW_SENSITIVITY_DEFAULT); - ZoomSensitivity = TryGetPref(ZOOM_SENSITIVITY_PREF, ZOOM_SENSITIVITY_DEFAULT); - } - - public T TryGetPref(string key, T defaultVal) { - if (PreferenceManager.ContainsPreference(key)) - return PreferenceManager.GetPreference(key); - return defaultVal; - } - - public void Update() { - if (CameraMode != null) - CameraMode.Update(this); - } - - public void LateUpdate() { - if (CameraMode != null) - CameraMode.LateUpdate(this); - } -} diff --git a/engine/Assets/Scripts/Camera/CameraController.cs.meta b/engine/Assets/Scripts/Camera/CameraController.cs.meta deleted file mode 100644 index aa87edcb48..0000000000 --- a/engine/Assets/Scripts/Camera/CameraController.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 72bd9fc32d95451d90530109dceeae75 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Camera/DriverStationCameraMode.cs b/engine/Assets/Scripts/Camera/DriverStationCameraMode.cs deleted file mode 100644 index 7e1b7c81bd..0000000000 --- a/engine/Assets/Scripts/Camera/DriverStationCameraMode.cs +++ /dev/null @@ -1,172 +0,0 @@ -using Synthesis.UI.Dynamic; -using SynthesisAPI.InputManager; -using SynthesisAPI.InputManager.Inputs; -using UnityEngine; -using Input = UnityEngine.Input; - -public class DriverStationCameraMode : ICameraMode { - private Vector3 _target = Vector3.zero; - - public float TargetZoom { get; private set; } = 15.0f; - public float TargetPitch { get; private set; } = 10.0f; - public float TargetYaw { get; private set; } = 135.0f; - public float ActualZoom { get; private set; } = 15.0f; - public float ActualPitch { get; private set; } = 10.0f; - public float ActualYaw { get; private set; } = 135.0f; - - private const string FORWARD_KEY = "FREECAM_FORWARD"; - private const string BACK_KEY = "FREECAM_BACK"; - private const string LEFT_KEY = "FREECAM_LEFT"; - private const string RIGHT_KEY = "FREECAM_RIGHT"; - private const string LEFT_YAW_KEY = "FREECAM_LEFT_YAW"; - private const string RIGHT_YAW_KEY = "FREECAM_RIGHT_YAW"; - private const string DOWN_PITCH_KEY = "FREECAM_DOWN_PITCH"; - private const string UP_PITCH_KEY = "FREECAM_UP_PITCH"; - - private bool isActive = false; - - public void Start(CameraController cam, T? previousCam) - where T : ICameraMode { - // only assign inputs once - if (!InputManager.MappedDigitalInputs.ContainsKey(FORWARD_KEY)) { - InputManager.AssignDigitalInput(FORWARD_KEY, new Digital("W")); - InputManager.AssignDigitalInput(BACK_KEY, new Digital("S")); - InputManager.AssignDigitalInput(LEFT_KEY, new Digital("A")); - InputManager.AssignDigitalInput(RIGHT_KEY, new Digital("D")); - // InputManager.AssignValueInput(LEFT_YAW_KEY, new Digital("Q")); - // InputManager.AssignValueInput(RIGHT_YAW_KEY, new Digital("E")); - // InputManager.AssignValueInput(DOWN_PITCH_KEY, new Digital("Z")); - // InputManager.AssignValueInput(UP_PITCH_KEY, new Digital("X")); - } - - if (previousCam != null) { - if (previousCam.GetType() == typeof(OrbitCameraMode)) { - OrbitCameraMode orbitCam = (previousCam as OrbitCameraMode)!; - TargetPitch = orbitCam.TargetPitch; - TargetYaw = orbitCam.TargetYaw; - ActualPitch = orbitCam.ActualPitch; - ActualYaw = orbitCam.ActualYaw; - } else if (previousCam.GetType() == typeof(FreeCameraMode)) { - FreeCameraMode freeCam = (previousCam as FreeCameraMode)!; - TargetPitch = freeCam.TargetPitch; - TargetYaw = freeCam.TargetYaw; - ActualPitch = freeCam.ActualPitch; - ActualYaw = freeCam.ActualYaw; - } - } - } - - public void Update(CameraController cam) { - if (Input.GetKeyDown(KeyCode.Mouse1)) { - SetActive(true); - } else if (Input.GetKeyUp(KeyCode.Mouse1)) { - SetActive(false); - } - - // don't allow camera movement when a modal is open - if (DynamicUIManager.ActiveModal != null) - return; - float p = 0.0f; - float y = 0.0f; - float z = 0.0f; - - // in old synthesis freecam mode, scrolling down zooms in and scrolling up zooms out - // z = cam.ZoomSensitivity * Input.mouseScrollDelta.y; - - // float yawMod = InputManager.MappedValueInputs.ContainsKey(LEFT_YAW_KEY) && - // InputManager.MappedValueInputs.ContainsKey(RIGHT_YAW_KEY) ? - // cam.YawSensitivity / 8 * (InputManager.MappedValueInputs[RIGHT_YAW_KEY].Value - - // InputManager.MappedValueInputs[LEFT_YAW_KEY].Value) : 0; - // float pitchMod = InputManager.MappedValueInputs.ContainsKey(UP_PITCH_KEY) && - // InputManager.MappedValueInputs.ContainsKey(DOWN_PITCH_KEY) ? - // cam.PitchSensitivity / 4 * (InputManager.MappedValueInputs[UP_PITCH_KEY].Value - - // InputManager.MappedValueInputs[DOWN_PITCH_KEY].Value) : 0; - - // p -= pitchMod; - // y += yawMod; - - if (isActive) { - p = -CameraController.PitchSensitivity * Input.GetAxis("Mouse Y"); - y = CameraController.YawSensitivity * Input.GetAxis("Mouse X"); - } - - var t = cam.transform; - - float speed = 5.0F; - - // transform forwards and backwards when forward and backward inputs are pressed - // left and right when left and right are pressed - - Vector3 forward = Vector3.zero, right = Vector3.zero; - - if (isActive) { - // make it so the user can't rotate the camera upside down - TargetPitch = Mathf.Clamp(TargetPitch + p, -90, 90); - TargetYaw += y; - TargetZoom = Mathf.Clamp(TargetZoom + z, cam.ZoomLowerLimit, cam.ZoomUpperLimit); - - float orbitLerpFactor = Mathf.Clamp((cam.OrbitalAcceleration * Time.deltaTime) / 0.018f, 0.01f, 1.0f); - ActualPitch = Mathf.Lerp(ActualPitch, TargetPitch, orbitLerpFactor); - ActualYaw = Mathf.Lerp(ActualYaw, TargetYaw, orbitLerpFactor); - float zoomLerpFactor = Mathf.Clamp((cam.ZoomAcceleration * Time.deltaTime) / 0.018f, 0.01f, 1.0f); - ActualZoom = Mathf.Lerp(ActualZoom, TargetZoom, zoomLerpFactor); - - forward = t.forward * (InputManager.MappedDigitalInputs[FORWARD_KEY][0].Value - - InputManager.MappedDigitalInputs[BACK_KEY][0].Value) + - t.forward * (TargetZoom - ActualZoom) * CameraController.ZoomSensitivity; - - right = t.right * (InputManager.MappedDigitalInputs[RIGHT_KEY][0].Value - - InputManager.MappedDigitalInputs[LEFT_KEY][0].Value); - - t.Translate(Time.deltaTime * speed * (forward + right), Space.World); - - // we don't want the user to be able to move the camera under the map or so high they can't see the field - t.position = new Vector3(t.position.x, Mathf.Clamp(t.position.y, 0, 100), t.position.z); - - t.localRotation = Quaternion.Euler(ActualPitch, ActualYaw, 0.0f); - } - - RobotSimObject currentRobot = RobotSimObject.GetCurrentlyPossessedRobot(); - _target = currentRobot is null - ? Vector3.zero - : currentRobot.GroundedNode.transform.TransformPoint(currentRobot.GroundedBounds.center); - } - - public void LateUpdate(CameraController cam) { - cam.GroundRenderer.material.SetVector("FOCUS_POINT", cam.transform.position); - if (!isActive) { - var relativePos = _target - cam.transform.position; - if (relativePos.magnitude == 0) - return; - var targetRotation = Quaternion.LookRotation(relativePos); - cam.transform.rotation = Quaternion.Lerp(cam.transform.rotation, targetRotation, Time.deltaTime * 5); - TargetPitch = ActualPitch = cam.transform.rotation.eulerAngles.x; - TargetYaw = ActualYaw = cam.transform.rotation.eulerAngles.y; - // so that mice with different scroll increments scroll the same amount each click - // float inaccuracy - cam.gameObject.GetComponent().fieldOfView -= - Mathf.Approximately(Input.mouseScrollDelta.y, 0) - ? 0 - : Mathf.Sign(Input.mouseScrollDelta.y) * CameraController.ZoomSensitivity * 2; - } - } - - public void SetActive(bool active) { - isActive = active; - if (active) { - Cursor.lockState = CursorLockMode.Locked; - Cursor.visible = false; - if (RobotSimObject.CurrentlyPossessedRobot != string.Empty) - RobotSimObject.GetCurrentlyPossessedRobot().BehavioursEnabled = false; - } else { - Cursor.lockState = CursorLockMode.None; - Cursor.visible = true; - if (RobotSimObject.CurrentlyPossessedRobot != string.Empty) - RobotSimObject.GetCurrentlyPossessedRobot().BehavioursEnabled = true; - } - } - - public void End(CameraController cam) { - SetActive(false); - } -} diff --git a/engine/Assets/Scripts/Camera/DriverStationCameraMode.cs.meta b/engine/Assets/Scripts/Camera/DriverStationCameraMode.cs.meta deleted file mode 100644 index e50b2445a4..0000000000 --- a/engine/Assets/Scripts/Camera/DriverStationCameraMode.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 8ba731027e064a609b9b1dacac847670 -timeCreated: 1687969529 \ No newline at end of file diff --git a/engine/Assets/Scripts/Camera/FreeCameraMode.cs b/engine/Assets/Scripts/Camera/FreeCameraMode.cs deleted file mode 100644 index 2a5a73b25d..0000000000 --- a/engine/Assets/Scripts/Camera/FreeCameraMode.cs +++ /dev/null @@ -1,146 +0,0 @@ - -using Synthesis.UI.Dynamic; -using SynthesisAPI.InputManager; -using SynthesisAPI.InputManager.Inputs; -using UnityEngine; -using Input = UnityEngine.Input; - -#nullable enable - -public class FreeCameraMode : ICameraMode { - public float TargetZoom { get; private set; } = 15.0f; - public float TargetPitch { get; private set; } = 10.0f; - public float TargetYaw { get; private set; } = 135.0f; - public float ActualZoom { get; private set; } = 15.0f; - public float ActualPitch { get; private set; } = 10.0f; - public float ActualYaw { get; private set; } = 135.0f; - - private const string FORWARD_KEY = "FREECAM_FORWARD"; - private const string BACK_KEY = "FREECAM_BACK"; - private const string LEFT_KEY = "FREECAM_LEFT"; - private const string RIGHT_KEY = "FREECAM_RIGHT"; - private const string LEFT_YAW_KEY = "FREECAM_LEFT_YAW"; - private const string RIGHT_YAW_KEY = "FREECAM_RIGHT_YAW"; - private const string DOWN_PITCH_KEY = "FREECAM_DOWN_PITCH"; - private const string UP_PITCH_KEY = "FREECAM_UP_PITCH"; - - private bool isActive = false; - - private CameraController _controller; - - public void Start(CameraController cam, T? previousCam) - where T : ICameraMode { - // only assign inputs once - if (!InputManager.MappedDigitalInputs.ContainsKey(FORWARD_KEY)) { - InputManager.AssignDigitalInput(FORWARD_KEY, new Digital("W")); - InputManager.AssignDigitalInput(BACK_KEY, new Digital("S")); - InputManager.AssignDigitalInput(LEFT_KEY, new Digital("A")); - InputManager.AssignDigitalInput(RIGHT_KEY, new Digital("D")); - } - - if (previousCam != null) { - if (previousCam.GetType() == typeof(OrbitCameraMode)) { - OrbitCameraMode orbitCam = (previousCam as OrbitCameraMode)!; - TargetPitch = orbitCam.TargetPitch; - TargetYaw = orbitCam.TargetYaw; - ActualPitch = orbitCam.ActualPitch; - ActualYaw = orbitCam.ActualYaw; - } else if (previousCam.GetType() == typeof(DriverStationCameraMode)) { - DriverStationCameraMode driverStationCam = (previousCam as DriverStationCameraMode)!; - TargetPitch = driverStationCam.TargetPitch; - TargetYaw = driverStationCam.TargetYaw; - ActualPitch = driverStationCam.ActualPitch; - ActualYaw = driverStationCam.ActualYaw; - } - } - - _controller = cam; - } - - public void Update(CameraController cam) { - if (Input.GetKeyDown(KeyCode.Mouse1)) { - SetActive(true); - } else if (Input.GetKeyUp(KeyCode.Mouse1)) { - SetActive(false); - } - - // don't allow camera movement when a modal is open - if (DynamicUIManager.ActiveModal != null) - return; - float p = 0.0f; - float y = 0.0f; - float z = 0.0f; - - if (isActive) { - p = -CameraController.PitchSensitivity * Input.GetAxis("Mouse Y"); - y = CameraController.YawSensitivity * Input.GetAxis("Mouse X"); - } - - // make it so the user can't rotate the camera upside down - TargetPitch = Mathf.Clamp(TargetPitch + p, -90, 90); - TargetYaw += y; - TargetZoom = Mathf.Clamp(TargetZoom + z, cam.ZoomLowerLimit, cam.ZoomUpperLimit); - - float orbitLerpFactor = Mathf.Clamp((cam.OrbitalAcceleration * Time.deltaTime) / 0.018f, 0.01f, 1.0f); - ActualPitch = Mathf.Lerp(ActualPitch, TargetPitch, orbitLerpFactor); - ActualYaw = Mathf.Lerp(ActualYaw, TargetYaw, orbitLerpFactor); - float zoomLerpFactor = Mathf.Clamp((cam.ZoomAcceleration * Time.deltaTime) / 0.018f, 0.01f, 1.0f); - ActualZoom = Mathf.Lerp(ActualZoom, TargetZoom, zoomLerpFactor); - - var t = cam.transform; - - float speed = 10.0F; - - // transform forwards and backwards when forward and backward inputs are pressed - // left and right when left and right are pressed - - Vector3 forward = Vector3.zero, right = Vector3.zero; - - if (isActive) { - forward = t.forward * (InputManager.MappedDigitalInputs[FORWARD_KEY][0].Value - - InputManager.MappedDigitalInputs[BACK_KEY][0].Value) + - t.forward * (TargetZoom - ActualZoom) * CameraController.ZoomSensitivity; - - right = t.right * (InputManager.MappedDigitalInputs[RIGHT_KEY][0].Value - - InputManager.MappedDigitalInputs[LEFT_KEY][0].Value); - - t.Translate(Time.deltaTime * speed * (forward + right), Space.World); - - // we don't want the user to be able to move the camera under the map or so high they can't see the field - t.position = new Vector3(t.position.x, Mathf.Clamp(t.position.y, 0, 100), t.position.z); - - t.localRotation = Quaternion.Euler(ActualPitch, ActualYaw, 0.0f); - } - } - - public void LateUpdate(CameraController cam) { - cam.GroundRenderer.material.SetVector("_GridFocusPoint", cam.transform.position); - } - - public void SetTransform(Vector3 position, Quaternion rotation) { - _controller.transform.position = position; - _controller.transform.rotation = rotation; - var euler = rotation.eulerAngles; - TargetPitch = ActualPitch = euler.x; - TargetYaw = ActualYaw = euler.y; - } - - public void SetActive(bool active) { - isActive = active; - if (active) { - Cursor.lockState = CursorLockMode.Locked; - Cursor.visible = false; - if (RobotSimObject.CurrentlyPossessedRobot != string.Empty) - RobotSimObject.GetCurrentlyPossessedRobot().BehavioursEnabled = false; - } else { - Cursor.lockState = CursorLockMode.None; - Cursor.visible = true; - if (RobotSimObject.CurrentlyPossessedRobot != string.Empty) - RobotSimObject.GetCurrentlyPossessedRobot().BehavioursEnabled = true; - } - } - - public void End(CameraController cam) { - SetActive(false); - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/Camera/FreeCameraMode.cs.meta b/engine/Assets/Scripts/Camera/FreeCameraMode.cs.meta deleted file mode 100644 index 789f3fdce3..0000000000 --- a/engine/Assets/Scripts/Camera/FreeCameraMode.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 45d38b2a6f314de893b133fff2dad92c -timeCreated: 1658446450 \ No newline at end of file diff --git a/engine/Assets/Scripts/Camera/GizmoCamera.cs b/engine/Assets/Scripts/Camera/GizmoCamera.cs deleted file mode 100644 index 98b31bdcf9..0000000000 --- a/engine/Assets/Scripts/Camera/GizmoCamera.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class GizmoCamera : MonoBehaviour { - Camera cam; - - // configures some values of Gizmo Camera to be the same as the main cam - void Awake() { - cam = gameObject.GetComponent(); - cam.fieldOfView = Camera.main.fieldOfView; - cam.focalLength = Camera.main.focalLength; - cam.sensorSize = Camera.main.sensorSize; - cam.lensShift = Camera.main.lensShift; - cam.rect = Camera.main.rect; - cam.farClipPlane = Camera.main.farClipPlane; - cam.nearClipPlane = Camera.main.nearClipPlane; - } -} diff --git a/engine/Assets/Scripts/Camera/GizmoCamera.cs.meta b/engine/Assets/Scripts/Camera/GizmoCamera.cs.meta deleted file mode 100644 index d82c5ce6ca..0000000000 --- a/engine/Assets/Scripts/Camera/GizmoCamera.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 39523781ad1896e45ad55541295ac4c4 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Camera/ICameraMode.cs b/engine/Assets/Scripts/Camera/ICameraMode.cs deleted file mode 100644 index 200bf07f4f..0000000000 --- a/engine/Assets/Scripts/Camera/ICameraMode.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using UnityEditor; -using UnityEngine; - -#nullable enable - -// clang-format off -public interface ICameraMode { - public void Start(CameraController cam, T? previousCam) where T : ICameraMode; - public void Update(CameraController cam); - public void LateUpdate(CameraController cam); - public void End(CameraController cam); -} - // clang-format on diff --git a/engine/Assets/Scripts/Camera/ICameraMode.cs.meta b/engine/Assets/Scripts/Camera/ICameraMode.cs.meta deleted file mode 100644 index c91d2c334d..0000000000 --- a/engine/Assets/Scripts/Camera/ICameraMode.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: dfb088b71e78411692ee7baa9f325645 -timeCreated: 1658430900 \ No newline at end of file diff --git a/engine/Assets/Scripts/Camera/MenuCamera.cs b/engine/Assets/Scripts/Camera/MenuCamera.cs deleted file mode 100644 index 41b0c3894c..0000000000 --- a/engine/Assets/Scripts/Camera/MenuCamera.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class MenuCamera : MonoBehaviour { - // TODO UPDATE NAMESPACE - - // Start is called before the first frame update - void Start() { - transform.localPosition = transform.up * 0.5f + transform.forward * -1 + offset; - } - - Vector3 lookPoint = new Vector3(0, 1, 0); - Vector3 offset = new Vector3(0, 1, 15); - - // Update is called once per frame - void Update() { - transform.RotateAround(lookPoint, Vector3.down, Time.deltaTime * 3f); - transform.LookAt(lookPoint); - } -} diff --git a/engine/Assets/Scripts/Camera/MenuCamera.cs.meta b/engine/Assets/Scripts/Camera/MenuCamera.cs.meta deleted file mode 100644 index 633aebfebb..0000000000 --- a/engine/Assets/Scripts/Camera/MenuCamera.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: a74ee1540ad3bc748b27c186934d07db -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Camera/OrbitCameraMode.cs b/engine/Assets/Scripts/Camera/OrbitCameraMode.cs deleted file mode 100644 index fb7ecf5fad..0000000000 --- a/engine/Assets/Scripts/Camera/OrbitCameraMode.cs +++ /dev/null @@ -1,97 +0,0 @@ -using System; -using Synthesis.UI.Dynamic; -using SynthesisAPI.InputManager; -using UnityEngine; -using UnityEngine.EventSystems; - -#nullable enable - -public class OrbitCameraMode : ICameraMode { - public static Func? FocusPoint = () => Vector3.zero; - - public float TargetZoom { get; private set; } = 8.0f; - public float TargetPitch { get; private set; } = 10.0f; - public float TargetYaw { get; private set; } = 135.0f; - public float ActualZoom { get; private set; } = 4.0f; - public float ActualPitch { get; private set; } = 0.0f; - - public float ActualYaw { get; private set; } = 0.0f; - private bool _useOrbit = false; - - public void Start(CameraController cam, T? previousCam) - where T : ICameraMode { - if (previousCam != null) { - if (previousCam.GetType() == typeof(FreeCameraMode)) { - FreeCameraMode freeCam = (previousCam as FreeCameraMode)!; - ActualPitch = freeCam.ActualPitch; - ActualYaw = freeCam.ActualYaw; - } else if (previousCam.GetType() == typeof(DriverStationCameraMode)) { - DriverStationCameraMode driverCam = (previousCam as DriverStationCameraMode)!; - ActualPitch = driverCam.ActualPitch; - ActualYaw = driverCam.ActualYaw; - } - } - } - - public void Update(CameraController cam) { - // don't allow camera movement when a modal is open - if (DynamicUIManager.ActiveModal != null) - return; - var pitchTest = cam.PitchUpperLimit - cam.PitchLowerLimit; - if (pitchTest < 0) - Debug.LogError("No range exists for pitch to reside in"); - else if (pitchTest == 0) - Debug.Log("Pitch is locked"); - - float p = 0.0f; - float y = 0.0f; - float z = 0.0f; - - bool isOverUI = EventSystem.current.IsPointerOverGameObject(); - bool enableOrbit = !isOverUI && !CameraController.isOverGizmo; - bool isGodMode = InputManager.MappedValueInputs.ContainsKey(GodMode.ENABLED_GOD_MODE_INPUT) - ? InputManager.MappedValueInputs[GodMode.ENABLED_GOD_MODE_INPUT].Value == 1.0F - : false; - - if (enableOrbit && !isGodMode) { - z = CameraController.ZoomSensitivity * -Input.mouseScrollDelta.y; - } - - if (!Input.GetKey(KeyCode.Mouse0) || isGodMode) { - _useOrbit = enableOrbit; - } else { - if (_useOrbit) { - p = -CameraController.PitchSensitivity * Input.GetAxis("Mouse Y"); - y = CameraController.YawSensitivity * Input.GetAxis("Mouse X"); - } - } - - TargetPitch = Mathf.Clamp(TargetPitch + p, cam.PitchLowerLimit, cam.PitchUpperLimit); - TargetYaw += y; - TargetZoom = Mathf.Clamp(TargetZoom + z, cam.ZoomLowerLimit, cam.ZoomUpperLimit); - - float orbitLerpFactor = Mathf.Clamp((cam.OrbitalAcceleration * Time.deltaTime) / 0.018f, 0.01f, 1.0f); - ActualPitch = Mathf.Lerp(ActualPitch, TargetPitch, orbitLerpFactor); - ActualYaw = Mathf.Lerp(ActualYaw, TargetYaw, orbitLerpFactor); - float zoomLerpFactor = Mathf.Clamp((cam.ZoomAcceleration * Time.deltaTime) / 0.018f, 0.01f, 1.0f); - ActualZoom = Mathf.Lerp(ActualZoom, TargetZoom, zoomLerpFactor); - } - - public void LateUpdate(CameraController cam) { - // Construct orientation of the camera - Vector3 focus = FocusPoint == null ? Vector3.zero : FocusPoint(); - - cam.GroundRenderer.material.SetVector("_GridFocusPoint", focus); - - var t = cam.transform; - t.localPosition = focus; - t.localRotation = Quaternion.identity; - - var up = t.up; - t.localRotation = Quaternion.Euler(ActualPitch, 0.0f, 0.0f); - t.RotateAround(focus, up, ActualYaw); - t.localPosition = (/*up * 0.5f +*/ t.forward * -ActualZoom) + t.localPosition; - } - - public void End(CameraController cam) {} -} \ No newline at end of file diff --git a/engine/Assets/Scripts/Camera/OrbitCameraMode.cs.meta b/engine/Assets/Scripts/Camera/OrbitCameraMode.cs.meta deleted file mode 100644 index e26502d02d..0000000000 --- a/engine/Assets/Scripts/Camera/OrbitCameraMode.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: fec4c84cfea34e21ba37c07da97794a5 -timeCreated: 1658433565 \ No newline at end of file diff --git a/engine/Assets/Scripts/Camera/OverviewCameraMode.cs b/engine/Assets/Scripts/Camera/OverviewCameraMode.cs deleted file mode 100644 index 3d1664ff88..0000000000 --- a/engine/Assets/Scripts/Camera/OverviewCameraMode.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Synthesis.UI.Dynamic; -using UnityEngine; - -#nullable enable - -public class OverviewCameraMode : ICameraMode { - public void Start(CameraController cam, T? previousCam) - where T : ICameraMode { - // camera should be positioned above the field looking down - cam.transform.position = new Vector3(0, 10, 0); - cam.transform.rotation = Quaternion.Euler(90, 0, 0); - } - - public void Update(CameraController cam) { - // don't allow camera movement when a modal or panel is open - if (DynamicUIManager.ActiveModal != null || DynamicUIManager.AnyPanels) - return; - // scrolling up zooms out in all other camera modes - cam.transform.Translate(0, 0, CameraController.ZoomSensitivity * Input.mouseScrollDelta.y); - Vector3 position = cam.transform.position; - - if (RobotSimObject.CurrentlyPossessedRobot != string.Empty) { - var robot = RobotSimObject.GetCurrentlyPossessedRobot(); - var focus = robot.GroundedNode.transform.localToWorldMatrix.MultiplyPoint(robot.GroundedBounds.center); - position.x = focus.x; - position.z = focus.z; - } - - cam.GroundRenderer.material.SetVector("_GridFocusPoint", position); - - // user can't go under the field or too far above that they can't see it - cam.transform.position = new Vector3(position.x, Mathf.Clamp(position.y, 0, 100), position.z); - } - - public void LateUpdate(CameraController cam) {} - - public void End(CameraController cam) {} -} \ No newline at end of file diff --git a/engine/Assets/Scripts/Camera/OverviewCameraMode.cs.meta b/engine/Assets/Scripts/Camera/OverviewCameraMode.cs.meta deleted file mode 100644 index d740a37fc3..0000000000 --- a/engine/Assets/Scripts/Camera/OverviewCameraMode.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 53288be058244f878cafe47edbc9da7d -timeCreated: 1658527299 \ No newline at end of file diff --git a/engine/Assets/Scripts/CoreEngine.asmdef b/engine/Assets/Scripts/CoreEngine.asmdef deleted file mode 100644 index e9a67b8450..0000000000 --- a/engine/Assets/Scripts/CoreEngine.asmdef +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "CoreEngine", - "rootNamespace": "", - "references": [ - "GUID:6055be8ebefd69e48b49212b09b47b2f", - "GUID:df380645f10b7bc4b97d4f5eb6303d95", - "GUID:5e0b455853cd340e0813387221dfd501", - "GUID:fe25561d224ed4743af4c60938a59d0b" - ], - "includePlatforms": [], - "excludePlatforms": [], - "allowUnsafeCode": false, - "overrideReferences": true, - "precompiledReferences": [ - "Api.dll", - "MathNet.Spatial.dll", - "MathNet.Numerics.dll", - "System.Drawing.Common.dll", - "Newtonsoft.Json.dll", - "Google.Protobuf.dll", - "Aardvark.dll", - "System.Buffers.dll", - "System.Memory.dll", - "System.Runtime.CompilerServices.Unsafe.dll", - "nunit.framework.dll", - "System.IO.Compression.ZipFile", - "DotNetZip.dll", - "BouncyCastle.Crypto.dll", - "ServerApi.dll", - "Ionic.Zip.dll" - ], - "autoReferenced": true, - "defineConstraints": [], - "versionDefines": [], - "noEngineReferences": false -} \ No newline at end of file diff --git a/engine/Assets/Scripts/CoreEngine.asmdef.meta b/engine/Assets/Scripts/CoreEngine.asmdef.meta deleted file mode 100644 index f2669d34a8..0000000000 --- a/engine/Assets/Scripts/CoreEngine.asmdef.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 51c516958b5932e4c80761515885e0da -AssemblyDefinitionImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Drivers.meta b/engine/Assets/Scripts/Drivers.meta deleted file mode 100644 index 286a50af80..0000000000 --- a/engine/Assets/Scripts/Drivers.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: a7df5d19c15e82a4dac381568941f24f -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Drivers/LinearDriver.cs b/engine/Assets/Scripts/Drivers/LinearDriver.cs deleted file mode 100644 index b005ecc3a5..0000000000 --- a/engine/Assets/Scripts/Drivers/LinearDriver.cs +++ /dev/null @@ -1,101 +0,0 @@ -using UnityEngine; -using SynthesisAPI.Simulation; -using Synthesis.PreferenceManager; -using Google.Protobuf.WellKnownTypes; -using Synthesis.Physics; - -namespace Synthesis { - public class LinearDriver : Driver { - public string Signal => _inputs[0]; - - public ConfigurableJoint JointA { get; private set; } - public ConfigurableJoint JointB { get; private set; } - private float _lastVel = 0; - public float _position = 0f; - public float Position { - get => _position; - private - set { - var newPos = Mathf.Clamp(value, Limits.Lower, Limits.Upper); - JointA.connectedAnchor = JointA.anchor + (JointA.axis * newPos); - if (newPos == Limits.Lower || newPos == Limits.Upper) - _lastVel = 0; - _position = newPos; - } - } - // Note: only used to save between sessions - private JointMotor _motor; - public JointMotor Motor { - get => _motor; - set { - _motor = value; - SimulationPreferences.SetRobotJointMotor((_simObject as RobotSimObject)!.RobotGUID, Name, _motor); - } - } - public (float Upper, float Lower) Limits { get; private set; } - - public double MainInput { - get { - if (PhysicsManager.IsFrozen) - return 0f; - var val = State.GetValue(_inputs[0]); - return val == null ? 0.0 : val.NumberValue; - } - set => State.SetValue(_inputs[0], Value.ForNumber(value)); - } - - public new string Name => State.SignalMap[_inputs[0]].Name; - - public readonly string MotorRef; - - public LinearDriver(string name, string[] inputs, string[] outputs, SimObject simObject, - ConfigurableJoint jointA, ConfigurableJoint jointB, (float, float) limits, string motorRef) - : base(name, inputs, outputs, simObject) { - // Takeover joint configuration and make it more suited to control rather than passive - var l = jointA.linearLimit; - l.limit = 0f; - jointA.linearLimit = l; - - JointA = jointA; - JointB = jointB; - Position = 0f; - Limits = limits; - MotorRef = motorRef; - - var motor = SimulationPreferences.GetRobotJointMotor((simObject as RobotSimObject)!.RobotGUID, motorRef); - - if (motor != null) { - _motor = motor.Value; - } else { - Motor = new JointMotor() { - force = 0.1f, - freeSpin = false, - targetVelocity = 0.2f, - }; - } - } - - public override void Update() { - // TODO: Position - - // VelocityControl - - float value = (float) MainInput; - - var tarVel = value * _motor.targetVelocity; - - var delta = tarVel - _lastVel; - var possibleDelta = _motor.force * Time.deltaTime; // Force = acceleration in M/S/S - - if (Mathf.Abs(delta) > possibleDelta) - delta = possibleDelta * Mathf.Sign(delta); - - _lastVel += delta; - - if (Mathf.Abs(_lastVel * Time.deltaTime) > _motor.targetVelocity) - _lastVel = _motor.targetVelocity * Mathf.Sign(_lastVel); - - Position += _lastVel * Time.deltaTime; - } - } -} diff --git a/engine/Assets/Scripts/Drivers/LinearDriver.cs.meta b/engine/Assets/Scripts/Drivers/LinearDriver.cs.meta deleted file mode 100644 index 470d39b572..0000000000 --- a/engine/Assets/Scripts/Drivers/LinearDriver.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: f04aae3793eda6b40b46ebfc3326f4b9 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Drivers/RotationalDriver.cs b/engine/Assets/Scripts/Drivers/RotationalDriver.cs deleted file mode 100644 index d6bf56cb55..0000000000 --- a/engine/Assets/Scripts/Drivers/RotationalDriver.cs +++ /dev/null @@ -1,329 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using Google.Protobuf.WellKnownTypes; -using Synthesis.PreferenceManager; -using SynthesisAPI.Simulation; -using SynthesisAPI.Utilities; -using UnityEngine; -using Synthesis.Util; -using Synthesis.Physics; -using Math = System.Math; - -#nullable enable - -namespace Synthesis { - public class RotationalDriver : Driver { - private const float MIRABUF_TO_UNITY_FORCE = 40f; - - // clang-format off - private bool _isWheel = false; - // clang-format on - public bool IsWheel => _isWheel; - - public string Signal => _inputs[0]; - - private SimBehaviour? _reservee; - public SimBehaviour? Reservee => _reservee; - public bool IsReserved => _reservee != null; - - /// - /// Global Coordinate Anchor Point for Joint - /// - public Vector3 Anchor { get => _jointA.transform.localToWorldMatrix.MultiplyPoint3x4(_jointA.anchor); } - - /// - /// Global Coordinate Axis for Joint - /// - public Vector3 Axis { - get => _jointA.transform.localToWorldMatrix.MultiplyVector(_jointA.axis); - set => SetAxis(value); - } - - public enum RotationalControlMode { - Position, - Velocity - } - - public double MainInput { - get { - if (PhysicsManager.IsFrozen) - return 0f; - var val = State.GetValue(_inputs[0]); - return val == null ? 0.0 : val.NumberValue; - } - set => State.SetValue(_inputs[0], Value.ForNumber(value)); - } - - public RotationalControlMode ControlMode { - get { - var val = State.GetValue(_inputs[1]); - if (val == null) - throw new Exception($"No value with guid '{_inputs[1]}'"); - - switch (val.StringValue) { - case "Velocity": - return RotationalControlMode.Velocity; - case "Position": - return RotationalControlMode.Position; - default: - throw new Exception("No valid control mode"); - } - } - set { - switch (value) { - case RotationalControlMode.Position: - State.SetValue(_inputs[1], Value.ForString("Position")); - break; - case RotationalControlMode.Velocity: - State.SetValue(_inputs[1], Value.ForString("Velocity")); - break; - default: - throw new Exception("Unrecognized Rotational Control Mode"); - } - } - } - - public new string Name => State.SignalMap[_inputs[0]].Name; - - private JointMotor _motor; - public JointMotor Motor { - get => _motor; - set { - _motor = value; - SimulationPreferences.SetRobotJointMotor((_simObject as RobotSimObject)!.RobotGUID, Name, _motor); - } - } - private HingeJoint _jointA; - public HingeJoint JointA => _jointA; - private HingeJoint _jointB; - public HingeJoint JointB => _jointB; - - private Rigidbody? _rbA; - public Rigidbody RbA { - get { - if (_rbA == null) - _rbA = _jointA.GetComponent(); - return _rbA; - } - } - private Rigidbody? _rbB; - public Rigidbody RbB { - get { - if (_rbB == null) - _rbB = _jointB.GetComponent(); - return _rbB; - } - } - - private float _lastVel = 0f; - private float _fakedTheta = 0f; - private float _fakedOmega = 0f; - - private JointLimits? _rotationalLimits; - - private bool _useFakeMotion = false; - public bool UseFakeMotion { - get => _useFakeMotion; - set { - if (value != _useFakeMotion) { - _useFakeMotion = value; - if (_useFakeMotion) { - return; - } - if (_rotationalLimits.HasValue) { - _jointA.limits = _rotationalLimits.Value; - } - EnableMotor(); - } - } - } - - private bool _useMotor = true; - - // Is this actually used? - public bool UseMotor { get => _useMotor; } - - public readonly string MotorRef; - - private float _convertedMotorTargetVel { get => Motor.targetVelocity * Mathf.Rad2Deg; } - - public RotationalDriver(string name, string[] inputs, string[] outputs, SimObject simObject, HingeJoint jointA, - HingeJoint jointB, bool isWheel, string motorRef) - : base(name, inputs, outputs, simObject) { - _jointA = jointA; - _jointB = jointB; - - if (_jointA.useLimits) { - _rotationalLimits = _jointA.limits; - } - - UseFakeMotion = jointA.useLimits; - - EnableMotor(); - - var motor = SimulationPreferences.GetRobotJointMotor((simObject as RobotSimObject)!.RobotGUID, motorRef); - - if (motor != null) { - _motor = motor.Value; - } else { - Motor = new JointMotor() { - // Default Motor. Slow but powerful enough. Also uses Motor to save it - force = 0.1f, - freeSpin = false, - targetVelocity = 0.2f, - }; - } - - MotorRef = motorRef; - - _isWheel = isWheel; - - State.SetValue(_inputs[1], Value.ForString("Velocity")); - State.SetValue(_outputs[0], Value.ForNumber(0)); - State.SetValue(_outputs[1], Value.ForNumber(1)); - } - - void EnableMotor() { - _useMotor = true; - _jointA.useMotor = true; - } - - void DisableMotor() { - _useMotor = false; - _jointA.useMotor = false; - } - - public bool Reserve(SimBehaviour? behaviour) { - if (behaviour == null || _reservee != null) - return false; - - _reservee = behaviour; - return true; - } - - public void Unreserve() { - _reservee = null; - } - - private float _jointAngle = 0.0f; - private float _lastUpdate = float.NaN; - - public override void Update() { - float deltaT = 0f; - if (!float.IsNaN(_lastUpdate)) { - deltaT = Time.realtimeSinceStartup - _lastUpdate; - } - _lastUpdate = Time.realtimeSinceStartup; - - switch (ControlMode) { - case RotationalControlMode.Position: - PositionControl(); - break; - case RotationalControlMode.Velocity: - VelocityControl(deltaT); - break; - } - - // Angle loops around so this works for now - _jointAngle += (_jointA.velocity * Time.deltaTime) / 360f; - - State.SetValue(_outputs[0], Value.ForNumber(_jointAngle)); - State.SetValue(_outputs[1], Value.ForNumber(_jointA.angle)); - } - - private void PositionControl() { - if (_jointA.useMotor) { - var targetPosition = MainInput; - - var inertiaA = - SynthesisUtil.GetInertiaAroundParallelAxis(_jointA.connectedBody, _jointB.anchor, _jointB.axis); - var inertiaB = - SynthesisUtil.GetInertiaAroundParallelAxis(_jointB.connectedBody, _jointA.anchor, _jointA.axis); - - float error = (float) (targetPosition - _jointA.angle); - while (error < -180) { - error += 360; - } - while (error > 180) { - error -= 360; - } - - float output = error * 0.1f; - - _jointA.motor = - new JointMotor { force = MIRABUF_TO_UNITY_FORCE * Motor.force * (inertiaA / (inertiaA + inertiaB)), - freeSpin = Motor.freeSpin, targetVelocity = _convertedMotorTargetVel * output }; - _jointB.motor = - new JointMotor { force = MIRABUF_TO_UNITY_FORCE * Motor.force * (inertiaB / (inertiaA + inertiaB)), - freeSpin = Motor.freeSpin, targetVelocity = -_convertedMotorTargetVel * output }; - } - } - - private void VelocityControl(float deltaT) { - if (_jointA.useMotor) { - var val = (float) MainInput; - - var inertiaA = - SynthesisUtil.GetInertiaAroundParallelAxis(_jointA.connectedBody, _jointB.anchor, _jointB.axis); - - var inertiaB = - SynthesisUtil.GetInertiaAroundParallelAxis(_jointB.connectedBody, _jointA.anchor, _jointA.axis); - - if (_useFakeMotion) { - float tarVel = val == 0 ? 0 : Mathf.Sign(val) * _convertedMotorTargetVel; - - var delta = tarVel - _lastVel; - var posDelta = _motor.force * Mathf.Rad2Deg * Time.deltaTime; - - if (Mathf.Abs(delta) > posDelta) - delta = posDelta * Mathf.Sign(delta); - - _lastVel += delta; - - if (Mathf.Abs(_lastVel) > _convertedMotorTargetVel) - _lastVel = _convertedMotorTargetVel * Mathf.Sign(_lastVel); - - float lastFakedTheta = _fakedTheta; - _fakedTheta += _lastVel * deltaT; - - if (_rotationalLimits.HasValue) { - if (_fakedTheta > _rotationalLimits.Value.max) { - _fakedTheta = _rotationalLimits.Value.max; - } else if (_fakedTheta < _rotationalLimits.Value.min) { - _fakedTheta = _rotationalLimits.Value.min; - } - - // Limit theta to specific range - _fakedTheta = Mathf.Clamp(_fakedTheta, -180, 179); - - // Check and see if we've hit a hard limit to zero out velocity - if (Math.Abs(lastFakedTheta - _fakedTheta) < 0.001f) - _lastVel = 0; - - _jointA.limits = - new JointLimits { bounceMinVelocity = _rotationalLimits.Value.bounceMinVelocity, - bounciness = _rotationalLimits.Value.bounciness, - contactDistance = _rotationalLimits.Value.contactDistance, max = _fakedTheta + 1, - min = _fakedTheta }; - } - - } else { - _jointA.motor = new JointMotor { force = Motor.force * (inertiaA / (inertiaA + inertiaB)), - freeSpin = Motor.freeSpin, targetVelocity = _convertedMotorTargetVel * val }; - _jointB.motor = new JointMotor { force = Motor.force * (inertiaB / (inertiaA + inertiaB)), - freeSpin = Motor.freeSpin, targetVelocity = -_convertedMotorTargetVel * val }; - } - } - } - - /// - /// Set a new axis for the joints - /// - /// Global vector - public void SetAxis(Vector3 newAxis) { - _jointA.axis = _jointA.transform.worldToLocalMatrix.MultiplyVector(newAxis).normalized; - _jointB.axis = _jointB.transform.worldToLocalMatrix.MultiplyVector(newAxis).normalized; - } - } -} diff --git a/engine/Assets/Scripts/Drivers/RotationalDriver.cs.meta b/engine/Assets/Scripts/Drivers/RotationalDriver.cs.meta deleted file mode 100644 index ea1368c5ee..0000000000 --- a/engine/Assets/Scripts/Drivers/RotationalDriver.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 66cfa9b13e3ac7e4d934f70438cd2f84 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Drivers/WheelDriver.cs b/engine/Assets/Scripts/Drivers/WheelDriver.cs deleted file mode 100644 index a4593561a8..0000000000 --- a/engine/Assets/Scripts/Drivers/WheelDriver.cs +++ /dev/null @@ -1,221 +0,0 @@ -using Google.Protobuf.WellKnownTypes; -using Mirabuf.Joint; -using Synthesis.PreferenceManager; -using SynthesisAPI.Simulation; -using UnityEngine; -using Synthesis.Physics; - -#nullable enable - -namespace Synthesis { - public class WheelDriver : Driver { - private const float MIRABUF_TO_UNITY_FORCE = 40f; - - private CustomWheel _customWheel; - private JointInstance.WheelTypeEnum _wheelType; - - private JointInstance _jointInstance; - public JointInstance JointInstance => _jointInstance; - - private Vector3 _localAnchor = Vector3.zero; - public Vector3 Anchor { - get => _customWheel.Rb.transform.localToWorldMatrix.MultiplyPoint3x4(_localAnchor); - set { - _localAnchor = _customWheel.Rb.transform.worldToLocalMatrix.MultiplyPoint3x4(value); - _customWheel.LocalAnchor = _localAnchor; - } - } - public Vector3 LocalAnchor { - get => _localAnchor; - set { - _localAnchor = value; - _customWheel.LocalAnchor = _localAnchor; - } - } - - private Vector3 _localAxis = Vector3.right; - public Vector3 Axis { - get => _customWheel.Rb.transform.localToWorldMatrix.MultiplyVector(_localAxis); - set { - _localAxis = _customWheel.Rb.transform.worldToLocalMatrix.MultiplyVector(value); - _customWheel.LocalAxis = _localAxis; - } - } - public Vector3 LocalAxis { - get => _localAxis; - set { - _localAxis = value; - _customWheel.LocalAxis = _localAxis; - } - } - - /// - /// Specify a roller direction. NULL roller direction indicates no roller - /// - public Vector3? LocalRoller { - get => _customWheel.LocalRollerRollingDirection; - set { _customWheel.LocalRollerRollingDirection = value; } - } - - private float _radius = 0.05f; - public float Radius { - get => _radius; - set { - _radius = value; - _customWheel.Radius = _radius; - } - } - - public float ImpulseMax { - get => _customWheel.ImpulseMax; - set => _customWheel.ImpulseMax = value; - } - - public enum RotationalControlMode { - Position, - Velocity - } - - public double MainInput { - get { - if (PhysicsManager.IsFrozen) - return 0f; - var val = State.GetValue(_inputs[0]); - return val == null ? 0.0 : val.NumberValue; - } - set => State.SetValue(_inputs[0], Value.ForNumber(value)); - } - - public bool HasContacts => _customWheel.HasContacts; - - private JointMotor _motor; - public JointMotor Motor { - get => _motor; - set { - _motor = value; - SimulationPreferences.SetRobotJointMotor((_simObject as RobotSimObject)!.RobotGUID, MotorRef, _motor); - } - } - - private bool _useMotor = true; - - // Is this actually used? - public bool UseMotor { get => _useMotor; } - - private float _targetRotationalSpeed = 0f; - - public readonly string MotorRef; - - /// - /// Creates a WheelDriver - /// - /// Name of signal - /// Input Signals - /// Output Signals - /// SimObject of which the driver belongs - /// Mirabuf Instance of the Joint constructing this wheel relation - /// Custom Physics Wheel - /// Anchor of the Rotational Joint - /// Axis of the Rotational Joint - /// Radius of the wheel. Automatically calculated if set to NaN - /// Optional parameter of wheel type for joint - public WheelDriver(string name, string[] inputs, string[] outputs, SimObject simObject, - JointInstance jointInstance, CustomWheel customWheel, Vector3 anchor, Vector3 axis, float radius, - string motorRef, JointInstance.WheelTypeEnum wheelType) - : base(name, inputs, outputs, simObject) { - _jointInstance = jointInstance; - _customWheel = customWheel; - _wheelType = wheelType; - - Anchor = _customWheel.Rb.transform.localToWorldMatrix.MultiplyPoint3x4(anchor); - Axis = _customWheel.Rb.transform.localToWorldMatrix.MultiplyVector(axis); - - MotorRef = motorRef; - - if (float.IsNaN(radius)) { - Radius = _customWheel.Rb.transform.GetBounds().extents.y; - } else { - Radius = radius; - } - - var motor = SimulationPreferences.GetRobotJointMotor((simObject as RobotSimObject)!.RobotGUID, motorRef); - - if (motor != null) { - _motor = motor.Value; - } else { - Motor = new JointMotor() { - // Default Motor. Slow but powerful enough. Also uses Motor to save it - force = 1, // About a Neo 550. Max is Falcon 550 at 4.67 - freeSpin = false, - targetVelocity = 30, - }; - } - - MatchRollerToWheelType(); - - State.SetValue(_outputs[0], Value.ForNumber(0)); - State.SetValue(_outputs[1], Value.ForNumber(1)); - } - - void EnableMotor() { - _useMotor = true; - } - - void DisableMotor() { - _useMotor = false; - } - - private float _jointAngle = 0.0f; - private float _lastUpdate = float.NaN; - - public override void Update() { - VelocityControl(); - - _lastUpdate = Time.realtimeSinceStartup; - - // I think these work? - State.SetValue(_outputs[0], Value.ForNumber(_jointAngle / (Mathf.PI * 2f))); - State.SetValue(_outputs[1], Value.ForNumber(PositiveMod(_jointAngle, Mathf.PI))); - } - - public float PositiveMod(float val, float mod) { - var res = val % mod; - if (res < 0) - res += mod; - return res; - } - - public void WheelsPhysicsUpdate(float mod) { - _customWheel.CalculateAndApplyFriction(mod); - } - - public void MatchRollerToWheelType() { - if (_wheelType == JointInstance.WheelTypeEnum.Omni) { - LocalRoller = LocalAxis; - } else { - LocalRoller = null; - } - } - - private void VelocityControl() { - if (!_useMotor) - return; - - var val = (float) MainInput; - var lastRotSpeed = _customWheel.RotationSpeed; - _customWheel.RotationSpeed = val * _motor.targetVelocity; - - if (!float.IsNaN(_lastUpdate)) { - var deltaT = Time.realtimeSinceStartup - _lastUpdate; - - if (deltaT == 0f) - return; - - // Calculations: - // var alpha = (_customWheel.RotationSpeed - lastRotSpeed) / deltaT; - // 0.5f * alpha * deltaT * deltaT + lastRotSpeed * deltaT; - _jointAngle += deltaT * (_customWheel.RotationSpeed - 0.5f * lastRotSpeed); - } - } - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/Drivers/WheelDriver.cs.meta b/engine/Assets/Scripts/Drivers/WheelDriver.cs.meta deleted file mode 100644 index 8a6017c63d..0000000000 --- a/engine/Assets/Scripts/Drivers/WheelDriver.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 35ee5ced2944472abf50485affe549df -timeCreated: 1685645347 \ No newline at end of file diff --git a/engine/Assets/Scripts/FileSystem.meta b/engine/Assets/Scripts/FileSystem.meta deleted file mode 100644 index 41e5db1e8a..0000000000 --- a/engine/Assets/Scripts/FileSystem.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 70b68548cb814ee797894d097ef484bf -timeCreated: 1624312299 \ No newline at end of file diff --git a/engine/Assets/Scripts/FileSystem/FileSystem.cs b/engine/Assets/Scripts/FileSystem/FileSystem.cs deleted file mode 100644 index 225a7c5533..0000000000 --- a/engine/Assets/Scripts/FileSystem/FileSystem.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.IO; -using UnityEngine; - -namespace Synthesis.FileSystem { - public static class FileSystem { - public static string Root = Application.persistentDataPath; - public static string Robots = Path.Combine(Root, "Models"); - public static string Fields = Path.Combine(Root, "Fields"); - public static string Preferences = Path.Combine(Root, "Preferences"); - - /// - /// Create folders in root on runtime - /// Note: Root does not have write access but folders in Root do - /// - [RuntimeInitializeOnLoadMethod] - public static void Init() { - if (!Directory.Exists(Robots)) - Directory.CreateDirectory(Robots); - if (!Directory.Exists(Fields)) - Directory.CreateDirectory(Fields); - if (!Directory.Exists(Preferences)) - Directory.CreateDirectory(Preferences); - } - } -} diff --git a/engine/Assets/Scripts/FileSystem/FileSystem.cs.meta b/engine/Assets/Scripts/FileSystem/FileSystem.cs.meta deleted file mode 100644 index 0808153cd3..0000000000 --- a/engine/Assets/Scripts/FileSystem/FileSystem.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 56a208e53dcf84d73bf0b4b7867d6002 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Gizmos.meta b/engine/Assets/Scripts/Gizmos.meta deleted file mode 100644 index 3bc7a63f39..0000000000 --- a/engine/Assets/Scripts/Gizmos.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 7a21268097878f94f947809f148daf95 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Gizmos/ArrowType.cs b/engine/Assets/Scripts/Gizmos/ArrowType.cs deleted file mode 100644 index 9fbe2efcfb..0000000000 --- a/engine/Assets/Scripts/Gizmos/ArrowType.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Synthesis.Configuration { - /// - /// Used for specifying an X, Y, Z, YZ, XZ, or XY arrow type. - /// - public enum ArrowType { - None, - P, - X, - Y, - Z, - YZ, - XZ, - XY, - RX, - RY, - RZ - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/Gizmos/ArrowType.cs.meta b/engine/Assets/Scripts/Gizmos/ArrowType.cs.meta deleted file mode 100644 index ea1f93c71e..0000000000 --- a/engine/Assets/Scripts/Gizmos/ArrowType.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 3cb60d6f3bfc2974b80963c2f54a3d0b -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Gizmos/ConnectionPointBillboard.cs b/engine/Assets/Scripts/Gizmos/ConnectionPointBillboard.cs deleted file mode 100644 index 15c5d8406d..0000000000 --- a/engine/Assets/Scripts/Gizmos/ConnectionPointBillboard.cs +++ /dev/null @@ -1,14 +0,0 @@ -using UnityEngine; - -public class ConnectionPointBillboard : MonoBehaviour { - void LateUpdate() { - transform.RotateAround(transform.position, transform.up, - CalcSignedCentralAngle(transform.forward, - Vector3.Normalize(Camera.main.transform.position - transform.position), transform.up) * - Mathf.Rad2Deg); - } - - private float CalcSignedCentralAngle( - Vector3 dir1, Vector3 dir2, Vector3 normal) // calculates signed angle projected to a plane - => Mathf.Atan2(Vector3.Dot(Vector3.Cross(dir1, dir2), normal), Vector3.Dot(dir1, dir2)); -} diff --git a/engine/Assets/Scripts/Gizmos/ConnectionPointBillboard.cs.meta b/engine/Assets/Scripts/Gizmos/ConnectionPointBillboard.cs.meta deleted file mode 100644 index 78ba5a0c0e..0000000000 --- a/engine/Assets/Scripts/Gizmos/ConnectionPointBillboard.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 533f5230dc4113548be05134573bca27 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Gizmos/GizmoManager.cs b/engine/Assets/Scripts/Gizmos/GizmoManager.cs deleted file mode 100644 index c91bb1e5df..0000000000 --- a/engine/Assets/Scripts/Gizmos/GizmoManager.cs +++ /dev/null @@ -1,109 +0,0 @@ -using System; -using Synthesis.Physics; -using Synthesis.Runtime; -using SynthesisAPI.InputManager; -using SynthesisAPI.InputManager.Inputs; -using UnityEngine; -using Object = UnityEngine.Object; - -#nullable enable - -namespace Synthesis.Gizmo { - /// - /// Manages Gizmos and ensures only one gizmo spawns at a time. - /// - public static class GizmoManager { - private static GizmoConfig? _currentGizmoConfig; - public static GizmoConfig? CurrentGizmoConfig => _currentGizmoConfig; - private static Transform? _currentTargetTransform; - - public static void Setup() { - SimulationRunner.OnUpdate += UpdateGizmo; - - InputManager.AssignDigitalInput( - "exit-gizmo", new Digital("Return", context: SimulationRunner.GIZMO_SIM_CONTEXT), e => ExitGizmo()); - } - - public static void SpawnGizmo(T gizmoObject) - where T : IGizmo => SpawnGizmo(new GizmoConfig { Transform = gizmoObject.GetGizmoData(), - UpdateCallback = gizmoObject.Update, - EndCallback = gizmoObject.End }); - - public static void SpawnGizmo(TransformData data, Action update, - Action end) => SpawnGizmo(new GizmoConfig { Transform = data, UpdateCallback = update, - EndCallback = end }); - - public static void SpawnGizmo(Vector3 position, Quaternion rotation, Action update, - Action end) => SpawnGizmo(new GizmoConfig { - Transform = new TransformData {Position = position, Rotation = rotation}, - UpdateCallback = update, - EndCallback = end - }); - - public static void SpawnGizmo(GizmoConfig config) { - if (_currentGizmoConfig.HasValue) - ExitGizmo(); - - // Check if modal is opened? - SimulationRunner.AddContext(SimulationRunner.GIZMO_SIM_CONTEXT); - _currentGizmoConfig = config; - - // Really duct-taped way of doing this - _currentTargetTransform = new GameObject("GIZMO_MARKER").transform; - _currentTargetTransform.position = _currentGizmoConfig.Value.Transform.Position; - _currentTargetTransform.rotation = _currentGizmoConfig.Value.Transform.Rotation; - - var gizmo = GameObject.Instantiate(SynthesisAssetCollection.GizmoPrefabStatic, _currentTargetTransform); - gizmo.name = "GIZMO"; - } - - private static void UpdateGizmo() { - if (!_currentGizmoConfig.HasValue || _currentTargetTransform == null) - return; - - _currentGizmoConfig.Value.UpdateCallback(_currentTargetTransform); - } - - public static void ExitGizmo() { - if (!_currentGizmoConfig.HasValue || _currentTargetTransform == null) { - return; - } - - SimulationRunner.RemoveContext(SimulationRunner.GIZMO_SIM_CONTEXT); - _currentGizmoConfig.Value.EndCallback(_currentTargetTransform); - Object.DestroyImmediate(_currentTargetTransform.gameObject); - - _currentGizmoConfig = null; - _currentTargetTransform = null; - } - } - - public struct TransformData { - public static TransformData Default = - new TransformData { Position = Vector3.zero, Rotation = Quaternion.identity }; - - public Vector3 Position; - public Quaternion Rotation; - - public static implicit operator TransformData( - Vector3 position) => new TransformData { Position = position, Rotation = Quaternion.identity }; - public static implicit operator TransformData( - Quaternion rotation) => new TransformData { Position = Vector3.zero, Rotation = rotation }; - public static implicit operator TransformData( - (Vector3, Quaternion) data) => new TransformData { Position = data.Item1, Rotation = data.Item2 }; - public static implicit operator TransformData( - Transform t) => new TransformData { Position = t.position, Rotation = t.rotation }; - } - - public struct GizmoConfig { - public TransformData Transform; - public Action UpdateCallback; - public Action EndCallback; - } - - public interface IGizmo { - public TransformData GetGizmoData(); - public void Update(TransformData data); - public void End(TransformData data); - } -} diff --git a/engine/Assets/Scripts/Gizmos/GizmoManager.cs.meta b/engine/Assets/Scripts/Gizmos/GizmoManager.cs.meta deleted file mode 100644 index a4b3edc510..0000000000 --- a/engine/Assets/Scripts/Gizmos/GizmoManager.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: dd108c47cb0bec14685a4dcfa776a203 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Gizmos/GizmoStore.cs b/engine/Assets/Scripts/Gizmos/GizmoStore.cs deleted file mode 100644 index ffbab169d2..0000000000 --- a/engine/Assets/Scripts/Gizmos/GizmoStore.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class GizmoStore : MonoBehaviour { - public GameObject GizmoPrefab; - public static GameObject GizmoPrefabStatic; - - public void Awake() { - if (GizmoPrefab == null) - throw new System.Exception(); - GizmoPrefabStatic = GizmoPrefab; - } -} diff --git a/engine/Assets/Scripts/Gizmos/GizmoStore.cs.meta b/engine/Assets/Scripts/Gizmos/GizmoStore.cs.meta deleted file mode 100644 index 41d099918c..0000000000 --- a/engine/Assets/Scripts/Gizmos/GizmoStore.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 81ea0101f432bf04aae3a26f78332ca4 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Gizmos/MoveArrow.cs b/engine/Assets/Scripts/Gizmos/MoveArrow.cs deleted file mode 100644 index d832b08ebb..0000000000 --- a/engine/Assets/Scripts/Gizmos/MoveArrow.cs +++ /dev/null @@ -1,476 +0,0 @@ -using System; -using System.Linq; -using Synthesis.Gizmo; -using Synthesis.Physics; -using UnityEngine; - -namespace Synthesis.Configuration { - public class MoveArrow : MonoBehaviour { - private const float SCALE = 0.075f; - private const float GIZMO_PITCH = -80; - private const float SNAP_ROTATION_TO_DEGREES = 15; - private const float SNAP_POSITION_TO_METERS = 0.5f; - private const float FLOOR_BOUNDS = 0f; - private const float BOUNDS = 50f; - - // limits a single movement boundary to this number times the distance from camera to position - private const float SINGLE_MOVE_LIMIT_SCALE = 20f; - - private Vector3 _initialScale; - private Vector3 _lastArrowPoint; - private ArrowType _activeArrow; - private bool _bufferPassed; - private bool _snapEnabled; - - private Plane _axisPlane; - private Plane _markerPlane; - - private Transform _parent; - private Func _originalCameraFocusPoint; - private Transform _gizmoCameraTransform; - - private CameraController _camComtroller; - private ICameraMode _previousMode; - private Vector3 _previousCameraPosition; - private Quaternion _previousCameraRotation; - private OrbitCameraMode _orbit; - private float _originalLowerPitch; - - private float _startRotation; - - private Transform _arrowTransform; - private Transform _axisArrowTransform; - private Transform _arrowX; - private Transform _arrowY; - private Transform _arrowZ; - - private RobotSimObject _robot; - - private Camera _mainCam; - - // To use: move gizmo as a child of the object you want to move in game - // Press R to reset rotation - // Press CTRL to snap to nearest configured multiple when moving - // Added gameObjects to Game while this script is active will not have their rigidbodies disabled - - /// - /// Gets or sets the active selected arrow. When - /// is changed, the "SetActiveArrow" message is broadcast to all - /// s. - /// - private ArrowType ActiveArrow { - get => _activeArrow; - set { - _activeArrow = value; - BroadcastMessage("SetActiveArrow", _activeArrow); - } - } - - /// - /// Returns a representing the direction the selected - /// arrow is facing, or if no arrow is selected. - /// - private Vector3 ArrowDirection { - get { - switch (ActiveArrow) { - case ArrowType.X: - case ArrowType.YZ: - case ArrowType.RX: - return transform.right; - case ArrowType.Y: - case ArrowType.XZ: - case ArrowType.RY: - return transform.up; - case ArrowType.Z: - case ArrowType.XY: - case ArrowType.RZ: - return transform.forward; - default: - return Vector3.zero; - } - } - } - - private void Awake() { - _mainCam = Camera.main!; - _camComtroller = _mainCam.GetComponent(); - _originalLowerPitch = _camComtroller.PitchLowerLimit; - _robot = RobotSimObject.GetCurrentlyPossessedRobot(); - - if (OrbitCameraMode.FocusPoint == null) { - _originalCameraFocusPoint = () => - _robot.GroundedNode != null && _robot.GroundedBounds != null - ? _robot.GroundedNode.transform.localToWorldMatrix.MultiplyPoint(_robot.GroundedBounds.center) - : Vector3.zero; - } else { - _originalCameraFocusPoint = (Func) OrbitCameraMode.FocusPoint.Clone(); - } - _previousMode = _camComtroller.CameraMode; - _camComtroller.CameraMode = CameraController.CameraModes["Orbit"]; - - var camTrf = _camComtroller.transform; - _previousCameraPosition = camTrf.position; - _previousCameraRotation = camTrf.rotation; - - // configure axis arrow transforms for later use - _arrowTransform = transform; - - _arrowX = transform.Find("X").GetComponent(); - _arrowY = transform.Find("Y").GetComponent(); - _arrowZ = _arrowTransform.Find("Z").GetComponent(); - - var arrowScale = _arrowTransform.localScale; - - _initialScale = new Vector3(arrowScale.x / _arrowTransform.lossyScale.x, - _arrowTransform.localScale.y / arrowScale.y, arrowScale.z / arrowScale.z); - } - - private void SetTransform() { // called to set certain value when activated or when the parent changes - - PhysicsManager.IsFrozen = true; - - _parent = transform.parent; - _arrowTransform.localPosition = Vector3.zero; - _arrowTransform.localRotation = Quaternion.identity; - - // clang-format off - _gizmoCameraTransform = new GameObject().transform; - _gizmoCameraTransform.position = _arrowTransform.parent.position; // camera shifting - OrbitCameraMode.FocusPoint = () => _gizmoCameraTransform.position; // camera focus - _camComtroller.PitchLowerLimit = GIZMO_PITCH; // camera pitch limits - // clang-format on - } - - private void RestoreCameraMode() { - _camComtroller.CameraMode = _previousMode; - _camComtroller.transform.position = _previousCameraPosition; - _camComtroller.transform.rotation = _previousCameraRotation; - - if (_originalCameraFocusPoint == null) { - OrbitCameraMode.FocusPoint = () => - _robot.GroundedNode != null && _robot.GroundedBounds != null - ? _robot.GroundedNode.transform.localToWorldMatrix.MultiplyPoint(_robot.GroundedBounds.center) - : Vector3.zero; - } else { - OrbitCameraMode.FocusPoint = _originalCameraFocusPoint; - } - - // test if cam.cameraMode is of type OrbitCameraMode - if (_camComtroller.CameraMode is OrbitCameraMode) { - _camComtroller.PitchLowerLimit = _originalLowerPitch; - } - } - - private void DisableGizmo() { // makes sure values are set correctly when the gizmo is removed - Destroy(_gizmoCameraTransform.gameObject); - RestoreCameraMode(); - CameraController.isOverGizmo = false; // this doesn't get reset? - PhysicsManager.IsFrozen = false; - } - - private void OnEnable() { - SetTransform(); - } - - private void OnDestroy() { - DisableGizmo(); - } - - private SelectableArrow _currentlyHovering; - - private void Update() { - Ray cameraRay = _mainCam.ScreenPointToRay(Input.mousePosition); - - if (Input.GetKeyDown(KeyCode.Escape)) { - GizmoManager.ExitGizmo(); - RestoreCameraMode(); - } - if (Input.GetKeyDown(KeyCode.R)) { // Reset on press R - _parent.rotation = Quaternion.identity; - } - if (Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl)) { // enable snap on ctrl press - _snapEnabled = true; - } else { - _snapEnabled = false; - } - - if (_activeArrow == ArrowType.None) // skip if there no gizmo components being dragged - return; - - // This allows for any updates from OnClick to complete before translation starts - if (!_bufferPassed) { - _bufferPassed = true; - return; - } - - switch (_activeArrow) { - // for marker point: allows for drag on a plane directly facing camera - case ArrowType.P: { - _markerPlane.Raycast(cameraRay, out var rayLength); // intersection between mouse ray and plane - _parent.position = cameraRay.GetPoint(rayLength); // finds point on ray - - if (_parent.position.y < 0) // limits y axis movements - _parent.position = new Vector3(_parent.position.x, 0, _parent.position.z); - break; - } - // plane and axis arrows movements - case <= ArrowType.XY: { - Ray mouseRay = _mainCam.ScreenPointToRay(Input.mousePosition); - Vector3 currentArrowPoint; - - if (_activeArrow <= ArrowType.Z) { - // draws plane with the same normal as the axis arrow, which faces the camera - Plane axisArrowPlane = new Plane(_axisArrowTransform.forward, _parent.position); - - // a ray from the mouse is drawn to intersect the plane - float rayLimit = Vector3.Distance(_mainCam.transform.position, _gizmoCameraTransform.position) * - SINGLE_MOVE_LIMIT_SCALE; - if (!axisArrowPlane.Raycast(mouseRay, out var rayDistance) || - rayDistance > - rayLimit) // limits the maximum distance the ray can be to prevent moving it to infinity - rayDistance = rayLimit; - - // finds nearest point on the axis line that is closest to the intersection point - ClosestPointsOnTwoLines(out Vector3 _, out currentArrowPoint, - axisArrowPlane.ClosestPointOnPlane(mouseRay.GetPoint(rayDistance)), - _axisArrowTransform.right, _parent.position, ArrowDirection); - - } else { - // draws plane on the plane's axis then intersects mouse ray with the axis - Plane plane = new Plane(ArrowDirection, _parent.position); - - float rayLimit = Vector3.Distance(_mainCam.transform.position, _gizmoCameraTransform.position) * - SINGLE_MOVE_LIMIT_SCALE; - // limit is distance from camera to object multiplied by a scalar - - if (!plane.Raycast(mouseRay, out var rayDistance) || - rayDistance > rayLimit) // limits ray distance to prevent moving to infinity - rayDistance = rayLimit; - - currentArrowPoint = plane.ClosestPointOnPlane(mouseRay.GetPoint(rayDistance)); - } - - bool setLastArrowPoint = true; // will be set to false if a boundary is hit - if (_lastArrowPoint != Vector3.zero) { - if (_snapEnabled && - _activeArrow <= - ArrowType.Z) // snaps to configurable amount when control is held down. does this - // by setting current arrow point to rounded distance - currentArrowPoint = LerpByDistance(_lastArrowPoint, currentArrowPoint, - RoundTo(Vector3.Distance(_lastArrowPoint, currentArrowPoint), SNAP_POSITION_TO_METERS)); - - Vector3 projectedPosition = _parent.position + currentArrowPoint - _lastArrowPoint; - setLastArrowPoint = projectedPosition.y >= FLOOR_BOUNDS; // sets movement bounds - if (setLastArrowPoint) - _parent.position += currentArrowPoint - _lastArrowPoint; - } - if (setLastArrowPoint) - _lastArrowPoint = - currentArrowPoint; // last arrow point keeps track of where the mouse is relative - // to the center of the parent object - break; - } - default: { - // if mouse ray doesn't intersect plane, set default ray length - if (!_axisPlane.Raycast(cameraRay, out var rayLength)) - rayLength = Vector3.Distance(_mainCam.transform.position, _parent.position) * 10; - - // get intersection point; if none, find closest point to default length - Vector3 pointToLook = _axisPlane.ClosestPointOnPlane(cameraRay.GetPoint(rayLength)); - - // Correct parent's forward depending on rotation axis. Y-axis does not need corrections - Vector3 t; - if (ActiveArrow == ArrowType.RZ) - t = _parent.right; - else if (ActiveArrow == ArrowType.RX) - t = _parent.up; - else - t = _parent.forward; - _parent.RotateAround(_parent.position, _axisPlane.normal, // defines point and axis plane - -1 * - RoundTo( - Vector3.SignedAngle(pointToLook - _parent.position, t, _axisPlane.normal) - - _startRotation, // rounds degrees of rotation axis forward to mouse ray intersection - _snapEnabled - ? SNAP_ROTATION_TO_DEGREES - : 0f)); // if control is pressed, snap to configurable value, otherwise, don't snap - break; - } - } - - // allows for the parent transform to be modified multiple times without changing the parent's actual - // transform. It is set at the end of the Update loop. - transform.parent = _parent; - } - - /// - /// Scales the arrows to maintain a constant size relative to screen coordinates. - /// - private void LateUpdate() { - Plane plane = new Plane(_mainCam.transform.forward, _mainCam.transform.position); - float dist = plane.GetDistanceToPoint(transform.position); - transform.localScale = _initialScale * SCALE * dist; - Vector3 scaleTmp = gameObject.transform.localScale; - scaleTmp.x /= _parent.localScale.x; - scaleTmp.y /= _parent.localScale.y; - scaleTmp.z /= _parent.localScale.z; - gameObject.transform.localScale = scaleTmp; - } - - /// - /// Sets the active arrow when a is selected. - /// - /// - private void OnArrowSelected(ArrowType arrowType) { - ActiveArrow = arrowType; - _lastArrowPoint = Vector3.zero; - _bufferPassed = false; - - if (arrowType == ArrowType.P) // sets marker's plane - _markerPlane = new Plane(Vector3.Normalize(_mainCam.transform.forward), _parent.position); - else if (arrowType <= ArrowType.Z) { // sets up axis arrows for plane creation - switch (arrowType) { - case ArrowType.X: - _axisArrowTransform = _arrowX; - break; - case ArrowType.Y: - _axisArrowTransform = _arrowY; - break; - case ArrowType.Z: - _axisArrowTransform = _arrowZ; - break; - } - } else if (arrowType >= ArrowType.RX) { // creates plane for rotation - _axisPlane = new Plane(ArrowDirection, _parent.position); - - // the following code determines the starting offset between the mouse and the gizmo. - // does the exact same thing as a normal rotation, but extracts the resulting angle as the initial - // offset - - // Project a ray from mouse - Ray cameraRay = _mainCam.ScreenPointToRay(Input.mousePosition); - - // if mouse ray doesn't intersect plane, set default ray length - if (!_axisPlane.Raycast(cameraRay, out var rayLength)) - rayLength = Vector3.Distance(_mainCam.transform.position, _parent.position) * 10; - - // get intersection point; if none, find closest point to default length - Vector3 pointToLook = _axisPlane.ClosestPointOnPlane(cameraRay.GetPoint(rayLength)); - - // Correct parent's forward depending on rotation axis. Y-axis does not need corrections - Vector3 t; - if (ActiveArrow == ArrowType.RZ) - t = _parent.right; - else if (ActiveArrow == ArrowType.RX) - t = _parent.up; - else - t = _parent.forward; - - // sets the starting rotational offset to the angle - _startRotation = Vector3.SignedAngle(pointToLook - _parent.position, t, _axisPlane.normal); - } - } - - /// - /// Sets the active arrow to when a - /// is released. - /// - private void OnArrowReleased() { - ActiveArrow = ArrowType.None; - - // detect if object is out of bounds - float x = transform.parent.position.x; - float y = transform.parent.position.y; - float z = transform.parent.position.z; - transform.parent.position = new Vector3(Mathf.Abs(x) > BOUNDS ? (x / Mathf.Abs(x) * BOUNDS) : x, - Mathf.Abs(y) > BOUNDS ? (y / Mathf.Abs(y) * BOUNDS) : y, - Mathf.Abs(z) > BOUNDS ? (z / Mathf.Abs(z) * BOUNDS) : z); - - // move the camera - _gizmoCameraTransform.position = transform.parent.position; - OrbitCameraMode.FocusPoint = () => _gizmoCameraTransform.position; - } - - /// - /// Enables or disables rigidbodies using isKinematic and detect collisions - /// - /// - public void SetRigidbodies(bool enabled) { - // Robot exists - if (RobotSimObject.CurrentlyPossessedRobot != String.Empty) { - var robot = RobotSimObject.GetCurrentlyPossessedRobot(); - var rbs = robot.RobotNode.GetComponentsInChildren(); - rbs.ForEach(e => { - e.isKinematic = !enabled; - e.detectCollisions = enabled; - }); - } - - if (FieldSimObject.CurrentField != null) { - FieldSimObject.CurrentField.GroundedNode.GetComponentsInChildren() - .Where(e => e.name != "grounded" && !e.name.StartsWith("gamepiece")) - .Concat(FieldSimObject.CurrentField.Gamepieces.Where(e => !e.IsCurrentlyPossessed) - .Select(e => e.GamepieceObject.GetComponent())) - .ForEach(e => { - e.isKinematic = !enabled; - e.detectCollisions = enabled; - }); - } - } - - /// - /// Based on a solution provided by the Unity Wiki (http://wiki.unity3d.com/index.php/3d_Math_functions). - /// Finds the closest points on two lines. - /// - /// - /// - /// - /// - /// - /// - /// - private bool ClosestPointsOnTwoLines(out Vector3 closestPointLine1, out Vector3 closestPointLine2, - Vector3 linePoint1, Vector3 lineVec1, Vector3 linePoint2, Vector3 lineVec2) // used for axis arrows movement - { - closestPointLine1 = Vector3.zero; - closestPointLine2 = Vector3.zero; - - float a = Vector3.Dot(lineVec1, lineVec1); - float b = Vector3.Dot(lineVec1, lineVec2); - float e = Vector3.Dot(lineVec2, lineVec2); - - float d = a * e - b * b; - - // Check if lines are parallel - if (d == 0.0f) - return false; - - Vector3 r = linePoint1 - linePoint2; - float c = Vector3.Dot(lineVec1, r); - float f = Vector3.Dot(lineVec2, r); - - float s = (b * f - c * e) / d; - float t = (a * f - c * b) / d; - - closestPointLine1 = linePoint1 + lineVec1 * s; - closestPointLine2 = linePoint2 + lineVec2 * t; - - return true; - } - - float RoundTo(float value, float multipleOf) { // used for snapping the gizmo to the nearest value - if (multipleOf != 0) - return Mathf.Round(value / multipleOf) * multipleOf; - - return value; - } - - /// - /// Finds the Vector3 point a distance of x away from Point A and on line AB - /// - public Vector3 LerpByDistance(Vector3 A, Vector3 B, float x) { // for snapping transformations - Vector3 P = x * Vector3.Normalize(B - A) + A; - return P; - } - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/Gizmos/MoveArrow.cs.meta b/engine/Assets/Scripts/Gizmos/MoveArrow.cs.meta deleted file mode 100644 index f44477e317..0000000000 --- a/engine/Assets/Scripts/Gizmos/MoveArrow.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: a55a216b91e30ed449299b3adb7807b0 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Gizmos/SelectableArrow.cs b/engine/Assets/Scripts/Gizmos/SelectableArrow.cs deleted file mode 100644 index ed241037b2..0000000000 --- a/engine/Assets/Scripts/Gizmos/SelectableArrow.cs +++ /dev/null @@ -1,96 +0,0 @@ -using System; -using UnityEngine; - -namespace Synthesis.Configuration { - public class SelectableArrow : MonoBehaviour { - private const float HiddenAlpha = 0.25f; - - private ArrowType arrowType; - private Material material; - private Color color; - private bool selectable; - - private Quaternion startRotation; - - /// - /// Initializes the and saves the assigned - /// . - /// - private void Start() { - if (!Enum.TryParse(name, out arrowType)) - arrowType = ArrowType.None; - - material = GetComponent().material; - color = material.color; - selectable = true; - } - - private void LateUpdate() { - if (arrowType == ArrowType.P) // keeps marker looking at the camera - { - transform.LookAt(Camera.main.transform.position); - } else if (arrowType <= ArrowType.Z) // keeps axis arrows looking at the camera - { - transform.RotateAround(transform.position, transform.up, - CalcSignedCentralAngle(transform.forward, - Vector3.Normalize(Camera.main.transform.position - transform.position), transform.up) * - Mathf.Rad2Deg); - } - } - - private float CalcSignedCentralAngle( - Vector3 dir1, Vector3 dir2, Vector3 normal) // calculates signed angle projected to a plane - => Mathf.Atan2(Vector3.Dot(Vector3.Cross(dir1, dir2), normal), Vector3.Dot(dir1, dir2)); - - /// - /// Sends a message upwards when this - /// is selected. - /// - public void OnMouseDown() { - SendMessageUpwards("OnArrowSelected", arrowType); - } - - /// - /// Sends a message upwards when this - /// is released. - /// - public void OnMouseUp() { - SendMessageUpwards("OnArrowReleased"); - material.color = color; - } - - /// - /// Highlights the arrow yellow when it is hovered over. - /// - public void OnMouseEnter() { - CameraController.isOverGizmo = true; - if (selectable) - material.color = Color.Lerp(color, new Color(30.0f / 255.0f, 164f / 255f, 212f / 255f, 1), 0.75f); - } - - /// - /// Returns the arrow to its original color when the mouse - /// is no longer hovering over it. - /// - public void OnMouseExit() { - CameraController.isOverGizmo = false; - if (selectable) - material.color = color; - } - - /// - /// Sets the alpha of this according to the - /// provided. - /// - /// - private void SetActiveArrow(ArrowType activeArrow) { - if (selectable = (activeArrow == ArrowType.None)) { - material.color = color; - } else { - Color newColor = material.color; - newColor.a = arrowType == activeArrow ? 1f : color.a * HiddenAlpha; - material.color = newColor; - } - } - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/Gizmos/SelectableArrow.cs.meta b/engine/Assets/Scripts/Gizmos/SelectableArrow.cs.meta deleted file mode 100644 index 846fa073b4..0000000000 --- a/engine/Assets/Scripts/Gizmos/SelectableArrow.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 794795dbe4bc3644f99ee2cb3ae4b1ef -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Gizmos/SignalsOverlayRenderer.cs b/engine/Assets/Scripts/Gizmos/SignalsOverlayRenderer.cs deleted file mode 100644 index bce8498e61..0000000000 --- a/engine/Assets/Scripts/Gizmos/SignalsOverlayRenderer.cs +++ /dev/null @@ -1,105 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.UI; - -public class SignalsOverlayRenderer : MonoBehaviour { - public static SignalsOverlayRenderer Instance { get; private set; } - - public Font GuiFont; - [SerializeField] - private Transform Canvas; - [SerializeField] - private GameObject LinePrefab; - - public void Awake() { - Instance = this; - } - - public void OnGUI() { - var style = new GUIStyle() { - alignment = TextAnchor.MiddleCenter, - font = GuiFont, - fontSize = 36, - normal = new GUIStyleState() { textColor = Color.white }, - }; - - GUI.contentColor = Color.white; - - GUI.Label(new Rect(100f, 100f, 50f, 50f), "0", style); - } - - public static GameObject BuildNewLinePrefab() => Instantiate(Instance.LinePrefab, Instance.Canvas); -} - -public class Line { - private const string POINT_A = "_PointA"; - private const string POINT_B = "_PointB"; - private const string COLOR = "_Color"; - private const string STROKE = "_Stroke"; - private const string ACTUAL_SCREEN_PARAMS = "_ActualScreenParams"; - - private Material _lineMaterial; - private GameObject _lineObject; - - private Vector2 _pointA = new Vector2(0, 0); - public Vector2 PointA { - get => _pointA; - set { - _pointA = value; - _lineMaterial.SetVector(POINT_A, new Vector4(_pointA.x, _pointA.y, 0f, 1f)); - } - } - private Vector2 _pointB = new Vector2(0, 0); - public Vector2 PointB { - get => _pointB; - set { - _pointB = value; - _lineMaterial.SetVector(POINT_B, new Vector4(_pointB.x, _pointB.y, 0f, 1f)); - } - } - private Color _color = Color.white; - public Color Color { - get => _color; - set { - _color = value; - _lineMaterial.SetColor(COLOR, _color); - } - } - private float _stroke = 1.0f; - public float Stroke { - get => _stroke; - set { - _stroke = value; - _stroke = Mathf.Clamp(_stroke, 1.0f, 100.0f); - _lineMaterial.SetFloat(STROKE, _stroke); - } - } - private Vector2 _ASP = new Vector2(1920, 1080); - public Vector2 ActualScreenParams { - get => _ASP; - set { - _ASP = value; - _lineMaterial.SetVector(ACTUAL_SCREEN_PARAMS, new Vector4(_ASP.x, _ASP.y, 0f, 1f)); - } - } - - public Line(Vector2 a, Vector2 b) { - _lineObject = SignalsOverlayRenderer.BuildNewLinePrefab(); - var img = _lineObject.GetComponent(); - _lineMaterial = new Material(img.material); - img.material = _lineMaterial; - - // Init - PointA = a; - PointB = b; - Color = _color; - Stroke = _stroke; - ActualScreenParams = _ASP; - } - - public void DeleteLine() { - _lineMaterial = null; - GameObject.Destroy(_lineObject); - } -} diff --git a/engine/Assets/Scripts/Gizmos/SignalsOverlayRenderer.cs.meta b/engine/Assets/Scripts/Gizmos/SignalsOverlayRenderer.cs.meta deleted file mode 100644 index 0be1882038..0000000000 --- a/engine/Assets/Scripts/Gizmos/SignalsOverlayRenderer.cs.meta +++ /dev/null @@ -1,17 +0,0 @@ -fileFormatVersion: 2 -<<<<<<< HEAD -======= -<<<<<<< HEAD:engine/Assets/Scripts/Networking/NetworkManager.cs.meta -guid: 1830ed1e942a3f14a989885bf2abd2b9 -======= ->>>>>>> Basic UDP communcation -guid: cf68f9e4e7b0b5d40a9dec8806dc9c78 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/GodMode.cs b/engine/Assets/Scripts/GodMode.cs deleted file mode 100644 index d01692e763..0000000000 --- a/engine/Assets/Scripts/GodMode.cs +++ /dev/null @@ -1,118 +0,0 @@ -using Synthesis.PreferenceManager; -using Synthesis.Runtime; -using SynthesisAPI.InputManager; -using SynthesisAPI.InputManager.Inputs; -using UnityEngine; -using Input = UnityEngine.Input; - -public class GodMode : MonoBehaviour { - public double ZoomSensitivity = 0.15; - public double MovementSpeed = 3.0; - private GameObject grabbedObject; - private ConfigurableJoint grabJoint; - private double grabbedDistance = 0.0; - - private Rigidbody _pointerBody = null; - - private GameObject GetGameObjectWithRigidbody(GameObject gameObj) { - Rigidbody rb = gameObj.GetComponent(); - if (rb != null && !rb.isKinematic) - return gameObj; - return gameObj.transform.parent != null ? GetGameObjectWithRigidbody(gameObj.transform.parent.gameObject) - : null; - } - - public const string ENABLED_GOD_MODE_INPUT = "input/enable_god_mode"; - public const string GOD_MODE_DRAG_INPUT = "input/god_mode_drag_object"; - - private void Start() { - InputManager.AssignValueInput(ENABLED_GOD_MODE_INPUT, - TryGetSavedInput(ENABLED_GOD_MODE_INPUT, new Digital("G", context: SimulationRunner.RUNNING_SIM_CONTEXT))); - InputManager.AssignValueInput( - GOD_MODE_DRAG_INPUT, TryGetSavedInput(GOD_MODE_DRAG_INPUT, - new Digital("Mouse0", context: SimulationRunner.RUNNING_SIM_CONTEXT))); - } - - private Analog TryGetSavedInput(string key, Analog defaultInput) { - if (InputManager.MappedValueInputs.ContainsKey(key)) { - var input = InputManager.GetAnalog(key); - input.ContextBitmask = defaultInput.ContextBitmask; - return input; - } - if (PreferenceManager.ContainsPreference(key)) { - var input = PreferenceManager.GetPreference(key) ?? - (Digital) PreferenceManager.GetPreference(key) [0].GetInput(); - input.ContextBitmask = defaultInput.ContextBitmask; - return input; - } else { - return defaultInput; - } - } - - private float _lastUpdate = float.NaN; - private Vector3 _speed, _lastPosition; - - private GameObject _pointer; - - private void Update() { - bool godModeKeyDown = InputManager.MappedValueInputs[ENABLED_GOD_MODE_INPUT].Value == 1.0F; - bool mouseDown = InputManager.MappedValueInputs[GOD_MODE_DRAG_INPUT].Value == 1.0F; - if (godModeKeyDown) { - if (mouseDown && grabbedObject == null) { - Camera camera = Camera.main; - Ray ray = camera.ScreenPointToRay(Input.mousePosition); - RaycastHit hitInfo; - bool hit = Physics.Raycast(ray, out hitInfo); - if (hit) { - grabbedObject = GetGameObjectWithRigidbody(hitInfo.collider.gameObject); - if (grabbedObject != null) { - _pointer = new GameObject("GODMODE_POINTER_RB"); - _pointerBody = _pointer.AddComponent(); - _pointerBody.isKinematic = true; - - _lastUpdate = Time.realtimeSinceStartup; - _speed = Vector3.zero; - _lastPosition = grabbedObject.transform.position; - - grabbedDistance = hitInfo.distance; - _pointerBody.transform.position = hitInfo.point; - // add a joint to the grabbed object anchored at where the user clicked - Vector3 localCoords = grabbedObject.transform.worldToLocalMatrix.MultiplyPoint(hitInfo.point); - grabJoint = grabbedObject.AddComponent(); - grabJoint.connectedBody = _pointerBody; - grabJoint.anchor = localCoords; - grabJoint.xMotion = grabJoint.yMotion = grabJoint.zMotion = ConfigurableJointMotion.Locked; - } - } - } else if (mouseDown && grabJoint != null) { - // move towards and away from the camera on scroll - grabbedDistance += ZoomSensitivity * Input.mouseScrollDelta.y; - Camera camera = Camera.main; - Vector3 mousePosition = Input.mousePosition; - mousePosition.z = (float) grabbedDistance; - Ray ray = camera.ScreenPointToRay(mousePosition); - // move grabbed object towards mouse cursor - - if (ray.GetPoint((float) grabbedDistance).y >= 0) { - var delta = (ray.GetPoint((float) grabbedDistance) - _pointerBody.position) * - (float) MovementSpeed * Time.deltaTime; - _pointerBody.position += delta; - - _speed = delta / Time.deltaTime; - } - } - } - - if (!mouseDown && grabJoint != null) { - Destroy(grabJoint); - Destroy(_pointerBody); - if (_pointer != null) - Destroy(_pointer); - - _pointerBody = null; - grabbedObject.GetComponent().velocity = _speed; - grabbedObject = null; - grabJoint = null; - } - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/GodMode.cs.meta b/engine/Assets/Scripts/GodMode.cs.meta deleted file mode 100644 index 655d1b8c61..0000000000 --- a/engine/Assets/Scripts/GodMode.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: ae7d17a5078b419190218853c9d10b9c -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Graphics.meta b/engine/Assets/Scripts/Graphics.meta deleted file mode 100644 index 16032f6058..0000000000 --- a/engine/Assets/Scripts/Graphics.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 4da929b5e6b1c4948a4f0790334329b6 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/GridEntry.cs b/engine/Assets/Scripts/GridEntry.cs deleted file mode 100644 index 070b89ac02..0000000000 --- a/engine/Assets/Scripts/GridEntry.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using SynthesisAPI.Utilities; - -using Logger = SynthesisAPI.Utilities.Logger; -using System; - -public class GridEntry : MonoBehaviour { - public float Delay; - public float Length; - - [SerializeField] - public Renderer FloorRenderer; - private Material _mat; - private Material MatRef => FloorRenderer.material; - - private float innerRadius; - private float featherRadius; - - private void Start() { - innerRadius = FloorRenderer.material.GetFloat("INNER_RADIUS"); - featherRadius = FloorRenderer.material.GetFloat("FEATHER_RADIUS"); - - _mat = new Material(FloorRenderer.material); - FloorRenderer.material = _mat; - MatRef.SetFloat("INNER_RADIUS", 0f); - MatRef.SetFloat("FEATHER_RADIUS", 0f); - - _startTime = Time.realtimeSinceStartup; - } - - private float _startTime = 0f; - - private void Update() { - if (Time.realtimeSinceStartup - _startTime > Length + Delay) { - MatRef.SetFloat("INNER_RADIUS", innerRadius); - MatRef.SetFloat("FEATHER_RADIUS", featherRadius); - Destroy(this); - } else { - float progress = Mathf.Clamp( - Mathf.Clamp(((Time.realtimeSinceStartup - _startTime) - Delay), 0f, float.MaxValue) / Length, 0f, 1f); - Func progressFunc = (float x) => (-Mathf.Pow((x - 1), 2)) + 1f; - // clang-format off - progress = progressFunc(progress); - // clang-format on - MatRef.SetFloat("INNER_RADIUS", innerRadius * progress); - MatRef.SetFloat("FEATHER_RADIUS", featherRadius * progress); - } - } -} diff --git a/engine/Assets/Scripts/GridEntry.cs.meta b/engine/Assets/Scripts/GridEntry.cs.meta deleted file mode 100644 index 096b2d90e6..0000000000 --- a/engine/Assets/Scripts/GridEntry.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: b1ad0b1f30e7ea341a889563c9609494 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/HighlightComponent.cs b/engine/Assets/Scripts/HighlightComponent.cs deleted file mode 100644 index 38880f593b..0000000000 --- a/engine/Assets/Scripts/HighlightComponent.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using UnityEngine; - -public class HighlightComponent : MonoBehaviour { - private Material _material; - private MeshRenderer[] _renderers; - private Material[] _originalMaterials; - - private Color _color; - public Color Color { - get => _color; - set { - _color = value; - OnEnable(); - } - } - - public void Awake() { - _renderers = gameObject.GetComponentsInChildren(); - _originalMaterials = _renderers.Select(x => x.material).ToArray(); - _material = new Material(Shader.Find("Shader Graphs/HighlightShader")); - } - - public void OnEnable() { - _material.SetColor("_Color", _color); - for (int i = 0; i < _renderers.Length; i++) { - _renderers[i].material = _material; - } - } - - public void OnDisable() { - for (int i = 0; i < _renderers.Length; i++) { - _renderers[i].material = _originalMaterials[i]; - } - } -} diff --git a/engine/Assets/Scripts/HighlightComponent.cs.meta b/engine/Assets/Scripts/HighlightComponent.cs.meta deleted file mode 100644 index 7c86acd77e..0000000000 --- a/engine/Assets/Scripts/HighlightComponent.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 5922dcf1a773273119de0d8ce7c0b081 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Importer.meta b/engine/Assets/Scripts/Importer.meta deleted file mode 100644 index be24216822..0000000000 --- a/engine/Assets/Scripts/Importer.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 6980a2d4c7efc8c4cb251b5bc21c5802 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Importer/Importer.cs b/engine/Assets/Scripts/Importer/Importer.cs deleted file mode 100644 index 52fa394e77..0000000000 --- a/engine/Assets/Scripts/Importer/Importer.cs +++ /dev/null @@ -1,468 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Google.Protobuf; -using Mirabuf; -using Mirabuf.Joint; -using Mirabuf.Signal; -using Synthesis.Util; -using SynthesisAPI.Simulation; -using UnityEngine; -using SimObjects.MixAndMatch; -using UMaterial = UnityEngine.Material; -using UMesh = UnityEngine.Mesh; -using Logger = SynthesisAPI.Utilities.Logger; -using Assembly = Mirabuf.Assembly; -using Vector3 = Mirabuf.Vector3; -using UVector3 = UnityEngine.Vector3; -using MPhysicalProperties = Mirabuf.PhysicalProperties; -using UPhysicalMaterial = UnityEngine.PhysicMaterial; -using SynthesisAPI.Controller; -using Joint = Mirabuf.Joint.Joint; - -namespace Synthesis.Import { - public static class Importer { -#region Static Import Function - - public static (GameObject mainObject, MirabufLive[] miraLiveFiles, SimObject sim) - ImportSimpleRobot(string filePath) { - return ImportRobot(new ImportHelper(filePath)); - } - - public static (GameObject mainObject, MirabufLive[] miraLiveFiles, RobotSimObject sim) - ImportMixAndMatchRobot(MixAndMatchRobotData mixAndMatchRobotData) { - return ImportRobot(new ImportHelper(mixAndMatchRobotData)); - } - - private static (GameObject mainObject, MirabufLive[] miraLiveFiles, RobotSimObject sim) - ImportRobot(ImportHelper importHelper) { - importHelper.CreateSimObject(); - importHelper.MakeAllJoints(); - return (importHelper.AssemblyObject, importHelper.MiraLiveFiles, importHelper.SimObject as RobotSimObject); - } - - public static (GameObject mainObject, MirabufLive[] miraLiveFiles, FieldSimObject sim) - ImportField(string filePath) { - ImportHelper importHelper = new ImportHelper(filePath); - importHelper.ConfigureGamepieces(); - importHelper.CreateSimObject(); - importHelper.MakeAllJoints(); - return (importHelper.AssemblyObject, importHelper.MiraLiveFiles, importHelper.SimObject as FieldSimObject); - } - -#endregion - - /// Does the bulk of the work importing a mirabuf file to a robot in synthesis - private class ImportHelper { - private static ulong _robotTally; // Just a number to add to the name of the sim object spawned - - public GameObject AssemblyObject => _assemblyObject; - public MirabufLive[] MiraLiveFiles => _miraLiveFiles; - public SimObject SimObject => _simObject; - - private readonly MirabufLive[] _miraLiveFiles; - private readonly GameObject _assemblyObject; - private readonly Assembly[] _assemblies; - private readonly(Dictionary objectDict, Matrix4x4 transformation)[] _groupObjects; - private readonly List _gamepieces = new(); - private SimObject _simObject; - - private readonly MixAndMatchRobotData _mixAndMatchRobotData; - private readonly bool _isMixAndMatch; - -#region Constructors &Setup - - public ImportHelper(MixAndMatchRobotData mixAndMatchRobotData) - : this(mixAndMatchRobotData, - mixAndMatchRobotData.GlobalPartData.Select(part => new MirabufLive(part.MirabufPartFilePath)) - .ToArray()) {} - - public ImportHelper(string filePath) : this(null, new[] { new MirabufLive(filePath) }) {} - - public ImportHelper(MixAndMatchRobotData mixAndMatchRobotData, MirabufLive[] miraLiveFiles) { - _miraLiveFiles = miraLiveFiles; - - _mixAndMatchRobotData = mixAndMatchRobotData; - _isMixAndMatch = mixAndMatchRobotData != null; - - _assemblies = _miraLiveFiles.Select(m => m.MiraAssembly).ToArray(); - - _assemblyObject = new GameObject( - $"{(_isMixAndMatch ? mixAndMatchRobotData!.Name :_assemblies[0].Info.Name)}_{_robotTally}"); - - UnityEngine.Physics.sleepThreshold = 0; - - _groupObjects = - (mixAndMatchRobotData == null) - ? new[] { (miraLiveFiles[0].GenerateDefinitionObjects(_assemblyObject), Matrix4x4.identity) } - : MirabufDefinitionHelper.GenerateMixAndMatchDefinitionObjects( - _miraLiveFiles, _assemblyObject, mixAndMatchRobotData); - } - - /// Populates the gamepieces list with gamepieces found - public void ConfigureGamepieces() { - _groupObjects.ForEachIndex( - (i, x) => x.objectDict.Where(y => _miraLiveFiles[i].Definitions.Definitions[y.Key].IsGamepiece) - .ForEach(z => { - var gpSim = new GamepieceSimObject( - _miraLiveFiles[i].Definitions.Definitions[z.Key].Name, z.Value); - try { - SimulationManager.RegisterSimObject(gpSim); - } catch (Exception e) { - // TODO: Fix - throw e; - } - - _gamepieces.Add(gpSim); - })); - } - - /// Creates and registers the robots sim object - public void CreateSimObject() { - List allSignals = new(); - - // Append part index to signal keys so two of the same part have different signals - _assemblies.ForEachIndex((i, a) => { - Signals newSignals = new Signals(); - if (a.Data.Signals != null) { - a.Data.Signals.SignalMap.ForEach( - kvp => { newSignals.SignalMap[kvp.Key + $"_{i}"] = kvp.Value; }); - allSignals.Add(newSignals); - } - }); - - var state = new ControllableState(allSignals.ToArray()); - - if (_assemblies[0].Dynamic) { - _robotTally++; - _simObject = new RobotSimObject(_assemblyObject.name, state, _miraLiveFiles, - _groupObjects[0].objectDict["grounded"], _isMixAndMatch, _mixAndMatchRobotData); - } else { - _simObject = new FieldSimObject(_assemblies[0].Info.Name, state, _miraLiveFiles[0], - _groupObjects[0].objectDict["grounded"], _gamepieces); - } - - void RegisterSimObject() { - try { - SimulationManager.RegisterSimObject(_simObject); - } catch { - // TODO: Fix - Logger.Log($"Field with assembly {_assemblies[0].Info.Name} already exists."); - UnityEngine.Object.Destroy(_assemblyObject); - } - } - - RegisterSimObject(); - } - -#endregion - -#region Joints - - /// Create all of a robots joints excluding those connecting mix and match parts - public void MakeAllJoints() { - var rigidDefinitions = _miraLiveFiles.Select(m => m.Definitions).ToArray(); - - _assemblies.ForEachIndex( - (partIndex, assembly) => assembly.Data.Joints.JointInstances.ForEach(jointKvp => { - if (jointKvp.Key != "grounded") { - var aKey = rigidDefinitions[partIndex].PartToDefinitionMap[jointKvp.Value.ParentPart]; - var a = _groupObjects[partIndex].objectDict[aKey]; - - var bKey = rigidDefinitions[partIndex].PartToDefinitionMap[jointKvp.Value.ChildPart]; - var b = _groupObjects[partIndex].objectDict[bKey]; - - MakeJoint(a, b, jointKvp.Value, _assemblies[partIndex], - _groupObjects[partIndex].transformation, partIndex); - } - })); - } - - private static readonly float TWO_PI = 2f * Mathf.PI; - - /// Connects two robot parts with a joint. (ex: connecting a wheel to a drivetrain) - private void MakeJoint(GameObject gameObjectA, GameObject gameObjectB, JointInstance instance, - Assembly assembly, Matrix4x4 partTransform, int partIndex) { - var definition = assembly.Data.Joints.JointDefinitions[instance.JointReference]; - - var rigidbodyA = gameObjectA.GetComponent(); - var rigidbodyB = gameObjectB.GetComponent(); - - switch (definition.JointMotionType) { - case JointMotion.Revolute: - if (instance.IsWheel(assembly)) - WheelJoint(); - else - HingeJoint(); - break; - case JointMotion.Slider: - SliderJoint(); - break; - default: - FixedJoint(); - break; - } - - void WheelJoint() { - rigidbodyA.transform.GetComponentsInChildren().ForEach(x => { - var mat = x.material; - mat.dynamicFriction = 0f; - mat.staticFriction = 0f; - mat.frictionCombine = PhysicMaterialCombine.Multiply; - mat.bounceCombine = PhysicMaterialCombine.Multiply; - mat.bounciness = 0f; - }); - - var wheelA = gameObjectA.AddComponent(); - var originA = (UVector3) (definition.Origin ?? new UVector3()); - UVector3 jointOffset = instance.Offset ?? new Vector3(); - wheelA.anchor = partTransform.MultiplyPoint3x4(originA + jointOffset); - - UVector3 axisWut; - if (assembly.Info.Version < 5) { - axisWut = new UVector3(definition.Rotational.RotationalFreedom.Axis.X, - definition.Rotational.RotationalFreedom.Axis.Y, - definition.Rotational.RotationalFreedom.Axis.Z); - } else { - axisWut = new UVector3(-definition.Rotational.RotationalFreedom.Axis.X, - definition.Rotational.RotationalFreedom.Axis.Y, - definition.Rotational.RotationalFreedom.Axis.Z); - } - - wheelA.connectedBody = rigidbodyB; - wheelA.connectedMassScale = rigidbodyB.mass / rigidbodyA.mass; - var wheelB = gameObjectB.AddComponent(); - wheelB.anchor = wheelA.anchor; - wheelB.connectedBody = rigidbodyA; - wheelB.connectedMassScale = rigidbodyA.mass / rigidbodyB.mass; - - // TODO: Technically, a isn't guaranteed to be the wheel - var customWheel = gameObjectA.AddComponent(); - - if (instance.HasSignal()) { - var driver = - new WheelDriver(assembly.Data.Signals.SignalMap[instance.SignalReference].Info.GUID, - new[] { instance.SignalReference, $"{instance.SignalReference}_mode" }, - new[] { $"{instance.SignalReference}_encoder", $"{instance.SignalReference}_absolute" }, - _simObject, instance, customWheel, wheelA.anchor, axisWut, float.NaN, - (assembly.Data.Joints.MotorDefinitions.ContainsKey(definition.MotorReference) - ? definition.MotorReference - : null)!, - instance.GetWheelType(assembly)); - SimulationManager.AddDriver(_simObject.Name, driver); - } - } - - void HingeJoint() { - var revoluteA = gameObjectA.AddComponent(); - - var originA = (UVector3) (definition.Origin ?? new UVector3()); - UVector3 jointOffset = instance.Offset ?? new Vector3(); - revoluteA.anchor = partTransform.MultiplyPoint3x4(originA + jointOffset); - - UVector3 axisWut; - if (assembly.Info.Version < 5) { - axisWut = new UVector3(definition.Rotational.RotationalFreedom.Axis.X, - definition.Rotational.RotationalFreedom.Axis.Y, - definition.Rotational.RotationalFreedom.Axis.Z); - } else { - axisWut = new UVector3(-definition.Rotational.RotationalFreedom.Axis.X, - definition.Rotational.RotationalFreedom.Axis.Y, - definition.Rotational.RotationalFreedom.Axis.Z); - } - - revoluteA.axis = partTransform.MultiplyVector(axisWut); - revoluteA.connectedBody = rigidbodyB; - revoluteA.connectedMassScale = revoluteA.connectedBody.mass / rigidbodyA.mass; - revoluteA.useMotor = true; - // TODO: Implement and test limits - var limits = definition.Rotational.RotationalFreedom.Limits; - if (limits != null && limits.Lower != limits.Upper) { - var currentPosition = definition.Rotational.RotationalFreedom.Value; - currentPosition = - (currentPosition % (TWO_PI)) - ((int) (currentPosition % (TWO_PI) / Mathf.PI) * (TWO_PI)); - var min = -(limits.Upper - currentPosition); - min = (min % (TWO_PI) -TWO_PI) % (TWO_PI); - var max = -(limits.Lower - currentPosition); - max = (max % (TWO_PI) + TWO_PI) % (TWO_PI); - revoluteA.useLimits = true; - revoluteA.limits = new JointLimits() { min = min * Mathf.Rad2Deg, max = max * Mathf.Rad2Deg }; - revoluteA.extendedLimits = true; - } - - var revoluteB = gameObjectB.AddComponent(); - - // All of the rigidbodies have the same location and orientation so these are the same for both - // joints - revoluteB.anchor = revoluteA.anchor; - revoluteB.axis = revoluteA.axis; // definition.Rotational.RotationalFreedom.Axis; - - revoluteB.connectedBody = rigidbodyA; - revoluteB.connectedMassScale = revoluteB.connectedBody.mass / rigidbodyB.mass; - - // TODO: Encoder Signals - if (instance.HasSignal()) { - var driver = - new RotationalDriver(assembly.Data.Signals.SignalMap[instance.SignalReference].Info.GUID, - new[] { $"{instance.SignalReference}_{partIndex}", $"{instance.SignalReference}_mode" }, - new[] { $"{instance.SignalReference}_encoder", $"{instance.SignalReference}_absolute" }, - _simObject, revoluteA, revoluteB, instance.IsWheel(assembly), - (assembly.Data.Joints.MotorDefinitions.ContainsKey(definition.MotorReference) - ? definition.MotorReference - : null) ?? - string.Empty); - SimulationManager.AddDriver(_simObject.Name, driver); - } - } - - void SliderJoint() { - UVector3 anchor = definition.Origin ?? new Vector3() + instance.Offset ?? new Vector3(); - UVector3 axis = definition.Prismatic.PrismaticFreedom.Axis; - axis = axis.normalized; - axis.x = -axis.x; - float midRange = ((definition.Prismatic.PrismaticFreedom.Limits.Lower + - definition.Prismatic.PrismaticFreedom.Limits.Upper) / - 2) * - 0.01f; - - var sliderA = gameObjectA.AddComponent(); - sliderA.anchor = partTransform.MultiplyPoint3x4(anchor); // + (axis * midRange); - sliderA.axis = partTransform.MultiplyVector(axis); - sliderA.autoConfigureConnectedAnchor = false; - sliderA.connectedAnchor = partTransform.MultiplyPoint3x4(anchor + (axis * midRange)); - sliderA.secondaryAxis = partTransform.MultiplyVector(axis); - sliderA.angularXMotion = ConfigurableJointMotion.Locked; - sliderA.angularYMotion = ConfigurableJointMotion.Locked; - sliderA.angularZMotion = ConfigurableJointMotion.Locked; - sliderA.xMotion = ConfigurableJointMotion.Limited; - sliderA.yMotion = ConfigurableJointMotion.Locked; - sliderA.zMotion = ConfigurableJointMotion.Locked; - if (Mathf.Abs(midRange) > 0.0001) { - sliderA.xMotion = ConfigurableJointMotion.Limited; - - var ulimitA = sliderA.linearLimit; - ulimitA.limit = Mathf.Abs(midRange); - sliderA.linearLimit = ulimitA; - } else { - sliderA.xMotion = ConfigurableJointMotion.Free; - } - sliderA.connectedBody = rigidbodyB; - sliderA.connectedMassScale = sliderA.connectedBody.mass / rigidbodyA.mass; - - var sliderB = gameObjectB.AddComponent(); - sliderB.anchor = sliderA.anchor; - sliderB.axis = sliderA.axis; - sliderB.angularXMotion = ConfigurableJointMotion.Locked; - sliderB.angularYMotion = ConfigurableJointMotion.Locked; - sliderB.angularZMotion = ConfigurableJointMotion.Locked; - sliderB.xMotion = ConfigurableJointMotion.Free; - sliderB.yMotion = ConfigurableJointMotion.Locked; - sliderB.zMotion = ConfigurableJointMotion.Locked; - sliderB.connectedBody = rigidbodyA; - sliderB.connectedMassScale = sliderB.connectedBody.mass / rigidbodyB.mass; - - if (instance.HasSignal()) { - assembly.Data.Joints.MotorDefinitions.TryGetValue(definition.MotorReference, out var motor); - var currentPosition = definition.Prismatic.PrismaticFreedom.Value; - var slideDriver = - new LinearDriver(assembly.Data.Signals.SignalMap[instance.SignalReference].Info.GUID, - new[] { $"{instance.SignalReference}_{partIndex}" }, Array.Empty(), _simObject, - sliderA, sliderB, - ((definition.Prismatic.PrismaticFreedom.Limits.Upper - currentPosition) * 0.01f, - (definition.Prismatic.PrismaticFreedom.Limits.Lower - currentPosition) * 0.01f), - assembly.Data.Joints.MotorDefinitions.ContainsKey(definition.MotorReference) - ? definition.MotorReference - : null); - SimulationManager.AddDriver(_simObject.Name, slideDriver); - } - } - - void FixedJoint() { - AddUnityFixedJoint(rigidbodyA, rigidbodyB, definition.Origin, instance.Offset); - AddUnityFixedJoint(rigidbodyB, rigidbodyA, definition.Origin, instance.Offset); - - void AddUnityFixedJoint( - Rigidbody rootObject, Rigidbody otherObject, Vector3 origin, Vector3 offset) { - var fixedJoint = rootObject.gameObject.AddComponent(); - fixedJoint.anchor = - partTransform.MultiplyPoint3x4((origin ?? new Vector3()) + (offset ?? new Vector3())); - fixedJoint.axis = partTransform.MultiplyVector(UVector3.forward); - fixedJoint.connectedBody = otherObject; - fixedJoint.connectedMassScale = fixedJoint.connectedBody.mass / rootObject.mass; - } - } - } - -#endregion - - /// - /// Gets the change between 2 transformations - /// - /// Starting transformation - /// End transformation - /// Transformation to apply to move from start to end - public Matrix4x4 TransformationDelta(Matrix4x4 from, Matrix4x4 to) { - return Matrix4x4.TRS(to.GetPosition() - from.GetPosition(), - to.rotation * Quaternion.Inverse(from.rotation), UVector3.one); - } - - public void DebugAssembly(Assembly assembly) { - Assembly debugAssembly; - // debugAssembly.MergeFrom(assembly); - MemoryStream ms = new MemoryStream(new byte[assembly.CalculateSize()]); - ms.Seek(0, SeekOrigin.Begin); - assembly.WriteTo(ms); // TODO: Causing issues all of a sudden [May 5th, 2023] - ms.Seek(0, SeekOrigin.Begin); - debugAssembly = Assembly.Parser.ParseFrom(ms); - - // Remove mesh data - // debugAssembly.Data.Parts.PartDefinitions.ForEach((x, y) => { y.Bodies.Clear(); }); - debugAssembly.Data.Parts.PartDefinitions.Select(kvp => kvp.Value.Bodies).ForEach(x => x.ForEach(y => { - y.TriangleMesh = new TriangleMesh(); - })); - - var jFormatter = new JsonFormatter(JsonFormatter.Settings.Default); - File.WriteAllText(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + - $"{Path.AltDirectorySeparatorChar}{debugAssembly.Info.Name}.json", - jFormatter.Format(debugAssembly)); - } - - public void DebugGraph(GraphContainer graph) { - graph.Nodes.ForEach(x => DebugNode(x, 0)); - } - - public void DebugNode(Node node, int level) { - int a = 0; - string prefix = ""; - while (a != level) { - prefix += "-"; - a++; - } - - Debug.Log($"{prefix} {node.Value}"); - node.Children.ForEach(x => DebugNode(x, level + 1)); - } - - private void DebugJoint(Assembly assembly, string joint) { - var instance = assembly.Data.Joints.JointInstances[joint]; - var definition = assembly.Data.Joints.JointDefinitions[instance.JointReference]; - - Debug.Log(Enum.GetName(typeof(Joint.JointMotionOneofCase), definition.JointMotionCase)); - } - - /// - /// Stock source type definitions - /// - public struct SourceType { - public string FileEnding { get; private set; } - public string Identifier { get; private set; } - - public SourceType(string identifier, string fileEnding) { - Identifier = identifier; - FileEnding = fileEnding; - } - } - } - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/Importer/Importer.cs.meta b/engine/Assets/Scripts/Importer/Importer.cs.meta deleted file mode 100644 index e77805e536..0000000000 --- a/engine/Assets/Scripts/Importer/Importer.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 7b852535f8c24608ae727296693e2126 -timeCreated: 1690836408 \ No newline at end of file diff --git a/engine/Assets/Scripts/Importer/MirabufCache.cs b/engine/Assets/Scripts/Importer/MirabufCache.cs deleted file mode 100644 index 54d6e11c96..0000000000 --- a/engine/Assets/Scripts/Importer/MirabufCache.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Collections.Generic; - -#nullable enable - -namespace Synthesis.Import { - public static class MirabufCache { - private const short MAX_CACHE_SIZE = 4; - - private static LinkedList _cache = new(); - - public static MirabufLive Get(string path) { - LinkedListNode? cursor = _cache.First; - while (cursor != null && !cursor.Value.MiraPath.Equals(path)) { - cursor = cursor.Next; - } - - if (cursor?.Value.MiraPath.Equals(path) ?? false) { - _cache.Remove(cursor); - _cache.AddFirst(cursor); - return cursor.Value; - } else { - MirabufLive mira = new MirabufLive(path); - _cache.AddFirst(mira); - while (_cache.Count > MAX_CACHE_SIZE) { - _cache.RemoveLast(); - } - return mira; - } - } - - public static void Clear() { - _cache.Clear(); - } - } -} diff --git a/engine/Assets/Scripts/Importer/MirabufCache.cs.meta b/engine/Assets/Scripts/Importer/MirabufCache.cs.meta deleted file mode 100644 index 5d06ddb9b4..0000000000 --- a/engine/Assets/Scripts/Importer/MirabufCache.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: f800e3683797bce438bb5a58a570e5b2 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Importer/MirabufDefinitionHelper.cs b/engine/Assets/Scripts/Importer/MirabufDefinitionHelper.cs deleted file mode 100644 index 09c8406bd2..0000000000 --- a/engine/Assets/Scripts/Importer/MirabufDefinitionHelper.cs +++ /dev/null @@ -1,580 +0,0 @@ -using System.Collections.Generic; -using UnityEngine; -using Mirabuf; -using Mirabuf.Joint; -using System; -using System.Linq; -using SynthesisAPI.Utilities; -using Mirabuf.Material; -using SimObjects.MixAndMatch; -using Utilities; -using Logger = SynthesisAPI.Utilities.Logger; -using MPhysicalProperties = Mirabuf.PhysicalProperties; -using Object = UnityEngine.Object; -using UVector3 = UnityEngine.Vector3; - -namespace Synthesis.Import { - public static class MirabufDefinitionHelper { -#region Creation - - /// Generates the unity gameobjects for a mix and match robot and merges all parts together - public static (Dictionary objectDict, - Matrix4x4 transformation)[] GenerateMixAndMatchDefinitionObjects(MirabufLive[] miraLiveFiles, - GameObject assemblyContainer, MixAndMatchRobotData robotTransformData) { - Dictionary[] groupObjects = new Dictionary[miraLiveFiles.Length]; - Matrix4x4[] transformations = new Matrix4x4[miraLiveFiles.Length]; - - int dynamicLayer = DynamicLayerManager.NextRobotLayer; - - // Generates the unity gameobjects with components for each part - miraLiveFiles.ForEachIndex((i, m) => groupObjects[i] = m.GenerateDefinitionObjects( - assemblyContainer, true, true, true, i, dynamicLayer)); - - // Generates part transformations - for (int i = 0; i < miraLiveFiles.Length; i++) { - var partData = robotTransformData.PartTransformData[i]; - transformations[i] = Matrix4x4.TRS(partData.LocalPosition, partData.LocalRotation, UVector3.one); - } - - // Creates a new grounded object that all part grounded objects will be combined onto - var mainGrounded = new GameObject("grounded"); - mainGrounded.transform.SetParent(assemblyContainer.transform); - var rb = mainGrounded.AddComponent(); - - // Merges part objects - groupObjects.ForEachIndex((i, objects) => { - var partData = robotTransformData.PartTransformData[i]; - - // Apply part transformations - objects.Values.ForEach(o => { - for (int childIndex = 0; childIndex < o.transform.childCount; childIndex++) { - var childTransform = o.transform.GetChild(childIndex); - var newMat = transformations[i] * childTransform.localToWorldMatrix; - childTransform.position = newMat.GetPosition(); - childTransform.rotation = newMat.rotation; - } - }); - - // Locates part parent node - GameObject parentNode; - { - var parentNodeData = partData.ParentNodeData; - if (parentNodeData.NodeName is "grounded" or "") { - parentNode = mainGrounded; - goto PartFound; - } - - var parentPartIndex = robotTransformData.PartGuidToIndex(parentNodeData.PartGuid); - - var targetName = $"{parentNodeData.NodeName}_{parentPartIndex}"; - var obj = groupObjects[parentPartIndex].Values.Find(x => x.name == targetName); - - if (obj != null) { - parentNode = obj; - goto PartFound; - } - - parentNode = mainGrounded; - } - - PartFound: - - // Sets the parent node as the part's grounded object to attach joints to - if (objects.TryGetValue("grounded", out var partGrounded)) { - var children = new List(); - - foreach (UnityEngine.Transform child in partGrounded.transform) { - children.Add(child); - } - - children.ForEach(c => c.SetParent(parentNode.transform)); - - var partRb = partGrounded.GetComponent(); - - rb.mass += partRb.mass; - - // Adds CoM * mass because a parts mass influences it's effect on the robots total CoM - rb.centerOfMass += partRb.centerOfMass * partRb.mass; - - objects.Remove("grounded"); - Object.DestroyImmediate(partGrounded); - - objects.Add("grounded", parentNode); - } else { - Logger.Log($"No grounded object found on part {robotTransformData.GlobalPartData[i].Name}"); - } - }); - - // Divides by total robot mass to get the final CoM of the whole robot - rb.centerOfMass /= rb.mass; - - return groupObjects.Zip(transformations, (d, t) => (d, t)).ToArray(); - } - - public enum ColliderGenType { - NoCollider = 0, - Convex = 1, - Concave = 2 - } - - public static void MakePartDefinition(GameObject container, PartDefinition definition, PartInstance instance, - AssemblyData assemblyData, ColliderGenType colliderGenType, bool useIndex, int partIndex) { - PhysicMaterial physMat = new PhysicMaterial { dynamicFriction = 0.6f, staticFriction = 0.6f }; - foreach (var body in definition.Bodies) { - if (body.TriangleMesh == null) - continue; - - var bodyObject = new GameObject(useIndex ? $"{body.Info.Name}_{partIndex}" : body.Info.Name); - var filter = bodyObject.AddComponent(); - var renderer = bodyObject.AddComponent(); - filter.sharedMesh = body.TriangleMesh.UnityMesh; - - renderer.material = - assemblyData.Materials.Appearances.TryGetValue(instance.Appearance, out var appearance) - ? appearance.UnityMaterial - : assemblyData.Materials.Appearances.TryGetValue( - body.AppearanceOverride, out var materialsAppearance) - ? materialsAppearance.UnityMaterial - : Appearance.DefaultAppearance.UnityMaterial; // Setup the override - - if (!instance.SkipCollider && colliderGenType > ColliderGenType.NoCollider) { - MeshCollider collider = null; - try { - collider = bodyObject.AddComponent(); - if (colliderGenType == ColliderGenType.Convex) { - collider.convex = true; - collider.sharedMesh = - body.TriangleMesh.ColliderMesh; // Again, not sure if this actually works - } else { - collider.convex = false; - collider.sharedMesh = body.TriangleMesh.UnityMesh; - } - } catch { - if (collider != null) { - Object.Destroy(collider); - collider = null; - } - } - - if (collider != null) - collider.material = physMat; - } - bodyObject.transform.parent = container.transform; - // Ensure all transformations are zeroed after assigning parent - bodyObject.transform.localPosition = UVector3.zero; - bodyObject.transform.localRotation = Quaternion.identity; - bodyObject.transform.localScale = UVector3.one; - } - } - -#endregion - -#region Rigidbody Identification - - /// - /// I really don't like how I made this. It gets the job done but I feel like it - /// could use a ton of optimizations. - /// TODO: Maybe get rid of the dictionary in the rigidbodyDefinitions and just - /// store keys. I feel like that would be a bit better. - /// - public static MirabufLive.RigidbodyDefinitions FindRigidbodyDefinitions(MirabufLive live) { - Assembly assembly = live.MiraAssembly; - -#if DEBUG_MIRA - MemoryStream ms = new MemoryStream(); - ms.Seek(0, SeekOrigin.Begin); - assembly.WriteTo(ms); - ms.Seek(0, SeekOrigin.Begin); - var debugAssembly = Assembly.Parser.ParseFrom(ms); - - debugAssembly.Data.Parts.PartDefinitions.ForEach(x => x.Value.Bodies.ForEach(x => x.TriangleMesh = null)); - var jFormatter = new JsonFormatter(JsonFormatter.Settings.Default); - File.WriteAllText(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + - $"{Path.AltDirectorySeparatorChar}{debugAssembly.Info.Name}.json", - jFormatter.Format(debugAssembly)); - - bool allUnique = false; - { - var allNodes = debugAssembly.Data.Joints.RigidGroups.Select(x => x.Name); - HashSet uniqueGuids = new HashSet((int) (allNodes.Count() * (1f / 0.75f))); - allUnique = allNodes.All(x => uniqueGuids.Add(x)); - } - if (!allUnique) - Logger.Log("Not all unique", LogLevel.Warning); -#endif - - var defs = new Dictionary(); - var partMap = new Dictionary(); - - // I'm using lambda functions so I can reuse repeated logic while taking advantage of variables in the - // current scope - Action MergeDefinitions = - (keep, delete) => { - delete.Parts.ForEach((k, v) => keep.Parts.Add(k, v)); - for (int i = 0; i < partMap.Keys.Count; i++) { - if (partMap[partMap.Keys.ElementAt(i)].Equals(delete.GUID)) - partMap[partMap.Keys.ElementAt(i)] = keep.GUID; - } - defs.Remove(delete.GUID); - }; - Action MoveToDef = (part, from, to) => { - if (from != string.Empty) - defs[from].Parts.Remove(part); - var _a = assembly.Data.Parts.PartInstances[part]; - defs[to].Parts.Add(part, _a); - partMap[part] = to; - }; - - var paths = LoadPartTreePaths(assembly.DesignHierarchy); - - var discoveredRigidGroups = new List(); - - (string guid, JointInstance joint) groundJoint = default; - int counter = 0; - - // Create initial definitions - foreach (var jInst in assembly.Data.Joints.JointInstances) { - bool isGrounded = jInst.Key.Equals("grounded"); - if (isGrounded) { - groundJoint = (jInst.Key, jInst.Value); - continue; // Skip grounded to apply it last - } - - var mainDef = new MirabufLive.RigidbodyDefinition { GUID = $"{counter}", - Name = $"{jInst.Value.Info.Name}_Rigidgroup{counter}", - Parts = new Dictionary() }; - defs[mainDef.GUID] = mainDef; - - var stubDef = new MirabufLive.RigidbodyDefinition { GUID = $"{counter}-2", - Name = $"{jInst.Value.Info.Name}_Rigidgroup{counter}-2", - Parts = new Dictionary() }; - defs[stubDef.GUID] = stubDef; - - // I'm slowly turning into Nick - // Grab all the parts listed under the joint - if (jInst.Value.Parts is { Nodes : { Count : > 0 } }) { - // I don't know why AllTreeElements sometimes returns null elements - var tmpParts = jInst.Value.Parts.Nodes.AllTreeElements() - .Where(x => !string.IsNullOrEmpty(x.Value)) - .Select(x => (x.Value, assembly.Data.Parts.PartInstances[x.Value])); - var tmpRG = new RigidGroup { Name = $"discovered_{counter}" }; - tmpRG.Occurrences.Add(tmpParts.Select(x => x.Value)); - discoveredRigidGroups.Add(tmpRG); - } - - // Grab all parts eligible via design hierarchy - var parentSiblings = IdentifyParentSiblings(paths, jInst.Value.ParentPart, jInst.Value.ChildPart); - // Gonna make an action so I don't have to have the same code written twice - void Inherit(string part, string definition) { - List toCheck = new List(); - List tmp = new List(); - var path = paths[part]; - Node n = assembly.DesignHierarchy.Nodes[0]; - foreach (var t in path) { - n = n.Children.Find(y => y.Value.Equals(t)); - } - - toCheck.Add(n.Children.Find(y => y.Value.Equals(part))); - var defObj = defs[definition]; - defObj.Name += $"_{assembly.Data.Parts.PartInstances[part]}"; - - var originalDef = partMap.TryGetValue(part, out var value) ? value : string.Empty; - - while (toCheck.Count > 0) { - toCheck.ForEach(y => { - partMap.TryGetValue(y.Value, out string existingDef); - if (existingDef == null) { - var _partInst = assembly.Data.Parts.PartInstances[y.Value]; - defs[definition].Parts.Add(y.Value, _partInst); - partMap[y.Value] = definition; - tmp.AddRange(y.Children.Where(z => z is { Value : not null })); // Just to make sure - } else if (existingDef.Equals(originalDef)) { - MoveToDef(y.Value, originalDef, definition); - tmp.AddRange(y.Children.Where(z => z is { Value : not null })); // Just to make sure - } - }); - toCheck.Clear(); - toCheck.AddRange(tmp); - tmp.Clear(); - } - } - - Inherit(parentSiblings.child, stubDef.GUID); - Inherit(parentSiblings.parent, mainDef.GUID); - counter++; - } - - // Apply Ground Last - if (groundJoint == default) { - Logger.Log("Not sure this is possible but failed to find grounded joint", LogLevel.Error); - throw new Exception(); - } - MirabufLive.RigidbodyDefinition groundDef = new MirabufLive.RigidbodyDefinition { Name = "grounded", - GUID = "grounded", Parts = new Dictionary() }; - defs.Add(groundDef.GUID, groundDef); - groundJoint.joint.Parts?.Nodes?.AllTreeElements().Where(x => !string.IsNullOrEmpty(x.Value)).ForEach(x => { - if (!partMap.ContainsKey(x.Value)) - MoveToDef(x.Value, string.Empty, groundDef.GUID); - }); - - // Add disjointed to grounded - assembly.Data.Parts.PartInstances.Where(x => !partMap.ContainsKey(x.Key)).ForEach(x => { - MoveToDef(x.Key, string.Empty, "grounded"); - }); - - // Check if the original grounded object has been eaten by one of the joints - var swallower = partMap[assembly.Data.Joints.JointInstances["grounded"].Parts.Nodes.ElementAt(0).Value]; - if (swallower != groundDef.GUID) { - var def = defs[swallower]; - MergeDefinitions(groundDef, def); - } - - // Apply RigidGroups - discoveredRigidGroups.AddRange(assembly.Data.Joints.RigidGroups); - discoveredRigidGroups.Where(x => x.Occurrences.Count > 1).ForEach(x => { - MirabufLive.RigidbodyDefinition rigidDef = new MirabufLive.RigidbodyDefinition { Name = $"{x.Name}", - GUID = $"{counter}", Parts = new Dictionary() }; - defs.Add(rigidDef.GUID, rigidDef); - x.Occurrences.ForEach(y => { - partMap.TryGetValue(y, out string existingDef); - if (existingDef == null) { - MoveToDef(y, string.Empty, rigidDef.GUID); - } else if (!existingDef.Equals(rigidDef.GUID)) { - if (existingDef.Equals("grounded")) { - MergeDefinitions(groundDef, rigidDef); - rigidDef = groundDef; - } else { - rigidDef.Name += $"_{defs[existingDef].Name}"; - MergeDefinitions(rigidDef, defs[existingDef]); - } - } - }); - - counter++; - }); - - bool wasRemoved = false; - MirabufLive.RigidbodyDefinition newGrounded = default; - // Clear excess rigidbodies - for (int i = 0; i < defs.Keys.Count; i++) { - if (defs[defs.Keys.ElementAt(i)].Parts.Count == 0) { - if (defs.Keys.ElementAt(i).Equals("grounded")) { - var groundedPartGuid = assembly.Data.Joints.JointInstances.Find(x => x.Key.Equals("grounded")) - .Value.Parts.Nodes[0] - .Value; - newGrounded = defs[partMap[groundedPartGuid]]; - wasRemoved = true; - } - defs.Remove(defs.Keys.ElementAt(i)); - i -= 1; - } - } - - // Re-add grounded if it was removed - if (wasRemoved) { - defs.Remove(newGrounded.GUID); - List originalKeys = new List(partMap.Keys); - foreach (string partKey in originalKeys) { - if (partMap[partKey].Equals(newGrounded.GUID)) - partMap[partKey] = "grounded"; - } - newGrounded.GUID = "grounded"; - newGrounded.Name = "grounded"; - defs.Add(newGrounded.GUID, newGrounded); - } - - // Move gamepieces to separate groupings - int gamepieceCounter = 0; - if (!assembly.Dynamic) { - assembly.Data.Parts.PartDefinitions.Where(x => x.Value.Dynamic) - .ForEach( - x => assembly.Data.Parts.PartInstances.Where(y => y.Value.PartDefinitionReference.Equals(x.Key)) - .ForEach(y => { - MirabufLive.RigidbodyDefinition rigidDef = - new MirabufLive.RigidbodyDefinition { Name = $"gamepiece_{gamepieceCounter}", - GUID = $"{counter}", Parts = new Dictionary() }; - defs.Add(rigidDef.GUID, rigidDef); - GetAllPartsInBranch(y.Key, paths, assembly.DesignHierarchy.Nodes.ElementAt(0)) - .ForEach(z => MoveToDef(z, partMap[z], rigidDef.GUID)); - - gamepieceCounter++; - counter++; - })); - } - - // Make names reasonable - int shift = 0; - for (int i = 0; i < defs.Keys.Count; i++) { - var def = defs[defs.Keys.ElementAt(i)]; - if (def.Name.Equals("grounded") || def.Name.Contains("gamepiece")) { - shift++; - } else { - def.Name = $"node_{i - shift}"; - } - defs[defs.Keys.ElementAt(i)] = def; - } - - // ===================================== - // === Data setup for ease of access === - // ===================================== - - MakeGlobalTransformations(assembly); - - float totalMass = 0f; - HashSet partDuplicateChecker = new HashSet(); - foreach (var group in defs.Values.Select(x => x.GUID)) { - var collectivePhysData = new List<(Matrix4x4, PhysicalProperties)>(); - - foreach (var part in defs[group].Parts) { - if (!partDuplicateChecker.Add(part.Value.Info.GUID)) { - continue; - } - - var partInstance = part.Value; - var partDefinition = assembly.Data.Parts.PartDefinitions[partInstance.PartDefinitionReference]; - - if (partDefinition.Bodies.Any()) { - collectivePhysData.Add((partInstance.GlobalTransform.UnityMatrix, partDefinition.PhysicalData)); - } - } - - var combPhysProps = CombinePhysicalProperties(collectivePhysData); - totalMass += (float) combPhysProps.Mass; - { // Ugh, structs... - var groupInstance = defs[group]; - groupInstance.CollectivePhysicalProperties = combPhysProps; - groupInstance.IsGamepiece = !assembly.Dynamic && groupInstance.Name.Contains("gamepiece"); - groupInstance.IsStatic = !assembly.Dynamic && groupInstance.Name.Contains("grounded"); - defs[group] = groupInstance; - } - } - - var definitions = new MirabufLive.RigidbodyDefinitions { Mass = totalMass, Definitions = defs, - PartToDefinitionMap = partMap }; - - return definitions; - } - - private static (string parent, string child) - IdentifyParentSiblings(Dictionary> paths, string parent, string child) { - var parentAncestors = new List(); - var childAncestors = new List(); - parentAncestors.AddRange(paths[parent]); - childAncestors.AddRange(paths[child]); - if (parentAncestors.Count == 0 || childAncestors.Count == 0) { - return (parentAncestors.Count == 0 ? parent : parentAncestors[0], - childAncestors.Count == 0 ? child : childAncestors[0]); - } - while (parentAncestors[0].Equals(childAncestors[0])) { - parentAncestors.RemoveAt(0); - childAncestors.RemoveAt(0); - - if (parentAncestors.Count == 0 || childAncestors.Count == 0) { - return (parentAncestors.Count == 0 ? parent : parentAncestors[0], - childAncestors.Count == 0 ? child : childAncestors[0]); - } - } - return (parentAncestors[0], childAncestors[0]); - } - - private static Dictionary> LoadPartTreePaths(GraphContainer designHierarchy) { - Dictionary> paths = new Dictionary>(); - foreach (Node n in designHierarchy.Nodes[0].Children) { - LoadPartTreePaths(n, paths); - } - return paths; - } - - private static void LoadPartTreePaths( - Node n, Dictionary> paths, List currentPath = null) { - paths[n.Value] = new List(); - if (currentPath is { Count : > 0 }) - paths[n.Value].AddRange(currentPath); - currentPath ??= new List(); - currentPath.Add(n.Value); - foreach (Node child in n.Children) { - LoadPartTreePaths(child, paths, currentPath); - } - currentPath.RemoveAt(currentPath.Count - 1); - } - - private static List GetAllPartsInBranch( - string rootPart, Dictionary> paths, Node rootNode) { - var parts = new List(); - var toCheck = new List { NavigateDHPath(paths[rootPart].Append(rootPart).ToList(), rootNode) }; - while (toCheck.Count > 0) { - var tmp = new List(); - toCheck.ForEach(x => { - parts.Add(x.Value); - x.Children.ForEach(y => { - if (y.Value != string.Empty) - tmp.Add(y); - }); - }); - toCheck.Clear(); - toCheck = tmp; - } - return parts; - } - - private static Node NavigateDHPath(List path, Node rootNode) { - var current = rootNode; - while (path.Count > 0) { - current = current.Children.First(x => x.Value.Equals(path[0])); - path.RemoveAt(0); - } - return current; - } - - private static MPhysicalProperties CombinePhysicalProperties( - List<(Matrix4x4 trans, MPhysicalProperties prop)> props) { - var total = 0.0f; - var com = new UVector3(); - props.ForEach(x => total += (float) x.prop.Mass); - props.ForEach(x => com += (x.trans.MultiplyPoint(x.prop.Com)) * (float) x.prop.Mass); - com /= total; - return new MPhysicalProperties { Mass = total, Com = com }; - } - -#endregion - -#region Global Transformations - - private static void MakeGlobalTransformations(Assembly assembly) { - var map = new Dictionary(); - foreach (Node n in assembly.DesignHierarchy.Nodes) { - Matrix4x4 trans = - assembly.Data.Parts.PartInstances[n.Value].Transform == null - ? assembly.Data.Parts - .PartDefinitions[assembly.Data.Parts.PartInstances[n.Value] - .PartDefinitionReference] - .BaseTransform == null - ? Matrix4x4.identity - : assembly.Data.Parts - .PartDefinitions[assembly.Data.Parts.PartInstances[n.Value].PartDefinitionReference] - .BaseTransform.MirabufMatrix - : assembly.Data.Parts.PartInstances[n.Value].Transform.MirabufMatrix; - map.Add(n.Value, trans); - MakeGlobalTransformations(map, map[n.Value], assembly.Data.Parts, n); - } - - foreach (var kvp in map) { - assembly.Data.Parts.PartInstances[kvp.Key].GlobalTransform = map[kvp.Key]; - } - } - - private static void MakeGlobalTransformations( - Dictionary map, Matrix4x4 parent, Parts parts, Node node) { - foreach (var child in node.Children) { - if (!map.ContainsKey(child.Value)) { - map.Add(child.Value, parent * parts.PartInstances[child.Value].Transform.MirabufMatrix); - MakeGlobalTransformations(map, map[child.Value], parts, child); - } else { - Logger.Log($"Key \"{child.Value}\" already present in map; ignoring", LogLevel.Error); - } - } - } - -#endregion - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/Importer/MirabufDefinitionHelper.cs.meta b/engine/Assets/Scripts/Importer/MirabufDefinitionHelper.cs.meta deleted file mode 100644 index 084f75be9e..0000000000 --- a/engine/Assets/Scripts/Importer/MirabufDefinitionHelper.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 06bf49a668984718817579f19619cebf -timeCreated: 1691778638 \ No newline at end of file diff --git a/engine/Assets/Scripts/Importer/MirabufLive.cs b/engine/Assets/Scripts/Importer/MirabufLive.cs deleted file mode 100644 index 9c1f8368cf..0000000000 --- a/engine/Assets/Scripts/Importer/MirabufLive.cs +++ /dev/null @@ -1,179 +0,0 @@ -#define DEBUG_MIRABUF - -using System.Collections.Generic; -using UnityEngine; -using Mirabuf; -using System.IO; -using System.IO.Compression; -using System; -using System.Threading.Tasks; -using SynthesisAPI.Utilities; -using Google.Protobuf; -using Synthesis.UI.Dynamic; -using Utilities; -using Logger = SynthesisAPI.Utilities.Logger; -using MPhysicalProperties = Mirabuf.PhysicalProperties; -using UVector3 = UnityEngine.Vector3; - -namespace Synthesis.Import { - public class MirabufLive { - public const UInt32 CURRENT_MIRA_EXPORTER_VERSION = 5; - public const UInt32 OLDEST_MIRA_EXPORTER_VERSION = 4; - - private readonly string _path; - public string MiraPath => _path; - private Assembly _miraAssembly; - public Assembly MiraAssembly => _miraAssembly; - - private readonly Task _findDefinitions; - - public RigidbodyDefinitions Definitions { - get { - if (_findDefinitions.Status < TaskStatus.RanToCompletion) { - _findDefinitions.Wait(); - } - - return _findDefinitions.Result; - } - } - - public MirabufLive(string path) { - _path = path; - - Load(); - - _findDefinitions = Task.Factory.StartNew( - () => MirabufDefinitionHelper.FindRigidbodyDefinitions(this)); - } - - public static MirabufLive OpenMirabufFile(string path) => MirabufCache.Get(path); - - private void Load() { - if (!File.Exists(_path)) { - Logger.Log($"Mira file {_path} not found!", LogLevel.Error); - DynamicUIManager.CloseActiveModal(); - return; - } - byte[] buff = File.ReadAllBytes(_path); - - // Check if data is compressed, and if so decompress it - if (buff[0] == 0x1f && buff[1] == 0x8b) { - int originalLength = BitConverter.ToInt32(buff, buff.Length - 4); - - MemoryStream mem = new MemoryStream(buff); - byte[] res = new byte[originalLength]; - GZipStream decompresser = new GZipStream(mem, CompressionMode.Decompress); - decompresser.Read(res, 0, res.Length); - decompresser.Close(); - mem.Close(); - buff = res; - } - - _miraAssembly = Assembly.Parser.ParseFrom(buff); - } - - public void Save() { - if (_miraAssembly == null) { - File.Delete(_path); - return; - } - - byte[] buff = new byte[_miraAssembly.CalculateSize()]; - _miraAssembly.WriteTo(new CodedOutputStream(buff)); - string backupPath = $"{_path}.bak"; - File.Delete(backupPath); - File.Move(_path, backupPath); - File.WriteAllBytes(_path, buff); - } - - public Dictionary GenerateDefinitionObjects(GameObject assemblyContainer, - bool rigidbodies = true, bool colliders = true, bool useIndex = false, int partIndex = 0, - int dynamicLayer = -1) { - Dictionary groupObjects = new Dictionary(); - - if (rigidbodies && !colliders) { - Logger.Log("Cannot generate definition objects with rigidbodies and colliders", LogLevel.Error); - throw new Exception(); - } - - if ((colliders) && _miraAssembly.Dynamic) { - if (dynamicLayer == -1) - dynamicLayer = DynamicLayerManager.NextRobotLayer; - - assemblyContainer.layer = dynamicLayer; - assemblyContainer.AddComponent(); - } - - foreach (var group in Definitions.Definitions.Values) { - GameObject groupObject = new GameObject(useIndex ? $"{group.Name}_{partIndex}" : group.Name); - var isGamepiece = group.IsGamepiece; - var isStatic = group.IsStatic; - // Import Parts - -#region Parts - - foreach (var part in group.Parts) { - var partInstance = part.Value; - var partDefinition = _miraAssembly.Data.Parts.PartDefinitions[partInstance.PartDefinitionReference]; - GameObject partObject = - new GameObject(useIndex ? $"{partInstance.Info.Name}_{partIndex}" : partInstance.Info.Name); - - MirabufDefinitionHelper.MakePartDefinition(partObject, partDefinition, partInstance, - _miraAssembly.Data, - !colliders ? MirabufDefinitionHelper.ColliderGenType.NoCollider - : (isStatic ? MirabufDefinitionHelper.ColliderGenType.Concave - : MirabufDefinitionHelper.ColliderGenType.Convex), - useIndex, partIndex); - partObject.transform.parent = groupObject.transform; - var gt = partInstance.GlobalTransform.UnityMatrix; - partObject.transform.localPosition = gt.GetPosition(); - partObject.transform.localRotation = gt.rotation; - } - - groupObject.transform.parent = assemblyContainer.transform; - -#endregion - - if (!_miraAssembly.Dynamic && !isGamepiece) { - groupObject.transform.GetComponentsInChildren().ForEach( - x => x.gameObject.layer = dynamicLayer = DynamicLayerManager.FieldLayer); - } else if (_miraAssembly.Dynamic && colliders) { - groupObject.transform.GetComponentsInChildren().ForEach( - x => x.gameObject.layer = dynamicLayer); - } - - if (rigidbodies && colliders) { - // Combine all physical data for grouping - var rb = groupObject.AddComponent(); - if (isStatic) - rb.isKinematic = true; - rb.mass = (float) group.CollectivePhysicalProperties.Mass; - rb.centerOfMass = group.CollectivePhysicalProperties.Com; // I actually don't need to flip this - rb.collisionDetectionMode = CollisionDetectionMode.Discrete; - } - - groupObjects.Add(group.GUID, groupObject); - } - - return groupObjects; - } - - /// - /// Collection of parts that move together - /// - public struct RigidbodyDefinition { - public string GUID; - public string Name; - public bool IsGamepiece; - public bool IsStatic; - public MPhysicalProperties CollectivePhysicalProperties; - public Dictionary Parts; // Using a dictionary to make Key searches faster - } - - public struct RigidbodyDefinitions { - public float Mass; - public Dictionary Definitions; - public Dictionary PartToDefinitionMap; - } - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/Importer/MirabufLive.cs.meta b/engine/Assets/Scripts/Importer/MirabufLive.cs.meta deleted file mode 100644 index e3380e5ef5..0000000000 --- a/engine/Assets/Scripts/Importer/MirabufLive.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 16b70701ad2930b4fa902ef5a68f8c15 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Interactable3DDetector.cs b/engine/Assets/Scripts/Interactable3DDetector.cs deleted file mode 100644 index 2902f40473..0000000000 --- a/engine/Assets/Scripts/Interactable3DDetector.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.EventSystems; -using Synthesis.UI; -using Synthesis.UI.ContextMenus; - -using ContextMenu = Synthesis.UI.ContextMenus.ContextMenu; - -public class Interactable3DDetector : MonoBehaviour { - private static Interactable3DDetector instance = null; - - private void Start() { - if (instance != null) { - Destroy(gameObject); - return; - } - instance = this; - } - - private void Update() { - if (Input.GetKeyDown(KeyCode.Mouse1)) { - var refResolution = ContextMenu.CanvasScaler.referenceResolution; - - Vector2 screen = new Vector2(Screen.currentResolution.width, Screen.currentResolution.height); - Vector2 mouse = new Vector2(Input.mousePosition.x, Input.mousePosition.y); - Vector2 adjustedPos = - new Vector2(refResolution.x * (mouse.x / screen.x), refResolution.y * (mouse.y / screen.y)); - - var ray = Camera.main.ScreenPointToRay(Input.mousePosition); - Physics.Raycast(ray, out RaycastHit hit); // TODO: Fix - if (hit.collider != null) { - var component = hit.collider.gameObject.GetComponent(); - if (component != null) { - component.OnPointerClick(new Vector2(Input.mousePosition.x, Input.mousePosition.y)); - } - } - } - } -} diff --git a/engine/Assets/Scripts/Interactable3DDetector.cs.meta b/engine/Assets/Scripts/Interactable3DDetector.cs.meta deleted file mode 100644 index c373b03d99..0000000000 --- a/engine/Assets/Scripts/Interactable3DDetector.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 3be3f4e6735c4be19127e1465ef4d703 -timeCreated: 1624312300 \ No newline at end of file diff --git a/engine/Assets/Scripts/Modes.meta b/engine/Assets/Scripts/Modes.meta deleted file mode 100644 index e8767d5ca9..0000000000 --- a/engine/Assets/Scripts/Modes.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: aa6f56db4ae14d6588890a60458a3684 -timeCreated: 1656009225 \ No newline at end of file diff --git a/engine/Assets/Scripts/Modes/Aether.meta b/engine/Assets/Scripts/Modes/Aether.meta deleted file mode 100644 index d4427fb5ed..0000000000 --- a/engine/Assets/Scripts/Modes/Aether.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 162696439e026473fb24e8e5063cd100 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Modes/Aether/ConnectToMultiplayerMode.cs b/engine/Assets/Scripts/Modes/Aether/ConnectToMultiplayerMode.cs deleted file mode 100644 index 319caca20f..0000000000 --- a/engine/Assets/Scripts/Modes/Aether/ConnectToMultiplayerMode.cs +++ /dev/null @@ -1,167 +0,0 @@ -using Google.Protobuf; -using Synthesis.Runtime; -using Synthesis.UI.Dynamic; -using SynthesisAPI.Aether.Lobby; -using SynthesisAPI.Controller; -using SynthesisAPI.Utilities; -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net.Sockets; -using System.Threading; -using System.Threading.Tasks; - -using Logger = SynthesisAPI.Utilities.Logger; - -public class ConnectToMultiplayerMode : IMode { - private const string SERVER_IP = "127.0.0.1"; - private const string CLIENT_NAME = "Client 3.1415"; - // clang-format off - private static readonly string[] _robotFolders = { - "Mira", - "Mira/Multiplayer" - }; - // clang-format on - private string _multiplayerRobotFolder => _robotFolders[1]; - - private LobbyClient _client; - - public ClientConnectionState ConnectionState { get; private set; } = ClientConnectionState.Disconnected; - public ClientActionState ActionState { get; private set; } = ClientActionState.Idle; - - public List GetAvailableRobots() { - List robots = new List(); - - foreach (string folder in _robotFolders) { - string path = ParsePath(Path.Combine("$appdata/Autodesk/Synthesis", folder), '/'); - if (!Directory.Exists(path)) { - Directory.CreateDirectory(path); - } - - robots.AddRange(Directory.GetFiles(path).Where(x => Path.GetExtension(x).Equals(".mira"))); - } - - return robots; - } - - public Task> SelectRobot(string pathToRobotMira) { - if (!File.Exists(pathToRobotMira)) { - Logger.Log("Robot does not exist", LogLevel.Error); - return Task.FromResult(new Result(new Exception("Robot file does not exist."))); - } - - var robot = new DataRobot { - Name = Path.GetFileNameWithoutExtension(pathToRobotMira), - Data = ByteString.CopyFrom(File.ReadAllBytes(pathToRobotMira)), - // Guid = _client.Guid - }; - - ActionState = ClientActionState.UploadingData; - - Task < Result < LobbyMessage ?, Exception >> task; - try { - task = _client.UploadRobotData(robot); - } catch (Exception e) { - Logger.Log("Failed to upload robot data", LogLevel.Error); - ActionState = ClientActionState.Idle; - return Task.FromResult(new Result(e)); - } - - ActionState = ClientActionState.Idle; - return task; - } - - public void Start() { - DynamicUIManager.CreateModal(); - SimulationRunner.OnGameObjectDestroyed += End; - - ConnectionState = ClientConnectionState.Connecting; - Task.Factory.StartNew(() => _client = new LobbyClient(SERVER_IP, CLIENT_NAME)).ContinueWith(t => { - if (t.IsFaulted) { - Logger.Log("Failed to connect to server", LogLevel.Error); - ConnectionState = ClientConnectionState.Disconnected; - } else { - Logger.Log("Test Client connected to server", LogLevel.Info); - ConnectionState = ClientConnectionState.Connected; - } - }); - } - - public void RequestServerRobotData() { - ActionState = ClientActionState.DownloadingData; - - _client.RequestServerRobotData().ContinueWith(t => { - if (t.IsFaulted) { - Logger.Log("Failed to request robot data from server", LogLevel.Error); - ActionState = ClientActionState.Idle; - return; - } - - string root = ParsePath(Path.Combine("$appdata/Autodesk/Synthesis", _multiplayerRobotFolder), '/'); - - foreach (DataRobot robot in _client.RobotsFromServer) { - string path = Path.Combine(root, robot.Name + ".mira"); - var bytes = robot.Data.ToByteArray(); - if (!File.Exists(path)) { - File.Create(path); - } - - File.WriteAllBytes(path, bytes); - } - }); - - ActionState = ClientActionState.Idle; - } - - public void Update() {} - - public void End() { - if (_client == null) { - return; - } - - Engine.ModuleLoader.Api.ToastLogger.SetEnabled(false); - _client.Dispose(); - _client = null; - Engine.ModuleLoader.Api.ToastLogger.SetEnabled(true); - } - - public void OpenMenu() {} - - public void CloseMenu() {} - - public enum ClientConnectionState { - Disconnected, - Connecting, - Connected - } - - public enum ClientActionState { - Idle, - UploadingData, - DownloadingData - } - - private static string ParsePath(string p, char c) { - string[] a = p.Split(c); - string b = ""; - for (int i = 0; i < a.Length; i++) { - switch (a[i]) { - case "$appdata": - b += System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData); - break; - default: - b += a[i]; - break; - } - - if (i != a.Length - 1) { - b += System.IO.Path.AltDirectorySeparatorChar; - } - } - - return b; - } -} diff --git a/engine/Assets/Scripts/Modes/Aether/ConnectToMultiplayerMode.cs.meta b/engine/Assets/Scripts/Modes/Aether/ConnectToMultiplayerMode.cs.meta deleted file mode 100644 index cbd7d0a5f0..0000000000 --- a/engine/Assets/Scripts/Modes/Aether/ConnectToMultiplayerMode.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 3c469460ce9dd4d8e8ab262678d72d00 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Modes/Aether/ServerHostingMode.cs b/engine/Assets/Scripts/Modes/Aether/ServerHostingMode.cs deleted file mode 100644 index da8ab4ca63..0000000000 --- a/engine/Assets/Scripts/Modes/Aether/ServerHostingMode.cs +++ /dev/null @@ -1,45 +0,0 @@ -using Synthesis.Runtime; -using Synthesis.UI.Dynamic; -using SynthesisAPI.Aether.Lobby; -using System.Collections.Generic; -using System.Threading.Tasks; - -public class ServerHostingMode : IMode { - private LobbyServer _server; - - public IReadOnlyCollection ClientInformation => - _server.Clients == null ? new List() : _server.Clients; - - public bool IsServerAlive => _server != null; - - public void Start() { - _server = new LobbyServer(); - - DynamicUIManager.CreateModal(); - SimulationRunner.OnGameObjectDestroyed += End; - } - - public void End() { - if (_server == null) { - return; - } - - Engine.ModuleLoader.Api.ToastLogger.SetEnabled(false); - _server.Dispose(); - _server = null; - Engine.ModuleLoader.Api.ToastLogger.SetEnabled(true); - } - - public void KillServer() { - if (_server != null) { - _server.Dispose(); - _server = null; - } - } - - public void Update() {} - - public void OpenMenu() {} - - public void CloseMenu() {} -} diff --git a/engine/Assets/Scripts/Modes/Aether/ServerHostingMode.cs.meta b/engine/Assets/Scripts/Modes/Aether/ServerHostingMode.cs.meta deleted file mode 100644 index ab22361c06..0000000000 --- a/engine/Assets/Scripts/Modes/Aether/ServerHostingMode.cs.meta +++ /dev/null @@ -1,14 +0,0 @@ -<<<<<<< HEAD:engine/Assets/Scripts/Analytics/OldAnalyticsManager.cs.meta -======= -fileFormatVersion: 2 -guid: 08ec81fd2ecd646acb9782dbea08985b -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: ->>>>>>> dev:engine/Assets/Scripts/Modes/Aether/ServerHostingMode.cs.meta diff --git a/engine/Assets/Scripts/Modes/Aether/ServerTestMode.cs b/engine/Assets/Scripts/Modes/Aether/ServerTestMode.cs deleted file mode 100644 index e04d327b21..0000000000 --- a/engine/Assets/Scripts/Modes/Aether/ServerTestMode.cs +++ /dev/null @@ -1,117 +0,0 @@ -#nullable enable - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Synthesis.Physics; -using Synthesis.Runtime; -using Synthesis.UI.Dynamic; -using SynthesisAPI.Aether.Lobby; -using SynthesisAPI.Controller; -using SynthesisAPI.Simulation; -using UI.Dynamic.Modals.Spawning; -using UnityEngine; - -public class ServerTestMode : IMode { - private LobbyServer? _server; - // clang-format off - public LobbyServer? Server => _server; - private readonly LobbyClient?[] _clients = new LobbyClient?[2]; - public LobbyClient?[] Clients => _clients; - // clang-format on - - private RobotSimObject _host; - private RobotSimObject _ghost; - - public IReadOnlyCollection ClientInformation => _server?.Clients ?? new List(); - - public void Start() { - DynamicUIManager.CloseActiveModal(); - // MainHUD.AddItemToDrawer("Multibot", b => DynamicUIManager.CreatePanel()); - - _server = new LobbyServer(); - - // DynamicUIManager.CreateModal(); - // TODO remove and allow user to choose robot - string dozer = "Dozer_v9.mira"; - string tmm = "Team 2471 (2018)_v5.mira"; - RobotSimObject.SpawnRobot(null, new Vector3(-2, 1, 0), Quaternion.Euler(0, 0, 0), false, - AddRobotModal.ParsePath("$appdata/Autodesk/Synthesis/Mira/" + dozer, '/')); - _host = RobotSimObject.GetCurrentlyPossessedRobot(); - _host.RobotNode.name = "host"; - _host.BehavioursEnabled = false; - RobotSimObject.SpawnRobot(null, new Vector3(2, 1, 0), Quaternion.Euler(0, 0, 0), false, - AddRobotModal.ParsePath("$appdata/Autodesk/Synthesis/Mira/" + dozer, '/')); - _ghost = RobotSimObject.GetCurrentlyPossessedRobot(); - _ghost.RobotNode.name = "ghost"; - _ghost.DriversEnabled = false; - _ghost.Freeze(); - - SimulationRunner.OnGameObjectDestroyed += End; - MainHUD.RemoveAllItemsFromDrawer(); - } - - public void KillClient(int i) { - _clients[i]?.Dispose(); - } - - public void KillClients() { - foreach (var client in _clients) { - client?.Dispose(); - } - } - - private bool _isFrozen = false; - - public void Update() { - if (_ghost is not null && !_isFrozen) { - _ghost.Freeze(); - _isFrozen = true; - } - - var transformsList = new List(); - if (_ghost is null || _host is null) - return; - if (_ghost.Client is null || _host.Client is null) - return; - - var ghostTransform = new ServerTransforms() { Guid = _ghost.Client.Guid.Value }; - - foreach (var node in _host.AllRigidbodies) { - Matrix4x4 m = node.transform.localToWorldMatrix; - ServerTransformData data = (ServerTransformData) m; - ghostTransform.Transforms.Add(node.name, data); - } - transformsList.Add(ghostTransform); - - _host.Client.UpdateTransforms(transformsList).ContinueWith((x, o) => { - var msg = x.Result.GetResult(); - msg?.FromControllableStates.AllUpdates.ForEach(update => { - // TODO handle guid - update.UpdatedSignals.ForEach(signal => { - // TODO choose robot based on client guid rather than hardcoding host - SimulationManager.Drivers[_host.Name].ForEach(driver => { - driver.State.SignalMap.Values.Where(sd => sd.SignalGuid == signal.SignalGuid) - .ToList()[0] - .Value = signal.Value; - }); - }); - }); - }, null); - } - - public void End() { - Engine.ModuleLoader.Api.ToastLogger.SetEnabled(false); - KillClients(); - _server?.Dispose(); - _server = null; - Engine.ModuleLoader.Api.ToastLogger.SetEnabled(true); - } - - public void OpenMenu() {} - - public void CloseMenu() {} -} diff --git a/engine/Assets/Scripts/Modes/Aether/ServerTestMode.cs.meta b/engine/Assets/Scripts/Modes/Aether/ServerTestMode.cs.meta deleted file mode 100644 index 8cdff3708e..0000000000 --- a/engine/Assets/Scripts/Modes/Aether/ServerTestMode.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: f4bf90c2ee8e04c8e863271f8c712907 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Modes/IMode.cs b/engine/Assets/Scripts/Modes/IMode.cs deleted file mode 100644 index dfe76d4c71..0000000000 --- a/engine/Assets/Scripts/Modes/IMode.cs +++ /dev/null @@ -1,7 +0,0 @@ -public interface IMode { - public void Start(); - public void Update(); - public void End(); - public void OpenMenu(); - public void CloseMenu(); -} \ No newline at end of file diff --git a/engine/Assets/Scripts/Modes/IMode.cs.meta b/engine/Assets/Scripts/Modes/IMode.cs.meta deleted file mode 100644 index e4e31d2e9c..0000000000 --- a/engine/Assets/Scripts/Modes/IMode.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: ced87f593d354e75bf2e30e1b468c31e -timeCreated: 1657564885 \ No newline at end of file diff --git a/engine/Assets/Scripts/Modes/MatchMode.meta b/engine/Assets/Scripts/Modes/MatchMode.meta deleted file mode 100644 index 8219d8c736..0000000000 --- a/engine/Assets/Scripts/Modes/MatchMode.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 9b89b33226997e94290c75468f19f1d5 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Modes/MatchMode/MatchMode.cs b/engine/Assets/Scripts/Modes/MatchMode/MatchMode.cs deleted file mode 100644 index 133697ee04..0000000000 --- a/engine/Assets/Scripts/Modes/MatchMode/MatchMode.cs +++ /dev/null @@ -1,144 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Synthesis.UI.Dynamic; -using SynthesisAPI.EventBus; -using SynthesisAPI.Utilities; -using UnityEngine; -using static MatchResultsTracker; -using Logger = SynthesisAPI.Utilities.Logger; - -namespace Modes.MatchMode { - public class MatchMode : IMode { - public static float MatchTime = 15f; - - public static MatchResultsTracker MatchResultsTracker; - - /// Integers to represent which robots the user selected in the MatchModeModal - public static int[] SelectedRobots = new int[6]; - - /// Whether or not the robot should snap to a grid in positioning mode - public static bool[] RoundSpawnLocation = new bool[6]; - - /// The un-rounded spawn position of all robots - public static (Vector3 position, Quaternion rotation)[] RawSpawnLocations = new( - Vector3 position, Quaternion rotation)[6]; - - /// Rounds the robots spawn position if the user chooses to - public static (Vector3 position, Quaternion rotation) GetSpawnLocation(int robot) { - if (RoundSpawnLocation[robot]) - return SpawnLocationPanel.RoundSpawnLocation(RawSpawnLocations[robot]); - - return RawSpawnLocations[robot]; - } - - public static List Robots = new List(); - - public const string PREVIOUS_SPAWN_LOCATION = "Previous Spawn Location"; - public const string PREVIOUS_SPAWN_ROTATION = "Previous Spawn Rotation"; - - private MatchStateMachine _stateMachine; - - public void Start() { - DynamicUIManager.CreateModal(); - EventBus.NewTypeListener(HandleScoreEvent); - - Array.Fill(SelectedRobots, -1); - Array.Fill(RawSpawnLocations, (Vector3.zero, Quaternion.identity)); - - _stateMachine = MatchStateMachine.Instance; - _stateMachine.SetState(MatchStateMachine.StateName.MatchConfig); - - MatchResultsTracker = new MatchResultsTracker(); - MainHUD.SetUpMatch(); - } - - private void HandleScoreEvent(IEvent e) { - if (e.GetType() != typeof(OnScoreUpdateEvent)) - return; - OnScoreUpdateEvent scoreUpdateEvent = e as OnScoreUpdateEvent; - if (scoreUpdateEvent == null) - return; - - ScoringZone zone = scoreUpdateEvent.Zone; - int points = zone.Points * (scoreUpdateEvent.IncreaseScore ? 1 : -1); - - switch (zone.Alliance) { - case Alliance.Blue: - Scoring.blueScore += points; - break; - case Alliance.Red: - Scoring.redScore += points; - break; - } - } - - public void Update() { - if (_stateMachine != null) { - _stateMachine.Update(); - - if (MatchTime <= 0 && _stateMachine.CurrentState.StateName is >= MatchStateMachine.StateName.Auto and <= - MatchStateMachine.StateName.Endgame) - _stateMachine.AdvanceState(); - } - } - - public void End() { - Scoring.redScore = 0; - Scoring.blueScore = 0; - Robots.Clear(); - EventBus.RemoveTypeListener(HandleScoreEvent); - } - - public void OpenMenu() {} - - public void CloseMenu() {} - - /// Spawns in all of the selected robots and disables physics for spawn location selection - public static void SpawnAllRobots() { - var robotsFolder = ParsePath("$appdata/Autodesk/Synthesis/Mira", '/'); - if (!Directory.Exists(robotsFolder)) - Directory.CreateDirectory(robotsFolder); - var robotFiles = - Directory.GetFiles(robotsFolder).Where(x => Path.GetExtension(x).Equals(".mira")).ToArray(); - - int i = 0; - SelectedRobots.ForEach(x => { - if (x != -1) { - Vector3 position = new Vector3(2 * i - 6, -150f, 0); - RawSpawnLocations[i].position = position; - - RobotSimObject.SpawnRobot(null, position, Quaternion.identity, false, robotFiles[x]); - Robots.Add(RobotSimObject.GetCurrentlyPossessedRobot()); - } else - Robots.Add(null); - i++; - }); - } - - /// Resets the currently selected robots and field - public static void ResetMatchConfiguration() { - Robots = new List(); - Array.Fill(SelectedRobots, -1); - } - - public static string ParsePath(string p, char c) { - string[] a = p.Split(c); - string b = ""; - for (int i = 0; i < a.Length; i++) { - switch (a[i]) { - case "$appdata": - b += Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); - break; - default: - b += a[i]; - break; - } - if (i != a.Length - 1) - b += Path.AltDirectorySeparatorChar; - } - return b; - } - } -} diff --git a/engine/Assets/Scripts/Modes/MatchMode/MatchMode.cs.meta b/engine/Assets/Scripts/Modes/MatchMode/MatchMode.cs.meta deleted file mode 100644 index 7df481e5e5..0000000000 --- a/engine/Assets/Scripts/Modes/MatchMode/MatchMode.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 44d662e8d91e6fe469fdf4df590cb26e -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Modes/MatchMode/MatchResultsTracker.cs b/engine/Assets/Scripts/Modes/MatchMode/MatchResultsTracker.cs deleted file mode 100644 index bb223a1d40..0000000000 --- a/engine/Assets/Scripts/Modes/MatchMode/MatchResultsTracker.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel; -using TMPro; -using UnityEngine; - -public class MatchResultsTracker { - public readonly Dictionary MatchResultEntries = new Dictionary(); - - public MatchResultsTracker() { - MatchResultEntries.Add(typeof(BluePoints), new BluePoints()); - MatchResultEntries.Add(typeof(RedPoints), new RedPoints()); - } - - /// The base interface for any tracked match statistics. Implement this to track a new statistic - public interface ITrackedData { - public string GetName(); - } - - /// The number of points scored by the blue team - public class BluePoints : ITrackedData { - public int Points => Scoring.blueScore; - - public override string ToString() { - return Points.ToString(); - } - - public string GetName() { - return "Blue Points"; - } - } - - /// The number of points scored by the red team - public class RedPoints : ITrackedData { - public int Points => Scoring.redScore; - - public override string ToString() { - return Points.ToString(); - } - - public string GetName() { - return "Red Points"; - } - } -} diff --git a/engine/Assets/Scripts/Modes/MatchMode/MatchResultsTracker.cs.meta b/engine/Assets/Scripts/Modes/MatchMode/MatchResultsTracker.cs.meta deleted file mode 100644 index 84c0c2f5f4..0000000000 --- a/engine/Assets/Scripts/Modes/MatchMode/MatchResultsTracker.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: e0a4710d6ded5f740afb067ec8899f35 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Modes/MatchMode/MatchStateMachine.cs b/engine/Assets/Scripts/Modes/MatchMode/MatchStateMachine.cs deleted file mode 100644 index 8dd9184e6b..0000000000 --- a/engine/Assets/Scripts/Modes/MatchMode/MatchStateMachine.cs +++ /dev/null @@ -1,402 +0,0 @@ -using System.Collections.Generic; -using Analytics; -using Synthesis.UI.Dynamic; -using UnityEngine; -using Synthesis.Physics; -using SynthesisAPI.EventBus; -using UI.Dynamic.Modals; - -namespace Modes.MatchMode { - public class MatchStateMachine { - private static MatchStateMachine _instance; - - public static MatchStateMachine Instance { - get { - if (_instance == null) - _instance = new MatchStateMachine(); - - return _instance; - } - } - -#region State Management - - private readonly Dictionary _matchStates = new Dictionary(); - private MatchState _currentState; - public MatchState CurrentState => _currentState; - - /// Sets the current state. Automatically calls any event functions in the state - /// The new state to switch to - public void SetState(StateName stateName) { - var newState = _matchStates[stateName]; - if (newState == null) { - Debug.LogError($"No state found for {stateName}"); - return; - } - - _currentState.End(); - _currentState = newState; - _currentState.Start(); - } - - public void AdvanceState() { - StateName currentStateName = _currentState.StateName; - var nextStateName = currentStateName + 1; - SetState(nextStateName); - } - - /// Manages the state of the match (ex: match config, teleop, match results) - public MatchStateMachine() { - _matchStates.Add(StateName.None, new None()); - _matchStates.Add(StateName.MatchConfig, new MatchConfig()); - _matchStates.Add(StateName.RobotPositioning, new RobotPositioning()); - _matchStates.Add(StateName.FieldConfig, new FieldConfig()); - _matchStates.Add(StateName.Auto, new Auto()); - _matchStates.Add(StateName.Transition, new Transition()); - _matchStates.Add(StateName.Teleop, new Teleop()); - _matchStates.Add(StateName.Endgame, new Endgame()); - _matchStates.Add(StateName.MatchResults, new MatchResults()); - _matchStates.Add(StateName.Restart, new Restart()); - _matchStates.Add(StateName.Reconfigure, new Reconfigure()); - - _currentState = _matchStates[StateName.None]; - } - - public void Update() { - _currentState.Update(); - } - -#endregion - -#region Match States - - /// Called whenever a new match state is started - public class OnStateStarted : IEvent { - public MatchState state; - public StateName stateName; - - public OnStateStarted(MatchState state, StateName stateName) { - this.state = state; - this.stateName = stateName; - } - - // state passes to next in SpawnLocationPanel accept button - } - - /// Called whenever a match state is ended - public class OnStateEnded : IEvent { - public MatchState state; - public StateName stateName; - - public OnStateEnded(MatchState state, StateName stateName) { - this.state = state; - this.stateName = stateName; - } - } - - /// A specific state during match mode - public abstract class MatchState { - public StateName StateName; - - public MatchState(StateName stateName) { - this.StateName = stateName; - } - - public virtual void Start() { - EventBus.Push(new OnStateStarted(this, StateName)); - } - - public abstract void Update(); - - public virtual void End() { - EventBus.Push(new OnStateEnded(this, StateName)); - } - } - - /// An empty state - public class None : MatchState { - public override void Start() { - base.Start(); - } - - public override void Update() {} - - public override void End() { - base.End(); - } - - public None() : base(StateName.None) {} - } - - /// When the user is choosing which robots to spawn in and other match settings - public class MatchConfig : MatchState { - public override void Start() { - base.Start(); - DynamicUIManager.CreateModal(); - DynamicUIManager.ActiveModal.OnAccepted += () => Instance.SetState(StateName.RobotPositioning); - } - - public override void Update() {} - - public override void End() { - base.End(); - } - - public MatchConfig() : base(StateName.MatchConfig) {} - } - - /// When the user is choosing where the robot will spawn - public class RobotPositioning : MatchState { - public override void Start() { - base.Start(); - - DynamicUIManager.ManualMainHUDEnabled = false; - PhysicsManager.IsFrozen = true; - MatchMode.SpawnAllRobots(); - - if (Camera.main != null) { - FreeCameraMode camMode = CameraController.CameraModes["Freecam"] as FreeCameraMode; - Camera.main.GetComponent().CameraMode = camMode; - var location = new Vector3(0, 6, -8); - camMode.SetTransform(location, Quaternion.LookRotation(-location.normalized, - Vector3.Cross(-location.normalized, Vector3.right))); - } - - // state passes to next in SpawnLocationPanel accept button - } - - public override void Update() {} - - public override void End() { - base.End(); - - if (Camera.main != null) { - Camera.main.GetComponent().CameraMode = CameraController.CameraModes["Orbit"]; - } - } - - public RobotPositioning() : base(StateName.RobotPositioning) {} - } - - // might expand to include more than scoring zones if necessary - public class FieldConfig : MatchState { - public override void Start() { - base.Start(); - ScoringZonesPanel.MatchModeSetup = true; - DynamicUIManager.CreatePanel(true); - var panel = DynamicUIManager.GetPanel(); - - panel.OnAccepted += () => { - DynamicUIManager.CreateModal(false, "Start Match?"); - DynamicUIManager.ActiveModal.OnAccepted += () => { - DynamicUIManager.CloseActiveModal(); - Instance.SetState(StateName.Auto); - }; - DynamicUIManager.ActiveModal.OnCancelled += () => { - DynamicUIManager.CloseActiveModal(); - Instance.SetState(StateName.FieldConfig); - }; - }; - } - - public override void Update() {} - - public override void End() { - base.End(); - DynamicUIManager.ManualMainHUDEnabled = true; - ScoringZonesPanel.MatchModeSetup = false; - } - - public FieldConfig() : base(StateName.FieldConfig) {} - } - - /// The autonomous state at the beginning of a match - public class Auto : MatchState { - public override void Start() { - base.Start(); - - MatchMode.MatchTime = 15; - DynamicUIManager.CreatePanel(true, true); - - AnalyticsManager.LogCustomEvent( - AnalyticsEvent.MatchStarted, ("NumRobots", RobotSimObject.SpawnedRobots.Count)); - PhysicsManager.IsFrozen = false; - } - - public override void Update() {} - - public override void End() { - base.End(); - } - - public Auto() : base(StateName.Auto) {} - } - - /// - /// 3 second transition state between Auto and Teleop - /// - public class Transition : MatchState { - private float _timer; - private string _possessed; - - public override void Start() { - base.Start(); - _possessed = RobotSimObject.CurrentlyPossessedRobot; - RobotSimObject.CurrentlyPossessedRobot = string.Empty; - MatchMode.MatchTime = 135; - _timer = 3; - } - - public override void Update() { - _timer -= Time.deltaTime; - if (_timer <= 0) { - Instance.AdvanceState(); - } - } - - public override void End() { - RobotSimObject.CurrentlyPossessedRobot = _possessed; - } - - public Transition() : base(StateName.Transition) {} - } - - /// - /// The teleop state of a match - /// - public class Teleop : MatchState { - public override void Start() { - base.Start(); - } - - public override void Update() { - if (MatchMode.MatchTime <= 30) - Instance.AdvanceState(); - } - - public override void End() {} - - public Teleop() : base(StateName.Teleop) {} - } - - public class Endgame : MatchState { - public override void Update() {} - - public Endgame() : base(StateName.Endgame) {} - } - - /// A state when a modal is displayed after a match showing info about the match - public class MatchResults : MatchState { - public override void Start() { - base.Start(); - - DynamicUIManager.CreateModal(); - - AnalyticsManager.LogCustomEvent(AnalyticsEvent.MatchEnded, - ("BluePoints", int.Parse(MatchMode.MatchResultsTracker - .MatchResultEntries[typeof(MatchResultsTracker.BluePoints)] - .ToString())), - ("RedPoints", int.Parse(MatchMode.MatchResultsTracker - .MatchResultEntries[typeof(MatchResultsTracker.RedPoints)] - .ToString()))); - } - - public override void Update() {} - - public override void End() { - Scoring.blueScore = 0; - Scoring.redScore = 0; - AnalyticsManager.LogCustomEvent(AnalyticsEvent.MatchEnded, - ("BluePoints", int.Parse(MatchMode.MatchResultsTracker - .MatchResultEntries[typeof(MatchResultsTracker.BluePoints)] - .ToString())), - ("RedPoints", int.Parse(MatchMode.MatchResultsTracker - .MatchResultEntries[typeof(MatchResultsTracker.RedPoints)] - .ToString()))); - } - - public MatchResults() : base(StateName.MatchResults) {} - } - - /// Restarts the match with the same configuration - public class Restart : MatchState { - public override void Start() { - base.Start(); - - DynamicUIManager.CloseActiveModal(); - DynamicUIManager.CloseAllPanels(true); - - // Reset robots to their selected spawn position - int i = 0; - MatchMode.Robots.ForEach(x => { - if (x != null) { - (Vector3 position, Quaternion rotation) location = MatchMode.GetSpawnLocation(i); - - Transform robot = x.RobotNode.transform; - - robot.position = Vector3.zero; - robot.rotation = Quaternion.identity; - - robot.rotation = location.rotation * Quaternion.Inverse(x.GroundedNode.transform.rotation); - robot.position = location.position - x.GroundedNode.transform.localToWorldMatrix.MultiplyPoint( - x.GroundedBounds.center); - } - i++; - }); - - DynamicUIManager.CreateModal(false, "Start Match?"); - DynamicUIManager.ActiveModal.OnAccepted += () => { - DynamicUIManager.CloseActiveModal(); - Instance.SetState(StateName.Auto); - }; - DynamicUIManager.ActiveModal.OnCancelled += () => { - DynamicUIManager.CloseActiveModal(); - Instance.SetState(StateName.Reconfigure); - }; - } - - public override void Update() {} - - public override void End() {} - - public Restart() : base(StateName.Restart) {} - } - - /// Resets the match and sends he user back to the MatchConfig modal - public class Reconfigure : MatchState { - public override void Start() { - DynamicUIManager.CloseActiveModal(); - DynamicUIManager.CloseAllPanels(true); - - RobotSimObject.RemoveAllRobots(); - FieldSimObject.DeleteField(); - MatchMode.ResetMatchConfiguration(); - - Instance.SetState(StateName.MatchConfig); - } - - public override void Update() {} - - public override void End() {} - - public Reconfigure() : base(StateName.Reconfigure) {} - } - -#endregion - - /// Represents a specific MatchState - public enum StateName { - None, - MatchConfig, - RobotPositioning, - FieldConfig, - Auto, - Transition, - Teleop, - Endgame, - MatchResults, - Restart, - Reconfigure - } - } -} diff --git a/engine/Assets/Scripts/Modes/MatchMode/MatchStateMachine.cs.meta b/engine/Assets/Scripts/Modes/MatchMode/MatchStateMachine.cs.meta deleted file mode 100644 index b2a5d78d82..0000000000 --- a/engine/Assets/Scripts/Modes/MatchMode/MatchStateMachine.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 3c2600eba34d4d5d873fd43dc5eb5c03 -timeCreated: 1687885881 \ No newline at end of file diff --git a/engine/Assets/Scripts/Modes/ModeManager.cs b/engine/Assets/Scripts/Modes/ModeManager.cs deleted file mode 100644 index 3660bd1412..0000000000 --- a/engine/Assets/Scripts/Modes/ModeManager.cs +++ /dev/null @@ -1,57 +0,0 @@ -using Synthesis.Runtime; -using Synthesis.UI; -using Synthesis.UI.Dynamic; -using UnityEngine; -using UnityEngine.SceneManagement; - -public class ModeManager { - // clang-format off - private static bool _modeHasStarted = false; - public static bool ModeHasStarted => _modeHasStarted; - // clang-format on - - public static bool isSinglePlayer = true; - - private static IMode _currentMode; - public static IMode CurrentMode { - get => _currentMode; - set { - if (_currentMode != null) - _currentMode.End(); - _currentMode = value; - _modeHasStarted = false; - - // this is always called in GridMenuScene so _currentMode is never started here - // it is now started in SimulationRunner::Start - if (SceneManager.GetActiveScene().name == "MainScene" && _currentMode != null) { - _currentMode.Start(); - _modeHasStarted = true; - } - } - } - - public static void Start() { - if (CurrentMode == null) { - if (isSinglePlayer) { - DynamicUIManager.CreateModal(); - } else { - DynamicUIManager.CreateModal(); - } - } else if (!ModeHasStarted) { - CurrentMode.Start(); - } - } - - public static void Update() { - CurrentMode?.Update(); - } - - public static void ModalClosed() { - if (CurrentMode != null) - CurrentMode.CloseMenu(); - } - - public static void Teardown() { - CurrentMode = null; - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/Modes/ModeManager.cs.meta b/engine/Assets/Scripts/Modes/ModeManager.cs.meta deleted file mode 100644 index 2f72a94d3a..0000000000 --- a/engine/Assets/Scripts/Modes/ModeManager.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 4018215ec7914bbaaa14855906f279a2 -timeCreated: 1656018132 \ No newline at end of file diff --git a/engine/Assets/Scripts/Modes/PracticeMode.cs b/engine/Assets/Scripts/Modes/PracticeMode.cs deleted file mode 100644 index c18c4bbb06..0000000000 --- a/engine/Assets/Scripts/Modes/PracticeMode.cs +++ /dev/null @@ -1,286 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Drawing.Text; -using System.Linq; -using Synthesis.Gizmo; -using Synthesis.Physics; -using Synthesis.PreferenceManager; -using Synthesis.Runtime; -using Synthesis.UI.Dynamic; -using SynthesisAPI.EventBus; -using SynthesisAPI.InputManager; -using SynthesisAPI.InputManager.Inputs; -using SynthesisAPI.Utilities; -using UI.Dynamic.Modals.MixAndMatch; -using UnityEngine; -using Logger = SynthesisAPI.Utilities.Logger; -using Random = System.Random; - -public class PracticeMode : IMode { - public static Vector3 GamepieceSpawnpoint = new Vector3(0, 10, 0); - private static GameObject _gamepieceSpawnpointObject; - - private bool _lastEscapeValue = false; - private bool _escapeMenuOpen = false; - private bool _showingScoreboard = false; - - public static GamepieceData ChosenGamepiece { get; set; } - public static PrimitiveType ChosenPrimitive { get; set; } - - public const string TOGGLE_ESCAPE_MENU_INPUT = "escape_menu"; - - private static Dictionary _initialPositions = new Dictionary(); - private static Dictionary _initialRotations = new Dictionary(); - - // for resetting the robot in practice mode - public static Dictionary InitialPositions { - get => _initialPositions; - set => _initialPositions = value; - } - - public static Dictionary InitialRotations { - get => _initialRotations; - set => _initialRotations = value; - } - - private static List _gamepieces = new List(); - - public void Start() { - DynamicUIManager.CreateModal(); - - InputManager.AssignValueInput( - TOGGLE_ESCAPE_MENU_INPUT, TryGetSavedInput(TOGGLE_ESCAPE_MENU_INPUT, - new Digital("Escape", context: SimulationRunner.RUNNING_SIM_CONTEXT))); - - EventBus.NewTypeListener(HandleScoreEvent); - - ConfigureMainHUD(); - } - - /// Adds buttons to the main hud (panel on left side) - public void ConfigureMainHUD() { - MainHUD.SetUpPractice(); - } - - private void HandleScoreEvent(IEvent e) { - if (e.GetType() != typeof(OnScoreUpdateEvent)) - return; - OnScoreUpdateEvent scoreUpdateEvent = e as OnScoreUpdateEvent; - if (scoreUpdateEvent == null) - return; - - ScoringZone zone = scoreUpdateEvent.Zone; - int points = zone.Points * (scoreUpdateEvent.IncreaseScore ? 1 : -1); - - switch (zone.Alliance) { - case Alliance.Blue: - Scoring.blueScore += points; - break; - case Alliance.Red: - Scoring.redScore += points; - break; - } - } - - public static void SetInitialState(GameObject robot) { - InitialPositions.Clear(); - InitialRotations.Clear(); - robot.GetComponentsInChildren().ForEach(rb => { - GameObject go = rb.gameObject; - InitialPositions.Add(go, go.transform.position); - InitialRotations.Add(go, go.transform.rotation); - }); - } - - private Analog TryGetSavedInput(string key, Analog defaultInput) { - if (PreferenceManager.ContainsPreference(key)) { - var input = PreferenceManager.GetPreference(key); - input.ContextBitmask = defaultInput.ContextBitmask; - return input; - } - return defaultInput; - } - - public void Update() { - if (!_showingScoreboard && FieldSimObject.CurrentField != null && - FieldSimObject.CurrentField.ScoringZones.Count > 0) { - _showingScoreboard = true; - DynamicUIManager.CreatePanel(true, false); - } - - // TODO: This randomly broke again for no apparent reason - /*bool openEscapeMenu = InputManager.MappedValueInputs[TOGGLE_ESCAPE_MENU_INPUT].Value == 1.0F; - if (openEscapeMenu && !_lastEscapeValue) { - if (_escapeMenuOpen) { - CloseMenu(); - } else { - OpenMenu(); - } - } - - _lastEscapeValue = openEscapeMenu;*/ - } - - public void OpenMenu() { - DynamicUIManager.CreateModal(); - _escapeMenuOpen = true; - } - - public void CloseMenu() { - DynamicUIManager.CloseActiveModal(); - _escapeMenuOpen = false; - } - - public void End() { - InputManager._mappedValueInputs.Remove(TOGGLE_ESCAPE_MENU_INPUT); - Scoring.redScore = 0; - Scoring.blueScore = 0; - EventBus.RemoveTypeListener(HandleScoreEvent); - } - - public static void ConfigureGamepieceSpawnpoint() { - _gamepieceSpawnpointObject = GameObject.CreatePrimitive(PrimitiveType.Cube); - _gamepieceSpawnpointObject.transform.localScale = new Vector3(1, 1, 1); - _gamepieceSpawnpointObject.transform.position = GamepieceSpawnpoint; - _gamepieceSpawnpointObject.transform.tag = "gamepiece"; - - _gamepieceSpawnpointObject.GetComponent().enabled = false; - - FieldSimObject currentField = FieldSimObject.CurrentField; - if (currentField != null) { - _gamepieceSpawnpointObject.transform.parent = currentField.FieldObject.transform; - } - - // make it transparent - Renderer renderer = _gamepieceSpawnpointObject.GetComponent(); - renderer.material = new Material(Shader.Find("Shader Graphs/DefaultSynthesisTransparentShader")); - - GizmoManager.SpawnGizmo(_gamepieceSpawnpointObject.transform, - t => { _gamepieceSpawnpointObject.transform.position = t.Position; }, - t => { EndConfigureGamepieceSpawnpoint(); }); - } - - public static void EndConfigureGamepieceSpawnpoint() { - GamepieceSpawnpoint = _gamepieceSpawnpointObject.transform.position; - GameObject.Destroy(_gamepieceSpawnpointObject); - _gamepieceSpawnpointObject = null; - } - - public static void ResetRobot() { - RobotSimObject robot = MainHUD.SelectedRobot; - if (robot == null) - return; - robot.ClearGamepieces(); - robot.RobotNode.GetComponentsInChildren().ForEach(rb => { - GameObject go = rb.gameObject; - go.transform.position = InitialPositions[go]; - go.transform.rotation = InitialRotations[go]; - }); - } - - public static void ResetGamepieces() { - if (RobotSimObject.CurrentlyPossessedRobot != string.Empty) - RobotSimObject.GetCurrentlyPossessedRobot().ClearGamepieces(); - - _gamepieces.ForEach(gp => { GameObject.Destroy(gp.GamepieceObject); }); - _gamepieces.Clear(); - FieldSimObject currentField = FieldSimObject.CurrentField; - if (currentField != null) { - FieldSimObject.CurrentField.Gamepieces.ForEach(gp => gp.Reset()); - } - - Scoring.ResetScore(); - } - - public static void ResetAll() { - ResetRobot(); - ResetGamepieces(); - } - - public static void SpawnGamepiece(float scale = 1.0f, PrimitiveType type = PrimitiveType.Sphere) { - SpawnGamepiece(GamepieceSpawnpoint, scale, type); - } - - public static void SpawnGamepiece( - int x, int y, int z, float scale = 1.0f, PrimitiveType type = PrimitiveType.Sphere) { - SpawnGamepiece(new Vector3(x, y, z), scale, type); - } - - public static void SpawnGamepiece( - Vector3 spawnPosition, float scale = 1.0f, PrimitiveType type = PrimitiveType.Sphere) { - FieldSimObject currentField = FieldSimObject.CurrentField; - GamepieceData data = ChosenGamepiece; - - GamepieceSimObject gamepiece; - - if (currentField == null || data == null) { - GameObject gameObject = GameObject.CreatePrimitive(type); - gameObject.transform.position = spawnPosition; - gameObject.AddComponent(); - gamepiece = new GamepieceSimObject(type + " Gamepiece", gameObject); - } else { - GameObject parent = new GameObject(data.Name); - Rigidbody rb = parent.AddComponent(); - rb.mass = data.Mass; - parent.AddComponent(); - - GameObject childWithTransform = new GameObject(data.Name); - childWithTransform.transform.parent = parent.transform; - - GameObject childWithMesh = new GameObject(data.Name); - childWithMesh.transform.parent = childWithTransform.transform; - childWithMesh.AddComponent().mesh = data.Mesh; - childWithMesh.AddComponent().material = data.Material; - MeshCollider collider = childWithMesh.AddComponent(); - collider.convex = true; - collider.material = data.ColliderMaterial; - - parent.transform.parent = data.Parent; - parent.transform.position = Vector3.zero; - childWithTransform.transform.position = spawnPosition; - - gamepiece = new GamepieceSimObject(data.Name, parent); - } - - _gamepieces.Add(gamepiece); - } - - public class GamepieceData { - public string Name; - public Mesh Mesh; - public Material Material; - public PhysicMaterial ColliderMaterial; - public Transform Parent; - public float Mass; - - public GamepieceData(GameObject gameObject) { - if (gameObject == null) - return; - - if (gameObject.transform.childCount > 0) - // standard game objects have children named block:# or balls:# - // so I use that for the name of the gamepiece - Name = gameObject.transform.GetChild(0).name.Split(':')[0]; - else - Name = gameObject.name; - - Parent = gameObject.transform.parent; - - MeshFilter meshFilter = gameObject.GetComponentInChildren(); - if (meshFilter != null) - Mesh = meshFilter.mesh; - - MeshCollider collider = gameObject.GetComponentInChildren(); - if (collider != null) - ColliderMaterial = collider.material; - - Rigidbody rb = gameObject.GetComponentInChildren(); - if (rb != null) - Mass = rb.mass; - - MeshRenderer meshRenderer = gameObject.GetComponentInChildren(); - if (meshRenderer != null) - Material = meshRenderer.material; - } - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/Modes/PracticeMode.cs.meta b/engine/Assets/Scripts/Modes/PracticeMode.cs.meta deleted file mode 100644 index ce4da1aa1c..0000000000 --- a/engine/Assets/Scripts/Modes/PracticeMode.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 21a7315af0f549aca1fe5c269d605784 -timeCreated: 1656009235 \ No newline at end of file diff --git a/engine/Assets/Scripts/ModuleLoader.meta b/engine/Assets/Scripts/ModuleLoader.meta deleted file mode 100644 index 2dc3a7cd92..0000000000 --- a/engine/Assets/Scripts/ModuleLoader.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 45216bb11c435434d9c7c5b969e1bfc1 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/ModuleLoader/Adapters.meta b/engine/Assets/Scripts/ModuleLoader/Adapters.meta deleted file mode 100644 index 03ede485a2..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/Adapters.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 9b43006f4ab89224b815dc135caae021 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/ModuleLoader/Adapters/AudioSourceAdapter.cs b/engine/Assets/Scripts/ModuleLoader/Adapters/AudioSourceAdapter.cs deleted file mode 100644 index 5b29ce7cbf..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/Adapters/AudioSourceAdapter.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; -using SynthesisAPI.AssetManager; -using SynthesisAPI.EnvironmentManager.Components; -using UnityEngine; - -using AudioSource = SynthesisAPI.EnvironmentManager.Components.AudioSource; - -namespace Engine.ModuleLoader.Adapters { - class AudioSourceAdapter : MonoBehaviour, IApiAdapter { - internal AudioSource instance; - internal UnityEngine.AudioSource unitySource; - - private AudioClipAsset currentClip = null; - - public void SetInstance(AudioSource source) { - instance = source; - - unitySource = gameObject.AddComponent(); - - instance.LinkedGetter = Getter; - instance.LinkedSetter = Setter; - - unitySource.playOnAwake = false; - unitySource.Stop(); - unitySource.time = 0; - } - - public object Getter(string n) { - switch (n.ToLower()) { - case "isplaying": - return unitySource.isPlaying; - case "clip": - return currentClip; - case "volume": - return unitySource.volume; - default: - throw new Exception(); - } - } - - public void Setter(string n, object o) { - switch (n.ToLower()) { - case "isplaying": - if ((bool) o && !unitySource.isPlaying) - unitySource.Play(); - else if (!(bool) o && unitySource.isPlaying) - unitySource.Stop(); - break; - case "clip": - currentClip = (AudioClipAsset) o; - unitySource.clip = currentClip.GetClip(); - break; - case "volume": - unitySource.volume = (float) o; - break; - default: - throw new Exception(); - } - } - - public static AudioSource NewInstance() => new AudioSource(); - } -} diff --git a/engine/Assets/Scripts/ModuleLoader/Adapters/AudioSourceAdapter.cs.meta b/engine/Assets/Scripts/ModuleLoader/Adapters/AudioSourceAdapter.cs.meta deleted file mode 100644 index 48caf18d9f..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/Adapters/AudioSourceAdapter.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 63d6295a000d3e14b95bc8ebc2396244 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/ModuleLoader/Adapters/CameraAdapter.cs b/engine/Assets/Scripts/ModuleLoader/Adapters/CameraAdapter.cs deleted file mode 100644 index 608334d5a3..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/Adapters/CameraAdapter.cs +++ /dev/null @@ -1,34 +0,0 @@ -using SynthesisAPI.EnvironmentManager.Components; -using UnityEngine.EventSystems; - -namespace Engine.ModuleLoader.Adapters { - public class CameraAdapter : UnityEngine.MonoBehaviour, IApiAdapter { - private Camera instance; - private new UnityEngine.Camera camera; - private static UnityEngine.Camera defaultCamera; - - public void SetInstance(Camera camera) { - instance = camera; - } - - public static Camera NewInstance() { - return new Camera(); - } - - public void Awake() { - camera = gameObject.GetComponent(); - if (camera == null) { - if (defaultCamera == null) { - defaultCamera = Util.Misc.FindGameObject("Main Camera").GetComponent(); - // TODO rename Main Camera in scene to something like Default Camera Settings - } - camera = gameObject.AddComponent(); - camera.CopyFrom(defaultCamera); - gameObject.AddComponent(); - camera.tag = "MainCamera"; // TODO manage which is main camera? - - gameObject.AddComponent(); - } - } - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/ModuleLoader/Adapters/CameraAdapter.cs.meta b/engine/Assets/Scripts/ModuleLoader/Adapters/CameraAdapter.cs.meta deleted file mode 100644 index 53d7e31a4f..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/Adapters/CameraAdapter.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 8c6a1ccfd85955948a74ffce814ac80b -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/ModuleLoader/Adapters/ComponentAdapter.cs b/engine/Assets/Scripts/ModuleLoader/Adapters/ComponentAdapter.cs deleted file mode 100644 index 797942d5b1..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/Adapters/ComponentAdapter.cs +++ /dev/null @@ -1,21 +0,0 @@ -using SynthesisAPI.EnvironmentManager; - -namespace Engine.ModuleLoader.Adapters { - public class ComponentAdapter : UnityEngine.MonoBehaviour, IApiAdapter { - public string Name; - - private Component component; - - public void Awake() { - if (component == null) { - gameObject.SetActive(false); - } - } - - public void SetInstance(Component component) { - this.component = component; - Name = this.component.GetType().FullName; - gameObject.SetActive(true); - } - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/ModuleLoader/Adapters/ComponentAdapter.cs.meta b/engine/Assets/Scripts/ModuleLoader/Adapters/ComponentAdapter.cs.meta deleted file mode 100644 index 93171c2261..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/Adapters/ComponentAdapter.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: b429de7751e504b4ea01bad80ec07d68 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/ModuleLoader/Adapters/IApiAdapter.cs b/engine/Assets/Scripts/ModuleLoader/Adapters/IApiAdapter.cs deleted file mode 100644 index 5a05832add..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/Adapters/IApiAdapter.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace Engine.ModuleLoader.Adapters { - public interface IApiAdapter { - void SetInstance(TBase baseTypeInstance); - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/ModuleLoader/Adapters/IApiAdapter.cs.meta b/engine/Assets/Scripts/ModuleLoader/Adapters/IApiAdapter.cs.meta deleted file mode 100644 index 4df845993a..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/Adapters/IApiAdapter.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: b54d067222b2e1f429b00b292095434b -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/ModuleLoader/Adapters/JointsAdapter.cs b/engine/Assets/Scripts/ModuleLoader/Adapters/JointsAdapter.cs deleted file mode 100644 index fe496b5da0..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/Adapters/JointsAdapter.cs +++ /dev/null @@ -1,198 +0,0 @@ -using UnityEngine; -using System.Collections; -using SynthesisAPI.EnvironmentManager.Components; -using System.Collections.Generic; -using FixedJoint = SynthesisAPI.EnvironmentManager.Components.FixedJoint; -using HingeJoint = SynthesisAPI.EnvironmentManager.Components.HingeJoint; -using System.ComponentModel; -using System; -using SynthesisAPI.Utilities; - -using Logger = SynthesisAPI.Utilities.Logger; - -namespace Engine.ModuleLoader.Adapters { - public class JointsAdapter : MonoBehaviour, IApiAdapter { - private Joints instance; - private List _jointAdapters = new List(); - - public void SetInstance(Joints joints) { - instance = joints; - instance.AddJoint += Add; - instance.RemoveJoint += Remove; - - foreach (var joint in instance.AllJoints) - Add(joint); - } - - public static Joints NewInstance => new Joints(); - - // Update is called once per frame - public void Update() { - for (var i = _jointAdapters.Count - 1; i >= 0; i--) { - IJointAdapter jointAdapter = _jointAdapters[i]; - if (!jointAdapter.Exists()) - _jointAdapters.Remove(jointAdapter); - else - jointAdapter.Update(); - } - } - - void Add(IJoint joint) { - if (joint is FixedJoint fixedJoint) { - FixedJointAdapter jointAdapter = new FixedJointAdapter(fixedJoint); - _jointAdapters.Add(jointAdapter); - } else if (joint is HingeJoint hingeJoint) { - HingeJointAdapter jointAdapter = new HingeJointAdapter(hingeJoint); - _jointAdapters.Add(jointAdapter); - } - } - - void Remove(IJoint j) { - _jointAdapters.RemoveAll(x => x.GetIJoint() == j); // Again, might not work - } - - interface IJointAdapter { - void Update(); - IJoint GetIJoint(); - bool Exists(); - } - - class FixedJointAdapter : IJointAdapter { - private FixedJoint _joint; - public IJoint GetIJoint() => _joint; - private UnityEngine.FixedJoint _unityJoint; - public bool Exists() => _unityJoint != null; - - public FixedJointAdapter(FixedJoint joint) { - _joint = joint; - _joint.PropertyChanged += UpdateProperty; - - // init - // TODO: Add parent and child body connections - _unityJoint = Api.ApiProviderData.GameObjects[_joint.connectedParent.Entity.Value] - .AddComponent(); - - _unityJoint.anchor = _joint.anchor.Map() - _unityJoint.transform.position; - _unityJoint.axis = _joint.axis.Map(); - _unityJoint.breakForce = _joint.breakForce; - _unityJoint.breakTorque = _joint.breakTorque; - _unityJoint.connectedBody = ((RigidbodyAdapter) _joint.connectedChild?.Adapter).unityRigidbody; - _unityJoint.enableCollision = _joint.enableCollision; - - _unityJoint.massScale = _joint.connectedParent.mass / _joint.connectedChild.mass; - } - - public void Update() {} - - private void UpdateProperty(object sender, PropertyChangedEventArgs args) { - if (_unityJoint == null) { - return; - } - - // TODO: What should we do about the parent? - switch (args.PropertyName.ToLower()) { - case "axis": - _unityJoint.axis = _joint.axis.Map() - _unityJoint.transform.position; - break; - case "anchor": - _unityJoint.anchor = _joint.anchor.Map(); - break; - case "connectedchild": - _unityJoint.connectedBody = ((RigidbodyAdapter) _joint.connectedChild.Adapter).unityRigidbody; - break; - case "breakforce": - _unityJoint.breakForce = _joint.breakForce; - break; - case "breaktorque": - _unityJoint.breakTorque = _joint.breakTorque; - break; - case "enablecollision": - _unityJoint.enableCollision = _joint.enableCollision; - break; - default: - throw new Exception($"Property {args.PropertyName} not supported"); - } - } - } - - class HingeJointAdapter : IJointAdapter { - private HingeJoint _joint; - public IJoint GetIJoint() => _joint; - private UnityEngine.HingeJoint _unityJoint; - public bool Exists() => _unityJoint != null; - - public HingeJointAdapter(HingeJoint joint) { - _joint = joint; - _joint.PropertyChanged += UpdateProperty; - - // init all properties - // TODO: Add parent and child body connections - _unityJoint = GameObject.Find($"Entity {_joint.connectedParent.Entity?.Index}") - .AddComponent(); - - _unityJoint.anchor = _joint.anchor.Map() - _unityJoint.transform.position; - _unityJoint.axis = _joint.axis.Map(); - _unityJoint.breakForce = _joint.breakForce; - _unityJoint.breakTorque = _joint.breakTorque; - _unityJoint.connectedBody = ((RigidbodyAdapter) _joint.connectedChild?.Adapter).unityRigidbody; - _unityJoint.enableCollision = _joint.enableCollision; - _unityJoint.useLimits = _joint.useLimits; - _unityJoint.limits = _joint.limits.GetUnity(); - _unityJoint.useMotor = _joint.useMotor; - _unityJoint.motor = _joint.motor.GetUnity(); - - _unityJoint.massScale = _joint.connectedParent.mass / _joint.connectedChild.mass; - } - - public void Update() { - _joint.velocity = _unityJoint.velocity; - _joint.angle = _unityJoint.angle; - } - - private void UpdateProperty(object sender, PropertyChangedEventArgs args) { - if (_unityJoint == null) { - // TODO: Need to do something else if joint breaks - return; - } - - // TODO: Add parent and child body connections - // TODO: What should we do about the parent? - switch (args.PropertyName.ToLower()) { - case "anchor": - _unityJoint.anchor = _joint.anchor.Map() - _unityJoint.transform.position; - break; - case "axis": - _unityJoint.axis = _joint.axis.Map(); - break; - case "breakforce": - _unityJoint.breakForce = _joint.breakForce; - break; - case "breaktorque": - _unityJoint.breakTorque = _joint.breakTorque; - break; - case "connectedchild": - _unityJoint.connectedBody = ((RigidbodyAdapter) _joint.connectedChild.Adapter).unityRigidbody; - break; - case "enablecollision": - _unityJoint.enableCollision = _joint.enableCollision; - break; - case "uselimits": - _unityJoint.useLimits = _joint.useLimits; - break; - case "limits": - _unityJoint.limits = _joint.limits.GetUnity(); - break; - case "usemotor": - _unityJoint.useMotor = _joint.useMotor; - break; - case "motor": - _unityJoint.motor = _joint.motor.GetUnity(); - break; - default: - throw new Exception($"Property {args.PropertyName} not supported"); - } - } - } - } - -} diff --git a/engine/Assets/Scripts/ModuleLoader/Adapters/JointsAdapter.cs.meta b/engine/Assets/Scripts/ModuleLoader/Adapters/JointsAdapter.cs.meta deleted file mode 100644 index f26ae63ec8..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/Adapters/JointsAdapter.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: e888eb1f73c7f144ebcbe930dfc79e6e -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/ModuleLoader/Adapters/MeshAdapter.cs b/engine/Assets/Scripts/ModuleLoader/Adapters/MeshAdapter.cs deleted file mode 100644 index 8ac3d1ff3c..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/Adapters/MeshAdapter.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using Engine.Util; -using SynthesisAPI.Utilities; -using UnityEditor; -using UnityEngine; -using Logger = UnityEngine.Logger; -using Mesh = SynthesisAPI.EnvironmentManager.Components.Mesh; - -namespace Engine.ModuleLoader.Adapters { - public sealed class MeshAdapter : MonoBehaviour, IApiAdapter { - private Material defaultMaterial = null; - - public void SetInstance(Mesh mesh) { - instance = mesh; - - if ((filter = gameObject.GetComponent()) == null) - filter = gameObject.AddComponent(); - if ((renderer = gameObject.GetComponent()) == null) - renderer = gameObject.AddComponent(); - - if (defaultMaterial == null) { - var s = Shader.Find("Universal Render Pipeline/Lit"); - defaultMaterial = new Material(s); - defaultMaterial.color = new Color(0.2f, 0.2f, 0.2f); - defaultMaterial.SetFloat("_Smoothness", 0.2f); - } - renderer.material = defaultMaterial; - - filter.mesh = new UnityEngine.Mesh(); - filter.mesh.vertices = Misc.MapAll(instance._vertices, Misc.MapVector3D).ToArray(); - filter.mesh.uv = Misc.MapAll(instance._uvs, x => new Vector2((float) x.X, (float) x.Y)).ToArray(); - filter.mesh.triangles = instance.Triangles.ToArray(); - filter.mesh.RecalculateNormals(); - - instance.PropertyChanged += (s, e) => { - switch (e.PropertyName.ToLower()) { - case "vertices": - filter.mesh.vertices = Misc.MapAll(instance._vertices, Misc.MapVector3D).ToArray(); - break; - case "uvs": - filter.mesh.uv = - Misc.MapAll(instance._uvs, x => new Vector2((float) x.X, (float) x.Y)).ToArray(); - break; - case "triangles": - filter.mesh.triangles = instance._triangles.ToArray(); - break; - case "color": - renderer.material.color = - new Color(instance._color.r, instance._color.g, instance._color.b, instance._color.a); - break; - case "recalculate": - filter.mesh.RecalculateNormals(); - break; - default: - SynthesisAPI.Utilities.Logger.Log("Property not setup", LogLevel.Warning); - break; - } - }; - } - - public static Mesh NewInstance() { - return new Mesh(); - } - - internal Mesh instance; - internal MeshFilter filter; - internal MeshRenderer renderer; - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/ModuleLoader/Adapters/MeshAdapter.cs.meta b/engine/Assets/Scripts/ModuleLoader/Adapters/MeshAdapter.cs.meta deleted file mode 100644 index bebf8ea199..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/Adapters/MeshAdapter.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: b474dd1d0a3202a489cd109d7e917de9 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/ModuleLoader/Adapters/MeshCollider2DAdapter.cs b/engine/Assets/Scripts/ModuleLoader/Adapters/MeshCollider2DAdapter.cs deleted file mode 100644 index f016325d47..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/Adapters/MeshCollider2DAdapter.cs +++ /dev/null @@ -1,92 +0,0 @@ -using Engine.Util; -using SynthesisAPI.EnvironmentManager; -using SynthesisAPI.EnvironmentManager.Components; -using SynthesisAPI.InputManager; -using SynthesisAPI.InputManager.InputEvents; -using SynthesisAPI.InputManager.Inputs; -using UnityEngine; -using static Engine.ModuleLoader.Api; - -using MeshCollider = UnityEngine.MeshCollider; - -namespace Engine.ModuleLoader.Adapters { - public sealed class MeshCollider2DAdapter : MonoBehaviour, IApiAdapter { - private MeshCollider2D instance; - private MeshCollider meshCollider = null; - private SynthesisAPI.EnvironmentManager.Components.Sprite sprite = null; - - public void OnEnable() { - if (instance == null) { - gameObject.SetActive(false); - return; - } - - if (meshCollider == null) { - meshCollider = gameObject.AddComponent(); - meshCollider.sharedMesh = new UnityEngine.Mesh(); - meshCollider.convex = true; - } - InputManager.AssignDigitalInput($"_internal MeshCollider2DAdapter select", new Digital($"mouse 0 non-ui"), - e => ProcessInput((DigitalEvent) e)); // TODO use preference manager for this - } - - public void OnDestroy() { - InputManager.UnassignDigitalInput($"_internal MeshCollider2DAdapter select"); - } - - public void Update() { - sprite = instance.Entity?.GetComponent(); - if (sprite != null) { - if (instance.Changed) { - meshCollider.sharedMesh.triangles = new int[0]; - meshCollider.sharedMesh.vertices = - Misc.MapAllToArray(sprite._sprite.vertices, (v2d) => new Vector3(v2d.x, v2d.y, 0)); - meshCollider.sharedMesh.triangles = Misc.MapAllToArray(sprite._sprite.triangles, (i) => (int) i); - instance.Bounds._bounds = meshCollider.bounds; - instance.ProcessedChanges(); - } - } - } - - public void ProcessInput(DigitalEvent mouseDownEvent) { - if (sprite != null) { - if (mouseDownEvent.State == DigitalState.Down) { - Ray ray = UnityEngine.Camera.main.ScreenPointToRay(UnityEngine.Input.mousePosition); - - bool isAlwaysOnTop = instance.Entity?.GetComponent() != null; - bool hitIntercepted = false; - bool hitMe = false; - var hits = Physics.RaycastAll(ray, Mathf.Infinity); - foreach (var hit in hits) { - if (hit.collider.transform == transform) { - hitMe = true; - } else if (ApiProviderData.GameObjects.TryGetValue( - hit.collider.transform.gameObject, out Entity otherE)) { - if (otherE.GetComponent() != null) { - hitIntercepted = true; - } else { - if (!hitMe) { - hitIntercepted = true; - } - } - } - } - if (hitMe && (!hitIntercepted || isAlwaysOnTop)) { - instance.OnMouseDown(); - } - } else if (mouseDownEvent.State == DigitalState.Up) { - instance.OnMouseUp(); - } - } - } - - public void SetInstance(MeshCollider2D meshCollider2D) { - instance = meshCollider2D; - gameObject.SetActive(true); - } - - public static MeshCollider2D NewInstance() { - return new MeshCollider2D(); - } - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/ModuleLoader/Adapters/MeshCollider2DAdapter.cs.meta b/engine/Assets/Scripts/ModuleLoader/Adapters/MeshCollider2DAdapter.cs.meta deleted file mode 100644 index 91cd84f361..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/Adapters/MeshCollider2DAdapter.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 82f0640d54743f8449d85495739c616a -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/ModuleLoader/Adapters/MeshColliderAdapter.cs b/engine/Assets/Scripts/ModuleLoader/Adapters/MeshColliderAdapter.cs deleted file mode 100644 index 69fcefd3b1..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/Adapters/MeshColliderAdapter.cs +++ /dev/null @@ -1,119 +0,0 @@ -using System; -using UnityEngine; -using SynthesisAPI.Utilities; -using MeshCollider = SynthesisAPI.EnvironmentManager.Components.MeshCollider; -using Mesh = SynthesisAPI.EnvironmentManager.Components.Mesh; -using MeshColliderCookingOptions = SynthesisAPI.EnvironmentManager.Components.MeshColliderCookingOptions; -using PhysicsMaterial = SynthesisAPI.EnvironmentManager.Components.PhysicsMaterial; -using Logger = SynthesisAPI.Utilities.Logger; -using System.ComponentModel; -using SynthesisAPI.EnvironmentManager; -using static Engine.ModuleLoader.Api; -using System.Collections.Generic; - -namespace Engine.ModuleLoader.Adapters { - public class MeshColliderAdapter : MonoBehaviour, IApiAdapter { - private static List allColliders = new List(); - - internal UnityEngine.MeshCollider unityCollider; - internal MeshCollider instance; - - public void OnDestroy() { - allColliders.Remove(this); - } - - public void SetInstance(MeshCollider collider) { - instance = collider; - - if ((unityCollider = GetComponent()) == null) - unityCollider = gameObject.AddComponent(); - - if (instance.Entity?.GetComponent() == null) - throw new SynthesisException("Cannot add a MeshCollider to an entity without a Mesh"); - - instance.PropertyChanged += UnityProperty; - - unityCollider.convex = instance.convex; - - if (instance.sharedMesh == null) { - instance.sharedMesh = instance.Entity?.GetComponent(); - unityCollider.sharedMesh = instance.sharedMesh.ToUnity(); - } else { - unityCollider.sharedMesh = instance.sharedMesh.ToUnity(); - } - - if (instance.material != null) { - unityCollider.material = instance.material.GetUnity(); - } - - unityCollider.cookingOptions = instance.cookingOptions.Convert(); - - foreach (MeshColliderAdapter adapter in allColliders) { - if (adapter.instance.collisionLayer.Equals(instance.collisionLayer)) { - Physics.IgnoreCollision(unityCollider, adapter.unityCollider); - } - } - - allColliders.Add(this); - } - - private void UnityProperty(object sender, PropertyChangedEventArgs args) { - switch (args.PropertyName.ToLower()) { - case "cookingoptions": - unityCollider.cookingOptions = - instance.cookingOptions.Convert(); - break; - case "sharedmesh": - unityCollider.sharedMesh = instance.sharedMesh.ToUnity(); - break; - case "material": - unityCollider.material = instance.material.GetUnity(); - break; - default: - throw new Exception($"Property {args.PropertyName} is not setup"); - } - } - - public void Start() { - gameObject.transform.position = - gameObject.transform.position + - new Vector3(0, float.Epsilon, 0); // Enable Unity collider by moving transform slightly - } - - public void Update() { - // Nothing to actively update - } - - private MeshCollider.Collision MapCollision(Collision collision) { - Entity? e = null; - if (ApiProviderData.GameObjects.TryGetValue(collision.collider.transform.gameObject, out Entity otherE)) { - e = otherE; - } - return new MeshCollider.Collision(collision.impulse.Map(), collision.relativeVelocity.Map(), e); - } - - public void OnCollisionEnter(Collision collision) { - if (instance != null && instance.OnCollisionEnter != null) { - instance.OnCollisionEnter(MapCollision(collision)); - } - } - - public void OnCollisionStay(Collision collision) { - if (instance != null && instance.OnCollisionEnter != null) { - instance.OnCollisionStay(MapCollision(collision)); - } - } - - public void OnCollisionExit(Collision collision) { - if (instance != null && instance.OnCollisionEnter != null) { - instance.OnCollisionExit(MapCollision(collision)); - } - } - - public static MeshCollider NewInstance() { - return new MeshCollider(); - } - - private TResult ConvertEnum(object i) => (TResult) Enum.Parse(typeof(TResult), i.ToString(), true); - } -} diff --git a/engine/Assets/Scripts/ModuleLoader/Adapters/MeshColliderAdapter.cs.meta b/engine/Assets/Scripts/ModuleLoader/Adapters/MeshColliderAdapter.cs.meta deleted file mode 100644 index 59e5ab9a2f..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/Adapters/MeshColliderAdapter.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 7c74617d91fccda4c9cdfec90cddf36e -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/ModuleLoader/Adapters/ParentAdapter.cs b/engine/Assets/Scripts/ModuleLoader/Adapters/ParentAdapter.cs deleted file mode 100644 index 1c61f66f5e..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/Adapters/ParentAdapter.cs +++ /dev/null @@ -1,30 +0,0 @@ -using UnityEngine; -using SynthesisAPI.EnvironmentManager.Components; -using SynthesisAPI.EnvironmentManager; -using static Engine.ModuleLoader.Api; - -namespace Engine.ModuleLoader.Adapters { - public class ParentAdapter : MonoBehaviour, IApiAdapter { - private Parent instance; - - public void SetInstance(Parent parent) { - instance = parent; - - instance.PropertyChanged += (s, e) => { - if (e.PropertyName == "ParentEntity") { - GameObject _parent = - (Entity) instance == 0 ? ApiProviderData.EntityParent : ApiProviderData.GameObjects[instance]; - gameObject.transform.SetParent(_parent.transform); - } - }; - } - - public void OnDestroy() { - instance.Entity.Value.RemoveEntity(); - } - - public static Parent NewInstance() { - return new Parent(); - } - } -} diff --git a/engine/Assets/Scripts/ModuleLoader/Adapters/ParentAdapter.cs.meta b/engine/Assets/Scripts/ModuleLoader/Adapters/ParentAdapter.cs.meta deleted file mode 100644 index 0abfd23813..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/Adapters/ParentAdapter.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 8848308e5be304fbbb49bcdff7ae4a13 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/ModuleLoader/Adapters/RigidbodyAdapter.cs b/engine/Assets/Scripts/ModuleLoader/Adapters/RigidbodyAdapter.cs deleted file mode 100644 index 140e1d242b..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/Adapters/RigidbodyAdapter.cs +++ /dev/null @@ -1,124 +0,0 @@ -using System; -using Rigidbody = SynthesisAPI.EnvironmentManager.Components.Rigidbody; -using UnityEngine; -using SynthesisAPI.Utilities; -using MathNet.Spatial.Euclidean; -using Engine.Util; - -using RigidbodyConstraints = SynthesisAPI.EnvironmentManager.Components.RigidbodyConstraints; -using CollisionDetectionMode = SynthesisAPI.EnvironmentManager.Components.CollisionDetectionMode; -using System.ComponentModel; - -namespace Engine.ModuleLoader.Adapters { - public class RigidbodyAdapter : MonoBehaviour, IApiAdapter { - internal Rigidbody instance; - internal UnityEngine.Rigidbody unityRigidbody; - - public void SetInstance(Rigidbody rigidbody) { - instance = rigidbody; - instance.Adapter = this; - - if ((unityRigidbody = GetComponent()) == null) - unityRigidbody = gameObject.AddComponent(); - - instance.PropertyChanged += UpdateProperty; - - unityRigidbody.sleepThreshold = 0; - - unityRigidbody.useGravity = instance.useGravity; - unityRigidbody.isKinematic = instance.isKinematic; - unityRigidbody.detectCollisions = instance.detectCollisions; - unityRigidbody.mass = instance.mass; - unityRigidbody.velocity = instance.velocity.Map(); - unityRigidbody.drag = instance.drag; - unityRigidbody.angularVelocity = instance.angularVelocity.Map(); - unityRigidbody.angularDrag = instance.angularDrag; - unityRigidbody.maxAngularVelocity = instance.maxAngularVelocity; - unityRigidbody.maxDepenetrationVelocity = instance.maxDepenetrationVelocity; - unityRigidbody.collisionDetectionMode = - instance.collisionDetectionMode.Convert(); - unityRigidbody.constraints = instance.constraints.Convert(); - } - - private void OnCollisionEnter(Collision collision) => instance.OnEnterCollision(collision.impulse.magnitude); - - private void UpdateProperty(object sender, PropertyChangedEventArgs args) { - switch (args.PropertyName.ToLower()) { - case "usegravity": - unityRigidbody.useGravity = instance.useGravity; - break; - case "iskinematic": - unityRigidbody.isKinematic = instance.isKinematic; - break; - case "detectcollisions": - unityRigidbody.detectCollisions = instance.detectCollisions; - break; - case "mass": - unityRigidbody.mass = instance.mass; - break; - case "velocity": - unityRigidbody.velocity = instance.velocity.Map(); - break; - case "drag": - unityRigidbody.drag = instance.drag; - break; - case "angularvelocity": - unityRigidbody.angularVelocity = instance.angularVelocity.Map(); - break; - case "angulardrag": - unityRigidbody.angularDrag = instance.angularDrag; - break; - case "maxangularvelocity": - unityRigidbody.maxAngularVelocity = instance.maxAngularVelocity; - break; - case "maxdepenetrationvelocity": - unityRigidbody.maxDepenetrationVelocity = instance.maxDepenetrationVelocity; - break; - case "collisiondetectionmode": - unityRigidbody.collisionDetectionMode = - ConvertEnum(instance.collisionDetectionMode); - break; - case "constraints": - unityRigidbody.constraints = ConvertEnum(instance.constraints); - break; - default: - throw new Exception($"Property {args.PropertyName} is not setup"); - } - } - - public void Update() { - instance.mass = unityRigidbody.mass; - instance.velocity = unityRigidbody.velocity.Map(); - instance.angularVelocity = unityRigidbody.angularVelocity.Map(); - - if (instance.AdditionalForces.Count > 0) { - foreach (var force in instance.AdditionalForces) { - if (force.Position != Vector3D.NaN) - unityRigidbody.AddForceAtPosition( - force.Force.Map(), force.Position.Map(), ConvertEnum(force.Mode)); - else if (force.Relative) - unityRigidbody.AddRelativeForce(force.Force.Map(), ConvertEnum(force.Mode)); - else - unityRigidbody.AddForce(force.Force.Map(), ConvertEnum(force.Mode)); - } - instance.AdditionalForces.Clear(); - } - - if (instance.AdditionalTorques.Count > 0) { - foreach (var torque in instance.AdditionalTorques) { - if (torque.Relative) - unityRigidbody.AddRelativeTorque(torque.Torque.Map(), ConvertEnum(torque.Mode)); - else - unityRigidbody.AddTorque(torque.Torque.Map(), ConvertEnum(torque.Mode)); - } - instance.AdditionalTorques.Clear(); - } - } - - public static Rigidbody NewInstance() { - return new Rigidbody(); - } - - public TResult ConvertEnum(object i) => (TResult) Enum.Parse(typeof(TResult), i.ToString(), true); - } -} diff --git a/engine/Assets/Scripts/ModuleLoader/Adapters/RigidbodyAdapter.cs.meta b/engine/Assets/Scripts/ModuleLoader/Adapters/RigidbodyAdapter.cs.meta deleted file mode 100644 index 3761e06cb9..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/Adapters/RigidbodyAdapter.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 30308d9323c005a43af7537a9fd74587 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/ModuleLoader/Adapters/SelectableAdapter.cs b/engine/Assets/Scripts/ModuleLoader/Adapters/SelectableAdapter.cs deleted file mode 100644 index e1818dbcd5..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/Adapters/SelectableAdapter.cs +++ /dev/null @@ -1,185 +0,0 @@ -using SynthesisAPI.EnvironmentManager; -using SynthesisAPI.EnvironmentManager.Components; -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using static Engine.ModuleLoader.Api; -using SynthesisAPI.InputManager; -using SynthesisAPI.InputManager.Inputs; -using SynthesisAPI.InputManager.InputEvents; -using System.Linq; -using SynthesisAPI.EventBus; - -namespace Engine.ModuleLoader.Adapters { - public class SelectableAdapter : MonoBehaviour, IApiAdapter { - private Selectable instance; - private static int selectableAdapterCount = 0; - - private static int selectableAdapterIndex = 0; // Used for InputManager control name - private int myIndex = 0; // Used for InputManager control name // TODO make this unnecessary - - private List materials = new List(); - public const float FlashSelectedTime = 0.1f; // sec - private long lastClickTime = 0; // ms - - private bool isDestroyed = false; - - public void SetInstance(Selectable obj) { - instance = obj; - gameObject.SetActive(true); - myIndex = selectableAdapterIndex; - selectableAdapterIndex++; - selectableAdapterCount++; - } - - public static Selectable NewInstance() { - return new Selectable(); - } - - private void Deselect() { - if (Selectable.Selected != null) { - foreach (var selectable in EnvironmentManager.GetComponentsWhere(c => true)) { - if (selectable.IsSelected) { - selectable.SetSelected(Selectable.SelectionType.Unselected); - selectable.OnDeselect(); - } - } - Selectable.ResetSelected(); - } - } - - private void Select() { - var currentClickTime = System.DateTimeOffset.Now.ToUnixTimeMilliseconds(); - var lastSelected = Selectable.Selected; - if (!instance.IsSelected) { - Deselect(); - instance.SetSelected((currentClickTime - lastClickTime) <= 400 - ? Selectable.SelectionType.ExtendedSelection - : Selectable.SelectionType.ExtendedSelectionPending); - instance.OnSelect(); - EventBus.Push(new Selectable.SelectionChangeEvent(Selectable.Selected, lastSelected)); - - StartCoroutine(FlashYellow()); - } else { - if ((currentClickTime - lastClickTime) <= 400) - instance.SetSelected(Selectable.SelectionType.ExtendedSelection); - else - instance.SetSelected(Selectable.SelectionType.Selected); - } - lastClickTime = currentClickTime; - } - - private IEnumerator FlashYellow() // TODO maybe make it highlight the mesh using some kind of shader - { - List backupColors = new List(materials.Count); - foreach (var m in materials) { - backupColors.Add(m.color); - m.color = Color.yellow; - } - - yield return new WaitForSeconds(FlashSelectedTime); - - for (var i = 0; i < materials.Count; i++) { - materials[i].color = backupColors[i]; - } - } - - public void OnEnable() { - if (instance == null) { - gameObject.SetActive(false); - return; - } - - if (gameObject.GetComponent() == null) { - instance.UsingChildren = true; - } - - if (!instance.UsingChildren) { - var renderer = GetComponent(); - if (renderer != null) { - foreach (var material in renderer.materials) { - if (!materials.Any(m => ReferenceEquals(m, material))) { - materials.Add(material); - } - } - } - } else { - foreach (var ms in GetComponentsInChildren()) { - foreach (var material in ms.materials) { - if (!materials.Any(m => ReferenceEquals(m, material))) { - materials.Add(material); - } - } - } - } - InputManager.AssignDigitalInput( - $"_internal SelectableAdapter select {myIndex}", new Digital($"mouse 0 non-ui"), e => { - if (!isDestroyed) - ProcessInput((DigitalEvent) e); - }); // TODO use preference manager for this - - if (selectableAdapterCount == 0) { - InputManager.AssignDigitalInput( - $"_internal SelectableAdapter deselect", new Digital($"mouse 1 non-ui"), e => { - if (Selectable.Selected != null) { - var lastSelected = Selectable.Selected; - Deselect(); - EventBus.Push(new Selectable.SelectionChangeEvent(Selectable.Selected, lastSelected)); - } - }); - } - } - - public void OnDestroy() { - isDestroyed = true; - InputManager.UnassignDigitalInput($"_internal SelectableAdapter select {myIndex}"); - if (selectableAdapterCount == 0) { - InputManager.UnassignDigitalInput($"_internal SelectableAdapter deselect {myIndex}"); - } - if (Selectable.Selected?.Entity != null && Selectable.Selected?.Entity == instance.Entity) { - var lastSelected = Selectable.Selected; - Deselect(); - EventBus.Push(new Selectable.SelectionChangeEvent(Selectable.Selected, lastSelected)); - } - selectableAdapterCount--; - } - - public void ProcessInput(DigitalEvent mouseDownEvent) { - if (mouseDownEvent.State == DigitalState.Down) { - Ray ray = UnityEngine.Camera.main.ScreenPointToRay(UnityEngine.Input.mousePosition); - - bool isAlwaysOnTop = instance.Entity?.GetComponent() != null; - bool hitIntercepted = false; - bool hitMe = false; - var hits = Physics.RaycastAll(ray, Mathf.Infinity); - foreach (var hit in hits) { - if (hit.collider.transform == transform) { - hitMe = true; - } else if (ApiProviderData.GameObjects.TryGetValue( - hit.collider.transform.gameObject, out Entity otherE)) { - if (otherE.GetComponent() != null) { - hitIntercepted = true; - } else { - if (instance.UsingChildren) { - Entity parent = otherE; - while (parent != 0) { - parent = parent.GetComponent().ParentEntity; - if (parent == instance.Entity) { - hitMe = true; - break; - } - } - } - if (!hitMe) { - hitIntercepted = true; - } - } - } - } - if (hitMe && (!hitIntercepted || isAlwaysOnTop)) { - Select(); - } - } - } - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/ModuleLoader/Adapters/SelectableAdapter.cs.meta b/engine/Assets/Scripts/ModuleLoader/Adapters/SelectableAdapter.cs.meta deleted file mode 100644 index e86eda3dd7..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/Adapters/SelectableAdapter.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 33d6d392151a94f469affb15da77e43d -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/ModuleLoader/Adapters/SpriteAdapter.cs b/engine/Assets/Scripts/ModuleLoader/Adapters/SpriteAdapter.cs deleted file mode 100644 index 26e16584c6..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/Adapters/SpriteAdapter.cs +++ /dev/null @@ -1,57 +0,0 @@ -using SynthesisAPI.EnvironmentManager; -using SynthesisAPI.EnvironmentManager.Components; -using UnityEngine; -using Sprite = SynthesisAPI.EnvironmentManager.Components.Sprite; - -namespace Engine.ModuleLoader.Adapters { - public sealed class SpriteAdapter : MonoBehaviour, IApiAdapter { - private Sprite instance = null; - private new SpriteRenderer renderer = null; - private Material defaultMaterial; - private bool updated = false; - - public void Awake() { - if ((renderer = gameObject.GetComponent()) == null) - renderer = gameObject.AddComponent(); - - if (instance == null) { - gameObject.SetActive(false); - } - defaultMaterial = renderer.material; - } - - public void Update() { - if (updated) { - var collider = instance.Entity?.GetComponent(); - if (collider != null) { - collider.Changed = true; - } - updated = false; - } - if (instance.Changed) { - renderer.sprite = instance._sprite; - if (instance.Entity?.GetComponent() != null) - renderer.material = new Material(Shader.Find("Custom/AlwaysOnTop")); - else - renderer.material = defaultMaterial; - - renderer.flipX = instance._flipX; - renderer.flipY = instance._flipY; - renderer.enabled = instance._visible; - instance.Bounds._bounds = renderer.bounds; - instance.ProcessedChanges(); - - updated = true; - } - } - - public void SetInstance(Sprite sprite) { - instance = sprite; - gameObject.SetActive(true); - } - - public static Sprite NewInstance() { - return new Sprite(); - } - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/ModuleLoader/Adapters/SpriteAdapter.cs.meta b/engine/Assets/Scripts/ModuleLoader/Adapters/SpriteAdapter.cs.meta deleted file mode 100644 index 693d031827..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/Adapters/SpriteAdapter.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 7b3d4c4f86c5f9e43ae36393b8f65015 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/ModuleLoader/Adapters/SystemAdapter.cs b/engine/Assets/Scripts/ModuleLoader/Adapters/SystemAdapter.cs deleted file mode 100644 index c3e6e45e77..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/Adapters/SystemAdapter.cs +++ /dev/null @@ -1,38 +0,0 @@ -using SynthesisAPI.EnvironmentManager; -using UnityEngine; - -namespace Engine.ModuleLoader.Adapters { - public class SystemAdapter : MonoBehaviour, IApiAdapter { - public string Name; - - private SystemBase _system; - - public void OnEnable() { - if (_system == null) { - gameObject.SetActive(false); - } - } - - public void Start() => _system.Setup(); - - public void Update() => _system.OnUpdate(); - - public void FixedUpdate() => _system.OnPhysicsUpdate(); - - public void OnGUI() { - _system.OnGUI(); - var e = Event.current; - if (e.isKey) { - _system.OnKeyPress(e.keyCode.ToString()); - } - } - - public void OnDestroy() => _system.Teardown(); - - public void SetInstance(SystemBase instance) { - _system = instance; - Name = _system.GetType().FullName; - gameObject.SetActive(true); - } - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/ModuleLoader/Adapters/SystemAdapter.cs.meta b/engine/Assets/Scripts/ModuleLoader/Adapters/SystemAdapter.cs.meta deleted file mode 100644 index 61e447576c..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/Adapters/SystemAdapter.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: d4574352bb4afd44aa673df0d960a196 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/ModuleLoader/Adapters/TransformAdapter.cs b/engine/Assets/Scripts/ModuleLoader/Adapters/TransformAdapter.cs deleted file mode 100644 index 58e1ea81b0..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/Adapters/TransformAdapter.cs +++ /dev/null @@ -1,68 +0,0 @@ -using UnityEngine; -using Transform = SynthesisAPI.EnvironmentManager.Components.Transform; -using SynthesisAPI.Utilities; -using System; - -using Quaternion = UnityEngine.Quaternion; -using SynQuaternion = MathNet.Spatial.Euclidean.Quaternion; -using MathNet.Spatial.Euclidean; -using Engine.Util; -using System.ComponentModel; - -namespace Engine.ModuleLoader.Adapters { - public class TransformAdapter : MonoBehaviour, IApiAdapter { - public void SetInstance(Transform transform) { - instance = transform; - - instance.PropertyChanged += UpdateProperty; - - unityTransform = gameObject.transform; - - unityTransform.localPosition = instance.Position.Map(); - unityTransform.localRotation = instance.Rotation.Map(); - unityTransform.localScale = instance.Scale.Map(); - } - - private void UpdateProperty(object sender, PropertyChangedEventArgs args) { - switch (args.PropertyName) { - case "Position": - unityTransform.localPosition = instance.Position.Map(); - instance.GlobalPosition = instance.PositionValidator(unityTransform.position.Map()); - break; - case "GlobalPosition": - unityTransform.position = instance.GlobalPosition.Map(); - instance.position = instance.PositionValidator(unityTransform.localPosition.Map()); - break; - case "Rotation": - unityTransform.localRotation = instance.Rotation.Map(); - instance.GlobalRotation = instance.RotationValidator(unityTransform.rotation.Map()); - break; - case "GlobalRotation": - unityTransform.rotation = instance.GlobalRotation.Map(); - instance.rotation = instance.RotationValidator(unityTransform.localRotation.Map()); - break; - case "Scale": - unityTransform.localScale = instance.Scale.Map(); - break; - default: - throw new Exception($"Property {args.PropertyName} is not setup"); - } - } - - public void Update() { - instance.position = instance.PositionValidator(unityTransform.localPosition.Map()); - instance.rotation = instance.RotationValidator(unityTransform.localRotation.Map()); - instance.scale = instance.ScaleValidator(unityTransform.localScale.Map()); - - instance.globalPosition = instance.PositionValidator(unityTransform.position.Map()); - instance.globalRotation = instance.RotationValidator(unityTransform.rotation.Map()); - } - - public static Transform NewInstance() { - return new Transform(); - } - - private Transform instance; - private UnityEngine.Transform unityTransform; - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/ModuleLoader/Adapters/TransformAdapter.cs.meta b/engine/Assets/Scripts/ModuleLoader/Adapters/TransformAdapter.cs.meta deleted file mode 100644 index d337ae4b01..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/Adapters/TransformAdapter.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 5cf2da2b12688b94393a1a64a521123d -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/ModuleLoader/Api.cs b/engine/Assets/Scripts/ModuleLoader/Api.cs deleted file mode 100644 index 0298603b41..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/Api.cs +++ /dev/null @@ -1,340 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Threading.Tasks; -using System.Threading; -using SynthesisAPI.EnvironmentManager; -using SynthesisAPI.Modules; -using SynthesisAPI.Runtime; -using SynthesisAPI.Utilities; -using SynthesisAPI.VirtualFileSystem; -using UnityEngine.UIElements; -using UnityEngine; -using Engine.ModuleLoader.Adapters; -using Logger = SynthesisAPI.Utilities.Logger; -using Component = SynthesisAPI.EnvironmentManager.Component; -using Debug = UnityEngine.Debug; -using SynthesisAPI.UIManager; -using System.Collections; -using Api.GUI; - -namespace Engine.ModuleLoader { - public class Api : MonoBehaviour { - private static Api Instance = null; - - private static readonly string ModulesSourcePath = FileSystem.BasePath + "modules"; - private static readonly string BaseModuleTargetPath = - SynthesisAPI.VirtualFileSystem.Directory.DirectorySeparatorChar + "modules"; - - private static MemoryStream _newConsoleStream = new MemoryStream(); - private static long _lastConsoleStreamPos = 0; - - private static int mainThreadId; - internal static bool IsMainThread => Thread.CurrentThread.ManagedThreadId == mainThreadId; - - private static Queue MainThreadTasks = new Queue(); - - private static bool _registerCore = false; - - public static ToastLogger ToastLogger; - - public void Start() // Must happen after ResourceLedger is initialized (in Awake) - { - if (Instance == null) { - Instance = this; - } else { - Destroy(gameObject); - return; - } - - SetupApplication(); // Always do this first - - DontDestroyOnLoad(gameObject); // Do not destroy this game object when loading a new scene. NOTE: Doesn't - // work in editor for some reason - - if (!_registerCore) { - _registerCore = true; - ModuleManager.RegisterModuleAssemblyName(Assembly.GetExecutingAssembly().GetName().Name, "Core Engine"); - Logger.RegisterLogger(new LoggerImpl()); - ApiProvider.RegisterApiProvider(new ApiProviderImpl()); - - ToastLogger = new ToastLogger(); - Logger.RegisterLogger(ToastLogger); // Must happen after ApiProvider is registered - } - - // ModuleLoader.PreloadApi(); - // ModuleLoader.LoadModules(ModulesSourcePath, BaseModuleTargetPath); - - RerouteConsoleOutput(); - } - - public void Update() { - if (IsMainThread && MainThreadTasks.Count > 0) - MainThreadTasks.Dequeue()(); - } - - private void SetupApplication() { - mainThreadId = Thread.CurrentThread.ManagedThreadId; - - Application.logMessageReceivedThreaded += (condition, stackTrace, type) => { - if (type == LogType.Exception) { - Logger.Log($"Unhandled exception: {condition}\n{stackTrace}", LogLevel.Error); - /* - if (!ModuleManager.IsFinishedLoading) - { - Task.Run(() => - { - while (Application.isPlaying) // Wait until module manager loads - { - Thread.Sleep(250); - if (ModuleManager.IsFinishedLoading) - { - // TODO show some module-independent error screen - break; - } - } - }); - } - */ - } - }; - // Screen.fullScreen = false; - - // GameObject.Find("Screen").GetComponent().scaleMode = - // PanelScaler.ScaleMode.ConstantPhysicalSize; - } - - private void OnDestroy() { - Instance = null; - } - - private class LoggerImpl : SynthesisAPI.Utilities.ILogger { - private bool debugLogsEnabled = true; - private bool _isEnabled = true; - - public void Log(object o, LogLevel logLevel = LogLevel.Info, string memberName = "", string filePath = "", - int lineNumber = 0) { - var type = new StackTrace().GetFrame(2).GetMethod().DeclaringType; - var msg = $"{ModuleManager.GetDeclaringModule(type)}\\{filePath.Split('\\').Last()}:{lineNumber}: {o}"; - switch (logLevel) { - case LogLevel.Info: { - Debug.Log(msg); - break; - } - case LogLevel.Debug: - if (!debugLogsEnabled) { - return; - } - Debug.Log(msg); - break; - case LogLevel.Warning: { - Debug.LogWarning(msg); - break; - } - case LogLevel.Error: { - Debug.LogError(msg); - break; - } - default: - throw new SynthesisException("Unhandled log level"); - } - } - - public void SetEnableDebugLogs(bool enable) { - debugLogsEnabled = enable; - } - - public void SetEnabled(bool enabled) { - _isEnabled = enabled; - } - - public bool IsEnabled() => _isEnabled; - } - - private void RerouteConsoleOutput() { - var writer = new StreamWriter(_newConsoleStream); - Console.SetOut(writer); - - var reader = new StreamReader(_newConsoleStream); - bool firstUse = true; - Task.Run(() => { - while (Application.isPlaying) { - if (_newConsoleStream.Position != _lastConsoleStreamPos) { - if (firstUse) { - Logger.Log("Please use ApiProvider.Log intsead of Console.WriteLine", LogLevel.Warning); - firstUse = false; - } - writer.Flush(); - var pos = _newConsoleStream.Position; - _newConsoleStream.Position = _lastConsoleStreamPos; - - Logger.Log(reader.ReadToEnd()); - - _lastConsoleStreamPos = pos; - _newConsoleStream.Position = pos; - } - } - }); - } - - public static class ApiProviderData { - public static GameObject EntityParent { get; set; } - public static BiDictionary GameObjects { get; set; } - - static ApiProviderData() { - EntityParent = new GameObject("Entities"); - GameObjects = new BiDictionary(); - } - } - - private class ApiProviderImpl : IApiProvider { - private readonly Dictionary _builtins; - - public ApiProviderImpl() { - _builtins = new Dictionary { - {typeof(SynthesisAPI.EnvironmentManager.Components.Mesh), typeof(MeshAdapter) }, - { typeof(SynthesisAPI.EnvironmentManager.Components.Camera), typeof(CameraAdapter) }, - { typeof(SynthesisAPI.EnvironmentManager.Components.Transform), typeof(TransformAdapter) }, - { typeof(SynthesisAPI.EnvironmentManager.Components.Selectable), typeof(SelectableAdapter) }, - { typeof(SynthesisAPI.EnvironmentManager.Components.Parent), typeof(ParentAdapter) }, - { typeof(SynthesisAPI.EnvironmentManager.Components.MeshCollider), typeof(MeshColliderAdapter) }, - { typeof(SynthesisAPI.EnvironmentManager.Components.Rigidbody), typeof(RigidbodyAdapter) }, - { typeof(SynthesisAPI.EnvironmentManager.Components.Joints), typeof(JointsAdapter) }, - { typeof(SynthesisAPI.EnvironmentManager.Components.Sprite), typeof(SpriteAdapter) }, - { typeof(SynthesisAPI.EnvironmentManager.Components.MeshCollider2D), typeof(MeshCollider2DAdapter)} - }; - } - - public void AddEntityToScene(Entity entity) { - if (ApiProviderData.GameObjects.Contains(entity)) - throw new Exception($"Entity \"{entity}\" already exists"); - var gameObject = new GameObject($"Entity {entity.Index}"); - gameObject.transform.SetParent(ApiProviderData.EntityParent.transform); - ApiProviderData.GameObjects.Add(entity, gameObject); - } - - public void RemoveEntityFromScene(Entity entity) { - GameObject gameObject; - if (!ApiProviderData.GameObjects.TryGetValue(entity, out gameObject)) - throw new Exception($"Entity \"{entity}\" does not exist"); - Destroy(gameObject); - } - - public Component AddComponentToScene(Entity entity, Type t) { - GameObject gameObject; - if (!ApiProviderData.GameObjects.TryGetValue(entity, out gameObject)) - throw new Exception($"Entity \"{entity}\" does not exist"); - - Type type; - Component component; - - if (_builtins.ContainsKey(t)) { - type = _builtins[t]; - component = (Component) type.GetMethod("NewInstance")?.Invoke(null, null); - - if (component == null) { - throw new LoadModuleException( - $"Builtin {type.FullName} type lacked way to create new instance of type {t.FullName}"); - } - } else if (t.IsSubclassOf(typeof(SystemBase))) { - try { - component = (SystemBase) Activator.CreateInstance(t); - type = typeof(SystemAdapter); - } catch (Exception e) { - throw new LoadModuleException( - $"Failed to create instance of SystemBase with type {t.FullName}", e); - } - } else { - try { - component = (Component) Activator.CreateInstance(t); - type = typeof(ComponentAdapter); - } catch (Exception e) { - throw new LoadModuleException( - $"Failed to create instance of component with type {t.FullName}", e); - } - } - component.SetEntity(entity); - var gameObjectComponent = gameObject.AddComponent(type); - type.GetMethod("SetInstance").Invoke(gameObjectComponent, new[] { component }); - - return component; - } - - public void AddComponentToScene(Entity entity, Component component) { - GameObject gameObject; - if (!ApiProviderData.GameObjects.TryGetValue(entity, out gameObject)) - throw new Exception($"Entity \"{entity}\" does not exist"); - Type componentType = component.GetType(); - Type type; - if (_builtins.ContainsKey(componentType)) { - type = _builtins[componentType]; - } else if (componentType.IsSubclassOf(typeof(SystemBase))) { - type = typeof(SystemAdapter); - } else { - type = typeof(ComponentAdapter); - } - component.SetEntity(entity); - var gameObjectComponent = gameObject.AddComponent(type); - type.GetMethod("SetInstance").Invoke(gameObjectComponent, new[] { component }); - } - - public void RemoveComponentFromScene(Entity entity, Type t) { - GameObject gameObject; - if (!ApiProviderData.GameObjects.TryGetValue(entity, out gameObject)) - throw new Exception($"Entity \"{entity}\" does not exist"); - Type type; - if (_builtins.ContainsKey(t)) { - type = _builtins[t]; - } else if (t.IsSubclassOf(typeof(SystemBase))) { - type = typeof(SystemAdapter); - } else { - type = typeof(ComponentAdapter); - } - Destroy(gameObject.GetComponent(type)); - } - - public T CreateUnityType(params object[] args) - - where T : class { - if (!IsMainThread) { - EnqueueTaskForMainThread( - () => { Logger.Log("Cannot make VisualElement outside of main thread", LogLevel.Error); }); - return null; - } - return (T) Activator.CreateInstance(typeof(T), args); - } - - public TUnityType InstantiateFocusable() - where TUnityType : Focusable { - return (TUnityType) Activator.CreateInstance(typeof(TUnityType)); - } - - public VisualElement GetRootVisualElement() { - // TODO: Re-evaluate this - return null; // PanelRenderer.visualTree; - } - - public GUIManager GetGUIManager() { - throw new NotImplementedException(); - } - - public void EnqueueTaskForMainThread(Action task) { - int loopDelay = 100; // ms - MainThreadTasks.Enqueue(task); - while (MainThreadTasks.Contains(task)) - Thread.Sleep(loopDelay); - } - - public Coroutine StartCoroutine(IEnumerator routine) { - return Instance.StartCoroutine(routine); - } - - public void StopCoroutine(IEnumerator routine) { - Instance.StopCoroutine(routine); - } - } - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/ModuleLoader/Api.cs.meta b/engine/Assets/Scripts/ModuleLoader/Api.cs.meta deleted file mode 100644 index 5d78bd2573..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/Api.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: cf886d2cfef74fe8b73f811a185477b7 -timeCreated: 1589698225 \ No newline at end of file diff --git a/engine/Assets/Scripts/ModuleLoader/LoadModuleEvent.cs b/engine/Assets/Scripts/ModuleLoader/LoadModuleEvent.cs deleted file mode 100644 index cd21805bec..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/LoadModuleEvent.cs +++ /dev/null @@ -1,15 +0,0 @@ -using SynthesisAPI.EventBus; - -namespace Engine.ModuleLoader { - public class LoadModuleEvent : IEvent { - public LoadModuleEvent(string name, string version) { - Name = name; - Version = version; - } - - public readonly string Name; - public readonly string Version; - - public object[] GetArguments() => new object[] { Name, Version }; - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/ModuleLoader/LoadModuleEvent.cs.meta b/engine/Assets/Scripts/ModuleLoader/LoadModuleEvent.cs.meta deleted file mode 100644 index a96e594730..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/LoadModuleEvent.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: b7540889863b4140be0e7b97ba3f9e94 -timeCreated: 1594064344 \ No newline at end of file diff --git a/engine/Assets/Scripts/ModuleLoader/LoadModuleException.cs b/engine/Assets/Scripts/ModuleLoader/LoadModuleException.cs deleted file mode 100644 index f84bc84a15..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/LoadModuleException.cs +++ /dev/null @@ -1,12 +0,0 @@ -using SynthesisAPI.Utilities; -using System; - -namespace Engine.ModuleLoader { - public class LoadModuleException : SynthesisException { - public LoadModuleException() {} - - public LoadModuleException(string message) : base(message) {} - - public LoadModuleException(string message, Exception inner) : base(message, inner) {} - } -} diff --git a/engine/Assets/Scripts/ModuleLoader/LoadModuleException.cs.meta b/engine/Assets/Scripts/ModuleLoader/LoadModuleException.cs.meta deleted file mode 100644 index 8d4dbbde6a..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/LoadModuleException.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: e34f166b25229f74dade1235319a8b82 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/ModuleLoader/ModuleLoader.cs b/engine/Assets/Scripts/ModuleLoader/ModuleLoader.cs deleted file mode 100644 index c0416e558b..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/ModuleLoader.cs +++ /dev/null @@ -1,531 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.IO.Compression; -using System.Linq; -using System.Reflection; -using Assets.Scripts.Engine.Util; -using Ionic.Zip; -using SynthesisAPI.AssetManager; -using SynthesisAPI.EnvironmentManager; -using SynthesisAPI.EventBus; -using SynthesisAPI.Modules; -using SynthesisAPI.Modules.Attributes; -using SynthesisAPI.Utilities; -using SynthesisAPI.VirtualFileSystem; -using Logger = SynthesisAPI.Utilities.Logger; -using PreloadedModule = System.ValueTuple; - -using Directory = System.IO.Directory; -using Type = System.Type; -using ZipFile = Ionic.Zip.ZipFile; - -namespace Engine.ModuleLoader { - public static class ModuleLoader { - private static string _moduleSourcePath; - private static string _baseModuleTargetPath; - - public static void LoadModules(string moduleSourcePath, string baseModuleTargetPath) { - _moduleSourcePath = moduleSourcePath; - _baseModuleTargetPath = baseModuleTargetPath; - - if (!Directory.Exists(_moduleSourcePath)) { - Directory.CreateDirectory(_moduleSourcePath); - } - var modules = new List(); - try { - modules = PreloadModules(); - } catch (Exception e) { - Logger.Log($"Failed to preload modules\n{e}", LogLevel.Error); - } - try { - ResolveDependencies(modules); - } catch (Exception e) { - Logger.Log($"Failed to resolve module dependencies\n{e}", LogLevel.Error); - } - foreach (var (archive, metadata) in modules) { - try { - LoadModule((archive, metadata)); - - EventBus.Push(new LoadModuleEvent(metadata.Name, metadata.Version)); - ModuleManager.AddToLoadedModuleList(new ModuleManager.ModuleInfo( - metadata.Name, metadata.Version, metadata.Author, metadata.Description)); - } catch (Exception e) { - Logger.Log($"Failed to load module {metadata.Name}\n{e}", LogLevel.Error); - // TODO error screen - break; - } - } - foreach (var (archive, _) in modules) { - archive.Dispose(); - } - ModuleManager.MarkFinishedLoading(); - } - - private static List PreloadModules() { - var modules = new List(); - - // Discover and preload all modules - foreach (var file in Directory.GetFiles(_moduleSourcePath).Where(fn => Path.GetExtension(fn) == ".zip")) { - var module = PreloadModule(Path.GetFileName(file)); - if (module is null) - continue; - foreach (var (_, metadata) in modules) { - if (metadata.Name == module?.Item2.Name) { - foreach (var (archive, _) in modules) { - archive.Dispose(); - } - throw new LoadModuleException( - $"Attempting to load module with duplicate name: {metadata.Name}"); - } - if (metadata.TargetPath == module?.Item2.TargetPath) { - foreach (var (archive, _) in modules) { - archive.Dispose(); - } - throw new LoadModuleException( - $"Attempting to load modules into same target path: {metadata.TargetPath}"); - } - } - modules.Add(module.Value); - } - return modules; - } - - private static PreloadedModule? PreloadModule(string filePath) { - var fullPath = $"{_moduleSourcePath}{Path.DirectorySeparatorChar}{filePath}"; - - var module = ZipFile.Read(fullPath); - - if (module.Entries.All(e => e.FileName != ModuleMetadata.MetadataFilename)) { - Logger.Log($"Potential module missing is metadata file: {filePath}", LogLevel.Warning); - return null; - } - - // Parse module metadata - try { - var tmp = module.Entries.First(e => e.FileName == ModuleMetadata.MetadataFilename); - var metadata = ModuleMetadata.Deserialize( - module.Entries.First(e => e.FileName == ModuleMetadata.MetadataFilename).OpenReader()); - return (module, metadata); - } catch (Exception e) { - module.Dispose(); - throw new LoadModuleException($"Failed to deserialize metadata in module: {fullPath}", e); - } - } - - public static void ResolveDependencies(List<(ZipFile archive, ModuleMetadata metadata)> moduleList) { - foreach (var (_, metadata) in moduleList) { - foreach (var dependency in metadata.Dependencies) { - if (moduleList.All(m => m.metadata.Name != dependency.Name)) { - throw new LoadModuleException( - $"Module {metadata.Name} is missing dependency module {dependency.Name}"); - } - var present_dep = moduleList.First(m => m.metadata.Name == dependency.Name); - if (present_dep.metadata.Version != dependency.Version) { - throw new LoadModuleException( - $"Module {metadata.Name} requires dependency module {dependency.Name} version {dependency.Version} but its version is {present_dep.metadata.Version}"); - } - } - } - - // Use Kahns algorithm to resolve module dependencies, ordering modules in list - // in the order they should be loaded - - // TODO check for cyclic dependencies and throw - var resolvedEntries = moduleList.Where(t => !t.metadata.Dependencies.Any()).ToList(); - var solutionSet = new Queue<(ZipFile archive, ModuleMetadata metadata)>(); - while (resolvedEntries.Count > 0) { - var element = resolvedEntries.PopAt(0); - solutionSet.Enqueue(element); - foreach (var dep in moduleList - .Where(t => t.metadata.Dependencies.Any( - d => d.Name == element.metadata.Name && d.Version == element.metadata.Version)) - .ToList()) { - dep.metadata.Dependencies.RemoveAll( - d => d.Name == element.metadata.Name && d.Version == element.metadata.Version); - if (dep.metadata.Dependencies.Count == 0) - resolvedEntries.Add(dep); - } - } - - moduleList.Clear(); - moduleList.AddRange(solutionSet.ToList()); - } - - private static string GetPath(string fullName) { - var i = fullName.LastIndexOf(SynthesisAPI.VirtualFileSystem.Directory.DirectorySeparatorChar, - fullName.Length - 1, fullName.Length - 2); - if (i == -1 || i == (fullName.Length - 1)) { - return ""; - } - return fullName.Substring(0, i + 1); - } - - private static string RemovePath(string metadataPath, string fullName) { - if (fullName.StartsWith(metadataPath)) { - return fullName.Substring(metadataPath.Length); - } - return fullName; - } - - public static void LoadModule((ZipFile archive, ModuleMetadata metadata) moduleInfo) { - var fileManifest = new List(); - fileManifest.AddRange(moduleInfo.metadata.FileManifest); - - var metadataPath = - GetPath(moduleInfo.archive.Entries.First(e => e.FileName == ModuleMetadata.MetadataFilename).FileName); - - List<(Assembly assembly, string owningModule)> loadedAssemblies = - new List<(Assembly assembly, string owningModule)>(); - - foreach (var entry in moduleInfo.archive.Entries.Where(e => { - var name = RemovePath(metadataPath, e.FileName); - return name != ModuleMetadata.MetadataFilename && - moduleInfo.metadata.FileManifest.Contains(name); - })) { - fileManifest.Remove(RemovePath(metadataPath, entry.FileName)); - var extension = Path.GetExtension(entry.FileName); - var stream = entry.OpenReader(); - if (extension == ".dll") { - if (!LoadModuleAssembly(stream, moduleInfo.metadata.Name, loadedAssemblies)) { - throw new LoadModuleException($"Failed to load assembly: {entry.FileName}"); - } - } else { - var targetPath = _baseModuleTargetPath + - SynthesisAPI.VirtualFileSystem.Directory.DirectorySeparatorChar + - moduleInfo.metadata.TargetPath + - SynthesisAPI.VirtualFileSystem.Directory.DirectorySeparatorChar + - GetPath(RemovePath(metadataPath, entry.FileName)); - var perm = Permissions.PublicReadWrite; - var type = AssetManager.GetTypeFromFileExtension(extension); - if (type == null) { - throw new LoadModuleException( - $"Failed to determine asset type from file extension of asset: {entry.FileName}"); - } else if (AssetManager.Import(type, new DeflateStreamWrapper(stream, entry.UncompressedSize), - targetPath, entry.FileName, perm, "") == null) { - throw new LoadModuleException($"Failed to import asset: {entry.FileName}"); - } - } - } - ProcessLoadedAssemblies(loadedAssemblies); - foreach (var file in fileManifest) { - Logger.Log( - $"Module \"{moduleInfo.metadata.Name}\" is missing file from manifest: {file}", LogLevel.Warning); - } - } - - public static bool PreloadApi() { - // Set up Api - try { - var apiAssembly = AppDomain.CurrentDomain.GetAssemblies().First(a => a.GetName().Name == "Api"); - var types = - apiAssembly.GetTypes() - .Where( - t => t.GetCustomAttribute() == null && - (t.IsSubclassOf(typeof(SystemBase)) || - t.GetMethods().Any(m => m.GetCustomAttribute() != null || - m.GetCustomAttribute() != null))) - .ToList(); - var prioritizedTypes = ResolveInitializationOrder(types, "API"); - var instances = new Dictionary(); - foreach (var (_, system, callback) in prioritizedTypes) { - if (system != null) { - var entity = EnvironmentManager.AddEntity(); - _ = entity.AddComponent(system); - } else if (callback != null) { - object instance = null; - var declaringType = callback.DeclaringType; - if (instances.ContainsKey(declaringType)) { - instance = instances[declaringType]; - } else { - instance = Activator.CreateInstance(declaringType); - instances[declaringType] = instance; - } - - if (callback.GetCustomAttribute() != null) { - RegisterTagCallback(callback, instance); - } - - if (callback.GetCustomAttribute() != null) { - RegisterTypeCallback(callback, instance); - } - } else { - throw new LoadModuleException("Type prioritization failed"); - } - ModuleManager.RegisterModuleAssemblyName(apiAssembly.GetName().Name, "Api"); - } - } catch (Exception e) { - Logger.Log($"Failed to load API\n{e}", LogLevel.Error); - } - - return true; - } - - public static bool LoadModuleAssembly( - Stream stream, string owningModule, List<(Assembly assembly, string owningModule)> loadedAssemblies) { - // Load module assembly - var memStream = new MemoryStream(); - stream.CopyTo(memStream); - stream.Close(); - var assembly = Assembly.Load(memStream.ToArray()); - - loadedAssemblies.Add((assembly, owningModule)); - - // Set up module - Type[] types; - try { - types = assembly.GetTypes(); - } catch (ReflectionTypeLoadException e) { - if (e is ReflectionTypeLoadException reflectionTypeLoadException) { - foreach (var inner in reflectionTypeLoadException.LoaderExceptions) { - Logger.Log($"Loading module {owningModule} resulted in type errors\n{inner}", LogLevel.Error); - } - } - return false; - } catch (Exception e) { - Logger.Log($"Failed to get types from module {owningModule}\n{e}", LogLevel.Error); - return false; - } - - var exportedModuleClasses = - types - .Where(t => t.GetCustomAttribute() == null && - (t.IsSubclassOf(typeof(SystemBase)) || - t.GetMethods().Any(m => m.GetCustomAttribute() != null || - m.GetCustomAttribute() != null))) - .ToList(); - var prioritizedInitializations = ResolveInitializationOrder(exportedModuleClasses, owningModule); - var instances = new Dictionary(); - - foreach (var (initializer, system, callback) in prioritizedInitializations) { - try { - if (initializer != null) { - var init = initializer.GetMethod("Initialize"); - if (init != null) { - init.Invoke(null, null); - } else { - Logger.Log($"Initializer for module {owningModule} does not have a valid Initialize method", - LogLevel.Warning); - } - } else if (system != null) { - var entity = EnvironmentManager.AddEntity(); - instances[system] = entity.AddComponent(system); - } else { - object instance = null; - var declaringType = callback.DeclaringType; - if (instances.ContainsKey(declaringType)) { - instance = instances[declaringType]; - } else { - instance = Activator.CreateInstance(declaringType); - instances[declaringType] = instance; - } - - if (callback.GetCustomAttribute() != null) { - RegisterTagCallback(callback, instance); - } - - if (callback.GetCustomAttribute() != null) { - RegisterTypeCallback(callback, instance); - } - } - } catch (TypeLoadException e) { - var errorSource = system == null ? callback.DeclaringType : system; - Logger.Log( - $"Module loader failed to process type {errorSource} from module {owningModule}\nType: {e.TypeName}, Site: {e.TargetSite}\n{e}", - LogLevel.Error); - } catch (Exception e) { - var errorSource = system == null ? callback.DeclaringType : system; - Logger.Log($"Module loader failed to process type {errorSource} from module {owningModule}\n{e}", - LogLevel.Error); - // TODO unload assembly? return false? - continue; - } - } - - ModuleManager.RegisterModuleAssemblyName(assembly.GetName().Name, owningModule); - return true; - } - - private static bool ProcessLoadedAssemblies(List<(Assembly assembly, string owningModule)> assemblies) { - foreach (var loadedAssembly in assemblies) { - Type[] types; - try { - types = loadedAssembly.assembly.GetTypes(); - } catch (ReflectionTypeLoadException e) { - if (e is ReflectionTypeLoadException reflectionTypeLoadException) { - foreach (var inner in reflectionTypeLoadException.LoaderExceptions) { - Logger.Log($"Loading module {loadedAssembly.owningModule} resulted in type errors\n{inner}", - LogLevel.Error); - } - } - return false; - } catch (Exception e) { - Logger.Log($"Failed to get types from module {loadedAssembly.owningModule}\n{e}", LogLevel.Error); - return false; - } - - var exportedModuleClasses = - types - .Where( - t => t.GetCustomAttribute() == null && - (t.IsSubclassOf(typeof(SystemBase)) || - t.GetMethods().Any(m => m.GetCustomAttribute() != null || - m.GetCustomAttribute() != null))) - .ToList(); - var prioritizedInitializations = - ResolveInitializationOrder(exportedModuleClasses, loadedAssembly.owningModule); - var instances = new Dictionary(); - - foreach (var (initializer, system, callback) in prioritizedInitializations) { - try { - if (initializer != null) { - var init = initializer.GetMethod("Initialize"); - if (init != null) { - init.Invoke(null, null); - } else { - Logger.Log( - $"Initializer for module {loadedAssembly.owningModule} does not have a valid Initialize method", - LogLevel.Warning); - } - } else if (system != null) { - var entity = EnvironmentManager.AddEntity(); - instances[system] = entity.AddComponent(system); - } else { - object instance = null; - var declaringType = callback.DeclaringType; - if (instances.ContainsKey(declaringType)) { - instance = instances[declaringType]; - } else { - instance = Activator.CreateInstance(declaringType); - instances[declaringType] = instance; - } - - if (callback.GetCustomAttribute() != null) { - RegisterTagCallback(callback, instance); - } - - if (callback.GetCustomAttribute() != null) { - RegisterTypeCallback(callback, instance); - } - } - } catch (TypeLoadException e) { - var errorSource = system == null ? callback.DeclaringType : system; - Logger.Log( - $"Module loader failed to process type {errorSource} from module {loadedAssembly.owningModule}\nType: {e.TypeName}, Site: {e.TargetSite}\n{e}", - LogLevel.Error); - } catch (Exception e) { - var errorSource = system == null ? callback.DeclaringType : system; - Logger.Log( - $"Module loader failed to process type {errorSource} from module {loadedAssembly.owningModule}\n{e}", - LogLevel.Error); - // TODO unload assembly? return false? - continue; - } - } - - ModuleManager.RegisterModuleAssemblyName( - loadedAssembly.assembly.GetName().Name, loadedAssembly.owningModule); - } - return true; - } - - private static List<(Type initializer, Type system, MethodInfo callback)> ResolveInitializationOrder( - List types, string moduleName) { - var systems = types.Where(t => t.IsSubclassOf(typeof(SystemBase))).ToList(); - var callbacks = - types - .Where(t => !t.IsSubclassOf(typeof(SystemBase)) || - t.GetMethods().Any(m => m.GetCustomAttribute() != null || - m.GetCustomAttribute() != null)) - .SelectMany( - m => m.GetMethods().Where(m2 => m2.GetCustomAttribute() != null || - m2.GetCustomAttribute() != null)) - .ToList(); - var prioritizedSystems = systems.Where(t => t.GetCustomAttribute() != null) - .OrderBy(t => t.GetCustomAttribute().Value) - .ToList(); - var prioritizedCallbacks = - callbacks.Where(m => m.GetCustomAttribute() != null) - .OrderBy(m => m.GetCustomAttribute().Value) - .ToList(); - var prioritizedElements = new List<(Type, Type, MethodInfo)>(); - var systemIndex = 0; - var callbackIndex = 0; - - byte GetPriority(object o) { - if (o is Type t) - return t.GetCustomAttribute().Value; - else if (o is MethodInfo m) - return m.GetCustomAttribute().Value; - else - return 255; - } - - for (var i = 0; i < prioritizedSystems.Count + prioritizedCallbacks.Count; ++i) { - if (GetPriority(prioritizedSystems.ElementAtOrDefault(systemIndex)) - 1 <= - GetPriority(prioritizedCallbacks.ElementAtOrDefault(callbackIndex)) - 1) { - prioritizedElements.Add((null, prioritizedSystems.ElementAtOrDefault(systemIndex), null)); - ++systemIndex; - } else { - prioritizedElements.Add((null, null, prioritizedCallbacks.ElementAtOrDefault(callbackIndex))); - ++callbackIndex; - } - } - - foreach (var system in systems.Where( - t => t.GetCustomAttribute() == null)) { - prioritizedElements.Add((null, system, null)); - } - - foreach (var callback in callbacks.Where( - m => m.GetCustomAttribute() == null)) { - prioritizedElements.Add((null, null, callback)); - } - - var initClass = types.FirstOrDefault(t => t.Name == "ModuleInitializer"); - if (initClass != null) { - if (!(initClass.IsAbstract && initClass.IsSealed)) { - Logger.Log($"Initializer for module {moduleName} is not static. Please make this class static.", - LogLevel.Warning); - } else { - prioritizedElements.Insert(0, (initClass, null, null)); - } - } - - return prioritizedElements; - } - - private static void RegisterTagCallback(MethodInfo callback, object instance) { - if (instance.GetType() != callback.DeclaringType) // Sanity check - { - throw new LoadModuleException( - $"Type of instance variable \"{instance.GetType()}\" does not match declaring type of callback \"{callback.Name}\" (expected \"{callback.DeclaringType}\""); - } - var eventType = callback.GetParameters().First().ParameterType; - var tag = callback.GetCustomAttribute().Tag; - typeof(EventBus) - .GetMethod("NewTagListener") - ?.Invoke(null, new object[] { tag, CreateEventCallback(callback, instance, eventType) }); - } - - private static void RegisterTypeCallback(MethodInfo callback, object instance) { - if (instance.GetType() != callback.DeclaringType) // Sanity check - { - throw new LoadModuleException( - $"Type of instance variable \"{instance.GetType()}\" does not match declaring type of callback \"{callback.Name}\" (expected \"{callback.DeclaringType}\""); - } - var eventType = callback.GetParameters().First().ParameterType; - typeof(EventBus) - .GetMethod("NewTypeListener") - ?.MakeGenericMethod(eventType) - .Invoke(null, new object[] { CreateEventCallback(callback, instance, eventType) }); - } - - private static EventBus.EventCallback CreateEventCallback(MethodInfo m, object instance, Type eventType) { - return (e) => m.Invoke(instance, new[] { typeof(ReflectHelper) - .GetMethod("CastObject") - ?.MakeGenericMethod(eventType) - .Invoke(null, new object[] { e }) }); - } - } -} diff --git a/engine/Assets/Scripts/ModuleLoader/ModuleLoader.cs.meta b/engine/Assets/Scripts/ModuleLoader/ModuleLoader.cs.meta deleted file mode 100644 index ab447b8bf3..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/ModuleLoader.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 9591418330484a2f8aaee40a281c0ca3 -timeCreated: 1597119436 \ No newline at end of file diff --git a/engine/Assets/Scripts/ModuleLoader/ModuleMetadata.cs b/engine/Assets/Scripts/ModuleLoader/ModuleMetadata.cs deleted file mode 100644 index 7ee6e4457b..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/ModuleMetadata.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System.IO; -using System.Collections.Generic; -using System.Linq; -using System.Xml.Serialization; - -namespace Engine.ModuleLoader { - public class ModuleMetadata { - public class Dependency { - public string Name; - public string Version; - - public Dependency() {} - - public Dependency(string name, string version) { - Name = name; - Version = version; - } - } - - public ModuleMetadata() { - Dependencies = new List(); - FileManifest = new List(); - } - - public ModuleMetadata(string name, string version, string targetPath, - IEnumerable dependencies = null, IEnumerable manifest = null) { - Name = name; - Version = version; - TargetPath = targetPath; - Dependencies = dependencies?.ToList() ?? new List(); - FileManifest = manifest?.ToList() ?? new List(); - } - - public static string MetadataFilename = "metadata.xml"; - - public static ModuleMetadata Deserialize(Stream stream) { - return (ModuleMetadata) new XmlSerializer(typeof(ModuleMetadata)).Deserialize(new StreamReader(stream)); - } - - public void Serialize(Stream stream, bool keepPosition = true) { - var pos = stream.Position; - new XmlSerializer(typeof(ModuleMetadata)).Serialize(new StreamWriter(stream), this); - if (keepPosition) - stream.Position = pos; - } - - public override string ToString() { - var m = new MemoryStream(); - Serialize(m); - return new StreamReader(m).ReadToEnd(); - } - - public string Name { get; set; } - - public string Version { get; set; } - - public string TargetPath { get; set; } - public string Author { get; set; } - public string Description { get; set; } - - public List Dependencies { get; set; } - - public List FileManifest { get; set; } - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/ModuleLoader/ModuleMetadata.cs.meta b/engine/Assets/Scripts/ModuleLoader/ModuleMetadata.cs.meta deleted file mode 100644 index 236b0056ee..0000000000 --- a/engine/Assets/Scripts/ModuleLoader/ModuleMetadata.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 66aba47549334ac0a070194998f53a40 -timeCreated: 1593039159 \ No newline at end of file diff --git a/engine/Assets/Scripts/MouseTracker.cs b/engine/Assets/Scripts/MouseTracker.cs deleted file mode 100644 index dc697676aa..0000000000 --- a/engine/Assets/Scripts/MouseTracker.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using Synthesis.UI.ContextMenus; - -using ContextMenu = Synthesis.UI.ContextMenus.ContextMenu; - -public class MouseTracker : MonoBehaviour { - public RectTransform tracker; - - private void Update() { - var refResolution = ContextMenu.CanvasScaler.referenceResolution; - Vector2 mouse = new Vector2(Input.mousePosition.x, Input.mousePosition.y); - tracker.position = mouse; - } -} diff --git a/engine/Assets/Scripts/MouseTracker.cs.meta b/engine/Assets/Scripts/MouseTracker.cs.meta deleted file mode 100644 index d3e56d22da..0000000000 --- a/engine/Assets/Scripts/MouseTracker.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 989f65f06a22415bb8397a4f36362ccd -timeCreated: 1624312301 \ No newline at end of file diff --git a/engine/Assets/Scripts/Networking.meta b/engine/Assets/Scripts/Networking.meta deleted file mode 100644 index f385ae6357..0000000000 --- a/engine/Assets/Scripts/Networking.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 388cb3f7e4ca56740aed125d4d113733 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Physics.meta b/engine/Assets/Scripts/Physics.meta deleted file mode 100644 index 8248146262..0000000000 --- a/engine/Assets/Scripts/Physics.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: d3db2adbc44246738d23a29cb24cecfe -timeCreated: 1624312298 \ No newline at end of file diff --git a/engine/Assets/Scripts/Physics/CustomWheel.cs b/engine/Assets/Scripts/Physics/CustomWheel.cs deleted file mode 100644 index 0371edbbf4..0000000000 --- a/engine/Assets/Scripts/Physics/CustomWheel.cs +++ /dev/null @@ -1,205 +0,0 @@ -using System.Collections.Generic; -using Synthesis; -using UnityEngine; -using Synthesis.Util; - -public class CustomWheel : MonoBehaviour { - // When enabled, you get weird priority effects. Leave disabled for now. - public static bool UseKineticFriction = false; - - private Rigidbody _rb = null; - public Rigidbody Rb { - get { - if (_rb == null) { - _rb = GetComponent(); - } - return _rb; - } - } - - private const float ROLLER_FRICTION = 0.15f; - - public Vector3? LocalRollerRollingDirection = null; - private Vector3? RollerRollingDirection => - LocalRollerRollingDirection == null - ? null - : Rb.transform.localToWorldMatrix.MultiplyVector(LocalRollerRollingDirection.Value); - - public float ImpulseMax = 100f; - - public Vector3 LocalAxis; - private Vector3 Axis => Rb.transform.localToWorldMatrix.MultiplyVector(LocalAxis); - - public Vector3 LocalAnchor; - private Vector3 Anchor => Rb.transform.localToWorldMatrix.MultiplyPoint3x4(LocalAnchor); - - // Friction Constants - private const float SlidingStaticFriction = 1.3f; - private const float SlidingKineticFriction = 0.95f; - // Wheel States - public float RotationSpeed = 0f; // radians/second - public float Radius = 0.05f; // meters - - private float _startTime; - - public bool HasContacts => _collisionDataThisFrame.numCollisions > 0; - - public float Inertia => SynthesisUtil.GetInertiaFromAxisVector(Rb, LocalAxis); - - private Vector3 _lastImpulseTotal; - - public void OnDrawGizmos() { - Gizmos.color = Color.red; - Gizmos.DrawSphere(Anchor, 0.05f); - - Gizmos.color = Color.green; - Gizmos.DrawLine(Anchor, Anchor + Axis); - - Gizmos.color = Color.cyan; - Gizmos.DrawLine(Anchor, Anchor + _lastImpulseTotal); - - Gizmos.color = Color.blue; - Gizmos.DrawLine(Anchor, Anchor + (Axis * RotationSpeed)); - } - - /// - /// Calculates friction forces for the wheel and applies them. Should be run every FixedUpdate - /// - /// Modifier to account for janky Unity joints - public void CalculateAndApplyFriction(float mod) { - if (!HasContacts) - return; - - _lastImpulseTotal = CalculateNetFriction(); - - Rb.velocity += _lastImpulseTotal * mod; // / Rb.mass; - - // Update visual meshes - for (int i = 0; i < Rb.transform.childCount; i++) { - var child = Rb.transform.GetChild(i); - child.RotateAround(Anchor, Axis, -RotationSpeed * Time.fixedDeltaTime * Mathf.Rad2Deg); - } - } - - public void OnCollisionEnter(Collision collision) { - AddCollisionData(collision); - } - - public void OnCollisionStay(Collision collision) { - AddCollisionData(collision); - } - - public void AddCollisionData(Collision collision) { - Vector3 impulse = collision.impulse; - - // If impulse vector is suspected of being backwards (happens with mean machine), calculate it manually - if (impulse.normalized.y < 0.5) { - impulse = Vector3.zero; - collision.contacts.ForEach(contact => { - impulse += (Rb.worldCenterOfMass - contact.point).normalized * contact.impulse.magnitude; - }); - } - - _collisionDataThisFrame.impulse += impulse; - _collisionDataThisFrame.velocity += collision.relativeVelocity; - _collisionDataThisFrame.numCollisions++; - } - - private (Vector3 impulse, Vector3 velocity, int numCollisions) _collisionDataThisFrame; - - /// - /// Compiles contacts and calculates friction forces - /// - /// The net friction force acting on the wheel from collisions this frame - private Vector3 CalculateNetFriction() { - Vector3 netImpulse = _collisionDataThisFrame.impulse; - Vector3 netVelocity = _collisionDataThisFrame.velocity; - - netVelocity /= _collisionDataThisFrame.numCollisions; // The velocities are different and I don't know why - - netImpulse = ClampMag(netImpulse, 0, ImpulseMax); - - _collisionDataThisFrame = new(Vector3.zero, Vector3.zero, 0); - - var evaluatedFriction = - CalculateSlidingFriction(netImpulse, netVelocity) + CalculateRollingFriction(netImpulse, netVelocity); - - if (LocalRollerRollingDirection.HasValue) { - Vector3 rollerDir = RollerRollingDirection.Value; - var rollerVec = rollerDir * Vector3.Dot(rollerDir, evaluatedFriction); - var sansRoller = evaluatedFriction - rollerVec; - var rollerFriction = rollerDir * Vector3.Dot(rollerDir, netVelocity); - evaluatedFriction = sansRoller + rollerFriction * ROLLER_FRICTION; - } - - return evaluatedFriction; - } - - /// - /// Calculates friction forces parallel to the axis of rotation - /// - /// Impulse of the collision data - /// Relative velocity of the object to the contacted object - /// A vector for sliding friction between the wheel and the ground - private Vector3 CalculateSlidingFriction(Vector3 impulse, Vector3 velocity) { - var dirVelocity = Vector3.Dot(Axis, velocity); - var dirMomentum = dirVelocity * Rb.mass; - var staticImpulse = SlidingStaticFriction * impulse.magnitude; - - if (UseKineticFriction && dirMomentum > staticImpulse) { - var dynamicImpulse = - ClampMag((SlidingKineticFriction * impulse.magnitude * Axis) / Rb.mass, 0f, dirVelocity); - return dynamicImpulse; - } else { - var staticImpulseVec = dirVelocity * Axis; - return staticImpulseVec; - } - } - - /// - /// Calculates friction forces perpendicular to the axis of rotation - /// - /// Impulse of the collision data - /// Relative velocity of the object to the contacted object - /// A vector for rolling friction between the wheel and the ground - private Vector3 CalculateRollingFriction(Vector3 impulse, Vector3 velocity) { - var direction = Vector3.Cross(impulse.normalized, Axis).normalized; - var wheelSurfaceVelocity = Vector3.Cross(impulse.normalized * Radius, Axis * RotationSpeed); - var groundSurfaceVelocity = Vector3.Dot(direction, wheelSurfaceVelocity) + Vector3.Dot(-direction, velocity); - - Vector3 frictionImpulse; - - if (UseKineticFriction && - SlidingStaticFriction * impulse.magnitude < Mathf.Abs(groundSurfaceVelocity) * Rb.mass) { - frictionImpulse = ClampMag( - (SlidingKineticFriction * impulse.magnitude * -direction * Mathf.Sign(groundSurfaceVelocity)) / Rb.mass, - 0f, Mathf.Abs(groundSurfaceVelocity)); - } else { - frictionImpulse = groundSurfaceVelocity * -direction; - } - - return frictionImpulse; - } - - /// - /// Clamp function for the magnitude of a vector - /// - /// Vector to clamp - /// Minimum magnitude - /// Maximum magnitude - /// Clamped Vector - public static Vector3 ClampMag(Vector3 v, float min, float max) { - if (v.magnitude > max) - return v.normalized * max; - if (v.magnitude < min) - return v.normalized * min; - return v; - } - - /// - /// Utility function to print Vectors. Shows more detail than Vector.ToString(). - /// - /// Vector to print - /// Stringified vector - public static string Str(Vector3 v) => $"({v.x},{v.y},{v.z})"; -} diff --git a/engine/Assets/Scripts/Physics/CustomWheel.cs.meta b/engine/Assets/Scripts/Physics/CustomWheel.cs.meta deleted file mode 100644 index 97dc96d9fb..0000000000 --- a/engine/Assets/Scripts/Physics/CustomWheel.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 801e62f68b111e14292fbcca32eae80b -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Physics/PhysicsManager.cs b/engine/Assets/Scripts/Physics/PhysicsManager.cs deleted file mode 100644 index 56cfb3aa1c..0000000000 --- a/engine/Assets/Scripts/Physics/PhysicsManager.cs +++ /dev/null @@ -1,198 +0,0 @@ -using UnityEngine; -using System; -using System.Linq; -using System.Collections.Generic; -using SynthesisAPI.EventBus; -using Synthesis.Replay; -using Synthesis.Runtime; -using UnityEngine.UIElements; - -#nullable enable - -namespace Synthesis.Physics { - /// - /// Controls physics within unity - /// - public static class PhysicsManager { - private static Dictionary _physObjects = new Dictionary(); - private static Dictionary> _contactRecorders = - new Dictionary>(); - - private static Dictionary _storedValues = - new Dictionary(); - - private static bool _storeOnFreeze = true; - - private static bool _isFrozen; - private static int _frozenCounter; - public static bool IsFrozen { - get => _isFrozen; - set { - if (value) - ++_frozenCounter; - else - --_frozenCounter; - - if (_frozenCounter < 0) { - // My guy - _frozenCounter = 0; - } - - var shouldFreeze = _frozenCounter != 0; - if (shouldFreeze != _isFrozen) { - _isFrozen = shouldFreeze; - if (_isFrozen) { - _physObjects.ForEach(x => { - if (_storeOnFreeze) { - x.Value.GetAllRigidbodies().ForEach(rb => { - var data = new RigidbodyFrameData { Velocity = rb.velocity, - AngularVelocity = rb.angularVelocity }; - _storedValues[rb] = data; - }); - } - x.Value.Freeze(); - }); - SimulationRunner.RemoveContext(SimulationRunner.RUNNING_SIM_CONTEXT); - SimulationRunner.AddContext(SimulationRunner.PAUSED_SIM_CONTEXT); - } else { - _physObjects.ForEach(x => { - x.Value.Unfreeze(); - if (_storeOnFreeze) { - _storedValues.ForEach((rb, f) => { - try { - rb.velocity = f.Velocity; - rb.angularVelocity = f.AngularVelocity; - } catch (Exception e) { - // ignored - } - }); - } - - _storedValues.Clear(); - _storeOnFreeze = true; - }); - SimulationRunner.RemoveContext(SimulationRunner.PAUSED_SIM_CONTEXT); - SimulationRunner.AddContext(SimulationRunner.RUNNING_SIM_CONTEXT); - } - EventBus.Push(new PhysicsFreezeChangeEvent { IsFrozen = _isFrozen }); - } - } - } - - public static void SetFrozenCounter(int value) { - _frozenCounter = value; - } - - public static void FixedUpdate() { - RobotSimObject.SpawnedRobots.ForEach(x => { x.UpdateWheels(); }); - } - - public static bool Register(T overridable) - - where T : class, IPhysicsOverridable { - if (_physObjects.ContainsKey(overridable.GetHashCode())) - return false; - _physObjects[overridable.GetHashCode()] = overridable; - if (_isFrozen) - overridable.Freeze(); - else - overridable.Unfreeze(); - AddContactRecorders(overridable); - return true; - } - - public static void AddContactRecorders(T overridable) - - where T : class, IPhysicsOverridable { - List recorders = new List(); - _contactRecorders[overridable.GetHashCode()] = recorders; - } - - public static bool Unregister(T overridable) - - where T : class, IPhysicsOverridable { - if (!_physObjects.ContainsKey(overridable.GetHashCode())) - return false; - _physObjects.Remove(overridable.GetHashCode()); - return true; - } - - public static void DisableLoadFromStoredDataOnce() { - _storeOnFreeze = false; - _storedValues.Clear(); - } - - public static List GetAllOverridable() => new List( - _physObjects.Values); - - public static List? GetContactRecorders(T overridable) - - where T : class, IPhysicsOverridable { - if (!_contactRecorders.ContainsKey(overridable.GetHashCode())) - return null; - return _contactRecorders[overridable.GetHashCode()]; - } - - public static void Reset() { - _physObjects = new Dictionary(); - _contactRecorders = new Dictionary>(); - _frozenCounter = 0; - _isFrozen = false; - } - } - - public class ContactRecorder : MonoBehaviour { - public void OnCollisionEnter(Collision c) { - if (GetComponent().isKinematic && c.rigidbody.isKinematic) - return; - - ReplayManager.PushContactReport(new ContactReport(this, c)); - } - } - - // TODO: Setup for json serialization? - public struct ContactReport { - public float TimeStamp; - public string RigidbodyA; - public string RigidbodyB; - public Vector3 RelativeVelocity; - public Vector3 Impulse; - public Vector3 point; - public Vector3 normal; - public float seperation; - - public ContactReport(ContactRecorder r, Collision c) { - // TODO: In newer versions of Unity they change these name for some reason. Hi future developer - RigidbodyA = r.gameObject.name; - RigidbodyB = c.rigidbody == null ? string.Empty : c.rigidbody.name; - TimeStamp = Time.realtimeSinceStartup - ReplayManager.DesyncTime; - RelativeVelocity = c.relativeVelocity; - Impulse = c.impulse; - - // averages contact points - Vector3 averageContactPoint = Vector3.zero; - Vector3 averageNormal = Vector3.zero; - float averageSeperation = 0; - c.contacts.ForEach(x => { - averageContactPoint += x.point; - averageNormal += x.normal; - averageSeperation += x.separation; - }); - point = averageContactPoint / c.contactCount; - normal = Vector3.Normalize(averageNormal); - seperation = averageSeperation / c.contactCount; - } - } - - public class PhysicsFreezeChangeEvent : IEvent { - public bool IsFrozen; - } - - public interface IPhysicsOverridable { - public bool isFrozen(); - public void Freeze(); - public void Unfreeze(); - public List GetAllRigidbodies(); - public GameObject GetRootGameObject(); - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/Physics/PhysicsManager.cs.meta b/engine/Assets/Scripts/Physics/PhysicsManager.cs.meta deleted file mode 100644 index ee5b335728..0000000000 --- a/engine/Assets/Scripts/Physics/PhysicsManager.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 5943cae7cb1e14be3aabde9a7f991d45 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Physics/ReplayManager.cs b/engine/Assets/Scripts/Physics/ReplayManager.cs deleted file mode 100644 index 865803a670..0000000000 --- a/engine/Assets/Scripts/Physics/ReplayManager.cs +++ /dev/null @@ -1,295 +0,0 @@ -using System; -using System.Linq; -using System.Collections; -using System.Collections.Generic; -using Newtonsoft.Json; -using Synthesis.Physics; -using SynthesisAPI.EventBus; -using UnityEngine; - -#nullable enable - -namespace Synthesis.Replay { - public static class ReplayManager { - private static bool _isRecording = false; - public static bool IsRecording { - get => _isRecording; - set { _isRecording = value; } - } - // clang-format off - private static float _timeSpan = 5f; - public static float TimeSpan => _timeSpan; - private static ReplayFrame? _newestFrame = null; - public static ReplayFrame? NewestFrame => _newestFrame; - private static ReplayFrame? _oldestFrame = null; - public static ReplayFrame CurrentFrame = null!; - - private static float _desyncTime = 0; - public static float DesyncTime => _desyncTime; - // clang-format on - - private static Action? _createContactMarker; - public static Action? CreateContactMarker => _createContactMarker; - private static Action? _eraseContactMarkers; - public static Action? EraseContactMarkers => _eraseContactMarkers; - - private static SortedList _contactReports = new SortedList(); - - private static float _startDesync = float.NaN; - - public static void SetupDesyncTracker() { - EventBus.NewTypeListener(e => { - var pe = e as PhysicsFreezeChangeEvent; - - if (pe!.IsFrozen) { - _startDesync = Time.realtimeSinceStartup; - } else { - if (float.IsNaN(_startDesync)) - return; - _desyncTime += Time.realtimeSinceStartup - _startDesync; - _startDesync = float.NaN; - } - }); - } - - public static void SetupContactUI(Action create, Action erase) { - _createContactMarker = create; - _eraseContactMarkers = erase; - } - - public static void PushContactReport(ContactReport r) { - if (_contactReports.ContainsKey(r.TimeStamp)) - return; - _contactReports.Add(r.TimeStamp, r); - } - - public static void InvalidateRecording() { - _newestFrame = null; - _oldestFrame = null; - } - - /// - /// MARK: Bug in here I think - /// - public static void RecordFrame() { - if (!IsRecording || PhysicsManager.IsFrozen) - return; - - var newFrame = ReplayFrame.RecordFrame(); - if (_newestFrame == null) { - _newestFrame = newFrame; - _oldestFrame = newFrame; - } else { - newFrame.LastFrame = _newestFrame; - _newestFrame.NextFrame = newFrame; - _newestFrame = newFrame; - while (_newestFrame.TimeStamp - _oldestFrame?.TimeStamp > _timeSpan) { - _oldestFrame = _oldestFrame?.NextFrame; - _oldestFrame.LastFrame = null!; - // Debug.Log("Frame dropped"); - if (_oldestFrame == _newestFrame) - break; - } - } - - while ( - _contactReports.Count > 0 && - (Time.realtimeSinceStartup - _desyncTime) - _contactReports.ElementAt(0).Value.TimeStamp > _timeSpan) { - _contactReports.RemoveAt(0); - } - } - - /// - /// - /// - /// Use negative range to show relative to the latest frame - public static ReplayFrame? GetFrameAtTime(float t) { - if (_newestFrame == null) - return null; - - if (t > 0) { - throw new NotImplementedException(); - } else { - // Time relative to the latest frame - ReplayFrame? a = _newestFrame, b = null; - while (a.TimeStamp > _newestFrame.TimeStamp + t) { - if (a.LastFrame == null) { - break; - } - a = a.LastFrame; - } - if (a.NextFrame == null) - return a; - b = a.NextFrame; - return ReplayFrame.Lerp( - a, b, ((_newestFrame.TimeStamp + t) - a.TimeStamp) / (b.TimeStamp - a.TimeStamp)); - } - } - - public static void ShowContactsAtTime(float t, float giveOrTake = 0.25f, float impulseThreshold = 10f) { - if (_newestFrame == null || _contactReports.Count < 1 || CreateContactMarker == null || - EraseContactMarkers == null) - return; - - EraseContactMarkers(); - - var targetTimeStamp = t > 0 ? t : _newestFrame.TimeStamp + t; - - // locate closest index using binary search (NOTE FOR FUTURE DEVS: I was too lazy to google a binary search - // algo so I made this in like a minute) - int a = 0, b = _contactReports.Count - 1; - int index = (a + b) / 2; - while (a != b) { - var tmpIndex = (a + b) / 2; - if (tmpIndex == index) - break; - index = tmpIndex; - if (_contactReports.ElementAt(index).Value.TimeStamp > t) { - b = index; - } else if (_contactReports.ElementAt(index).Value.TimeStamp < t) { - a = index; - } else { - break; - } - } - - // Before Markers - int indexBefore = index; - while (indexBefore > -1) { - var dist = Math.Abs(_contactReports.ElementAt(indexBefore).Value.TimeStamp - targetTimeStamp); - if (dist >= giveOrTake) - break; - if (_contactReports.ElementAt(indexBefore).Value.Impulse.magnitude >= impulseThreshold) - CreateContactMarker(_contactReports.ElementAt(indexBefore).Value, (giveOrTake - dist) / giveOrTake); - indexBefore--; - } - int indexAfter = index + 1; - while (indexAfter < _contactReports.Count) { - var dist = Math.Abs(_contactReports.ElementAt(indexAfter).Value.TimeStamp - targetTimeStamp); - if (dist >= giveOrTake) - break; - if (_contactReports.ElementAt(indexAfter).Value.Impulse.magnitude >= impulseThreshold) - CreateContactMarker(_contactReports.ElementAt(indexAfter).Value, (giveOrTake - dist) / giveOrTake); - indexAfter++; - } - } - - public static void MakeCurrentNewestFrame() { - if (_newestFrame == null || CurrentFrame == null) - return; - - var originalNewestTimestamp = _newestFrame.TimeStamp; - - while (_newestFrame.TimeStamp > CurrentFrame.TimeStamp) { - if (_newestFrame == _oldestFrame) { - throw new Exception("Current Frame is too outdated"); - } - _newestFrame = _newestFrame.LastFrame; - } - - _desyncTime += originalNewestTimestamp - CurrentFrame.TimeStamp; - - while (_contactReports.Count > 0 && - _contactReports.ElementAt(_contactReports.Count - 1).Value.TimeStamp > CurrentFrame.TimeStamp) { - _contactReports.RemoveAt(_contactReports.Count - 1); - } - - _newestFrame.NextFrame = CurrentFrame; - CurrentFrame.LastFrame = _newestFrame; - CurrentFrame.NextFrame = null!; - _newestFrame = CurrentFrame; - - CurrentFrame = null!; - } - - public static void Teardown() { - _startDesync = float.NaN; - _desyncTime = 0; - InvalidateRecording(); - CurrentFrame = null!; - _isRecording = false; - } - } - - public class ReplayFrame { - public float TimeStamp; - public Dictionary RigidbodyData = - new Dictionary(); - - [JsonConstructor] - private ReplayFrame() {} - - /// - /// Record the current simulation into a Replay Frame - /// - /// - public static ReplayFrame RecordFrame() { - var frame = new ReplayFrame(); - frame.TimeStamp = Time.realtimeSinceStartup - ReplayManager.DesyncTime; - PhysicsManager.GetAllOverridable().ForEach(x => { - x.GetAllRigidbodies().ForEach(y => { - var data = new RigidbodyFrameData { Position = y.transform.position, - Rotation = y.transform.rotation, Velocity = y.velocity, AngularVelocity = y.angularVelocity }; - frame.RigidbodyData[y] = data; - }); - }); - return frame; - } - - [JsonIgnore] - public ReplayFrame NextFrame; - [JsonIgnore] - public ReplayFrame LastFrame; - - /// - /// Lerps between two frames - /// - /// From Frame - /// To Frame - /// t is between 0.0 to 1.0 - /// - public static ReplayFrame Lerp(ReplayFrame a, ReplayFrame b, float t) { - var c = new ReplayFrame(); - c.TimeStamp = Mathf.Lerp(a.TimeStamp, b.TimeStamp, t); - a.RigidbodyData.ForEach(x => { - if (b.RigidbodyData.ContainsKey(x.Key)) { - var data = new RigidbodyFrameData { Position = Vector3.Lerp( - x.Value.Position, b.RigidbodyData[x.Key].Position, t), - Rotation = Quaternion.Lerp(x.Value.Rotation, b.RigidbodyData[x.Key].Rotation, t), - Velocity = Vector3.Lerp(x.Value.Velocity, b.RigidbodyData[x.Key].Velocity, t), - AngularVelocity = - Vector3.Lerp(x.Value.AngularVelocity, b.RigidbodyData[x.Key].AngularVelocity, t) }; - c.RigidbodyData[x.Key] = data; - } - }); - return c; - } - - /// - /// Apply this frame to current simulation - /// - public void ApplyFrame() => ApplyFrame(this); - - /// - /// Apply a frame to the current simulation - /// - /// Frame to apply - public static void ApplyFrame(ReplayFrame a) { - a.RigidbodyData.ForEach(x => { - x.Key.transform.position = x.Value.Position; - x.Key.transform.rotation = x.Value.Rotation; - x.Key.velocity = x.Value.Velocity; - x.Key.angularVelocity = x.Value.AngularVelocity; - }); - ReplayManager.CurrentFrame = a; - } - } - - public struct RigidbodyFrameData { - public Vector3 Position; - public Quaternion Rotation; - public Vector3 Velocity; - public Vector3 AngularVelocity; - public List ContactReports; - } -} diff --git a/engine/Assets/Scripts/Physics/ReplayManager.cs.meta b/engine/Assets/Scripts/Physics/ReplayManager.cs.meta deleted file mode 100644 index e97d7602c5..0000000000 --- a/engine/Assets/Scripts/Physics/ReplayManager.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 5076bc515b3a77848879c9cdb60b04d5 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Physics/ReplayRunner.cs b/engine/Assets/Scripts/Physics/ReplayRunner.cs deleted file mode 100644 index 1a37cd7180..0000000000 --- a/engine/Assets/Scripts/Physics/ReplayRunner.cs +++ /dev/null @@ -1,119 +0,0 @@ -using System; -using System.Collections.Generic; -using Synthesis.Physics; -using Synthesis.PreferenceManager; -using Synthesis.Replay; -using Synthesis.Runtime; -using Synthesis.UI.Dynamic; -using SynthesisAPI.EventBus; -using SynthesisAPI.InputManager; -using SynthesisAPI.InputManager.InputEvents; -using SynthesisAPI.InputManager.Inputs; -using UnityEngine; - -public class ReplayRunner : MonoBehaviour { - public GameObject ContactMarker; - - public const string TOGGLE_PLAY = "input/toggle_play"; - - private void Start() { - ReplayManager.IsRecording = true; - DynamicUIManager.ReplaySlider.AddOnValueChangedEvent((s, val) => { - if (PhysicsManager.IsFrozen) { - var frame = ReplayManager.GetFrameAtTime(val); - frame?.ApplyFrame(); - ReplayManager.ShowContactsAtTime(val, 1.0f, 1.0f); - } - }); - DynamicUIManager.ReplaySlider.RootGameObject.SetActive(false); - - EventBus.NewTypeListener(PhysChange); - - Digital toggleReplayInput; - if (PreferenceManager.ContainsPreference(TOGGLE_PLAY)) { - toggleReplayInput = (Digital) PreferenceManager.GetPreference(TOGGLE_PLAY) [0].GetInput(); - toggleReplayInput.ContextBitmask = - SimulationRunner.RUNNING_SIM_CONTEXT | SimulationRunner.REPLAY_SIM_CONTEXT; - } else { - toggleReplayInput = new Digital(Enum.GetName(typeof(KeyCode), KeyCode.Tab), - context: SimulationRunner.RUNNING_SIM_CONTEXT | SimulationRunner.REPLAY_SIM_CONTEXT); - } - InputManager.UnassignDigitalInput(TOGGLE_PLAY); - InputManager.AssignDigitalInput(TOGGLE_PLAY, toggleReplayInput, TogglePlay); - - ReplayManager.SetupDesyncTracker(); - ReplayManager.SetupContactUI(CreateContactMarker, EraseContactMarkers); - } - - private List _contactMarkers = new List(); - - private void EraseContactMarkers() { - _contactMarkers.ForEach(x => Destroy(x)); - _contactMarkers.Clear(); - } - - private void CreateContactMarker(ContactReport report, float opacity = 1f) { - var marker = Instantiate(ContactMarker, report.point, Quaternion.identity); - var mat = marker.GetComponent(); - var color = mat.material.GetColor("TRANSPARENT_COLOR"); - color.a = opacity; - mat.material.SetColor("TRANSPARENT_COLOR", color); - _contactMarkers.Add(marker); - marker.AddComponent(); - } - - private void PhysChange(IEvent e) { - var physInfo = e as PhysicsFreezeChangeEvent; - } - - private void TogglePlay(IEvent e) { - var de = e as DigitalEvent; - if (de.State == DigitalState.Down) { - PhysicsManager.DisableLoadFromStoredDataOnce(); - PhysicsManager.IsFrozen = !PhysicsManager.IsFrozen; - if (PhysicsManager.IsFrozen) { - ReplayManager.NewestFrame.ApplyFrame(); - SimulationRunner.AddContext(SimulationRunner.REPLAY_SIM_CONTEXT); - DynamicUIManager.ReplaySlider.SetValue(0); - DynamicUIManager.ReplaySlider.RootGameObject.SetActive(true); - } else { - ReplayManager.CurrentFrame.ApplyFrame(); - ReplayManager.InvalidateRecording(); - SimulationRunner.RemoveContext(SimulationRunner.REPLAY_SIM_CONTEXT); - DynamicUIManager.ReplaySlider.RootGameObject.SetActive(false); - if (ReplayManager.EraseContactMarkers != null) - ReplayManager.EraseContactMarkers(); - ReplayManager.MakeCurrentNewestFrame(); - } - } - } - - private void FixedUpdate() { - if (!PhysicsManager.IsFrozen) - ReplayManager.RecordFrame(); - } -} - -public class ContactMarkerHandler : MonoBehaviour { - public const int LEFT_BOUNDS = 30; - public const int RIGHT_BOUNDS = 30; - public const int TOP_BOUNDS = 100; - public const int BOTTOM_BOUNDS = 150; - - private Renderer? _r; - - private void Start() { - _r = GetComponent(); - } - - private void FixedUpdate() { - var sp = Camera.main.WorldToScreenPoint(transform.position); - // Hate it but whatever - if (sp.x < LEFT_BOUNDS || sp.x > Screen.currentResolution.width - RIGHT_BOUNDS || sp.y < BOTTOM_BOUNDS || - sp.y > Screen.currentResolution.height - TOP_BOUNDS) { - _r!.enabled = false; - } else { - _r!.enabled = true; - } - } -} diff --git a/engine/Assets/Scripts/Physics/ReplayRunner.cs.meta b/engine/Assets/Scripts/Physics/ReplayRunner.cs.meta deleted file mode 100644 index 210c9b2331..0000000000 --- a/engine/Assets/Scripts/Physics/ReplayRunner.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: b742decb8161262409508c4c05c461ea -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/PreferenceManager.meta b/engine/Assets/Scripts/PreferenceManager.meta deleted file mode 100644 index 4bda9aa2f3..0000000000 --- a/engine/Assets/Scripts/PreferenceManager.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 6a429cc29b2a459b9ee219eac7b39c73 -timeCreated: 1624312288 \ No newline at end of file diff --git a/engine/Assets/Scripts/PreferenceManager/PreferenceManager.cs b/engine/Assets/Scripts/PreferenceManager/PreferenceManager.cs deleted file mode 100644 index c41ba41dc1..0000000000 --- a/engine/Assets/Scripts/PreferenceManager/PreferenceManager.cs +++ /dev/null @@ -1,94 +0,0 @@ -using System; -using System.Linq; -using System.Collections.Generic; -using System.IO; -using Newtonsoft.Json; -using SynthesisAPI.EventBus; -using SynthesisAPI.InputManager; -using UnityEngine; - -namespace Synthesis.PreferenceManager { - public static class PreferenceManager { - // Prevents Devs and Users from trying to load corruptted or no longer supported preference formats. - internal const string COHERENCE_ID = "ppqwokopqkwkshjhcwhuyre"; - - internal static PreferenceData _data; - public static bool UnsavedChanges { get; private set; } - // clang-format off - private static Dictionary _preferences = new Dictionary(); - public static bool AnyPrefs => _preferences.Keys.Count > 0; - // clang-format on - private static string FilePath = Path.Combine(FileSystem.FileSystem.Preferences, "preferences.json"); - - public static void Load() { - if (!File.Exists(FilePath)) - return; - - try { - string data = File.ReadAllText(FilePath); - _data = JsonConvert.DeserializeObject(data); - if (_data.CoherenceId != COHERENCE_ID) - return; - _preferences = _data.BulkData != null ? _data.BulkData : _preferences; - } catch (Exception) { - } - } - - public static void Save() { - EventBus.Push(new PrePreferenceSaveEvent()); - // TODO: Just save all inputs? - InputManager._mappedDigitalInputs.ForEach( - x => { SetPreference(x.Key, x.Value.Select(y => new InputData(y)).ToArray()); }); - if (UnsavedChanges) { - _data.BulkData = _preferences; - _data.CoherenceId = COHERENCE_ID; - File.WriteAllText(FilePath, JsonConvert.SerializeObject(_data)); - } - UnsavedChanges = false; - EventBus.Push(new PostPreferenceSaveEvent()); - } - - public static void SetPreferenceObject(string key, object value) { - _preferences[key] = value; - UnsavedChanges = true; - } - - public static void SetPreference(string key, T value) { - _preferences[key] = JsonConvert.SerializeObject(value); - UnsavedChanges = true; - } - - public static object GetPreferenceObject(string key) { - return ContainsPreference(key) ? _preferences[key] : null; - } - - public static T GetPreference(string key) { - if (ContainsPreference(key)) { - try { - return JsonConvert.DeserializeObject((string) _preferences[key]); - } catch { - Debug.Log("Cannot deserialize that type"); - } - } - return default; - } - - public static bool ContainsPreference(string key) { - return _preferences.ContainsKey(key); - } - - public static void ClearPreferences() { - _preferences.Clear(); - UnsavedChanges = true; - } - } - - public class PrePreferenceSaveEvent : IEvent {} - - public class PostPreferenceSaveEvent : IEvent {} - - internal struct PreferenceData { - public string CoherenceId; - public Dictionary BulkData; - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/PreferenceManager/PreferenceManager.cs.meta b/engine/Assets/Scripts/PreferenceManager/PreferenceManager.cs.meta deleted file mode 100644 index 023d9a92d9..0000000000 --- a/engine/Assets/Scripts/PreferenceManager/PreferenceManager.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: ae64c622254f04c91a7441ca05a71ef2 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/PreferenceManager/SimulationPreferences.cs b/engine/Assets/Scripts/PreferenceManager/SimulationPreferences.cs deleted file mode 100644 index 9be79140d4..0000000000 --- a/engine/Assets/Scripts/PreferenceManager/SimulationPreferences.cs +++ /dev/null @@ -1,430 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using Mirabuf; -using Newtonsoft.Json; -using Org.BouncyCastle.Asn1; -using SimObjects.MixAndMatch; -using Synthesis.Import; -using SynthesisAPI.EventBus; -using SynthesisAPI.InputManager.Inputs; -using SynthesisAPI.Utilities; -using UnityEngine; -using Synthesis.WS.Translation; -using UnityEngine.Windows; -using ITD = RobotSimObject.IntakeTriggerData; -using STD = RobotSimObject.ShotTrajectoryData; -using Input = UnityEngine.Input; - -#nullable enable - -namespace Synthesis.PreferenceManager { - // Funky inner setup so I can control the lifetime of the instance - public static class SimulationPreferences { - public const string ALL_ROBOT_DATA_KEY = "all_robot_data"; - public const string ALL_FIELD_DATA_KEY = "all_field_data"; - - // Why, again? - public static void DestroyInstance() { - _instance = null; - } - - public static void LoadRobotFromMira(MirabufLive live) => Instance.LoadRobotFromMira(live); - public static void LoadFieldFromMira(MirabufLive live) => Instance.LoadFieldFromMira(live); - - public static void LoadRobotFromMixAndMatch( - MixAndMatchRobotData robotData) => Instance.LoadRobotFromMixAndMatch(robotData); - - public static Analog GetRobotInput(string robot, string input) => Instance.GetRobotInput(robot, input); - - public static Dictionary GetRobotInputs(string robot) => Instance.GetRobotInputs(robot); - - public static JointMotor? GetRobotJointMotor(string robot, string motorKey) => Instance.GetRobotJointMotor( - robot, motorKey); - - public static float? GetRobotJointSpeed(string robot, string speedKey) => Instance.GetRobotJointSpeed( - robot, speedKey); - - public static ITD? GetRobotIntakeTriggerData(string robot) => Instance.GetRobotIntakeTriggerData(robot); - - public static STD? GetRobotTrajectoryData(string robot) => Instance.GetTrajectoryData(robot); - - public static RioTranslationLayer? GetRobotSimTranslationLayer(string robot) => Instance.GetSimTranslationLayer( - robot); - - public static (RobotSimObject.DrivetrainType drivetrain, bool foundDrivetrain) - GetRobotDrivetrain(string robot) => Instance.GetRobotDrivetrainType(robot); - - public static void SetRobotInput(string robot, string inputKey, Analog inputValue) { - Instance.SetRobotInput(robot, inputKey, inputValue); - } - - public static void SetRobotJointMotor(string robot, string motorKey, JointMotor motor) { - Instance.SetRobotJointMotor(robot, motorKey, motor); - } - - public static void SetRobotJointSpeed(string robot, string speedKey, float speed) { - Instance.SetRobotJointSpeed(robot, speedKey, speed); - } - - public static void SetRobotIntakeTriggerData(string robot, ITD? data) { - Instance.SetRobotIntakeTriggerData(robot, data); - } - - public static void SetRobotTrajectoryData(string robot, STD? data) { - Instance.SetRobotTrajectoryData(robot, data); - } - - public static void SetRobotSimTranslationLayer(string robot, RioTranslationLayer layer) { - Instance.SetRobotSimTranslationLayer(robot, layer); - } - - public static void SetRobotDrivetrainType(string robot, - RobotSimObject.DrivetrainType drivetrainType) => Instance.SetRobotDrivetrainType(robot, drivetrainType); - - public static IReadOnlyCollection? GetFieldScoringZones( - string field) => Instance.GetFieldScoringZones(field); - - public static void SetFieldScoringZones( - string field, List zones) => Instance.SetFieldScoringZones(field, zones); - - private class Inner { - public const string USER_DATA_KEY = "saved-data"; - - private readonly Dictionary _allRobotData; - private readonly Dictionary _allFieldData; - - public Inner() { - EventBus.NewTypeListener(PreSaveDump); - - if (!PreferenceManager.AnyPrefs) - PreferenceManager.Load(); // A way of making sure data is loaded first? - - if (PreferenceManager.ContainsPreference(ALL_ROBOT_DATA_KEY)) { - _allRobotData = PreferenceManager.GetPreference>(ALL_ROBOT_DATA_KEY); - } else { - _allRobotData = new Dictionary(); - PreferenceManager.SetPreference(ALL_ROBOT_DATA_KEY, _allRobotData); - } - - if (PreferenceManager.ContainsPreference(ALL_FIELD_DATA_KEY)) { - _allFieldData = PreferenceManager.GetPreference>(ALL_FIELD_DATA_KEY); - } else { - _allFieldData = new Dictionary(); - PreferenceManager.SetPreference(ALL_FIELD_DATA_KEY, _allFieldData); - } - } - - /// - /// Load all the necessary data into PreferenceManager before it is saved - /// - public void PreSaveDump(IEvent _) { - if (RobotSimObject.CurrentlyPossessedRobot != string.Empty) { - var robot = RobotSimObject.GetCurrentlyPossessedRobot()!; - - if (robot.IsMixAndMatch) { - var robotData = robot.MixAndMatchRobotData!; - robotData.RobotPreferencesJson = JsonConvert.SerializeObject(_allRobotData[robotData.Name]); - MixAndMatchSaveUtil.SaveRobotData(robotData); - } else { - var live = robot.MiraLiveFiles[0]; - live.MiraAssembly.Data.Parts.UserData ??= new UserData(); - live.MiraAssembly.Data.Parts.UserData.Data[USER_DATA_KEY] = - JsonConvert.SerializeObject(_allRobotData[live.MiraAssembly.Info.GUID]); - live.Save(); - } - } - - if (FieldSimObject.CurrentField != null) { - // clang-format off - var live = FieldSimObject.CurrentField.MiraLive; - live.MiraAssembly.Data.Parts.UserData ??= new Mirabuf.UserData(); - if (_allFieldData.ContainsKey(live.MiraAssembly.Info.GUID)) { - live.MiraAssembly.Data.Parts.UserData.Data[USER_DATA_KEY] = - JsonConvert.SerializeObject(_allFieldData[live.MiraAssembly.Info.GUID]); - } - live.Save(); - // clang-format on - } - } - - public void LoadRobotFromMira(MirabufLive live) { - if (live.MiraAssembly.Data.Parts.UserData != null && - live.MiraAssembly.Data.Parts.UserData.Data.ContainsKey(USER_DATA_KEY)) { - _allRobotData[live.MiraAssembly.Info.GUID] = JsonConvert.DeserializeObject( - live.MiraAssembly.Data.Parts.UserData.Data[USER_DATA_KEY])!; - } - } - - public void LoadRobotFromMixAndMatch(MixAndMatchRobotData robotData) { - if (robotData.RobotPreferencesJson != null) { - var robotPrefs = JsonConvert.DeserializeObject(robotData.RobotPreferencesJson); - if (robotPrefs != null) - _allRobotData[robotData.Name] = robotPrefs; - } - } - - public void LoadFieldFromMira(MirabufLive live) { - if (live.MiraAssembly.Data.Parts.UserData != null && - live.MiraAssembly.Data.Parts.UserData.Data.ContainsKey(USER_DATA_KEY)) { - _allFieldData[live.MiraAssembly.Info.GUID] = JsonConvert.DeserializeObject( - live.MiraAssembly.Data.Parts.UserData.Data[USER_DATA_KEY])!; - } - } - -#region Robot Data - -#region Getters - - public Analog GetRobotInput(string robot, string input) { - if (!_allRobotData.ContainsKey(robot)) - return null; - - var rData = _allRobotData[robot]; - if (!rData.InputData.ContainsKey(input)) - return null; - - return rData.InputData[input].GetInput(); - } - - public Dictionary GetRobotInputs(string robot) { - if (!_allRobotData.ContainsKey(robot)) - return null; - - var inputs = new Dictionary(); - var rData = _allRobotData[robot]; - rData.InputData.ForEach(x => inputs.Add(x.Key, x.Value.GetInput())); - return inputs; - } - - public JointMotor? GetRobotJointMotor(string robot, string motorKey) { - if (!_allRobotData.ContainsKey(robot)) - return null; - - var motors = _allRobotData[robot].JointMotors; - if (!motors.ContainsKey(motorKey)) - return null; - - return motors[motorKey]; - } - - public float? GetRobotJointSpeed(string robot, string speedKey) { - if (!_allRobotData.ContainsKey(robot)) - return null; - - var speeds = _allRobotData[robot].JointSpeeds; - if (!speeds.ContainsKey(speedKey)) - return null; - - return speeds[speedKey]; - } - - public ITD? GetRobotIntakeTriggerData(string robot) { - if (!_allRobotData.ContainsKey(robot)) - return null; - - return _allRobotData[robot].IntakeTrigger; - } - - public STD? GetTrajectoryData(string robot) { - if (!_allRobotData.ContainsKey(robot)) - return null; - - return _allRobotData[robot].TrajectoryPointer; - } - - public RioTranslationLayer? GetSimTranslationLayer(string robot) { - if (!_allRobotData.ContainsKey(robot)) - return null; - - return _allRobotData[robot].SimTranslationLayer; - } - - public (RobotSimObject.DrivetrainType drivetrain, bool foundDrivetrain) - GetRobotDrivetrainType(string robot) { - if (!_allRobotData.ContainsKey(robot)) - return (RobotSimObject.DrivetrainType.ARCADE, false); - - var drivetrain = _allRobotData[robot].DrivetrainType; - - return drivetrain == null ? (RobotSimObject.DrivetrainType.ARCADE, false) : (drivetrain.Value, true); - } - -#endregion - -#region Setters - - public void SetRobotInput(string robot, string inputKey, Analog inputValue) { - if (!_allRobotData.ContainsKey(robot)) - _allRobotData[robot] = new RobotData(robot); - var rData = _allRobotData[robot]; - rData.InputData[inputKey] = new InputData(inputValue); - } - - public void SetRobotJointMotor(string robot, string motorKey, JointMotor m) { - if (!_allRobotData.ContainsKey(robot)) - _allRobotData[robot] = new RobotData(robot); - var rData = _allRobotData[robot]; - rData.JointMotors[motorKey] = m; - } - - public void SetRobotJointSpeed(string robot, string speedKey, float speed) { - if (!_allRobotData.ContainsKey(robot)) - _allRobotData[robot] = new RobotData(robot); - var rData = _allRobotData[robot]; - rData.JointSpeeds[speedKey] = speed; - } - - public void SetRobotIntakeTriggerData(string robot, ITD? data) { - if (!_allRobotData.ContainsKey(robot)) - _allRobotData[robot] = new RobotData(robot); - _allRobotData[robot].IntakeTrigger = data; - } - - public void SetRobotTrajectoryData(string robot, STD? data) { - if (!_allRobotData.ContainsKey(robot)) - _allRobotData[robot] = new RobotData(robot); - _allRobotData[robot].TrajectoryPointer = data; - } - - public void SetRobotSimTranslationLayer(string robot, RioTranslationLayer layer) { - if (!_allRobotData.ContainsKey(robot)) - _allRobotData[robot] = new RobotData(robot); - _allRobotData[robot].SimTranslationLayer = layer; - } - - public void SetRobotDrivetrainType(string robot, RobotSimObject.DrivetrainType drivetrainType) { - if (!_allRobotData.ContainsKey(robot)) - _allRobotData[robot] = new RobotData(robot); - _allRobotData[robot].DrivetrainType = drivetrainType; - } - -#endregion - -#endregion - -#region Field Data - -#region Getters - - public IReadOnlyCollection? GetFieldScoringZones(string field) { - if (!_allFieldData.ContainsKey(field)) - return null; - - return _allFieldData[field].ScoringZones.AsReadOnly(); - } - -#endregion - -#region Setters - - public void SetFieldScoringZones(string field, List zones) { - _allFieldData.TryGetValue(field, out var data); - data ??= new FieldData(field); - data.ScoringZones.Clear(); - data.ScoringZones.AddRange(zones); - _allFieldData[field] = data; - } - -#endregion - -#endregion - } - - private static Inner _instance; - private static Inner Instance { - get { - if (_instance == null) { - _instance = new Inner(); - } - return _instance; - } - } - } - - [JsonObject(MemberSerialization.OptIn)] - public class RobotData { - [JsonConstructor] - public RobotData() { - AssemblyGuid = string.Empty; - InputData = new Dictionary(); - JointMotors = new Dictionary(); - JointSpeeds = new Dictionary(); - } - - public RobotData(string guid) { - AssemblyGuid = guid; - InputData = new Dictionary(); - JointMotors = new Dictionary(); - JointSpeeds = new Dictionary(); - } - - [JsonProperty] - public string AssemblyGuid; - [JsonProperty] - public Dictionary InputData; - [JsonProperty] - public Dictionary JointMotors; - [JsonProperty] - public Dictionary JointSpeeds; - [JsonProperty] - public ITD? IntakeTrigger; - [JsonProperty] - public STD? TrajectoryPointer; - [JsonProperty] - public RioTranslationLayer? SimTranslationLayer; - [JsonProperty] - public RobotSimObject.DrivetrainType? DrivetrainType; - } - - [JsonObject(MemberSerialization.OptIn)] - public class FieldData { - [JsonConstructor] - public FieldData() { - AssemblyGuid = string.Empty; - ScoringZones = new List(); - } - - public FieldData(string guid) { - AssemblyGuid = guid; - ScoringZones = new List(); - } - - [JsonProperty] - public string AssemblyGuid; - [JsonProperty] - public List ScoringZones; - } - - [JsonObject(MemberSerialization.OptIn)] - public class InputData { - [JsonProperty] - public Type Type; - [JsonProperty] - public string Data; - - [JsonConstructor] - public InputData() {} - - public InputData(Analog input) { - this.Type = input.GetType(); - Data = JsonConvert.SerializeObject(input); - } - - private static MethodInfo _deserializeMethod; - private static MethodInfo DeserializeMethod { - get { - if (_deserializeMethod == null) - _deserializeMethod = typeof(JsonConvert) - .GetMethods() - .First(y => y.IsGenericMethod && y.Name.Equals("DeserializeObject")); - return _deserializeMethod; - } - } - - public Analog GetInput() => (Analog) DeserializeMethod.MakeGenericMethod(this.Type).Invoke( - null, new string[] { Data }); - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/PreferenceManager/SimulationPreferences.cs.meta b/engine/Assets/Scripts/PreferenceManager/SimulationPreferences.cs.meta deleted file mode 100644 index ebe4952a62..0000000000 --- a/engine/Assets/Scripts/PreferenceManager/SimulationPreferences.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 011717c3c51cc1c4a95aa64e9bc212eb -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Scoring.meta b/engine/Assets/Scripts/Scoring.meta deleted file mode 100644 index cbfaa68f32..0000000000 --- a/engine/Assets/Scripts/Scoring.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: ed693abaa5bc40ebaf0414b89c9a03cf -timeCreated: 1655488794 \ No newline at end of file diff --git a/engine/Assets/Scripts/Scoring/Scoring.cs b/engine/Assets/Scripts/Scoring/Scoring.cs deleted file mode 100644 index 146b3b246d..0000000000 --- a/engine/Assets/Scripts/Scoring/Scoring.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.Collections.Generic; -using UnityEngine; - -public static class Scoring { - public static int redScore = 0; - public static int blueScore = 0; - - public static void ResetScore() { - redScore = 0; - blueScore = 0; - } - - public static List CreatePowerupScoreZones() { - List gameObjects = new List(); - gameObjects.Add(CreateRectangularScorezone( - new Vector3(0, 1.8f, -1.83f), new Vector3(1, 0.5f, 0.7f), new Vector3(0, 0, 0), Alliance.Red)); - gameObjects.Add(CreateRectangularScorezone( - new Vector3(0, 1.8f, 1.83f), new Vector3(1, 0.5f, 0.7f), new Vector3(0, 0, 0), Alliance.Blue)); - return gameObjects; - } - - private static GameObject CreateRectangularScorezone( - Vector3 position, Vector3 scale, Vector3 rotation, Alliance color) { - GameObject zone = GameObject.CreatePrimitive(PrimitiveType.Cube); - zone.transform.position = position; - zone.transform.localScale = scale; - zone.transform.eulerAngles = rotation; - zone.GetComponent().isTrigger = true; - zone.GetComponent().enabled = false; - zone.tag = color == Alliance.Red ? "red zone" : "blue zone"; - - return zone; - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/Scoring/Scoring.cs.meta b/engine/Assets/Scripts/Scoring/Scoring.cs.meta deleted file mode 100644 index f05233d3da..0000000000 --- a/engine/Assets/Scripts/Scoring/Scoring.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 6fe68d094969f0a489889a0dd4e9d3c8 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Scoring/ScoringZone.cs b/engine/Assets/Scripts/Scoring/ScoringZone.cs deleted file mode 100644 index cf25c9ffbc..0000000000 --- a/engine/Assets/Scripts/Scoring/ScoringZone.cs +++ /dev/null @@ -1,204 +0,0 @@ -using System.Collections.Generic; -using System.Security.Policy; -using Mirabuf.Material; -using Synthesis.Physics; -using Synthesis.PreferenceManager; -using Synthesis.Runtime; -using Synthesis.UI; -using Synthesis.UI.Dynamic; -using SynthesisAPI.EventBus; -using UnityEngine; -using Utilities.ColorManager; - -public enum Alliance { - Red, - Blue -} - -public class ScoringZone : IPhysicsOverridable { - private ScoringZoneData _zoneData; - public ScoringZoneData ZoneData { - get => _zoneData; - set { - _zoneData = value; - GameObject.name = _zoneData.Name; - GameObject.tag = _zoneData.Alliance == Alliance.Red ? "red zone" : "blue zone"; - GameObject.transform.parent = - FieldSimObject.CurrentField.FieldObject.transform.Find(_zoneData.Parent ?? "grounded") ?? - FieldSimObject.CurrentField.FieldObject.transform.Find("grounded"); - Alliance = _zoneData.Alliance; - GameObject.transform.localPosition = - new Vector3(_zoneData.LocalPosition.x, _zoneData.LocalPosition.y, _zoneData.LocalPosition.z); - GameObject.transform.localRotation = new Quaternion(_zoneData.LocalRotation.x, _zoneData.LocalRotation.y, - _zoneData.LocalRotation.z, _zoneData.LocalRotation.w); - GameObject.transform.localScale = - new Vector3(_zoneData.LocalScale.x, _zoneData.LocalScale.y, _zoneData.LocalScale.z); - } - } - - public Alliance Alliance { - get => _zoneData.Alliance; - set { - _zoneData.Alliance = value; - UpdateColor(); - } - } - - public string Name => _zoneData.Name; - - private int _visibilityCounter = 0; - public int VisibilityCounter { - get => _visibilityCounter; - set { - _visibilityCounter = value; - if (_visibilityCounter < 0) - throw new System.Exception("Not allowed to be negative"); - - if (_visibilityCounter == 0) { - SetVisibility(PreferenceManager.GetPreference(SettingsModal.RENDER_SCORE_ZONES)); - } else { - SetVisibility(true); - } - } - } - - public int Points => _zoneData.Points; - public bool DestroyGamepiece => _zoneData.DestroyGamepiece; - public bool PersistentPoints => _zoneData.PersistentPoints; - public GameObject GameObject; - private Collider _collider; - private MeshRenderer _meshRenderer; - - private bool _isFrozen; - - public ScoringZone(GameObject gameObject, string name, Alliance alliance, int points, bool destroyGamepiece, - bool persistentPoints) { - _zoneData = new() { Name = name, PersistentPoints = persistentPoints, DestroyGamepiece = destroyGamepiece, - Points = points }; - GameObject = gameObject; - GameObject.layer = 2; // ignore raycast layer - - // configure gameobject to have box collider as trigger - GameObject.name = name; - - ScoringZoneListener listener = GameObject.AddComponent(); - listener.ScoringZone = this; - - _collider = GameObject.GetComponent(); - _meshRenderer = GameObject.GetComponent(); - - _collider.isTrigger = true; - Alliance = alliance; - - PhysicsManager.Register(this); - UpdateColor(); - } - - public ScoringZone(ScoringZoneData data) { - GameObject = GameObject.CreatePrimitive(PrimitiveType.Cube); - GameObject.layer = 2; // ignore raycast layer - ScoringZoneListener listener = GameObject.AddComponent(); - listener.ScoringZone = this; - _collider = GameObject.GetComponent(); - _meshRenderer = GameObject.GetComponent(); - _collider.isTrigger = true; - ZoneData = data; - - PhysicsManager.Register(this); - } - - private void UpdateColor() { - Color color = - _zoneData.Alliance == Alliance.Red ? Color.HSVToRGB(1f, 0.83f, 0.93f) : Color.HSVToRGB(0.66f, 0.83f, 0.93f); - color.a = 0.8f; - Material mat = new Material(Appearance.DefaultTransparentShader); - mat.SetColor(Appearance.TRANSPARENT_COLOR, color); - mat.SetFloat(Appearance.TRANSPARENT_SMOOTHNESS, 0); - _meshRenderer.material = mat; - } - - private void SetVisibility(bool visible) { - if (_meshRenderer) { - _meshRenderer.enabled = visible; - } - } - - public bool isFrozen() => _isFrozen; - - public void Freeze() { - _isFrozen = true; - _collider.isTrigger = false; - } - - public void Unfreeze() { - _isFrozen = false; - _collider.isTrigger = true; - } - - public List GetAllRigidbodies() => new List {}; - public GameObject GetRootGameObject() => GameObject; -} - -public class ScoringZoneListener : MonoBehaviour { - public ScoringZone ScoringZone; - - private SortedDictionary _inScoringZone = new SortedDictionary(); - - private void OnTriggerEnter(Collider other) { - if (ScoringZone.isFrozen()) - return; - if (other.gameObject == gameObject) - return; - if (!other.transform.CompareTag("gamepiece")) - return; - if (_inScoringZone.ContainsKey(other.GetHashCode())) - return; - - // don't destroy gamepiece if user is moving the zone - if (SimulationRunner.HasContext(SimulationRunner.GIZMO_SIM_CONTEXT)) - return; - - // trigger scoring - EventBus.Push(new OnScoreUpdateEvent(other.name, ScoringZone)); - _inScoringZone.Add(other.GetHashCode(), other); - - if (ScoringZone.DestroyGamepiece) - Destroy(other.gameObject); - } - - private void OnTriggerExit(Collider other) { - if (ScoringZone.isFrozen()) - return; - if (other.gameObject == gameObject) - return; - if (!other.transform.CompareTag("gamepiece")) - return; - - if (_inScoringZone.ContainsKey(other.GetHashCode())) { - if (!ScoringZone.PersistentPoints) - EventBus.Push(new OnScoreUpdateEvent(other.name, ScoringZone, false)); - _inScoringZone.Remove(other.GetHashCode()); - } - } - - private void OnDestroy() { - PhysicsManager.Unregister(ScoringZone); - } -} - -public class OnScoreUpdateEvent : IEvent { - public string Name; - public ScoringZone Zone; - public bool IncreaseScore; - - /// - /// OnScoreEvent pushed when gamepiece collides with scoring zone - /// - /// Name of gamepiece object - /// Scoring Zone - public OnScoreUpdateEvent(string name, ScoringZone zone, bool increaseScore = true) { - Name = name; - Zone = zone; - IncreaseScore = increaseScore; - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/Scoring/ScoringZone.cs.meta b/engine/Assets/Scripts/Scoring/ScoringZone.cs.meta deleted file mode 100644 index d7c7dc5632..0000000000 --- a/engine/Assets/Scripts/Scoring/ScoringZone.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 767efa32ba834a2d85be1305cfbc27d1 -timeCreated: 1655488806 \ No newline at end of file diff --git a/engine/Assets/Scripts/Scoring/ShootableGamepiece.cs b/engine/Assets/Scripts/Scoring/ShootableGamepiece.cs deleted file mode 100644 index 5192e0b652..0000000000 --- a/engine/Assets/Scripts/Scoring/ShootableGamepiece.cs +++ /dev/null @@ -1,41 +0,0 @@ -using UnityEngine; - -public class ShootableGamepiece : MonoBehaviour { - public GamepieceSimObject SimObject; - private MeshRenderer _mesh; - private Rigidbody _rb; - private MeshCollider _collider; - - private bool _requireExit = false; - - void Start() { - _mesh = gameObject.GetComponentInChildren(); - _rb = gameObject.GetComponent(); - _collider = gameObject.GetComponentInChildren(); - } - - void Update() {} - - public void RequireExit() { - _requireExit = true; - } - - public bool currentlyHeld = false; - - private bool scored = false; - private int value = 1; // TEMPORARY VALUES - - private void OnTriggerStay(Collider collider) { - if (RobotSimObject.CurrentlyPossessedRobot == string.Empty) - return; - - if (collider.transform.CompareTag("robot") && RobotSimObject.GetCurrentlyPossessedRobot().PickingUpGamepieces) { - RobotSimObject.GetCurrentlyPossessedRobot().CollectGamepiece(SimObject); - } - } - - private void OnTriggerExit(Collider collider) { - if (collider.transform.CompareTag("robot")) - _requireExit = false; - } -} diff --git a/engine/Assets/Scripts/Scoring/ShootableGamepiece.cs.meta b/engine/Assets/Scripts/Scoring/ShootableGamepiece.cs.meta deleted file mode 100644 index 29da5949c5..0000000000 --- a/engine/Assets/Scripts/Scoring/ShootableGamepiece.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 5f983490816defa4ab56a612d73db550 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/SimObjects.meta b/engine/Assets/Scripts/SimObjects.meta deleted file mode 100644 index 65af8617dc..0000000000 --- a/engine/Assets/Scripts/SimObjects.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: c1a96a57b9a8698438d1d7f3a09e3754 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/SimObjects/FieldSimObject.cs b/engine/Assets/Scripts/SimObjects/FieldSimObject.cs deleted file mode 100644 index 512f58ecb8..0000000000 --- a/engine/Assets/Scripts/SimObjects/FieldSimObject.cs +++ /dev/null @@ -1,187 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using Analytics; -using MathNet.Numerics; -using Mirabuf; -using Synthesis.Gizmo; -using Synthesis.Import; -using Synthesis.Physics; -using Synthesis.PreferenceManager; -using Synthesis.UI; -using Synthesis.UI.Dynamic; -using SynthesisAPI.Controller; -using SynthesisAPI.Simulation; -using SynthesisAPI.Utilities; -using UnityEngine; -using Utilities.ColorManager; -using Bounds = UnityEngine.Bounds; -using Transform = Mirabuf.Transform; -using Vector3 = UnityEngine.Vector3; - -public class FieldSimObject : SimObject, IPhysicsOverridable { - public static FieldSimObject CurrentField { get; private set; } - - private readonly List _scoringZones; - public IReadOnlyCollection ScoringZones => _scoringZones.AsReadOnly(); - - public MirabufLive MiraLive { get; private set; } - public GameObject GroundedNode { get; private set; } - public GameObject FieldObject { get; private set; } - public Bounds FieldBounds { get; private set; } - public List Gamepieces { get; private set; } - - private Vector3 _initialPosition; - private Quaternion _initialRotation; - - private bool _isFrozen; - public bool isFrozen() => _isFrozen; - - public void Freeze() { - if (_isFrozen) - return; - FieldObject.GetComponentsInChildren() - .Where(e => e.name != "grounded") - .Concat( - Gamepieces.Where(e => !e.IsCurrentlyPossessed).Select(e => e.GamepieceObject.GetComponent())) - .ForEach(e => { - e.isKinematic = true; - e.detectCollisions = false; - }); - - _isFrozen = true; - } - - public void Unfreeze() { - if (!_isFrozen) - return; - - FieldObject.GetComponentsInChildren() - .Where(e => e.name != "grounded") - .Concat( - Gamepieces.Where(e => !e.IsCurrentlyPossessed).Select(e => e.GamepieceObject.GetComponent())) - .ForEach(e => { - e.isKinematic = false; - e.detectCollisions = true; - }); - - _isFrozen = false; - } - - public List - GetAllRigidbodies() => FieldObject.GetComponentsInChildren().Where(e => e.name != "grounded").ToList(); - - public GameObject GetRootGameObject() { - return FieldObject; - } - - public FieldSimObject(string name, ControllableState state, MirabufLive miraLive, GameObject groundedNode, - List gamepieces) - : base(name, state) { - MiraLive = miraLive; - GroundedNode = groundedNode; - // grounded node is what gets grabbed in god mode so it needs field tag to not get moved - GroundedNode.transform.tag = "field"; - FieldObject = groundedNode.transform.parent.gameObject; - FieldBounds = groundedNode.transform.GetBounds(); - Gamepieces = gamepieces; - SimulationPreferences.LoadFieldFromMira(MiraLive); - - _scoringZones = new List(); - - PhysicsManager.Register(this); - - // Level the field - FieldObject.transform.position = - new Vector3(-FieldBounds.center.x, FieldBounds.extents.y - FieldBounds.center.y, -FieldBounds.center.z); - - _initialPosition = FieldObject.transform.position; - - CurrentField = this; - Gamepieces.ForEach(gp => { - UnityEngine.Transform gpTransform = gp.GamepieceObject.transform; - gp.InitialPosition = gpTransform.position; - gp.InitialRotation = gpTransform.rotation; - }); - - SynthesisAPI.EventBus.EventBus.NewTypeListener(e => { - bool visible = PreferenceManager.GetPreference(SettingsModal.RENDER_SCORE_ZONES); - ScoringZones.ForEach(zone => zone.VisibilityCounter = zone.VisibilityCounter); - }); - - FieldObject.transform.GetComponentsInChildren().ForEach(x => { - var rc = x.gameObject.AddComponent(); - rc.Color = ColorManager.GetColor(ColorManager.SynthesisColor.HighlightSelect); - rc.enabled = false; - }); - } - - public bool RemoveScoringZone(ScoringZone zone) { - var res = _scoringZones.Remove(zone); - if (res) - UpdateSavedScoringZones(); - return res; - } - - public void AddScoringZone(ScoringZone zone) { - _scoringZones.Add(zone); - UpdateSavedScoringZones(); - } - - public void UpdateSavedScoringZones() { - SimulationPreferences.SetFieldScoringZones( - MiraLive.MiraAssembly.Info.GUID, _scoringZones.Select(x => x.ZoneData).ToList()); - PreferenceManager.Save(); - } - - public void InitializeScoreZones() { - _scoringZones.Clear(); - bool visible = PreferenceManager.GetPreference(SettingsModal.RENDER_SCORE_ZONES); - var scoringZones = SimulationPreferences.GetFieldScoringZones(MiraLive.MiraAssembly.Info.GUID); - if (scoringZones != null) { - scoringZones.ForEach(x => { - var zone = new ScoringZone( - GameObject.CreatePrimitive(PrimitiveType.Cube), "temp scoring zone", Alliance.Blue, 0, false, true); - zone.ZoneData = x; - zone.VisibilityCounter = zone.VisibilityCounter; - _scoringZones.Add(zone); - }); - } - } - - public static bool DeleteField() { - if (CurrentField == null) - return false; - - if (RobotSimObject.CurrentlyPossessedRobot != string.Empty) - RobotSimObject.GetCurrentlyPossessedRobot().ClearGamepieces(); - - CurrentField._scoringZones.Clear(); - CurrentField.Gamepieces.ForEach(x => x.DeleteGamepiece()); - CurrentField.Gamepieces.Clear(); - GameObject.Destroy(CurrentField.FieldObject); - SimulationManager.RemoveSimObject(CurrentField); - CurrentField = null; - return true; - } - - // TODO: Fix field spawning - public static void SpawnField(string filePath, bool spawnRobotGizmo = true) { - DeleteField(); - - var mira = Importer.ImportField(filePath); - mira.mainObject.transform.SetParent(GameObject.Find("Game").transform); - mira.mainObject.tag = "field"; - - FieldSimObject.CurrentField.InitializeScoreZones(); - - if (spawnRobotGizmo && RobotSimObject.CurrentlyPossessedRobot != string.Empty) { - GizmoManager.SpawnGizmo(RobotSimObject.GetCurrentlyPossessedRobot()); - // TODO: Move robot to default spawn location for field - } - } - - public override void Destroy() { - PhysicsManager.Unregister(this); - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/SimObjects/FieldSimObject.cs.meta b/engine/Assets/Scripts/SimObjects/FieldSimObject.cs.meta deleted file mode 100644 index c5e5195255..0000000000 --- a/engine/Assets/Scripts/SimObjects/FieldSimObject.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: c13385801107a0d4098e563702ffdc96 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/SimObjects/GamepieceSimObject.cs b/engine/Assets/Scripts/SimObjects/GamepieceSimObject.cs deleted file mode 100644 index eeed992f77..0000000000 --- a/engine/Assets/Scripts/SimObjects/GamepieceSimObject.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using SynthesisAPI.Controller; -using SynthesisAPI.Simulation; -using SynthesisAPI.Utilities; -using UnityEngine; - -using Bounds = UnityEngine.Bounds; - -public class GamepieceSimObject : SimObject { - private GameObject _gamepieceObject; - private Vector3 _initialPosition; - private Quaternion _initialRotation; - public GameObject GamepieceObject { get; private set; } - public Bounds GamepieceBounds { get; private set; } - public Vector3 InitialPosition { get; set; } - public Quaternion InitialRotation { get; set; } - public ShootableGamepiece Shootable { get; private set; } - public bool IsCurrentlyPossessed { get; internal set; } - - public GamepieceSimObject(string name, GameObject g) : base(name, new ControllableState()) { - GamepieceObject = g; - GamepieceBounds = GetBounds(GamepieceObject.transform); - InitialPosition = g.transform.position; - InitialRotation = g.transform.rotation; - - foreach (Transform t in g.GetComponentsInChildren()) { - t.tag = "gamepiece"; - } - - Shootable = GamepieceObject.AddComponent(); - Shootable.SimObject = this; - } - - private static Bounds GetBounds(Transform top) { - Vector3 min = new Vector3(float.MaxValue, float.MaxValue, float.MaxValue), - max = new Vector3(float.MinValue, float.MinValue, float.MinValue); - top.GetComponentsInChildren().ForEach(x => { - var b = x.bounds; - if (min.x > b.min.x) - min.x = b.min.x; - if (min.y > b.min.y) - min.y = b.min.y; - if (min.z > b.min.z) - min.z = b.min.z; - if (max.x < b.max.x) - max.x = b.max.x; - if (max.y < b.max.y) - max.y = b.max.y; - if (max.z < b.max.z) - max.z = b.max.z; - }); - return new Bounds(((max + min) / 2f) - top.position, max - min); - } - - public void DeleteGamepiece() { - GameObject.Destroy(_gamepieceObject); - SimulationManager.RemoveSimObject(this); - } - - public void Reset() { - GamepieceObject.transform.position = InitialPosition; - GamepieceObject.transform.rotation = InitialRotation; - } -} diff --git a/engine/Assets/Scripts/SimObjects/GamepieceSimObject.cs.meta b/engine/Assets/Scripts/SimObjects/GamepieceSimObject.cs.meta deleted file mode 100644 index 7a8807648f..0000000000 --- a/engine/Assets/Scripts/SimObjects/GamepieceSimObject.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: a9641576fdbc22041bd77d777623e0d5 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/SimObjects/MixAndMatch.meta b/engine/Assets/Scripts/SimObjects/MixAndMatch.meta deleted file mode 100644 index d7a1ab31db..0000000000 --- a/engine/Assets/Scripts/SimObjects/MixAndMatch.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 8b416053f3294df79f5250508a465921 -timeCreated: 1689107770 \ No newline at end of file diff --git a/engine/Assets/Scripts/SimObjects/MixAndMatch/MixAndMatchSaveData.cs b/engine/Assets/Scripts/SimObjects/MixAndMatch/MixAndMatchSaveData.cs deleted file mode 100644 index 2fe14a09f0..0000000000 --- a/engine/Assets/Scripts/SimObjects/MixAndMatch/MixAndMatchSaveData.cs +++ /dev/null @@ -1,286 +0,0 @@ -using System; -using System.IO; -using System.Linq; -using Newtonsoft.Json; -using UnityEngine; -using UnityEngine.Serialization; - -namespace SimObjects.MixAndMatch { - public static class MixAndMatchSaveUtil { - private static readonly char ALT_SEP = Path.AltDirectorySeparatorChar; - - public static readonly string PART_MIRABUF_FOLDER_PATH = - Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + ALT_SEP + "Autodesk" + ALT_SEP + - "Synthesis" + ALT_SEP + "MixAndMatch" + ALT_SEP + "Mira"; - - private static readonly string MIX_AND_MATCH_FOLDER_PATH = - Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + ALT_SEP + "Autodesk" + ALT_SEP + - "Synthesis" + ALT_SEP + "MixAndMatch"; - - private static readonly string PART_FOLDER_PATH = MIX_AND_MATCH_FOLDER_PATH + ALT_SEP + "Parts"; - private static readonly string ROBOT_FOLDER_PATH = MIX_AND_MATCH_FOLDER_PATH + ALT_SEP + "Robots"; - - /// An array of all part files found in the appdata folder - public static string[] PartFiles { - get { - if (!Directory.Exists(PART_FOLDER_PATH)) - Directory.CreateDirectory(PART_FOLDER_PATH); - return Directory.GetFiles(PART_FOLDER_PATH).Select(Path.GetFileNameWithoutExtension).ToArray(); - } - } - - /// An array of all robot files found in the appdata folder - public static string[] RobotFiles { - get { - if (!Directory.Exists(ROBOT_FOLDER_PATH)) - Directory.CreateDirectory(ROBOT_FOLDER_PATH); - return Directory.GetFiles(ROBOT_FOLDER_PATH).Select(Path.GetFileNameWithoutExtension).ToArray(); - } - } - - /// An array of all part mirabuf files found in the appdata folder - public static string[] PartMirabufFiles { - get { - if (!Directory.Exists(PART_MIRABUF_FOLDER_PATH)) - Directory.CreateDirectory(PART_MIRABUF_FOLDER_PATH); - return Directory.GetFiles(PART_MIRABUF_FOLDER_PATH) - .Where(x => Path.GetExtension(x).Equals(".mira")) - .ToArray(); - } - } - - /// Save a part to the appdata folder. Overrides an existing part with the same name - public static void SavePartData(GlobalPartData part) { - if (!Directory.Exists(PART_FOLDER_PATH)) { - Directory.CreateDirectory(PART_FOLDER_PATH); - } - - var filePath = Path.GetFullPath(PART_FOLDER_PATH) + ALT_SEP + part.Name + ".json"; - - File.WriteAllText(filePath, JsonUtility.ToJson(part)); - } - - /// Load a part from the appdata folder. If no found, a blank part with be created - public static GlobalPartData LoadPartData(string fileName, bool createNewIfNoExist = true) { - if (!Directory.Exists(PART_FOLDER_PATH)) { - Directory.CreateDirectory(PART_FOLDER_PATH); - } - - var filePath = Path.GetFullPath(PART_FOLDER_PATH) + ALT_SEP + fileName + ".json"; - - if (!File.Exists(filePath)) { - if (createNewIfNoExist) - return CreateNewPart(fileName); - return null; - } - - var part = JsonUtility.FromJson(File.ReadAllText(filePath)); - - if (part.Guid is null or "") - part.Guid = Guid.NewGuid().ToString(); - - return part; - } - - /// Save a robot to the appdata folder. Overrides an existing robot with the same name - public static void SaveRobotData(MixAndMatchRobotData robot) { - if (!Directory.Exists(ROBOT_FOLDER_PATH)) { - Directory.CreateDirectory(ROBOT_FOLDER_PATH); - } - - var filePath = Path.GetFullPath(ROBOT_FOLDER_PATH) + ALT_SEP + robot.Name + ".json"; - - File.WriteAllText(filePath, JsonUtility.ToJson(robot)); - } - - /// Load a robot from the appdata folder. If no found, a new robot with be created - public static MixAndMatchRobotData LoadRobotData(string fileName) { - if (!Directory.Exists(ROBOT_FOLDER_PATH)) { - Directory.CreateDirectory(ROBOT_FOLDER_PATH); - } - - var filePath = Path.GetFullPath(ROBOT_FOLDER_PATH) + ALT_SEP + fileName + ".json"; - - if (!File.Exists(filePath)) { - return CreateNewRobot(fileName); - } - - return JsonUtility.FromJson(File.ReadAllText(filePath)); - } - - /// Creates a new mix and match part with no connection points - public static GlobalPartData CreateNewPart(string name, string mirabufFile = "") { - return new GlobalPartData( - name, Guid.NewGuid().ToString(), mirabufFile, Array.Empty<(Vector3, Quaternion)>()); - } - - /// Creates a new mix and match robot with no parts - public static MixAndMatchRobotData CreateNewRobot(string name) { - return new MixAndMatchRobotData(name, Array.Empty()); - } - - /// Deletes the part if it exists - public static void DeletePart(string fileName) { - var filePath = Path.GetFullPath(PART_FOLDER_PATH) + ALT_SEP + fileName + ".json"; - if (File.Exists(filePath)) - File.Delete(filePath); - } - - /// Deletes the robot if it exists - public static void DeleteRobot(string fileName) { - var filePath = Path.GetFullPath(ROBOT_FOLDER_PATH) + ALT_SEP + fileName + ".json"; - if (File.Exists(filePath)) - File.Delete(filePath); - } - } - - /// Stores info about a robot including the positions of it's parts. Only ever saved in it's own json - /// file. - [Serializable] - public class MixAndMatchRobotData { - public string Name; - public LocalPartData[] PartTransformData; - - public string RobotPreferencesJson; - - [JsonIgnore] - private GlobalPartData[] _globalPartData; - - [JsonIgnore] - public GlobalPartData[] GlobalPartData { - get { - if (_globalPartData != null) - return _globalPartData; - - _globalPartData = - PartTransformData.Select(part => MixAndMatchSaveUtil.LoadPartData(part.FileName)).ToArray(); - - return _globalPartData; - } - } - - public MixAndMatchRobotData(string name, LocalPartData[] transforms) { - Name = name; - PartTransformData = transforms; - RobotPreferencesJson = ""; - } - - public int PartGuidToIndex(string partGuid) { - int index = 0; - - foreach (var part in GlobalPartData) { - if (partGuid == part.Guid) - return index; - - index++; - } - - return -1; - } - } - - /// Robot specific part data (position, parent node, etc) that is local to a single robot - [Serializable] - public class LocalPartData { - public string FileName; - public Vector3 LocalPosition; - public Quaternion LocalRotation; - public ParentNodeData ParentNodeData; - public RobotEditorPartInfo EditorPartInfo; - - public LocalPartData(string fileName, ParentNodeData parentNodeData, Vector3 position, Quaternion rotation, - RobotEditorPartInfo editorPartInfo) { - FileName = fileName; - ParentNodeData = parentNodeData; - LocalPosition = position; - LocalRotation = rotation; - EditorPartInfo = editorPartInfo; - } - - public (string name, ParentNodeData parentNodeData, Vector3 position, Quaternion rotation) ToTuple() { - return (FileName, ParentNodeData, LocalPosition, LocalRotation); - } - } - - /// Global data about a part that is shared with all robots that use it. - [Serializable] - public class GlobalPartData { - [JsonIgnore] - public string Name; // Ignored because it is the filename - public string Guid; - public string MirabufPartFile; - - [JsonIgnore] - private string _mirabufPartFilePath; - [JsonIgnore] - public string MirabufPartFilePath { - get { - if (_mirabufPartFilePath == null) { - _mirabufPartFilePath = - MixAndMatchSaveUtil.PART_MIRABUF_FOLDER_PATH + Path.AltDirectorySeparatorChar + MirabufPartFile; - if (!File.Exists(_mirabufPartFilePath)) { - _mirabufPartFilePath = MirabufPartFile; - if (!File.Exists(_mirabufPartFilePath)) { - throw new Exception($"Can't find mira file '{_mirabufPartFilePath}'."); - } - } - } - - return _mirabufPartFilePath; - } - } - - public ConnectionPointData[] ConnectionPoints; - - public GlobalPartData(string name, string guid, string mirabufPartFile, - (Vector3 position, Quaternion rotation)[] connectionPoints) { - Name = name; - MirabufPartFile = mirabufPartFile; - ConnectionPoints = connectionPoints.Select(c => new ConnectionPointData(c.position, c.rotation)).ToArray(); - Guid = guid; - } - } - - /// The position and direction of a part's connection point. Only ever saved in a part's json - /// file. - [Serializable] - public class ConnectionPointData { - public Vector3 LocalPosition; - public Quaternion LocalRotation; - - public ConnectionPointData(Vector3 localPosition, Quaternion localRotation) { - LocalPosition = localPosition; - LocalRotation = localRotation; - } - - public ConnectionPointData() { - LocalPosition = Vector3.zero; - LocalRotation = Quaternion.identity; - } - } - - /// Stores data about what a part is parented to. Only ever saved in a part's json file - [Serializable] - public class ParentNodeData { - public string PartGuid; - public string NodeName; - - public ParentNodeData(string partGuid, string nodeName) { - PartGuid = partGuid; - NodeName = nodeName; - } - } - - /// Info about how parts connect together used in the robot editor - [Serializable] - public class RobotEditorPartInfo { - [JsonIgnore] - public GameObject GameObject; - [FormerlySerializedAs("PartData")] - [JsonIgnore] - public GlobalPartData GlobalPartData; - - public float Rotation; - public int ConnectedPoint; - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/SimObjects/MixAndMatch/MixAndMatchSaveData.cs.meta b/engine/Assets/Scripts/SimObjects/MixAndMatch/MixAndMatchSaveData.cs.meta deleted file mode 100644 index 9a50bf1ee1..0000000000 --- a/engine/Assets/Scripts/SimObjects/MixAndMatch/MixAndMatchSaveData.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 81293b93b44a402b96700aa33cd0c035 -timeCreated: 1689616539 \ No newline at end of file diff --git a/engine/Assets/Scripts/SimObjects/RobotSimObject.cs b/engine/Assets/Scripts/SimObjects/RobotSimObject.cs deleted file mode 100644 index 608f55c913..0000000000 --- a/engine/Assets/Scripts/SimObjects/RobotSimObject.cs +++ /dev/null @@ -1,1066 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Runtime.InteropServices; -using System.Threading.Tasks; -using Analytics; -using Newtonsoft.Json; -using SimObjects.MixAndMatch; -using Synthesis; -using Synthesis.Gizmo; -using Synthesis.Import; -using Synthesis.Physics; -using Synthesis.PreferenceManager; -using Synthesis.Runtime; -using Synthesis.WS.Translation; -using SynthesisAPI.Aether.Lobby; -using SynthesisAPI.Controller; -using SynthesisAPI.EventBus; -using SynthesisAPI.InputManager; -using SynthesisAPI.InputManager.Inputs; -using SynthesisAPI.Simulation; -using SynthesisAPI.Utilities; -using UI.Dynamic.Panels.Tooltip; -using UnityEngine; -using Utilities.ColorManager; -using Bounds = UnityEngine.Bounds; -using Input = UnityEngine.Input; -using Logger = SynthesisAPI.Utilities.Logger; -using MVector3 = Mirabuf.Vector3; -using Object = UnityEngine.Object; - -#nullable enable - -public class RobotSimObject : SimObject, IPhysicsOverridable, IGizmo { - public const int MAX_ROBOTS = 6; - - private const string INTAKE_GAMEPIECES = "input/intake"; - private const string OUTTAKE_GAMEPIECES = "input/shoot-gamepiece"; - - private const float TIME_BETWEEN_SHOTS = 0.5f; - private float _lastShotTime; - - public static int ControllableJointCounter = 0; - - private OrbitCameraMode orbit; - private ICameraMode previousMode; - - private IEnumerable? _wheelDrivers; - public (RotationalDriver azimuth, WheelDriver driver)[] modules; - - public string RobotGUID { get; } - public MirabufLive[] MiraLiveFiles { get; } - public MixAndMatchRobotData? MixAndMatchRobotData { get; } - public GameObject GroundedNode { get; } - public Bounds GroundedBounds { get; } - public GameObject RobotNode { get; } - public Bounds RobotBounds { get; } - - private readonly List _allRigidbodies; - public IReadOnlyCollection AllRigidbodies => _allRigidbodies.AsReadOnly(); - - private readonly Dictionary _nodes = new(); - - public readonly bool IsMixAndMatch; - -#region Robot Possession - - private static string _currentlyPossessedRobot = string.Empty; - - public static string CurrentlyPossessedRobot { - get => _currentlyPossessedRobot; - set { - if (value == _currentlyPossessedRobot) - return; - - var old = _currentlyPossessedRobot; - - if (_currentlyPossessedRobot != string.Empty) - GetCurrentlyPossessedRobot()?.Unpossess(); - - _currentlyPossessedRobot = value; - - if (_currentlyPossessedRobot != string.Empty) - GetCurrentlyPossessedRobot()?.Possess(); - - EventBus.Push(new PossessionChangeEvent { NewBot = value, OldBot = old }); - } - } - - public static RobotSimObject? GetCurrentlyPossessedRobot() => _currentlyPossessedRobot == string.Empty - ? null - : _spawnedRobots[_currentlyPossessedRobot]; - - private static readonly Dictionary _spawnedRobots = new(); - public static Dictionary.ValueCollection SpawnedRobots => _spawnedRobots.Values; - -#endregion - -#region Multiplayer - - private static Dictionary _serverTransforms = new(); - - public static Dictionary ServerTransforms { - get => _serverTransforms; - set => _serverTransforms = value; - } - - private LobbyClient? _client; - - public LobbyClient? Client { - get => _client; - set => _client = value; - } - -#endregion - -#region Behaviours - - private WSSimBehavior _simBehaviour; - private RioTranslationLayer _simulationTranslationLayer; - - public RioTranslationLayer SimulationTranslationLayer { - get => _simulationTranslationLayer; - set { - _simulationTranslationLayer = value; - _simBehaviour.Translation = _simulationTranslationLayer; - - SimulationPreferences.SetRobotSimTranslationLayer(RobotGUID, _simulationTranslationLayer); - PreferenceManager.Save(); - } - } - - private bool _useSimBehaviour; - - public bool UseSimulationBehaviour { - get => _useSimBehaviour; - set { - if (_useSimBehaviour != value) { - _useSimBehaviour = value; - SimulationManager.Behaviours[_name].ForEach(b => { - // Kinda ugly but whatever - if (_useSimBehaviour ? b.GetType() != typeof(WSSimBehavior) : b.GetType() == typeof(WSSimBehavior)) - b.Enabled = false; - else - b.Enabled = true; - }); - } - } - } - - public SimBehaviour? DriveBehaviour { get; private set; } - - private readonly GameObject _intakeTrigger; - private IntakeTriggerData? _intakeData; - - public IntakeTriggerData? IntakeData { - get => _intakeData; - set { - _intakeData = value; - if (value.HasValue) { - _intakeTrigger.SetActive(true); - _intakeTrigger.transform.parent = RobotNode.transform.Find(_intakeData?.NodeName); - _intakeTrigger.transform.localPosition = _intakeData!.Value.RelativePosition.ToVector3(); - _intakeTrigger.GetComponent().radius = _intakeData.Value.TriggerSize * 0.5f; - } else { - _intakeTrigger.SetActive(false); - } - } - } - - private readonly GameObject _trajectoryPointer; - private ShotTrajectoryData? _trajectoryData; - - public ShotTrajectoryData? TrajectoryData { - get => _trajectoryData; - set { - _trajectoryData = value; - if (value.HasValue) { - _trajectoryPointer.transform.parent = RobotNode.transform.Find(_trajectoryData?.NodeName); - _trajectoryPointer.transform.localPosition = _trajectoryData!.Value.RelativePosition.ToVector3(); - _trajectoryPointer.transform.localRotation = _trajectoryData.Value.RelativeRotation.ToQuaternion(); - } - } - } - - private readonly Queue _gamepiecesInPossession = new(); - public bool PickingUpGamepieces { get; private set; } - - private DrivetrainType _drivetrainType; - - public DrivetrainType ConfiguredDrivetrainType { - get => _drivetrainType; - set { - _drivetrainType = value; - SimulationPreferences.SetRobotDrivetrainType(RobotGUID, value); - PreferenceManager.Save(); - ConfigureDrivetrain(); - } - } - - private (List leftWheels, List rightWheels)? _tankTrackWheels; - -#endregion - - public RobotSimObject(string name, ControllableState state, MirabufLive[] miraLiveFiles, GameObject groundedNode, - bool isMixAndMatch, MixAndMatchRobotData? robotData) - : base(name, state) { - RobotGUID = (isMixAndMatch) ? robotData!.Name : miraLiveFiles![0].MiraAssembly.Info.GUID; - - MiraLiveFiles = miraLiveFiles; - IsMixAndMatch = isMixAndMatch; - MixAndMatchRobotData = robotData; - - GroundedNode = groundedNode; - GroundedBounds = GetBounds(GroundedNode.transform); - - RobotNode = groundedNode.transform.parent.gameObject; - RobotBounds = GetBounds(RobotNode.transform); - - DebugJointAxes.DebugBounds.Add((GroundedBounds, () => GroundedNode.transform.localToWorldMatrix)); - - if (_spawnedRobots.ContainsKey(name)) { - Logger.Log($"Robot \"{name}\" already loaded!", LogLevel.Error); - throw new Exception($"Robot \"{name}\" already loaded!"); - } - - _spawnedRobots.Add(name, this); - - _allRigidbodies = new List(RobotNode.transform.GetComponentsInChildren()); - - foreach (Transform child in RobotNode.transform) { - _nodes.Add(child.name, child.gameObject); - } - - // tags every mesh collider component in the robot with a tag of robot - RobotNode.tag = "robot"; - RobotNode.GetComponentsInChildren().ForEach(g => g.tag = "robot"); - - // Highlight component MonoBehaviour for configuring intake/trajectory data - _allRigidbodies.ForEach(x => { - var rc = x.gameObject.AddComponent(); - rc.Color = ColorManager.GetColor(ColorManager.SynthesisColor.HighlightHover); - rc.enabled = false; - }); - - // Intake and outtake gameobjects - { - _intakeTrigger = new GameObject("INTAKE_TRIGGER") { - transform = {localPosition = Vector3.zero, localRotation = Quaternion.identity} - }; - - var intakeCollider = _intakeTrigger.AddComponent(); - - intakeCollider.isTrigger = true; - intakeCollider.tag = "robot"; - intakeCollider.transform.parent = GroundedNode.transform; - intakeCollider.radius = 0.01f; - - _trajectoryPointer = new GameObject("TRAJECTORY_POINTER") { - transform = {parent = GroundedNode.transform, position = Vector3.zero, rotation = Quaternion.identity} - }; - } - - // Robot Preferences - { - if (isMixAndMatch) - SimulationPreferences.LoadRobotFromMixAndMatch(robotData!); - else - SimulationPreferences.LoadRobotFromMira(MiraLiveFiles[0]); - - var _drivetrainInfo = SimulationPreferences.GetRobotDrivetrain(RobotGUID); - - // If no drivetrain is found in robot data, search all mira files for a drivetrain type - if (isMixAndMatch && !_drivetrainInfo.foundDrivetrain) { - foreach (var m in MiraLiveFiles) { - SimulationPreferences.LoadRobotFromMira(m); - var miraDrivetrain = SimulationPreferences.GetRobotDrivetrain(m.MiraAssembly.Info.GUID); - if (miraDrivetrain.foundDrivetrain) { - _drivetrainType = miraDrivetrain.drivetrain; - break; - } - } - } else - _drivetrainType = _drivetrainInfo.drivetrain; - - SimulationPreferences.SetRobotDrivetrainType(RobotGUID, _drivetrainType); - - IntakeData = SimulationPreferences.GetRobotIntakeTriggerData(RobotGUID); - SimulationPreferences.SetRobotIntakeTriggerData(RobotGUID, _intakeData); - - TrajectoryData = SimulationPreferences.GetRobotTrajectoryData(RobotGUID); - SimulationPreferences.SetRobotTrajectoryData(RobotGUID, _trajectoryData); - - PreferenceManager.Save(); - } - - _simulationTranslationLayer = - SimulationPreferences.GetRobotSimTranslationLayer(RobotGUID) ?? new RioTranslationLayer(); - - if (ModeManager.CurrentMode.GetType() == typeof(ServerTestMode)) { - Task.Factory.StartNew(() => Client = new LobbyClient("127.0.0.1", Name)); - } - - PhysicsManager.Register(this); - EventBus.Push(new RobotSpawnEvent { Bot = name }); - } - - public static void Setup() { - InputManager.AssignValueInput(INTAKE_GAMEPIECES, - TryGetSavedInput(INTAKE_GAMEPIECES, new Digital("E", context: SimulationRunner.RUNNING_SIM_CONTEXT))); - InputManager.AssignValueInput(OUTTAKE_GAMEPIECES, - TryGetSavedInput(OUTTAKE_GAMEPIECES, new Digital("Q", context: SimulationRunner.RUNNING_SIM_CONTEXT))); - - SimulationRunner.OnUpdate += () => { - if (CurrentlyPossessedRobot == string.Empty) { - return; - } - - bool pickup = InputManager.MappedValueInputs[INTAKE_GAMEPIECES].Value == 1.0F; - GetCurrentlyPossessedRobot().PickingUpGamepieces = pickup; - - bool shootGamepiece = InputManager.MappedValueInputs[OUTTAKE_GAMEPIECES].Value == 1.0F; - - if (shootGamepiece && - GetCurrentlyPossessedRobot()._lastShotTime + TIME_BETWEEN_SHOTS < Time.realtimeSinceStartup) { - GetCurrentlyPossessedRobot()._lastShotTime = Time.realtimeSinceStartup; - GetCurrentlyPossessedRobot().ShootGamepiece(); - } - }; - } - - private static Analog TryGetSavedInput(string key, Analog defaultInput) { - if (InputManager.MappedValueInputs.ContainsKey(key)) { - var input = InputManager.GetAnalog(key); - input.ContextBitmask = defaultInput.ContextBitmask; - return input; - } - if (PreferenceManager.ContainsPreference(key)) { - var input = PreferenceManager.GetPreference(key) ?? - (Digital) PreferenceManager.GetPreference(key) [0].GetInput(); - input.ContextBitmask = defaultInput.ContextBitmask; - return input; - } - return defaultInput; - } - - private void Possess() { - CurrentlyPossessedRobot = Name; - BehavioursEnabled = true; - OrbitCameraMode.FocusPoint = () => - GroundedNode != null && GroundedBounds != null - ? GroundedNode.transform.localToWorldMatrix.MultiplyPoint(GroundedBounds.center) - : Vector3.zero; - } - - private void Unpossess() { - GizmoManager.ExitGizmo(); - BehavioursEnabled = false; - Vector3 currentPoint = OrbitCameraMode.FocusPoint(); - OrbitCameraMode.FocusPoint = () => currentPoint; - } - - public override void Destroy() { - Client?.Dispose(); - Client = null; - ClearGamepieces(); - PhysicsManager.Unregister(this); - if (CurrentlyPossessedRobot.Equals(this._name)) { - CurrentlyPossessedRobot = string.Empty; - } - - Object.Destroy(GroundedNode.transform.parent.gameObject); - } - - public void ClearGamepieces() { - if (_gamepiecesInPossession.Count == 0) - return; - _trajectoryPointer.transform.GetChild(0).transform.parent = FieldSimObject.CurrentField.FieldObject.transform; - _gamepiecesInPossession.Clear(); - } - - public void CollectGamepiece(GamepieceSimObject gp) { - if (!_intakeData.HasValue || !_trajectoryData.HasValue) - return; - - if (_gamepiecesInPossession.Count >= _intakeData.Value.StorageCapacity) - return; - - var rb = gp.GamepieceObject.GetComponent(); - rb.detectCollisions = false; - rb.isKinematic = true; - gp.GamepieceObject.SetActive(false); - - _gamepiecesInPossession.Enqueue(gp); - - gp.IsCurrentlyPossessed = true; - if (_gamepiecesInPossession.Count == 1) - UpdateShownGamepiece(); - } - - private void ShootGamepiece() { - if (_gamepiecesInPossession.Count == 0) { - return; - } - - var gp = _gamepiecesInPossession.Dequeue(); - var rb = gp.GamepieceObject.GetComponent(); - rb.detectCollisions = true; - rb.isKinematic = false; - gp.GamepieceObject.transform.parent = FieldSimObject.CurrentField.FieldObject.transform; - rb.AddForce(_trajectoryPointer.transform.rotation * Vector3.forward * _trajectoryData.Value.EjectionSpeed, - ForceMode.VelocityChange); - gp.IsCurrentlyPossessed = false; - - UpdateShownGamepiece(); - } - - private void UpdateShownGamepiece() { - // Take the first gamepiece in the queue and display it at trajectory pointer - if (_gamepiecesInPossession.Count == 0) - return; - - if (_trajectoryPointer.transform.childCount > 0) - return; - - var gp = _gamepiecesInPossession.Peek(); - gp.GamepieceObject.SetActive(true); - gp.GamepieceObject.transform.parent = _trajectoryPointer.transform; - gp.GamepieceObject.transform.localRotation = Quaternion.identity; - gp.GamepieceObject.transform.localPosition = Vector3.zero; - gp.GamepieceObject.transform.localPosition -= gp.GamepieceBounds.center; - } - - public void UpdateWheels() { - if (_wheelDrivers == null) - return; - - // if (!DriversEnabled) return; - - int wheelsInContact = _wheelDrivers.Count(x => x.HasContacts); - float mod = wheelsInContact <= 3 ? 1f : Mathf.Pow(0.7f, wheelsInContact - 3); - - _wheelDrivers.ForEach(x => x.WheelsPhysicsUpdate(mod)); - } - - private static Bounds GetBounds(Transform top) { - Vector3 min = new Vector3(float.MaxValue, float.MaxValue, float.MaxValue), - max = new Vector3(float.MinValue, float.MinValue, float.MinValue); - top.GetComponentsInChildren().ForEach(x => { - var b = x.bounds; - if (min.x > b.min.x) - min.x = b.min.x; - if (min.y > b.min.y) - min.y = b.min.y; - if (min.z > b.min.z) - min.z = b.min.z; - if (max.x < b.max.x) - max.x = b.max.x; - if (max.y < b.max.y) - max.y = b.max.y; - if (max.z < b.max.z) - max.z = b.max.z; - }); - return new Bounds(((max + min) / 2f) - top.position, max - min); - } - - public (List leftWheels, List rightWheels)? GetLeftRightWheels() { - if (!_tankTrackWheels.HasValue) { - var wheels = SimulationManager.Drivers[base.Name].OfType(); - - var leftWheels = new List(); - var rightWheels = new List(); - - Dictionary wheelDotProducts = new Dictionary(); - foreach (var wheel in wheels) { - wheel.MainInput = 0f; - wheelDotProducts[wheel] = Vector3.Dot(Vector3.right, wheel.LocalAnchor); - } - - float min = float.MaxValue; - float max = float.MinValue; - wheelDotProducts.ForEach(x => { - if (x.Value < min) - min = x.Value; - if (x.Value > max) - max = x.Value; - }); - float mid = (min + max) / 2f; - wheelDotProducts.ForEach(x => { - if (x.Value > mid) - rightWheels.Add(x.Key); - else - leftWheels.Add(x.Key); - }); - - // Spin all of the wheels straight - wheels.ForEach(x => { - foreach (var miraLive in MiraLiveFiles) { - if (!miraLive.MiraAssembly.Data.Joints.JointDefinitions.TryGetValue( - x.JointInstance.JointReference, out var def)) - continue; - - var jointAxis = new Vector3(def.Rotational.RotationalFreedom.Axis.X, - def.Rotational.RotationalFreedom.Axis.Y, def.Rotational.RotationalFreedom.Axis.Z); - var globalAxis = GroundedNode.transform.rotation * jointAxis.normalized; - var cross = Vector3.Cross(GroundedNode.transform.up, globalAxis); - if (miraLive.MiraAssembly.Info.Version < 5) { - if (Vector3.Dot(GroundedNode.transform.forward, cross) > 0) { - var ogAxis = jointAxis; - - ogAxis.x *= -1; - ogAxis.y *= -1; - ogAxis.z *= -1; - // Modify assembly for if a new behaviour evaluates this again - // def.Rotational.RotationalFreedom.Axis = ogAxis; // I think this is irrelevant after the - // last few lines - def.Rotational.RotationalFreedom.Axis = - new MVector3() { X = jointAxis.x, Y = jointAxis.y, Z = jointAxis.z }; - - x.LocalAxis = ogAxis; - } - } else { - if (Vector3.Dot(GroundedNode.transform.forward, cross) < 0) { - jointAxis.x = -jointAxis.x; - var ogAxis = jointAxis; - ogAxis.x *= -1; - ogAxis.y *= -1; - ogAxis.z *= -1; - // Modify assembly for if a new behaviour evaluates this again - // def.Rotational.RotationalFreedom.Axis = ogAxis; // I think this is irrelevant after the - // last few lines - def.Rotational.RotationalFreedom.Axis = - new MVector3() { X = -jointAxis.x, Y = jointAxis.y, Z = jointAxis.z }; - - x.LocalAxis = ogAxis; - } - } - } - }); - - _tankTrackWheels = (leftWheels, rightWheels); - } - - return _tankTrackWheels; - } - - public void ConfigureDefaultBehaviours() { - if (_wheelDrivers == null) { - _wheelDrivers = SimulationManager.Drivers[base.Name].OfType(); - - var wheelDrivers = _wheelDrivers as WheelDriver[] ?? _wheelDrivers.ToArray(); - - if (wheelDrivers.Any()) { - wheelDrivers.ForEach(x => x.ImpulseMax = (GroundedNode.GetComponent().mass * - Physics.gravity.magnitude * (1f / 120f)) / - _wheelDrivers.Count()); - - float radius = wheelDrivers.Average(x => x.Radius); - wheelDrivers.ForEach(x => x.Radius = radius); - } - } - - ConfigureDrivetrain(); - ConfigureArmBehaviours(); - ConfigureSliderBehaviours(); - ConfigureTestSimulationBehaviours(); - _simBehaviour.Enabled = false; - } - - private void ConfigureDrivetrain() { - if (DriveBehaviour != null) { - SimulationManager.RemoveBehaviour(base.Name, DriveBehaviour); - DriveBehaviour = null; - } - - bool success = true; - - if (ConfiguredDrivetrainType.Value == DrivetrainType.ARCADE.Value) { - ConfigureArcadeDrivetrain(); - } else if (ConfiguredDrivetrainType.Value == DrivetrainType.TANK.Value) { - ConfigureTankDrivetrain(); - } else if (ConfiguredDrivetrainType.Value == DrivetrainType.SWERVE.Value) { - success = ConfigureSwerveDrivetrain(); - } else if (ConfiguredDrivetrainType.Value == DrivetrainType.MECANUM.Value) { - success = ConfigureMecanumDrivetrain(); - } else if (ConfiguredDrivetrainType.Value == DrivetrainType.OMNI.Value) { - ConfigureOmniDrivetrain(); - } - - if (!success) { - Logger.Log( - $"Failed to switch to '{ConfiguredDrivetrainType.Name}'. Please select another.", LogLevel.Error); - ConfiguredDrivetrainType = DrivetrainType.NONE; - } - } - - private void ConfigureTestSimulationBehaviours() { - _simBehaviour = new WSSimBehavior(Name, _simulationTranslationLayer); - SimulationManager.AddBehaviour(Name, _simBehaviour); - } - - // Account for passive joints - private void ConfigureArmBehaviours() { - SimulationManager.Drivers[Name].ForEach(x => { - if (x is RotationalDriver { IsReserved : false } driver) { - var genArmBehaviour = new GeneralArmBehaviour(Name, driver); - SimulationManager.AddBehaviour(Name, genArmBehaviour); - } - }); - } - - private void ConfigureSliderBehaviours() { - SimulationManager.Drivers[Name].ForEach(x => { - if (x is not LinearDriver linearDriver) - return; - - var behaviour = new GeneralSliderBehaviour(Name, linearDriver); - SimulationManager.AddBehaviour(Name, behaviour); - }); - } - - private void ConfigureArcadeDrivetrain() { - var wheels = GetLeftRightWheels(); - - var arcadeBehaviour = new ArcadeDriveBehaviour(Name, wheels!.Value.leftWheels, wheels!.Value.rightWheels); - DriveBehaviour = arcadeBehaviour; - - SimulationManager.AddBehaviour(Name, arcadeBehaviour); - } - - private void ConfigureTankDrivetrain() { - var wheels = GetLeftRightWheels(); - - var tankBehaviour = new TankDriveBehavior(Name, wheels!.Value.leftWheels, wheels!.Value.rightWheels); - DriveBehaviour = tankBehaviour; - - SimulationManager.AddBehaviour(Name, tankBehaviour); - } - - private bool ConfigureSwerveDrivetrain() { - // Sets wheels rotating forward - GetLeftRightWheels(); - - try { - List potentialAzimuthDrivers = - SimulationManager.Drivers[_name] - .OfType() - .Where(x => !x.IsWheel && - (x.Axis - Vector3.Dot(GroundedNode.transform.up, x.Axis) * GroundedNode.transform.up) - .magnitude < 0.05f) - .ToList(); - - var wheels = SimulationManager.Drivers[_name].OfType(); - - var wheelDrivers = wheels as WheelDriver[] ?? wheels.ToArray(); - - if (!potentialAzimuthDrivers.Any() || potentialAzimuthDrivers.Count() < wheelDrivers.Count()) - return false; - - modules = new(RotationalDriver azimuth, WheelDriver driver)[wheelDrivers.Count()]; - int i = 0; - wheelDrivers.ForEach(x => { - RotationalDriver closest = potentialAzimuthDrivers.First(); - float distance = float.MaxValue; - potentialAzimuthDrivers.ForEach( - y => closest = (y.Anchor - x.Anchor).magnitude < distance ? y : closest); - modules[i] = (closest, x); - potentialAzimuthDrivers.Remove(closest); - i++; - }); - - } catch (Exception _) { - return false; - } - - var swerveBehaviour = new SwerveDriveBehaviour(this, modules); - DriveBehaviour = swerveBehaviour; - - SimulationManager.AddBehaviour(Name, swerveBehaviour); - return true; - } - - private bool ConfigureMecanumDrivetrain() { - var wheels = GetLeftRightWheels(); - - if (!wheels.HasValue) { - return false; - } - - List frontLeft = new List(wheels.Value.leftWheels.Count); - List backLeft = new List(wheels.Value.leftWheels.Count); - List backRight = new List(wheels.Value.rightWheels.Count); - List frontRight = new List(wheels.Value.rightWheels.Count); - - // Using GroundedBounds instead of rigidbody because there is an issue with grabbing it too early - var comZ = GroundedBounds.center.z; - - foreach (var leftWheel in wheels.Value.leftWheels) { - if (GroundedNode.transform.worldToLocalMatrix.MultiplyPoint3x4(leftWheel.Anchor).z >= comZ) { - frontLeft.Add(leftWheel); - } else { - backLeft.Add(leftWheel); - } - } - - foreach (var rightWheel in wheels.Value.rightWheels) { - if (GroundedNode.transform.worldToLocalMatrix.MultiplyPoint3x4(rightWheel.Anchor).z >= comZ) { - frontRight.Add(rightWheel); - } else { - backRight.Add(rightWheel); - } - } - - if (!frontLeft.Any() || !frontRight.Any() || !backRight.Any() || !backLeft.Any()) { - if (!frontLeft.Any()) - Logger.Log("No front-left wheels", LogLevel.Debug); - if (!frontRight.Any()) - Logger.Log("No front-right wheels", LogLevel.Debug); - if (!backLeft.Any()) - Logger.Log("No back-left wheels", LogLevel.Debug); - if (!backRight.Any()) - Logger.Log("No back-right wheels", LogLevel.Debug); - return false; - } - - var mecanumBehaviour = new MecanumDriveBehaviour(this, frontLeft, frontRight, backRight, backLeft); - DriveBehaviour = mecanumBehaviour; - - SimulationManager.AddBehaviour(Name, mecanumBehaviour); - - return true; - } - - private void ConfigureOmniDrivetrain() { - var wheels = SimulationManager.Drivers[Name].OfType().ToList(); - - var omniBehaviour = new OmniDriveBehaviour(this, wheels); - DriveBehaviour = omniBehaviour; - - SimulationManager.AddBehaviour(Name, omniBehaviour); - } - - public static void SpawnRobot( - MixAndMatchRobotData mixAndMatchRobotData, bool spawnGizmo = true, string? filePath = null) { - SpawnRobot(mixAndMatchRobotData, new Vector3(0f, 0.5f, 0f), Quaternion.identity, spawnGizmo, filePath); - } - - public static void SpawnRobot(MixAndMatchRobotData mixAndMatchRobotData, Vector3 position, Quaternion rotation, - bool spawnGizmo, string? filePath) { - if (mixAndMatchRobotData?.PartTransformData.Length == 0) { - Logger.Log("Custom robot contains no parts", LogLevel.Info); - return; - } - - var mira = filePath == null ? Importer.ImportMixAndMatchRobot(mixAndMatchRobotData) - : Importer.ImportSimpleRobot(filePath); - - RobotSimObject simObject = (mira.sim as RobotSimObject)!; - mira.mainObject.transform.SetParent(GameObject.Find("Game").transform); - simObject.ConfigureDefaultBehaviours(); - - mira.mainObject.transform.position = position; - mira.mainObject.transform.rotation = rotation; - - simObject.Possess(); - MainHUD.SelectedRobot = simObject; - - if (spawnGizmo) - GizmoManager.SpawnGizmo(simObject); - AnalyticsManager.LogCustomEvent(AnalyticsEvent.RobotSpawned, ("RobotName", mira.mainObject.name)); - } - - public static bool RemoveRobot(string robot) { - if (!_spawnedRobots.ContainsKey(robot)) - return false; - - GizmoManager.ExitGizmo(); - - if (robot == CurrentlyPossessedRobot) - CurrentlyPossessedRobot = string.Empty; - _spawnedRobots.Remove(robot); - MainHUD.SelectedRobot = null; - return SimulationManager.RemoveSimObject(robot); - } - - public static void RemoveAllRobots() { - string[] robots = new string[_spawnedRobots.Keys.Count]; - _spawnedRobots.Keys.CopyTo(robots, 0); - - robots.ForEach(x => { RemoveRobot(x); }); - } - - private Dictionary _preFreezeStates = new(); - - private bool _isFrozen; - public bool isFrozen() => _isFrozen; - - public void Freeze() { - if (_isFrozen) - return; - - _allRigidbodies.ForEach(x => { - _preFreezeStates[x] = (x.isKinematic, x.velocity, x.angularVelocity); - x.isKinematic = true; - x.detectCollisions = false; - }); - - _isFrozen = true; - } - - public void Unfreeze() { - if (!_isFrozen) { - return; - } - - _allRigidbodies.ForEach(x => { - var originalState = _preFreezeStates[x]; - x.isKinematic = originalState.isKine; - x.detectCollisions = true; - }); - _preFreezeStates.Clear(); - - _isFrozen = false; - } - - public List GetAllRigidbodies() => _allRigidbodies; - - public GameObject GetRootGameObject() { - return RobotNode; - } - - public TransformData GetGizmoData() { - return new TransformData { Position = - GroundedNode.transform.localToWorldMatrix.MultiplyPoint(GroundedBounds.center), - Rotation = GroundedNode.transform.rotation }; - } - - public void UpdateMultiplayer() { - if (Client is not null) { - if (RobotNode.name != "host") { - List changedSignals = new List(); - foreach (var driver in SimulationManager.Drivers[Name]) { - List changes = - driver.State.CompileChanges().Where(s => s.Name != string.Empty).ToList(); - foreach (var signal in changes) - changedSignals.Add(signal); - } - - Client.UpdateControllableState(changedSignals).ContinueWith((x, _) => { - if (!x.IsCompletedSuccessfully) - return; - var msg = x.Result.GetResult(); - msg?.FromSimulationTransformData.TransformData.ForEach(t => { - if (t.Transforms.Count != 0) - ServerTransforms[t.Guid] = t.Clone(); - }); - }, false); - } - - // TODO compare guids once networking between computers - // right now only does it if ghost because ghost is acting as client - if (RobotNode.name != "host") { - if (Client.Guid.HasValue && ServerTransforms.TryGetValue(Client.Guid.Value, out var transform)) { - if (transform != null) { - foreach (var td in transform.Transforms) { - Matrix4x4 matrix = (Matrix4x4) td.Value; - Transform nodeTransform = _nodes[td.Key].transform; - nodeTransform.position = matrix.GetPosition(); - nodeTransform.rotation = matrix.rotation; - } - } - } - } - } - } - - public void Update(TransformData data) { - RobotNode.transform.rotation = Quaternion.identity; - RobotNode.transform.position = Vector3.zero; - - RobotNode.transform.rotation = data.Rotation * Quaternion.Inverse(GroundedNode.transform.rotation); - RobotNode.transform.position = - data.Position - GroundedNode.transform.localToWorldMatrix.MultiplyPoint(GroundedBounds.center); - } - - public void End(TransformData data) { - PracticeMode.SetInitialState(RobotNode); - } - - [JsonObject(MemberSerialization.OptIn)] - public struct DrivetrainType { - public static readonly DrivetrainType NONE = new(0, "None"); - public static readonly DrivetrainType TANK = new(1, "Tank"); - public static readonly DrivetrainType ARCADE = new(2, "Arcade"); - public static readonly DrivetrainType SWERVE = new(3, "Swerve"); - public static readonly DrivetrainType MECANUM = new(4, "Mecanum"); - public static readonly DrivetrainType OMNI = new(5, "Omni"); - - [JsonProperty] - private string _name; - public string Name => _name; - [JsonProperty] - private int _value; - public int Value => _value; - - private DrivetrainType(int val, string name) { - _value = val; - _name = name; - } - - public override bool Equals(object obj) { - if (!(obj is DrivetrainType)) - return false; - - var o = (DrivetrainType) obj; - return o._value == _value && o._name.Equals(_name); - } - - public override int GetHashCode() { - return _name.GetHashCode() * 345345234 + _value * 678465890; - } - } - - public static readonly DrivetrainType[] DRIVETRAIN_TYPES = { DrivetrainType.NONE, DrivetrainType.TANK, - DrivetrainType.ARCADE, DrivetrainType.SWERVE, DrivetrainType.MECANUM, DrivetrainType.OMNI }; - - public struct IntakeTriggerData { - public string NodeName; - public float TriggerSize; - public float[] RelativePosition; - public int StorageCapacity; - } - - public struct ShotTrajectoryData { - public string NodeName; - public float EjectionSpeed; - public float[] RelativePosition; - public float[] RelativeRotation; - } - - public class PossessionChangeEvent : IEvent { - public string NewBot; - public string OldBot; - } - - public class RobotSpawnEvent : IEvent { - public string Bot; - } - - public class RobotRemoveEvent : IEvent { - public string Bot; - } - - public void CreateDrivetrainTooltip() { - string MiraId = MainHUD.SelectedRobot.RobotGUID; - int inputCount = 2; // for intake, and eject - if (!ConfiguredDrivetrainType.Equals(DrivetrainType.NONE)) { - inputCount++; - - if (ConfiguredDrivetrainType.Equals(DrivetrainType.SWERVE) || - ConfiguredDrivetrainType.Equals(DrivetrainType.MECANUM) || - ConfiguredDrivetrainType.Equals(DrivetrainType.OMNI)) { - inputCount++; // for turn - } - } - - MainHUD.SelectedRobot.GetAllReservedInputs().ForEach(input => { - if (!input.displayName.Contains("Arcade") && - (!input.displayName.Contains("Swerve") || input.displayName.Contains("Reset Forward")) && - !input.displayName.Contains("Tank") && - (!input.displayName.Contains("Mecanum") || input.displayName.Contains("Reset Forward") || - input.displayName.Contains("Toggle Field Centric")) && - (!input.displayName.Contains("Omni") || input.displayName.Contains("Reset Forward") || - input.displayName.Contains("Toggle Field Centric"))) { - inputCount++; - } - }); - (string, string)[] inputs = new(string key, string input)[inputCount]; - int i = 0; - switch (ConfiguredDrivetrainType.Name) { - case "Arcade": - string f = GetTooltipOutput(MiraId + "Arcade Forward", "W"); - string b = GetTooltipOutput(MiraId + "Arcade Backward", "S"); - string l = GetTooltipOutput(MiraId + "Arcade Left", "A"); - string r = GetTooltipOutput(MiraId + "Arcade Right", "D"); - inputs[0] = (f + b + l + r, "Drive"); - i++; - break; - case "Tank": - f = GetTooltipOutput(MiraId + "Tank Left-Forward", "W"); - b = GetTooltipOutput(MiraId + "Tank Left-Reverse", "S"); - l = GetTooltipOutput(MiraId + "Tank Right-Forward", "I"); - r = GetTooltipOutput(MiraId + "Tank Right-Reverse", "K"); - inputs[0] = (f + b + l + r, "Drive"); - i++; - break; - case "Swerve": - f = GetTooltipOutput(MiraId + "Swerve Forward", "W"); - b = GetTooltipOutput(MiraId + "Swerve Backward", "S"); - l = GetTooltipOutput(MiraId + "Swerve Left", "A"); - r = GetTooltipOutput(MiraId + "Swerve Right", "D"); - inputs[0] = (f + b + l + r, "Drive"); - i++; - string lturn = GetTooltipOutput(MiraId + "Swerve Turn Left", "LeftArrow"); - string rturn = GetTooltipOutput(MiraId + "Swerve Turn Right", "RightArrow"); - inputs[1] = (lturn + " " + rturn, "Turn"); - i++; - break; - case "Mecanum": - f = GetTooltipOutput(MiraId + "Mecan Forward", "W"); - b = GetTooltipOutput(MiraId + "Mecan Backward", "S"); - l = GetTooltipOutput(MiraId + "Mecan Left", "A"); - r = GetTooltipOutput(MiraId + "Mecan Right", "D"); - inputs[0] = (f + b + l + r, "Drive"); - i++; - lturn = GetTooltipOutput(MiraId + "Mecan Turn Left", "LeftArrow"); - rturn = GetTooltipOutput(MiraId + "Mecan Turn Right", "RightArrow"); - inputs[1] = (lturn + " " + rturn, "Turn"); - i++; - break; - case "Omni": - f = GetTooltipOutput(MiraId + "Omni Forward", "W"); - b = GetTooltipOutput(MiraId + "Omni Backward", "S"); - l = GetTooltipOutput(MiraId + "Omni Left", "A"); - r = GetTooltipOutput(MiraId + "Omni Right", "D"); - inputs[0] = (f + b + l + r, "Drive"); - i++; - lturn = GetTooltipOutput(MiraId + "Omni Turn Left", "LeftArrow"); - rturn = GetTooltipOutput(MiraId + "Omni Turn Right", "RightArrow"); - inputs[1] = (lturn + " " + rturn, "Turn"); - i++; - break; - } - foreach (var inputKey in MainHUD.SelectedRobot.GetAllReservedInputs()) { - if (!inputKey.displayName.Contains("Arcade") && - (!inputKey.displayName.Contains("Swerve") || inputKey.displayName.Contains("Reset Forward")) && - !inputKey.displayName.Contains("Tank") && - (!inputKey.displayName.Contains("Mecanum") || inputKey.displayName.Contains("Reset Forward") || - inputKey.displayName.Contains("Toggle Field Centric")) && - (!inputKey.displayName.Contains("Omni") || inputKey.displayName.Contains("Reset Forward") || - inputKey.displayName.Contains("Toggle Field Centric"))) { - inputs[i] = (InputManager.MappedValueInputs[inputKey.key].Name, inputKey.displayName); - i++; - } - } - inputs[i] = (((Digital) TryGetSavedInput( - INTAKE_GAMEPIECES, new Digital("E", context: SimulationRunner.RUNNING_SIM_CONTEXT))) - .Name, - "Intake"); - i++; - inputs[i] = (((Digital) TryGetSavedInput( - OUTTAKE_GAMEPIECES, new Digital("Q", context: SimulationRunner.RUNNING_SIM_CONTEXT))) - .Name, - "Eject"); - - TooltipManager.CreateTooltip(inputs); - } - - private string GetTooltipOutput(string key, string defaultInput) { - Analog input = InputManager.MappedValueInputs.ContainsKey(key) - ? InputManager.GetAnalog(key) - : SimulationPreferences.GetRobotInput(MainHUD.SelectedRobot.RobotGUID, key); - return input != null ? input.Name : defaultInput; - } -} diff --git a/engine/Assets/Scripts/SimObjects/RobotSimObject.cs.meta b/engine/Assets/Scripts/SimObjects/RobotSimObject.cs.meta deleted file mode 100644 index c084cc38e8..0000000000 --- a/engine/Assets/Scripts/SimObjects/RobotSimObject.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 735ab5cfcf1a0864c91f65e5052e27ac -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/SimulationRunner.cs b/engine/Assets/Scripts/SimulationRunner.cs deleted file mode 100644 index 51848f8114..0000000000 --- a/engine/Assets/Scripts/SimulationRunner.cs +++ /dev/null @@ -1,173 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using Synthesis.Import; -using System.Linq; -using Synthesis.Gizmo; -using Synthesis.PreferenceManager; -using Synthesis.UI.Dynamic; -using SynthesisAPI.InputManager; -using SynthesisAPI.Simulation; -using SynthesisAPI.Utilities; -using Synthesis.Util; -using UnityEngine; - -using Logger = SynthesisAPI.Utilities.Logger; -using Synthesis.UI; -using UnityEngine.SceneManagement; -using Synthesis.Physics; -using SynthesisAPI.EventBus; -using Synthesis.Replay; -using Synthesis.WS; -using SynthesisAPI.Controller; -using SynthesisAPI.RoboRIO; -using UnityEngine.Rendering; - -namespace Synthesis.Runtime { - public class SimulationRunner : MonoBehaviour { - // clang-format off - private static uint _simulationContext = 0x00000001; - // clang-format on - public static uint SimulationContext => _simulationContext; - - public const uint RUNNING_SIM_CONTEXT = 0x00000001; - public const uint PAUSED_SIM_CONTEXT = 0x00000002; - public const uint REPLAY_SIM_CONTEXT = 0x00000004; - public const uint GIZMO_SIM_CONTEXT = 0x00000008; - - /// - /// Called when going to the main menu. - /// Will be completely reset after called - /// - public static event Action OnSimKill; - - public static event Action OnUpdate; - public static event Action OnGameObjectDestroyed; - - private static bool _inSim = false; - public static bool InSim { - get => _inSim; - set { - _inSim = value; - if (!_inSim) - SimKill(); - } - } - - private bool _setupSceneSwitchEvent = false; - - private void Awake() { - Synthesis.PreferenceManager.PreferenceManager.Load(); - UnityEngine.Physics.defaultSolverIterations = 20; - } - - private void Start() { - InSim = true; - - SetContext(RUNNING_SIM_CONTEXT); - MainHUD.Setup(); - ModeManager.Start(); - RobotSimObject.Setup(); - WebSocketManager.Init(); - GizmoManager.Setup(); - - OnUpdate += ModeManager.Update; - OnUpdate += () => RobotSimObject.SpawnedRobots.ForEach(r => r.UpdateMultiplayer()); - - WebSocketManager.RioState.OnUnrecognizedMessage += s => Debug.Log(s); - - if (ModeManager.CurrentMode is not null) - ModeManager.CurrentMode.Start(); - - SettingsModal.LoadSettings(); - SettingsModal.ApplySettings(); - } - - private void TestColor(Color c) { - Debug.Log($"{c.r * 255}, {c.g * 255}, {c.b * 255}, {c.a * 255}"); - var hex = c.ToHex(); - Debug.Log(hex); - var color = hex.ColorToHex(); - Debug.Log($"{color.r * 255}, {color.g * 255}, {color.b * 255}, {color.a * 255}"); - } - - void Update() { - InputManager.UpdateInputs(_simulationContext); - SimulationManager.Update(); - DynamicUIManager.Update(); - - if (OnUpdate != null) { - OnUpdate(); - } - } - - private void FixedUpdate() { - SimulationManager.FixedUpdate(); - PhysicsManager.FixedUpdate(); - } - - void OnDestroy() { - MainHUD.Delete(); - - Synthesis.PreferenceManager.PreferenceManager.Save(); - MirabufCache.Clear(); - if (OnGameObjectDestroyed != null) - OnGameObjectDestroyed(); - } - - /// - /// Set current context - /// - /// Mask for context - public static void SetContext(uint c) { - _simulationContext = c; - } - - /// - /// Add an additional context to the current contexts - /// - /// Mask for context - public static void AddContext(uint c) { - _simulationContext |= c; - } - - /// - /// Remove a context from the current context - /// - /// Mask for context - public static void RemoveContext(uint c) { - if (HasContext(c)) - _simulationContext ^= c; - } - - /// - /// Check if a context exists within the current context - /// - /// Mask for context - /// - public static bool HasContext(uint c) => (_simulationContext & c) != 0; - - /// - /// Teardown sim for recycle - /// - public static void SimKill() { - ModeManager.Teardown(); - - FieldSimObject.DeleteField(); - List robotIDs = new List(RobotSimObject.SpawnedRobots.Count); - RobotSimObject.SpawnedRobots.ForEach(x => robotIDs.Add(x.Name)); - robotIDs.ForEach(x => RobotSimObject.RemoveRobot(x)); - OrbitCameraMode.FocusPoint = () => Vector3.zero; - - if (OnSimKill != null) - OnSimKill(); - - OnSimKill = null; - OnUpdate = null; - - PhysicsManager.Reset(); - ReplayManager.Teardown(); - WebSocketManager.Teardown(); - } - } -} diff --git a/engine/Assets/Scripts/SimulationRunner.cs.meta b/engine/Assets/Scripts/SimulationRunner.cs.meta deleted file mode 100644 index 1a59916a0b..0000000000 --- a/engine/Assets/Scripts/SimulationRunner.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 15e2d6158aa48b94687bd0e5e9dac99a -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Test.meta b/engine/Assets/Scripts/Test.meta deleted file mode 100644 index 25c6355cab..0000000000 --- a/engine/Assets/Scripts/Test.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: b6ac6d1973e48f04a843df9ea21c8faf -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Test/ConfigurableJointTest.cs b/engine/Assets/Scripts/Test/ConfigurableJointTest.cs deleted file mode 100644 index 19657251c1..0000000000 --- a/engine/Assets/Scripts/Test/ConfigurableJointTest.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class ConfigurableJointTest : MonoBehaviour { - private Rigidbody _rb; - private ConfigurableJoint _joint; - - public void Start() { - _joint = GetComponent(); - _rb = _joint.gameObject.GetComponent(); - _rb.sleepThreshold = 0; - _joint.connectedBody.sleepThreshold = 0; - - _joint.targetPosition = new Vector3(0, 2, 0); - _joint.xDrive = new JointDrive { maximumForce = 1000 }; - _joint.yDrive = new JointDrive { maximumForce = 1000 }; - _joint.zDrive = new JointDrive { maximumForce = 1000 }; - } -} diff --git a/engine/Assets/Scripts/Test/ConfigurableJointTest.cs.meta b/engine/Assets/Scripts/Test/ConfigurableJointTest.cs.meta deleted file mode 100644 index 7677cf2eb1..0000000000 --- a/engine/Assets/Scripts/Test/ConfigurableJointTest.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 2fcd0878c88eb6b42a3710fce791ecb8 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Test/DebugJointAxes.cs b/engine/Assets/Scripts/Test/DebugJointAxes.cs deleted file mode 100644 index 9f72e6648e..0000000000 --- a/engine/Assets/Scripts/Test/DebugJointAxes.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using System.Linq; -using System; - -public class DebugJointAxes : MonoBehaviour { - public static List<(Vector3 point, Func trans)> DebugPoints = - new List<(Vector3 point, Func trans)>(); - public static List<(UnityEngine.Bounds bounds, Func trans)> DebugBounds = - new List<(UnityEngine.Bounds bounds, Func trans)>(); - - public void OnDrawGizmos() { - if (Application.isPlaying) { - SynthesisAPI.Simulation.SimulationManager.Drivers.Select(x => x.Value).ForEach(a => a.ForEach(y => { - if (y is Synthesis.RotationalDriver) { - var ArmDriver = y as Synthesis.RotationalDriver; - - var anchorA = ArmDriver.JointA.anchor; - var axisA = ArmDriver.JointA.axis; - var anchorB = ArmDriver.JointB.anchor; - var axisB = ArmDriver.JointB.axis; - - Vector3 globalAnchorA = - ArmDriver.JointA.gameObject.transform.localToWorldMatrix.MultiplyPoint(anchorA); - Vector3 globalAxisA = - ArmDriver.JointA.gameObject.transform.localToWorldMatrix.MultiplyVector(axisA); - Vector3 globalAnchorB = - ArmDriver.JointB.gameObject.transform.localToWorldMatrix.MultiplyPoint(anchorB); - Vector3 globalAxisB = - ArmDriver.JointB.gameObject.transform.localToWorldMatrix.MultiplyVector(axisB); - - Gizmos.color = Color.green; - Gizmos.DrawSphere(globalAnchorA, 0.01f); - Gizmos.DrawLine(globalAnchorA, globalAnchorA + (globalAxisA.normalized * 0.2f)); - } - })); - DebugPoints.RemoveAll(x => { - try { - Gizmos.color = Color.white; - Gizmos.DrawSphere(x.trans().MultiplyPoint(x.point), 0.01f); - return false; - } catch (Exception) { - return true; - } - }); - DebugBounds.RemoveAll(x => { - try { - Gizmos.color = Color.magenta; - Gizmos.DrawWireCube(x.trans().MultiplyPoint(x.bounds.center), x.bounds.extents * 2f); - return false; - } catch (Exception) { - return true; - } - }); - } - } -} diff --git a/engine/Assets/Scripts/Test/DebugJointAxes.cs.meta b/engine/Assets/Scripts/Test/DebugJointAxes.cs.meta deleted file mode 100644 index f9846235b6..0000000000 --- a/engine/Assets/Scripts/Test/DebugJointAxes.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: e9dfc7d08dd93df46af64b96c25ec147 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Tween.meta b/engine/Assets/Scripts/Tween.meta deleted file mode 100644 index 4a7b0e8393..0000000000 --- a/engine/Assets/Scripts/Tween.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 407486e7cf323bc488f20bee81608eb7 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Tween/Demo.meta b/engine/Assets/Scripts/Tween/Demo.meta deleted file mode 100644 index ab500fa0d7..0000000000 --- a/engine/Assets/Scripts/Tween/Demo.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 9f5880b033929b7478e7b3a9ed6c5ee7 -folderAsset: yes -timeCreated: 1455295494 -licenseType: Store -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Tween/Demo/TweenDemo.cs b/engine/Assets/Scripts/Tween/Demo/TweenDemo.cs deleted file mode 100644 index 65f476a2e6..0000000000 --- a/engine/Assets/Scripts/Tween/Demo/TweenDemo.cs +++ /dev/null @@ -1,103 +0,0 @@ -/* -The MIT License (MIT) -Copyright (c) 2016 Digital Ruby, LLC -http://www.digitalruby.com -Created by Jeff Johnson - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit -persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and -this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED -"AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -using UnityEngine; -using System.Collections; - -// for your own scripts make sure to add the following line: -using DigitalRuby.Tween; -using UnityEngine.SceneManagement; - -namespace DigitalRuby.Tween { - public class TweenDemo : MonoBehaviour { - public GameObject Circle; - public Light Light; - - private SpriteRenderer spriteRenderer; - - private void TweenMove() { - System.Action> updateCirclePos = - (t) => { Circle.gameObject.transform.position = t.CurrentValue; }; - - System.Action> circleMoveCompleted = (t) => { Debug.Log("Circle move completed"); }; - - Vector3 currentPos = Circle.transform.position; - Vector3 startPos = Camera.main.ViewportToWorldPoint(Vector3.zero); - Vector3 midPos = Camera.main.ViewportToWorldPoint(Vector3.one); - Vector3 endPos = Camera.main.ViewportToWorldPoint(new Vector3(0.5f, 0.5f, 0.5f)); - currentPos.z = startPos.z = midPos.z = endPos.z = 0.0f; - - // completion defaults to null if not passed in - Circle.gameObject - .Tween("MoveCircle", currentPos, startPos, 1.75f, TweenScaleFunctions.CubicEaseIn, updateCirclePos) - .ContinueWith( - new Vector3Tween().Setup(startPos, midPos, 1.75f, TweenScaleFunctions.Linear, updateCirclePos)) - .ContinueWith(new Vector3Tween().Setup( - midPos, endPos, 1.75f, TweenScaleFunctions.CubicEaseOut, updateCirclePos, circleMoveCompleted)); - } - - private void TweenColor() { - System.Action> updateColor = (t) => { spriteRenderer.color = t.CurrentValue; }; - - Color endColor = UnityEngine.Random.ColorHSV(0.0f, 1.0f, 0.0f, 1.0f, 0.5f, 1.0f, 1.0f, 1.0f); - - // completion defaults to null if not passed in - Circle.gameObject.Tween( - "ColorCircle", spriteRenderer.color, endColor, 1.0f, TweenScaleFunctions.QuadraticEaseOut, updateColor); - } - - private void TweenRotate() { - System.Action> circleRotate = (t) => { - // start rotation from identity to ensure no stuttering - Circle.transform.rotation = Quaternion.identity; - Circle.transform.Rotate(Camera.main.transform.forward, t.CurrentValue); - }; - - float startAngle = Circle.transform.rotation.eulerAngles.z; - float endAngle = startAngle + 720.0f; - - // completion defaults to null if not passed in - Circle.gameObject.Tween( - "RotateCircle", startAngle, endAngle, 2.0f, TweenScaleFunctions.CubicEaseInOut, circleRotate); - } - - private void TweenReset() { - SceneManager.LoadScene(0, LoadSceneMode.Single); - } - - private void Start() { - // for demo purposes, clear all tweens when new level loads, default is false - TweenFactory.ClearTweensOnLevelLoad = true; - spriteRenderer = Circle.GetComponent(); - } - - private void Update() { - if (Input.GetKeyDown(KeyCode.Alpha1)) { - TweenMove(); - } - if (Input.GetKeyDown(KeyCode.Alpha2)) { - TweenColor(); - } - if (Input.GetKeyDown(KeyCode.Alpha3)) { - TweenRotate(); - } - if (Input.GetKeyDown(KeyCode.R)) { - TweenReset(); - } - } - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/Tween/Demo/TweenDemo.cs.meta b/engine/Assets/Scripts/Tween/Demo/TweenDemo.cs.meta deleted file mode 100644 index 92274fed48..0000000000 --- a/engine/Assets/Scripts/Tween/Demo/TweenDemo.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 85997561a67b3e740be145c96c4a0b37 -timeCreated: 1455294104 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Tween/Demo/TweenDemoCircle.png b/engine/Assets/Scripts/Tween/Demo/TweenDemoCircle.png deleted file mode 100644 index 167e44f5e6..0000000000 Binary files a/engine/Assets/Scripts/Tween/Demo/TweenDemoCircle.png and /dev/null differ diff --git a/engine/Assets/Scripts/Tween/Demo/TweenDemoCircle.png.meta b/engine/Assets/Scripts/Tween/Demo/TweenDemoCircle.png.meta deleted file mode 100644 index eed7c735f2..0000000000 --- a/engine/Assets/Scripts/Tween/Demo/TweenDemoCircle.png.meta +++ /dev/null @@ -1,96 +0,0 @@ -fileFormatVersion: 2 -guid: df831354d51eda74491b6ef6cfbbc4d0 -TextureImporter: - internalIDToNameTable: [] - externalObjects: {} - serializedVersion: 11 - mipmaps: - mipMapMode: 0 - enableMipMap: 0 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapsPreserveCoverage: 0 - alphaTestReferenceValue: 0.5 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - streamingMipmaps: 0 - streamingMipmapsPriority: 0 - vTOnly: 0 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: -1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: 1 - aniso: 16 - mipBias: 0 - wrapU: 1 - wrapV: 1 - wrapW: 1 - nPOTScale: 0 - lightmap: 0 - compressionQuality: 50 - spriteMode: 1 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spritePixelsToUnits: 32 - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spriteGenerateFallbackPhysicsShape: 1 - alphaUsage: 1 - alphaIsTransparency: 1 - spriteTessellationDetail: -1 - textureType: 8 - textureShape: 1 - singleChannelComponent: 0 - flipbookRows: 1 - flipbookColumns: 1 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - ignorePngGamma: 0 - applyGammaDecoding: 1 - platformSettings: - - serializedVersion: 3 - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - bones: [] - spriteID: 5e97eb03825dee720800000000000000 - internalID: 0 - vertices: [] - indices: - edges: [] - weights: [] - secondaryTextures: [] - spritePackingTag: - pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Tween/Demo/TweenDemoMaterial.mat b/engine/Assets/Scripts/Tween/Demo/TweenDemoMaterial.mat deleted file mode 100644 index 44e6909545..0000000000 --- a/engine/Assets/Scripts/Tween/Demo/TweenDemoMaterial.mat +++ /dev/null @@ -1,143 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &-8404376027746969931 -MonoBehaviour: - m_ObjectHideFlags: 11 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} - m_Name: - m_EditorClassIdentifier: - version: 7 ---- !u!21 &2100000 -Material: - serializedVersion: 8 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: TweenDemoMaterial - m_Shader: {fileID: 4800000, guid: 8d2bb70cbf9db8d4da26e15b26e74248, type: 3} - m_Parent: {fileID: 0} - m_ModifiedSerializedProperties: 0 - m_ValidKeywords: - - _EMISSION - - _SURFACE_TYPE_TRANSPARENT - m_InvalidKeywords: [] - m_LightmapFlags: 1 - m_EnableInstancingVariants: 0 - m_DoubleSidedGI: 0 - m_CustomRenderQueue: 3000 - stringTagMap: - RenderType: Transparent - disabledShaderPasses: - - DepthOnly - - SHADOWCASTER - m_LockedProperties: - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: - - _AlphaTex: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _BaseMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _BumpMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailAlbedoMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailMask: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailNormalMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _EmissionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MainTex: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MetallicGlossMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _OcclusionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _ParallaxMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _SpecGlossMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - unity_Lightmaps: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - unity_LightmapsInd: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - unity_ShadowMasks: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Ints: [] - m_Floats: - - PixelSnap: 0 - - _AlphaClip: 0 - - _AlphaToMask: 0 - - _Blend: 0 - - _BlendModePreserveSpecular: 0 - - _BumpScale: 1 - - _Cull: 2 - - _Cutoff: 0.5 - - _DetailNormalMapScale: 1 - - _DstBlend: 10 - - _DstBlendAlpha: 10 - - _EnableExternalAlpha: 0 - - _Glossiness: 0.5 - - _GlossinessSource: 0 - - _Metallic: 0 - - _Mode: 0 - - _OcclusionStrength: 1 - - _Parallax: 0.02 - - _QueueOffset: 0 - - _ReceiveShadows: 1 - - _Shininess: 0 - - _Smoothness: 0.5 - - _SmoothnessSource: 0 - - _SpecSource: 0 - - _SpecularHighlights: 1 - - _SrcBlend: 5 - - _SrcBlendAlpha: 1 - - _Surface: 1 - - _UVSec: 0 - - _ZWrite: 0 - m_Colors: - - _BaseColor: {r: 1, g: 1, b: 1, a: 1} - - _Color: {r: 1, g: 1, b: 1, a: 1} - - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - - _Flip: {r: 1, g: 1, b: 1, a: 1} - - _RendererColor: {r: 1, g: 1, b: 1, a: 1} - - _SpecColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5} - m_BuildTextureStacks: [] diff --git a/engine/Assets/Scripts/Tween/Demo/TweenDemoMaterial.mat.meta b/engine/Assets/Scripts/Tween/Demo/TweenDemoMaterial.mat.meta deleted file mode 100644 index 78dd2c8435..0000000000 --- a/engine/Assets/Scripts/Tween/Demo/TweenDemoMaterial.mat.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 2d994b80f30361c449f5504b6ddb859a -timeCreated: 1455295548 -licenseType: Store -NativeFormatImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Tween/Demo/TweenDemoScene.unity b/engine/Assets/Scripts/Tween/Demo/TweenDemoScene.unity deleted file mode 100644 index 482945c18d..0000000000 --- a/engine/Assets/Scripts/Tween/Demo/TweenDemoScene.unity +++ /dev/null @@ -1,661 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!29 &1 -OcclusionCullingSettings: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_OcclusionBakeSettings: - smallestOccluder: 5 - smallestHole: 0.25 - backfaceThreshold: 100 - m_SceneGUID: 00000000000000000000000000000000 - m_OcclusionCullingData: {fileID: 0} ---- !u!104 &2 -RenderSettings: - m_ObjectHideFlags: 0 - serializedVersion: 9 - m_Fog: 0 - m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} - m_FogMode: 3 - m_FogDensity: 0.01 - m_LinearFogStart: 0 - m_LinearFogEnd: 300 - m_AmbientSkyColor: {r: 0, g: 0, b: 0, a: 0} - m_AmbientEquatorColor: {r: 0, g: 0, b: 0, a: 0} - m_AmbientGroundColor: {r: 0, g: 0, b: 0, a: 0} - m_AmbientIntensity: 0 - m_AmbientMode: 3 - m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} - m_SkyboxMaterial: {fileID: 0} - m_HaloStrength: 0.5 - m_FlareStrength: 1 - m_FlareFadeSpeed: 3 - m_HaloTexture: {fileID: 0} - m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} - m_DefaultReflectionMode: 0 - m_DefaultReflectionResolution: 128 - m_ReflectionBounces: 1 - m_ReflectionIntensity: 1 - m_CustomReflection: {fileID: 0} - m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} - m_UseRadianceAmbientProbe: 0 ---- !u!157 &3 -LightmapSettings: - m_ObjectHideFlags: 0 - serializedVersion: 12 - m_GIWorkflowMode: 1 - m_GISettings: - serializedVersion: 2 - m_BounceScale: 1 - m_IndirectOutputScale: 1 - m_AlbedoBoost: 1 - m_EnvironmentLightingMode: 0 - m_EnableBakedLightmaps: 0 - m_EnableRealtimeLightmaps: 0 - m_LightmapEditorSettings: - serializedVersion: 12 - m_Resolution: 2 - m_BakeResolution: 40 - m_AtlasSize: 1024 - m_AO: 0 - m_AOMaxDistance: 1 - m_CompAOExponent: 0 - m_CompAOExponentDirect: 0 - m_ExtractAmbientOcclusion: 0 - m_Padding: 2 - m_LightmapParameters: {fileID: 0} - m_LightmapsBakeMode: 1 - m_TextureCompression: 1 - m_FinalGather: 0 - m_FinalGatherFiltering: 1 - m_FinalGatherRayCount: 1024 - m_ReflectionCompression: 2 - m_MixedBakeMode: 1 - m_BakeBackend: 0 - m_PVRSampling: 1 - m_PVRDirectSampleCount: 32 - m_PVRSampleCount: 512 - m_PVRBounces: 2 - m_PVREnvironmentSampleCount: 512 - m_PVREnvironmentReferencePointCount: 2048 - m_PVRFilteringMode: 0 - m_PVRDenoiserTypeDirect: 0 - m_PVRDenoiserTypeIndirect: 0 - m_PVRDenoiserTypeAO: 0 - m_PVRFilterTypeDirect: 0 - m_PVRFilterTypeIndirect: 0 - m_PVRFilterTypeAO: 0 - m_PVREnvironmentMIS: 0 - m_PVRCulling: 1 - m_PVRFilteringGaussRadiusDirect: 1 - m_PVRFilteringGaussRadiusIndirect: 5 - m_PVRFilteringGaussRadiusAO: 2 - m_PVRFilteringAtrousPositionSigmaDirect: 0.5 - m_PVRFilteringAtrousPositionSigmaIndirect: 2 - m_PVRFilteringAtrousPositionSigmaAO: 1 - m_ExportTrainingData: 0 - m_TrainingDataDestination: TrainingData - m_LightProbeSampleCountMultiplier: 4 - m_LightingDataAsset: {fileID: 0} - m_LightingSettings: {fileID: 4890085278179872738, guid: f25aea883aa26ce4dafd81ae95082994, type: 2} ---- !u!196 &4 -NavMeshSettings: - serializedVersion: 2 - m_ObjectHideFlags: 0 - m_BuildSettings: - serializedVersion: 2 - agentTypeID: 0 - agentRadius: 0.5 - agentHeight: 2 - agentSlope: 45 - agentClimb: 0.4 - ledgeDropHeight: 0 - maxJumpAcrossDistance: 0 - minRegionArea: 2 - manualCellSize: 0 - cellSize: 0.16666667 - manualTileSize: 0 - tileSize: 256 - accuratePlacement: 0 - maxJobWorkers: 0 - preserveTilesOutsideBounds: 0 - debug: - m_Flags: 0 - m_NavMeshData: {fileID: 0} ---- !u!1 &279954674 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 279954676} - - component: {fileID: 279954675} - m_Layer: 0 - m_Name: Circle - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!212 &279954675 -SpriteRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 279954674} - m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_DynamicOccludee: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 0 - m_ReflectionProbeUsage: 0 - m_RayTracingMode: 0 - m_RayTraceProcedural: 0 - m_RenderingLayerMask: 1 - m_RendererPriority: 0 - m_Materials: - - {fileID: 2100000, guid: 2d994b80f30361c449f5504b6ddb859a, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_ReceiveGI: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 1 - m_SelectedEditorRenderState: 0 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_Sprite: {fileID: 21300000, guid: df831354d51eda74491b6ef6cfbbc4d0, type: 3} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_FlipX: 0 - m_FlipY: 0 - m_DrawMode: 0 - m_Size: {x: 1, y: 1} - m_AdaptiveModeThreshold: 0.5 - m_SpriteTileMode: 0 - m_WasSpriteAssigned: 1 - m_MaskInteraction: 0 - m_SpriteSortPoint: 0 ---- !u!4 &279954676 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 279954674} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &309942542 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 309942543} - - component: {fileID: 309942545} - - component: {fileID: 309942544} - m_Layer: 5 - m_Name: Commands - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &309942543 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 309942542} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 2081690836} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 266, y: -8} - m_SizeDelta: {x: 500, y: -16} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &309942544 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 309942542} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 20 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 0 - m_MaxSize: 40 - m_Alignment: 0 - m_AlignByGeometry: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: 'Commands: - - 1] Tween Move - - 2] Tween Color - - 3] Tween Rotate - - R] - Reset' ---- !u!222 &309942545 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 309942542} - m_CullTransparentMesh: 1 ---- !u!1 &464777571 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 464777577} - - component: {fileID: 464777576} - - component: {fileID: 464777574} - - component: {fileID: 464777573} - - component: {fileID: 464777572} - m_Layer: 0 - m_Name: Main Camera - m_TagString: MainCamera - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &464777572 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 464777571} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 85997561a67b3e740be145c96c4a0b37, type: 3} - m_Name: - m_EditorClassIdentifier: - Circle: {fileID: 279954674} - Light: {fileID: 1462085731} ---- !u!81 &464777573 -AudioListener: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 464777571} - m_Enabled: 1 ---- !u!124 &464777574 -Behaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 464777571} - m_Enabled: 1 ---- !u!20 &464777576 -Camera: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 464777571} - m_Enabled: 1 - serializedVersion: 2 - m_ClearFlags: 2 - m_BackGroundColor: {r: 0, g: 0, b: 0, a: 1} - m_projectionMatrixMode: 1 - m_GateFitMode: 2 - m_FOVAxisMode: 0 - m_SensorSize: {x: 36, y: 24} - m_LensShift: {x: 0, y: 0} - m_FocalLength: 50 - m_NormalizedViewPortRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - near clip plane: 0.3 - far clip plane: 1000 - field of view: 60 - orthographic: 1 - orthographic size: 10 - m_Depth: -1 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingPath: -1 - m_TargetTexture: {fileID: 0} - m_TargetDisplay: 0 - m_TargetEye: 3 - m_HDR: 0 - m_AllowMSAA: 1 - m_AllowDynamicResolution: 0 - m_ForceIntoRT: 0 - m_OcclusionCulling: 1 - m_StereoConvergence: 10 - m_StereoSeparation: 0.022 ---- !u!4 &464777577 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 464777571} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &1462085730 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1462085732} - - component: {fileID: 1462085731} - m_Layer: 0 - m_Name: Point light - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!108 &1462085731 -Light: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1462085730} - m_Enabled: 1 - serializedVersion: 10 - m_Type: 2 - m_Shape: 0 - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_Intensity: 2 - m_Range: 500 - m_SpotAngle: 30 - m_InnerSpotAngle: 21.80208 - m_CookieSize: 10 - m_Shadows: - m_Type: 0 - m_Resolution: -1 - m_CustomResolution: -1 - m_Strength: 1 - m_Bias: 0.05 - m_NormalBias: 0.4 - m_NearPlane: 0.2 - m_CullingMatrixOverride: - e00: 1 - e01: 0 - e02: 0 - e03: 0 - e10: 0 - e11: 1 - e12: 0 - e13: 0 - e20: 0 - e21: 0 - e22: 1 - e23: 0 - e30: 0 - e31: 0 - e32: 0 - e33: 1 - m_UseCullingMatrixOverride: 0 - m_Cookie: {fileID: 0} - m_DrawHalo: 0 - m_Flare: {fileID: 0} - m_RenderMode: 0 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingLayerMask: 1 - m_Lightmapping: 4 - m_LightShadowCasterMode: 0 - m_AreaSize: {x: 1, y: 1} - m_BounceIntensity: 0 - m_ColorTemperature: 6570 - m_UseColorTemperature: 0 - m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} - m_UseBoundingSphereOverride: 0 - m_UseViewFrustumForShadowCasterCull: 1 - m_ShadowRadius: 0 - m_ShadowAngle: 0 ---- !u!4 &1462085732 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1462085730} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -100} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &1986219434 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1986219437} - - component: {fileID: 1986219436} - - component: {fileID: 1986219435} - m_Layer: 0 - m_Name: EventSystem - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &1986219435 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1986219434} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} - m_Name: - m_EditorClassIdentifier: - m_HorizontalAxis: Horizontal - m_VerticalAxis: Vertical - m_SubmitButton: Submit - m_CancelButton: Cancel - m_InputActionsPerSecond: 10 - m_RepeatDelay: 0.5 - m_ForceModuleActive: 0 ---- !u!114 &1986219436 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1986219434} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} - m_Name: - m_EditorClassIdentifier: - m_FirstSelected: {fileID: 0} - m_sendNavigationEvents: 1 - m_DragThreshold: 5 ---- !u!4 &1986219437 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1986219434} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 4 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &2081690832 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2081690836} - - component: {fileID: 2081690835} - - component: {fileID: 2081690834} - - component: {fileID: 2081690833} - m_Layer: 5 - m_Name: UICanvas - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &2081690833 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2081690832} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IgnoreReversedGraphics: 1 - m_BlockingObjects: 0 - m_BlockingMask: - serializedVersion: 2 - m_Bits: 4294967295 ---- !u!114 &2081690834 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2081690832} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} - m_Name: - m_EditorClassIdentifier: - m_UiScaleMode: 1 - m_ReferencePixelsPerUnit: 100 - m_ScaleFactor: 1 - m_ReferenceResolution: {x: 800, y: 600} - m_ScreenMatchMode: 0 - m_MatchWidthOrHeight: 0 - m_PhysicalUnit: 3 - m_FallbackScreenDPI: 96 - m_DefaultSpriteDPI: 96 - m_DynamicPixelsPerUnit: 1 - m_PresetInfoIsWorld: 0 ---- !u!223 &2081690835 -Canvas: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2081690832} - m_Enabled: 1 - serializedVersion: 3 - m_RenderMode: 0 - m_Camera: {fileID: 0} - m_PlaneDistance: 100 - m_PixelPerfect: 0 - m_ReceivesEvents: 1 - m_OverrideSorting: 0 - m_OverridePixelPerfect: 0 - m_SortingBucketNormalizedSize: 0 - m_AdditionalShaderChannelsFlag: 25 - m_SortingLayerID: 0 - m_SortingOrder: 0 - m_TargetDisplay: 0 ---- !u!224 &2081690836 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2081690832} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0, y: 0, z: 0} - m_Children: - - {fileID: 309942543} - m_Father: {fileID: 0} - m_RootOrder: 3 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0, y: 0} diff --git a/engine/Assets/Scripts/Tween/Demo/TweenDemoScene.unity.meta b/engine/Assets/Scripts/Tween/Demo/TweenDemoScene.unity.meta deleted file mode 100644 index 7d3d47006b..0000000000 --- a/engine/Assets/Scripts/Tween/Demo/TweenDemoScene.unity.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: ad948b3082b546f4e8f3565bdfe0abf6 -timeCreated: 1455295598 -licenseType: Store -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Tween/Demo/TweenDemoSceneSettings.lighting b/engine/Assets/Scripts/Tween/Demo/TweenDemoSceneSettings.lighting deleted file mode 100644 index 1255b620c9..0000000000 --- a/engine/Assets/Scripts/Tween/Demo/TweenDemoSceneSettings.lighting +++ /dev/null @@ -1,63 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!850595691 &4890085278179872738 -LightingSettings: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: TweenDemoSceneSettings - serializedVersion: 3 - m_GIWorkflowMode: 1 - m_EnableBakedLightmaps: 0 - m_EnableRealtimeLightmaps: 0 - m_RealtimeEnvironmentLighting: 1 - m_BounceScale: 1 - m_AlbedoBoost: 1 - m_IndirectOutputScale: 1 - m_UsingShadowmask: 0 - m_BakeBackend: 0 - m_LightmapMaxSize: 1024 - m_BakeResolution: 40 - m_Padding: 2 - m_TextureCompression: 1 - m_AO: 0 - m_AOMaxDistance: 1 - m_CompAOExponent: 0 - m_CompAOExponentDirect: 0 - m_ExtractAO: 0 - m_MixedBakeMode: 1 - m_LightmapsBakeMode: 1 - m_FilterMode: 1 - m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0} - m_ExportTrainingData: 0 - m_TrainingDataDestination: TrainingData - m_RealtimeResolution: 2 - m_ForceWhiteAlbedo: 0 - m_ForceUpdates: 0 - m_FinalGather: 0 - m_FinalGatherRayCount: 1024 - m_FinalGatherFiltering: 1 - m_PVRCulling: 1 - m_PVRSampling: 1 - m_PVRDirectSampleCount: 32 - m_PVRSampleCount: 512 - m_PVREnvironmentSampleCount: 512 - m_PVREnvironmentReferencePointCount: 2048 - m_LightProbeSampleCountMultiplier: 4 - m_PVRBounces: 2 - m_PVRMinBounces: 2 - m_PVREnvironmentMIS: 0 - m_PVRFilteringMode: 0 - m_PVRDenoiserTypeDirect: 0 - m_PVRDenoiserTypeIndirect: 0 - m_PVRDenoiserTypeAO: 0 - m_PVRFilterTypeDirect: 0 - m_PVRFilterTypeIndirect: 0 - m_PVRFilterTypeAO: 0 - m_PVRFilteringGaussRadiusDirect: 1 - m_PVRFilteringGaussRadiusIndirect: 5 - m_PVRFilteringGaussRadiusAO: 2 - m_PVRFilteringAtrousPositionSigmaDirect: 0.5 - m_PVRFilteringAtrousPositionSigmaIndirect: 2 - m_PVRFilteringAtrousPositionSigmaAO: 1 diff --git a/engine/Assets/Scripts/Tween/Demo/TweenDemoSceneSettings.lighting.meta b/engine/Assets/Scripts/Tween/Demo/TweenDemoSceneSettings.lighting.meta deleted file mode 100644 index 69484f3d60..0000000000 --- a/engine/Assets/Scripts/Tween/Demo/TweenDemoSceneSettings.lighting.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: f25aea883aa26ce4dafd81ae95082994 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 4890085278179872738 - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Tween/Readme.txt b/engine/Assets/Scripts/Tween/Readme.txt deleted file mode 100644 index b28abab873..0000000000 --- a/engine/Assets/Scripts/Tween/Readme.txt +++ /dev/null @@ -1,24 +0,0 @@ -Tween for Unity -(c) 2016 Digital Ruby, LLC -https://www.digitalruby.com/unity-plugins/ -Created by Jeff Johnson - -Version 1.0.4 - -Tween for Unity is the easiest and simplest Tween script for Unity. In a matter of seconds you can be tweening and animating your game objects. - -Tween supports float, Vector2, Vector3, Vector4 and Quaternion tweens. - -TweenFactory is the class you will want to use to initiate tweens. There is no need to add any scripts to game objects. TweenFactory takes care of everything. - -Simply call TweenFactory.Tween(...) and pass in your parameters and callback functions. - -TweenFactory.DefaultTimeFunc can be set to your desired time function, default is Time.deltaTime. - -Tweens may have a key, or null for no key. If adding a tween with a non-null key, existing tweens with the same key will be removed. Use the AddKeyStopBehavior field of TweenFactory to determine what to do in these cases. - -Set Tween.ForceUpdate = true; if you want Tween to continue to run on objects that are not visible. - -Make sure to add a "using DigitalRuby.Tween" to your scripts. - -See TweenDemoScene for a demo scene, and look in TweenDemo.cs for code samples. \ No newline at end of file diff --git a/engine/Assets/Scripts/Tween/Readme.txt.meta b/engine/Assets/Scripts/Tween/Readme.txt.meta deleted file mode 100644 index aa422be2b6..0000000000 --- a/engine/Assets/Scripts/Tween/Readme.txt.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: d536e9d2e2dc3f94cb6ca36e79a2d583 -timeCreated: 1455298832 -licenseType: Store -TextScriptImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/Tween/Tween.cs b/engine/Assets/Scripts/Tween/Tween.cs deleted file mode 100644 index 84bf0e3a26..0000000000 --- a/engine/Assets/Scripts/Tween/Tween.cs +++ /dev/null @@ -1,1124 +0,0 @@ -/* -The MIT License (MIT) -Copyright (c) 2016 Digital Ruby, LLC -http://www.digitalruby.com -Created by Jeff Johnson - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit -persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and -this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED -"AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#if UNITY || UNITY_2017_4_OR_NEWER - -#define IS_UNITY - -#endif - -using System; -using System.Collections.Generic; - -using UnityEngine; - -namespace DigitalRuby.Tween { - /// - /// State of an ITween object - /// - public enum TweenState { - /// - /// The tween is running. - /// - Running, - - /// - /// The tween is paused. - /// - Paused, - - /// - /// The tween is stopped. - /// - Stopped - } - - /// - /// The behavior to use when manually stopping a tween. - /// - public enum TweenStopBehavior { - /// - /// Does not change the current value. - /// - DoNotModify, - - /// - /// Causes the tween to progress to the end value immediately. - /// - Complete - } - -#if IS_UNITY - - /// - /// Tween manager - do not add directly as a script, instead call the static methods in your other scripts. - /// - public class TweenFactory : MonoBehaviour { - private static GameObject root; - private static readonly List tweens = new List(); - private static GameObject toDestroy; - - private static void EnsureCreated() { - if (root == null && Application.isPlaying) { - root = GameObject.Find("DigitalRubyTween"); - if (root == null || root.GetComponent() == null) { - if (root != null) { - toDestroy = root; - } - root = new GameObject { name = "DigitalRubyTween", hideFlags = HideFlags.HideAndDontSave }; - root.AddComponent().hideFlags = HideFlags.HideAndDontSave; - } - if (Application.isPlaying) { - GameObject.DontDestroyOnLoad(root); - } - } - } - - private void Start() { - UnityEngine.SceneManagement.SceneManager.sceneLoaded += SceneManagerSceneLoaded; - if (toDestroy != null) { - GameObject.Destroy(toDestroy); - toDestroy = null; - } - } - - private void SceneManagerSceneLoaded( - UnityEngine.SceneManagement.Scene s, UnityEngine.SceneManagement.LoadSceneMode m) { - if (ClearTweensOnLevelLoad) { - tweens.Clear(); - } - } - - private void Update() { - ITween t; - - for (int i = tweens.Count - 1; i >= 0; i--) { - t = tweens[i]; - if (t.Update(t.TimeFunc()) && i < tweens.Count && tweens[i] == t) { - tweens.RemoveAt(i); - } - } - } - - /// - /// Start and add a float tween - /// - /// Key - /// Start value - /// End value - /// Duration in seconds - /// Scale function - /// Progress handler - /// Completion handler - /// FloatTween - public static FloatTween Tween(object key, float start, float end, float duration, Func scaleFunc, - System.Action> progress, System.Action> completion = null) { - FloatTween t = new FloatTween(); - t.Key = key; - t.Setup(start, end, duration, scaleFunc, progress, completion); - t.Start(); - AddTween(t); - - return t; - } - - /// - /// Start and add a Vector2 tween - /// - /// Key - /// Start value - /// End value - /// Duration in seconds - /// Scale function - /// Progress handler - /// Completion handler - /// Vector2Tween - public static Vector2Tween Tween(object key, Vector2 start, Vector2 end, float duration, - Func scaleFunc, System.Action> progress, - System.Action> completion = null) { - Vector2Tween t = new Vector2Tween(); - t.Key = key; - t.Setup(start, end, duration, scaleFunc, progress, completion); - t.Start(); - AddTween(t); - - return t; - } - - /// - /// Start and add a Vector3 tween - /// - /// Key - /// Start value - /// End value - /// Duration in seconds - /// Scale function - /// Progress handler - /// Completion handler - /// Vector3Tween - public static Vector3Tween Tween(object key, Vector3 start, Vector3 end, float duration, - Func scaleFunc, System.Action> progress, - System.Action> completion = null) { - Vector3Tween t = new Vector3Tween(); - t.Key = key; - t.Setup(start, end, duration, scaleFunc, progress, completion); - t.Start(); - AddTween(t); - - return t; - } - - /// - /// Start and add a Vector4 tween - /// - /// Key - /// Start value - /// End value - /// Duration in seconds - /// Scale function - /// Progress handler - /// Completion handler - /// Vector4Tween - public static Vector4Tween Tween(object key, Vector4 start, Vector4 end, float duration, - Func scaleFunc, System.Action> progress, - System.Action> completion = null) { - Vector4Tween t = new Vector4Tween(); - t.Key = key; - t.Setup(start, end, duration, scaleFunc, progress, completion); - t.Start(); - AddTween(t); - - return t; - } - - /// - /// Start and add a Color tween - /// - /// Start value - /// End value - /// Duration in seconds - /// Scale function - /// Progress handler - /// Completion handler - /// ColorTween - public static ColorTween Tween(object key, Color start, Color end, float duration, Func scaleFunc, - System.Action> progress, System.Action> completion = null) { - ColorTween t = new ColorTween(); - t.Key = key; - t.Setup(start, end, duration, scaleFunc, progress, completion); - t.Start(); - AddTween(t); - - return t; - } - - /// - /// Start and add a Quaternion tween - /// - /// Start value - /// End value - /// Duration in seconds - /// Scale function - /// Progress handler - /// Completion handler - /// QuaternionTween - public static QuaternionTween Tween(object key, Quaternion start, Quaternion end, float duration, - Func scaleFunc, System.Action> progress, - System.Action> completion = null) { - QuaternionTween t = new QuaternionTween(); - t.Key = key; - t.Setup(start, end, duration, scaleFunc, progress, completion); - t.Start(); - AddTween(t); - - return t; - } - - /// - /// Add a tween - /// - /// Tween to add - public static void AddTween(ITween tween) { - EnsureCreated(); - if (tween.Key != null) { - RemoveTweenKey(tween.Key, AddKeyStopBehavior); - } - tweens.Add(tween); - } - - /// - /// Remove a tween - /// - /// Tween to remove - /// Stop behavior - /// True if removed, false if not - public static bool RemoveTween(ITween tween, TweenStopBehavior stopBehavior) { - tween.Stop(stopBehavior); - return tweens.Remove(tween); - } - - /// - /// Remove a tween by key - /// - /// Key to remove - /// Stop behavior - /// True if removed, false if not - public static bool RemoveTweenKey(object key, TweenStopBehavior stopBehavior) { - if (key == null) { - return false; - } - - bool foundOne = false; - for (int i = tweens.Count - 1; i >= 0; i--) { - ITween t = tweens[i]; - if (key.Equals(t.Key)) { - t.Stop(stopBehavior); - tweens.RemoveAt(i); - foundOne = true; - } - } - return foundOne; - } - - /// - /// Clear all tweens - /// - public static void Clear() { - tweens.Clear(); - } - - /// - /// Stop behavior if you add a tween with a key and tweens already exist with the key - /// - public static TweenStopBehavior AddKeyStopBehavior = TweenStopBehavior.DoNotModify; - - /// - /// Whether to clear tweens on level load, default is false - /// - public static bool ClearTweensOnLevelLoad { get; set; } - - /// - /// Default time func - /// - public static Func DefaultTimeFunc = TimeFuncDeltaTime; - - /// - /// Time func delta time instance - /// - public static readonly Func TimeFuncDeltaTimeFunc = TimeFuncDeltaTime; - - /// - /// Time func unscaled delta time instance - /// - public static readonly Func TimeFuncUnscaledDeltaTimeFunc = TimeFuncUnscaledDeltaTime; - - /// - /// Time func that uses Time.deltaTime - /// - /// Time.deltaTime - private static float TimeFuncDeltaTime() { - return Time.deltaTime; - } - - /// - /// Time func that uses Time.unscaledDeltaTime - /// - /// Time.unscaledDeltaTime - private static float TimeFuncUnscaledDeltaTime() { - return Time.unscaledDeltaTime; - } - } - - /// - /// Extensions for tween for game objects - unity only - /// - public static class GameObjectTweenExtensions { - /// - /// Start and add a float tween - /// - /// Game object - /// Key - /// Start value - /// End value - /// Duration in seconds - /// Scale function - /// Progress handler - /// Completion handler - /// FloatTween - public static FloatTween Tween(this GameObject obj, object key, float start, float end, float duration, - Func scaleFunc, System.Action> progress, - System.Action> completion = null) { - FloatTween t = TweenFactory.Tween(key, start, end, duration, scaleFunc, progress, completion); - t.GameObject = obj; - t.Renderer = obj.GetComponent(); - return t; - } - - /// - /// Start and add a Vector2 tween - /// - /// Game object - /// Key - /// Start value - /// End value - /// Duration in seconds - /// Scale function - /// Progress handler - /// Completion handler - /// Vector2Tween - public static Vector2Tween Tween(this GameObject obj, object key, Vector2 start, Vector2 end, float duration, - Func scaleFunc, System.Action> progress, - System.Action> completion = null) { - Vector2Tween t = TweenFactory.Tween(key, start, end, duration, scaleFunc, progress, completion); - t.GameObject = obj; - t.Renderer = obj.GetComponent(); - return t; - } - - /// - /// Start and add a Vector3 tween - /// - /// Game object - /// Key - /// Start value - /// End value - /// Duration in seconds - /// Scale function - /// Progress handler - /// Completion handler - /// Vector3Tween - public static Vector3Tween Tween(this GameObject obj, object key, Vector3 start, Vector3 end, float duration, - Func scaleFunc, System.Action> progress, - System.Action> completion = null) { - Vector3Tween t = TweenFactory.Tween(key, start, end, duration, scaleFunc, progress, completion); - t.GameObject = obj; - t.Renderer = obj.GetComponent(); - return t; - } - - /// - /// Start and add a Vector4 tween - /// - /// Game object - /// Key - /// Start value - /// End value - /// Duration in seconds - /// Scale function - /// Progress handler - /// Completion handler - /// Vector4Tween - public static Vector4Tween Tween(this GameObject obj, object key, Vector4 start, Vector4 end, float duration, - Func scaleFunc, System.Action> progress, - System.Action> completion = null) { - Vector4Tween t = TweenFactory.Tween(key, start, end, duration, scaleFunc, progress, completion); - t.GameObject = obj; - t.Renderer = obj.GetComponent(); - return t; - } - - /// - /// Start and add a Color tween - /// - /// Game object - /// Start value - /// End value - /// Duration in seconds - /// Scale function - /// Progress handler - /// Completion handler - /// ColorTween - public static ColorTween Tween(this GameObject obj, object key, Color start, Color end, float duration, - Func scaleFunc, System.Action> progress, - System.Action> completion = null) { - ColorTween t = TweenFactory.Tween(key, start, end, duration, scaleFunc, progress, completion); - t.GameObject = obj; - t.Renderer = obj.GetComponent(); - return t; - } - - /// - /// Start and add a Quaternion tween - /// - /// Game object - /// Start value - /// End value - /// Duration in seconds - /// Scale function - /// Progress handler - /// Completion handler - /// QuaternionTween - public static QuaternionTween Tween(this GameObject obj, object key, Quaternion start, Quaternion end, - float duration, Func scaleFunc, System.Action> progress, - System.Action> completion = null) { - QuaternionTween t = TweenFactory.Tween(key, start, end, duration, scaleFunc, progress, completion); - t.GameObject = obj; - t.Renderer = obj.GetComponent(); - return t; - } - } - -#endif - - /// - /// Interface for a tween object. - /// - public interface ITween { - /// - /// The key that identifies this tween - can be null - /// - object Key { get; } - - /// - /// Gets the current state of the tween. - /// - TweenState State { get; } - - /// - /// Time function - /// - System.Func TimeFunc { get; set; } - - /// - /// Start the tween. - /// - void Start(); - - /// - /// Pauses the tween. - /// - void Pause(); - - /// - /// Resumes the paused tween. - /// - void Resume(); - - /// - /// Stops the tween. - /// - /// The behavior to use to handle the stop. - void Stop(TweenStopBehavior stopBehavior); - - /// - /// Updates the tween. - /// - /// The elapsed time to add to the tween. - /// True if done, false if not - bool Update(float elapsedTime); - } - - /// - /// Interface for a tween object that handles a specific type. - /// - /// The type to tween. - public interface ITween : ITween - - where T : struct { - /// - /// Gets the current value of the tween. - /// - T CurrentValue { get; } - - /// - /// Gets the current progress of the tween. - /// - float CurrentProgress { get; } - - /// - /// Initialize a tween. - /// - /// The start value. - /// The end value. - /// The duration of the tween. - /// A function used to scale progress over time. - /// Progress callback - /// Called when the tween completes - Tween Setup(T start, T end, float duration, Func scaleFunc, System.Action> progress, - System.Action> completion = null); - } - - /// - /// An implementation of a tween object. - /// - /// The type to tween. - public class Tween : ITween - - where T : struct { - private readonly Func, T, T, float, T> lerpFunc; - - private float currentTime; - private float duration; - private Func scaleFunc; - private System.Action> progressCallback; - private System.Action> completionCallback; - private TweenState state; - - private T start; - private T end; - private T value; - - private ITween continueWith; - - /// - /// The key that identifies this tween - can be null - /// - public object Key { get; set; } - - /// - /// Gets the current time of the tween. - /// - public float CurrentTime { - get { return currentTime; } - } - - /// - /// Gets the duration of the tween. - /// - public float Duration { - get { return duration; } - } - - /// - /// Delay before starting the tween - /// - public float Delay { get; set; } - - /// - /// Gets the current state of the tween. - /// - public TweenState State { - get { return state; } - } - - /// - /// Gets the starting value of the tween. - /// - public T StartValue { - get { return start; } - } - - /// - /// Gets the ending value of the tween. - /// - public T EndValue { - get { return end; } - } - - /// - /// Gets the current value of the tween. - /// - public T CurrentValue { - get { return value; } - } - - /// - /// Time function - returns elapsed time for next frame - /// - public System.Func TimeFunc { get; set; } - -#if IS_UNITY - - /// - /// The game object - null if none - /// - public GameObject GameObject { get; set; } - - /// - /// The renderer - null if none - /// - public Renderer Renderer { get; set; } - - /// - /// Whether to force update even if renderer is null or not visible or deactivated, default is false - /// - public bool ForceUpdate { get; set; } - -#endif - - /// - /// Gets the current progress of the tween (0 - 1). - /// - public float CurrentProgress { get; private set; } - - /// - /// Initializes a new Tween with a given lerp function. - /// - /// - /// C# generics are good but not good enough. We need a delegate to know how to - /// interpolate between the start and end values for the given type. - /// - /// The interpolation function for the tween type. - public Tween(Func, T, T, float, T> lerpFunc) { - this.lerpFunc = lerpFunc; - state = TweenState.Stopped; - -#if IS_UNITY - - TimeFunc = TweenFactory.DefaultTimeFunc; - -#else - - // TODO: Implement your own time functions - -#endif - } - - /// - /// Initialize a tween. - /// - /// The start value. - /// The end value. - /// The duration of the tween. - /// A function used to scale progress over time. - /// Progress callback - /// Called when the tween completes - public Tween Setup(T start, T end, float duration, Func scaleFunc, - System.Action> progress, System.Action> completion = null) { - scaleFunc = (scaleFunc ?? TweenScaleFunctions.Linear); - currentTime = 0; - this.duration = duration; - this.scaleFunc = scaleFunc; - this.progressCallback = progress; - this.completionCallback = completion; - this.start = start; - this.end = end; - - return this; - } - - /// - /// Starts a tween. Setup must be called first. - /// - public void Start() { - if (state != TweenState.Running) { - if (duration <= 0.0f && Delay <= 0.0f) { - // complete immediately - value = end; - if (progressCallback != null) { - progressCallback(this); - } - if (completionCallback != null) { - completionCallback(this); - } - return; - } - - state = TweenState.Running; - UpdateValue(); - } - } - - /// - /// Pauses the tween. - /// - public void Pause() { - if (state == TweenState.Running) { - state = TweenState.Paused; - } - } - - /// - /// Resumes the paused tween. - /// - public void Resume() { - if (state == TweenState.Paused) { - state = TweenState.Running; - } - } - - /// - /// Stops the tween. - /// - /// The behavior to use to handle the stop. - public void Stop(TweenStopBehavior stopBehavior) { - if (state != TweenState.Stopped) { - state = TweenState.Stopped; - if (stopBehavior == TweenStopBehavior.Complete) { - currentTime = duration; - UpdateValue(); - if (completionCallback != null) { - completionCallback.Invoke(this); - completionCallback = null; - } - if (continueWith != null) { - continueWith.Start(); - -#if IS_UNITY - - TweenFactory.AddTween(continueWith); - -#else - - // TODO: Implement your own continueWith handling - -#endif - - continueWith = null; - } - } - } - } - - /// - /// Updates the tween. - /// - /// The elapsed time to add to the tween. - /// True if done, false if not - public bool Update(float elapsedTime) { - if (state == TweenState.Running) { - if (Delay > 0.0f) { - currentTime += elapsedTime; - if (currentTime <= Delay) { - // delay is not over yet - return false; - } else { - // set to left-over time beyond delay - currentTime = (currentTime - Delay); - Delay = 0.0f; - } - } else { - currentTime += elapsedTime; - } - - if (currentTime >= duration) { - Stop(TweenStopBehavior.Complete); - return true; - } else { - UpdateValue(); - return false; - } - } - return (state == TweenState.Stopped); - } - - /// - /// Set another tween to execute when this tween finishes. Inherits the Key and if using Unity, GameObject, - /// Renderer and ForceUpdate properties. - /// - /// Type of new tween - /// New tween - /// New tween - public Tween ContinueWith(Tween tween) - - where TNewTween : struct { - tween.Key = Key; - -#if IS_UNITY - - tween.GameObject = GameObject; - tween.Renderer = Renderer; - tween.ForceUpdate = ForceUpdate; - -#endif - - continueWith = tween; - return tween; - } - - /// - /// Helper that uses the current time, duration, and delegates to update the current value. - /// - private void UpdateValue() { -#if IS_UNITY - - if (Renderer == null || Renderer.isVisible || ForceUpdate) { -#endif - - CurrentProgress = scaleFunc(currentTime / duration); - value = lerpFunc(this, start, end, CurrentProgress); - if (progressCallback != null) { - progressCallback.Invoke(this); - } - -#if IS_UNITY - } - -#endif - } - } - - /// - /// Object used to tween float values. - /// - public class FloatTween : Tween { - private static float LerpFloat(ITween t, float start, float end, float progress) { - return start + (end - start) * progress; - } - - private static readonly Func, float, float, float, float> LerpFunc = LerpFloat; - - /// - /// Initializes a new FloatTween instance. - /// - public FloatTween() : base(LerpFunc) {} - } - - /// - /// Object used to tween Vector2 values. - /// - public class Vector2Tween : Tween { - private static Vector2 LerpVector2(ITween t, Vector2 start, Vector2 end, float progress) { - return Vector2.Lerp(start, end, progress); - } - - private static readonly Func, Vector2, Vector2, float, Vector2> LerpFunc = LerpVector2; - - /// - /// Initializes a new Vector2Tween instance. - /// - public Vector2Tween() : base(LerpFunc) {} - } - - /// - /// Object used to tween Vector3 values. - /// - public class Vector3Tween : Tween { - private static Vector3 LerpVector3(ITween t, Vector3 start, Vector3 end, float progress) { - return Vector3.Lerp(start, end, progress); - } - - private static readonly Func, Vector3, Vector3, float, Vector3> LerpFunc = LerpVector3; - - /// - /// Initializes a new Vector3Tween instance. - /// - public Vector3Tween() : base(LerpFunc) {} - } - - /// - /// Object used to tween Vector4 values. - /// - public class Vector4Tween : Tween { - private static Vector4 LerpVector4(ITween t, Vector4 start, Vector4 end, float progress) { - return Vector4.Lerp(start, end, progress); - } - - private static readonly Func, Vector4, Vector4, float, Vector4> LerpFunc = LerpVector4; - - /// - /// Initializes a new Vector4Tween instance. - /// - public Vector4Tween() : base(LerpFunc) {} - } - - /// - /// Object used to tween Color values. - /// - public class ColorTween : Tween { - private static Color LerpColor(ITween t, Color start, Color end, float progress) { - return Color.Lerp(start, end, progress); - } - - private static readonly Func, Color, Color, float, Color> LerpFunc = LerpColor; - - /// - /// Initializes a new ColorTween instance. - /// - public ColorTween() : base(LerpFunc) {} - } - - /// - /// Object used to tween Quaternion values. - /// - public class QuaternionTween : Tween { - private static Quaternion LerpQuaternion( - ITween t, Quaternion start, Quaternion end, float progress) { - return Quaternion.Lerp(start, end, progress); - } - - private static readonly Func, Quaternion, Quaternion, float, Quaternion> LerpFunc = - LerpQuaternion; - - /// - /// Initializes a new QuaternionTween instance. - /// - public QuaternionTween() : base(LerpFunc) {} - } - - /// - /// Tween scale functions - /// Implementations based on http://theinstructionlimit.com/flash-style-tweeneasing-functions-in-c, which are based - /// on http://www.robertpenner.com/easing/ - /// - public static class TweenScaleFunctions { - private const float halfPi = Mathf.PI * 0.5f; - - /// - /// A linear progress scale function. - /// - public static readonly Func Linear = LinearFunc; - - private static float LinearFunc(float progress) { - return progress; - } - - /// - /// A quadratic (x^2) progress scale function that eases in. - /// - public static readonly Func QuadraticEaseIn = QuadraticEaseInFunc; - - private static float QuadraticEaseInFunc(float progress) { - return EaseInPower(progress, 2); - } - - /// - /// A quadratic (x^2) progress scale function that eases out. - /// - public static readonly Func QuadraticEaseOut = QuadraticEaseOutFunc; - - private static float QuadraticEaseOutFunc(float progress) { - return EaseOutPower(progress, 2); - } - - /// - /// A quadratic (x^2) progress scale function that eases in and out. - /// - public static readonly Func QuadraticEaseInOut = QuadraticEaseInOutFunc; - - private static float QuadraticEaseInOutFunc(float progress) { - return EaseInOutPower(progress, 2); - } - - /// - /// A cubic (x^3) progress scale function that eases in. - /// - public static readonly Func CubicEaseIn = CubicEaseInFunc; - - private static float CubicEaseInFunc(float progress) { - return EaseInPower(progress, 3); - } - - /// - /// A cubic (x^3) progress scale function that eases out. - /// - public static readonly Func CubicEaseOut = CubicEaseOutFunc; - - private static float CubicEaseOutFunc(float progress) { - return EaseOutPower(progress, 3); - } - - /// - /// A cubic (x^3) progress scale function that eases in and out. - /// - public static readonly Func CubicEaseInOut = CubicEaseInOutFunc; - - private static float CubicEaseInOutFunc(float progress) { - return EaseInOutPower(progress, 3); - } - - /// - /// A quartic (x^4) progress scale function that eases in. - /// - public static readonly Func QuarticEaseIn = QuarticEaseInFunc; - - private static float QuarticEaseInFunc(float progress) { - return EaseInPower(progress, 4); - } - - /// - /// A quartic (x^4) progress scale function that eases out. - /// - public static readonly Func QuarticEaseOut = QuarticEaseOutFunc; - - private static float QuarticEaseOutFunc(float progress) { - return EaseOutPower(progress, 4); - } - - /// - /// A quartic (x^4) progress scale function that eases in and out. - /// - public static readonly Func QuarticEaseInOut = QuarticEaseInOutFunc; - - private static float QuarticEaseInOutFunc(float progress) { - return EaseInOutPower(progress, 4); - } - - /// - /// A quintic (x^5) progress scale function that eases in. - /// - public static readonly Func QuinticEaseIn = QuinticEaseInFunc; - - private static float QuinticEaseInFunc(float progress) { - return EaseInPower(progress, 5); - } - - /// - /// A quintic (x^5) progress scale function that eases out. - /// - public static readonly Func QuinticEaseOut = QuinticEaseOutFunc; - - private static float QuinticEaseOutFunc(float progress) { - return EaseOutPower(progress, 5); - } - - /// - /// A quintic (x^5) progress scale function that eases in and out. - /// - public static readonly Func QuinticEaseInOut = QuinticEaseInOutFunc; - - private static float QuinticEaseInOutFunc(float progress) { - return EaseInOutPower(progress, 5); - } - - /// - /// A sine progress scale function that eases in. - /// - public static readonly Func SineEaseIn = SineEaseInFunc; - - private static float SineEaseInFunc(float progress) { - return Mathf.Sin(progress * halfPi - halfPi) + 1; - } - - /// - /// A sine progress scale function that eases out. - /// - public static readonly Func SineEaseOut = SineEaseOutFunc; - - private static float SineEaseOutFunc(float progress) { - return Mathf.Sin(progress * halfPi); - } - - /// - /// A sine progress scale function that eases in and out. - /// - public static readonly Func SineEaseInOut = SineEaseInOutFunc; - - private static float SineEaseInOutFunc(float progress) { - return (Mathf.Sin(progress * Mathf.PI - halfPi) + 1) / 2; - } - - private static float EaseInPower(float progress, int power) { - return Mathf.Pow(progress, power); - } - - private static float EaseOutPower(float progress, int power) { - int sign = power % 2 == 0 ? -1 : 1; - return (sign * (Mathf.Pow(progress - 1, power) + sign)); - } - - private static float EaseInOutPower(float progress, int power) { - progress *= 2.0f; - if (progress < 1) { - return Mathf.Pow(progress, power) / 2.0f; - } else { - int sign = power % 2 == 0 ? -1 : 1; - return (sign / 2.0f * (Mathf.Pow(progress - 2, power) + sign * 2)); - } - } - } -} \ No newline at end of file diff --git a/engine/Assets/Scripts/Tween/Tween.cs.meta b/engine/Assets/Scripts/Tween/Tween.cs.meta deleted file mode 100644 index 28c061bd18..0000000000 --- a/engine/Assets/Scripts/Tween/Tween.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 96aee4e6410e5c149aa48287d2bb7112 -timeCreated: 1455294094 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/UI.meta b/engine/Assets/Scripts/UI.meta deleted file mode 100644 index f8ffaa4a57..0000000000 --- a/engine/Assets/Scripts/UI.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 4d2d16a50a984155adea8d628cf7524e -timeCreated: 1624312288 \ No newline at end of file diff --git a/engine/Assets/Scripts/UI/ContextMenu.meta b/engine/Assets/Scripts/UI/ContextMenu.meta deleted file mode 100644 index b950a91b2b..0000000000 --- a/engine/Assets/Scripts/UI/ContextMenu.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 32bb28c7d77ad9943b16192f3433f5af -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/UI/ContextMenu/ContextItem.cs b/engine/Assets/Scripts/UI/ContextMenu/ContextItem.cs deleted file mode 100644 index 6b2bb7ada5..0000000000 --- a/engine/Assets/Scripts/UI/ContextMenu/ContextItem.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.Net.Http.Headers; -using System; -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.UI; -using TMPro; - -namespace Synthesis.UI.ContextMenus { - public class ContextItem : MonoBehaviour { - public TMP_Text TextObj; - public Image IconImage; - - public InteractableObject Creator; - private Action callback; - public Action Callback { - get => callback; - set => callback = value; - } - public Sprite Icon { - get => IconImage.sprite; - set => IconImage.sprite = value; - } - public string Text { - get => TextObj.text; - set { - TextObj.text = value; - gameObject.name = value; - } - } - - public void OnClick() { - ContextMenu.Hide(); - callback(Creator); - } - } -} diff --git a/engine/Assets/Scripts/UI/ContextMenu/ContextItem.cs.meta b/engine/Assets/Scripts/UI/ContextMenu/ContextItem.cs.meta deleted file mode 100644 index 38dfca5d78..0000000000 --- a/engine/Assets/Scripts/UI/ContextMenu/ContextItem.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 93611d1b735a00741bc288c190c1c712 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/UI/ContextMenu/ContextMenu.cs b/engine/Assets/Scripts/UI/ContextMenu/ContextMenu.cs deleted file mode 100644 index 066f87a882..0000000000 --- a/engine/Assets/Scripts/UI/ContextMenu/ContextMenu.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using UnityEngine; -using UnityEngine.EventSystems; -using UnityEngine.UI; -using Synthesis.Util; -using TMPro; - -// Todo: Descriptions -namespace Synthesis.UI.ContextMenus { - public class ContextMenu : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler { - public static bool IsShowing { get; private set; } = false; - - public CanvasScaler canvasScaler; - public static CanvasScaler CanvasScaler => contextMenu.canvasScaler; - - public GameObject ContextItem; - public Transform ContentContainer; - private List SpawnedItems = new List(); - - private static ContextMenu contextMenu; - private static InteractableObject CurrentInteraction = null; - - private bool isMouseOverMe = false; - - private void Awake() { - contextMenu = this; - gameObject.SetActive(false); - } - - public static void Show(InteractableObject sender, Vector2 pos, string title, T interactable) - where T : InteractableObject { - Show(sender, pos, title, InteractableObject.GetInteractableOptions(interactable)); - } - - public static void Show(InteractableObject sender, Vector2 pos, string title, - IEnumerable<(string title, Sprite icon, Action callback)> description) { - // This order?? - Hide(); - contextMenu.gameObject.SetActive(true); - if (IsShowing) - ResetItems(); - - // Spawn in items - description.ForEach(x => { - var item = - Instantiate(contextMenu.ContextItem, contextMenu.ContentContainer).GetComponent(); - item.Text = x.title; - if (x.icon == null) { - item.IconImage.color = new Color(0, 0, 0, 0); - } else { - item.Icon = x.icon; - } - item.Callback = x.callback; - item.Creator = sender; - contextMenu.SpawnedItems.Add(item.gameObject); - }); - - // Move menu - contextMenu.GetComponent().position = pos; - - IsShowing = true; - sender.IsBeingInteractedWith = true; - CurrentInteraction = sender; - } - - public static void Hide() { - ResetItems(); - if (CurrentInteraction != null) { - CurrentInteraction.IsBeingInteractedWith = false; - CurrentInteraction = null; - } - - contextMenu.gameObject.SetActive(false); - - IsShowing = false; - } - - private static void ResetItems() { - contextMenu.SpawnedItems.RemoveAll(x => { - Destroy(x); - return true; - }); - } - - public void OnPointerEnter(PointerEventData eventData) => isMouseOverMe = true; - - public void OnPointerExit(PointerEventData eventData) => isMouseOverMe = false; - } -} diff --git a/engine/Assets/Scripts/UI/ContextMenu/ContextMenu.cs.meta b/engine/Assets/Scripts/UI/ContextMenu/ContextMenu.cs.meta deleted file mode 100644 index 47c8808a32..0000000000 --- a/engine/Assets/Scripts/UI/ContextMenu/ContextMenu.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: a4c7a2a6f388ce049999e6b0967454e2 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/UI/Dynamic.meta b/engine/Assets/Scripts/UI/Dynamic.meta deleted file mode 100644 index 5aeb0ea3ad..0000000000 --- a/engine/Assets/Scripts/UI/Dynamic.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: e59960bc75b291f4ba0d5382e3788a3f -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/engine/Assets/Scripts/UI/Dynamic/DynamicUIComponents.cs b/engine/Assets/Scripts/UI/Dynamic/DynamicUIComponents.cs deleted file mode 100644 index 49a18d1d71..0000000000 --- a/engine/Assets/Scripts/UI/Dynamic/DynamicUIComponents.cs +++ /dev/null @@ -1,1850 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using Synthesis.Util; -using SynthesisAPI.Utilities; -using UnityEngine; -using UnityEngine.UI; -using TMPro; -using UI; -using UI.Dynamic.Modals.Spawning; -using UI.EventListeners; -using UnityEngine.EventSystems; -using UnityEngine.PlayerLoop; -using Utilities.ColorManager; -using UButton = UnityEngine.UI.Button; -using UToggle = UnityEngine.UI.Toggle; -using USlider = UnityEngine.UI.Slider; -using UImage = UnityEngine.UI.Image; -using UScrollbar = UnityEngine.UI.Scrollbar; -using UScrollView = UnityEngine.UI.ScrollRect; - -using Logger = SynthesisAPI.Utilities.Logger; -using Math = System.Math; -using Object = UnityEngine.Object; - -#nullable enable - -namespace Synthesis.UI.Dynamic { - -#region Abstracts - - public abstract class PanelDynamic { - public const float MAIN_CONTENT_HORZ_PADDING = 25f; - public Vector2 TweenDirection = Vector2.right; - public bool IsClosing = false; - - private float _leftContentPadding, _rightContentPadding; - public float LeftContentPadding => _leftContentPadding; - public float RightContentPadding => _rightContentPadding; - - private Vector2 _mainContentSize; // Shouldn't really be used after init is called - private GameObject _unityObject; - public GameObject UnityObject => _unityObject; - // Default for Modal - private Transform _footer; - protected Transform Footer => _footer; - private Button _cancelButton; - private RectTransform _headerRt; - protected RectTransform HeaderRt => _headerRt; - protected Button CancelButton => _cancelButton; - private Button _acceptButton; - protected Button AcceptButton => _acceptButton; - - private Image _panelIcon; - protected Image PanelIcon => _panelIcon; - - private Button _middleButton; - - private Image _panelBackground; - protected Image PanelBackground => _panelBackground; - private Label _title; - protected Label Title => _title; - - private Content _mainContent; - protected Content MainContent => _mainContent; - - private bool _hidden = false; - public bool Hidden { - get => _hidden; - set { - if (value != _hidden) { - _hidden = value; - if (_unityObject != null) - _unityObject.SetActive(!_hidden); - OnVisibilityChange(); - } - } - } - - protected Button MiddleButton { - get { - if (_middleButton == null) { - GameObject buttonPrefab = SynthesisAssetCollection.GetUIPrefab("dynamic-panel-base") - .transform.Find("Footer") - .Find("Accept") - .gameObject; - RectTransform buttonTransform = - GameObject.Instantiate(buttonPrefab, Footer).GetComponent(); - - buttonTransform.anchorMin = new Vector2(0.5f, 0f); - buttonTransform.anchorMax = new Vector2(0.5f, 0f); - buttonTransform.pivot = new Vector2(1f, 0f); - - buttonTransform.localPosition = new Vector3( - buttonTransform.rect.width / 2f, AcceptButton.RootGameObject.transform.localPosition.y, 0); - - Button middleButton = new Button(null!, buttonTransform.gameObject, null); - middleButton.Image.SetColor(ColorManager.SynthesisColor.AcceptButton); - middleButton.Label?.SetColor(ColorManager.SynthesisColor.AcceptCancelButtonText); - - _middleButton = middleButton; - return middleButton; - } - - return _middleButton; - } - } - - public Action OnAccepted; - - protected PanelDynamic(Vector2 mainContentSize, float leftContentPadding = MAIN_CONTENT_HORZ_PADDING, - float rightContentPadding = MAIN_CONTENT_HORZ_PADDING) { - _mainContentSize = mainContentSize; - _leftContentPadding = leftContentPadding; - _rightContentPadding = rightContentPadding; - } - - public void Create_Internal(GameObject unityObject) { - _unityObject = unityObject; - - var header = _unityObject.transform.Find("Header"); - _headerRt = header.GetComponent(); - - _panelIcon = new Image(null, header.Find("Image").gameObject); - _panelIcon.SetColor(ColorManager.SynthesisColor.MainText); - _panelIcon.RootGameObject.SetActive(false); - - _panelBackground = new Image(null, unityObject); - _panelBackground.SetColor(ColorManager.GetColor(ColorManager.SynthesisColor.Background)); - _panelBackground.SetCornerRadius(20); - - _title = new Label(null, header.Find("Title").gameObject, null); - - _footer = _unityObject.transform.Find("Footer"); - var footerRt = _footer.GetComponent(); - - _cancelButton = new Button(null!, _footer.Find("Cancel").gameObject, null); - _cancelButton.AddOnClickedEvent(b => { - if (!DynamicUIManager.ClosePanel(this.GetType())) - Logger.Log("Failed to Close Panel", LogLevel.Error); - }); - _cancelButton.Image.SetColor(ColorManager.GetColor(ColorManager.SynthesisColor.CancelButton)); - - _cancelButton.Label?.SetColor(ColorManager.GetColor(ColorManager.SynthesisColor.AcceptCancelButtonText)); - _acceptButton = new Button(null!, _footer.Find("Accept").gameObject, null); - - _acceptButton.Image.SetColor(ColorManager.GetColor(ColorManager.SynthesisColor.AcceptButton)); - _acceptButton.Label!.SetColor(ColorManager.GetColor(ColorManager.SynthesisColor.AcceptCancelButtonText)); - _acceptButton.AddOnClickedEvent(b => { - if (OnAccepted != null) - OnAccepted.Invoke(); - }); - - // Create Inital Content Component - var hiddenContentT = _unityObject.transform.Find("Content"); - var hiddenRt = hiddenContentT.GetComponent(); - hiddenRt.sizeDelta = new Vector2(hiddenRt.sizeDelta.x, _mainContentSize.y); - hiddenRt.anchorMin = new Vector2(0, 1); - hiddenRt.anchorMax = new Vector2(1, 1); - hiddenRt.pivot = new Vector2(0.5f, 1); - hiddenRt.anchoredPosition = new Vector2(0, -_headerRt.sizeDelta.y); - var actualContentObj = - GameObject.Instantiate(SynthesisAssetCollection.GetUIPrefab("content-base"), hiddenContentT); - actualContentObj.name = "CentralContent"; - var contentRt = actualContentObj.GetComponent(); - contentRt.offsetMax = new Vector2(-_rightContentPadding, contentRt.offsetMax.y); - contentRt.offsetMin = new Vector2(_leftContentPadding, contentRt.offsetMin.y); - var modalRt = _unityObject.GetComponent(); - modalRt.sizeDelta = new Vector2(_mainContentSize.x + (_leftContentPadding + _rightContentPadding), - hiddenRt.sizeDelta.y + _headerRt.sizeDelta.y + footerRt.sizeDelta.y); - _mainContent = new Content(null!, actualContentObj, _mainContentSize); - } - - public abstract bool Create(); - public abstract void Update(); - public abstract void Delete(); - - protected virtual void OnVisibilityChange() {} - - public void Delete_Internal() => Object.Destroy(_unityObject); - public void ClearContent() => MainContent.DeleteAllChildren(); - - protected Content Strip(Vector2? newContentSize = null, float leftPadding = 0f, float rightPadding = 0f, - float topPadding = 0f, float bottomPadding = 0f) { - CancelButton.RootGameObject.SetActive(false); - AcceptButton.RootGameObject.SetActive(false); - Title.RootGameObject.SetActive(false); - PanelIcon.RootGameObject.SetActive(false); - - var panel = new Content(null, UnityObject, null); - if (newContentSize.HasValue) { - panel.SetSize(new Vector2(newContentSize.Value.x + leftPadding + rightPadding, - newContentSize.Value.y + topPadding + bottomPadding)); - } - panel.SetAnchors(new Vector2(0.5f, 0.0f), new Vector2(0.5f, 0.0f)); - panel.SetPivot(new Vector2(0.5f, 0.0f)); - panel.SetAnchoredPosition(new Vector2(0.0f, 10.0f)); - var newMainContent = - panel.CreateSubContent(newContentSize ?? new Vector2(panel.Size.x - (rightPadding + leftPadding), - panel.Size.y - (topPadding + bottomPadding))); - newMainContent.SetStretch(leftPadding, rightPadding, topPadding, bottomPadding); - - return newMainContent; - } - - protected Content CenterAtBottom(Vector2? newContentSize = null, float leftPadding = 0f, - float rightPadding = 0f, float topPadding = 0f, float bottomPadding = 0f) { - var panel = new Content(null, UnityObject, null); - if (newContentSize.HasValue) { - panel.SetSize(new Vector2(newContentSize.Value.x + leftPadding + rightPadding, - newContentSize.Value.y + topPadding + bottomPadding)); - } - panel.SetAnchors(new Vector2(0.5f, 0.0f), new Vector2(0.5f, 0.0f)); - panel.SetPivot(new Vector2(0.5f, 0.0f)); - panel.SetAnchoredPosition(new Vector2(0.0f, 10.0f)); - var newMainContent = - panel.CreateSubContent(newContentSize ?? new Vector2(panel.Size.x - (rightPadding + leftPadding), - panel.Size.y - (topPadding + bottomPadding))); - newMainContent.SetStretch(leftPadding, rightPadding, topPadding, bottomPadding); - newMainContent.RootRectTransform.transform.SetSiblingIndex(2); - - return newMainContent; - } - } - - public abstract class ModalDynamic { - public const float MAIN_CONTENT_HORZ_PADDING = 35f; - - private Vector2 _mainContentSize; // Shouldn't really be used after init is called - private GameObject _unityObject; - - private RectTransform _headerRt; - private RectTransform _footerRt; - public GameObject UnityObject => _unityObject; - - // Default for Modal - private Button _cancelButton; - public Button CancelButton => _cancelButton; - private Button _acceptButton; - protected Button AcceptButton => _acceptButton; - private Image _modalIcon; - protected Image ModalIcon => _modalIcon; - private Image _modalBackground; - protected Image ModalBackground => _modalBackground; - - private Label _title; - protected Label Title => _title; - private Label _description; - protected Label Description => _description; - private Transform _footer; - protected Transform Footer => _footer; - private Content _mainContent; - protected Content MainContent => _mainContent; - private Button? _middleButton; - - public Action OnAccepted; - public Action OnCancelled; - - protected Button MiddleButton { - get { - if (_middleButton == null) { - GameObject buttonPrefab = SynthesisAssetCollection.GetUIPrefab("dynamic-modal-base") - .transform.Find("Footer") - .Find("Accept") - .gameObject; - RectTransform buttonTransform = - GameObject.Instantiate(buttonPrefab, Footer).GetComponent(); - - buttonTransform.anchorMin = new Vector2(0.5f, 0f); - buttonTransform.anchorMax = new Vector2(0.5f, 0f); - buttonTransform.pivot = new Vector2(1f, 0f); - - buttonTransform.localPosition = new Vector3( - buttonTransform.rect.width / 2f, AcceptButton.RootGameObject.transform.localPosition.y, 0); - - Button middleButton = new Button(null!, buttonTransform.gameObject, null); - middleButton.Image.SetColor(ColorManager.SynthesisColor.AcceptButton); - middleButton.Label?.SetColor(ColorManager.SynthesisColor.AcceptCancelButtonText); - - _middleButton = middleButton; - return middleButton; - } - - return _middleButton; - } - } - - protected ModalDynamic(Vector2 mainContentSize) { - _mainContentSize = mainContentSize; - } - - public void Create_Internal(GameObject unityObject) { - _unityObject = unityObject; - - // Grab Customizable Modal Components - - var header = _unityObject.transform.Find("Header"); - _headerRt = header.GetComponent(); - _modalIcon = new Image(null, header.Find("Image").gameObject); - _modalIcon.SetColor(ColorManager.SynthesisColor.MainText); - - _modalBackground = new Image(null, unityObject); - _modalBackground.SetColor(ColorManager.GetColor(ColorManager.SynthesisColor.Background)); - _modalBackground.SetCornerRadius(35); - - _title = new Label(null, header.Find("Title").gameObject, null); - _title.SetColor(ColorManager.GetColor(ColorManager.SynthesisColor.MainText)); - - _description = new Label(null, header.Find("Description").gameObject, null); - _description.SetColor(ColorManager.GetColor(ColorManager.SynthesisColor.MainText)); - - _footer = _unityObject.transform.Find("Footer"); - - _footerRt = _footer.GetComponent(); - _cancelButton = new Button(null!, _footer.Find("Cancel").gameObject, null); - _cancelButton.AddOnClickedEvent(b => { - if (!DynamicUIManager.CloseActiveModal()) - Logger.Log("Failed to Close Modal", LogLevel.Error); - }); - _cancelButton.Image.SetColor(ColorManager.GetColor(ColorManager.SynthesisColor.CancelButton)); - _cancelButton.Label.SetColor(ColorManager.GetColor(ColorManager.SynthesisColor.AcceptCancelButtonText)); - _acceptButton = new Button(null!, _footer.Find("Accept").gameObject, null); - _acceptButton.Image.SetColor(ColorManager.GetColor(ColorManager.SynthesisColor.AcceptButton)); - _acceptButton.Label.SetColor(ColorManager.GetColor(ColorManager.SynthesisColor.AcceptCancelButtonText)); - - _cancelButton.AddOnClickedEvent(b => { - if (OnCancelled != null) - OnCancelled.Invoke(); - }); - _acceptButton.AddOnClickedEvent(b => { - if (OnAccepted != null) - OnAccepted.Invoke(); - }); - - // Create Inital Content Component - var hiddenContentT = _unityObject.transform.Find("Content"); - var hiddenRt = hiddenContentT.GetComponent(); - hiddenRt.sizeDelta = new Vector2(hiddenRt.sizeDelta.x, _mainContentSize.y); - hiddenRt.anchorMin = new Vector2(0, 1); - hiddenRt.anchorMax = new Vector2(1, 1); - hiddenRt.pivot = new Vector2(0.5f, 1); - hiddenRt.anchoredPosition = new Vector2(0, -_headerRt.sizeDelta.y); - var actualContentObj = - GameObject.Instantiate(SynthesisAssetCollection.GetUIPrefab("content-base"), hiddenContentT); - actualContentObj.name = "CentralContent"; - var contentRt = actualContentObj.GetComponent(); - contentRt.offsetMax = new Vector2(-MAIN_CONTENT_HORZ_PADDING, contentRt.offsetMax.y); - contentRt.offsetMin = new Vector2(MAIN_CONTENT_HORZ_PADDING, contentRt.offsetMin.y); - var modalRt = _unityObject.GetComponent(); - modalRt.sizeDelta = new Vector2(_mainContentSize.x + (MAIN_CONTENT_HORZ_PADDING * 2), - hiddenRt.sizeDelta.y + _headerRt.sizeDelta.y + _footerRt.sizeDelta.y); - _mainContent = new Content(null!, actualContentObj, _mainContentSize); - } - - public abstract void Create(); - public abstract void Update(); - public abstract void Delete(); - - public void Delete_Internal() => Object.Destroy(_unityObject); - - protected void ClearAndResizeContent(Vector2 size, bool resetButtons = true) { - ClearMainContent(); - ResizeMainContent(size); - - if (!resetButtons) - return; - - AcceptButton.ClearOnClickedEvents().ApplyTemplate(Button.EnableAcceptButton); - CancelButton.ClearOnClickedEvents().ApplyTemplate(Button.EnableCancelButton); - } - - protected void ClearMainContent() => MainContent.DeleteAllChildren(); - - protected void ResizeMainContent(Vector2 size) { - // Reposition all elements - foreach (Transform child in MainContent.RootGameObject.transform) { - ((RectTransform) child.transform).anchoredPosition += (size - _mainContentSize) / 2f; - } - - _mainContentSize = size; - - var hiddenContentT = _unityObject.transform.Find("Content"); - var hiddenRt = hiddenContentT.GetComponent(); - hiddenRt.sizeDelta = new Vector2(hiddenRt.sizeDelta.x, _mainContentSize.y); - hiddenRt.anchorMin = new Vector2(0, 1); - hiddenRt.anchorMax = new Vector2(1, 1); - hiddenRt.pivot = new Vector2(0.5f, 1); - hiddenRt.anchoredPosition = new Vector2(0, -_headerRt.sizeDelta.y); - var actualContentObj = MainContent.RootGameObject; - actualContentObj.name = "CentralContent"; - var contentRt = actualContentObj.GetComponent(); - contentRt.offsetMax = new Vector2(-MAIN_CONTENT_HORZ_PADDING, contentRt.offsetMax.y); - contentRt.offsetMin = new Vector2(MAIN_CONTENT_HORZ_PADDING, contentRt.offsetMin.y); - var modalRt = _unityObject.GetComponent(); - modalRt.sizeDelta = new Vector2(_mainContentSize.x + (MAIN_CONTENT_HORZ_PADDING * 2), - hiddenRt.sizeDelta.y + _headerRt.sizeDelta.y + _footerRt.sizeDelta.y); - _mainContent = new Content(null!, actualContentObj, _mainContentSize); - } - } - - public abstract class UIComponent { - public static Func VerticalLayout = (u) => { - var offset = (-u.Parent!.RectOfChildren(u).yMin) + 7.5f; - u.SetTopStretch(anchoredY: offset); - return u; - }; - - public static Func VerticalLayoutNoSpacing = (u) => { - var offset = (-u.Parent!.RectOfChildren(u).yMin); - u.SetTopStretch(anchoredY: offset); - return u; - }; - - public static Func VerticalLayoutBigSpacing = (u) => { - var offset = (-u.Parent!.RectOfChildren(u).yMin + 15f); - u.SetTopStretch(anchoredY: offset); - return u; - }; - - public float HeightOfChildren { - get { - float sum = 0f; - Children.ForEach(x => sum += x.Size.y); - return sum; - } - } - public float WidthOfChildren { - get { - float sum = 0f; - Children.ForEach(x => sum += x.Size.x); - return sum; - } - } - - public Rect RectOfChildren(UIComponent negate = null!) { - if (Children.Count == 0) - return new Rect(); - bool hasInital = false; - Rect r = new Rect(); - for (int i = 0; i < Children.Count; i++) { - if (Children[i] == negate) - continue; - if (!hasInital) { - r = Children[i].RootRectTransform.GetOffsetRect(); - continue; - } - var childTrans = Children[i].RootRectTransform; - var childRect = childTrans.GetOffsetRect(); - - if (childRect.xMin < r.xMin) - r.xMin = childRect.xMin; - if (childRect.xMax > r.xMax) - r.xMax = childRect.xMax; - if (childRect.yMin < r.yMin) - r.yMin = childRect.yMin; - if (childRect.yMax > r.yMax) - r.yMax = childRect.yMax; - } - return r; - } - - public void DeleteAllChildren() { - Children.ForEach(x => { GameObject.Destroy(x.RootGameObject); }); - Children.Clear(); - } - - protected bool _eventsActive = true; - // clang-format off - public bool EventsActive => _eventsActive; - // clang-format on - - public Vector2 Size { get; protected set; } - public GameObject RootGameObject { get; protected set; } - public RectTransform RootRectTransform { get; protected set; } - public UIComponent? Parent { get; protected set; } - protected List Children = new List(); - - public IReadOnlyList ChildrenReadOnly => Children.AsReadOnly(); - - public UIComponent(UIComponent? parentComponent, GameObject rootGameObject) { - Parent = parentComponent; - RootGameObject = rootGameObject; - RootRectTransform = rootGameObject.GetComponent(); - Size = RootRectTransform.sizeDelta; - } - - private void SetAnchorOffset(Vector2 aMin, Vector2 aMax, Vector2 oMin, Vector2 oMax) { - RootRectTransform.anchorMin = aMin; - RootRectTransform.anchorMax = aMax; - RootRectTransform.offsetMin = oMin; - RootRectTransform.offsetMax = oMax; - } - public T SetTopStretch(float leftPadding = 0f, float rightPadding = 0f, float anchoredY = 0f) - where T : UIComponent { - SetAnchorOffset( - new Vector2(0, 1), new Vector2(1, 1), new Vector2(leftPadding, -Size.y), new Vector2(-rightPadding, 0)); - RootRectTransform.pivot = new Vector2(RootRectTransform.pivot.x, 1); - RootRectTransform.anchoredPosition = new Vector2(RootRectTransform.anchoredPosition.x, -anchoredY); - return (this as T)!; - } - public T SetBottomStretch(float leftPadding = 0f, float rightPadding = 0f, float anchoredY = 0f) - where T : UIComponent { - SetAnchorOffset( - new Vector2(0, 0), new Vector2(1, 0), new Vector2(leftPadding, 0), new Vector2(-rightPadding, Size.y)); - RootRectTransform.pivot = new Vector2(RootRectTransform.pivot.x, 0); - RootRectTransform.anchoredPosition = new Vector2(RootRectTransform.anchoredPosition.x, anchoredY); - return (this as T)!; - } - public T SetLeftStretch(float topPadding = 0f, float bottomPadding = 0f, float anchoredX = 0f) - where T : UIComponent { - SetAnchorOffset( - new Vector2(0, 0), new Vector2(0, 1), new Vector2(0, bottomPadding), new Vector2(Size.x, -topPadding)); - RootRectTransform.pivot = new Vector2(0, RootRectTransform.pivot.y); - RootRectTransform.anchoredPosition = new Vector2(anchoredX, RootRectTransform.anchoredPosition.y); - return (this as T)!; - } - public T SetRightStretch(float topPadding = 0f, float bottomPadding = 0f, float anchoredX = 0f) - where T : UIComponent { - SetAnchorOffset( - new Vector2(1, 0), new Vector2(1, 1), new Vector2(-Size.x, bottomPadding), new Vector2(0, -topPadding)); - RootRectTransform.pivot = new Vector2(1, RootRectTransform.pivot.y); - RootRectTransform.anchoredPosition = new Vector2(-anchoredX, RootRectTransform.anchoredPosition.y); - return (this as T)!; - } - public T SetStretch( - float leftPadding = 0f, float rightPadding = 0f, float topPadding = 0f, float bottomPadding = 0f) - where T : UIComponent { - SetAnchorOffset(new Vector2(0, 0), new Vector2(1, 1), new Vector2(leftPadding, bottomPadding), - new Vector2(-rightPadding, -topPadding)); - return (this as T)!; - } - public T SetPivot(Vector2 pivot) - where T : UIComponent { - RootRectTransform.pivot = pivot; - return (this as T)!; - } - public T SetAnchoredPosition(Vector2 pos) - where T : UIComponent { - RootRectTransform.anchoredPosition = pos; - return (this as T)!; - } - public T SetAnchor(Vector2 anchorMin, Vector2 anchorMax) - where T : UIComponent { - RootRectTransform.anchorMin = anchorMin; - RootRectTransform.anchorMax = anchorMax; - return (this as T)!; - } - public T SetSize(Vector2 size) - where T : UIComponent { - Size = size; - RootRectTransform.sizeDelta = size; - return (this as T)!; - } - public T SetWidth(float width) - where T : UIComponent { - Size = new Vector2(width, Size.y); - RootRectTransform.sizeDelta = Size; - return (this as T)!; - } - public T SetHeight(float height) - where T : UIComponent { - Size = new Vector2(Size.x, height); - RootRectTransform.sizeDelta = Size; - return (this as T)!; - } - public T ShiftOffsetMax(Vector2 shift) - where T : UIComponent { - RootRectTransform.offsetMax += shift; - return (this as T)!; - } - public T ShiftOffsetMin(Vector2 shift) - where T : UIComponent { - RootRectTransform.offsetMin += shift; - return (this as T)!; - } - public T EnableEvents() - where T : UIComponent { - _eventsActive = true; - return (this as T)!; - } - public T DisableEvents() - where T : UIComponent { - _eventsActive = false; - return (this as T)!; - } - public T SetAnchors(Vector2 min, Vector2 max) - where T : UIComponent { - RootRectTransform.anchorMin = min; - RootRectTransform.anchorMax = max; - return (this as T)!; - } - public T SetAnchorCenter() - where T : UIComponent { - RootRectTransform.anchorMin = new Vector2(0.5f, 0.5f); - RootRectTransform.anchorMax = new Vector2(0.5f, 0.5f); - return (this as T)!; - } - public T SetAnchorTop() - where T : UIComponent { - RootRectTransform.anchorMin = new Vector2(0.5f, 1); - RootRectTransform.anchorMax = new Vector2(0.5f, 1); - return (this as T)!; - } - - public T SetAnchorLeft() - where T : UIComponent { - RootRectTransform.anchorMin = new Vector2(0, 0.5f); - RootRectTransform.anchorMax = new Vector2(1, 0.5f); - return (this as T)!; - } - - public T SetBackgroundColor(ColorManager.SynthesisColor c) - where T : UIComponent { - return SetBackgroundColor(ColorManager.GetColor(c)); - } - - public T SetBackgroundColor(ColorManager.SynthesisColor start, ColorManager.SynthesisColor end) - where T : UIComponent { - return SetBackgroundColor(ColorManager.GetColor(start), ColorManager.GetColor(end)); - } - - public T SetBackgroundColor(Color color) - where T : UIComponent { - return SetBackgroundColor(color, color); - } - - public T SetBackgroundColor(Color start, Color end) - where T : UIComponent { - GradientImageUpdater gradientImage = RootGameObject.GetComponent(); - UnityEngine.UI.Image image = RootGameObject.GetComponent(); - - if (gradientImage) { - gradientImage.StartColor = start; - gradientImage.EndColor = end; - - if (image) - RootGameObject.GetComponent().color = Color.white; - gradientImage.Refresh(); - } else { - if (image) - image.color = start; - } - - return (this as T)!; - } - - public T SetHorizontalGradient(bool horizontal) - where T : UIComponent { - GradientImageUpdater gradientImage = RootGameObject.GetComponent(); - if (gradientImage) { - gradientImage.GradientAngle = Mathf.PI * (horizontal ? 0 : 1) * (3f / 2f); - gradientImage.Refresh(); - } - - return (this as T)!; - } - - public T? CheckIfNull() - where T : UIComponent { - return RootGameObject == null ? null : (this as T)!; - } - - public T SetAlpha(float alpha) - where T : UIComponent { - if (RootGameObject.TryGetComponent(out var canvasGroup)) - canvasGroup.alpha = alpha; - else - RootGameObject.AddComponent().alpha = alpha; - - return (this as T)!; - } - } - -#endregion - -#region Components - - public class Content : UIComponent { - private Image? _image; - public Image? Image => _image; - - /// - /// Creates a Content UIComponent from an existing GameObject with a set parent - /// - /// - /// - /// - /// - public Content(UIComponent? parent, GameObject unityObject, Vector2? size) : base(parent, unityObject) { - if (size != null) { - RootRectTransform.sizeDelta = size.Value; - Size = size.Value; - } else { - Size = RootRectTransform.sizeDelta; - } - - var uImg = unityObject.GetComponent(); - if (uImg != null) { - _image = new Image(this, unityObject); - } - } - - public (Content left, Content right) SplitLeftRight(float leftWidth, float padding) { - var leftContentObject = GameObject.Instantiate( - SynthesisAssetCollection.GetUIPrefab("content-base"), base.RootGameObject.transform); - var leftRt = leftContentObject.GetComponent(); - leftRt.anchorMax = new Vector2(0f, 0.5f); - leftRt.anchorMin = new Vector2(0f, 0.5f); - leftRt.pivot = new Vector2(0f, 0.5f); - leftRt.anchoredPosition = new Vector2(0f, 0f); - var leftContent = new Content(this, leftContentObject, new Vector2(leftWidth, Size.y)); - - var rightContentObject = GameObject.Instantiate( - SynthesisAssetCollection.GetUIPrefab("content-base"), base.RootGameObject.transform); - var rightRt = rightContentObject.GetComponent(); - rightRt.anchorMax = new Vector2(1f, 0.5f); - rightRt.anchorMin = new Vector2(1f, 0.5f); - float rightWidth = (Size.x - leftWidth) - padding; - rightRt.pivot = new Vector2(1f, 0.5f); - rightRt.anchoredPosition = new Vector2(0f, 0f); - var rightContent = new Content(this, rightContentObject, new Vector2(rightWidth, Size.y)); - - base.Children.Add(leftContent); - base.Children.Add(rightContent); - - return (leftContent, rightContent); - } - - public (Content top, Content bottom) SplitTopBottom(float topHeight, float padding) { - var topContentObject = GameObject.Instantiate( - SynthesisAssetCollection.GetUIPrefab("content-base"), base.RootGameObject.transform); - var topRt = topContentObject.GetComponent(); - topRt.anchorMax = new Vector2(0.5f, 1f); - topRt.anchorMin = new Vector2(0.5f, 1f); - topRt.pivot = new Vector2(0.5f, 1f); - topRt.anchoredPosition = new Vector2(0f, 0); - var topContent = new Content(this, topContentObject, new Vector2(Size.x, topHeight)); - - var bottomContentObject = GameObject.Instantiate( - SynthesisAssetCollection.GetUIPrefab("content-base"), base.RootGameObject.transform); - var bottomRt = bottomContentObject.GetComponent(); - bottomRt.anchorMax = new Vector2(0.5f, 0f); - bottomRt.anchorMin = new Vector2(0.5f, 0f); - float bottomHeight = (Size.y - topHeight) - padding; - bottomRt.pivot = new Vector2(0.5f, 0f); - bottomRt.anchoredPosition = new Vector2(0f, 0); - // rightRt.sizeDelta = new Vector2(rightWidth, rightRt.sizeDelta.y); - var bottomContent = new Content(this, bottomContentObject, new Vector2(Size.x, bottomHeight)); - - base.Children.Add(topContent); - base.Children.Add(bottomContent); - - return (topContent, bottomContent); - } - - public Label CreateLabel(float height = 15f) { - var labelObj = GameObject.Instantiate( - SynthesisAssetCollection.GetUIPrefab("label-base"), base.RootGameObject.transform); - var label = new Label(this, labelObj, new Vector2(Size.x, height)); - base.Children.Add(label); - return label; - } - - public Toggle CreateToggle(bool radioSelect = false, bool isOn = false, string label = "New Toggle") { - var toggleObj = GameObject.Instantiate( - SynthesisAssetCollection.GetUIPrefab((radioSelect) ? "radio-select-base" : "toggle-base"), - base.RootGameObject.transform); - var toggle = new Toggle(this, toggleObj, isOn, label, radioSelect); - base.Children.Add(toggle); - return toggle; - } - - public Slider CreateSlider(string label = "New Slider", string unitSuffix = "", float minValue = 0, - float maxValue = 1, float currentValue = 0) { - var sliderObj = GameObject.Instantiate( - SynthesisAssetCollection.GetUIPrefab("slider-base"), base.RootGameObject.transform); - var slider = new Slider(this, sliderObj, label, unitSuffix, minValue, maxValue, currentValue); - base.Children.Add(slider); - return slider; - } - - public Button CreateButton(string text = "New Button") { - var buttonObj = GameObject.Instantiate( - SynthesisAssetCollection.GetUIPrefab("button-base"), base.RootGameObject.transform); - var button = new Button(this, buttonObj, null); - button.StepIntoLabel(l => l.SetText(text)); - base.Children.Add(button); - return button; - } - - public LabeledButton CreateLabeledButton() { - var lButtonObj = GameObject.Instantiate( - SynthesisAssetCollection.GetUIPrefab("labeled-button-base"), base.RootGameObject.transform); - var lButton = new LabeledButton(this, lButtonObj); - base.Children.Add(lButton); - return lButton; - } - - public Dropdown CreateDropdown() { - var dropdownObj = GameObject.Instantiate( - SynthesisAssetCollection.GetUIPrefab("dropdown-base"), base.RootGameObject.transform); - var dropdown = new Dropdown(this, dropdownObj, null); - base.Children.Add(dropdown); - return dropdown; - } - - public LabeledDropdown CreateLabeledDropdown() { - var lDropdownObj = GameObject.Instantiate( - SynthesisAssetCollection.GetUIPrefab("labeled-dropdown-base"), base.RootGameObject.transform); - var lDropdown = new LabeledDropdown(this, lDropdownObj); - base.Children.Add(lDropdown); - return lDropdown; - } - - public InputField CreateInputField() { - var inputFieldObj = GameObject.Instantiate( - SynthesisAssetCollection.GetUIPrefab("input-field-base"), base.RootGameObject.transform); - var inputField = new InputField(this, inputFieldObj); - base.Children.Add(inputField); - return inputField; - } - - public ScrollView CreateScrollView() { - var scrollViewObj = GameObject.Instantiate( - SynthesisAssetCollection.GetUIPrefab("scroll-view-base"), base.RootGameObject.transform); - var scrollView = new ScrollView(this, scrollViewObj); - base.Children.Add(scrollView); - return scrollView; - } - - public Content CreateSubContent(Vector2 size) { - var contentObj = GameObject.Instantiate( - SynthesisAssetCollection.GetUIPrefab("content-base"), base.RootGameObject.transform); - var content = new Content(this, contentObj, size); - base.Children.Add(content); - return content; - } - - public NumberInputField CreateNumberInputField() { - var numberInputFieldObj = GameObject.Instantiate( - SynthesisAssetCollection.GetUIPrefab("number-input-field-base"), base.RootGameObject.transform); - var numberInputField = new NumberInputField(this, numberInputFieldObj); - base.Children.Add(numberInputField); - return numberInputField; - } - - public Content StepIntoImage(Action mod) { - if (_image != null) - mod(_image); - return this; - } - - public Content EnsureImage() { - if (_image == null) { - base.RootGameObject.AddComponent(); - _image = new Image(this, base.RootGameObject); - _image.SetSprite(SynthesisAssetCollection.GetSpriteByName("250r-rounded")); - _image.SetMultiplier(50); - } - return this; - } - } - - public class ScrollView : UIComponent { - private UScrollView _unityScrollView; - private Image _backgroundImage; - private Content _content; - public Content Content => _content; - - public ScrollView(UIComponent? parent, GameObject unityObject) : base(parent, unityObject) { - _unityScrollView = unityObject.GetComponent(); - - _content = new Content(this, unityObject.transform.Find("Viewport").Find("Content").gameObject, null); - - _backgroundImage = new Image(this, unityObject); - _backgroundImage.SetColor(ColorManager.GetColor(ColorManager.SynthesisColor.BackgroundSecondary)) - .SetCornerRadius(12); - } - - public ScrollView StepIntoContent(Action mod) { - mod(_content); - return this; - } - } - - public class Label : UIComponent { - private TMP_Text _unityText; - - public string Text => _unityText.text; - public FontStyles FontStyle => _unityText.fontStyle; - public bool IsFontSizeAutomatic => _unityText.enableAutoSizing; - - public static readonly Func VerticalLayoutTemplate = (Label label) => { - return label.SetTopStretch(anchoredY: label.Parent!.HeightOfChildren - label.Size.y + 15f); - }; - public static readonly Func BigLabelTemplate = (Label label) => { - return label.SetHeight