This file contains 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
Here is a bonus Unity example for 2D Game Design F21. Let me know what else you need! | |
====================================================================================== | |
(DE) ACTIVATING GAMEOBJECTS | |
Activate another GameObject on Start example: ShowOnStart.cs | |
Deactivate this GameObject on action (press space) example: HideOnAction.cs | |
Example Unity Project: https://drive.google.com/file/d/1qhtZZOpn83fH7DKXjtUJ8WmbGrK62By2/view?usp=sharing | |
Important: | |
1. ShowOnStart requires the GameObject you want to activate deactivated in your scene (uncheck the top-left box in its Inspector) |
This file contains 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 Spin : MonoBehaviour | |
{ | |
// Set the velocity of rotation (positive numbers go counterclockwise, negative numbers go clockwise) | |
public float spinVelocity = 10f; | |
private Rigidbody2D rb2d; |
This file contains 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; | |
using System.Collections; | |
using UnityEngine; | |
public class InkInteraction : MonoBehaviour | |
{ | |
// This is the ink JSON asset | |
[SerializeField] private TextAsset inkJSON; | |
// This is a reference to the Ink Manager script designed to run the story |
This file contains 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
// Unity C# Cheat Sheet | |
// I made these examples for students with prior exerience working with C# and Unity. | |
// Too much? Try Unity's very good tutorials to get up to speed: https://unity3d.com/learn/tutorials/topics/scripting |
OlderNewer