protected override void OnInitialize() { this.properties = gameObject.GetComponent <PropertiesComponent>(); this.behaviours = gameObject.GetComponent <BehavioursComponent>(); HealthComponent.AnyEntityDamaged += OnAnyEntityDamaged; }
protected override void OnInitialize() { this.attributes = GetComponent <AttributesComponent>(); this.properties = GetComponent <PropertiesComponent>(); var actionPoints = new Resource(gameObject, I18N.Instance.Get("resource_action_points"), ResourceType.ActionPoint, 10, 10); actionPoints.Changed += OnActionPointsChanged; var rage = new Resource(gameObject, I18N.Instance.Get("resource_rage"), ResourceType.Rage, 0, 100); rage.Changed += OnRageChanged; this.resources.Add(ResourceType.ActionPoint, actionPoints); this.resources.Add(ResourceType.Rage, rage); var actionPointsProperty = this.properties.Get(PropertyType.MaximumActionPoints); actionPointsProperty.Changed += OnMaxActionPointsChanged; OnMaxActionPointsChanged(actionPointsProperty); HealthComponent.AnyEntityHealed += OnEntityHealed; HealthComponent.AnyEntityDamaged += OnEntityDamaged; BehavioursComponent.AnyBehaviourApplied += OnAnyBehaviourApplied; Episode.AnyEpisodeStarted += OnAnyEpisodeInitialized; GameState.AnyGameStateEnter += OnAnyGameStateEnter; CombatEncounter.AnyCombatEnded += OnAnyCombatEnded; CombatEncounter.AnyCombatRoundStarted += OnAnyCombatRoundStarted; }
protected override void OnInitialize() { Item.AnyItemStatsUpdated += OnAnyItemStatsUpdated; this.experience = GetComponent <ExperienceComponent>(); this.inventory = GetComponent <InventoryComponent>(); this.attributes = GetComponent <AttributesComponent>(); this.properties = GetComponent <PropertiesComponent>(); this.behaviours = GetComponent <BehavioursComponent>(); this.actor = GetComponent <ActorComponent>(); }