Esempio n. 1
0
 void Start()
 {
     this.playersNumber = (int) Mathf.Clamp((float)this.playersNumber, 1F, 4F);
     for (int i = 0; i < this.playersNumber; i++) {
       GameObject player = new GameObject("Player_" + (i + 1));
       player.SetActive(false);
       player.transform.localScale = new Vector3(2F, 2F, 1F);
       InputHandler inputHandler = player.AddComponent<InputHandler>();
       inputHandler.playerNumber = i + 1;
       PlayerSelection selection = player.AddComponent<PlayerSelection>();
       selection.character = this.character;
       player.SetActive(true);
     }
 }
Esempio n. 2
0
 void Start()
 {
     instance = this;
     messageHandler = GameMessageHandler.Instance;
     messageHandler.Register(this, "GmStats");
     InvokeRepeating("SendRequest", 1f, 5f);
     container = transform.Find("stats").gameObject;
     template = transform.Find("template").gameObject;
     template.SetActive(false);
     canvas = gameObject.GetComponent<Canvas>() as Canvas;
     canvas.enabled = false;
 }
Esempio n. 3
0
 void Start()
 {
     if (!GamePlayer.IsNetworked()) {
         Destroy(this.gameObject);
         return;
     }
     messageHandler = GameMessageHandler.instance;
     messageHandler.Register(this, "GmStats");
     InvokeRepeating("SendRequest", 1f, 5f);
     container = transform.Find("stats").gameObject;
     template = transform.Find("template").gameObject;
     template.SetActive(false);
     canvas = gameObject.GetComponent<Canvas>() as Canvas;
     canvas.enabled = false;
 }
 private void OnLevelLoaded(GameScenes scene)
 {
     if (Settings.AllowEditors)
     {
         foreach (var editor in editorTypes.Where(e => e.Value.Contains(scene)))
         {
             try
             {
                 GameObject obj = new GameObject (editor.Key.Name);
                 obj.AddComponent (editor.Key);
                 obj.SetActive (true);
                 Utils.Log ("IngameEditor " + editor.Key.Name + " created");
             }
             catch(Exception e)
             {
                 Utils.LogError ("Failed to load editor: " + editor.Key.Name);
                 Debug.LogException (e);
             }
         }
     }
 }
Esempio n. 5
0
        public void Start()
        {
            if (!signalOrigin)
            {
                Main.DebugLog(() => "CommsRadioNumberSwitcher: signalOrigin on isn't set, using this.transform!");
                signalOrigin = transform;
            }

            if (display == null)
            {
                Main.DebugLog(() => "CommsRadioNumberSwitcher: display not set, can't function properly!");
            }

            if ((selectionMaterial == null) || (skinningMaterial == null))
            {
                Main.DebugLog(() => "CommsRadioNumberSwitcher: Selection material(s) not set. Visuals won't be correct.");
            }

            if (trainHighlighter == null)
            {
                Main.DebugLog(() => "CommsRadioNumberSwitcher: trainHighlighter not set, can't function properly!!");
            }

            if ((HoverCarSound == null) || (SelectedCarSound == null) || (ConfirmSound == null) || (CancelSound == null))
            {
                Main.DebugLog(() => "Not all audio clips set, some sounds won't be played!");
            }

            TrainCarMask = LayerMask.GetMask(new string[]
            {
                "Train_Big_Collider"
            });

            HighlighterRender = trainHighlighter?.GetComponentInChildren <MeshRenderer>(true);
            trainHighlighter?.SetActive(false);
            trainHighlighter?.transform?.SetParent(null);
        }
 /// <summary>
 ///   <para>This re-establishes a non-player object with client authority with a client that is reconnected.  It is similar to NetworkServer.SpawnWithClientAuthority().</para>
 /// </summary>
 /// <param name="newConnection">The connection of the new client.</param>
 /// <param name="oldObject">The object with client authority that is being reconnected.</param>
 /// <param name="oldConnectionId">This client's connectionId on the old host.</param>
 /// <returns>
 ///   <para>True if the object was reconnected.</para>
 /// </returns>
 public bool ReconnectObjectForConnection(NetworkConnection newConnection, GameObject oldObject, int oldConnectionId)
 {
   if (!NetworkServer.active)
   {
     if (LogFilter.logError)
       Debug.LogError((object) "ReconnectObjectForConnection must have active server");
     return false;
   }
   if (LogFilter.logDebug)
     Debug.Log((object) ("ReconnectObjectForConnection: oldConnId=" + (object) oldConnectionId + " obj=" + (object) oldObject + " conn:" + (object) newConnection));
   if (!this.m_PendingPlayers.ContainsKey(oldConnectionId))
   {
     if (LogFilter.logError)
       Debug.LogError((object) ("ReconnectObjectForConnection oldConnId=" + (object) oldConnectionId + " not found."));
     return false;
   }
   oldObject.SetActive(true);
   oldObject.GetComponent<NetworkIdentity>().SetNetworkInstanceId(new NetworkInstanceId(0U));
   if (NetworkServer.SpawnWithClientAuthority(oldObject, newConnection))
     return true;
   if (LogFilter.logError)
     Debug.LogError((object) ("ReconnectObjectForConnection oldConnId=" + (object) oldConnectionId + " SpawnWithClientAuthority failed."));
   return false;
 }
 public void EnterGame()
 {
     mainMenu.SetActive(false);
     gameStarted = true;
 }
