void updateChild() { Texture2D _childTexture = new Texture2D(1024, 768); byte [] data = AGGameState.getChildImage(); if (data != null && data.Length > 0) { _childTexture.LoadImage(data); } else { _childTexture = defaultChildImage; } childImage.renderer.material.mainTexture = _childTexture; starCount.text = string.Format("{0}", AGGameState.getStarCount()); string chName = AGGameState.getChildName(); if (chName == null || chName.Equals("")) { chName = "Child"; } childName.text = chName; }
void updateChild() { Texture2D _childTexture = new Texture2D(1024, 768); byte [] data = AGGameState.getChildImage(); if (data != null && data.Length > 0) { _childTexture.LoadImage(data); } else { _childTexture = defaultChildImage; } childImage.renderer.material.mainTexture = _childTexture; starCount.text = string.Format("{0}", AGGameState.getStarCount()); string chName = AGGameState.getChildName(); if (chName != null && !chName.Equals(childName.text)) { double timeSpent = (double)(Time.time - AGGameState.startingTime); AndroidJavaObject persistanceManager = AGGameState.getPersistanceManager(); persistanceManager.Call("addChildSessionTimeLog", (double)timeSpent); AGGameState.startingTime = Time.time; } if (chName == null || chName.Equals("")) { chName = "Child"; } childName.text = chName; if (AGGameState.getChildCount() > 1) { childSwitchButton.SetActive(true); } else { childSwitchButton.SetActive(false); } }