// Use this for initialization void Start() { Assert.IsNotNull(mainBody); Assert.IsNotNull(teamAttribute); Assert.IsNotNull(healthAttribute); Assert.IsNotNull(movementAttribute); privCheckLayer(); if (tag == "Player") { playerIdentity = this; } OnSpawn.Invoke(); }
// Update is called once per frame void Update() { if (user != null && !prevEquiped) { OnEquiped.Invoke(); prevEquiped = true; } else if (user == null && prevEquiped) { OnDequiped.Invoke(); prevEquiped = false; user = null; } }
public void inflict(AttackInfo attackInfo) { Abstract_Identity activator = attackInfo.activator; // Victim must be human Human_Identity victim = attackInfo.victim.GetComponent <Human_Identity>(); if (victim != null) { Infection victimInfectionComponent = victim.getInfectionComponent(); Assert.IsNotNull(victimInfectionComponent); Zombie_Identity activatorZomb = (Zombie_Identity)activator; Assert.IsNotNull(activatorZomb); // Infect float infectiousness = activatorZomb.GetInfectiousness(); victimInfectionComponent.addInfection(infectiousness, activatorZomb); } }
public void inflict(AttackInfo attackInfo) { if (attackInfo.activator == null) { attackInfo.activator = World_Identity.singleton; } Assert.IsNotNull(attackInfo.activator); Assert.IsNotNull(attackInfo.victim); Abstract_Identity activator = attackInfo.activator; Abstract_Identity victim = attackInfo.victim.GetComponent <Abstract_Identity>(); // Hit character if (victim != null) { victim.getHealthComponent().subtractHealth(new DamageInfo(attackInfo.damage, activator.transform.position - victim.transform.position, activator)); } else { } }
public void setUser(Abstract_Identity newUser) { user = newUser; }
public AttackInfo(Abstract_Identity _activator) { activator = _activator; posImpact = new Vector2(); }
public DamageInfo(float _damageAmount, Vector2 _direction, Abstract_Identity _activator) { damageAmount = _damageAmount; direction = _direction; activator = _activator; }