Skip to content

Commit

Permalink
ahhhhhhhhhhh sleeeeeeeeeeeep?
Browse files Browse the repository at this point in the history
  • Loading branch information
V4ll3V committed Apr 18, 2016
1 parent 61bd026 commit 6f31d06
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 34 deletions.
37 changes: 27 additions & 10 deletions Assets/Scripts/EnemyComponent.cs
Expand Up @@ -53,6 +53,7 @@ public void Update()
AttackPlayer();
if (transform.position.y <= -20)
Destroy(transform.parent.gameObject);

}
public void AttackPlayer()
{
Expand All @@ -66,29 +67,31 @@ public void AttackPlayer()
}
else
{
SpriteAnimator.SetBool("OnWalk", false);
HeadSprite.gameObject.SetActive(true);
//SpriteAnimator.SetBool("OnWalk", false);
//HeadSprite.gameObject.SetActive(true);
}
}

public void OnParticleCollision(GameObject other)
{
Debug.Log(_gameEntity.GetModule<EnemyModule>().BaseData.CurrentMusicType.Value + " | " + other.name);
if (CheckToKill(other.name))
Debug.Log(CheckToKill(other.name, _gameEntity.GetModule<EnemyModule>().BaseData.CurrentMusicType.Value));
if (CheckToKill(other.name, _gameEntity.GetModule<EnemyModule>().BaseData.CurrentMusicType.Value))
{
Destroy(transform.parent.gameObject);
}
}

public bool CheckToKill(String MusikType)
public bool CheckToKill(String AttckerMusicType , String VictimMusicType )
{
if (MusikType.Contains(MusicTypes.metal.ToString()) && _gameEntity.GetModule<EnemyModule>().BaseData.CurrentMusicType.Value == MusicTypes.techno.ToString())
if (AttckerMusicType.Contains(MusicTypes.metal.ToString()) && VictimMusicType.Contains(MusicTypes.techno.ToString()))
{
return true;
}
else if (MusikType.Contains(MusicTypes.classic.ToString()) && _gameEntity.GetModule<EnemyModule>().BaseData.CurrentMusicType.Value == MusicTypes.metal.ToString())
else if (AttckerMusicType.Contains(MusicTypes.classic.ToString()) && VictimMusicType.Contains(MusicTypes.metal.ToString()))
{
return true;
}
else if (MusikType.Contains(MusicTypes.techno.ToString()) && _gameEntity.GetModule<EnemyModule>().BaseData.CurrentMusicType.Value == MusicTypes.classic.ToString())
else if (AttckerMusicType.Contains(MusicTypes.techno.ToString()) && VictimMusicType.Contains(MusicTypes.classic.ToString()))
{
return true;
}
Expand All @@ -100,10 +103,24 @@ public bool CheckToKill(String MusikType)
public void OnTriggerStay(Collider other)
{
PlayerComponent comp = other.gameObject.GetComponentInChildren<PlayerComponent>();
if (comp != null && _gameEntity.GetModule<EnemyModule>().BaseData.CurrentMusicType.Value != comp.GameEntity.GetModule<PlayerModule>().BaseData.CurrentMusicType.Value)
if (comp != null && CheckToKill(_gameEntity.GetModule<EnemyModule>().BaseData.CurrentMusicType.Value, comp.GameEntity.GetModule<PlayerModule>().BaseData.CurrentMusicType.Value))
{
_target = comp.Spotlight.gameObject;
else if (comp != null && _gameEntity.GetModule<EnemyModule>().BaseData.CurrentMusicType.Value == comp.GameEntity.GetModule<PlayerModule>().BaseData.CurrentMusicType.Value)
}
else if (comp != null)
{
_target = null;
if (_gameEntity.GetModule<EnemyModule>().BaseData.CurrentMusicType.Value != comp.GameEntity.GetModule<PlayerModule>().BaseData.CurrentMusicType.Value)
{
SpriteAnimator.SetBool("OnWalk", true);
HeadSprite.gameObject.SetActive(false);
}
else
{
SpriteAnimator.SetBool("OnWalk", false);
HeadSprite.gameObject.SetActive(true);
}
}
}
}
}
1 change: 0 additions & 1 deletion Assets/Scripts/PlayerComponent.cs
Expand Up @@ -87,7 +87,6 @@ private void Update()
_gameEntity.GetModule<PlayerModule>().BaseData.MusicHealthMeter -= 0.1f;
UiFillBar.reduceByAmount(0.1f);
}
Debug.Log(_gameEntity.GetModule<PlayerModule>().BaseData.MusicHealthMeter);
if (CoolDownTimer >= 0)
CoolDownTimer -= Time.deltaTime;
else
Expand Down
24 changes: 1 addition & 23 deletions Assets/Test.unity
Expand Up @@ -172,12 +172,6 @@ RectTransform:
m_PrefabParentObject: {fileID: 22455012, guid: 274f394d5ddef554ca7c1dafcfb06e78,
type: 2}
m_PrefabInternal: {fileID: 128306320}
--- !u!114 &15738192 stripped
MonoBehaviour:
m_PrefabParentObject: {fileID: 11444466, guid: 274f394d5ddef554ca7c1dafcfb06e78,
type: 2}
m_PrefabInternal: {fileID: 128306320}
m_Script: {fileID: 11500000, guid: 139f7f6bb50d79742b7d0c3632bf9179, type: 3}
--- !u!1001 &128306320
Prefab:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -261,22 +255,6 @@ Prefab:
propertyPath: PowerMeter
value:
objectReference: {fileID: 1026483512}
- target: {fileID: 11435368, guid: 274f394d5ddef554ca7c1dafcfb06e78, type: 2}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_CallState
value: 2
objectReference: {fileID: 0}
- target: {fileID: 11435368, guid: 274f394d5ddef554ca7c1dafcfb06e78, type: 2}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 15738192}
- target: {fileID: 11435368, guid: 274f394d5ddef554ca7c1dafcfb06e78, type: 2}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: backToMainMenu
objectReference: {fileID: 0}
- target: {fileID: 11405050, guid: 274f394d5ddef554ca7c1dafcfb06e78, type: 2}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_CallState
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 274f394d5ddef554ca7c1dafcfb06e78, type: 2}
m_IsPrefabParent: 0
Expand Down Expand Up @@ -457,7 +435,7 @@ MonoBehaviour:
Detail: 150
Delay: 5
rampOffset: -0.11
Radius: 0.14
Radius: 0.1
Beat: 1.814014
--- !u!1001 &436982730
Prefab:
Expand Down

0 comments on commit 6f31d06

Please sign in to comment.