void OnEnable() { if (product == null) { gameObject.SetActive(false); NotificationViewController.ShowNotification(Localization.Localize(StringKey.Msg_FindProductFail)); return; } cover.SetActive(true); scrollCamera.SetActive(true); leftButton.SetActive(false); rightButton.SetActive(true); modelPrefab = Resources.Load("Prefabs/ProductPrefab") as GameObject; model = Instantiate(modelPrefab) as GameObject; model.transform.position = new Vector3(0, 1000, 0); labelPrefab = Resources.Load("Prefabs/ProductLabel") as GameObject; SingleModelController smc = model.GetComponent <SingleModelController>(); smc.beforeMoveAway = BeforeMoveAway; smc.beforeMoveBack = BeforeMoveBack; smc.afterMoveAway = AfterMoveAway; smc.afterMoveBack = AfterMoveBack; ResizeViewport(); tableComp.Reposition(); }
private void RightButtonClick(GameObject go) { SingleModelController smc = model.GetComponent <SingleModelController>(); if (smc != null) { smc.MoveAway(); } }
private void ResizeViewport() { SingleModelController smc = model.GetComponent <SingleModelController>(); UIViewport vp = smc.surroundCamera.GetComponent <UIViewport>(); if (vp != null) { vp.sourceCamera = sourceCamera.GetComponent <Camera>(); vp.topLeft = topLeft.transform; vp.bottomRight = bottomRight2.transform; } }