Created
August 16, 2017 11:37
-
-
Save yuw-unknown/c13cd8e974e17671d1ec058c41ab5c82 to your computer and use it in GitHub Desktop.
Arbor2でSpriteRendererの色を変更します
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; | |
using Arbor; | |
/** | |
* Spriteの色を変更します | |
*/ | |
// MenuのComponentにメニューを追加する | |
[AddComponentMenu("Arbor/Sprite色変更")] | |
// 挙動追加のメニューを追加する | |
[AddBehaviourMenu("Original/Sprite/色ちぇんじ")] | |
[BuiltInBehaviour] | |
// StateBehaviourはMonoBehaviourを継承しているので、UnityのBehaviour機能をそのまま使える | |
public class ArborChangeSpriteColor : StateBehaviour { | |
[SerializeField] private SpriteRenderer _SpriteRenderer; | |
[SerializeField] private Color _Color; | |
void Start () { | |
} | |
// Use this for awake state | |
public override void OnStateAwake() { | |
} | |
// Use this for enter state | |
public override void OnStateBegin() { | |
_SpriteRenderer.color = _Color; | |
} | |
// Use this for exit state | |
public override void OnStateEnd() { | |
} | |
// Update is called once per frame | |
void Update () { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment