Пример #1
0
        void OnEntitySpawned(CargoShip ship)
        {
            if (ship == null)
            {
                return;
            }

            // disable egress
            timer.In(5f, () => {
                ship.CancelInvoke(new Action(ship.StartEgress));
            });

            // start egress when safe
            timer.In((CargoShip.event_duration_minutes * 60f), () => {
                checker?.Destroy();
                checker = timer.Every(1f, () => {
                    if (safePos(ship.transform.position))
                    {
                        ship.Invoke(new Action(ship.StartEgress), 1f);
                        checker?.Destroy();
                    }
                });
            });
        }