using System; using System.Collections; using System.Collections.Generic; using UnityEngine; namespace QFramework.Example { public class OrEventExample : MonoBehaviour { private BindableProperty mPropertyA = new BindableProperty(10); private BindableProperty mPropertyB = new BindableProperty(5); private EasyEvent EventA = new EasyEvent(); // Start is called before the first frame update void Start() { mPropertyA .Or(EventA) .Or(mPropertyB) .Register(() => { Debug.Log("Event Received"); }).UnRegisterWhenGameObjectDestroyed(gameObject); } private void Update() { if (Input.GetMouseButtonDown(0)) { mPropertyA.Value++; } if (Input.GetMouseButtonDown(1)) { mPropertyB.Value++; } if (Input.GetKeyDown(KeyCode.Space)) { EventA.Trigger(); } } } }