コード例 #1
0
ファイル: ShowEnemyStats.cs プロジェクト: metorres89/3d-game
 public void Start()
 {
     myCanvas      = gameObject.transform.Find("Canvas").GetComponent <Canvas>();
     myPlayer      = GameObject.Find("Player");
     myHealthState = gameObject.GetComponent <HealthState> ();
     healthBar.Init("", myHealthState.initialHealthPoints);
 }
コード例 #2
0
    void Start()
    {
        GameObject goPlayer = GameObject.FindWithTag("Player");

        myPlayerState = goPlayer.GetComponent <PlayerState> ();
        myPlayerShoot = goPlayer.GetComponent <PlayerShoot> ();

        healthBar.Init("Life: %", myPlayerState.initialHealthPoints);
        staminaBar.Init("Stamina: %", myPlayerState.GetStaminaState().initialStaminaPoints);
    }