/// <summary> /// 通过给定BuildInfo,得到正确的Builder /// </summary> /// <param name="info">给定的BuildInfo</param> /// <returns></returns> public IBuilderNode GetCorrectBuilder(BaseBuildInfo info) { if (CheckInfo(info)) { //Debug.Log($"由 {GetType().Name} 构建对象"); return(this); } if (Next != null) { return(Next.GetCorrectBuilder(info)); } return(null); }
public override bool CheckInfo(BaseBuildInfo info) { return(info is PlayerBuildInfo); }
/// <summary> /// 给定BuildInfo和BuildType,构建BaseStageObject /// </summary> /// <param name="info">给定的BuildInfo</param> /// <param name="type">给定的BuildType</param> /// <returns></returns> public BaseStageObject Build(BaseBuildInfo info, BuildType type = BuildType.Client) { return(Build((Tinfo)info, type)); }
/// <summary> /// 检查BuildInfo是否该由本Builder处理。用于在GetCorrectBuilder中得到正确的Builder /// </summary> /// <param name="info">给定的BuildInfo</param> /// <returns></returns> public abstract bool CheckInfo(BaseBuildInfo info);
public override bool CheckInfo(BaseBuildInfo info) { return(info is RigidBuildInfo); }