KaiClavier

FleeceBegin.cs [Playmaker Action]

Mar 2nd, 2020
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.02 KB | None | 0 0
  1. // (c) Copyright HutongGames, LLC 2010-2013. All rights reserved.
  2. // Coded by Kai Clavier 2020
  3.  
  4. using UnityEngine;
  5. using System.Collections.Generic;
  6. using System.Text;
  7. using UnityEngine.UI;
  8. using Fleece;
  9.  
  10. namespace HutongGames.PlayMaker.Actions
  11. {
  12.     [ActionCategory("Fleece")]
  13.     [Tooltip("Begins reading at a specific point.")]
  14.     public class FleeceBegin : FsmStateAction
  15.     {
  16.        
  17.         [RequiredField]
  18.         [CheckForComponent(typeof(GenericDrawstring))]
  19.         public FsmOwnerDefault gameObject;
  20.  
  21.         [UIHint(UIHint.Variable)]
  22.         public FsmString passageName;
  23.         //public Jumper startPassage;
  24.  
  25.         private GenericDrawstring genericDrawstring;
  26.  
  27.         public bool everyFrame;
  28.  
  29.         public override void Reset()
  30.         {
  31.             //startPassage = null;
  32.             passageName = null;
  33.         }
  34.  
  35.         public override void OnEnter()
  36.         {
  37.             GameObject go = Fsm.GetOwnerDefaultTarget(gameObject);
  38.             genericDrawstring = go.GetComponent<GenericDrawstring>();
  39.             genericDrawstring.Begin(passageName.Value); //start reading at specified passage
  40.             if (!everyFrame) Finish();
  41.         }
  42.  
  43.         public override void OnUpdate()
  44.         {
  45.  
  46.         }
  47.  
  48.     }
  49. }
Add Comment
Please, Sign In to add comment