- Removed useless comments.

This commit is contained in:
samJa 2015-08-20 14:13:05 -04:00
parent 3a5294091b
commit 909eb9c31f
2 changed files with 11 additions and 64 deletions

View File

@ -48,17 +48,6 @@ public class Squad : Unit
_timer = 0f;
}
//void Awake()
//{
/* InitializeSquad();
InitializeDefaultTagAndLayer();
CurrentHP = 255;
Debug.Log("Current HP" + CurrentHP) ;
Attack = ComputeAttackDamage();
_enemySquad = null;
_timer = 0f;*/
//}
// Update is called once per frame
void Update ()
{
@ -79,17 +68,13 @@ public class Squad : Unit
if (_numberOfAliveSoldiers > 0) return;
// first release all humans ...
AbandonUnits(Humans.Count);
// then we destroy the squad
//DestroyUnit();
IsDead = true;
}
void OnTriggerEnter(Collider collider)
{
if (IsDead) return;
//var objectTag = collider.gameObject;
// check if the game object have an attached Unit class
//switch(objectTag.GetType())
var unitComponent = collider.GetComponent<Unit>();
if (unitComponent == null)
@ -113,31 +98,20 @@ public class Squad : Unit
{
if (unitComponent.IsDead)
return;
_playerInRange = true;
_enemySquad = collider.GetComponent<Squad>();
/* try
{
AttackEnemySquad(unitComponent as Squad);
}
catch (InvalidCastException exception)
{
Debug.LogError(exception.ToString());
//throw;
}*/
}
}
void OnTriggerExit(Collider collider)
{
if (collider.gameObject.tag != Tag && collider.gameObject.tag != TagLayerManager.Human)
{
_playerInRange = false;
this.gameObject.GetComponent<CharacterBehavior>().PlayAttackAnimation(false);
_enemySquad = null;
// collider.GetComponent<CharacterBehavior>().PlayAttackAnimation(false);
}
if (collider.gameObject.tag == Tag || collider.gameObject.tag == TagLayerManager.Human)
return;
_playerInRange = false;
this.gameObject.GetComponent<CharacterBehavior>().PlayAttackAnimation(false);
_enemySquad = null;
}
#endregion
@ -308,17 +282,6 @@ public class Squad : Unit
humanUnit.Tag = Tag;
AddSoldier(humanUnit as Squad);
// AddSoldier((VampireSquad) humanUnit) ) (VampireSquad or ZombieSquad)
/*if (Tag.Equals(TagLayerManager.VampirePlayer))
{
// add the vampire to the soldier list
AddSoldier((VampireSquad) humanUnit);
}
else
{
// add the zombie to the soldier list
AddSoldier((ZombieSquad)humanUnit);
}*/
}
}
else
@ -374,10 +337,6 @@ public class Squad : Unit
soldier.GetComponent<CharacterBehavior>().PlayAttackAnimation(false);
}
}
//TODO improve this method add the total of squad damage or to compute the reduce of hp, etc...
// compute the amount of hp reduced to this unit
//unit.Hp -= Attack; // we remove some hp of the unit that was
// targettedEnemySquad.ReceiveDamage(ComputeAttackDamage());
}
/// <summary>

View File

@ -38,10 +38,6 @@ public class Unit : MonoBehaviour
void Update()
{
/* if (IsDead)
{
DestroyUnit(DyingTime);
}*/
if (IsCaptured)
{
var gapVector = new Vector3(TargetDestination.position.x + DestinationGap, TargetDestination.position.y,TargetDestination.position.z + DestinationGap);
@ -63,7 +59,7 @@ public class Unit : MonoBehaviour
isDamaged = true;
CurrentHP -= amountOfDamage;
// HealthSlider.value = CurrentHP;
//HealthSlider.value = CurrentHP;
// TODO play hurt animation
// TODO play hurt sound
@ -77,7 +73,7 @@ public class Unit : MonoBehaviour
public void Death()
{
IsDead = true;
_character.PlayDeathAnimation();
//_character.PlayDeathAnimation();
// TODO play death sound
// TODO disable this gameobject movements.
Debug.Log("Entered death function!");
@ -105,12 +101,10 @@ public class Unit : MonoBehaviour
{
//TODO First play dead animation
// retrieve the character behavior object, so that we can access it's animation properties...
//var character = GetComponent<CharacterBehavior>();
// play the death animation
//character.PlayDeathAnimation();
_character.PlayDeathAnimation();
yield return new WaitForSeconds(_character.CurrrentAnimationLength());
// then destroy the game object only 3 seconds after the animation
//Destroy(this.transform.gameObject, dyingTime);
}
@ -124,12 +118,6 @@ public class Unit : MonoBehaviour
set
{
_currentHp = value > StartingHealth ? StartingHealth : value;
/* if (CurrentHP <= 0)
{
IsDead = true;
StartCoroutine(DestroyUnit(DyingTime));
}*/
}
}