private void Awake()
        {
            this.gameBehaviour = GameBehaviour.Instance;

            if (this.gameBehaviour != null)
            {
                this.gameBehaviour.GameChanged += this.OnGameChanged;
            }
        }
        private void Awake()
        {
            this.gameBehaviour = (GameBehaviour)FindObjectOfType(typeof(GameBehaviour));

            if (this.gameBehaviour != null)
            {
                this.gameBehaviour.GameChanged += this.OnGameChanged;
            }
        }
        /// <summary>
        ///   Loads the game configuration, if available.
        /// </summary>
        private void Awake()
        {
            Instance = this;

            if (this.GameConfiguration == null)
            {
                this.GameConfiguration =
                    (GameConfigurationBehaviour)FindObjectOfType(typeof(GameConfigurationBehaviour));
            }
        }
        /// <summary>
        ///   Allows registering as listener for specific game logic events.
        /// </summary>
        protected virtual void Awake()
        {
            this.gameBehaviour = GameBehaviour.Instance;
            if (this.gameBehaviour != null)
            {
                this.gameBehaviour.GameChanged += this.OnGameChanged;
            }

            this.RegisterListeners();

            if (this.gameBehaviour != null)
            {
                this.OnGameChanged(this.gameBehaviour.Game, null);
            }
        }
        protected virtual void Awake()
        {
            GameBehaviour gameBehaviour = GameBehaviour.Instance;

            if (gameBehaviour != null)
            {
                gameBehaviour.GameChanged += this.OnGameChanged;
                if (gameBehaviour.Game != null)
                {
                    this.OnGameChanged(gameBehaviour.Game, null);
                }
            }

            this.listeners = new Dictionary <object, EventManager.EventDelegate>();
        }
        /// <summary>
        ///   Allows registering as listener for specific game logic events.
        /// </summary>
        protected virtual void Awake()
        {
            this.gameBehaviour = FindObjectOfType<GameBehaviour>();
            if (this.gameBehaviour != null)
            {
                this.gameBehaviour.GameChanged += this.OnGameChanged;
            }

            this.RegisterListeners();

            if (this.gameBehaviour != null)
            {
                this.OnGameChanged(this.gameBehaviour.Game, null);
            }
        }
        /// <summary>
        ///   Allows registering as listener for specific game logic events.
        /// </summary>
        protected virtual void Awake()
        {
            this.gameBehaviour = GameBehaviour.Instance;
            if (this.gameBehaviour != null)
            {
                this.gameBehaviour.GameChanged += this.OnGameChanged;
            }

            this.RegisterListeners();

            if (this.gameBehaviour != null)
            {
                this.OnGameChanged(this.gameBehaviour.Game, null);
            }
        }
        private void Awake()
        {
            this.gameBehaviour = GameBehaviour.Instance;

            this.gameBehaviour.GameChanged += this.OnGameChanged;
        }
        private void Awake()
        {
            this.gameBehaviour = FindObjectOfType<GameBehaviour>();

            this.gameBehaviour.GameChanged += this.OnGameChanged;
        }
Exemple #10
0
        private void Update()
        {
            if (this.showConsole)
            {
                GameBehaviour newGameBehaviour = (GameBehaviour)FindObjectOfType(typeof(GameBehaviour));
                if (this.gameBehaviour != newGameBehaviour)
                {
                    if (this.gameBehaviour != null)
                    {
                        this.gameBehaviour.GameChanged -= this.OnGameChanged;
                    }
                    this.gameBehaviour = newGameBehaviour;

                    if (this.gameBehaviour != null)
                    {
                        this.gameBehaviour.GameChanged += this.OnGameChanged;
                    }

                    this.game = this.gameBehaviour != null ? this.gameBehaviour.Game : null;
                }
            }
        }
 public GameWindowContext()
 {
     this.game = Object.FindObjectOfType<GameBehaviour>();
 }
        private void Update()
        {
            if (this.showConsole)
            {
                GameBehaviour newGameBehaviour = GameBehaviour.Instance;
                if (this.gameBehaviour != newGameBehaviour)
                {
                    if (this.gameBehaviour != null)
                    {
                        this.gameBehaviour.GameChanged -= this.OnGameChanged;
                    }
                    this.gameBehaviour = newGameBehaviour;

                    if (this.gameBehaviour != null)
                    {
                        this.gameBehaviour.GameChanged += this.OnGameChanged;
                    }

                    this.game = this.gameBehaviour != null ? this.gameBehaviour.Game : null;
                }
            }
        }
        /// <summary>
        ///   Loads the game configuration, if available.
        /// </summary>
        private void Awake()
        {
            Instance = this;

            if (this.GameConfiguration == null)
            {
                this.GameConfiguration =
                    (GameConfigurationBehaviour)FindObjectOfType(typeof(GameConfigurationBehaviour));
            }
        }