private void CheckHole() { var tileType = tileMapInfo.GetTileType(botEntity.transform.position); if (tileType == TileType.Hole) { Hp = new BotHp(0); } }
public BotApplication(BotEntity botEntity, BotEntityAnimation botEntityAnimation, TileMapInfo tileMapInfo, EventSystemWatcher eventSystemWatcher, Gun gun, MeleeAttackApplication.MeleeAttackApplication meleeAttackApplication, bool noPosFix = false) { this.botEntity = botEntity; botEntity.HitBulletEvent += (sender, e) => Hp = Hp.DamageHp(1); this.botEntityAnimation = botEntityAnimation; this.tileMapInfo = tileMapInfo; Hp = new BotHp(3); this.meleeAttackApplication = meleeAttackApplication; this.noPosFix = noPosFix; this.eventSystemWatcher = eventSystemWatcher; this.gun = gun; }
//Hpを描画する public void RenderHp(BotHp botHp) { if (heartObjects.Count > botHp.hp) { if (heartObjects.Count > 0) { GameObject disHeart = heartObjects.Pop(); Destroy(disHeart); } } else if (heartObjects.Count < botHp.hp) { GameObject incHeart = Instantiate(heartPrefab); RectTransform rectTransform = incHeart.GetComponent <RectTransform>(); rectTransform.SetParent(GetComponent <RectTransform>(), false); rectTransform.anchoredPosition = latestHeartPosition; latestHeartPosition += heartPosition; heartObjects.Push(incHeart); } }