Esempio n. 1
0
 public void PlayerDied(RoboModule player)
 {
     _playerInstances.Remove(player);
     if (_playerInstances.Count == 1)
     {
         PlayerWon(_playerInstances.FirstOrDefault());
     }
     _camMan.PlayerDied(player);
 }
Esempio n. 2
0
 void PlayerWon(RoboModule player)
 {
     if (_playerWon == false)
     {
         _playerWon = true;
         print($"PLAYER {player.InputModule.Player} WON!");
         Observable.Timer(System.TimeSpan.FromSeconds(3)).Subscribe(_ =>
         {
             SceneManager.LoadScene("Main");
         });
     }
 }
Esempio n. 3
0
        public void AddVisualizer(RoboModule player, Color color)
        {
            _canvas = FindObjectOfType <Canvas>();
            var playerNumber  = player.InputModule.Player;
            var visualization = Instantiate(_visualizerPrefab);
            var rect          = visualization.GetComponent <RectTransform>();

            rect.SetParent(_canvas.transform);
            rect.sizeDelta        = new Vector2(BeginWidth, 32f);
            rect.localScale       = VisualizerScales[playerNumber - 1];
            rect.anchorMin        = VisualizerMins[playerNumber - 1];
            rect.anchorMax        = VisualizerMaxs[playerNumber - 1];
            rect.anchoredPosition = VisualizerPositions[playerNumber - 1];
            rect.gameObject.GetComponent <Image>().color = color * 0.75f;
            player.InputModule.visualizer = visualization;
        }
Esempio n. 4
0
 public void PlayerDied(RoboModule player)
 {
     _robots.Remove(player);
 }
Esempio n. 5
0
 void Start()
 {
     robo    = GetComponent <RoboModule>();
     _health = MaxHealth;
 }