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
Vector3 pos = new Vector3(x, y, z); | |
GameObject cube = GameObject.Instantiate(block, pos, Quaternion.identity); | |
cube.GetComponent<Renderer>().material = new Material(Shader.Find("Standard")); | |
cube.GetComponent<Renderer>().material.color = Random.ColorHSV(); | |
cube.name = x + "_" + y + "_" + 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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class CreateQuard : MonoBehaviour | |
{ | |
public Material material; | |
// Start is called before the first frame update | |
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
import bpy | |
start_position = [-31, 138, 2.7] | |
positions = [ [0,3,2], [4, 1, 6], [3, -5, 1], [3, 10, 1], [1, 8, 1]] | |
def set_object_a_keyframe_for_location(name, xyz, frame_num): | |
ob = bpy.data.objects[name] | |
bpy.context.scene.frame_set(frame_num) | |
ob.location = xyz | |
ob.keyframe_insert(data_path="location", index = -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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using System.IO; | |
using System.Runtime.Serialization.Formatters.Binary; | |
public static class SaveSystem | |
{ |
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 ProceduralPlate : MonoBehaviour | |
{ | |
public Material material; | |
// Start is called before the first frame update | |
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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using System.Threading; | |
using System; | |
public class Threadqueuer : MonoBehaviour | |
{ | |
List<Action> functionsToRunInMainThread; |
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
Appendix A - CG Function List | |
abs( x ) | |
Absolute value of x . | |
acos( x ) | |
Arccos of x in range [0, pi], x in [-1, 1]. | |
all( x ) | |
true if all components of x != 0 - false otherwise. |
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.gameObject.tag = "Terrain"; //Note that you can’t attract gameObject to a tag that was not created, … but you can create is in code |
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 UnityEditor; | |
using UnityEngine; | |
public class BasicObjectSpawner : EditorWindow | |
{ | |
string objectBaseName = ""; | |
int objectId = 1; | |
GameObject objectToSpawn; | |
float objectScale; | |
float spawnRadius = 5f; |