Fix mobcat bullets

This commit is contained in:
Jens Pitkänen 2019-08-19 00:26:42 +03:00
parent dd385f4898
commit c27c634faa
5 changed files with 6 additions and 9 deletions

View File

@ -9520,7 +9520,7 @@ GameObject:
- component: {fileID: 4482402865533696887}
- component: {fileID: 3311105517541852250}
m_Layer: 9
m_Name: EnemyBullet
m_Name: MobcatBullet
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@ -9611,7 +9611,7 @@ MonoBehaviour:
Sprite: {fileID: 5552990435088311320}
Trail: {fileID: 4595570391660610945}
Explosion: {fileID: 6411602551704027216}
Damage: 12
Damage: 3.4
--- !u!1 &5552990435088311320
GameObject:
m_ObjectHideFlags: 0

View File

@ -38,10 +38,10 @@ namespace Saltosion.OneWeapon.AI.Behaviours {
}
private void Shoot() {
Vector2 Direction = Follow.TargetDirection;
Vector2 Direction = Follow.TargetDirection.normalized;
GameObject ShotBulletObj = Instantiate(BulletPrefab, transform.position + (Vector3)Direction, new Quaternion());
Bullet ShotBullet = ShotBulletObj.GetComponent<Bullet>();
ShotBullet.Direction = Direction.normalized;
ShotBullet.Direction = Direction;
ShotBullet.InitialRotation = Mathf.Atan2(Direction.y, Direction.x);
}

View File

@ -1,14 +1,11 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine;
using Saltosion.OneWeapon.Player;
using Saltosion.OneWeapon.Enemies;
using Saltosion.OneWeapon.Effects;
using Saltosion.OneWeapon.Environment;
namespace Saltosion.OneWeapon.Guns {
[RequireComponent(typeof(Bullet))]
public class EnemyBullet : MonoBehaviour {
public class MobcatBullet : MonoBehaviour {
public Rigidbody2D Body;
public GameObject Sprite;