...
 
Commits (2)
......@@ -37,6 +37,7 @@ Transform:
m_LocalScale: {x: 2.6, y: 2.6, z: 2.6}
m_Children:
- {fileID: 1344694553418298308}
- {fileID: 8396877311374348593}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
......@@ -156,7 +157,7 @@ MonoBehaviour:
patrolRange: 5
targetPos: {fileID: 1344694553418298308}
moveTime: 2
chillTime: 0.5
speed: 0
--- !u!114 &879798643589630551
MonoBehaviour:
m_ObjectHideFlags: 0
......@@ -261,3 +262,33 @@ Transform:
m_Father: {fileID: 4738352637052488}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &6125012515752616465
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8396877311374348593}
m_Layer: 14
m_Name: Shotspawn
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8396877311374348593
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6125012515752616465}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.562, y: -0.026, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4738352637052488}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
......@@ -32640,12 +32640,12 @@ PrefabInstance:
- target: {fileID: 52145075018362285, guid: 2e3528907311e438dab0d393127aa332,
type: 3}
propertyPath: m_LocalPosition.x
value: 31.43
value: -117.4
objectReference: {fileID: 0}
- target: {fileID: 52145075018362285, guid: 2e3528907311e438dab0d393127aa332,
type: 3}
propertyPath: m_LocalPosition.y
value: 17.98
value: 89.2
objectReference: {fileID: 0}
- target: {fileID: 52145075018362285, guid: 2e3528907311e438dab0d393127aa332,
type: 3}
......@@ -10,6 +10,7 @@ public class AI_WindAttack : WeightedAction
private float restCooldown;
private Rigidbody2D body;
public Transform shotSpawn;
public GameObject windAttack;
public float Cooldown;
public float attackRange;
......@@ -55,11 +56,10 @@ public class AI_WindAttack : WeightedAction
public void Fire(Vector3 attackdir)
{
GameObject projectile = Instantiate(windAttack, transform.position + attackdir*2, Quaternion.AngleAxis(0, Vector3.forward));
GameObject projectile = Instantiate(windAttack, shotSpawn.position, shotSpawn.rotation);
projectile.GetComponent<AI_WindProjectile>().setValues(damage, destroyTime, thrust);
body = projectile.GetComponent<Rigidbody2D>();
Vector3 rotatedVector = Quaternion.AngleAxis(0, Vector3.forward) * attackdir;
body.velocity = new Vector2(rotatedVector.x * firePower, rotatedVector.y * firePower);
body.velocity = attackdir*firePower;
}
}