예제 #1
0
 /// <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);
 }
예제 #2
0
 public override bool CheckInfo(BaseBuildInfo info)
 {
     return(info is PlayerBuildInfo);
 }
예제 #3
0
 /// <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));
 }
예제 #4
0
 /// <summary>
 /// 检查BuildInfo是否该由本Builder处理。用于在GetCorrectBuilder中得到正确的Builder
 /// </summary>
 /// <param name="info">给定的BuildInfo</param>
 /// <returns></returns>
 public abstract bool CheckInfo(BaseBuildInfo info);
예제 #5
0
 public override bool CheckInfo(BaseBuildInfo info)
 {
     return(info is RigidBuildInfo);
 }