Commit 57717828 authored by Aaron Lieberman's avatar Aaron Lieberman
Browse files

Tutorial at the beginning of the game!

parent 44425d3d
No related merge requests found
Pipeline #41923 passed with stages
in 8 seconds
Showing with 1912 additions and 312 deletions
+1912 -312
......@@ -75,6 +75,8 @@ MonoBehaviour:
interactionTags:
- Summon
damageCooldown: 0.75
knockBackDistance: 1
knockBackVelocity: 10
--- !u!1 &3949820747973446837
GameObject:
m_ObjectHideFlags: 0
......@@ -315,7 +317,7 @@ MonoBehaviour:
enemyScaleSize: 1
inverseScale: 1
altInverseScale: -1
agroDist: 50
agroDist: 30
wallCheck: {fileID: 3949820748384610944}
wallCheckRadius: 0
whatIsWall:
......
......@@ -75,6 +75,8 @@ MonoBehaviour:
interactionTags:
- Summon
damageCooldown: 0.75
knockBackDistance: 1
knockBackVelocity: 10
--- !u!1 &1204554881523425039
GameObject:
m_ObjectHideFlags: 0
......@@ -297,7 +299,7 @@ MonoBehaviour:
enemyScaleSize: 1
inverseScale: 1
altInverseScale: -1
agroDist: 50
agroDist: 30
wallCheck: {fileID: 6819825627125590913}
wallCheckRadius: 0
whatIsWall:
......
......@@ -75,6 +75,8 @@ MonoBehaviour:
interactionTags:
- Summon
damageCooldown: 0.75
knockBackDistance: 1
knockBackVelocity: 10
--- !u!1 &3509292894472850804
GameObject:
m_ObjectHideFlags: 0
......@@ -314,7 +316,7 @@ MonoBehaviour:
enemyScaleSize: 1
inverseScale: 1
altInverseScale: 1
agroDist: 50
agroDist: 30
wallCheck: {fileID: 4622421854011190431}
wallCheckRadius: 0
whatIsWall:
......
......@@ -75,6 +75,8 @@ MonoBehaviour:
interactionTags:
- Summon
damageCooldown: 0.75
knockBackDistance: 1
knockBackVelocity: 10
--- !u!1 &1739412811534334316
GameObject:
m_ObjectHideFlags: 0
......@@ -283,7 +285,7 @@ MonoBehaviour:
enemyScaleSize: 1
inverseScale: 1
altInverseScale: 1
agroDist: 50
agroDist: 30
wallCheck: {fileID: 5633458602499379525}
wallCheckRadius: 0
whatIsWall:
......
......@@ -28,7 +28,7 @@ Transform:
m_GameObject: {fileID: 5725812940166781539}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.5, y: 1.5, z: 0}
m_LocalScale: {x: 1, y: 0.95, z: 1}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 8804515848198323191}
......@@ -52,7 +52,7 @@ BoxCollider2D:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0.5, y: 0.5}
oldSize: {x: 1, y: 1}
newSize: {x: 1, y: 3}
newSize: {x: 1, y: 1}
adaptiveTilingThreshold: 0.5
drawMode: 2
adaptiveTiling: 0
......@@ -106,7 +106,7 @@ SpriteRenderer:
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 2
m_Size: {x: 1, y: 3}
m_Size: {x: 1, y: 1}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
......@@ -156,7 +156,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7917911137510183408}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.5, y: 0.498, z: 0}
m_LocalPosition: {x: 0.5, y: 0.5, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
......@@ -274,7 +274,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8859818087853129645}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.5, y: 2.494, z: 0}
m_LocalPosition: {x: 0.5, y: 2.5, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
......
......@@ -13,7 +13,7 @@ GameObject:
- component: {fileID: 5675037367491374654}
- component: {fileID: 7655715039495802005}
m_Layer: 12
m_Name: SummonBatSpawner_Triggerable Variant
m_Name: Summon_Bat_Spawner
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
......
......@@ -124,7 +124,7 @@ GameObject:
- component: {fileID: 3128326238812167601}
- component: {fileID: 3128326238812167606}
m_Layer: 12
m_Name: SummonTree_Triggerable
m_Name: Summon_Tree_Spawner
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
......
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &7187473901566601052
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7187473901566601053}
- component: {fileID: 7187473901566601055}
- component: {fileID: 7187473901566601054}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7187473901566601053
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7187473901566601052}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 6450964449957971853}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 1}
--- !u!222 &7187473901566601055
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7187473901566601052}
m_CullTransparentMesh: 1
--- !u!114 &7187473901566601054
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7187473901566601052}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: '[Text goes here]'
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 4a85636ba9aa01943a5a040b354b9abe, type: 2}
m_sharedMaterial: {fileID: -6075074542992275817, guid: 4a85636ba9aa01943a5a040b354b9abe, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 24
m_fontSizeBase: 24
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 2
m_VerticalAlignment: 256
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.195
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: -0.022621155, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &7187473902181648256
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6226662996107752414}
m_Layer: 5
m_Name: Tutorial Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &6226662996107752414
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7187473902181648256}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 6450964449957971853}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &8519264460090172406
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6450964449957971853}
- component: {fileID: 5328691874476564901}
- component: {fileID: 2862515642681762675}
- component: {fileID: 5052622693745697450}
m_Layer: 5
m_Name: Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6450964449957971853
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8519264460090172406}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.02, y: 0.02, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 7187473901566601053}
m_Father: {fileID: 6226662996107752414}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0.5, y: -3}
m_SizeDelta: {x: 300, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!223 &5328691874476564901
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8519264460090172406}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 2
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 1
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_AdditionalShaderChannelsFlag: 25
m_SortingLayerID: -304377885
m_SortingOrder: 0
m_TargetDisplay: 0
--- !u!114 &2862515642681762675
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8519264460090172406}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 0
m_ReferencePixelsPerUnit: 1
m_ScaleFactor: 1
m_ReferenceResolution: {x: 800, y: 600}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 0
m_PhysicalUnit: 3
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
m_PresetInfoIsWorld: 1
--- !u!114 &5052622693745697450
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8519264460090172406}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
fileFormatVersion: 2
guid: 5efbd051503279042bb690e0f4197234
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
......@@ -11,7 +11,7 @@ public class AI : MonoBehaviour
[SerializeField] private float altInverseScale = -1;
private Transform target;
[SerializeField] private float agroDist;
[SerializeField] private float agroDist = 30;
[SerializeField] private Transform wallCheck;
[SerializeField] private float wallCheckRadius;
......@@ -38,7 +38,7 @@ enum MovementState { Idle, Jumping, Falling, Move, Hurt }
Animator _animator;
EnemyDamageHandler _enemyDamageHandler;
SpriteRenderer _spriteRenderer;
Color _baseColor;
MovementState _state = MovementState.Idle;
......@@ -84,29 +84,36 @@ private void MoveEnemy()
_spriteRenderer.color = _baseColor;
if (moveType == MoveType.SEEK_FLY)
{
MoveSeekingFlyingEnemy();
}
else if (moveType == MoveType.SEEK_WALK)
{
MoveSeekingWalkingEnemy();
}
else if (moveType == MoveType.HOP)
if (target == null)
{
MoveHoppingEnemy();
}
else if (moveType == MoveType.PATROL_NONINTERVAL_WALK)
{
MovePatrolNonIntervalEnemy();
}
else if (moveType == MoveType.PATROL_INTERVAL_WALK)
{
MovePatrolIntervalEnemy();
AttemptFindAndAttachPlayerGameObject();
}
else if (moveType == MoveType.SEEK_EDGE_AWARE_WALK)
if (target == null) return;
var toTargetDist = Vector2.Distance(transform.position, target.position);
if (toTargetDist > agroDist) return;
switch (moveType)
{
MoveEdgeAwareSeekingWalkingEnemy();
case MoveType.SEEK_FLY:
MoveSeekingFlyingEnemy();
break;
case MoveType.SEEK_WALK:
MoveSeekingWalkingEnemy();
break;
case MoveType.HOP:
MoveHoppingEnemy();
break;
case MoveType.PATROL_NONINTERVAL_WALK:
MovePatrolNonIntervalEnemy();
break;
case MoveType.PATROL_INTERVAL_WALK:
MovePatrolIntervalEnemy();
break;
case MoveType.SEEK_EDGE_AWARE_WALK:
MoveEdgeAwareSeekingWalkingEnemy();
break;
}
}
......@@ -114,25 +121,24 @@ private void MoveSeekingFlyingEnemy()
{
if (target != null)
{
var toTargetDist = Vector2.Distance(transform.position, target.position);
if (toTargetDist > agroDist && moveRight)
if (moveRight)
{
transform.localScale = new Vector3(inverseScale * enemyScaleSize, enemyScaleSize, 1f);
transform.position = Vector2.MoveTowards(transform.position, new Vector2(transform.position.x + 1, transform.position.y), speed * Time.deltaTime);
}
else if (toTargetDist > agroDist && !moveRight)
else if (!moveRight)
{
transform.localScale = new Vector3(inverseScale * -enemyScaleSize, enemyScaleSize, 1f);
transform.position = Vector2.MoveTowards(transform.position, new Vector2(transform.position.x - 1, transform.position.y), speed * Time.deltaTime);
}
if (toTargetDist < agroDist && transform.position.x < target.position.x)
if (transform.position.x < target.position.x)
{
transform.localScale = new Vector3(inverseScale * enemyScaleSize, enemyScaleSize, 1f);
transform.position = Vector2.MoveTowards(transform.position, target.position, speed * Time.deltaTime);
moveRight = true;
}
else if (toTargetDist < agroDist && transform.position.x > target.position.x)
else if (transform.position.x > target.position.x)
{
transform.localScale = new Vector3(inverseScale * -enemyScaleSize, enemyScaleSize, 1f);
transform.position = Vector2.MoveTowards(transform.position, target.position, speed * Time.deltaTime);
......@@ -153,25 +159,24 @@ private void MoveSeekingWalkingEnemy()
if (target != null)
{
var toTargetDist = Vector2.Distance(transform.position, target.position);
if (toTargetDist > agroDist && moveRight)
if (moveRight)
{
transform.localScale = new Vector3(inverseScale * enemyScaleSize, enemyScaleSize, 1f);
GetComponent<Rigidbody2D>().velocity = new Vector2(speed, GetComponent<Rigidbody2D>().velocity.y);
}
else if (toTargetDist > agroDist && !moveRight)
else if (!moveRight)
{
transform.localScale = new Vector3(inverseScale * -enemyScaleSize, enemyScaleSize, 1f);
GetComponent<Rigidbody2D>().velocity = new Vector2(-speed, GetComponent<Rigidbody2D>().velocity.y);
}
if (toTargetDist < agroDist && transform.position.x < target.position.x)
if (transform.position.x < target.position.x)
{
transform.localScale = new Vector3(inverseScale * enemyScaleSize, enemyScaleSize, 1f);
GetComponent<Rigidbody2D>().velocity = new Vector2(speed, GetComponent<Rigidbody2D>().velocity.y);
moveRight = true;
}
else if (toTargetDist < agroDist && transform.position.x > target.position.x)
else if (transform.position.x > target.position.x)
{
transform.localScale = new Vector3(inverseScale * -enemyScaleSize, enemyScaleSize, 1f);
GetComponent<Rigidbody2D>().velocity = new Vector2(-speed, GetComponent<Rigidbody2D>().velocity.y);
......@@ -191,26 +196,24 @@ private void MoveHoppingEnemy()
{
if (Mathf.Abs(GetComponent<Rigidbody2D>().velocity.y) > 0.1f)
{
var toTargetDist = Vector2.Distance(transform.position, target.position);
if (toTargetDist > agroDist && moveRight)
if (moveRight)
{
transform.localScale = new Vector3(inverseScale * enemyScaleSize, enemyScaleSize, 1f);
GetComponent<Rigidbody2D>().velocity = new Vector2(speed, GetComponent<Rigidbody2D>().velocity.y);
}
else if (toTargetDist > agroDist && !moveRight)
else if (!moveRight)
{
transform.localScale = new Vector3(inverseScale * -enemyScaleSize, enemyScaleSize, 1f);
GetComponent<Rigidbody2D>().velocity = new Vector2(-speed, GetComponent<Rigidbody2D>().velocity.y);
}
if (toTargetDist < agroDist && transform.position.x < target.position.x)
if (transform.position.x < target.position.x)
{
transform.localScale = new Vector3(inverseScale * enemyScaleSize, enemyScaleSize, 1f);
GetComponent<Rigidbody2D>().velocity = new Vector2(speed, GetComponent<Rigidbody2D>().velocity.y);
moveRight = true;
}
else if (toTargetDist < agroDist && transform.position.x > target.position.x)
else if (transform.position.x > target.position.x)
{
transform.localScale = new Vector3(inverseScale * -enemyScaleSize, enemyScaleSize, 1f);
GetComponent<Rigidbody2D>().velocity = new Vector2(-speed, GetComponent<Rigidbody2D>().velocity.y);
......@@ -229,25 +232,23 @@ private void MoveEdgeAwareSeekingWalkingEnemy()
{
if (target != null)
{
var toTargetDist = Vector2.Distance(transform.position, target.position);
if (toTargetDist > agroDist && moveRight)
if (moveRight)
{
transform.localScale = new Vector3(inverseScale * enemyScaleSize, enemyScaleSize, 1f);
GetComponent<Rigidbody2D>().velocity = new Vector2(speed, GetComponent<Rigidbody2D>().velocity.y);
}
else if (toTargetDist > agroDist && !moveRight)
else if (!moveRight)
{
transform.localScale = new Vector3(inverseScale * -enemyScaleSize, enemyScaleSize, 1f);
GetComponent<Rigidbody2D>().velocity = new Vector2(-speed, GetComponent<Rigidbody2D>().velocity.y);
}
if (toTargetDist < agroDist && transform.position.x < target.position.x)
if (transform.position.x < target.position.x)
{
transform.localScale = new Vector3(inverseScale * enemyScaleSize, enemyScaleSize, 1f);
GetComponent<Rigidbody2D>().velocity = new Vector2(speed, GetComponent<Rigidbody2D>().velocity.y);
moveRight = true;
}
else if (toTargetDist < agroDist && transform.position.x > target.position.x)
else if (transform.position.x > target.position.x)
{
transform.localScale = new Vector3(inverseScale * -enemyScaleSize, enemyScaleSize, 1f);
GetComponent<Rigidbody2D>().velocity = new Vector2(-speed, GetComponent<Rigidbody2D>().velocity.y);
......@@ -303,7 +304,7 @@ private void AttemptFindAndAttachPlayerGameObject()
{
GameObject[] targetObjects = GameObject.FindGameObjectsWithTag(targetTag);
Transform closestTarget = null;
foreach(GameObject targetObject in targetObjects)
foreach (GameObject targetObject in targetObjects)
{
if (closestTarget == null)
closestTarget = targetObject.transform;
......@@ -312,7 +313,7 @@ private void AttemptFindAndAttachPlayerGameObject()
}
target = closestTarget;
}
}
private void ForceEnemyRotate()
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class WorldSpacePositioner : MonoBehaviour
{
[SerializeField] GameObject Target;
void Update()
{
//var targetPos = Camera.main.WorldToScreenPoint(Target.transform.position);
//transform.position = targetPos;
transform.position = Target.transform.position;
}
}
fileFormatVersion: 2
guid: 8809b80fb91b2134d8d8d422d1efdd52
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -36,7 +36,7 @@ TextureImporter:
filterMode: 0
aniso: 1
mipBias: 0
wrapU: 1
wrapU: 0
wrapV: 1
wrapW: 1
nPOTScale: 0
......@@ -44,7 +44,7 @@ TextureImporter:
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
spriteMeshType: 0
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 16
......
......@@ -36,7 +36,7 @@ TextureImporter:
filterMode: 0
aniso: 1
mipBias: 0
wrapU: 1
wrapU: 0
wrapV: 1
wrapW: 1
nPOTScale: 0
......@@ -44,7 +44,7 @@ TextureImporter:
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
spriteMeshType: 0
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 16
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Menu