public void PlayPropsAnimation(ArgsPropsInfo propInfo, Transform toolParent, Transform startPos, Transform endPos) { MsgProps type = (MsgProps)propInfo.propsId; Sequence se = DOTween.Sequence(); string tweenName = ""; switch (type) { case MsgProps.MsgPropsEgg: //鸡蛋 >>ok tweenName = "AnimProp_jidan"; CretePropsTween_Two(type, startPos, endPos, tweenName); break; case MsgProps.MsgPropsBeer: //啤酒 >>Ok 修改 同玫,因为有动画状态机 两个动画中间有个转换 tweenName = "AnimProp_pijiu"; BeerAnimation(se, type, startPos, endPos, GetScaleMutiple(type, 1), tweenName); break; case MsgProps.MsgPropsBomb: //炸弹 >>ok tweenName = "AnimProp_shoulei"; CretePropsTween_Two(type, startPos, endPos, tweenName); break; case MsgProps.MsgPropsRose: //玫瑰 >>修改 添加了一个预制体 tweenName = "AnimProp_yizhihua"; RoseAnimation(se, type, startPos, endPos, GetScaleMutiple(type, 1), tweenName); break; case MsgProps.MsgPropsKnife: //刀子 >>修改 修改了刀光 tweenName = "AnimProp_caidao"; CretePropsTween_Two(type, startPos, endPos, tweenName); break; case MsgProps.MsgPropsBrick: //板砖 >>Ok tweenName = "AnimProp_Tbanzhuan"; CretePropsTween_Two(type, startPos, endPos, tweenName); break; case MsgProps.MsgPropsIncense: //香炉 >>Ok 修改了烟雾 tweenName = "AnimProp_xianglu"; CretePropsTween_Two(type, startPos, endPos, tweenName, 4); break; case MsgProps.MsgPropsGod: //财神 >>OK tweenName = "AnimProp_dushen"; CretePropsTween_Three(type, startPos, endPos, tweenName, 15); break; } }
void UseProps(LocalNotification e) { ArgsPropsInfo propInfo = e.param as ArgsPropsInfo; EPlayerPositionType startType = RoomInfo.Instance.GetPlayerPosById(propInfo.action_id); EPlayerPositionType endType = RoomInfo.Instance.GetPlayerPosById(propInfo.target_id); Transform startPos = GetHeadPos(startType); if (propInfo.target_id == 0) { endType = EPlayerPositionType.ESelf; } Transform endPos = GetHeadPos(endType) /*.localPosition*/; TweenManager.Instance.PlayPropsAnimation(propInfo, this.transform, startPos, endPos); PlayerInfo.Instance.UpdateGold(0);//扣除当前的玩家的金币(暂时不扣除金币) }