IEnumerator Startup() { ViewController.GetInstance().Initialize(ViewAnchorRef.transform); UserDataController.GetInstance().Initialize(); while (UserDataController.GetInstance().ContactsUsers == null) { yield return(null); } SoundManager.GetInstance(); yield return(new WaitForSeconds(.1f)); StartCoroutine(NetworkController.GetInstance().Connect()); SpeechController.GetInstance().Initialize(); PhotoController.GetInstance().Initialize(); CheatController.GetInstance().Initialize(ViewAnchorRef.transform); ContactsList cl = ViewController.GetInstance().CurrentView.GetComponent <ContactsList>(); cl.Initialize(); //Initiate The Singletons //Transaction<List<TcgCard>> t = new Transaction<List<TcgCard>>(); }
private void PhotoDragHandler(Sprite spr) { if (null != PhotoController.GetInstance().ActiveSet&& null != spr) { NetworkController.GetInstance().SendPhotoMessage(PhotoController.GetInstance().ActiveSet.Name, spr.name); } SharedPhotoViewOn(spr); }
/* * public void ChangeState(ContactsList.CurrentState State) * { * if (State == ContactsList.CurrentState.ContactList) * { * AcceptingInput = true; * transform.Find("Albums").gameObject.SetActive(false); * transform.Find("Requests").gameObject.SetActive(true); * transform.Find("Tab/TimeToCall").gameObject.SetActive(true); * transform.Find("Tab/LastTalked").gameObject.SetActive(true); * transform.Find("Tab/Calling").gameObject.SetActive(false); * } * * if (State == ContactsList.CurrentState.Calling) * { * AcceptingInput = false; * transform.Find("Albums").gameObject.SetActive(false); * transform.Find("Requests").gameObject.SetActive(false); * transform.Find("Tab/TimeToCall").gameObject.SetActive(false); * transform.Find("Tab/LastTalked").gameObject.SetActive(false); * transform.Find("Tab/Calling").gameObject.SetActive(true); * } * * if (State == ContactsList.CurrentState.Calling) * { * AcceptingInput = false; * transform.Find("Albums").gameObject.SetActive(false); * transform.Find("Requests").gameObject.SetActive(false); * transform.Find("Tab/TimeToCall").gameObject.SetActive(false); * transform.Find("Tab/LastTalked").gameObject.SetActive(false); * transform.Find("Tab/Calling").gameObject.SetActive(true); * } * } */ public void SetUserPopsicleInfo(ContactModel contactModel) { NameText.text = contactModel.Name; TimeToCallText.text = contactModel.TimeToCall; LastTalkedText.text = contactModel.LastTalked; if (UserDataController.GetInstance().ActiveUserType == UserDataController.UserType.Caregiver) { List <LayoutElement> les = RequestedOfMeScroll.content.GetComponent <VerticalLayoutGroup>().GetComponentsInChildren <LayoutElement>().ToList(); foreach (LayoutElement le in les) { Destroy(le.gameObject); } foreach (string req in contactModel.RequestedOfMe) { GameObject go = GameObject.Instantiate <GameObject>(requestedOfMeItemPrefab, RequestedOfMeScroll.content.transform); go.GetComponent <RectTransform>().localScale = Vector3.one; go.transform.Find("Text").GetComponent <Text>().text = req; } les = RequestedOfOthersScroll.content.GetComponent <VerticalLayoutGroup>().GetComponentsInChildren <LayoutElement>().ToList(); foreach (LayoutElement le in les) { Destroy(le.gameObject); } foreach (string req in contactModel.RequestedOfOthers) { GameObject go = GameObject.Instantiate <GameObject>(requestedOfOthersItemPrefab, RequestedOfOthersScroll.content.transform); go.GetComponent <RectTransform>().localScale = Vector3.one; go.transform.Find("Text").GetComponent <Text>().text = req; } } else { ScrollRect albumScrollRect = SeniorAlbums.transform.Find("Scroll View").GetComponent <ScrollRect>(); List <LayoutElement> les = albumScrollRect.content.transform.GetComponentsInChildren <LayoutElement>().ToList(); foreach (LayoutElement le in les) { Destroy(le.gameObject); } GameObject albumImagePrefab = Resources.Load <GameObject>("Prefabs/ContactsScreen/AlbumImage"); foreach (string photoName in contactModel.Photos) { Regex re = new Regex(@"([a-zA-Z]+)(\d+)"); Match result = re.Match(photoName); string alphaPart = result.Groups[1].Value; string numberPart = result.Groups[2].Value; Sprite photoSprite = PhotoController.GetInstance().GetPhoto(alphaPart, photoName); GameObject albumImageInstance = Instantiate <GameObject>(albumImagePrefab); albumImageInstance.GetComponent <Image>().sprite = photoSprite; albumImageInstance.transform.SetParent(albumScrollRect.content.transform); albumImageInstance.GetComponent <RectTransform>().localScale = Vector3.one; //albumScrollRect.Rebuild(CanvasUpdate.Prelayout); } } }
// Use this for initialization void Start() { PhotoController.GetInstance().OnActiveSetChanged += PhotoSetChanged; sv = this.GetComponent <ScrollRect>(); PhotoSet set = PhotoController.GetInstance().ActiveSet; SetActivePhotos(set); }
void Start() { ButtonComponent = transform.Find("Mask/Mask/BG").GetComponent <Button>(); ScrollView = this.transform.Find("Mask/ScrollView").GetComponent <RectTransform>(); ButtonComponent.onClick.AddListener(ShowScrollView); LocalViewCanvas = transform.Find("Mask/Mask/BG").GetComponent <CanvasRenderer>(); transform.Find("Mask/Mask/BG").GetComponent <Image>().sprite = Resources.Load <Sprite>("Textures/Photos/Profile/" + UserDataController.GetInstance().UserImage); VideoChat.localView = true; if (Application.platform == RuntimePlatform.Android) { LocalViewCanvas.GetComponent <RectTransform>().Rotate(new Vector3(0, 0, 90)); } PhotoController.GetInstance().OnActiveSetChanged += ForceOpenScrollView; }
private void ReceivedNetworkPhoto(string setName, string photoName) { Sprite spr = PhotoController.GetInstance().GetPhoto(setName, photoName); SharedPhotoViewOn(spr); }