コード例 #1
0
ファイル: ForChildModel.cs プロジェクト: Costie92/UnityRun
 private void Awake()
 {
     iChildModel = transform.parent.gameObject.GetComponent <IChildModel>();
     if (iChildModel == null)
     {
         Debug.Log("IChildModel 인터페이스 추출 불가");
     }
 }
コード例 #2
0
        public async Task <IParentModel> GetModelParentAsync(IChildModel model)
        {
            IParentModel parent = null;

            if (model.GameId > 0)
            {
                parent = (await GetGamesAsync()).FirstOrDefault(x => x.Id == model.GameId);
            }
            if (model.DeveloperId > 0)
            {
                parent = (await GetDevelopersAsync()).FirstOrDefault(x => x.Id == model.DeveloperId);
            }
            if (model.TopicId > 0)
            {
                parent = (await GetTopicsAsync()).FirstOrDefault(x => x.Id == model.TopicId);
            }
            if (parent == null)
            {
                throw new Exception("No parent!");
            }
            return(parent);
        }
コード例 #3
0
 public Uri ParentFilesUrl(IChildModel childModel, bool absolute = false)
 {
     return(ParentFilesUrl(childModel.Parent, absolute));
 }
コード例 #4
0
ファイル: BaseUrlManager.cs プロジェクト: crazyants/BioEngine
 public Uri ParentIconUrl(IChildModel child)
 {
     return(ParentIconUrl((dynamic)child.Parent));
 }
コード例 #5
0
 public Uri ParentNewsUrl(IChildModel news, int?page = null, bool absolute = false)
 {
     return(ParentNewsUrl(news.Parent, page, absolute));
 }