1
Fork 0

Git merge something

This commit is contained in:
Steffo 2019-04-28 00:29:23 +02:00
parent 3e0fe60e7a
commit c422045fcf
3 changed files with 20 additions and 3 deletions

View file

@ -42,7 +42,7 @@ Camera:
m_Enabled: 1 m_Enabled: 1
serializedVersion: 2 serializedVersion: 2
m_ClearFlags: 1 m_ClearFlags: 1
m_BackGroundColor: {r: 1, g: 1, b: 1, a: 0} m_BackGroundColor: {r: 0, g: 0, b: 0, a: 0}
m_projectionMatrixMode: 1 m_projectionMatrixMode: 1
m_GateFitMode: 2 m_GateFitMode: 2
m_FOVAxisMode: 0 m_FOVAxisMode: 0
@ -59,7 +59,7 @@ Camera:
far clip plane: 1000 far clip plane: 1000
field of view: 60 field of view: 60
orthographic: 1 orthographic: 1
orthographic size: 5 orthographic size: 7
m_Depth: -1 m_Depth: -1
m_CullingMask: m_CullingMask:
serializedVersion: 2 serializedVersion: 2

View file

@ -46,8 +46,13 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
hpMax: 0 hpMax: 0
hp: 0 hp: 0
<<<<<<< Updated upstream
sprite: {fileID: 21300000, guid: ee7ef72c830dc204c9df0595e161f049, type: 3} sprite: {fileID: 21300000, guid: ee7ef72c830dc204c9df0595e161f049, type: 3}
visionRange: 4 visionRange: 4
=======
sprite: {fileID: 21300000, guid: 0121970e693ee0a4d987bd5fe694ad67, type: 3}
visionRange: 2.5
>>>>>>> Stashed changes
--- !u!212 &1351652798109185028 --- !u!212 &1351652798109185028
SpriteRenderer: SpriteRenderer:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View file

@ -14,7 +14,19 @@ public class AISlime : AI
public override void OnTurn(){ public override void OnTurn(){
if (CanSeePlayer()){ if (CanSeePlayer()){
//TODO Vector2Int distance = player.MapPosition - MapPosition;
if (distance.x < 0 && map.CanMoveTo(MapPosition + Vector2Int.left)){
transform.Translate(Vector3.left);
}
else if (distance.x > 0 && map.CanMoveTo(MapPosition + Vector2Int.right)){
transform.Translate(Vector3.right);
}
else if (distance.y > 0 && map.CanMoveTo(MapPosition + Vector2Int.up)){
transform.Translate(Vector3.up);
}
else if (distance.y < 0 && map.CanMoveTo(MapPosition + Vector2Int.down)){
transform.Translate(Vector3.down);
}
} }
else { else {
int direction = Random.Range(0, 4); int direction = Random.Range(0, 4);