Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*****************
- / Coins AI
- / Library to load
- /*****************/
- using UnityEngine;
- using UnityEngine.UI;
- using System.Collections;
- using MadLevelManager;
- //Public Mean I can access via other script.
- //class that to tell that a class aka "block of data & function"
- //Coins is actually the name of my .cs file and class.
- //MonoBehaviour is to tell Unity that I use it's code :)
- public class Coins : MonoBehaviour {
- //void is set to create class for "function" there.
- //Update() is name of the function that constantly run. (no need to call it.)
- void Update() {
- //Adding a function name that way would mean to Execute it Here Now.
- RotateTheCoin();
- }
- //Void as always create a function.
- //RotateTheCoin() is the name of the function.
- //Custom name is a function to call later. So if no call is made the code will not execute.
- void RotateTheCoin() {
- //transform mean I will use the main class "transform" from one of my library
- //(mean i will move or scale or rotate.)
- //Rotate is the actual function to use.
- //"(" ")" are there to set params of the function.
- //Vector3 Is there to tell we use Axes system ( X Y Z )
- //in the Vector3 we use "up" so we will use Y in positive way
- //" * " is a multiplier sign to tell we rotate it with a power of
- //and "5" is actually the power used to rotate "Script" Holder by 5 on the axe Y in a positive way.
- transform.Rotate(Vector3.up * 5);
- }
- }
- //So basicly this script try to rotate a mesh that hold the script.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement