Skip to content

Instantly share code, notes, and snippets.

@muzudho
Last active June 16, 2017 01:27
Show Gist options
  • Save muzudho/7eab8806e0d21a31a52239d0f4569003 to your computer and use it in GitHub Desktop.
Save muzudho/7eab8806e0d21a31a52239d0f4569003 to your computer and use it in GitHub Desktop.
ゲーム開発を受注しようぜ<その5> ref: http://qiita.com/muzudho1/items/c2d57d16fbab3db50f86
//レイヤーマスク作成
int layerMask = LayerMask.NameToLayer("UI");
// Update is called once per frame
void Update () {
#region テスト・コード
// とりあえず、どんどんメーターが減っていくコードを書いてみる。
if (0<rectTransform_cache.sizeDelta.x)
{
rectTransform_cache.sizeDelta = new Vector2(rectTransform_cache.sizeDelta.x - 1.0f, rectTransform_cache.sizeDelta.y);
}
#endregion
}
// Update is called once per frame
void Update () {
#region テスト・コード
// とりあえず、どんどんメーターが減っていくコードを書いてみる。
if (0<value)
{
Add(-1);
}
#endregion
// 内部データと表示データが合っていない場合、表示データを更新する
if (dirty)
{
rectTransform_cache.sizeDelta = new Vector2(rectTransform_cache.sizeDelta.x * value / maxValue, rectTransform_cache.sizeDelta.y);
dirty = false; // (2017-06-15 Add)忘れていたので追記
}
}
if (dirty)
{
rectTransform_cache.sizeDelta = new Vector2(widthMax_cache * value / maxValue, rectTransform_cache.sizeDelta.y);
dirty = false; // (2017-06-15 Add)忘れていたので追記
}
設計図_クラス図(分割3b).pu
→H,J,M,Pへ。
設計図_クラス図(分割3S)_0616.pu
→SとTへ。
using UnityEngine;
public class JumpButton : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
public void OnClick()
{
Debug.Log("ジャンプボタンをクリックした");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment