void Awake() { // Setting the current health when the enemy first spawns. _currentHealth = startingHealth; mustDestroy = new DispatchOnChange <bool>(GetInstanceID()); mustDestroy.NotifyOnValueSet(OnDestroyed); }
void Awake() { position = transform.position; amount = healthBonus; destroyed = new DispatchOnChange <bool>(GetInstanceID()); destroyed.NotifyOnValueSet(OnDestroyed); }
/// <summary> /// Add and Remove callbacks are enabled by the IReactOnAddAndRemove interface /// They are called when: /// an Entity is built in a group (no swap case) /// an Entity is removed from a group (no swap case) /// </summary> /// <param name="entityViewStruct">the up to date entity</param> /// <param name="previousGroup">where the entity is coming from</param> public void Add(ref EnemyAttackEntityViewStruct entityViewStruct, EGID egid) { var dispatchOnChange = new DispatchOnChange <EnemyCollisionData>(egid); dispatchOnChange.NotifyOnValueSet(_onCollidedWithTarget); entityViewStruct.targetTriggerComponent.hitChange = dispatchOnChange; }
private void Awake() { playerTransform = transform; selection = new DispatchOnChange <HexCoordinates>(gameObject.GetInstanceID()); cellClick = new DispatchOnSet <HexCoordinates>(gameObject.GetInstanceID()); pass = new DispatchOnSet <bool>(gameObject.GetInstanceID()); abilitySelected = new DispatchOnSet <int>(gameObject.GetInstanceID()); cancel = new DispatchOnSet <bool>(gameObject.GetInstanceID()); }
private void Awake() { unitTransform = transform; anim = GetComponent <Animator>(); isMyTurn = new DispatchOnSet <bool>(gameObject.GetInstanceID()); currentAbility = new DispatchOnSet <int>(gameObject.GetInstanceID()); maxMove = 5; moveCounter = new DispatchOnChange <int>(gameObject.GetInstanceID()); state = new DispatchOnSet <UnitTurnState>(gameObject.GetInstanceID()); }
private void Awake() { currentHealth = new DispatchOnChange <int>(gameObject.GetInstanceID()); maxHealth = new DispatchOnChange <int>(gameObject.GetInstanceID()); }