public void OnSwapGunBegin(BaseActor baseActor) { if (Global.Instance.battle.BattleUI.GetComponent<BattleUI>().Center.GetComponent<Button_Center>().fireControl.isPress) return; if (_eESwapGunState != ESwapGunState.END) return; if (_eESwapBulletState != ESwapBulletState.END) return; this.baseActor = baseActor; _eESwapGunState = ESwapGunState.DOWN; iTween.StopByName(baseActor.info.m_GunList[baseActor.info.useGunIndex].info.obj, "Swap_gun_down"); iTween.StopByName(baseActor.info.m_GunList[baseActor.info.useGunIndex].info.obj, "Swap_gun_up"); Hashtable hashtable = new Hashtable(); hashtable.Add("name", "Swap_gun_down"); hashtable.Add("time", 0.275f); hashtable.Add("x", 30.0f); hashtable.Add("islocal", true); hashtable.Add("oncomplete", "OnSwapGunModel"); hashtable.Add("oncompletetarget", gameObject); iTween.RotateTo(gameObject, hashtable); //发消息 LoginMsg.C2S_Actor_Animation msg = new LoginMsg.C2S_Actor_Animation(); msg.animatiom = "SwapGun"; msg.roomNum = baseActor.info.roomID; baseActor.info.sendAnimationNum++; msg.num = baseActor.info.sendAnimationNum; LoginServerManager.Instance.Server.SendMessage(baseActor.info.guid, ICmdNum.CmdNum.CS_Actor_Animation, msg, LoginServerManager.Instance.sendTime.interval_3, LoginServerManager.Instance.sendTime.count_3); //动画 baseActor.info.obj.GetComponent<AnimationControl>().SwapGun(); }
// public void OnSwapBulletBegin(BaseActor baseActor) { if (_eESwapGunState != ESwapGunState.END) return; if (_eESwapBulletState != ESwapBulletState.END) return; this.baseActor = baseActor; _eESwapBulletState = ESwapBulletState.UP; Global.Instance.battle.BattleUI.GetComponent<BattleUI>().CrossFireReturn(); Hashtable hashtable = new Hashtable(); hashtable.Add("name", "Swap_bullet_up"); hashtable.Add("time", 0.25f); hashtable.Add("x", 30.0f); hashtable.Add("islocal", true); hashtable.Add("oncomplete", "OnSwapBulletModel"); hashtable.Add("oncompletetarget", gameObject); iTween.RotateTo(gameObject, hashtable); //发消息 LoginMsg.C2S_Actor_Animation msg = new LoginMsg.C2S_Actor_Animation(); msg.animatiom = "SwapBullet"; msg.roomNum = baseActor.info.roomID; baseActor.info.sendAnimationNum++; msg.num = baseActor.info.sendAnimationNum; LoginServerManager.Instance.Server.SendMessage(baseActor.info.guid, ICmdNum.CmdNum.CS_Actor_Animation, msg, LoginServerManager.Instance.sendTime.interval_3, LoginServerManager.Instance.sendTime.count_3); //动画 baseActor.info.obj.GetComponent<AnimationControl>().SwapBullet(); }