Exemplo n.º 1
0
        private void OnSaveAndRestart(object sender, RoutedEventArgs e)
        {
            Exception ex = ConfigurationController.Save();

            if (ex == null)
            {
                Close();
                MarbleController.CloseHosting();

                var    commandArgs = Environment.GetCommandLineArgs();
                string path        = commandArgs[0];
                string args        = string.Join(" ", commandArgs.Skip(1));
                var    startInfo   = new ProcessStartInfo
                {
                    FileName        = path,
                    Arguments       = args,
                    UseShellExecute = true,
                };
                Process p = Process.Start(startInfo);
                p.WaitForInputIdle();
                Application.Current.Shutdown();
            }
            else
            {
                MessageBox.Show(ex.ToString(), "Failure", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Exemplo n.º 2
0
    void Start()
    {
        marble = GetComponent <MarbleController>();

        AudioSource[] audios = GetComponents <AudioSource>();
        rollSound  = audios[0];
        startSound = audios[1];
        dropSound  = audios[2];
        clickSound = audios[3];
    }
Exemplo n.º 3
0
    public void SpawnMarble(AnswerTypes answerType)
    {
        Vector3 spawnPos = new Vector3
        {
            x = Random.Range(minSpawnPos.position.x, maxSpawnPos.position.x),
            y = minSpawnPos.position.y,
            z = minSpawnPos.position.z
        };

        MarbleController newMarble = Instantiate(marblePrefab, this.transform).GetComponent <MarbleController>();

        newMarble.transform.position = spawnPos;

        newMarble.SetMarbleType(answerType);
    }
Exemplo n.º 4
0
 public void EndGame(MarbleController marble)
 {
     SceneManager.LoadScene("Game_Over");
 }
Exemplo n.º 5
0
 /// <summary>
 /// Send a balk.
 /// </summary>
 /// <param name="items">The items.</param>
 public void OnBulkSend(IEnumerable <MarbleBase> items)
 {
     MarbleController.AddMarbleItem(items.ToArray());
 }
Exemplo n.º 6
0
 private void Start()
 {
     marbleController = GetComponent <MarbleController>();
 }
Exemplo n.º 7
0
 private void ResetMarble(MarbleController marble)
 {
     marblesToSpawn.Enqueue(marble.GetMarbleType());
 }