Commit 2e7f158e authored by Andrew's avatar Andrew

Further comments in EnemyRanged.cs

parent 09d87083
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &7178697834341496283
--- !u!1 &546435855955265263
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
......@@ -8,26 +8,26 @@ GameObject:
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 9022672397112247442}
- component: {fileID: 7178697834341496286}
- component: {fileID: 7178697834341496281}
- component: {fileID: 2334164951446619000}
- component: {fileID: 5628614846504043946}
- component: {fileID: 7178697834341496280}
- component: {fileID: 1818459865233979302}
- component: {fileID: 546435855955265258}
- component: {fileID: 546435855955265261}
- component: {fileID: 4930897923621711948}
- component: {fileID: 3032704036229314206}
- component: {fileID: 546435855955265260}
m_Layer: 0
m_Name: EnemyRanged
m_Name: EnemyRanged 1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &9022672397112247442
--- !u!4 &1818459865233979302
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7178697834341496283}
m_GameObject: {fileID: 546435855955265263}
m_LocalRotation: {x: -0, y: -0.99144495, z: -0, w: -0.13052589}
m_LocalPosition: {x: -0.7, y: 1.78, z: 12.04}
m_LocalScale: {x: 4, y: 4, z: 1}
......@@ -35,13 +35,13 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: -194.99998, z: 0}
--- !u!212 &7178697834341496286
--- !u!212 &546435855955265258
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7178697834341496283}
m_GameObject: {fileID: 546435855955265263}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
......@@ -72,7 +72,7 @@ SpriteRenderer:
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 86a0f7fb420c183488725dc158dac91e, type: 3}
m_Sprite: {fileID: 21300000, guid: f1412927548e0e7498fa8f74fd63963f, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 1
m_FlipY: 0
......@@ -83,13 +83,13 @@ SpriteRenderer:
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!136 &7178697834341496281
--- !u!136 &546435855955265261
CapsuleCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7178697834341496283}
m_GameObject: {fileID: 546435855955265263}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
......@@ -97,29 +97,29 @@ CapsuleCollider:
m_Height: 0.6327838
m_Direction: 1
m_Center: {x: 0.04588693, y: 0, z: -2.6832936e-10}
--- !u!114 &2334164951446619000
--- !u!114 &4930897923621711948
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7178697834341496283}
m_GameObject: {fileID: 546435855955265263}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a7bdc197271574d459491b39874dc4ec, type: 3}
m_Name:
m_EditorClassIdentifier:
health: 50
--- !u!114 &5628614846504043946
--- !u!114 &3032704036229314206
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7178697834341496283}
m_GameObject: {fileID: 546435855955265263}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 71554234a0af918479894b59b39ce876, type: 3}
m_Script: {fileID: 11500000, guid: 3edb577f02b72d2468f5f4de4f1e46e6, type: 3}
m_Name:
m_EditorClassIdentifier:
health: 50
......@@ -136,13 +136,13 @@ MonoBehaviour:
player: {fileID: 0}
playerPosition: {x: 0, y: 0, z: 0}
thisTransform: {fileID: 0}
--- !u!54 &7178697834341496280
--- !u!54 &546435855955265260
Rigidbody:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7178697834341496283}
m_GameObject: {fileID: 546435855955265263}
serializedVersion: 2
m_Mass: 100
m_Drag: 0
......
fileFormatVersion: 2
guid: ed067dec83bce034eaf619e8635ed09d
guid: 5a907769260b22e499f65391b4d07926
PrefabImporter:
externalObjects: {}
userData:
......
......@@ -6067,155 +6067,72 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &2334164952670000728
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7178697832849809659}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a7bdc197271574d459491b39874dc4ec, type: 3}
m_Name:
m_EditorClassIdentifier:
health: 50
--- !u!114 &5628614847428448394
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7178697832849809659}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3edb577f02b72d2468f5f4de4f1e46e6, type: 3}
m_Name:
m_EditorClassIdentifier:
health: 50
attackRange: 0
bulletPrefab: {fileID: 0}
bulletSpawnPoint: {x: 0, y: 0, z: 0}
bulletDamage: 0
moveSpeed: 0
moveDecisionThreshold: 0
teleportDecisionThreshold: 0
ammoPrefab: {fileID: 0}
insanityRefillAmount: 0
chanceToDropAmmo: 0
player: {fileID: 0}
playerPosition: {x: 0, y: 0, z: 0}
thisTransform: {fileID: 0}
--- !u!54 &7178697832849809656
Rigidbody:
--- !u!1001 &7208731525626537492
PrefabInstance:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7178697832849809659}
serializedVersion: 2
m_Mass: 100
m_Drag: 0
m_AngularDrag: 0
m_UseGravity: 0
m_IsKinematic: 1
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!136 &7178697832849809657
CapsuleCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7178697832849809659}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
m_Radius: 0.18816422
m_Height: 0.6327838
m_Direction: 1
m_Center: {x: 0.04588693, y: 0, z: -2.6832936e-10}
--- !u!1 &7178697832849809659
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 9022672398070206898}
- component: {fileID: 7178697832849809662}
- component: {fileID: 7178697832849809657}
- component: {fileID: 2334164952670000728}
- component: {fileID: 5628614847428448394}
- component: {fileID: 7178697832849809656}
m_Layer: 0
m_Name: EnemyRanged
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!212 &7178697832849809662
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7178697832849809659}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: f1412927548e0e7498fa8f74fd63963f, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 1
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 0.64, y: 0.64}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!4 &9022672398070206898
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7178697832849809659}
m_LocalRotation: {x: -0, y: -0.99144495, z: -0, w: -0.13052589}
m_LocalPosition: {x: -0.7, y: 1.78, z: 12.04}
m_LocalScale: {x: 4, y: 4, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 11
m_LocalEulerAnglesHint: {x: 0, y: -194.99998, z: 0}
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 546435855955265263, guid: 5a907769260b22e499f65391b4d07926,
type: 3}
propertyPath: m_Name
value: EnemyRanged
objectReference: {fileID: 0}
- target: {fileID: 1818459865233979302, guid: 5a907769260b22e499f65391b4d07926,
type: 3}
propertyPath: m_LocalPosition.x
value: -0.7
objectReference: {fileID: 0}
- target: {fileID: 1818459865233979302, guid: 5a907769260b22e499f65391b4d07926,
type: 3}
propertyPath: m_LocalPosition.y
value: 1.78
objectReference: {fileID: 0}
- target: {fileID: 1818459865233979302, guid: 5a907769260b22e499f65391b4d07926,
type: 3}
propertyPath: m_LocalPosition.z
value: 12.04
objectReference: {fileID: 0}
- target: {fileID: 1818459865233979302, guid: 5a907769260b22e499f65391b4d07926,
type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1818459865233979302, guid: 5a907769260b22e499f65391b4d07926,
type: 3}
propertyPath: m_LocalRotation.y
value: -0.99144495
objectReference: {fileID: 0}
- target: {fileID: 1818459865233979302, guid: 5a907769260b22e499f65391b4d07926,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1818459865233979302, guid: 5a907769260b22e499f65391b4d07926,
type: 3}
propertyPath: m_LocalRotation.w
value: -0.13052589
objectReference: {fileID: 0}
- target: {fileID: 1818459865233979302, guid: 5a907769260b22e499f65391b4d07926,
type: 3}
propertyPath: m_RootOrder
value: 11
objectReference: {fileID: 0}
- target: {fileID: 1818459865233979302, guid: 5a907769260b22e499f65391b4d07926,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1818459865233979302, guid: 5a907769260b22e499f65391b4d07926,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: -194.99998
objectReference: {fileID: 0}
- target: {fileID: 1818459865233979302, guid: 5a907769260b22e499f65391b4d07926,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 5a907769260b22e499f65391b4d07926, type: 3}
......@@ -61,7 +61,7 @@ public class EnemyRanged : MonoBehaviour
thisTransform.LookAt(targetPos); // Lock rotation of Y and X axis in Inspector to limit rotation to only left/right.
}
//These regions can be expanded, they hold sections of code to make everything look neater.
#region Movement
void DecideToMove()
......@@ -75,11 +75,13 @@ public class EnemyRanged : MonoBehaviour
// Call this function if EnemyRanged has decided to move towards the Player.
// Various ways to do this, such as "Vector3.MoveTowards" or "Vector3.Lerp"
Debug.Log(this.name + " is moving!");
}
void Teleport()
{
// Call this function if Player is over "teleportDecisionThreshold" distance away from EnemyRanged.
Debug.Log(this.name + " teleported!");
}
#endregion
......@@ -90,6 +92,7 @@ public class EnemyRanged : MonoBehaviour
// Call this function right before firing to return a direction that the Enemy will shoot towards.
// If we let the Aim() change as "playerPosition" changes, the bullets will hone in on Player. We want to grab "playerPosition" at one specific point in time.
Debug.Log(this.name + " is aiming!");
}
void ShootBullet()
{
......@@ -97,6 +100,7 @@ public class EnemyRanged : MonoBehaviour
// instantiate "bulletPrefab" at a specific position "bulletSpawnPoint", fire it in the direction specified by Aim(), and give it X amount of "bulletDamage"
// We also want a system to prevent shooting for a small amount of time after the last shot. You can keep track of time passing with "Time.deltaTime"
Debug.Log(this.name + " is firing!");
}
#endregion
......@@ -113,7 +117,7 @@ public class EnemyRanged : MonoBehaviour
//player.insanity += insanityRefill; //we don't have a specific name for the Player's insanity variable yet, "player.insanity" is filler. Once we do, add "insanityRefill" to it.
Debug.Log(this.name + " died!");
}
#endregion
......
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