Ejemplo n.º 1
0
    public GameObject LoadView(string tPath, Transform tParent = null)
    {
        GameObject viewObj   = _AssetManager.GetGameObject(tPath);
        Transform  viewTrans = viewObj.transform;

        if (tParent != null)
        {
            viewTrans.SetParent(tParent);
        }
        else
        {
            viewTrans.SetParent(mViewRootTrans);
        }
        viewTrans.localScale    = Vector3.one;
        viewTrans.localPosition = Vector3.zero;

        mViewObjs.Add(viewObj);

        ViewBase mViewBase = viewObj.GetComponent <ViewBase>();

        mViewBase.RecordLoadPath(tPath);
        ViewAttr mViewAttr = viewObj.GetComponent <ViewAttr>();
        ViewRoot mViewRoot = mViewRootDic[mViewAttr.mViewType];

        mViewRoot.AddChild(mViewAttr);
        return(viewObj);
    }
Ejemplo n.º 2
0
    /// <summary>
    /// 同意解散请求
    /// </summary>
    private void ConfirmDisloveHandler()
    {
        var disloveC2S = new DissloveRoomConfirmC2S();

        NetMgr.Instance.SendBuff(SocketType.BATTLE, MsgNoC2S.DISSLOVEROOM_CONFIRM_C2S.GetHashCode(), 0, disloveC2S, false);
        //UIManager.Instance.HideUI(UIViewID.DISLOVE_APPLY_VIEW);
        ViewRoot.SetActive(false);
    }
Ejemplo n.º 3
0
 public BattleVM(ViewRoot root)
 {
     backButton = new BackButtonVM();
     skillInfo  = new SkillInfoVM();
     skillCutIn = new SkillCutInVM();
     root.Bind(backButton);
     root.Bind(skillInfo);
     root.Bind(skillCutIn);
 }
Ejemplo n.º 4
0
 private View(ViewRoot viewRoot, ConfigSpec configSpec, ProductId productId, TargetVersion targetVersion, SrBranchName srBranchName, string build, ViewType?viewType)
 {
     ViewRoot      = viewRoot;
     ConfigSpec    = configSpec;
     ProductId     = productId;
     TargetVersion = targetVersion;
     SrBranchName  = srBranchName;
     Build         = build;
     ViewType      = viewType;
 }
Ejemplo n.º 5
0
    public void UpdateView(ViewAttr tViewAttr)
    {
        if (!mViewObjs.Contains(tViewAttr.gameObject))
        {
            return;
        }
        ViewRoot mViewRoot = mViewRootDic[tViewAttr.mViewType];

        mViewRoot.UpdateChild(tViewAttr);
    }
Ejemplo n.º 6
0
        /// <summary>
        ///     Starts this
        ///     <code>Application</code>
        ///     .
        /// </summary>
        public void Start( )
        {
            ViewRoot.Content = PrepareViewRoot ? .Invoke( );

            Console.KeyPressed  += KeyWatcherOnKeyPressed;
            Console.SizeChanged += Console_SizeChanged;
            Console.Start( );

            ViewRoot.Enabled = true;
            ViewRoot.ResumeRedraw( );
        }
Ejemplo n.º 7
0
    public void UnLoadView(ViewAttr tViewAttr)
    {
        if (!mViewObjs.Contains(tViewAttr.gameObject))
        {
            return;
        }
        mViewObjs.Remove(tViewAttr.gameObject);
        ViewRoot mViewRoot = mViewRootDic[tViewAttr.mViewType];

        mViewRoot.RemoveChild(tViewAttr);
    }
Ejemplo n.º 8
0
    void Awake()
    {
        mViewRootTrans = GameObject.Find("Facade/UIRoot").transform;

        mViewRootDic = new Dictionary <ViewTypeEnum, ViewRoot>();
        for (ViewTypeEnum i = ViewTypeEnum.main; i < ViewTypeEnum.loadingcircle; i++)
        {
            int baseIndex = (int)i;
            mViewRootDic[i] = new ViewRoot(baseIndex * 1000, (baseIndex + 1) * 1000);
        }
    }
