Skip to content

Instantly share code, notes, and snippets.

@shinriyo
Created May 14, 2013 00:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shinriyo/5572691 to your computer and use it in GitHub Desktop.
Save shinriyo/5572691 to your computer and use it in GitHub Desktop.
keijiroさんのサンプルのRing部分のC#化 transformは最適化した
using UnityEngine;
using System.Collections;
public class Ring : MonoBehaviour
{
private Transform _myTransform ;
void Awake ()
{
_myTransform = transform;
}
// Use this for initialization
void Start ()
{
_myTransform.rotation = Random.rotation;
}
// Update is called once per frame
void Update ()
{
_myTransform.localRotation *= Quaternion.AngleAxis (Time.deltaTime * 180.0f, Vector3.right);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment