daily pastebin goal
40%
SHARE
TWEET

Untitled

a guest Apr 19th, 2014 144 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // (c) Copyright HutongGames, LLC 2010-2013. All rights reserved.
  2.  
  3. using UnityEngine;
  4.  
  5. namespace HutongGames.PlayMaker.Actions
  6. {
  7.         [ActionCategory(ActionCategory.GameObject)]
  8.         [Tooltip("Sets the value of a Material Variable.")]
  9.         public class SetMaterial : FsmStateAction
  10.         {
  11.                 [RequiredField]
  12.                 [UIHint(UIHint.Variable)]
  13.                 public FsmMaterial variable;
  14.                 public FsmMaterial material;
  15.                 public bool everyFrame;
  16.  
  17.                 public override void Reset()
  18.                 {
  19.                         variable = null;
  20.                         material = null;
  21.                         everyFrame = false;
  22.                 }
  23.  
  24.                 public override void OnEnter()
  25.                 {
  26.                         variable.Value = material.Value;
  27.                        
  28.                         if (!everyFrame)
  29.                         {
  30.                                 Finish();              
  31.                         }
  32.                 }
  33.  
  34.                 public override void OnUpdate()
  35.                 {
  36.                         variable.Value = material.Value;
  37.                 }
  38.         }
  39. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top