Ejemplo n.º 9
0
        public void BindVM(BattleData data)
        {
            ViewRoot      root        = Object.FindObjectOfType <ViewRoot>();
            List <UnitVM> playerUnits = CreateUnitVMList(data.PlayerUnit.GetData());
            List <UnitVM> rivalUnits  = CreateUnitVMList(data.RivalUnit.GetData());

            this.unitListVM = new UnitListVM(playerUnits, rivalUnits);
            this.battleVM   = new BattleVM(root);
            this.guideVM    = new GuideVM()
            {
                GuideText = ""
            };
            root.Bind(this.unitListVM);
            root.Bind(this.guideVM);
            root.SetContext();
        }
Ejemplo n.º 10
0
        public static View LoadView(string directory)
        {
            var wdv = CommandLineExecutor.ExecuteCleartool("pwv -wdview")
                      .Replace("Working directory view: ", string.Empty)
                      .Trim();

            if (wdv.Contains("** NONE"))
            {
                return(null);
            }
            var localRoot = CommandLineExecutor.ExecuteCleartool("pwv -root").Trim();
            var stgPath   = CommandLineExecutor.ExecuteCleartool($"lsview {wdv}").Split(' ').Last().Trim();
            var root      = new ViewRoot(localRoot, stgPath);
            var cs        = root?.GetConfigSpec();
            var type      = cs?.GetViewType();
            var view      = type == null?View.Unknown(root, cs)
                                : type.Value == ViewType.Sr ? View.Sr(root, cs, cs.GetProductId(), cs.GetTargetVersion(), cs.GetSrBranchName())
                : type.Value == ViewType.Build ? View.Bld(root, cs, cs.GetProductId(), cs.GetTargetVersion(), cs.GetBuild())
                : null;

            return(view);
        }
Ejemplo n.º 11
0
        public static ConfigSpec GetConfigSpec(this ViewRoot src)
        {
            var rawConfigSpec = new ConfigSpec(File.ReadAllLines(Path.Combine(src.ServerAccessPath, "config_spec")));

            return(rawConfigSpec.FormatCs());
        }
Ejemplo n.º 12
0
 public static View Unknown(ViewRoot viewRoot, ConfigSpec configSpec)
 {
     return(new View(viewRoot, configSpec, null, null, null, null, null));
 }
Ejemplo n.º 13
0
 public override void OnHide()
 {
     base.OnHide();
     UIManager.Instance.HidenDOTween(ViewRoot.GetComponent <RectTransform>(), null);
     //   ApplicationFacade.Instance.RemoveMediator(Mediators.DISLOVESTATISTICS_VIEW_MEDIATOR);
 }
Ejemplo n.º 14
0
 public override void OnShow()
 {
     base.OnShow();
     UIManager.Instance.ShowUIMask(UIViewID.DISLOVE_STATISTICS_VIEW);
     UIManager.Instance.ShowDOTween(ViewRoot.GetComponent <RectTransform>());
 }
Ejemplo n.º 15
0
 public static View Sr(ViewRoot viewRoot, ConfigSpec configSpec, ProductId productId, TargetVersion targetVersion, SrBranchName srBranchName)
 {
     return(new View(viewRoot, configSpec, productId, targetVersion, srBranchName, null, Model.ViewType.Sr));
 }
Ejemplo n.º 16
0
 private void Awake()
 {
     m_instace = this;
 }
Ejemplo n.º 17
0
 private void Console_SizeChanged(object sender, ConsoleSizeChangedEvnetArgs e)
 => ViewRoot.RequestUpdateDisplay( );
Ejemplo n.º 18
0
 public override void OnHide()
 {
     UIManager.Instance.HidenDOTween(ViewRoot.GetComponent <RectTransform>(), base.OnHide);
 }
Ejemplo n.º 19
0
 public static View Bld(ViewRoot viewRoot, ConfigSpec configSpec, ProductId productId, TargetVersion targetVersion, string build)
 {
     return(new View(viewRoot, configSpec, productId, targetVersion, null, build, Model.ViewType.Build));
 }