using UnityEngine;
using System.Collections;
public class CameraLookAt : MonoBehaviour
{
public Transform target;
void Update()
{
transform.LookAt(target);
}
}
using UnityEngine;
using System.Collections;
public class CameraLookAt : MonoBehaviour
{
public Transform target;
void Update()
{
transform.LookAt(target);
}
}
using UnityEngine;
using System.Collections;
public class TransformFunctions : MonoBehaviour
{
public float moveSpeed = 10f;
public float turnSpeed = 50f;
void Update()
{
if (Input.GetKey(KeyCode.UpArrow))
transform.Translate(Vector3.forward * moveSpeed * Time.deltaTime);
if (Input.GetKey(KeyCode.DownArrow))
transform.Translate(–Vector3.forward * moveSpeed * Time.deltaTime);
if (Input.GetKey(KeyCode.LeftArrow))
transform.Rotate(Vector3.up, –turnSpeed * Time.deltaTime);
if (Input.GetKey(KeyCode.RightArrow))
transform.Rotate(Vector3.up, turnSpeed * Time.deltaTime);
}
}
using UnityEngine;
using System.Collections;
public class EnableComponents : MonoBehaviour
{
private Light myLight;
void Start()
{
myLight = GetComponent<Light>();
}
void Update()
{
if (Input.GetKeyUp(KeyCode.Space))
{
myLight.enabled = !myLight.enabled;
}
}
}
using UnityEngine;
using System.Collections;
public class UpdateAndFixedUpdate : MonoBehaviour
{
void FixedUpdate()
{
Debug.Log(“FixedUpdate time :” + Time.deltaTime);
}
void Update()
{
Debug.Log(“Update time :” + Time.deltaTime);
}
}
using UnityEngine;
using System.Collections;
public class AwakeAndStart : MonoBehaviour
{
void Awake()
{
Debug.Log(“Awake called.”);
}
void Start()
{
Debug.Log(“Start called.”);
}
}
using UnityEngine;
using System.Collections;
public class ScopeAndAccessModifiers : MonoBehaviour
{
public int alpha = 5;
private int beta = 0;
private int gamma = 5;
private AnotherClass myOtherClass;
void Start()
{
alpha = 29;
myOtherClass = new AnotherClass();
myOtherClass.FruitMachine(alpha, myOtherClass.apples);
}
void Example(int pens, int crayons)
{
int answer;
answer = pens * crayons * alpha;
Debug.Log(answer);
}
void Update()
{
Debug.Log(“Alpha is set to: “ + alpha);
}
}
using UnityEngine;
using System.Collections;
public class AnotherClass
{
public int apples;
public int bananas;
private int stapler;
private int sellotape;
public void FruitMachine(int a, int b)
{
int answer;
answer = a + b;
Debug.Log(“Fruit total: “ + answer);
}
private void OfficeSort(int a, int b)
{
int answer;
answer = a + b;
Debug.Log(“Office Supplies total: “ + answer);
}
}
using UnityEngine;
using System.Collections;
public class CheckState : MonoBehaviour
{
public GameObject myObject;
void Start()
{
Debug.Log(“Active Self: “ + myObject.activeSelf);
Debug.Log(“Active in Hierarchy” + myObject.activeInHierarchy);
}
}
I will like to use Trello
ActiveCollab
-Pro
-Con
-Pro
-Con
-Pro
-Con
Default Access in C# Script and JavaScript
Else statement as a conditional
Creating a Instance of the stuff class