/// <summary>
        /// Called when a .NET event that must be propagated to Flutter is raised.
        /// This method propagates the event through <see cref="OnPlatformEvent"/>
        /// so that <see cref="FlutnetBridge"/> can subscribe and send data to Flutter.
        /// </summary>
        private static void PropagatePlatformEvent(string serviceName, string eventName, object sender, EventArgs eventArgs)
        {
            OnPlatformEventArgs args = new OnPlatformEventArgs
            {
                ServiceName = serviceName,
                EventName   = eventName,
                EventData   = eventArgs
            };

            OnPlatformEvent?.Invoke(sender, args);
        }
Exemple #2
0
    private void OnPlatform(Platform platform)
    {
        if (!GameManager.Instance.IsRun)
        {
            platform.RunBirdLandingEffect();
            return;
        }

        if (isOnPlatform == false && TryBounce())
        {
            platform.RunBirdLandingEffect();
            OnPlatformEvent?.Invoke(platform);
        }

        isOnPlatform   = true;
        availableJumps = maxJumps;
    }