Пример #1
0
        void RegisterPlayer()
        {
            ID = "Playa" + _inputManager.PlayerNum;
            transform.name = ID;
            nickname = ID;

            scoreManager = GameObject.Find ("Score Manager").GetComponent<ScoreManagerCouch> ();

            networkManager = GameObject.Find ("_NetworkManager");
            _networkController = networkManager.GetComponent<PlayersManager> ();
            _networkController.RegisterOfflinePlayer (ID);
        }
Пример #2
0
        public void GetObjects()
        {
            Debug.Log ("GetCharacters local ");
            _OfflinePlayerController = GetComponent<OfflinePlayerController> ();
            ID = _OfflinePlayerController.ID;
            networkManager = GameObject.Find ("_NetworkManager");
            _networkController = networkManager.GetComponent<PlayersManager> ();
            foreach (Transform child in transform) {
                if (child.gameObject.CompareTag (Tags.Character)) {
                    character = child.gameObject;
                    audioSource = child.gameObject.GetComponent<AudioSource> ();
                }
            }

            PlaySound (ID, SoundTypes.Spawning, audioSource);
        }
Пример #3
0
 public bool IsMy()
 {
     return(Owner == PlayersManager.GetMyPlayer());
 }
Пример #4
0
 // Use this for initialization
 void Start()
 {
     ins = this;
     //test
     //NewPlayer(Instantiate(prefab));
 }
Пример #5
0
 protected override void RpcDoShootEffect(Vector3 pos, Quaternion rot, PhotonMessageInfo pmi)
 {
     BulletTrailPrefab.GetComponent <BulletMovment>().own = PlayersManager.FindPlayer(pmi.sender).gameObject.GetComponent <TankEvolution>().HullGameObject;
     Instantiate(BulletTrailPrefab, pos, rot);
 }
Пример #6
0
 void OdbierzHpOfiaraRPC(PhotonPlayer ofiaraPP, float damage)
 {
     //Debug.Log("Gracz " + Player.FindPlayer(ofiaraPP).nick + " stracił " + damage + " punktów!");
     PlayersManager.FindPlayer(ofiaraPP).currentHp -= damage;
 }
Пример #7
0
 // Start is called before the first frame update
 void Start()
 {
     PM = GameObject.Find("PlayersManager").GetComponent <PlayersManager>();
     Ch = GameObject.Find("Players").GetComponent <Character>();
 }
Пример #8
0
 void Awake()
 {
     if (Instance == null) Instance = this;
     else {
         Destroy(this.gameObject);
         return;
     }
     DontDestroyOnLoad(gameObject);
 }
Пример #9
0
 public CharactersInitialisation(SetupScene setupSceneFrom)
 {
     playersManager = PlayersManager.playersManager;
     setupScene     = setupSceneFrom;
 }
Пример #10
0
 void Start()
 {
     PM        = GameObject.Find("PlayersManager").GetComponent <PlayersManager>();
     inventory = GameObject.Find("Players").GetComponent <InventorySystem>();
 }
Пример #11
0
        public ResultsScreen(Gamestate gamestate, PlayersManager playersManager, TextureManager textureManager, StatisticsManager statisticsManager) : base(gamestate, playersManager, ScreenType.Results)
        {
            StatisticsManager = statisticsManager;

            SaveStatistics();

            Text = new Text(new Position(200, 25, 600, 100), Gamestate, new Vector2f(), 50, TextPosition.Middle, TextPosition.Middle, GetResultsText());

            Buttons = new List <Button>();
            Buttons.Add(new ActionButton(new Position(200, 150, 600, 100), Gamestate, new Vector2f(), 40, TextPosition.Middle, TextPosition.Middle, "Rematch", (MouseButtonEventArgs args) => { PlayersManager.ChangePlayer(); MessageBus.Instance.PostEvent(MessageType.ChangeScreen, this, new ChangeScreenEventArgs {
                    Screen = ScreenType.Game
                }); }));
            Buttons.Add(new ActionButton(new Position(200, 300, 600, 100), Gamestate, new Vector2f(), 40, TextPosition.Middle, TextPosition.Middle, "New Game", (MouseButtonEventArgs args) => { Gamestate.Clear(); MessageBus.Instance.PostEvent(MessageType.ChangeScreen, this, new ChangeScreenEventArgs {
                    Screen = ScreenType.Pregame
                }); }));

            Buttons.Add(new ReturnButton(new Position(25, 875, 100, 100), Gamestate, textureManager.TexturesDictionary[TextureType.Icon]["back"], ScreenType.MenuScreen));
        }
Пример #12
0
 public PlayerController()
 {
     _playersManager = new PlayersManager();
     _teamsManager   = new TeamsManager();
 }
Пример #13
0
 private void Awake()
 {
     PM    = GameObject.Find("PlayersManager").GetComponent <PlayersManager>();
     PMove = GameObject.Find("Players").GetComponent <PlayerMovement>();
 }
 /// <summary>
 /// Инициализация ViewModel'и футбол
 /// </summary>
 /// <param name="playerList"></param>
 public FootballViewModel(IFootballPlayerList playerList, IFootballField field, IEfficiencyChart chart)
 {
     _playerList       = playerList;
     _playersManeger   = new PlayersManager(playerList, field, chart);
     _selectedTabIndex = 0;
 }
