Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using CodeStage.AntiCheat.ObscuredTypes;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class ZS : bl_PhotonHelper {
- public bl_GameManager manager = null;
- public bl_ChatRoom chat = null;
- public bl_KillFeed killFeed = null;
- public GameObject countdown = null;
- public bl_RoundTime timeManager = null;
- protected int ZombiesCount = -1;
- protected List<PhotonPlayer> Zombies = null;
- protected bool IsGameInProgress = false;
- protected bool IsCountdownStarted = false;
- protected ObscuredInt TimeLeft = 60;
- // Use this for initialization
- void Start () {
- }
- // Update is called once per frame
- void Update () {
- Zombies = manager.GetPlayersInTeam("Recon");
- ZombiesCount = Zombies.Count;
- if (ZombiesCount == 0 && manager.GetPlayersInTeam("Delta").Count > 1 && !IsCountdownStarted)
- {
- IsCountdownStarted = true;
- InvokeRepeating("TimeUpdate", 1, 1);
- countdown.SetActive(true);
- }
- }
- void TimeUpdate()
- {
- if(TimeLeft <= 0)
- {
- StartGame();
- return;
- }
- TimeLeft--;
- countdown.GetComponentInChildren<Text>().text = TimeLeft.ToString();
- }
- void StartGame()
- {
- countdown.SetActive(false);
- CancelInvoke("TimeUpdate");
- IsCountdownStarted = false;
- IsGameInProgress = true;
- }
- void SelectNewZombie()
- {
- if (PhotonNetwork.isMasterClient)
- {
- List<PhotonPlayer> DeltaPlayers = manager.GetPlayersInTeam("Delta");
- int index = Random.Range(0, DeltaPlayers.Count);
- PhotonPlayer newZombie = DeltaPlayers[index];
- PhotonView photonView = this.gameObject.GetComponentInChildren<PhotonView>();
- photonView.RPC("TransformToZombie", newZombie); ///???
- }
- }
- }
- ////Client
- [PunRPC]
- public void ExplodeShahid()
- {
- GameObject e = PhotonNetwork.Instantiate("Shahid", playerObj.transform.position, Quaternion.identity, 0, null);
- playerObj.GetComponent<AudioSource>().PlayOneShot(shahid, 1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement