This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
// PiXYZ SDK namespaces | |
using UnityEngine.Pixyz.Algo; | |
using UnityEngine.Pixyz.API; | |
using UnityEngine.Pixyz.Scene; | |
using UnityEngine.Pixyz.IO; | |
using UnityEngine.Pixyz.Core; | |
namespace PixyzDemo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
// This code allows the camera to focus on a specific object while | |
// moving through predefined waypoints, enhancing the cinematic effect | |
//and dynamic camera movement in your game or application. | |
public class CinematicCameraPath : MonoBehaviour | |
{ | |
[SerializeField] private Camera cameraToAnimate; // The camera that gets animated | |
[SerializeField] private Transform[] waypoints; // The points the camera will move between | |
[SerializeField] private float speed = 5.0f; // The speed of the camera movement | |
[SerializeField] private bool loop = false; // Whether the path should loop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import pxz | |
from pxz import algo, scene, io, core | |
def init_pixyz(): | |
""" | |
Initialize Pixyz and configure log level to INFO. | |
""" | |
pxz.initialize() | |
print(core.getVersion()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading.Tasks; | |
using UnityEngine; | |
using PimDeWitte.UnityMainThreadDispatcher; | |
/// <summary> | |
/// A Unity C# script to execute task asynchronously and process result on Unity main thread. | |
/// </summary> | |
/// Note: This script utilizes the UnityMainThreadDispatcher | |
/// from https://github.com/PimDeWitte/UnityMainThreadDispatcher package |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | |
# [USER PARAMETER] Desired file path | |
FILE_PATH = 'C:/output/modeldescription.json' | |
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | |
def get_metadata_dict(metadata): | |
metadata_dict = dict() | |
metadata_dict['name'] = metadata.name | |
metadata_dict['value'] = metadata.value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// PostProcessorFileCopy class contains functions to copy source folder and subfolders/files (recursive) | |
/// to build directory as post process after build. Place this class inside Editor folder. | |
/// </summary> | |
public class PostProcessorFileCopy { | |
[PostProcessBuild] | |
public static void OnPostprocessBuild(BuildTarget target, string pathToBuildfile) { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
namespace UnityEngine | |
{ | |
public static class UnityEngineEx | |
{ | |
public static T GetComponentInDirectChildren<T>(this Component parent) where T : Component | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Add mesh collider to game object | |
/// Gets all child components, looks for meshes and assings | |
/// them to gameobject meshcollider | |
/// </summary> | |
/// <param name="containerModel">The gameobject</param> | |
private void AddMeshCollider (GameObject containerModel) | |
{ | |
// Add mesh collider | |
MeshFilter meshFilter = containerModel.GetComponent<MeshFilter>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. | |
// To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/ | |
// or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. | |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Net.Sockets; | |
using System.Text; | |
using System.Threading; | |
using UnityEngine; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; using System.Collections.Generic; | |
using System.IO; using UnityEngine; | |
/// <summary> | |
/// Attach this script to an empty gameObject. Create a secondary camera | |
/// gameObject for offscreen rendering (not your main camera) and connect it | |
/// with this script. Offscreen camera should have a texture object attached to it. | |
/// OffscreenCamera texture object is used for rendering (please see camera properties). | |
/// </summary> | |
public class OffscreenRendering : MonoBehaviour { |
NewerOlder