// run SelectWeponBox.cs public void SelectedSword(GameObject wepon) { isSelected = true; //hide popup FirstPersonControl firstPersonControl = GameObject.Find("First Person Controller").GetComponent <FirstPersonControl> (); firstPersonControl.ActiveSword(); if (FirstPersonControl.VR) { } else { HandControl.rightGraphicsModel = null; HandControl.leftGraphicsModel = null; } Stan.StartWand(); Stan.playMovingSound(); StartCoroutine(Moving(5F)); sword.gameObject.SetActive(true); wepon.transform.parent = sword.transform; LeanTween.cancel(wepon); LeanTween.scale(wepon, new Vector3(1, 1, 1), 3.0f).setEase(LeanTweenType.easeOutQuad); LeanTween.rotateLocal(wepon, new Vector3(0, 180, 180), 3.0f).setEase(LeanTweenType.easeOutQuad); LeanTween.moveLocal(wepon, new Vector3(0, 0, 0), 3.0f).setEase(LeanTweenType.easeOutQuad); }
IEnumerator Moving(float waitTime) { yield return(new WaitForSeconds(waitTime)); isMoving = true; FirstPersonControl firstPersonControl = GameObject.Find("First Person Controller").GetComponent <FirstPersonControl> (); firstPersonControl.ActiveSword(); CubeStanCd.GetComponent <Collider> ().enabled = true; BGM bgm = GameObject.Find("BGM").GetComponent <BGM> (); bgm.Play2(); popupBox.Deactive(); }