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
mesh = new Mesh(); | |
mesh.indexFormat = UnityEngine.Rendering.IndexFormat.UInt32; //using 32 bit index insted 16 bit |
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 UnityEngine; | |
using UnityEditor; | |
public class IntHexBinConverter : EditorWindow | |
{ | |
//Converter 1 Variables | |
int converter_1_input_int = 0; |
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 UnityEngine; | |
using UnityEditor; | |
public class AreaOfTrinagle : EditorWindow | |
{ | |
string objectBaseName = ""; | |
int objectId = 1; |
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
public static Matrix4x4 RotateX(float aAngleRad) | |
{ | |
Matrix4x4 m = Matrix4x4.identity; // 1 0 0 0 | |
m.m11 = m.m22 = Mathf.Cos(aAngleRad); // 0 cos -sin 0 | |
m.m21 = Mathf.Sin(aAngleRad); // 0 sin cos 0 | |
m.m12 = -m.m21; // 0 0 0 1 | |
return m; | |
} | |
public static Matrix4x4 RotateY(float aAngleRad) | |
{ |
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 UnityEngine; | |
public class Generator : MonoBehaviour | |
{ | |
// Start is called before the first frame update | |
void Start() | |
{ | |
var allNumbers = CosmosCount(); |
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
var floatArray1 = new float[] { 123.45f, 123f, 45f, 1.2f, 34.5f }; | |
// create a byte array and copy the floats into it... | |
var byteArray = new byte[floatArray1.Length * 4]; | |
Buffer.BlockCopy(floatArray1, 0, byteArray, 0, byteArray.Length); | |
// create a second float array and copy the bytes into it... | |
var floatArray2 = new float[byteArray.Length / 4]; | |
Buffer.BlockCopy(byteArray, 0, floatArray2, 0, byteArray.Length); |
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 UnityEngine; | |
using System.IO; | |
public class LearningFileStreams : MonoBehaviour | |
{ | |
//https://www.tutorialspoint.com/csharp/csharp_binary_files.htm | |
void StartSSS() | |
{ |
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
//Call it in Update() | |
void CalculateFPS() | |
{ | |
fps = (int)(1.0f / Time.smoothDeltaTime); | |
} |
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
//Cartesian to polar 2d | |
float radius = Mathf.Sqrt((x * x) + (y * y)); | |
float angle = Mathf.Atan2(y, x); | |
float angle = Mathf.Atan2(py, px) * Mathf.Rad2Deg; //To get degress much more usefull | |
//TO get from zero to 1 angle / (float)(365) | |
https://docs.unity3d.com/ScriptReference/Mathf.Atan2.html |
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 UnityEngine; | |
//[ExecuteInEditMode] | |
public class LineRendererExample_000 : MonoBehaviour | |
{ | |
public LineRenderer lineRenderer; |
OlderNewer