Example #1
0
    public void OnSwapBulletModel()
    {
        _eESwapBulletState = ESwapBulletState.DOWN;

        iTween.StopByName(baseActor.info.m_GunList[baseActor.info.useGunIndex].info.obj, "Swap_bullet_up");

        Hashtable hashtable = new Hashtable();
        hashtable.Add("name", "Swap_bullet_down");
        hashtable.Add("time", 0.25f);
        hashtable.Add("x", 0.0f);
        hashtable.Add("islocal", true);
        hashtable.Add("oncomplete", "OnSwapBulletComplete");
        hashtable.Add("oncompletetarget", gameObject);
        iTween.RotateTo(gameObject, hashtable);  
    }
Example #2
0
 public void OnSwapBulletComplete()
 {
     //弹药
     baseActor.info.m_GunList[baseActor.info.useGunIndex].info.curCount = baseActor.info.m_GunList[baseActor.info.useGunIndex].info.count;
     Global.Instance.battle.BattleUI.GetComponent<BattleUI>().BulletCount.text = baseActor.info.m_GunList[baseActor.info.useGunIndex].info.curCount.ToString();
     //
     iTween.StopByName(baseActor.info.m_GunList[baseActor.info.useGunIndex].info.obj, "Swap_bullet_down");
     _eESwapBulletState = ESwapBulletState.END;
     //TweenRotation tweenRotation = baseActor.info.swapGunPoint.GetComponent<TweenRotation>();
     //tweenRotation.enabled = false;
 }
Example #3
0
    //
    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();
        
    }