Exemplo n.º 1
0
        /// <summary>
        /// Sets the collected aliases to specified index in the given spanshot.
        /// </summary>
        /// <param name="memoryIndex">Index of the memory.</param>
        /// <param name="snapshot">The snapshot.</param>
        /// <param name="isMust">if set to <c>true</c> uses must and may aliases otherwise all must aliases are invalidated.</param>
        internal void SetAliases(MemoryIndex memoryIndex, IReferenceHolder snapshot, bool isMust)
        {
            if (allReferences.Count == 0)
            {
                return;
            }

            if (!isMust)
            {
                InvalidateMust();
            }

            HashSet <MemoryIndex> mayReferences = new HashSet <MemoryIndex>();

            CopyMayReferencesTo(mayReferences);

            foreach (MemoryIndex mustAlias in mustReferences)
            {
                snapshot.AddAlias(mustAlias, memoryIndex, null);
            }

            foreach (MemoryIndex mayAlias in mayReferences)
            {
                snapshot.AddAlias(mayAlias, null, memoryIndex);
            }

            snapshot.AddAliases(memoryIndex, mustReferences, mayReferences);
        }
Exemplo n.º 2
0
        // Token: 0x06000098 RID: 152 RVA: 0x00005724 File Offset: 0x00003924
        public override void DoStart()
        {
            GameObject gameObject  = GameObject.Find("Canvas");
            GameObject gameObject2 = Resources.Load <GameObject>("UI/" + UIDefine.UIRoot.resDir);
            bool       flag        = gameObject2 == null;

            if (flag)
            {
                Debug.LogError("Can not load UIRoot !" + UIDefine.UIRoot.resDir);
            }
            GameObject       gameObject3 = Object.Instantiate <GameObject>(gameObject2, gameObject.transform);
            IReferenceHolder component   = gameObject3.GetComponent <IReferenceHolder>();

            this.normalParent  = component.GetRef <Transform>("TransNormal");
            this.forwardParent = component.GetRef <Transform>("TransForward");
            this.importParent  = component.GetRef <Transform>("TransNotice");
            Debug.Log("UIStart ", null);
            bool isDebugMode = this.IsDebugMode;

            if (isDebugMode)
            {
                this.OpenWindow(UIDefine.UILoading, null);
            }
            else
            {
                this.OpenWindow(UIDefine.UILogin, null);
            }
        }
Exemplo n.º 3
0
 public static void Synchronize <T>(this IReferenceHolder <T> referenceHolder, IEventTrigger evnt, bool evenDefault)
 {
     referenceHolder.OnReferenceSet.Register(evnt);
     if (evenDefault || SafeNotDefault(referenceHolder.CurrentReference))
     {
         evnt.Trigger();
     }
 }
Exemplo n.º 4
0
        public void AddReferenceHolder(IReferenceHolder referenceHolder)
        {
            int id = referenceHolder.ReferencedId;

            if (!m_ReferenceHolders.ContainsKey(id))
            {
                m_ReferenceHolders[id] = new List <IReferenceHolder>();
            }
            m_ReferenceHolders[id].Add(referenceHolder);
            if (m_Redirections.ContainsKey(id))
            {
                referenceHolder.ReferencedId = m_Redirections[id];
            }
        }
Exemplo n.º 5
0
 protected virtual void Awake()
 {
     _referenceHolder = GetComponent <IReferenceHolder>();
     Debug.Assert(_referenceHolder != null, GetType() + " miss IReferenceHolder ");
 }
Exemplo n.º 6
0
 public static void Synchronize <T>(this IReferenceHolder <T> referenceHolder, System.Action <T> evnt, params IEventValidator[] validators)
 {
     Synchronize(referenceHolder, new ActionEventCapsule <T>(evnt), validators);
 }
Exemplo n.º 7
0
 public static void Synchronize <T>(this IReferenceHolder <T> referenceHolder, System.Action <T> evnt, System.Func <bool> validation)
 {
     Synchronize <T>(referenceHolder, new ConditionalEventListener <T>(evnt, () => validation()));
 }
Exemplo n.º 8
0
 public static void Synchronize <T>(this IReferenceHolder <T> referenceHolder, System.Action <T> evnt)
 {
     Synchronize(referenceHolder, new ActionEventCapsule <T>(evnt));
 }
Exemplo n.º 9
0
    public static void Synchronize <T>(this IReferenceHolder <T> referenceHolder, IEventTrigger evnt, params IEventValidator[] validators)
    {
        var vals = validators.GetCurrentValidators();

        Synchronize(referenceHolder, new ConditionalEventListener(evnt, () => vals.And() && evnt.IsValid));
    }
Exemplo n.º 10
0
 public static void Synchronize <T>(this IReferenceHolder <T> referenceHolder, IEventTrigger evnt, System.Func <bool> validation)
 {
     Synchronize(referenceHolder, new ConditionalEventListener(evnt, () => validation() && evnt.IsValid));
 }
Exemplo n.º 11
0
 public static void Synchronize <T>(this IReferenceHolder <T> referenceHolder, IEventTrigger evnt)
 {
     Synchronize(referenceHolder, evnt, true);
 }
Exemplo n.º 12
0
 public static void Synchronize <T>(this IReferenceHolder <T> referenceHolder, System.Action evnt, bool evenDefault)
 {
     Synchronize(referenceHolder, new ActionEventCapsule(evnt), evenDefault);
 }