Large diffs are not rendered by default.

@@ -248,7 +248,11 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 483112, guid: 57c806e5fb8b40143a37e27bab03b554, type: 2}
propertyPath: m_RootOrder
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 13671988, guid: 57c806e5fb8b40143a37e27bab03b554, type: 2}
propertyPath: m_IsTrigger
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 57c806e5fb8b40143a37e27bab03b554, type: 2}

Large diffs are not rendered by default.

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

public class GameManaagerFSM : MonoBehaviour
{
protected static GameManaagerFSM gM_FSM;

public void GameStateChange(GameStates to)
{
checkStateChange(c_gState, to);
}

private GameStates c_gState;

public GameStates CurrentGState
{
get
{
return c_gState;
}
}


private bool checkStateChange(GameStates to, GameStates from)
{
switch(from)
{
case GameStates.init:
if(to == GameStates.mainMenu)
{
c_gState = to;
return true;
}
break;
case GameStates.mainMenu:
if(to == GameStates.gamePlay)
{
c_gState = to;
return true;
}
break;
case GameStates.gamePlay:
if(to == GameStates.pause || to == GameStates.gameOver)
{
c_gState = to;
return true;
}
break;
case GameStates.pause:
if(to == GameStates.mainMenu || to == GameStates.close || to == GameStates.gamePlay)
{
c_gState = to;
return true;
}
break;
case GameStates.gameOver:
if(to == GameStates.close || to == GameStates.mainMenu)
{
c_gState = to;
return true;
}
break;
default:
break;
}
return false;
}
}
@@ -0,0 +1,23 @@
using UnityEngine;
using System.Collections;

public class ProjectileFSM : MonoBehaviour
{
public int damgaeOutput;

public enum projectileType
{
turretBullet,
shotgunShell,
gernade,
}

public void OnTriggerEnter(Collider C)
{
if(C.gameObject == FindObjectOfType<Stats>().isEnemy)
{
Destroy(gameObject);
C.GetComponent<Stats>().m_Health -= damgaeOutput;
}
}
}
@@ -7,16 +7,16 @@ public class FieldOfView : MonoBehaviour

public void OnTriggerStay(Collider c)
{
if(c.GetComponent<Stats>())
if(c.GetComponent<Stats>().isShootable == true)
isTargetInView = true;
if (c.GetComponent<Stats>())
if(c.GetComponent<Stats>().isShootable == true)
isTargetInView = true;
}

public void OnTriggerExit(Collider c)
{
if (c.GetComponent<Stats>())
if (c.GetComponent<Stats>().isShootable == true)
isTargetInView = false;
if (c.GetComponent<Stats>().isShootable == true)
isTargetInView = false;
}

// Use this for initialization
@@ -54,28 +54,6 @@ void t_Fire(TurretStats.e_TurretType type)
}
break;

case TurretStats.e_TurretType.e_AntiAir:
Vector3 spawnPos = new Vector3(GetComponentInParent<TurretStats>().barrelPos[0].position.x,
GetComponentInParent<TurretStats>().barrelPos[0].position.y,
GetComponentInParent<TurretStats>().barrelPos[0].position.z);

GetComponentInParent<TurretStats>().t_cycle++;

switch (GetComponentInParent<TurretStats>().t_cycle++ % 7)
{
case 1: spawnPos = GetComponentInParent<TurretStats>().barrelPos[0].position; print("Fire 1"); break;
case 2: spawnPos = GetComponentInParent<TurretStats>().barrelPos[1].position; print("Fire 2"); break;
case 3: spawnPos = GetComponentInParent<TurretStats>().barrelPos[2].position; print("Fire 3"); break;
case 4: spawnPos = GetComponentInParent<TurretStats>().barrelPos[3].position; print("Fire 4"); break;
case 5: spawnPos = GetComponentInParent<TurretStats>().barrelPos[4].position; print("Fire 5"); break;
case 6: spawnPos = GetComponentInParent<TurretStats>().barrelPos[5].position; print("Fire 6"); break;
}

Instantiate(GetComponentInParent<TurretStats>().bullet,
spawnPos,
GetComponentInParent<TurretStats>().barrelPos[1].rotation);
break;

case TurretStats.e_TurretType.e_ShotGun:
foreach (Transform t_Barrel in GetComponentInParent<TurretStats>().barrelPos)
{
@@ -84,6 +62,29 @@ void t_Fire(TurretStats.e_TurretType type)
break;
}

if(GetComponentInParent<TurretStats>().type == TurretStats.e_TurretType.e_AntiAir)
{
Vector3 spawnPos = new Vector3(GetComponentInParent<TurretStats>().barrelPos[0].position.x,
GetComponentInParent<TurretStats>().barrelPos[0].position.y,
GetComponentInParent<TurretStats>().barrelPos[0].position.z);

GetComponentInParent<TurretStats>().t_cycle++;

switch (GetComponentInParent<TurretStats>().t_cycle++ % 7)
{
case 1: spawnPos = GetComponentInParent<TurretStats>().barrelPos[0].position; break;
case 2: spawnPos = GetComponentInParent<TurretStats>().barrelPos[1].position; break;
case 3: spawnPos = GetComponentInParent<TurretStats>().barrelPos[2].position; break;
case 4: spawnPos = GetComponentInParent<TurretStats>().barrelPos[3].position; break;
case 5: spawnPos = GetComponentInParent<TurretStats>().barrelPos[4].position; break;
case 6: spawnPos = GetComponentInParent<TurretStats>().barrelPos[5].position; break;
}

Instantiate(GetComponentInParent<TurretStats>().bullet,
spawnPos,
GetComponentInParent<TurretStats>().barrelPos[0].rotation);
}

if (GetComponentInParent<TurretStats>().m_Ammo == 0)
{
GetComponentInParent<TurretStats>().isReloading = true;
@@ -30,20 +30,18 @@ public enum e_TurretType

void OnTriggerStay(Collider c)
{
if (c.GetComponent<Stats>())
if (c.GetComponentInParent<Stats>().isShootable == true)
{
target = c.gameObject;
Debug.Log("Hi Mr.Panda");
}
Debug.Log("Let me love you");
if(c.GetComponentInParent<Stats>())
if (c.GetComponentInParent<Stats>().isShootable == true)
{
target = c.gameObject;
}
}

void OnTriggerExit(Collider c)
{
if (c.GetComponent<Stats>())
if (c.GetComponentInParent<Stats>().isShootable == true)
target = null;
if (c.GetComponentInParent<Stats>())
if (c.GetComponentInParent<Stats>().isShootable == true)
target = null;
}

// Use this for initialization
@@ -35,3 +35,13 @@ public enum LevelState
combat,
exit,
}

public enum GameStates
{
init,
mainMenu,
gamePlay,
pause,
gameOver,
close,
}