Esempio n. 8
0
 public void LoadMainMenu()
 {
     optionsMenu.SetActive(false);
     mainMenu.SetActive(true);
 }
Esempio n. 9
0
 private void ShowTypingBubble(bool isTyping)
 {
     typingBubble.SetActive(isTyping);
 }
Esempio n. 10
0
 public void OpenShop()
 {
     inMenu.TransitionTo(0.4f);
     shopPanel.SetActive(true);
 }
Esempio n. 11
0
 public void OpenLevelPanel()
 {
     inMenu.TransitionTo(0.4f);
     selectLevelPanel.SetActive(true);
 }
Esempio n. 12
0
	private void showDialog(){
		dialog.SetActive (true);
	}
 public void OnChangeTimeSampling()
 {
     m_fps_control.SetActive(m_dropdown_simesampling.value == 0);
 }
    // Update is called once per frame
    void Update()
    {
        // Will contain the information of which object the raycast hit
        RaycastHit hit;

        if (canJump)
        {
            jump.SetActive(true);
        }
        else
        {
            jump.SetActive(false);
        }

        Ray ray = cam.ViewportPointToRay(new Vector3(0.5F, 0.5F, 0));

        if (Physics.Raycast(ray, out hit, 2))
        {
            if (hit.transform.tag == "Climbable" || hit.transform.tag == "Window")
            {
                if (hit.collider.gameObject.GetComponent <BecomeActiveWhenClose>().closeEnough == true)
                {
                    canJump = true;
                }
                else
                {
                    canJump = false;
                }
            }
        }
        else
        {
            canJump = false;
        }

        // if raycast hits, it checks if it hit an object with the tag Player
        if (Physics.Raycast(transform.position, transform.forward, out hit, offset))
        {
            if (!Tags.Any(n => n.TriggerTag == hit.collider.tag))
            {
                target.sprite = Default;
            }
            else
            {
                if (hit.collider == null)
                {
                    target.sprite = Default;
                }
            }
        }
        else
        {
            target.sprite = Default;
        }


        foreach (Data dat in Tags)
        {
            if (Physics.Raycast(transform.position, transform.forward, out hit, offset) &&
                hit.collider.gameObject.CompareTag(dat.TriggerTag))
            {
                target.sprite = dat.CursorImage;
            }
        }
    }
