Created
September 15, 2017 08:38
-
-
Save EdSkamor/b8c17aa1f2935a1e9a0b574ae6c2dc3f to your computer and use it in GitHub Desktop.
iDontKnowWhatItsDo
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; | |
using UnityStandardAssets.CrossPlatformInput; | |
public class GizmosScript : MonoBehaviour | |
{ | |
[SerializeField] float rotSpeed = 90f; | |
[Range(0f, 10f)] | |
public float Range = 2f; | |
private Transform m_thisTransform = null; | |
void Start() | |
{ | |
m_thisTransform = GetComponent<Transform>(); | |
} | |
void Update() | |
{ | |
m_thisTransform.rotation *= Quaternion.AngleAxis(rotSpeed * Time.deltaTime, Vector3.up); | |
} | |
void OnDrawGizmos() | |
{ | |
Gizmos.color = Color.blue; | |
Gizmos.DrawLine(transform.position, transform.position + transform.forward * Range); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment