private Ctrl_SkeletonArcher_Prop _MyProperty; //该敌人的属性 private void Start() { //得到英雄、英雄的属性脚本 _HeroGO = GameObject.FindGameObjectWithTag(Tag.Tag_Player); if (_HeroGO) { _HeroProperty = _HeroGO.GetComponent<Ctrl_HeroProperty>(); } //得到该敌人、该敌人的属性脚本 _MyGO = UnityHelper.GetInstance().SelectGOWhithTag(transform, Tag.Tag_Enemy); if (_MyGO) { _MyProperty = _MyGO.GetComponent<Ctrl_SkeletonArcher_Prop>(); } }
public Ctrl_SkeletonArcher_Prop _MyProperty_S; //特有属性 #region 【重载后的自动方法】 protected override void Start() { _MyProperty_S = gameObject.GetComponent <Ctrl_SkeletonArcher_Prop>(); base.Start(); }