Esempio n. 15
0
    void OnCollisionEnter(Collision collision)
    {
        if (interactionCount > 2)
        {
            nextTrash.SetActive(true);
        }


        if ((collision.gameObject.name == "trashbag" || collision.gameObject.name == "foam cup") && trashOk)
        {
            GetComponent <Animation>().Play();
            StartCoroutine(negativeCoroutine());
            trashOk = false;
        }



        if (collision.gameObject.name == "trashbag")
        {
            trashBagDialogue.SetActive(true);
            trashBagDialogue_trans.SetActive(true);

            boxDialogue.SetActive(false);
            boxDialogue_trans.SetActive(false);

            bottleDialogue.SetActive(false);
            bottleDialogue_trans.SetActive(false);

            foamCupDialogue.SetActive(false);
            foamCupDialogue_trans.SetActive(false);

            sodaDialogue.SetActive(false);
            sodaDialogue_trans.SetActive(false);

            trashCanRun = false;
            StartCoroutine(trashCoroutine());

            if (!trashHasCollided)
            {
                trashHasCollided = true;
                interactionCount++;
            }
        }

        if (collision.gameObject.name == "box")
        {
            trashBagDialogue.SetActive(false);
            trashBagDialogue_trans.SetActive(false);

            boxDialogue.SetActive(true);
            boxDialogue_trans.SetActive(true);

            bottleDialogue.SetActive(false);
            bottleDialogue_trans.SetActive(false);

            foamCupDialogue.SetActive(false);
            foamCupDialogue_trans.SetActive(false);

            sodaDialogue.SetActive(false);
            sodaDialogue_trans.SetActive(false);

            boxCanRun = false;
            StartCoroutine(boxCoroutine());

            if (!boxHasCollided)
            {
                boxHasCollided = true;
                interactionCount++;
            }
        }


        if (collision.gameObject.name == "wata bottle")
        {
            trashBagDialogue.SetActive(false);
            trashBagDialogue_trans.SetActive(false);

            boxDialogue.SetActive(false);
            boxDialogue_trans.SetActive(false);

            bottleDialogue.SetActive(true);
            bottleDialogue_trans.SetActive(true);

            foamCupDialogue.SetActive(false);
            foamCupDialogue_trans.SetActive(false);

            sodaDialogue.SetActive(false);
            sodaDialogue_trans.SetActive(false);

            bottleCanRun = false;
            StartCoroutine(bottleCoroutine());

            if (!bottleHasCollided)
            {
                bottleHasCollided = true;
                interactionCount++;
            }
        }

        if (collision.gameObject.name == "foam cup")
        {
            trashBagDialogue.SetActive(false);
            trashBagDialogue_trans.SetActive(false);

            boxDialogue.SetActive(false);
            boxDialogue_trans.SetActive(false);

            bottleDialogue.SetActive(false);
            bottleDialogue_trans.SetActive(false);

            foamCupDialogue.SetActive(true);
            foamCupDialogue_trans.SetActive(true);

            sodaDialogue.SetActive(false);
            sodaDialogue_trans.SetActive(false);

            foamCanRun = false;
            StartCoroutine(foamCoroutine());

            if (!foamHasCollided)
            {
                foamHasCollided = true;
                interactionCount++;
            }
        }

        if (collision.gameObject.name == "soda can")
        {
            trashBagDialogue.SetActive(false);
            trashBagDialogue_trans.SetActive(false);

            boxDialogue.SetActive(false);
            boxDialogue_trans.SetActive(false);

            bottleDialogue.SetActive(false);
            bottleDialogue_trans.SetActive(false);

            foamCupDialogue.SetActive(false);
            foamCupDialogue_trans.SetActive(false);

            sodaDialogue.SetActive(true);
            sodaDialogue_trans.SetActive(true);

            sodaCanRun = false;
            StartCoroutine(sodaCoroutine());

            if (!sodaHasCollided)
            {
                sodaHasCollided = true;
                interactionCount++;
            }
        }
    }
Esempio n. 16
0
 public void ShowMapMenu()
 {
     m_CharacterSelection.SetActive(false);
     m_MapSelection.SetActive(true);
 }
Esempio n. 17
0
 public void StartToCharacterSelection()
 {
     m_MainMenu.SetActive(false);
     m_CharacterSelection.SetActive(true);
     Invoke("EnterCharacterSelection", 0.1f);
 }
