| @@ -0,0 +1,34 @@ | ||
| using System.Collections; | ||
| using System.Collections.Generic; | ||
| using UnityEngine; | ||
|
|
||
| public class RotateBridge : MonoBehaviour { | ||
|
|
||
| public float amountToRotate; | ||
| public GameObject objectToRotate; | ||
| private bool active; | ||
|
|
||
| // Use this for initialization | ||
| void Start () { | ||
| active = false; | ||
| } | ||
|
|
||
| // Update is called once per frame | ||
| void Update () { | ||
|
|
||
| } | ||
|
|
||
| private void OnMouseDown() | ||
| { | ||
| if (active == false) | ||
| { | ||
| objectToRotate.transform.Rotate(0, amountToRotate, 0, Space.Self); | ||
| active = true; | ||
| } | ||
| else if( active == true) | ||
| { | ||
| objectToRotate.transform.Rotate(0, -amountToRotate, 0, Space.Self); | ||
| active = false; | ||
| } | ||
| } | ||
| } |
| @@ -0,0 +1,18 @@ | ||
| using System.Collections; | ||
| using System.Collections.Generic; | ||
| using UnityEngine; | ||
|
|
||
| public class particleScript : MonoBehaviour { | ||
|
|
||
| public Vector3 speed; | ||
|
|
||
| // Use this for initialization | ||
| void Start () { | ||
|
|
||
| } | ||
|
|
||
| // Update is called once per frame | ||
| void Update () { | ||
| transform.Rotate(speed * Time.deltaTime); | ||
| } | ||
| } |