| | |
| | | this.onHit = onHit; |
| | | this.bulletTrans = bulletEffect.transform as RectTransform; |
| | | this.hurts = tagUseSkillAttack.HurtList.ToList(); |
| | | |
| | | // 设置bulletTrans坐标为caster.heroRectTrans的世界坐标转换到bulletTrans父节点下的本地坐标 |
| | | if (bulletTrans != null && caster.heroRectTrans != null) |
| | | { |
| | | var parent = bulletTrans.parent as RectTransform; |
| | | Vector2 localPoint; |
| | | RectTransformUtility.ScreenPointToLocalPointInRectangle( |
| | | parent, |
| | | RectTransformUtility.WorldToScreenPoint(null, caster.heroRectTrans.position), |
| | | null, |
| | | out localPoint); |
| | | bulletTrans.anchoredPosition = localPoint; |
| | | } |
| | | } |
| | | |
| | | public virtual void Reset() |