본문으로 바로가기

Demo script

category Technical Report/Unity Scripts 2020. 2. 12. 13:45
반응형


using System.Collections;
using System.Collections.Generic;
using UnityEngine;


[ExecuteInEditMode]

public class Rotate : MonoBehaviour
{
    [Header("Roate world postion")]
    [Space(10)]

    [Tooltip("Control the object rotate speed each axis")]
    public float Xspeed;    
    public float Yspeed;
    public float Zspeed;
    

    void Update()
    {                
        // If relativeTo is not specified or set to Space.Self the rotation is applied around the transform's local axes.
        // If relativeTo is set to Space.World the rotation is applied around the world x, y, z axes.
        transform.Rotate(Time.deltaTime * Xspeed , Time.deltaTime * Yspeed, Time.deltaTime * Zspeed, Space.World);       
    }
}



반응형

'Technical Report > Unity Scripts' 카테고리의 다른 글

Unity Scriptable RenderPipeline  (0) 2020.02.17
PCSS Light script  (0) 2019.09.15
Unity Legacy shadow map resolution control  (0) 2019.09.15
Custom Material GUI  (0) 2019.08.14
Unity Custom tube, shere Light  (0) 2018.12.04