コード例 #1
0
        protected void Subscribe(int id, EventHandler <GameEventArgs> handler)
        {
            if (eventSubscriber == null)
            {
                eventSubscriber = EventSubscriber.Create(this);
            }

            eventSubscriber.Subscribe(id, handler);
        }
コード例 #2
0
    public static void Subscribe <T>(this GameObject obj, Action <T> func)
    {
        EventSubscriber eventSubscriber = obj.GetComponent <EventSubscriber>();

        if (eventSubscriber == null)
        {
            eventSubscriber = obj.AddComponent <EventSubscriber>();
        }

        eventSubscriber.Subscribe <T>(func);
    }
コード例 #3
0
        private void Start()
        {
            if (SpawnerType == null)
            {
                Debug.LogError("Spawner type is null, please, assign him", this);
                return;
            }
            if (ObjectPlaceType == null)
            {
                Debug.LogError("Object Place Type is null, please, assign him", this);
                return;
            }

            EventSubscriber.Subscribe(this);
        }
コード例 #4
0
ファイル: PlaySound.cs プロジェクト: Kiizbuy/GameFramework
 private void Start()
 {
     EventSubscriber.Subscribe(this);
 }
コード例 #5
0
 public void SubscribeEnnemyKilledEvent(EventSubscriber_EventCallback callback)
 {
     eventSubscriber.Subscribe(ennemyKilledEvent, callback);
 }
コード例 #6
0
 public void Subscribe_SendsSubscribeCommandWithGivenTopic(string topic)
 {
     _subscriber.Subscribe <Event>(topic, x => { });
     _fixture.MockConnectionMultiplexer.Verify(x => x.GetSubscriber(It.IsAny <object>()), Times.Once);
     _fixture.MockSubscriber.Verify(x => x.Subscribe(topic, It.IsAny <Action <RedisChannel, RedisValue> >(), It.IsAny <CommandFlags>()), Times.Once);
 }