Esempio n. 18
0
 public void DisplayPause()
 {
     m_PauseMenu.SetActive(true);
 }
Esempio n. 19
0
 public void Goal()
 {
     goals++;
     textGoals.text = goals.ToString();
     imageGoals.SetActive(true);
 }
Esempio n. 20
0
 private static void ApplySpawnPayload(NetworkIdentity uv, Vector3 position, byte[] payload, NetworkInstanceId netId, GameObject newGameObject)
 {
   if (!uv.gameObject.activeSelf)
     uv.gameObject.SetActive(true);
   uv.transform.position = position;
   if (payload != null && payload.Length > 0)
   {
     NetworkReader reader = new NetworkReader(payload);
     uv.OnUpdateVars(reader, true);
   }
   if ((Object) newGameObject == (Object) null)
     return;
   newGameObject.SetActive(true);
   uv.SetNetworkInstanceId(netId);
   ClientScene.SetLocalObject(netId, newGameObject);
   if (!ClientScene.s_IsSpawnFinished)
     return;
   uv.OnStartClient();
   ClientScene.CheckForOwner(uv);
 }
        private bool Initialize()
        {
            bool success = true;
            try
            {
                _rectTransform = GetComponent<RectTransform>();
                _inputRT = _rectTransform.FindChild("InputField").GetComponent<RectTransform>();
                _mainInput = _inputRT.GetComponent<InputField>();

                _overlayRT = _rectTransform.FindChild("Overlay").GetComponent<RectTransform>();
                _overlayRT.gameObject.SetActive(false);


                _scrollPanelRT = _overlayRT.FindChild("ScrollPanel").GetComponent<RectTransform>();
                _scrollBarRT = _scrollPanelRT.FindChild("Scrollbar").GetComponent<RectTransform>();
                _slidingAreaRT = _scrollBarRT.FindChild("SlidingArea").GetComponent<RectTransform>();
                //  scrollHandleRT = slidingAreaRT.FindChild("Handle").GetComponent<RectTransform>();
                _itemsPanelRT = _scrollPanelRT.FindChild("Items").GetComponent<RectTransform>();
                //itemPanelLayout = itemsPanelRT.gameObject.GetComponent<LayoutGroup>();

                _canvas = GetComponentInParent<Canvas>();
                _canvasRT = _canvas.GetComponent<RectTransform>();

                _scrollRect = _scrollPanelRT.GetComponent<ScrollRect>();
                _scrollRect.scrollSensitivity = _rectTransform.sizeDelta.y / 2;
                _scrollRect.movementType = ScrollRect.MovementType.Clamped;
                _scrollRect.content = _itemsPanelRT;

                itemTemplate = _rectTransform.FindChild("ItemTemplate").gameObject;
                itemTemplate.SetActive(false);
            }
            catch (System.NullReferenceException ex)
            {
                Debug.LogException(ex);
                Debug.LogError("Something is setup incorrectly with the dropdownlist component causing a Null Refernece Exception");
                success = false;
            }
            panelObjects = new Dictionary<string, GameObject>();

            _prunedPanelItems = new List<string>();
            _panelItems = AvailableOptions.ToList();

            RebuildPanel();
            //RedrawPanel(); - causes an initialisation failure in U5
            return success;
        }
Esempio n. 22
0
 private void OnEnterPlayMode()
 {
     roboClone = Instantiate(roboParent, roboParent.transform.position, roboParent.transform.rotation);
     roboClone.name = "Parts (Play Mode)";
     roboParent.SetActive(false);
 }
Esempio n. 23
0
 // Use this for initialization
 void Start () {
     videoPlayer.SetActive(false);
 }
Esempio n. 24
0
 public void QuitPopUp(bool isActive)
 {
     quitPopUp.SetActive(isActive);
     Application.Quit();
 }
Esempio n. 25
0
 public void OpenOption()
 {
     inMenu.TransitionTo(0.4f);
     optionPanel.SetActive(true);
 }
 void Start()
 {
     game.SetActive(true);
     Invoke("setinactive", 1);
 }
