/* Functions */ protected virtual void Awake() { // try to get the action component by itself. if (mInvincibleTimeAction == null) { mInvincibleTimeAction = this.GetComponent <JCS_InvincibleTimeAction>(); } // Auto add, for better design plz // add "JCS_LiquidBarInfo" manually. if (mHPInfo == null) { mHPInfo = this.gameObject.AddComponent <JCS_LiquidBarInfo>(); } mHPInfo.TagName = "HP"; if (mMPInfo == null) { mMPInfo = this.gameObject.AddComponent <JCS_LiquidBarInfo>(); } mMPInfo.TagName = "MP"; if (mEXPInfo == null) { mEXPInfo = this.gameObject.AddComponent <JCS_LiquidBarInfo>(); mEXPInfo.CurrentValue = 0; } mEXPInfo.TagName = "EXP"; }
/// <summary> /// Attach 2d live object so it will follow the /// value from this object. /// </summary> /// <param name="obj"> Info for liquid bar to follow. </param> public void AttachInfo(JCS_LiquidBarInfo info) { mLiquidBar.AttachInfo(info); }
/// <summary> /// Attach 2d live object so it will follow the /// value from this object. /// </summary> /// <param name="obj"> Info for liquid bar to follow. </param> public override void AttachInfo(JCS_LiquidBarInfo info) { this.mInfo = info; UpdateInfo(); }
//======================================== // Interface-Define //------------------------------ /// <summary> /// Attach 2d live object so it will follow the /// value from this object. /// </summary> /// <param name="obj"> Info for liquid bar to follow. </param> public abstract void AttachInfo(JCS_LiquidBarInfo info);