Camera Look At

using UnityEngine;
using System.Collections;

public class CameraLookAt : MonoBehaviour
{
    public Transform target;

    void Update()
    {
        transform.LookAt(target);
    }
}

Translate and Rotate

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);
    }
}

Enabling and Disabling Components

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;
        }
    }
}

Update and FixedUpdate

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);
    }
}

Awake and Start

using UnityEngine;
using System.Collections;

public class AwakeAndStart : MonoBehaviour
{
    void Awake()
    {
        Debug.Log(“Awake called.”);
    }

    void Start()
    {
        Debug.Log(“Start called.”);
    }
}

Scope and Access Modifiers

Scope and Access

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);
    }
}

 

Another class

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);
    }
}

Activating Game Objects

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);
    }
}

Project Management and Bug Reporting Software

I will like to use Trello

ActiveCollab

-Pro

  • Time Tracker.
  • Easy to use and understand.
  • Budget Tracker.
  • Different Channels for each team.
  • Keep track of every project by using filters.

-Con

  • very complex.
  • use only in pc

Slack

-Pro

  • Easy to use and understand.
  • Different channel for each team.
  • Private chat.
  • phone accessibility

-Con

  • don’t show budgets.
  • don’t timelines

 

Trello

-Pro

  • card for each situation
  • easy management

-Con

  • it is a little confusing.

Building Scripting Skills

Scripts as Behavior Components 

 

Notes: 

How to build a script to change the color

 

Variables and Functions

Notes:

Variable Int 

Int as a Function

Start Function

Conventions and Syntax

Notes:

Dot Operator

Opening and closing brackets

Comments

C# vs JS syntax

Notes:

C# Script

C# Functions

JavaScript

JavaScripts Functions

Default Access in C# Script and JavaScript

IF Statements

Notes:

Decision based on a condition

Else statement as a conditional

Loops

Notes:

While Loop

Do While Loop

For Loop

For Each Loop

Classes

Notes:

MonoBehavior class

SubClass Stuff

Creating a Instance of the stuff class