Esempio n. 27
0
 public void SetEnableLights(bool enable)
 {
     lights.SetActive(enable);
 }
 public void HideUpdateMessageMenu()
 {
     UpdateMessageMenu.SetActive(false);
 }
Esempio n. 29
0
 public void scytheNO()
 {
     if(rubies > 10 && ScytheIsBought == false ){
         ScytheBuy.SetActive(true);
     }
 }
 public void Forward()
 {
     MainMenu.SetActive(false);
     GameChooseMenu.SetActive(true);
 }
Esempio n. 31
0
 private void SetWaitPanelActive(bool active)
 {
     MatchRoomPanel.SetActive(active);
 }
 public void Back()
 {
     MainMenu.SetActive(true);
     GameChooseMenu.SetActive(false);
     MapSelectionMenu.SetActive(false);
 }
Esempio n. 33
0
 // Disables and enables credits
 public void ToggleCredits()
 {
     menuUI.SetActive(!menuUI.activeSelf);
     creditsUI.SetActive(!creditsUI.activeSelf);
 }
	public void CloseMiniGame(){
		golovolomka.SetActive (false);
	}
 /// <summary>
 ///   <para>This re-establishes a player object with a client that is reconnected.  It is similar to NetworkServer.AddPlayerForConnection(). The player game object will become the player object for the new connection.</para>
 /// </summary>
 /// <param name="newConnection">The connection of the new client.</param>
 /// <param name="oldPlayer">The player object.</param>
 /// <param name="oldConnectionId">This client's connectionId on the old host.</param>
 /// <param name="playerControllerId">The playerControllerId of the player that is rejoining.</param>
 /// <returns>
 ///   <para>True if able to re-add this player.</para>
 /// </returns>
 public bool ReconnectPlayerForConnection(NetworkConnection newConnection, GameObject oldPlayer, int oldConnectionId, short playerControllerId)
 {
   if (!NetworkServer.active)
   {
     if (LogFilter.logError)
       Debug.LogError((object) "ReconnectPlayerForConnection must have active server");
     return false;
   }
   if (LogFilter.logDebug)
     Debug.Log((object) ("ReconnectPlayerForConnection: oldConnId=" + (object) oldConnectionId + " player=" + (object) oldPlayer + " conn:" + (object) newConnection));
   if (!this.m_PendingPlayers.ContainsKey(oldConnectionId))
   {
     if (LogFilter.logError)
       Debug.LogError((object) ("ReconnectPlayerForConnection oldConnId=" + (object) oldConnectionId + " not found."));
     return false;
   }
   oldPlayer.SetActive(true);
   NetworkServer.Spawn(oldPlayer);
   if (!NetworkServer.AddPlayerForConnection(newConnection, oldPlayer, playerControllerId))
   {
     if (LogFilter.logError)
       Debug.LogError((object) ("ReconnectPlayerForConnection oldConnId=" + (object) oldConnectionId + " AddPlayerForConnection failed."));
     return false;
   }
   if (NetworkServer.localClientActive)
     this.SendPeerInfo();
   return true;
 }
        private static void SetupFootprintPrefab()
        {
            footprintPrefab = new GameObject ("KerbalEVAFootprint");
            footprintPrefab.layer = GameLayers.LocalSpace;
            footprintPrefab.SetActive (false);

            var mf = footprintPrefab.AddComponent<MeshFilter> ();
            var mr = footprintPrefab.AddComponent<MeshRenderer> ();

            mf.mesh = new Quad (0.15f, 0.3f, true);

            var material = new Material (Shaders.Footprint);
            var footprintMask = new Texture2D (4, 4);
            footprintMask.LoadImage (Textures.KerbalEVAFootprintMask);
            material.SetTexture ("_MainTex", footprintMask);
            material.SetFloat ("_Opacity", 0.8f);
            material.SetColor ("_Color", Color.black);
            mr.material = material;
            mr.castShadows = false;

            footprintPrefab.AddComponent<KerbalEVAFootprint> ();

            Utils.Log ("Footprint prefab created");
        }
