Exemplo n.º 1
0
        public override void TriggerLeave(PoolObjHandle <ActorRoot> src, ITrigger inTrigger)
        {
            int leaveUniqueId = this.LeaveUniqueId;

            if (leaveUniqueId > 0)
            {
                BufConsumer bufConsumer = new BufConsumer(leaveUniqueId, src, new PoolObjHandle <ActorRoot>(null));
                bufConsumer.Use();
            }
            int enterUniqueId = this.EnterUniqueId;

            if (this.bStopWhenLeaving && enterUniqueId > 0 && inTrigger != null)
            {
                AreaEventTrigger areaEventTrigger = inTrigger as AreaEventTrigger;
                if (areaEventTrigger != null)
                {
                    RefParamOperator refParamOperator = areaEventTrigger._inActors.get_Item(src.handle.ObjID).refParams[this];
                    if (refParamOperator != null)
                    {
                        ListView <string> listView   = new ListView <string>();
                        GameObject[]      refObjList = this.RefObjList;
                        if (refObjList != null)
                        {
                            int num = refObjList.Length;
                            for (int i = 0; i < num; i++)
                            {
                                listView.Add(string.Format("TriggerActionBuffTar_{0}", i));
                            }
                        }
                        if (this.bSrc)
                        {
                            listView.Add("TriggerActionBuffSrc");
                        }
                        if (this.bAtker)
                        {
                            listView.Add("TriggerActionBuffAtker");
                        }
                        ListView <string> .Enumerator enumerator = listView.GetEnumerator();
                        while (enumerator.MoveNext())
                        {
                            string current = enumerator.Current;
                            if (!string.IsNullOrEmpty(current))
                            {
                                BuffFense refParamObject = refParamOperator.GetRefParamObject <BuffFense>(current);
                                if (refParamObject != null)
                                {
                                    refParamObject.Stop();
                                }
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        public override void TriggerLeave(PoolObjHandle <ActorRoot> src, ITrigger inTrigger)
        {
            int leaveUniqueId = base.LeaveUniqueId;

            if (leaveUniqueId > 0)
            {
                new BufConsumer(leaveUniqueId, src, new PoolObjHandle <ActorRoot>(null)).Use();
            }
            int enterUniqueId = base.EnterUniqueId;

            if ((base.bStopWhenLeaving && (enterUniqueId > 0)) && (inTrigger != null))
            {
                AreaEventTrigger trigger = inTrigger as AreaEventTrigger;
                if (trigger != null)
                {
                    AreaEventTrigger.STriggerContext context = trigger._inActors[src.handle.ObjID];
                    RefParamOperator @operator = context.refParams[this];
                    if (@operator != null)
                    {
                        ListView <string> view       = new ListView <string>();
                        GameObject[]      refObjList = base.RefObjList;
                        if (refObjList != null)
                        {
                            int length = refObjList.Length;
                            for (int i = 0; i < length; i++)
                            {
                                view.Add(string.Format("TriggerActionBuffTar_{0}", i));
                            }
                        }
                        if (base.bSrc)
                        {
                            view.Add("TriggerActionBuffSrc");
                        }
                        if (base.bAtker)
                        {
                            view.Add("TriggerActionBuffAtker");
                        }
                        ListView <string> .Enumerator enumerator = view.GetEnumerator();
                        while (enumerator.MoveNext())
                        {
                            string current = enumerator.Current;
                            if (!string.IsNullOrEmpty(current))
                            {
                                BuffFense refParamObject = @operator.GetRefParamObject <BuffFense>(current);
                                if (refParamObject != null)
                                {
                                    refParamObject.Stop();
                                }
                            }
                        }
                    }
                }
            }
        }