//初始化属性 获取物体 组件 protected void InitAttribute() { _hpSlider = GameTool.GetComFromObjectsChild <Slider>(_entityGameObject, "Slider"); _hpTextCom = GameTool.GetComFromObjectsChild <Text>(_entityGameObject, "Text"); _hpCanvas = GameTool.FindGameObjectByParent(_entityGameObject, "Canvas"); _canvasInitScale = _hpCanvas.transform.localScale; _maxHp = _currentHp = 1000; _moveSpeed = 10; _isActive = false; }