public override void OnInitialize(params object[] args) { base.OnInitialize(args); LoadDefaultView("Etc/Transition", "TopTop"); view.Visible = false; view.BlocksRaycast = false; belowView = viewManager.CreateView("Etc/Transition", "BelowPopup"); belowView.Visible = false; belowView.BlocksRaycast = false; // view.CGroup.alpha = 0.0f; }
void DoEndAnim(CLView view, System.Action onEndAction = null) { view.BlocksRaycast = false; var temp = view.CGroup.DOFade(0, 0.1f); if (onEndAction != null) { temp.OnComplete(() => { onEndAction(); }); } view.Trans.localScale = Vector3.one; view.Trans.DOScale(Vector3.one * 0.9f, 0.2f); }
protected void LoadDefaultView(string location = null, string layer = null) { string loc = location; // string curlayer = layer; if (loc == null) { var attrib = (CLContextAttrib)Attribute.GetCustomAttribute(this.GetType(), typeof(CLContextAttrib)); loc = attrib.Name; view = viewManager.CreateView($"Views/{attrib.Name}", layer); } else { view = viewManager.CreateView(loc, layer); } view.BlocksRaycast = true; view.Visible = true; }
static void Main(string[] args) { NameValueCollection paths = (NameValueCollection)ConfigurationManager.GetSection("paths"); string[] pathsCatalogs = paths.AllKeys; List <DirectoryCatalog> directoryCatalogs = new List <DirectoryCatalog>(); foreach (string pathsCatalog in pathsCatalogs) { if (Directory.Exists(pathsCatalog)) { directoryCatalogs.Add(new DirectoryCatalog(pathsCatalog)); } } AggregateCatalog catalog = new AggregateCatalog(directoryCatalogs); CompositionContainer container = new CompositionContainer(catalog); CLView view = new CLView(); container.ComposeParts(view.ViewModel); view.Run(); }
// HashSet<CLView> hash = new HashSet<CLView>(); public CLView CreateView(string name, string layer = null) { if (layer == null) { layer = Layers[0].name; } var layerTrans = (from item in Layers where item.name == layer select item).FirstOrDefault(); if (layerTrans == null) { throw new System.Exception($"No layer name called={layer}"); } var res = Resources.Load <GameObject>(name); var created = GameObject.Instantiate(res, layerTrans, false); var view = new CLView(created.GetComponent <Transform>()); // created.AddComponent<CanvasGroup>(); container.InjectGameObject(created); return(view); }