Beispiel #1
0
 private void InitPlayer()
 {
     //player load
     if (null != Player)
     {
         GameObject PlayerObject = GameObject.Instantiate(Player) as GameObject;
         PlayerObject.transform.position = new Vector3(0, 1.75f, -20.0f);
         ObjectUI objUI = PlayerObject.AddComponent <ObjectUI>();
         objUI.Init(100);
         _player = PlayerObject.GetComponent <Player>();
         _player.SetHpBar(objUI);
     }
 }
Beispiel #2
0
 public void SetHpBar(ObjectUI objectUI)
 {
     _objectUI = objectUI;
     _objectUI.Init(_hp);
 }