コード例 #1
0
ファイル: Unit.cs プロジェクト: pwong15/GalacticBuccaneers
 public void Initialize(Character character, Tile tile)
 {
     this.Character       = character;
     tile.BoardPiece      = this.gameObject;
     this.gameObject.name = this.ToString();
     this.MoveSpeed       = character.MoveSpeed;
     this.Tile            = tile;
     this.Team            = Character.Team;
     this.Attack          = Character.Attack;
     this.Defense         = Character.Defense;
     this.Speed           = Character.MoveSpeed;
     this.MaxHealth       = Character.MaxHealth;
     this.Health          = Character.MaxHealth;
     HasDied          = false;
     _hasActed        = true;
     HasMoved         = true;
     TurnStartEffects = new List <Effect>();
     TurnEndEffects   = new List <Effect>();
     healthBar        = gameObject.GetComponentInChildren <BarController>();
     healthBar.SetMaxValue(character.MaxHealth);
     healthBar.SetMinValue(0);
     healthBar.SetValue(character.MaxHealth);
     actionMenu            = gameObject.GetComponentInChildren <PanelScript>();
     actionMenu.unit       = this;
     actionMenu.grid       = Tile.gameBoard;
     this.InjuryMultiplier = character.InjuryMultiplier;
     this.HitMultiplier    = character.HitMultiplier;
     if (Team == 0)
     {
         Image health = gameObject.transform.Find("HealthBarCanvas/healthBar/healthFill").gameObject.GetComponent <Image>();
         health.color = Color.blue;
     }
     actionMenu.HidePanel();
 }
コード例 #2
0
 void Start()
 {
     currentHealth = maxHealth;
     healthBar.SetMaxValue(maxHealth);
     panel.HidePanel();
 }