Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // (c) Copyright HutongGames, LLC 2010-2013. All rights reserved.
- using UnityEngine;
- namespace HutongGames.PlayMaker.Actions
- {
- [ActionCategory(ActionCategory.GameObject)]
- [Tooltip("Sets the value of a Material Variable.")]
- public class SetMaterial : FsmStateAction
- {
- [RequiredField]
- [UIHint(UIHint.Variable)]
- public FsmMaterial variable;
- public FsmMaterial material;
- public bool everyFrame;
- public override void Reset()
- {
- variable = null;
- material = null;
- everyFrame = false;
- }
- public override void OnEnter()
- {
- variable.Value = material.Value;
- if (!everyFrame)
- {
- Finish();
- }
- }
- public override void OnUpdate()
- {
- variable.Value = material.Value;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement