Skip to content
Snippets Groups Projects
Remover.cs 723 B
Newer Older
  • Learn to ignore specific revisions
  • using System.Collections;
    using System.Collections.Generic;
    
    using System.Linq;
    
    using UnityEngine;
    using static CommunicationEvents;
    
    public class Remover : Gadget
    {
    
        /// \copydoc Gadget.s_type
        [Newtonsoft.Json.JsonProperty]
        protected static new string s_type = "Remover";
    
    
    ki7077's avatar
    ki7077 committed
        public override void _Hit(RaycastHit[] hit)
    
            bool samestep = false;
            foreach (string uri in hit.Select(h => h.transform.GetComponent<FactObject>()?.URI))
            {
                if(uri == null)
                    continue;
    
                Workflow.Add(uri);
                StageStatic.stage.factState.Remove(Workflow.Last(), samestep, gadget: this);
    
                samestep = true;
            }