Пример #15
0
		// Use this for initialization
		public void Init ()
		{
			_networkController = FindObjectOfType<PlayersManager> ();
			audioPlayer = GetComponent<AudioPlayerCharacter> ();
			initialized = true;
		}
Пример #16
0
    bool destroy_portals = false; //The portals has to be destoryed

    void Awake()
    {
        players_manager = GameObject.Find("Players").GetComponent <PlayersManager>();
    }
Пример #17
0
 void SetCameraDeathRPC(PhotonMessageInfo pmi)
 {
     Debug.Log("Ustawiam u siebie CAMERE!!!!!!!!!!");
     Debug.Log(PlayersManager.FindPlayer(pmi.sender).gameObject.name);
     tankStore.camDeadTarget = PlayersManager.FindPlayer(pmi.sender).gameObject.GetComponent <TankEvolution>().HullGameObject;    //TO DO: wysłać to przez RPC
 }
Пример #18
0
 void Start()
 {
     m_playersManager = FindObjectOfType<PlayersManager>();
 }
 private void Awake()
 {
     playersManager = FindObjectOfType <PlayersManager>();
 }
Пример #20
0
        public Client(int playerId, UdpClient udpClient, PacketsReceiver packetsReceiver, PacketsSender packetsSender, PlayersManager playersManager, MetaMonoBehaviours metaMonoBehaviours)
        {
            this.playerId = playerId;

            tcpConnection = null;
            udpIpEndPoint = null;

            this.metaMonoBehaviours = metaMonoBehaviours;
            this.udpClient = udpClient;
            this.packetsReceiver = packetsReceiver;
            this.packetsSender = packetsSender;
            this.playersManager = playersManager;
        }
Пример #21
0
 public void Init()
 {
     _multiplayerPlayerController = GetComponent<MultiplayerPlayerController> ();
     _playersManager = FindObjectOfType<PlayersManager> ();
 }
Пример #22
0
 public void InitializeTest()
 {
     _playersManager = new PlayersManager();
     _stringWriter = new StringWriter();
 }
Пример #23
0
		public void Init ()
		{
			if (initialized)
				return;
			
			playerObjects = GetComponent<PlayerObjectReferences>();

			_scoreManager = FindObjectOfType<ScoreManager> ();
			if (_scoreManager != null && base.isServer)
				_scoreManager.OnRoundStart += Revive;

			killsFeed = FindObjectsOfType<ChatEnterer> ().FirstOrDefault(c => c.feedType == ChatFeederTypes.Kills);
			chatFeed = FindObjectsOfType<ChatEnterer> ().FirstOrDefault(c => c.feedType == ChatFeederTypes.Chat);

			characterLoader = playerObjects.transform.GetComponent<CharacterLoader>();


			// fill health and ammo
			health = maxHealth;
			ammo = maxAmmo;

			//find start positions
			_startPositions = GameObject.FindGameObjectsWithTag (Tags.SpawnPoint);


			_character = playerObjects.character;
			selfInjury = _character.injurator;
		
			//find audio network sync
			_audioPlayer = GetComponent<AudioPlayerCharacter> ();

			_playersManager = FindObjectOfType <PlayersManager> ();
			_hudController = FindObjectOfType<HudController> ();
			statusIndicators = playerObjects.statusIndicators;

			if (base.isLocalPlayer) {
				
				Cmd_GetPlayers ();

				if (chatFeed != null) {
					chatFeed.OnPostChatMessage += PostChatMessage;
				}
			}
				
			
			Revive ();

			StartCoroutine(CleareMessagesCount());

			initialized = true;

            /* events */
            JetsonsAnalytics.LogEquipment();

		}
Пример #24
0
 void Start()
 {
     uIController   = UIController.instance;
     playersManager = PlayersManager.instance;
 }
Пример #25
0
 void ZabiJOfiareRPC(PhotonPlayer ofiaraPP)
 {
     PlayersManager.FindPlayer(ofiaraPP).gameObject.GetComponent <TankDeath>().OnDead();
 }
Пример #26
0
		public void Cmd_GetPlayers ()
		{
			if (_playersManager == null)
				_playersManager = FindObjectOfType <PlayersManager> ();

			for (int i = 0; i < _playersManager.players.Length; i++) {
				
				_playersManager.players [i].gameObject.GetComponent<Combat> ().Rpc_GetPlayers ();
			}
		}
Пример #27
0
 void Start()
 {
     anim    = GetComponent <Animator>();
     manager = Camera.main.GetComponent <PlayersManager> ();
 }
Пример #28
0
 void Start()
 {
     m_playersManager = FindObjectOfType<PlayersManager>();
     m_audioSource = GetComponent<AudioSource>();
     m_audioDirector = FindObjectOfType<AudioDirector>();
 }
Пример #29
0
 public void Start()
 {
     PM = GameObject.Find("PlayersManager").GetComponent <PlayersManager>();
     ObjectsHierarchy = GameObject.Find("Objetos");
 }