Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Arbor2でSpriteRendererの色を変更します
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
You can’t perform that action at this time.