private void LoadLifeBar() { GameObject _go = ResourceManager.Instance.LoadNewPrefab("UILifeBar2",UIMgr.Instance.GetLayer(UIMgr.Layer.layer2)); _go.name = "UILifeBar_" + Enity.GetProperty("name"); barTransfrom = _go.transform as RectTransform; _uilifeBar = barTransfrom.GetComponent<UILifeBar2>(); if(_uilifeBar == null) { _uilifeBar = barTransfrom.gameObject.AddComponent<UILifeBar2>(); } _uilifeBar._camera = Enity.GetProperty("camera") as Camera; _uilifeBar._actor = Enity.Transform; }
private void LoadLifeBar() { GameObject _go = ResourceManager.Instance.LoadNewPrefab("UILifeBar2", UIMgr.Instance.GetLayer(UIMgr.Layer.layer2)); _go.name = "UILifeBar_" + Enity.GetProperty("name"); barTransfrom = _go.transform as RectTransform; _uilifeBar = barTransfrom.GetComponent <UILifeBar2>(); if (_uilifeBar == null) { _uilifeBar = barTransfrom.gameObject.AddComponent <UILifeBar2>(); } _uilifeBar._camera = Enity.GetProperty("camera") as Camera; _uilifeBar._actor = Enity.Transform; }