Esempio n. 37
0
		private bool Initialize()
		{
			bool success = true;
			try
			{
				_rectTransform = GetComponent<RectTransform>();
				_mainButton = new DropDownListButton(_rectTransform.FindChild("MainButton").gameObject);

				_overlayRT = _rectTransform.FindChild("Overlay").GetComponent<RectTransform>();
				_overlayRT.gameObject.SetActive(false);


				_scrollPanelRT = _overlayRT.FindChild("ScrollPanel").GetComponent<RectTransform>();
				_scrollBarRT = _scrollPanelRT.FindChild("Scrollbar").GetComponent<RectTransform>();
				_slidingAreaRT = _scrollBarRT.FindChild("SlidingArea").GetComponent<RectTransform>();
				//  scrollHandleRT = slidingAreaRT.FindChild("Handle").GetComponent<RectTransform>();
				_itemsPanelRT = _scrollPanelRT.FindChild("Items").GetComponent<RectTransform>();
				//itemPanelLayout = itemsPanelRT.gameObject.GetComponent<LayoutGroup>();

				_canvas = GetComponentInParent<Canvas>();
				_canvasRT = _canvas.GetComponent<RectTransform>();

				_scrollRect = _scrollPanelRT.GetComponent<ScrollRect>();
				_scrollRect.scrollSensitivity = _rectTransform.sizeDelta.y / 2;
				_scrollRect.movementType = ScrollRect.MovementType.Clamped;
				_scrollRect.content = _itemsPanelRT;


				_itemTemplate = _rectTransform.FindChild("ItemTemplate").gameObject;
				_itemTemplate.SetActive(false);
			}
			catch (System.NullReferenceException ex)
			{
				Debug.LogException(ex);
				Debug.LogError("Something is setup incorrectly with the dropdownlist component causing a Null Refernece Exception");
				success = false;
			}

			_panelItems = new List<DropDownListButton>();

			RebuildPanel();
			RedrawPanel();
			return success;
		}
Esempio n. 38
0
 private CombinedMeshComponent AddMeshComponent()
 {
     GameObject gobj = new GameObject(
     "LWF/" + data.name + "/Mesh/" + meshComponents.Count);
     gobj.SetActive(false);
     gobj.transform.parent = gameObject.transform;
     gobj.transform.localPosition = Vector3.zero;
     gobj.transform.localScale = Vector3.one;
     gobj.transform.localRotation = Quaternion.identity;
     CombinedMeshComponent meshComponent =
     gobj.AddComponent<CombinedMeshComponent>();
     meshComponent.Init(this);
     meshComponents.Add(meshComponent);
     return meshComponent;
 }
 public void PushToPool( ref GameObject obj, bool retainObject = true, Transform parent = null)
 {
     if(obj == null) { return; }
     if(retainObject == false)
     {
         Object.Destroy(obj);
         obj = null;
         return;
     }
     if(parent != null)
     {
         obj.transform.parent = parent;
     }
     Queue<GameObject> queue = FindInContainer(obj.name);
     queue.Enqueue(obj);
     obj.SetActive(false);
     obj = null;
 }
Esempio n. 40
0
	public void GameOver() {
		gameOverPanel.SetActive (true);
		highScoreText.text = PlayerPrefs.GetInt ("HighScore").ToString ();
		//playerDead.SetActive (true);
	}
Esempio n. 41
0
 void Start()
 {
     gameObject.GetComponent<Canvas>().enabled = false;
     template = transform.Find("panel").Find("character").gameObject;
     template.SetActive(false);
 }
 public void OnHover()
 {
     HoverWindow.SetActive(true);
     HoverManager.instance.DisplaySpell(spell);
 }
Esempio n. 43
0
 private CombinedMeshComponent AddMeshComponent()
 {
     GameObject gobj = new GameObject(
     "LWF/" + data.name + "/Mesh/" + meshComponents.Count);
     gobj.SetActive(false);
     gobj.transform.parent = gameObject.transform;
     gobj.transform.position = gameObject.transform.position;
     CombinedMeshComponent meshComponent =
     gobj.AddComponent<CombinedMeshComponent>();
     meshComponent.Init(this);
     meshComponents.Add(meshComponent);
     return meshComponent;
 }
