public void OnClickSkillItem() { if (previousSelectedButton != null) { Destroy(GameObject.Find("SkillNav")); } currentSelectedButton = EventSystem.current.currentSelectedGameObject; previousSelectedButton = previousSelectedButton == null ? EventSystem.current.currentSelectedGameObject: currentSelectedButton; GameObject answerPrefab = Instantiate(Resources.Load("Prefabs/SkillNav")) as GameObject; answerPrefab.transform.SetParent(EventSystem.current.currentSelectedGameObject.transform, false); TweenController.TweenScaleToSmall(previousSelectedButton.transform, new Vector3(1.0f, 1.0f, 1.0f), 0.5f); TweenController.TweenScaleToLarge(EventSystem.current.currentSelectedGameObject.transform, new Vector3(1.10f, 1.10f, 1.10f), 0.5f); answerPrefab.name = "SkillNav"; answerPrefab.transform.localPosition = new Vector3(53, EventSystem.current.currentSelectedGameObject.transform.localPosition.y, 0); answerPrefab.transform.SetAsFirstSibling(); answerPrefab.transform.GetChild(1).GetComponent <Button> ().onClick.AddListener(() => { OnClickInfo(); }); answerPrefab.transform.GetChild(2).GetComponent <Button> ().onClick.AddListener(() => { OnClickUse(); }); //TweenController.TweenMoveTo (answerPrefab.transform,),0.5f); //_scrollRect.content.GetChild(0).transform.SetAsLastSibling(); }
public void ScaleToSmall() { TweenController.TweenScaleToSmall(gestureButtonContainer.transform, new Vector3(0.7f, 0.7f, 0.7f), 0.1f); Invoke("HideGestureButton", 0.05f); }