public void SetOwner(EPlayerController own) { if (pView.IsMine) { pView.RPC("RPC_SetOwner", RpcTarget.All, own.GetComponent <PhotonView>().ViewID); } }
void OnPlayerListChanged(EPlayerController p, bool isRemove) { OnLogGame(string.Format("[FF0000]{0}[-]\n", "Người chơi \"" + p.username + "\" đã " + (isRemove ? "rời khởi bàn chơi." : "tham gia bàn chơi."))); UITabbarPanel manager = Array.Find <UITabbarPanel>(controller.tabbarPanel, s => s.GetComponent <GPManagerView>() != null); manager.GetComponent <GPManagerView>().OnPlayerListChanged(p, isRemove); }
public void RPC_OffensiveLeft() { controllingPlayer = null; controllerPView = null; isOccupied = false; turret.transform.rotation = originalOrientation; }
public void RegisterEventRoomMasterChanged(EPlayerController p) { if (EventRoomMasterChanged != null) { EventRoomMasterChanged(p); } }
void SpawnPlayer() { spawnedPlayer = PhotonNetwork.Instantiate(Path.Combine("PhotonPrefabs", "PhotonPlayerCharacter"), GameObject.FindObjectOfType <GameManager>().GetSpawnLocation(), Quaternion.identity, 0); playerController = spawnedPlayer.GetComponent <EPlayerController>(); playerController.SetNetworkPresence(this, pView.ViewID); }
public void Awake() { gameManager = GameObject.FindObjectOfType <GameManager>(); player = gameManager.FetchLocalPlayer(); highlightedCategoryMaterial = new Material(highlightedCategoryMaterial); regularCategoryMaterial = new Material(regularCategoryMaterial); }
private void OnEnable() { owner = transform.parent.root; player = owner.GetComponent <EPlayerController>(); playerCam = Camera.main; isShooting = false; hasEnergyWeapon = false; DisableAttackBeam(); }
public void RPC_SetOwner(int own) { owner = PhotonView.Find(own).GetComponent <EPlayerController>(); if (hasProximityDetector) { GetComponentInChildren <ProximityDetector>().SetOwner(owner); GetComponentInChildren <ProximityDetector>().SetStructure(this); } }
public void ForceStart() { gameObject.SetActive(true); qCurrentCategory = 0; qCurrentSpawnable = 0; player = gameManager.FetchLocalPlayer(); HighlightQuickSpawnable(); quickMenu.ShowSelected(); gameObject.SetActive(false); }
public void RegisterKill(EPlayerController deceased, EPlayerController perpetrator) { foreach (PlayerRecord currRecord in playerRecords) { //if(currRecord.player == deceased.GetNetworkPresence()) //{ // currRecord.deaths += 1; //} } }
public void RemoveWaitingPlayer(EPlayerController player) { PlayerWaitingView waitingView = waitingViews.Find(pl => pl.player.username == player.username); if (waitingView != null) { GameObject.Destroy(waitingView.gameObject); waitingViews.Remove(waitingView); GameManager.Instance.FunctionDelay(delegate() { tableListWaiting.Reposition(); tableListWaiting.transform.parent.GetComponent <UIScrollView>().ResetPosition(); }, 0.001f); } }
public override void OnSwapSlot(EPlayerController[] listPlayer) { if (GameModelChan.game != null) { for (int i = 0; i <= 2; i++) { EPlayerController p = Array.Find <EPlayerController>(listPlayer, player => player != null && player.mSide == (ESide)(i + 1)); SetDataPlayer(p, i); } } }
public static PlayerWaitingInManager Create(EPlayerController player, UIGrid parent, EGPViewManager grandParent) { GameObject gobj = (GameObject)GameObject.Instantiate(Resources.Load("Prefabs/Gameplay/PlayerWaiting/PlayerWaitingInManager")); gobj.transform.parent = parent.transform; gobj.transform.localPosition = Vector3.zero; gobj.transform.localScale = Vector3.one; PlayerWaitingInManager item = gobj.GetComponent <PlayerWaitingInManager>(); item.grandParent = grandParent; item.SetData(player); return(item); }
public override void SetDataPlayer(EPlayerController p, int i) { base.SetDataPlayer(p, i); int slot = GameModelChan.YourController.slotServer; slot += (i + 1); if (slot >= 4) { slot -= 4; } swappedAvatar[i].gameObject.GetComponent <UIContainerAnonymous>().valueInt = slot; }
void SetDataPlayer(EPlayerController p, int i) { if (p != null) { UIContainerAnonymous anony = kickButton[i].gameObject.GetComponent <UIContainerAnonymous>(); if (anony == null) { anony = kickButton[i].gameObject.AddComponent <UIContainerAnonymous>(); } anony.intermediary = p; } Texture avatar = null; if (p != null) { p.AvatarTexture(delegate(Texture _texture) { avatar = _texture; }); } string username = p != null ? p.username : ""; kickAvatar[i].mainTexture = swappedAvatar[i].mainTexture = avatar; Color white = Color.white; if (p == null) { white.a = 0f; } kickAvatar[i].color = swappedAvatar[i].color = white; kickUsername[i].text = swappedUsername[i].text = username; kickButton[i].gameObject.SetActive(p != null); kickAvatar[i].gameObject.SetActive(p != null); int slot = GameModelChan.YourController.slotServer; slot += (i + 1); if (slot >= 4) { slot -= 4; } swappedAvatar[i].gameObject.GetComponent <UIContainerAnonymous>().valueInt = slot; }
public override void OnPlayerListChanged(EPlayerController p, bool isRemove) { if (isRemove) { if (p.mSide == ESide.None) { PlayerWaitingInManager playerView = waitingPlayers.Find(plc => plc.player.username == p.username); if (playerView != null) { GameObject.Destroy(playerView.gameObject); waitingPlayers.Remove(playerView); } GameManager.Instance.FunctionDelay(delegate() { gridWaitingPlayer.Reposition(); }, 0.01f); } else { if (GameModelChan.CurrentState == GameModelChan.EGameState.waitingForPlayer || GameModelChan.CurrentState == GameModelChan.EGameState.waitingForReady) { int i = ((int)p.mSide - 1); kickAvatar[i].mainTexture = swappedAvatar[i].mainTexture = null; kickAvatar[i].color = swappedAvatar[i].color = Color.black; kickUsername[i].text = swappedUsername[i].text = ""; kickButton[i].gameObject.SetActive(false); } } } else { if (p.mSide == ESide.None) { waitingPlayers.Add(PlayerWaitingInManager.Create(p, gridWaitingPlayer, this)); gridWaitingPlayer.Reposition(); } else { int i = 0; if (p.mSide != ESide.Slot_0) { i = ((int)p.mSide - 1); } SetDataPlayer(p, i); } } }
public Meld(int[] lst, EPlayerController p) { player = p; foreach (int value in lst) { ECard card = p.mCardHand.Find(c => c.CardId == value); if (card == null) { card = p.mCardHand.Find(c => c.CardId == -1); if (card != null) { card.CardId = value; } } p.mCardHand.Remove(card); meld.Add(card); } }
public void RegisterEventPlayerListChanged(EPlayerController p, bool isRemove) { if (EventPlayerListChanged != null && GameObject.Find("__Prefab Manager Gameplay") != null) { EventPlayerListChanged(p, isRemove); } else { if (GameManager.CurrentScene == ESceneName.GameplayChan) { GPInformationView.listMessage.Add(string.Format("[FF0000]{0}[-]\n", "Người chơi \"" + p.username + "\" đã " + (isRemove ? "rời khởi bàn chơi." : "tham gia bàn chơi."))); } else if (GameManager.CurrentScene == ESceneName.GameplayPhom) { GPInformationViewPhom.listMessage.Add(string.Format("[FF0000]{0}[-]\n", "Người chơi \"" + p.username + "\" đã " + (isRemove ? "rời khởi bàn chơi." : "tham gia bàn chơi."))); } else if (GameManager.CurrentScene == ESceneName.GameplayTLMN) { GPInformationViewTLMN.listMessage.Add(string.Format("[FF0000]{0}[-]\n", "Người chơi \"" + p.username + "\" đã " + (isRemove ? "rời khởi bàn chơi." : "tham gia bàn chơi."))); } } }
IEnumerator CheckForEnemies() { while (true) { playerToAttack = null; Collider[] everyoneInRange = Physics.OverlapSphere(transform.position, 40, 1 << 16); if (everyoneInRange.Length > 0) { foreach (Collider currCol in everyoneInRange) { if (currCol.GetComponent <EPlayerController>().GetNetworkID() != GetOwner().GetNetworkID()) { playerToAttack = currCol.GetComponent <EPlayerController>(); break; } } if (playerToAttack) { PerformAttack(); } } yield return(new WaitForSeconds(1.0f / frequency)); } }
public virtual void SetDataPlayer(EPlayerController p, int i) { if (p != null) { UIContainerAnonymous anony = kickButton[i].gameObject.GetComponent <UIContainerAnonymous>(); if (anony == null) { anony = kickButton[i].gameObject.AddComponent <UIContainerAnonymous>(); } anony.intermediary = p; } Texture avatar = null; if (p != null) { p.AvatarTexture(delegate(Texture _texture) { avatar = _texture; }); } string username = p != null ? p.username : ""; kickAvatar[i].mainTexture = swappedAvatar[i].mainTexture = avatar; Color white = Color.white; if (p == null) { white.a = 0f; } kickAvatar[i].color = swappedAvatar[i].color = white; kickUsername[i].text = swappedUsername[i].text = username; kickButton[i].gameObject.SetActive(p != null); kickAvatar[i].gameObject.SetActive(p != null); }
public void RegisterKill(EPlayerController deceased) { }
//private void OnTriggerEnter(Collider other) //{ // if (!owner || !GetComponentInParent<SpawnableGO>().isUsable) // { // return; // } // if (other.GetComponent<EPlayerController>() && other.GetComponent<EPlayerController>() != owner) // { // structure.OpponentDetected(other.GetComponent<EPlayerController>()); // } //} //private void OnTriggerExit(Collider other) //{ // if (other.GetComponent<EPlayerController>()) // { // structure.OpponentLeft(other.GetComponent<EPlayerController>()); // } //} public void SetOwner(EPlayerController own) { owner = own; }
public void SpawnSpawnable(SpawnableType type, string id, Vector3 location, Quaternion rotation, EPlayerController owner) { Spawnable receivedBlueprint = GetBlueprint(type, id); //GameObject spawnedSpawnable = Instantiate(receivedBlueprint.prefab, location, rotation); GameObject spawnedSpawnable = PhotonNetwork.Instantiate(Path.Combine(receivedBlueprint.pathStrings), location, receivedBlueprint.isGridAligned?GetGridAlignedRotation(rotation):rotation, 0); spawnedSpawnable.GetComponent <SpawnableGO>().displayName = receivedBlueprint.displayName; if (spawnedSpawnable.GetComponent <SpawnableHealth>()) { spawnedSpawnable.GetComponent <SpawnableHealth>().InitiateSystems(receivedBlueprint.health); } if (spawnedSpawnable.GetComponent <DefensiveBase>()) { spawnedSpawnable.GetComponent <DefensiveBase>().SetOwner(owner); } }
void Start() { playerController = GetComponentInParent <EPlayerController>(); }
public virtual void OnPlayerListChanged(EPlayerController p, bool isRemove) { }
public void SetControllingPlayer(EPlayerController controller) { controllingPlayer = controller; }
public void OffensiveOccuppied(EPlayerController controller) { int tID = controller.GetComponent <PhotonView>().ViewID; pView.RPC("RPC_OffensiveOccupied", RpcTarget.All, tID); }
public void SetData(EPlayerController player) { this.player = player; StartCoroutine(_SetData()); }
public void RPC_OffensiveOccupied(int controller) { controllingPlayer = PhotonView.Find(controller).GetComponent <EPlayerController>(); controllerPView = PhotonView.Find(controller).GetComponent <PhotonView>(); isOccupied = true; }
public void SetOwner(EPlayerController tPlayer) { player = tPlayer; }