Last active
December 11, 2015 06:24
-
-
Save ChunChunMorning/b52591479962d94af716 to your computer and use it in GitHub Desktop.
大きさが変わるuGUI
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 UnityEngine; | |
using System.Collections; | |
public class OverstateUI : MonoBehaviour | |
{ | |
[SerializeField] Vector3 m_MaxSize = Vector3.one; | |
[SerializeField] Vector3 m_MinSize = Vector3.zero; | |
[SerializeField] float m_AngularFrequency = 1.0f; | |
float m_Time; | |
void Awake() | |
{ | |
m_Time = 0.0f; | |
} | |
void Update() | |
{ | |
m_Time += m_AngularFrequency * Time.deltaTime; | |
transform.localScale = Vector3.Lerp (m_MinSize, m_MaxSize, 0.5f * Mathf.Sin (m_Time) + 0.5f); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment