Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -0,0 +1,397 @@
; FBX 6.1.0 project file
; Created by Blender FBX Exporter
; for support mail: ideasman42@gmail.com
; ----------------------------------------------------

FBXHeaderExtension: {
FBXHeaderVersion: 1003
FBXVersion: 6100
CreationTimeStamp: {
Version: 1000
Year: 2013
Month: 12
Day: 05
Hour: 16
Minute: 15
Second: 51
Millisecond: 0
}
Creator: "FBX SDK/FBX Plugins build 20070228"
OtherFlags: {
FlagPLE: 0
}
}
CreationTime: "2013-12-05 16:15:51:000"
Creator: "Blender version 2.69 (sub 0)"

; Object definitions
;------------------------------------------------------------------

Definitions: {
Version: 100
Count: 5
ObjectType: "Model" {
Count: 1
}
ObjectType: "Geometry" {
Count: 1
}
ObjectType: "Material" {
Count: 1
}
ObjectType: "Texture" {
Count: 1
}
ObjectType: "Video" {
Count: 1
}
ObjectType: "Pose" {
Count: 1
}
ObjectType: "GlobalSettings" {
Count: 1
}
}

; Object properties
;------------------------------------------------------------------

Objects: {
Model: "Model::FileCabinet", "Mesh" {
Version: 232
Properties60: {
Property: "QuaternionInterpolate", "bool", "",0
Property: "Visibility", "Visibility", "A+",1
Property: "Lcl Translation", "Lcl Translation", "A+",0.000000000000000,0.000000000000000,0.000000000000000
Property: "Lcl Rotation", "Lcl Rotation", "A+",-90.000009334538021,0.000000000000000,0.000000000000000
Property: "Lcl Scaling", "Lcl Scaling", "A+",1.000000000000000,1.000000000000000,1.000000000000000
Property: "RotationOffset", "Vector3D", "",0,0,0
Property: "RotationPivot", "Vector3D", "",0,0,0
Property: "ScalingOffset", "Vector3D", "",0,0,0
Property: "ScalingPivot", "Vector3D", "",0,0,0
Property: "TranslationActive", "bool", "",0
Property: "TranslationMin", "Vector3D", "",0,0,0
Property: "TranslationMax", "Vector3D", "",0,0,0
Property: "TranslationMinX", "bool", "",0
Property: "TranslationMinY", "bool", "",0
Property: "TranslationMinZ", "bool", "",0
Property: "TranslationMaxX", "bool", "",0
Property: "TranslationMaxY", "bool", "",0
Property: "TranslationMaxZ", "bool", "",0
Property: "RotationOrder", "enum", "",0
Property: "RotationSpaceForLimitOnly", "bool", "",0
Property: "AxisLen", "double", "",10
Property: "PreRotation", "Vector3D", "",0,0,0
Property: "PostRotation", "Vector3D", "",0,0,0
Property: "RotationActive", "bool", "",0
Property: "RotationMin", "Vector3D", "",0,0,0
Property: "RotationMax", "Vector3D", "",0,0,0
Property: "RotationMinX", "bool", "",0
Property: "RotationMinY", "bool", "",0
Property: "RotationMinZ", "bool", "",0
Property: "RotationMaxX", "bool", "",0
Property: "RotationMaxY", "bool", "",0
Property: "RotationMaxZ", "bool", "",0
Property: "RotationStiffnessX", "double", "",0
Property: "RotationStiffnessY", "double", "",0
Property: "RotationStiffnessZ", "double", "",0
Property: "MinDampRangeX", "double", "",0
Property: "MinDampRangeY", "double", "",0
Property: "MinDampRangeZ", "double", "",0
Property: "MaxDampRangeX", "double", "",0
Property: "MaxDampRangeY", "double", "",0
Property: "MaxDampRangeZ", "double", "",0
Property: "MinDampStrengthX", "double", "",0
Property: "MinDampStrengthY", "double", "",0
Property: "MinDampStrengthZ", "double", "",0
Property: "MaxDampStrengthX", "double", "",0
Property: "MaxDampStrengthY", "double", "",0
Property: "MaxDampStrengthZ", "double", "",0
Property: "PreferedAngleX", "double", "",0
Property: "PreferedAngleY", "double", "",0
Property: "PreferedAngleZ", "double", "",0
Property: "InheritType", "enum", "",0
Property: "ScalingActive", "bool", "",0
Property: "ScalingMin", "Vector3D", "",1,1,1
Property: "ScalingMax", "Vector3D", "",1,1,1
Property: "ScalingMinX", "bool", "",0
Property: "ScalingMinY", "bool", "",0
Property: "ScalingMinZ", "bool", "",0
Property: "ScalingMaxX", "bool", "",0
Property: "ScalingMaxY", "bool", "",0
Property: "ScalingMaxZ", "bool", "",0
Property: "GeometricTranslation", "Vector3D", "",0,0,0
Property: "GeometricRotation", "Vector3D", "",0,0,0
Property: "GeometricScaling", "Vector3D", "",1,1,1
Property: "LookAtProperty", "object", ""
Property: "UpVectorProperty", "object", ""
Property: "Show", "bool", "",1
Property: "NegativePercentShapeSupport", "bool", "",1
Property: "DefaultAttributeIndex", "int", "",0
Property: "Color", "Color", "A",0.8,0.8,0.8
Property: "Size", "double", "",100
Property: "Look", "enum", "",1
}
MultiLayer: 0
MultiTake: 1
Shading: Y
Culling: "CullingOff"
Vertices: -0.640872,-0.330000,0.000000,-0.640872,0.330000,0.000000,0.605915,0.330000,0.000000,0.605915,-0.330000,0.000000,
-0.698704,-0.363787,1.721435,-0.669296,-0.350069,1.760000,-0.698704,0.365078,1.721457,-0.669296,0.351388,1.760000,
0.697941,0.365078,1.721487,0.669296,0.351388,1.760000,0.697941,-0.363787,1.721453,0.669296,-0.350069,1.760000
PolygonVertexIndex: 11,9,7,-6,8,10,3,-3,4,6,1,-1,6,8,2,-2,5,7,6,-5,7,9,8,-7,9,11,10,-9,11,5,4,-11,
10,4,0,-4
GeometryVersion: 124
LayerElementNormal: 0 {
Version: 101
Name: ""
MappingInformationType: "ByPolygonVertex"
ReferenceInformationType: "Direct"
Normals: 0.000000,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000,0.000000,1.000000,
0.998574,0.000001,-0.053382,0.998574,0.000001,-0.053382,0.998574,0.000001,-0.053382,0.998574,0.000001,-0.053382,
-0.999436,0.000000,-0.033576,-0.999436,0.000000,-0.033576,-0.999436,0.000000,-0.033576,-0.999436,0.000000,-0.033576,
0.000000,0.999792,-0.020372,0.000000,0.999792,-0.020372,0.000000,0.999792,-0.020372,0.000000,0.999792,-0.020372,
-0.795090,-0.000009,0.606492,-0.795090,-0.000009,0.606492,-0.795090,-0.000009,0.606492,-0.795090,-0.000009,0.606492,
-0.000004,0.942286,0.334809,-0.000004,0.942286,0.334809,-0.000004,0.942286,0.334809,-0.000004,0.942286,0.334809,
0.802511,-0.000014,0.596638,0.802511,-0.000014,0.596638,0.802511,-0.000014,0.596638,0.802511,-0.000014,0.596638,
-0.000002,-0.942142,0.335215,-0.000002,-0.942142,0.335215,-0.000002,-0.942142,0.335215,-0.000002,-0.942142,0.335215,
0.000000,-0.999807,-0.019623,0.000000,-0.999807,-0.019623,0.000000,-0.999807,-0.019623,0.000000,-0.999807,-0.019623
}
LayerElementSmoothing: 0 {
Version: 102
Name: ""
MappingInformationType: "ByPolygon"
ReferenceInformationType: "Direct"
Smoothing: 0,0,0,0,0,0,0,0,0
}
LayerElementUV: 0 {
Version: 101
Name: "UVMap"
MappingInformationType: "ByPolygonVertex"
ReferenceInformationType: "IndexToDirect"
UV: 0.472388,0.457178,0.470651,0.508903,0.420673,0.506723,0.461747,0.507952,0.462329,0.507135,0.439451,0.477932,
0.438438,0.426188,0.460887,0.485651,0.465772,0.478643,0.420673,0.485650,0.462330,0.485239,0.419790,0.507952,
0.444888,0.426854,0.419217,0.507134,0.443875,0.478643,0.509843,0.457176,0.464715,0.426853,0.512609,0.508903,
0.419790,0.484420,0.509843,0.457178,0.460887,0.506724,0.418610,0.426188,0.472387,0.457177,0.461748,0.484422,
0.419217,0.485238,0.417555,0.477932
UVIndex: 7,20,2,9,8,14,12,16,5,25,21,6,1,17,15,22,9,2,13,24,2,20,3,11,20,7,10,4,7,9,18,23,17,1,0,19
}
LayerElementTexture: 0 {
Version: 101
Name: "UVMap"
MappingInformationType: "AllSame"
ReferenceInformationType: "IndexToDirect"
BlendMode: "Translucent"
TextureAlpha: 1
TextureId: 0
}
LayerElementMaterial: 0 {
Version: 101
Name: ""
MappingInformationType: "AllSame"
ReferenceInformationType: "IndexToDirect"
Materials: 0
}
Layer: 0 {
Version: 100
LayerElement: {
Type: "LayerElementNormal"
TypedIndex: 0
}
LayerElement: {
Type: "LayerElementSmoothing"
TypedIndex: 0
}
LayerElement: {
Type: "LayerElementUV"
TypedIndex: 0
}
LayerElement: {
Type: "LayerElementTexture"
TypedIndex: 0
}
LayerElement: {
Type: "LayerElementMaterial"
TypedIndex: 0
}
}
}
Material: "Material::Material__mainTexture_png", "" {
Version: 102
ShadingModel: "lambert"
MultiLayer: 0
Properties60: {
Property: "ShadingModel", "KString", "", "Lambert"
Property: "MultiLayer", "bool", "",0
Property: "EmissiveColor", "ColorRGB", "",0.8000,0.8000,0.8000
Property: "EmissiveFactor", "double", "",0.0000
Property: "AmbientColor", "ColorRGB", "",1.0000,1.0000,1.0000
Property: "AmbientFactor", "double", "",1.0000
Property: "DiffuseColor", "ColorRGB", "",0.8000,0.8000,0.8000
Property: "DiffuseFactor", "double", "",0.8000
Property: "Bump", "Vector3D", "",0,0,0
Property: "TransparentColor", "ColorRGB", "",1,1,1
Property: "TransparencyFactor", "double", "",0.0000
Property: "SpecularColor", "ColorRGB", "",1.0000,1.0000,1.0000
Property: "SpecularFactor", "double", "",0.5000
Property: "ShininessExponent", "double", "",12.3
Property: "ReflectionColor", "ColorRGB", "",0,0,0
Property: "ReflectionFactor", "double", "",1
Property: "Emissive", "ColorRGB", "",0,0,0
Property: "Ambient", "ColorRGB", "",1.0,1.0,1.0
Property: "Diffuse", "ColorRGB", "",0.8,0.8,0.8
Property: "Specular", "ColorRGB", "",1.0,1.0,1.0
Property: "Shininess", "double", "",12.3
Property: "Opacity", "double", "",1.0
Property: "Reflectivity", "double", "",0
}
}
Video: "Video::mainTexture_png", "Clip" {
Type: "Clip"
Properties60: {
Property: "FrameRate", "double", "",0
Property: "LastFrame", "int", "",0
Property: "Width", "int", "",0
Property: "Height", "int", "",0
Property: "Path", "charptr", "", "mainTexture.png"
Property: "StartFrame", "int", "",0
Property: "StopFrame", "int", "",0
Property: "PlaySpeed", "double", "",1
Property: "Offset", "KTime", "",0
Property: "InterlaceMode", "enum", "",0
Property: "FreeRunning", "bool", "",0
Property: "Loop", "bool", "",0
Property: "AccessMode", "enum", "",0
}
UseMipMap: 0
Filename: "mainTexture.png"
RelativeFilename: "E:\user_data\user_documents\documents\my_games\apress_firstperson_game\gimp\mainTexture.png"
}
Texture: "Texture::mainTexture_png", "TextureVideoClip" {
Type: "TextureVideoClip"
Version: 202
TextureName: "Texture::mainTexture_png"
Properties60: {
Property: "Translation", "Vector", "A+",0,0,0
Property: "Rotation", "Vector", "A+",0,0,0
Property: "Scaling", "Vector", "A+",1,1,1
Property: "Texture alpha", "Number", "A+",0
Property: "TextureTypeUse", "enum", "",0
Property: "CurrentTextureBlendMode", "enum", "",1
Property: "UseMaterial", "bool", "",0
Property: "UseMipMap", "bool", "",0
Property: "CurrentMappingType", "enum", "",0
Property: "UVSwap", "bool", "",0
Property: "WrapModeU", "enum", "",0
Property: "WrapModeV", "enum", "",0
Property: "TextureRotationPivot", "Vector3D", "",0,0,0
Property: "TextureScalingPivot", "Vector3D", "",0,0,0
Property: "VideoProperty", "object", ""
}
Media: "Video::mainTexture_png"
FileName: "mainTexture.png"
RelativeFilename: "E:\user_data\user_documents\documents\my_games\apress_firstperson_game\gimp\mainTexture.png"
ModelUVTranslation: 0,0
ModelUVScaling: 1,1
Texture_Alpha_Source: "None"
Cropping: 0,0,0,0
}
Pose: "Pose::BIND_POSES", "BindPose" {
Type: "BindPose"
Version: 100
Properties60: {
}
NbPoseNodes: 1
PoseNode: {
Node: "Model::FileCabinet"
Matrix: 0.000000075497901,0.000000000000000,-1.000000000000000,0.000000000000000,-1.000000000000000,0.000000000000000,-0.000000075497901,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000
}
}
GlobalSettings: {
Version: 1000
Properties60: {
Property: "UpAxis", "int", "",1
Property: "UpAxisSign", "int", "",1
Property: "FrontAxis", "int", "",2
Property: "FrontAxisSign", "int", "",1
Property: "CoordAxis", "int", "",0
Property: "CoordAxisSign", "int", "",1
Property: "UnitScaleFactor", "double", "",1
}
}
}

; Object relations
;------------------------------------------------------------------

Relations: {
Model: "Model::FileCabinet", "Mesh" {
}
Model: "Model::Producer Perspective", "Camera" {
}
Model: "Model::Producer Top", "Camera" {
}
Model: "Model::Producer Bottom", "Camera" {
}
Model: "Model::Producer Front", "Camera" {
}
Model: "Model::Producer Back", "Camera" {
}
Model: "Model::Producer Right", "Camera" {
}
Model: "Model::Producer Left", "Camera" {
}
Model: "Model::Camera Switcher", "CameraSwitcher" {
}
Material: "Material::Material__mainTexture_png", "" {
}
Texture: "Texture::mainTexture_png", "TextureVideoClip" {
}
Video: "Video::mainTexture_png", "Clip" {
}
}

; Object connections
;------------------------------------------------------------------

Connections: {
Connect: "OO", "Model::FileCabinet", "Model::Scene"
Connect: "OO", "Material::Material__mainTexture_png", "Model::FileCabinet"
Connect: "OO", "Texture::mainTexture_png", "Model::FileCabinet"
Connect: "OO", "Video::mainTexture_png", "Texture::mainTexture_png"
}
;Takes and animation section
;----------------------------------------------------

Takes: {
Current: ""
}
;Version 5 settings
;------------------------------------------------------------------

Version5: {
AmbientRenderSettings: {
Version: 101
AmbientLightColor: 0.0,0.0,0.0,0
}
FogOptions: {
FogEnable: 0
FogMode: 0
FogDensity: 0.000
FogStart: 5.000
FogEnd: 25.000
FogColor: 0.1,0.1,0.1,1
}
Settings: {
FrameRate: "24"
TimeFormat: 1
SnapOnFrames: 0
ReferenceTimeIndex: -1
TimeLineStartTime: 0
TimeLineStopTime: 479181389250
}
RendererSetting: {
DefaultCamera: "Producer Perspective"
DefaultViewingMode: 0
}
}
@@ -0,0 +1,385 @@
; FBX 6.1.0 project file
; Created by Blender FBX Exporter
; for support mail: ideasman42@gmail.com
; ----------------------------------------------------

FBXHeaderExtension: {
FBXHeaderVersion: 1003
FBXVersion: 6100
CreationTimeStamp: {
Version: 1000
Year: 2013
Month: 12
Day: 05
Hour: 16
Minute: 16
Second: 32
Millisecond: 0
}
Creator: "FBX SDK/FBX Plugins build 20070228"
OtherFlags: {
FlagPLE: 0
}
}
CreationTime: "2013-12-05 16:16:32:000"
Creator: "Blender version 2.69 (sub 0)"

; Object definitions
;------------------------------------------------------------------

Definitions: {
Version: 100
Count: 5
ObjectType: "Model" {
Count: 1
}
ObjectType: "Geometry" {
Count: 1
}
ObjectType: "Material" {
Count: 1
}
ObjectType: "Texture" {
Count: 1
}
ObjectType: "Video" {
Count: 1
}
ObjectType: "Pose" {
Count: 1
}
ObjectType: "GlobalSettings" {
Count: 1
}
}

; Object properties
;------------------------------------------------------------------

Objects: {
Model: "Model::Floor", "Mesh" {
Version: 232
Properties60: {
Property: "QuaternionInterpolate", "bool", "",0
Property: "Visibility", "Visibility", "A+",1
Property: "Lcl Translation", "Lcl Translation", "A+",0.000000000000000,0.000000000000000,0.000000000000000
Property: "Lcl Rotation", "Lcl Rotation", "A+",-90.000009334538021,0.000000000000000,0.000000000000000
Property: "Lcl Scaling", "Lcl Scaling", "A+",1.000000000000000,1.000000000000000,1.000000000000000
Property: "RotationOffset", "Vector3D", "",0,0,0
Property: "RotationPivot", "Vector3D", "",0,0,0
Property: "ScalingOffset", "Vector3D", "",0,0,0
Property: "ScalingPivot", "Vector3D", "",0,0,0
Property: "TranslationActive", "bool", "",0
Property: "TranslationMin", "Vector3D", "",0,0,0
Property: "TranslationMax", "Vector3D", "",0,0,0
Property: "TranslationMinX", "bool", "",0
Property: "TranslationMinY", "bool", "",0
Property: "TranslationMinZ", "bool", "",0
Property: "TranslationMaxX", "bool", "",0
Property: "TranslationMaxY", "bool", "",0
Property: "TranslationMaxZ", "bool", "",0
Property: "RotationOrder", "enum", "",0
Property: "RotationSpaceForLimitOnly", "bool", "",0
Property: "AxisLen", "double", "",10
Property: "PreRotation", "Vector3D", "",0,0,0
Property: "PostRotation", "Vector3D", "",0,0,0
Property: "RotationActive", "bool", "",0
Property: "RotationMin", "Vector3D", "",0,0,0
Property: "RotationMax", "Vector3D", "",0,0,0
Property: "RotationMinX", "bool", "",0
Property: "RotationMinY", "bool", "",0
Property: "RotationMinZ", "bool", "",0
Property: "RotationMaxX", "bool", "",0
Property: "RotationMaxY", "bool", "",0
Property: "RotationMaxZ", "bool", "",0
Property: "RotationStiffnessX", "double", "",0
Property: "RotationStiffnessY", "double", "",0
Property: "RotationStiffnessZ", "double", "",0
Property: "MinDampRangeX", "double", "",0
Property: "MinDampRangeY", "double", "",0
Property: "MinDampRangeZ", "double", "",0
Property: "MaxDampRangeX", "double", "",0
Property: "MaxDampRangeY", "double", "",0
Property: "MaxDampRangeZ", "double", "",0
Property: "MinDampStrengthX", "double", "",0
Property: "MinDampStrengthY", "double", "",0
Property: "MinDampStrengthZ", "double", "",0
Property: "MaxDampStrengthX", "double", "",0
Property: "MaxDampStrengthY", "double", "",0
Property: "MaxDampStrengthZ", "double", "",0
Property: "PreferedAngleX", "double", "",0
Property: "PreferedAngleY", "double", "",0
Property: "PreferedAngleZ", "double", "",0
Property: "InheritType", "enum", "",0
Property: "ScalingActive", "bool", "",0
Property: "ScalingMin", "Vector3D", "",1,1,1
Property: "ScalingMax", "Vector3D", "",1,1,1
Property: "ScalingMinX", "bool", "",0
Property: "ScalingMinY", "bool", "",0
Property: "ScalingMinZ", "bool", "",0
Property: "ScalingMaxX", "bool", "",0
Property: "ScalingMaxY", "bool", "",0
Property: "ScalingMaxZ", "bool", "",0
Property: "GeometricTranslation", "Vector3D", "",0,0,0
Property: "GeometricRotation", "Vector3D", "",0,0,0
Property: "GeometricScaling", "Vector3D", "",1,1,1
Property: "LookAtProperty", "object", ""
Property: "UpVectorProperty", "object", ""
Property: "Show", "bool", "",1
Property: "NegativePercentShapeSupport", "bool", "",1
Property: "DefaultAttributeIndex", "int", "",0
Property: "Color", "Color", "A",0.8,0.8,0.8
Property: "Size", "double", "",100
Property: "Look", "enum", "",1
}
MultiLayer: 0
MultiTake: 1
Shading: Y
Culling: "CullingOff"
Vertices: 4.000000,-0.000001,0.000000,4.000000,-0.000001,3.165742,4.000000,-3.999999,3.165742,0.000000,-0.000001,0.000000,
4.000000,-4.000000,0.000000,0.000000,-4.000000,0.000000,0.000000,-0.000001,3.165742,0.000000,-3.999999,3.165742
PolygonVertexIndex: 1,2,7,-7,0,3,5,-5
GeometryVersion: 124
LayerElementNormal: 0 {
Version: 101
Name: ""
MappingInformationType: "ByPolygonVertex"
ReferenceInformationType: "Direct"
Normals: 0.000000,0.000000,-1.000000,0.000000,0.000000,-1.000000,0.000000,0.000000,-1.000000,0.000000,0.000000,-1.000000,
0.000000,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000,0.000000,1.000000
}
LayerElementSmoothing: 0 {
Version: 102
Name: ""
MappingInformationType: "ByPolygon"
ReferenceInformationType: "Direct"
Smoothing: 0,0
}
LayerElementUV: 0 {
Version: 101
Name: "UVMap"
MappingInformationType: "ByPolygonVertex"
ReferenceInformationType: "IndexToDirect"
UV: 0.181100,0.631302,0.181100,0.509971,0.301266,0.630138,0.301266,0.751469,0.301266,0.509971,0.301266,0.631302,
0.181100,0.751469,0.181100,0.630138
UVIndex: 5,3,6,0,2,7,1,4
}
LayerElementTexture: 0 {
Version: 101
Name: "UVMap"
MappingInformationType: "AllSame"
ReferenceInformationType: "IndexToDirect"
BlendMode: "Translucent"
TextureAlpha: 1
TextureId: 0
}
LayerElementMaterial: 0 {
Version: 101
Name: ""
MappingInformationType: "AllSame"
ReferenceInformationType: "IndexToDirect"
Materials: 0
}
Layer: 0 {
Version: 100
LayerElement: {
Type: "LayerElementNormal"
TypedIndex: 0
}
LayerElement: {
Type: "LayerElementSmoothing"
TypedIndex: 0
}
LayerElement: {
Type: "LayerElementUV"
TypedIndex: 0
}
LayerElement: {
Type: "LayerElementTexture"
TypedIndex: 0
}
LayerElement: {
Type: "LayerElementMaterial"
TypedIndex: 0
}
}
}
Material: "Material::Material__mainTexture_png", "" {
Version: 102
ShadingModel: "lambert"
MultiLayer: 0
Properties60: {
Property: "ShadingModel", "KString", "", "Lambert"
Property: "MultiLayer", "bool", "",0
Property: "EmissiveColor", "ColorRGB", "",0.8000,0.8000,0.8000
Property: "EmissiveFactor", "double", "",0.0000
Property: "AmbientColor", "ColorRGB", "",1.0000,1.0000,1.0000
Property: "AmbientFactor", "double", "",1.0000
Property: "DiffuseColor", "ColorRGB", "",0.8000,0.8000,0.8000
Property: "DiffuseFactor", "double", "",0.8000
Property: "Bump", "Vector3D", "",0,0,0
Property: "TransparentColor", "ColorRGB", "",1,1,1
Property: "TransparencyFactor", "double", "",0.0000
Property: "SpecularColor", "ColorRGB", "",1.0000,1.0000,1.0000
Property: "SpecularFactor", "double", "",0.5000
Property: "ShininessExponent", "double", "",12.3
Property: "ReflectionColor", "ColorRGB", "",0,0,0
Property: "ReflectionFactor", "double", "",1
Property: "Emissive", "ColorRGB", "",0,0,0
Property: "Ambient", "ColorRGB", "",1.0,1.0,1.0
Property: "Diffuse", "ColorRGB", "",0.8,0.8,0.8
Property: "Specular", "ColorRGB", "",1.0,1.0,1.0
Property: "Shininess", "double", "",12.3
Property: "Opacity", "double", "",1.0
Property: "Reflectivity", "double", "",0
}
}
Video: "Video::mainTexture_png", "Clip" {
Type: "Clip"
Properties60: {
Property: "FrameRate", "double", "",0
Property: "LastFrame", "int", "",0
Property: "Width", "int", "",0
Property: "Height", "int", "",0
Property: "Path", "charptr", "", "mainTexture.png"
Property: "StartFrame", "int", "",0
Property: "StopFrame", "int", "",0
Property: "PlaySpeed", "double", "",1
Property: "Offset", "KTime", "",0
Property: "InterlaceMode", "enum", "",0
Property: "FreeRunning", "bool", "",0
Property: "Loop", "bool", "",0
Property: "AccessMode", "enum", "",0
}
UseMipMap: 0
Filename: "mainTexture.png"
RelativeFilename: "E:\user_data\user_documents\documents\my_games\apress_firstperson_game\gimp\mainTexture.png"
}
Texture: "Texture::mainTexture_png", "TextureVideoClip" {
Type: "TextureVideoClip"
Version: 202
TextureName: "Texture::mainTexture_png"
Properties60: {
Property: "Translation", "Vector", "A+",0,0,0
Property: "Rotation", "Vector", "A+",0,0,0
Property: "Scaling", "Vector", "A+",1,1,1
Property: "Texture alpha", "Number", "A+",0
Property: "TextureTypeUse", "enum", "",0
Property: "CurrentTextureBlendMode", "enum", "",1
Property: "UseMaterial", "bool", "",0
Property: "UseMipMap", "bool", "",0
Property: "CurrentMappingType", "enum", "",0
Property: "UVSwap", "bool", "",0
Property: "WrapModeU", "enum", "",0
Property: "WrapModeV", "enum", "",0
Property: "TextureRotationPivot", "Vector3D", "",0,0,0
Property: "TextureScalingPivot", "Vector3D", "",0,0,0
Property: "VideoProperty", "object", ""
}
Media: "Video::mainTexture_png"
FileName: "mainTexture.png"
RelativeFilename: "E:\user_data\user_documents\documents\my_games\apress_firstperson_game\gimp\mainTexture.png"
ModelUVTranslation: 0,0
ModelUVScaling: 1,1
Texture_Alpha_Source: "None"
Cropping: 0,0,0,0
}
Pose: "Pose::BIND_POSES", "BindPose" {
Type: "BindPose"
Version: 100
Properties60: {
}
NbPoseNodes: 1
PoseNode: {
Node: "Model::Floor"
Matrix: 0.000000075497901,0.000000000000000,-1.000000000000000,0.000000000000000,-1.000000000000000,0.000000000000000,-0.000000075497901,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000
}
}
GlobalSettings: {
Version: 1000
Properties60: {
Property: "UpAxis", "int", "",1
Property: "UpAxisSign", "int", "",1
Property: "FrontAxis", "int", "",2
Property: "FrontAxisSign", "int", "",1
Property: "CoordAxis", "int", "",0
Property: "CoordAxisSign", "int", "",1
Property: "UnitScaleFactor", "double", "",1
}
}
}

; Object relations
;------------------------------------------------------------------

Relations: {
Model: "Model::Floor", "Mesh" {
}
Model: "Model::Producer Perspective", "Camera" {
}
Model: "Model::Producer Top", "Camera" {
}
Model: "Model::Producer Bottom", "Camera" {
}
Model: "Model::Producer Front", "Camera" {
}
Model: "Model::Producer Back", "Camera" {
}
Model: "Model::Producer Right", "Camera" {
}
Model: "Model::Producer Left", "Camera" {
}
Model: "Model::Camera Switcher", "CameraSwitcher" {
}
Material: "Material::Material__mainTexture_png", "" {
}
Texture: "Texture::mainTexture_png", "TextureVideoClip" {
}
Video: "Video::mainTexture_png", "Clip" {
}
}

; Object connections
;------------------------------------------------------------------

Connections: {
Connect: "OO", "Model::Floor", "Model::Scene"
Connect: "OO", "Material::Material__mainTexture_png", "Model::Floor"
Connect: "OO", "Texture::mainTexture_png", "Model::Floor"
Connect: "OO", "Video::mainTexture_png", "Texture::mainTexture_png"
}
;Takes and animation section
;----------------------------------------------------

Takes: {
Current: ""
}
;Version 5 settings
;------------------------------------------------------------------

