void CreateAttackBeam() { var attackBeam = new WolfAttackBeam(this, attackBeamAngle); float beamDist = 10; float rads = -attackBeamAngle * RXMath.DTOR + Mathf.PI; Vector2 offset = new Vector2(Mathf.Cos(rads), Mathf.Sin(rads)) * beamDist; attackBeam.x = x + offset.x; attackBeam.y = y + 15 + offset.y; attackBeam.AddToArea(); attackBeam.Update(); }
void CreateAttackBeam() { var attackBeam = new WolfAttackBeam(this,attackBeamAngle); float beamDist = 10; float rads = -attackBeamAngle * RXMath.DTOR + Mathf.PI; Vector2 offset = new Vector2(Mathf.Cos(rads),Mathf.Sin(rads))*beamDist; attackBeam.x = x+offset.x; attackBeam.y = y+15+offset.y; attackBeam.AddToArea(); attackBeam.Update(); }