Пример #1
0
        static async Task Main(string[] args)
        {
            var  exitManager = new ExitManager();
            bool createdNew  = false;

            using var m = await Task.Factory.StartNew(() => new Mutex (true, MonitorName, out createdNew), CancellationToken.None,
                                                      TaskCreationOptions.HideScheduler | TaskCreationOptions.DenyChildAttach, MutexThread.Inst);

            try
            {
                if (createdNew)
                {
                    await StartApp(args, exitManager);
                }
                else
                {
                    try
                    {
                        await using var client = new NamedPipeClientStream(".", MonitorName, PipeDirection.In, PipeOptions.Asynchronous);
                        await client.ConnectAsync(10000, CancellationToken.None);

                        byte[] data = Encoding.UTF8.GetBytes(new ExposedCommandLineProvider(args).Serialize());
                        var(message, lenght) = new NetworkMessageFormatter(MemoryPool <byte> .Shared)
                                               .WriteMessage(NetworkMessage.Create("Args", data));
                        using var mem = message;

                        await client.WriteAsync(mem.Memory[..lenght]);
                    }
Пример #2
0
    private void GenerateEnd(Node n)
    {
        ExitManager em = Instantiate(endRoom, (Vector2)(n.position * roomSize), Quaternion.identity).GetComponent <ExitManager>();

        em.Init();
        em.SetExits(n.exits);
        roomsExit.Add(em);
    }
Пример #3
0
    private void GenerateRooms(Node n, int difficulty)
    {
        List <Room> ad = possiblesRooms.Where(a => a.difficulty == (Room.RoomTag)difficulty).ToList();
        ExitManager em = Instantiate(possiblesRooms[Random.Range(0, possiblesRooms.Count)], (Vector2)(n.position * roomSize), Quaternion.identity).GetComponent <ExitManager>();

        em.Init();
        em.SetExits(n.exits);
        roomsExit.Add(em.GetComponent <ExitManager>());
    }
Пример #4
0
 private void init()
 {
     if (!IsCurrentGameState(GameStates.GAMEOVER))
     {
         m_player       = GameObject.Find("Player").GetComponent <PlayerScript>();
         m_enemyManager = GameObject.Find("Enemy stuff").GetComponent <EnemyManager>();
         m_exitManager  = GameObject.Find("DoorAndTerminal").GetComponent <ExitManager>();
         m_fader        = GameObject.Find("FadeCanvas").GetComponent <Fader>();
         m_exitManager.init();
     }
 }
Пример #5
0
    public void Awake()
    {
        if (instance != null)
        {
            Destroy(gameObject);
            return;
        }

        instance = this;
        DontDestroyOnLoad(gameObject);
    }
Пример #6
0
        public DbgPsHost(IDebugger debugger, ExitManager exitManager)
        {
            _exitManager = exitManager;
            var consoleColors = new ConsoleColorProxy
            {
                ErrorForegroundColor    = ConsoleColor.Red,
                ErrorBackgroundColor    = ConsoleColor.Black,
                WarningForegroundColor  = ConsoleColor.Yellow,
                WarningBackgroundColor  = ConsoleColor.Black,
                DebugForegroundColor    = ConsoleColor.Yellow,
                DebugBackgroundColor    = ConsoleColor.Black,
                VerboseForegroundColor  = ConsoleColor.Yellow,
                VerboseBackgroundColor  = ConsoleColor.Black,
                ProgressForegroundColor = ConsoleColor.Yellow,
                ProgressBackgroundColor = ConsoleColor.DarkCyan,
            };

            PrivateData = new PSObject(consoleColors);
            _dbgEngineHostUserInterface = new DbgEngineHostUserInterface(debugger, consoleColors, this);
        }
Пример #7
0
 void Awake()
 {
     Instance = this;
 }
Пример #8
0
 // Use this for initialization
 void Start()
 {
     ex = GameObject.Find("DespensableScripts").GetComponent <ExitManager> ();
 }
Пример #9
0
 private void Awake()
 {
     exitManager = GameObject.FindGameObjectWithTag("ExitManager").GetComponent <ExitManager>();
 }
Пример #10
0
 void Awake()
 {
     main = this;
 }
Пример #11
0
 void Start()
 {
     manager = GameObject.Find("theManager").GetComponent <ExitManager>();
 }