void Start() { boxClollider = gameObject.AddComponent <BoxCollider>(); boxClollider.isTrigger = false; chScript = gameObject.AddComponent <CollisionHandler>(); dpScript = gameObject.AddComponent <DeathProtocol>(); hcScript = gameObject.AddComponent <HealthContainer>(); }
public UIProfile(GameObject gameObject) : base(gameObject) { UIReferencing referencing = gameObject.GetComponent <UIReferencing>(); this.localScore = referencing.localScore; this.localScore.label.text = "YOUR SCORE"; this.enemyScore = referencing.enemyScore; this.healthContainer = referencing.healthContainer; Object.DestroyImmediate(referencing); }
public void InitializePlayer() { Init(); transform.position = new Vector3(0, -GameController.instance.GetComponent <SheetAssigner>().verticalOffset / 5.4f, 0); // Stats maxHP = 10; hp = 3; damage = 5; speed = 1; fireRate = 15.0f; projectileCooldown = false; isHit = false; knockback = false; firing = false; projectileSpeed = 10.0f; heartContainer = GameController.instance.uiCanvas.GetChild(0).Find("HealthContainer").GetComponent <HealthContainer>(); UpdateHealthDisplay(); GameController.instance.singletons.Add(this.gameObject); }
public virtual void Awake() { _rigidbody = GetComponent <Rigidbody2D>(); _healthContainer = GetComponent <HealthContainer>(); }
public static HealthContainerWrapper Wrap(HealthContainer healthContainer) => new HealthContainerWrapper { HealthContainer = healthContainer };
public StateContainer(GameState state, IEnumerable <IStateObserver> observers, HealthContainer healthContainer) { _state = state; _reactiveState = new ReactiveProperty <GameState>(_state); foreach (var stateObserver in observers) { stateObserver.SubscribeTo(_reactiveState); } healthContainer.SubscribeTo(_reactiveState); }
private void Awake() { _strenth = GetComponent <HealthContainer>(); isExplode = false; }