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; | |
| using System.Collections; | |
| public static class Vibration | |
| { | |
| #if UNITY_ANDROID && !UNITY_EDITOR | |
| public static AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); | |
| public static AndroidJavaObject currentActivity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity"); | |
| public static AndroidJavaObject vibrator = currentActivity.Call<AndroidJavaObject>("getSystemService", "vibrator"); |
Beginner Programming
- https://learn.unity.com/projects/?k=%5B%22lang%3Aen%22%2C%22sl%3Abeginner%22%2C%22tag%3A5814655a090915001868ebec%22%5D&ob=starts
- https://learn.unity.com/project/c-survival-guide-quick-tips
- https://learn.unity.com/project/c-survival-guide-functions-and-methods
- https://learn.unity.com/project/c-survival-guide-variables
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
| // original source from https://github.com/mopsicus/unity-bezier-curves | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| public class SplineLine : MonoBehaviour | |
| { | |
| public LineRenderer lineRenderer; | |
| private int segmentsCount = 16; |
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
| // https://docs.unity3d.com/Manual/ShaderTut2.html | |
| Shader "Tutorial/Display Normals" | |
| { | |
| SubShader { | |
| Pass { | |
| CGPROGRAM | |
| #pragma vertex vert | |
| #pragma fragment frag |
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
| // https://forum.unity.com/threads/snap-round-3d-direction-vector-based-on-angle.905168/#post-5963291 | |
| private Vector3 findNearest(Vector3 dir) | |
| { | |
| // scale vector to unit cube | |
| float scaleDivisor = Mathf.Abs(dir.x); | |
| if (Mathf.Abs(dir.y) > scaleDivisor) | |
| scaleDivisor = Mathf.Abs(dir.y); | |
| if (Mathf.Abs(dir.z) > scaleDivisor) | |
| scaleDivisor = Mathf.Abs(dir.z); |
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
| // note, using Animation component (with autoplay disabled) | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| public class AnimPlayer : MonoBehaviour | |
| { | |
| Animation anim; | |
| void Start() |
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
| \Adobe\Acrobat DC\Acrobat\AdobeCollabSync.exe | |
| \Adobe\Acrobat DC\Acrobat\acrotray.exe | |
| Adobe\Adobe Desktop Common\ElevationManager\AdobeUpdateService.exe |
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
| // https://forum.unity.com/threads/is-it-possible-to-have-gpu-instancing-with-geometry-shader.898070/#post-5928629 | |
| Shader "Unlit/InstancedGeometryShader" | |
| { | |
| Properties | |
| { | |
| _TriangleOffset ("Triangle Offset", Float) = 0.1 | |
| _Color ("Color", Color) = (1,1,1,1) | |
| } | |
| SubShader |
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; | |
| public static class ConfigurableJointExtensions | |
| { | |
| /// <summary> | |
| /// Sets a joint's targetRotation to match a given local rotation. | |
| /// The joint transform's local rotation must be cached on Start and passed into this method. | |
| /// </summary> | |
| public static void SetTargetRotationLocal (this ConfigurableJoint joint, Quaternion targetLocalRotation, Quaternion startLocalRotation) | |
| { |