Пример #1
0
    private void AddHpUI()
    {
        GameObject HP = null;

        HP   = Instantiate(Resources.Load("Prefab/HP", typeof(GameObject)) as GameObject);
        HpUI = HP.GetComponent <HpUI>();
        if (Type == uFantasy.Enum.BiologyType.Player)
        {
            HpUI.HPValue.sprite = Resources.Load <Sprite>("UI/ui-assets/HpGreen");
        }
        if (Type != uFantasy.Enum.BiologyType.Player)
        {
            HpUI.HPValue.sprite = Resources.Load <Sprite>("UI/ui-assets/HpRed");
        }
        HP.transform.SetParent(GameObject.Find("Canvas/HP").transform);//fixme:應該跟maingame要位置
        HP.name = name + "HP";

        HpUI.SetBio(this);
        BiologyAnimationEvent.HpUI = HpUI;
    }
Пример #2
0
//	float playerHpPercent;

    void Awake()
    {
        _instance = this;
    }