Version5: {
AmbientRenderSettings: {
Version: 101
AmbientLightColor: 0.0,0.0,0.0,0
}
FogOptions: {
FogEnable: 0
FogMode: 0
FogDensity: 0.000
FogStart: 5.000
FogEnd: 25.000
FogColor: 0.1,0.1,0.1,1
}
Settings: {
FrameRate: "24"
TimeFormat: 1
SnapOnFrames: 0
ReferenceTimeIndex: -1
TimeLineStartTime: 0
TimeLineStopTime: 479181389250
}
RendererSetting: {
DefaultCamera: "Producer Perspective"
DefaultViewingMode: 0
}
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,40 @@
//-------------------------------------------------------------
using UnityEngine;
using System.Collections;
[ExecuteInEditMode]
//-------------------------------------------------------------
public class GUICam : MonoBehaviour
{
//Camera Component
private Camera Cam = null;

//Pixel to World Scale
public float PixelToWorldScale = 200.0f;

public LayerMask LM;

//Cached transform for camera
private Transform ThisTransform = null;
//-------------------------------------------------------------
// Use this for initialization
void Start ()
{
//Get camera component for GUI
Cam = GetComponent<Camera>();

//Get camera transform
ThisTransform = transform;
}
//-------------------------------------------------------------
// Update is called once per frame
void Update ()
{
//Update camera size
Cam.orthographicSize = Screen.height/2/PixelToWorldScale;

//Offset camera so top-left of screen is position (0,0) for game objects
ThisTransform.localPosition = new Vector3(Screen.width/2/PixelToWorldScale, -(Screen.height/2/PixelToWorldScale), ThisTransform.localPosition.z);
}
//-------------------------------------------------------------
}
//-------------------------------------------------------------
@@ -0,0 +1,17 @@
//Posts notification when gui element is clicked
//------------------------------------------------
using UnityEngine;
using System.Collections;
//------------------------------------------------
public class GUIEvent : MonoBehaviour
{
//Notification to send when activated
public string Notification = null;

//Check for input
void OnMouseDown()
{
GameManager.Notifications.PostNotification(this, Notification);
}
}
//------------------------------------------------
@@ -0,0 +1,22 @@
using UnityEngine;
using System.Collections;
[ExecuteInEditMode]
public class GUILabel : MonoBehaviour
{
//Content for label
public GUIContent LabelData;

//Style for label
public GUIStyle LabelStyle;

//Rect for label
public Rect LabelRegion;

//Draw label
void OnGUI()
{
Rect FinalRect = new Rect(LabelRegion.x * Screen.width, LabelRegion.y * Screen.height, LabelRegion.width * Screen.width, LabelRegion.height * Screen.height);

GUI.Label(FinalRect, LabelData, LabelStyle);
}
}
@@ -0,0 +1,63 @@
//------------------------------------------------
using UnityEngine;
using System.Collections;
[ExecuteInEditMode]
//------------------------------------------------
public class GUIObject : MonoBehaviour
{
[System.Serializable]
public class PixelPadding
{
public float LeftPadding;
public float RightPadding;
public float TopPadding;
public float BottomPadding;
}

//Pixel Padding
public PixelPadding Padding;

//HALIGN
public enum HALIGN {left=0, right=1};

//VALIGN
public enum VALIGN {top=0, bottom=1};

//Alignment
public HALIGN HorzAlign = HALIGN.left;
public VALIGN VertAlign = VALIGN.top;

//Reference to GUICamera for this object
public GUICam GUICamera = null;

//Reference to cached transform
private Transform ThisTransform = null;

//------------------------------------------------
// Use this for initialization
void Start ()
{
//Get cached transform
ThisTransform = transform;
}
//------------------------------------------------
// Update is called once per frame
void Update ()
{
//Calculate position on-screen
Vector3 FinalPosition = new Vector3(HorzAlign == HALIGN.left ? 0.0f : Screen.width,
VertAlign == VALIGN.top ? 0.0f : -Screen.height,
ThisTransform.localPosition.z);

//Offset with padding
FinalPosition = new Vector3(FinalPosition.x + (Padding.LeftPadding * Screen.width) - (Padding.RightPadding * Screen.width), FinalPosition.y - (Padding.TopPadding * Screen.height) + (Padding.BottomPadding * Screen.height), FinalPosition.z);

//Convert to pixel scale
FinalPosition = new Vector3(FinalPosition.x / GUICamera.PixelToWorldScale, FinalPosition.y / GUICamera.PixelToWorldScale, FinalPosition.z);

//Update position
ThisTransform.localPosition = FinalPosition;
}
//------------------------------------------------
}
//------------------------------------------------
@@ -0,0 +1,71 @@
//--------------------------------------------------------------
//Class for menu functionality
using UnityEngine;
using System.Collections;
//--------------------------------------------------------------
public class GUIOptions : MonoBehaviour
{
//Sprite Renderer for menu
private SpriteRenderer SR = null;

//Collision objects for buttons
private BoxCollider[] Colliders = null;

//--------------------------------------------------------------
// Use this for initialization
void Start ()
{
//Get sprite renderer
SR = GetComponent<SpriteRenderer>();

//Get button colliders
Colliders = GetComponentsInChildren<BoxCollider>();

//Add listeners
GameManager.Notifications.AddListener(this, "ShowOptions");
GameManager.Notifications.AddListener(this, "HideOptions");

//Hide menu on startup
HideOptions(null);
}
//--------------------------------------------------------------
//Hide options event
public void HideOptions(Component Sender)
{
Cursor.visible = false;
SetOptionsVisible(false);
}
//--------------------------------------------------------------
//Show options event
public void ShowOptions(Component Sender)
{
Cursor.visible = true;
SetOptionsVisible();
}
//--------------------------------------------------------------
//Function to show/hide options
private void SetOptionsVisible(bool bShow = true)
{
//If enabling, then pause game - else resume
Time.timeScale = (bShow) ? 0.0f : 1.0f;

//Enable/Disable input
GameManager.Instance.InputAllowed = !bShow;

//Show/Hide menu graphics
SR.enabled = bShow;

//Enable/Disable button colliders
foreach(BoxCollider B in Colliders)
B.enabled = bShow;
}
//--------------------------------------------------------------
//Watch escape key input
void Update()
{
//If escape key pressed
if(Input.GetKeyDown(KeyCode.Escape))
SetOptionsVisible(!SR.enabled);
}
//--------------------------------------------------------------
}
@@ -0,0 +1,32 @@
//--------------------------------------------------------------
using UnityEngine;
using System.Collections;
//--------------------------------------------------------------
public class GUIUpdateStats : MonoBehaviour
{
//Player reference
private PlayerController PC = null;

//Health Label Component
public GUILabel HealthLabel = null;

//Ammo Label Component
public GUILabel AmmoLabel = null;

//--------------------------------------------------------------
void Start()
{
//Get Player Controller Component
GameObject PlayerObject = GameObject.Find("Player");
PC = PlayerObject.GetComponentInChildren<PlayerController>();
}
//--------------------------------------------------------------
// Update is called once per frame
void Update ()
{
//Update health and ammo strings
AmmoLabel.LabelData.text = "Ammo: " + ((PC.ActiveWeapon.Ammo < 0) ? "None" : PC.ActiveWeapon.Ammo.ToString());
HealthLabel.LabelData.text = "Health: " + Mathf.Clamp(PC.Health,0,100);
}
//--------------------------------------------------------------
}
@@ -0,0 +1,290 @@
//Sets up FSM for enemy AI
//------------------------------------------------
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
//------------------------------------------------
public class Enemy : MonoBehaviour
{
//Enemy types
public enum ENEMY_TYPE {Drone = 0, ToughGuy = 1, Boss=2};

//Type of this enemy
public ENEMY_TYPE Type = ENEMY_TYPE.Drone;

//Custom ID of this enemy
public int EnemyID = 0;

//Current health of this enemy
public int Health = 100;

//Attack Damage - amount of damage this enemy deals to player when attacking
public int AttackDamage = 10;

//Recovery delay in seconds after launching an attack
public float RecoveryDelay = 1.0f;

//Enemy cached transform
protected Transform ThisTransform = null;

//------------------------------------------------
//AI Properties

//Reference to NavMesh Agent component
protected NavMeshAgent Agent = null;

//Reference to active PlayerController component for player
protected PlayerController PC = null;

//Reference to Player Transform
protected Transform PlayerTransform = null;

//Total distance in Unity Units from current position that agent can wander when patrolling
public float PatrolDistance = 10.0f;

//Total distance enemy must be from player, in Unity Units, before chasing them (entering chase state)
public float ChaseDistance = 10.0f;

//Total distance enemy must be from player before attacking them
public float AttackDistance = 0.1f;

//Enum of states for FSM
public enum ENEMY_STATE {PATROL = 0, CHASE = 1, ATTACK=2};

//Current state of enemy - default is patrol
public ENEMY_STATE ActiveState = ENEMY_STATE.PATROL;

//------------------------------------------------
//Called on object start
protected virtual void Start()
{
//Get NavAgent Component
Agent = GetComponent<NavMeshAgent>();

//Get Player Controller Component
GameObject PlayerObject = GameObject.Find("Player");
PC = PlayerObject.GetComponentInChildren<PlayerController>();

//Get Player Transform
PlayerTransform = PC.transform;

//Get Enemy Transform
ThisTransform = transform;

//Set default state
ChangeState(ActiveState);

//Add listener for saving games
GameManager.Notifications.AddListener(this, "SaveGamePrepare");
GameManager.Notifications.AddListener(this, "LoadGameComplete");
}
//------------------------------------------------
//Change AI State
public void ChangeState(ENEMY_STATE State)
{
//Stops all AI Processing
StopAllCoroutines();

//Set new state
ActiveState = State;

//Activates new state
switch(ActiveState)
{
case ENEMY_STATE.ATTACK:
StartCoroutine(AI_Attack());
SendMessage("Attack", SendMessageOptions.DontRequireReceiver); //Notify Game Object
return;

case ENEMY_STATE.CHASE:
StartCoroutine(AI_Chase());
SendMessage("Chase", SendMessageOptions.DontRequireReceiver); //Notify Game Object
return;

case ENEMY_STATE.PATROL:
StartCoroutine(AI_Patrol());
SendMessage("Patrol", SendMessageOptions.DontRequireReceiver); //Notify Game Object
return;
}
}
//------------------------------------------------
//AI Function to handle patrol behaviour for enemy
//Can exit this state and enter chase
IEnumerator AI_Patrol()
{
//Stop Agent
Agent.Stop();

//Loop forever while in patrol state
while(ActiveState == ENEMY_STATE.PATROL)
{
//Get random destination on map
Vector3 randomPosition = Random.insideUnitSphere * PatrolDistance;

//Add as offset from current position
randomPosition += ThisTransform.position;

//Get nearest valid position
NavMeshHit hit;
NavMesh.SamplePosition(randomPosition, out hit, PatrolDistance, 1);

//Set destination
Agent.SetDestination(hit.position);

//Set distance range between object and destination to classify as 'arrived'
float ArrivalDistance = 2.0f;

//Set timeout before new path is generated (5 seconds)
float TimeOut = 5.0f;

//Elapsed Time
float ElapsedTime = 0;

//Wait until enemy reaches destination or times-out, and then get new position
while(Vector3.Distance(ThisTransform.position, hit.position) > ArrivalDistance && ElapsedTime < TimeOut)
{
//Update ElapsedTime
ElapsedTime += Time.deltaTime;

//Check if should enter chase state
if(Vector3.Distance(ThisTransform.position, PlayerTransform.position) < ChaseDistance)
{
//Exit patrol and enter chase state
ChangeState(ENEMY_STATE.CHASE);
yield break;
}

yield return null;
}
}
}
//------------------------------------------------
//AI Function to handle chase behaviour for enemy
//Can exit this state and enter either patrol or attack
IEnumerator AI_Chase()
{
//Stop Agent
Agent.Stop();

//Loop forever while in chase state
while(ActiveState == ENEMY_STATE.CHASE)
{
//Set destination to player
Agent.SetDestination(PlayerTransform.position);

//Check distances and state exit conditions
float DistanceFromPlayer = Vector3.Distance(ThisTransform.position, PlayerTransform.position);

//If within attack range, then change to attack state
if(DistanceFromPlayer < AttackDistance) {ChangeState(ENEMY_STATE.ATTACK); yield break;}

//If outside chase range, then revert to patrol state
if(DistanceFromPlayer > ChaseDistance) {ChangeState(ENEMY_STATE.PATROL); yield break;}

//Wait until next frame
yield return null;
}
}
//------------------------------------------------
//AI Function to handle attack behaviour for enemy
//Can exit this state and enter either patrol or chase
IEnumerator AI_Attack()
{
//Stop Agent
Agent.Stop();

//Elapsed time - to calculate strike intervals
float ElapsedTime = RecoveryDelay;

//Loop forever while in chase state
while(ActiveState == ENEMY_STATE.ATTACK)
{
//Update elapsed time
ElapsedTime += Time.deltaTime;

//Check distances and state exit conditions
float DistanceFromPlayer = Vector3.Distance(ThisTransform.position, PlayerTransform.position);

//If outside chase range, then revert to patrol state
if(DistanceFromPlayer > ChaseDistance) {ChangeState(ENEMY_STATE.PATROL); yield break;}

//If within attack range, then change to attack state
if(DistanceFromPlayer > AttackDistance) {ChangeState(ENEMY_STATE.CHASE); yield break;}

//Make strike
if(ElapsedTime >= RecoveryDelay)
{
//Reset elapsed time
ElapsedTime = 0;
SendMessage("Strike",SendMessageOptions.DontRequireReceiver);
}

//Wait until next frame
yield return null;
}
}
//------------------------------------------------
//Function called when saving game
public void SaveGamePrepare(Component Sender)
{
//Create enemy data for this enemy
LoadSaveManager.GameStateData.DataEnemy ThisEnemy = new LoadSaveManager.GameStateData.DataEnemy();

//Fill in data for current enemy
ThisEnemy.EnemyID = EnemyID;
ThisEnemy.Health = Health;
ThisEnemy.PosRotScale.X = ThisTransform.position.x;
ThisEnemy.PosRotScale.Y = ThisTransform.position.y;
ThisEnemy.PosRotScale.Z = ThisTransform.position.z;
ThisEnemy.PosRotScale.RotX = ThisTransform.localEulerAngles.x;
ThisEnemy.PosRotScale.RotY = ThisTransform.localEulerAngles.y;
ThisEnemy.PosRotScale.RotZ = ThisTransform.localEulerAngles.z;
ThisEnemy.PosRotScale.ScaleX = ThisTransform.localScale.x;
ThisEnemy.PosRotScale.ScaleY = ThisTransform.localScale.y;
ThisEnemy.PosRotScale.ScaleZ = ThisTransform.localScale.z;

//Add enemy to Game State
GameManager.StateManager.GameState.Enemies.Add(ThisEnemy);
}
//------------------------------------------------
//Function called when loading is complete
public void LoadGameComplete(Component Sender)
{
//Cycle through enemies and find matching ID
List<LoadSaveManager.GameStateData.DataEnemy> Enemies = GameManager.StateManager.GameState.Enemies;

//Reference to this enemy
LoadSaveManager.GameStateData.DataEnemy ThisEnemy = null;

for(int i=0; i<Enemies.Count; i++)
{
if(Enemies[i].EnemyID == EnemyID)
{
//Found enemy. Now break break from loop
ThisEnemy = Enemies[i];
break;
}
}

//If we reach here and no enemy is found, then it was destroyed when saved. So destroy now
if(ThisEnemy==null){DestroyImmediate(gameObject);return;}

//Else load enemy data
EnemyID = ThisEnemy.EnemyID;
Health = ThisEnemy.Health;

//Set position
Agent.Warp(new Vector3(ThisEnemy.PosRotScale.X, ThisEnemy.PosRotScale.Y, ThisEnemy.PosRotScale.Z));

//Set rotation
ThisTransform.localRotation = Quaternion.Euler(ThisEnemy.PosRotScale.RotX, ThisEnemy.PosRotScale.RotY, ThisEnemy.PosRotScale.RotZ);

//Set scale
ThisTransform.localScale = new Vector3(ThisEnemy.PosRotScale.ScaleX, ThisEnemy.PosRotScale.ScaleY, ThisEnemy.PosRotScale.ScaleZ);
}
//------------------------------------------------

}
//------------------------------------------------


@@ -0,0 +1,106 @@
using UnityEngine;
using System.Collections;

public class Enemy_Boss : Enemy
{
//-----------------------------------------------
//Sound to play on destroy
public AudioClip DestroyAudio = null;

//Audio Source for sound playback
private AudioSource SFX = null;

//Sprites for walk animation
public SpriteRenderer[] WalkSprites = null;

//Sprites for attack animation
public SpriteRenderer[] AttackSprites = null;

//Default Sprite (neutral state)
public SpriteRenderer DefaultSprite = null;
//------------------------------------------------
protected override void Start()
{
//Called super start method
base.Start();

//Find sound object in scene
GameObject SoundsObject = GameObject.FindGameObjectWithTag("sounds");

//If no sound object, then exit
if(SoundsObject == null) return;

//Get audio source component for sfx
SFX = SoundsObject.GetComponent<AudioSource>();
}
//------------------------------------------------
//Event called when damaged by an attack
public void Damage(int Damage = 0)
{
//Reduce health
Health -= Damage;

//Play damage animation
gameObject.SendMessage("PlayColorAnimation",0,SendMessageOptions.DontRequireReceiver);

//Check if dead
if(Health <= 0)
{
//Send enemy destroyed notification
GameManager.Notifications.PostNotification(this, "EnemyDestroyed");

//Play collection sound, if audio source is available
if(SFX){SFX.PlayOneShot(DestroyAudio, 1.0f);}

//Remove object from scene
DestroyImmediate(gameObject);
}
}
//------------------------------------------------
//Handle patrol state
public void Patrol()
{
//Hide default and attack sprites
foreach(SpriteRenderer SR in AttackSprites)
SR.enabled=false;

//Hide default sprite
DefaultSprite.enabled = false;

//Entered patrol state
SendMessage ("StopSpriteAnimation", ((int)ENEMY_STATE.PATROL), SendMessageOptions.DontRequireReceiver);
SendMessage ("StopSpriteAnimation", ((int)ENEMY_STATE.ATTACK), SendMessageOptions.DontRequireReceiver);
SendMessage("PlaySpriteAnimation", ((int)ENEMY_STATE.PATROL), SendMessageOptions.DontRequireReceiver);
}
//------------------------------------------------
//Handle Chase State
public void Chase()
{
//Same animations as patrol
Patrol();
}
//------------------------------------------------
//Entered Attack State
public void Attack()
{
//Hide default and walk sprites
foreach(SpriteRenderer SR in WalkSprites)
SR.enabled=false;

//Hide default sprite
DefaultSprite.enabled = false;

//Entered attack state
SendMessage ("StopSpriteAnimation", ((int)ENEMY_STATE.PATROL), SendMessageOptions.DontRequireReceiver);
SendMessage ("StopSpriteAnimation", ((int)ENEMY_STATE.ATTACK), SendMessageOptions.DontRequireReceiver);
SendMessage("PlaySpriteAnimation", ((int)ENEMY_STATE.ATTACK), SendMessageOptions.DontRequireReceiver);
}
//------------------------------------------------
//Strike - called each time the enemy makes a strike against the player (deal damage)
public void Strike()
{
//Damage player
PC.gameObject.SendMessage("ApplyDamage", AttackDamage, SendMessageOptions.DontRequireReceiver);
}
//------------------------------------------------
}
@@ -0,0 +1,112 @@
//------------------------------------------------
using UnityEngine;
using System.Collections;
//------------------------------------------------
public class Enemy_Drone : Enemy
{
//------------------------------------------------
//Sound to play on destroy
public AudioClip DestroyAudio = null;

//Audio Source for sound playback
private AudioSource SFX = null;

//Sprites for walk animation
public SpriteRenderer[] WalkSprites = null;

//Sprites for attack animation
public SpriteRenderer[] AttackSprites = null;

//Default Sprite (neutral state)
public SpriteRenderer DefaultSprite = null;

//------------------------------------------------
protected override void Start()
{
//Called super start method
base.Start();

//Find sound object in scene
GameObject SoundsObject = GameObject.FindGameObjectWithTag("sounds");

//If no sound object, then exit
if(SoundsObject == null) return;

//Get audio source component for sfx
SFX = SoundsObject.GetComponent<AudioSource>();
}
//------------------------------------------------
//Event called when damaged by an attack
public void Damage(int Damage = 0)
{
//Reduce health
Health -= Damage;

//Play damage animation
gameObject.SendMessage("PlayColorAnimation",0,SendMessageOptions.DontRequireReceiver);

//Check if dead
if(Health <= 0)
{
//Send enemy destroyed notification
GameManager.Notifications.PostNotification(this, "EnemyDestroyed");

//Play collection sound, if audio source is available
if(SFX){SFX.PlayOneShot(DestroyAudio, 1.0f);}

//Remove object from scene
DestroyImmediate(gameObject);

//Clean up old listeners
GameManager.Notifications.RemoveRedundancies();
}
}
//------------------------------------------------
//Handle patrol state
public void Patrol()
{
//Hide default and attack sprites
foreach(SpriteRenderer SR in AttackSprites)
SR.enabled=false;

//Hide default sprite
DefaultSprite.enabled = false;

//Entered patrol state
SendMessage ("StopSpriteAnimation", ((int)ENEMY_STATE.PATROL), SendMessageOptions.DontRequireReceiver);
SendMessage ("StopSpriteAnimation", ((int)ENEMY_STATE.ATTACK), SendMessageOptions.DontRequireReceiver);
SendMessage("PlaySpriteAnimation", ((int)ENEMY_STATE.PATROL), SendMessageOptions.DontRequireReceiver);
}
//------------------------------------------------
//Handle Chase State
public void Chase()
{
//Same animations as patrol
Patrol();
}
//------------------------------------------------
//Entered Attack State
public void Attack()
{
//Hide default and walk sprites
foreach(SpriteRenderer SR in WalkSprites)
SR.enabled=false;

//Hide default sprite
DefaultSprite.enabled = false;

//Entered attack state
SendMessage ("StopSpriteAnimation", ((int)ENEMY_STATE.PATROL), SendMessageOptions.DontRequireReceiver);
SendMessage ("StopSpriteAnimation", ((int)ENEMY_STATE.ATTACK), SendMessageOptions.DontRequireReceiver);
SendMessage("PlaySpriteAnimation", ((int)ENEMY_STATE.ATTACK), SendMessageOptions.DontRequireReceiver);
}
//------------------------------------------------
//Strike - called each time the enemy makes a strike against the player (deal damage)
public void Strike()
{
//Damage player
PC.gameObject.SendMessage("ApplyDamage", AttackDamage, SendMessageOptions.DontRequireReceiver);
}
//------------------------------------------------
}
//------------------------------------------------
@@ -0,0 +1,107 @@
//-----------------------------------------------
using UnityEngine;
using System.Collections;
//-----------------------------------------------
public class Enemy_ToughGuy : Enemy
{
//-----------------------------------------------
//Sound to play on destroy
public AudioClip DestroyAudio = null;

//Audio Source for sound playback
private AudioSource SFX = null;

//Sprites for walk animation
public SpriteRenderer[] WalkSprites = null;

//Sprites for attack animation
public SpriteRenderer[] AttackSprites = null;

//Default Sprite (neutral state)
public SpriteRenderer DefaultSprite = null;
//------------------------------------------------
protected override void Start()
{
//Called super start method
base.Start();

//Find sound object in scene
GameObject SoundsObject = GameObject.FindGameObjectWithTag("sounds");

//If no sound object, then exit
if(SoundsObject == null) return;

//Get audio source component for sfx
SFX = SoundsObject.GetComponent<AudioSource>();
}
//------------------------------------------------
//Event called when damaged by an attack
public void Damage(int Damage = 0)
{
//Reduce health
Health -= Damage;

//Play damage animation
gameObject.SendMessage("PlayColorAnimation",0,SendMessageOptions.DontRequireReceiver);

//Check if dead
if(Health <= 0)
{
//Send enemy destroyed notification
GameManager.Notifications.PostNotification(this, "EnemyDestroyed");

//Play collection sound, if audio source is available
if(SFX){SFX.PlayOneShot(DestroyAudio, 1.0f);}

//Remove object from scene
DestroyImmediate(gameObject);
}
}
//------------------------------------------------
//Handle patrol state
public void Patrol()
{
//Hide default and attack sprites
foreach(SpriteRenderer SR in AttackSprites)
SR.enabled=false;

//Hide default sprite
DefaultSprite.enabled = false;

//Entered patrol state
SendMessage ("StopSpriteAnimation", ((int)ENEMY_STATE.PATROL), SendMessageOptions.DontRequireReceiver);
SendMessage ("StopSpriteAnimation", ((int)ENEMY_STATE.ATTACK), SendMessageOptions.DontRequireReceiver);
SendMessage("PlaySpriteAnimation", ((int)ENEMY_STATE.PATROL), SendMessageOptions.DontRequireReceiver);
}
//------------------------------------------------
//Handle Chase State
public void Chase()
{
//Same animations as patrol
Patrol();
}
//------------------------------------------------
//Entered Attack State
public void Attack()
{
//Hide default and walk sprites
foreach(SpriteRenderer SR in WalkSprites)
SR.enabled=false;

//Hide default sprite
DefaultSprite.enabled = false;

//Entered attack state
SendMessage ("StopSpriteAnimation", ((int)ENEMY_STATE.PATROL), SendMessageOptions.DontRequireReceiver);
SendMessage ("StopSpriteAnimation", ((int)ENEMY_STATE.ATTACK), SendMessageOptions.DontRequireReceiver);
SendMessage("PlaySpriteAnimation", ((int)ENEMY_STATE.ATTACK), SendMessageOptions.DontRequireReceiver);
}
//------------------------------------------------
//Strike - called each time the enemy makes a strike against the player (deal damage)
public void Strike()
{
//Damage player
PC.gameObject.SendMessage("ApplyDamage", AttackDamage, SendMessageOptions.DontRequireReceiver);
}
//------------------------------------------------
}