public void SetWeapon(MenuFirstPageGun firstPageGun) { this.ReleaseAllCheck(); firstPageGun.SetChecked(true); if (this.gameObj != null) { this.gameObj.SetActive(false); } this.info.SetInfo(firstPageGun.weaponName.ToUpper()); this.speed = Vector2.zero; this.gameObj = firstPageGun.weaponLoader.weaponInstance; this.gameObj.transform.rotation = Quaternion.identity; this.gameObj.transform.position += new Vector3(3f, 0f, 0f); this.gameObj.SetActive(true); this.gameObj.transform.DOMove(firstPageGun.weaponLoader.originPos, 0.8f).SetEase(Ease.OutCubic); }
private void Awake() { canvasGroup = GetComponent <CanvasGroup>(); equipments = Find <RectTransform>("LeftPanel"); touchPad = Find <GameCameraTouchPad>("Bg"); info = Find <MenuFirstPageInfo>("RightPanel"); gun1 = Find <MenuFirstPageGun>("LeftPanel/Box/Weapon1"); gun2 = Find <MenuFirstPageGun>("LeftPanel/Box/Weapon2"); item1 = Find <MenuFirstPageGun>("LeftPanel/Box/Item1"); this.touchPad.onDrag = (Action <Vector2>)Delegate.Combine(this.touchPad.onDrag, new Action <Vector2>(this.OnDrag)); this.touchPad.onDown = (Action <Vector2>)Delegate.Combine(this.touchPad.onDown, new Action <Vector2>(this.OnDown)); this.touchPad.onUp = (Action <Vector2>)Delegate.Combine(this.touchPad.onUp, new Action <Vector2>(this.OnUp)); canvasGroup.alpha = 0; gameObject.SetActive(false); }