Esempio n. 44
0
    void Update()
    {
        Player player = Utils.ClientLocalPlayer();
        if (!player) return;

        // hotkey (not while typing in chat, etc.)
        if (Input.GetKeyDown(hotKey) && !UIUtils.AnyInputActive())
            panel.SetActive(!panel.activeSelf);

        // only update the panel if it's active
        if (panel.activeSelf)
        {
            Party party = player.party;
            int memberCount = party.members != null ? party.members.Length : 0;

            // properties
            currentCapacityText.text = memberCount.ToString();
            maximumCapacityText.text = Party.Capacity.ToString();

            // instantiate/destroy enough slots
            UIUtils.BalancePrefabs(slotPrefab.gameObject, memberCount, memberContent);

            // refresh all members
            for (int i = 0; i < memberCount; ++i)
            {
                UIPartyMemberSlot slot = memberContent.GetChild(i).GetComponent<UIPartyMemberSlot>();
                string memberName = party.members[i];

                slot.nameText.text = memberName;
                slot.masterIndicatorText.gameObject.SetActive(i == 0);

                // party struct doesn't sync health, mana, level, etc. We find
                // those from observers instead. Saves bandwidth and is good
                // enough since another member's health is only really important
                // to use when we are fighting the same monsters.
                // => null if member not in observer range, in which case health
                 //    bars etc. should be grayed out!

                // update some data only if around. otherwise keep previous data.
                // update icon only if around. otherwise keep previous one.
                if (Player.onlinePlayers.ContainsKey(memberName))
                {
                    Player member = Player.onlinePlayers[memberName];
                    slot.icon.sprite = member.classIcon;
                    slot.levelText.text = member.level.ToString();
                    slot.guildText.text = member.guildName;
                    slot.healthSlider.value = member.HealthPercent();
                    slot.manaSlider.value = member.ManaPercent();
                }

                // action button:
                // dismiss: if i=0 and member=self and master
                // kick: if i > 0 and player=master
                // leave: if member=self and not master
                if (memberName == player.name && i == 0)
                {
                    slot.actionButton.gameObject.SetActive(true);
                    slot.actionButton.GetComponentInChildren<Text>().text = "Dismiss";
                    slot.actionButton.onClick.SetListener(() => {
                        player.CmdPartyDismiss();
                    });
                }
                else if (memberName == player.name && i > 0)
                {
                    slot.actionButton.gameObject.SetActive(true);
                    slot.actionButton.GetComponentInChildren<Text>().text = "Leave";
                    slot.actionButton.onClick.SetListener(() => {
                        player.CmdPartyLeave();
                    });
                }
                else if (party.members[0] == player.name && i > 0)
                {
                    slot.actionButton.gameObject.SetActive(true);
                    slot.actionButton.GetComponentInChildren<Text>().text = "Kick";
                    int icopy = i;
                    slot.actionButton.onClick.SetListener(() => {
                        player.CmdPartyKick(icopy);
                    });
                }
                else
                {
                    slot.actionButton.gameObject.SetActive(false);
                }
            }

            // exp share toggle
            experienceShareToggle.interactable = player.InParty() && party.members[0] == player.name;
            experienceShareToggle.onValueChanged.SetListener((val) => {}); // avoid callback while setting .isOn via code
            experienceShareToggle.isOn = party.shareExperience;
            experienceShareToggle.onValueChanged.SetListener((val) => {
                player.CmdPartySetExperienceShare(val);
            });

            // gold share toggle
            goldShareToggle.interactable = player.InParty() && party.members[0] == player.name;
            goldShareToggle.onValueChanged.SetListener((val) => {}); // avoid callback while setting .isOn via code
            goldShareToggle.isOn = party.shareGold;
            goldShareToggle.onValueChanged.SetListener((val) => {
                player.CmdPartySetGoldShare(val);
            });
        }
    }