public GameObject ShowSelectionPopUp() { SystemSoundController.Instance.PlaySFX("SFX_ChangeOrder"); GameObject selectionPopUp = SystemResourceController.Instance.LoadPrefab("PopUpChangeOrder", SystemPopupController.Instance.popUp); List <GameObject> popUpSelectionList = new List <GameObject> (); for (int i = 0; i < selectionPopUp.transform.childCount; i++) { popUpSelectionList.Add(selectionPopUp.transform.GetChild(i).gameObject); } if (popUpSelectionList.Count > 1) { int randomSelection = UnityEngine.Random.Range(1, popUpSelectionList.Count); GameObject selectionToBeSwitched1 = popUpSelectionList[randomSelection - 1]; GameObject selectionToBeSwitched2 = popUpSelectionList[randomSelection]; Vector3 selectionPosition = selectionToBeSwitched1.transform.localPosition; selectionToBeSwitched1.transform.localPosition = selectionToBeSwitched2.transform.localPosition; selectionToBeSwitched2.transform.localPosition = selectionPosition; TweenFacade.TweenMoveTo(selectionToBeSwitched1.transform, selectionToBeSwitched2.transform.localPosition, 0.5f); TweenFacade.TweenJumpTo(selectionToBeSwitched2.transform , selectionToBeSwitched1.transform.localPosition, 180f, 1, 0.5f, 0); } return(selectionPopUp); }
public GameObject ShowSelectionPopUp() { SystemSoundController.Instance.PlaySFX("SFX_SelectLetter"); GameObject selectionPopUp = SystemResourceController.Instance.LoadPrefab("PopUPSelectLetter", SystemPopupController.Instance.popUp); List <GameObject> popUpSelectionList = new List <GameObject> (); for (int i = 0; i < selectionPopUp.transform.childCount; i++) { popUpSelectionList.Add(selectionPopUp.transform.GetChild(i).gameObject); } if (popUpSelectionList.Count > 0) { for (int i = 0; i < popUpSelectionList.Count; i++) { if (i % 2 == 0) { TweenFacade.TweenJumpTo( popUpSelectionList [i].transform, popUpSelectionList [i].transform.localPosition, 40f, 1, 0.1f , 0); } else { TweenFacade.TweenJumpTo( popUpSelectionList [i].transform, popUpSelectionList [i].transform.localPosition, 40f, 1, 0.1f , 0.5f); } } } return(selectionPopUp); }
public GameObject ShowSelectionPopUp() { SystemSoundController.Instance.PlaySFX("SFX_WordChoice"); GameObject selectionPopUp = SystemResourceController.Instance.LoadPrefab("PopUpWordChoice", SystemPopupController.Instance.popUp); gameObject.SetActive(true); popUpSelectionList = new List <GameObject> (); for (int i = 0; i < selectionPopUp.transform.childCount; i++) { popUpSelectionList.Add(selectionPopUp.transform.GetChild(i).gameObject); } if (popUpSelectionList.Count > 1) { TweenFacade.TweenJumpTo(popUpSelectionList [0].transform, popUpSelectionList [0].transform.localPosition , 30f, 1, 0.5f, 0); TweenFacade.TweenJumpTo(popUpSelectionList [1].transform, popUpSelectionList [1].transform.localPosition , 30f, 1, 0.5f, 0.5f); InvokeRepeating("ChangeSelectionColor", 0.5f, 0.5f); // StartCoroutine (ChangeSelectionColor (popUpSelectionList)); } return(selectionPopUp); }