Skip to content

Instantly share code, notes, and snippets.

@ChunChunMorning
Last active December 11, 2015 06:24
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 ChunChunMorning/b52591479962d94af716 to your computer and use it in GitHub Desktop.
Save ChunChunMorning/b52591479962d94af716 to your computer and use it in GitHub Desktop.
大きさが変わるuGUI
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