Пример #1
0
 protected override void Awake()
 {
     base.Awake();
     Trigger = TriggerObject.TryGetElseAdd <EventTrigger>();
     Trigger.Add(EventTriggerType.PointerClick, PointerGuiClick);
     Trigger.Add(EventTriggerType.PointerDown, PointerGuiClickDown);
     Trigger.Add(EventTriggerType.PointerUp, PointerGuiClickUp);
     Trigger.Add(EventTriggerType.PointerEnter, PointerGuiAreaEnter);
     Trigger.Add(EventTriggerType.PointerExit, PointerGuiAreaExit);
 }
Пример #2
0
 protected void SetProperties(Trigger trigger)
 {
     trigger.Description = this.Description;
     this.Annotations?.ForEach(item => trigger.Annotations.Add(item));
     if (this.AdditionalProperties != null)
     {
         foreach (var item in this.AdditionalProperties)
         {
             if (item.Key != "typeProperties")
             {
                 trigger.Add(item.Key, item.Value);
             }
         }
     }
 }
Пример #3
0
        public override void Bind(Entity entity, Main main, bool creating = false)
        {
            Transform transform = entity.GetOrCreate <Transform>("Transform");
            Trigger   trigger   = entity.GetOrCreate <Trigger>("Trigger");

            VoxelAttachable.MakeAttachable(entity, main);

            this.SetMain(entity, main);

            trigger.EditorProperties();
            entity.Add("Enable", trigger.Enable);
            entity.Add("Disable", trigger.Disable);
            entity.Add("Entered", trigger.Entered);
            entity.Add("Exited", trigger.Exited);

            trigger.Add(new TwoWayBinding <Vector3>(transform.Position, trigger.Position));
        }
 public virtual void Apply(Trigger?trigger)
 {
     trigger?.Add(this);
 }