Пример #1
0
    private void SelectActorView(ActorRoot actorRootLook, BaseEntityInfo actorViewInfo)
    {
        m_actorRootLook = actorRootLook;

        m_animationSpeed = 1.0f;

        foreach (ISubCharacterViewer subCharacterViewer in m_characterViewerDic.Values)
        {
            subCharacterViewer.ChangeActor(m_actorRootLook);
        }
    }
Пример #2
0
 public static VInt3 Move(ActorRoot actor, VInt3 delta, out VInt groundY, MoveDirectionState state = null)
 {
     if (actor.isMovable)
     {
         groundY = ((actor == null) ? 0 : actor.groundY);
         VInt3 location = actor.location;
         return(PathfindingUtility.InternalMove(location, delta, ref groundY, actor, state));
     }
     groundY = actor.groundY;
     return(VInt3.zero);
 }
Пример #3
0
    public static bool IsValidTarget(ActorRoot actor, VInt3 target)
    {
        if (!AstarPath.active)
        {
            return(false);
        }
        int actorCamp = actor.TheActorMeta.ActorCamp;
        TriangleMeshNode locatedByRasterizer = AstarPath.active.GetLocatedByRasterizer(target, actorCamp);

        return(locatedByRasterizer != null);
    }
Пример #4
0
 public static VInt3 MoveLerp(ActorRoot actor, VInt3 srcPos, VInt3 delta, out VInt groundY)
 {
     if (actor.isMovable)
     {
         groundY = ((actor == null) ? 0 : actor.groundY);
         VInt3 zero = VInt3.zero;
         return(PathfindingUtility.InternalMove(srcPos, delta, ref groundY, actor, null));
     }
     groundY = actor.groundY;
     return(VInt3.zero);
 }
 public static void ApplyActorShadowSettings(List <PoolObjHandle <ActorRoot> > actors)
 {
     for (int i = 0; i < actors.get_Count(); i++)
     {
         ActorRoot handle = actors.get_Item(i).handle;
         if (handle != null && !(handle.ShadowEffect == null) && !(handle.gameObject == null))
         {
             handle.ShadowEffect.ApplyShadowSettings();
         }
     }
 }
 private static bool Intersects(ActorRoot _actor, VCollisionShape _shape, bool bEdge)
 {
     if (_actor == null || _actor.ActorControl.GetNoAbilityFlag(ObjAbilityType.ObjAbiliity_CollisionDetection))
     {
         return(false);
     }
     if (bEdge)
     {
         return(_actor.shape.EdgeIntersects(_shape));
     }
     return(_actor.shape.Intersects(_shape));
 }
Пример #7
0
 public static void ApplyActorShadowSettings(List <PoolObjHandle <ActorRoot> > actors)
 {
     for (int i = 0; i < actors.Count; i++)
     {
         PoolObjHandle <ActorRoot> handle = actors[i];
         ActorRoot root = handle.handle;
         if (((root != null) && (root.ShadowEffect != null)) && (root.gameObject != null))
         {
             root.ShadowEffect.ApplyShadowSettings();
         }
     }
 }
Пример #8
0
 private static void ReviveTower(ActorRoot inActor, int inParam)
 {
     if (((inActor != null) && (inActor.ActorControl != null)) && inActor.ActorControl.IsDeadState)
     {
         inActor.ActorControl.Revive(false);
         inActor.RecoverOriginalActorMesh();
         if (inActor.ActorMesh != null)
         {
             inActor.ActorMesh.SetLayer("Actor", "Particles", true);
         }
     }
 }
Пример #9
0
 public override void Process(Action _action, Track _track, int _localTime)
 {
     if (!this.done_ && (this.actor_ != 0))
     {
         bool flag     = this.lastTime_ < this.rotationTime;
         int  moveTick = _localTime - this.lastTime_;
         this.lastTime_ = _localTime;
         if (this.teleport)
         {
             this.Teleport();
         }
         else
         {
             if (flag)
             {
                 float      t          = Mathf.Min(1f, (float)(_localTime / this.rotationTime));
                 Quaternion quaternion = Quaternion.Slerp(this.fromRot, this.toRot, t);
                 this.actor_.handle.rotation = quaternion;
             }
             if ((this.moveTick - moveTick) <= 0)
             {
                 moveTick   = this.moveTick;
                 this.done_ = true;
             }
             else
             {
                 this.moveTick -= moveTick;
             }
             VInt3 delta   = this.dir.NormalizeTo((this.moveSpeed * moveTick) / 0x3e8);
             VInt  groundY = this.actor_.handle.groundY;
             if (!this.IgnoreCollision)
             {
                 delta = PathfindingUtility.Move(this.actor_.handle, delta, out groundY, out this.actor_.handle.hasReachedNavEdge);
             }
             if (this.actor_.handle.MovementComponent.isFlying)
             {
                 int       y      = this.actor_.handle.location.y;
                 ActorRoot handle = this.actor_.handle;
                 handle.location += delta;
                 VInt3 location = this.actor_.handle.location;
                 location.y = y;
                 this.actor_.handle.location = location;
             }
             else
             {
                 ActorRoot local2 = this.actor_.handle;
                 local2.location += delta;
             }
             this.actor_.handle.groundY = groundY;
             base.Process(_action, _track, _localTime);
         }
     }
 }
        public List <PoolObjHandle <ActorRoot> > GetCollidedActorList(Action _action, PoolObjHandle <ActorRoot> InActor, PoolObjHandle <ActorRoot> triggerActor)
        {
            VCollisionShape vCollisionShape = null;

            if (triggerActor)
            {
                vCollisionShape = triggerActor.get_handle().shape;
            }
            this.triggerHeroList.Clear();
            this.triggerMonsterList.Clear();
            this.triggerOrganList.Clear();
            this.triggerEyeList.Clear();
            this.triggerPriority.Clear();
            this.collidedActors.Clear();
            if (vCollisionShape == null && this.bUseTriggerObj)
            {
                return(null);
            }
            if (this.bUseTriggerObj)
            {
                this._coordInActor = InActor;
                this._coordShape   = vCollisionShape;
                SceneManagement instance = Singleton <SceneManagement> .GetInstance();

                SceneManagement.Coordinate coord = default(SceneManagement.Coordinate);
                instance.GetCoord(ref coord, vCollisionShape);
                instance.UpdateDirtyNodes();
                instance.ForeachActors(coord, this._coordHandler);
                this._coordInActor.Release();
                this._coordShape = null;
            }
            else
            {
                List <PoolObjHandle <ActorRoot> > gameActors = Singleton <GameObjMgr> .get_instance().GameActors;

                int count = gameActors.get_Count();
                for (int i = 0; i < count; i++)
                {
                    PoolObjHandle <ActorRoot> poolObjHandle = gameActors.get_Item(i);
                    if (poolObjHandle)
                    {
                        ActorRoot handle = poolObjHandle.get_handle();
                        if (!this.TargetObjTypeFilter(ref InActor, handle) && !this.TargetCollideTimeFiler(handle) && !this.TargetCollideCountFilter(handle) && !this.TargetMoveDirectionFilter(ref InActor, ref poolObjHandle))
                        {
                            this.collidedActors.Add(poolObjHandle);
                            this.type_actorList[(int)handle.TheActorMeta.ActorType].Add(poolObjHandle);
                        }
                    }
                }
            }
            return(this.collidedActors);
        }
        private PoolObjHandle <ActorRoot> SearchTarget()
        {
            int num = 0;
            PoolObjHandle <ActorRoot> poolObjHandle  = default(PoolObjHandle <ActorRoot>);
            PoolObjHandle <ActorRoot> poolObjHandle2 = default(PoolObjHandle <ActorRoot>);
            int   num2 = 4;
            ulong num3 = (ulong)((long)this.searchRadius * (long)this.searchRadius);
            ulong num4 = num3;
            ulong num5 = num3;
            int   num6 = this.maxTargetCount;
            int   num7 = this.maxTargetCount;
            List <PoolObjHandle <ActorRoot> > gameActors = Singleton <GameObjMgr> .GetInstance().GameActors;

            for (int i = 0; i < gameActors.get_Count(); i++)
            {
                PoolObjHandle <ActorRoot> poolObjHandle3 = gameActors.get_Item(i);
                ActorRoot handle = poolObjHandle3.handle;
                if (this.attackActor.handle.CanAttack(handle) && (num2 & 1 << (int)handle.TheActorMeta.ActorType) <= 0 && handle.ObjID != this.tarActor.handle.ObjID && handle.HorizonMarker.IsVisibleFor(this.attackActor.handle.TheActorMeta.ActorCamp) && (!this.effectCountMap.TryGetValue(handle.ObjID, ref num) || num < this.maxTargetCount))
                {
                    ulong sqrMagnitudeLong2D = (ulong)(handle.location - this.tarActor.handle.location).sqrMagnitudeLong2D;
                    if (sqrMagnitudeLong2D < num3)
                    {
                        if (!this.bHeroWithPrioritySelection || handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
                        {
                            if (num < num6)
                            {
                                poolObjHandle = poolObjHandle3;
                                num4          = sqrMagnitudeLong2D;
                                num6          = num;
                            }
                            else if (num == num6 && sqrMagnitudeLong2D < num4)
                            {
                                poolObjHandle = poolObjHandle3;
                                num4          = sqrMagnitudeLong2D;
                            }
                        }
                        else if (num < num7)
                        {
                            poolObjHandle2 = poolObjHandle3;
                            num5           = sqrMagnitudeLong2D;
                            num7           = num;
                        }
                        else if (num == num7 && sqrMagnitudeLong2D < num5)
                        {
                            poolObjHandle2 = poolObjHandle3;
                            num5           = sqrMagnitudeLong2D;
                        }
                    }
                }
            }
            return(poolObjHandle ? poolObjHandle : poolObjHandle2);
        }
Пример #12
0
 private static void ReviveTower(ActorRoot inActor, int inParam)
 {
     if (inActor != null && inActor.ActorControl != null && inActor.ActorControl.IsDeadState)
     {
         inActor.ActorControl.Revive(false);
         inActor.RecoverOriginalActorMesh();
         if (inActor.ActorMesh != null)
         {
             inActor.ActorMesh.SetLayer("Actor", "Particles", true);
         }
         inActor.ActorControl.PlayAnimation("Born", 0.01f, 0, false);
     }
 }
Пример #13
0
        public List <PoolObjHandle <ActorRoot> > GetCollidedActorList(AGE.Action _action, PoolObjHandle <ActorRoot> InActor, PoolObjHandle <ActorRoot> triggerActor)
        {
            VCollisionShape shape = null;

            if (triggerActor != 0)
            {
                shape = triggerActor.handle.shape;
            }
            this.triggerHeroList.Clear();
            this.triggerMonsterList.Clear();
            this.triggerOrganList.Clear();
            this.triggerEyeList.Clear();
            this.triggerPriority.Clear();
            this.collidedActors.Clear();
            if ((shape == null) && this.bUseTriggerObj)
            {
                return(null);
            }
            if (this.bUseTriggerObj)
            {
                this._coordInActor = InActor;
                this._coordShape   = shape;
                SceneManagement instance = Singleton <SceneManagement> .GetInstance();

                SceneManagement.Coordinate coord = new SceneManagement.Coordinate();
                instance.GetCoord(ref coord, shape);
                instance.UpdateDirtyNodes();
                instance.ForeachActors(coord, this._coordHandler);
                this._coordInActor.Release();
                this._coordShape = null;
            }
            else
            {
                List <PoolObjHandle <ActorRoot> > gameActors = Singleton <GameObjMgr> .instance.GameActors;
                int count = gameActors.Count;
                for (int i = 0; i < count; i++)
                {
                    PoolObjHandle <ActorRoot> item = gameActors[i];
                    if (item != 0)
                    {
                        ActorRoot handle = item.handle;
                        if ((!this.TargetObjTypeFilter(ref InActor, handle) && !this.TargetCollideTimeFiler(handle)) && !this.TargetCollideCountFilter(handle))
                        {
                            this.collidedActors.Add(item);
                            this.type_actorList[(int)handle.TheActorMeta.ActorType].Add(item);
                        }
                    }
                }
            }
            return(this.collidedActors);
        }
    public static VInt3 FindValidTarget(ActorRoot actor, VInt3 start, VInt3 end, int radius, out bool bResult)
    {
        long num  = (long)radius * (long)radius;
        long num2 = start.XZSqrMagnitude(ref end);

        if (num2 < num)
        {
            return(PathfindingUtility.FindValidTarget(actor, start, end, out bResult));
        }
        VInt3 vInt = end - start;
        VInt3 end2 = start + vInt.NormalizeTo(radius);

        return(PathfindingUtility.FindValidTarget(actor, start, end2, out bResult));
    }
Пример #15
0
 private void RefreshPropPanel(GameObject root, ref PoolObjHandle <ActorRoot> actor)
 {
     if ((actor != 0) && (root != null))
     {
         GameObject      gameObject = root.transform.Find(s_propPanel).gameObject.transform.Find("Panel_HeroProp").gameObject;
         ActorRoot       handle     = actor.handle;
         ValueDataInfo[] actorValue = handle.ValueComponent.mActorValue.GetActorValue();
         int             soulLevel  = handle.ValueComponent.mActorValue.SoulLevel;
         if (Singleton <BattleLogic> .GetInstance().m_GameInfo.gameContext.IsBalanceProp())
         {
         }
         this.RefreshHeroPropPanel(gameObject, ref actorValue, soulLevel, (uint)actor.handle.TheActorMeta.ConfigId);
     }
 }
Пример #16
0
        private void onDragon_Dead(ActorRoot actor)
        {
            DragonIcon.DragonNode dragonNode = this.getDragonNode(actor.ObjID, actor.ActorControl.GetActorSubSoliderType());
            if (dragonNode != null)
            {
                dragonNode.ShowDead(actor.ActorControl.IsDeadState);
                dragonNode.objid = 0u;
                SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

                if (curLvelContext != null && curLvelContext.IsFireHolePlayMode())
                {
                    dragonNode.Recycle();
                }
            }
        }
Пример #17
0
 private void SetBossIcon(ActorRoot inActor)
 {
     if (inActor != null)
     {
         string str = UT.Bytes2String(MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(inActor.TheActorMeta.ConfigId).szBossIcon);
         if (!string.IsNullOrEmpty(str))
         {
             this.boss_icon.SetSprite(str, this.map_fromScript, true, false, false);
         }
         else
         {
             this.boss_icon.SetSprite("UGUI/Sprite/Dynamic/BustCircle/50001", this.map_fromScript, true, false, false);
         }
     }
 }
Пример #18
0
        private void send_signal(CUIEvent uiEvent, GameObject img, int signal_id = 0)
        {
            if ((uiEvent != null) && (img != null))
            {
                byte type    = (byte)uiEvent.m_eventParams.tag2;
                uint tagUInt = uiEvent.m_eventParams.tagUInt;
                if (signal_id == 0)
                {
                    signal_id = uiEvent.m_eventParams.tag3;
                }
                this.Switch(EMapType.Mini);
                SignalPanel panel = (Singleton <CBattleSystem> .GetInstance().FightForm == null) ? null : Singleton <CBattleSystem> .instance.FightForm.GetSignalPanel();

                if (panel != null)
                {
                    switch (type)
                    {
                    case 3:
                    case 1:
                    case 2:
                    case 6:
                    case 4:
                    case 5:
                        panel.SendCommand_SignalMiniMap_Target((byte)signal_id, type, tagUInt);
                        return;
                    }
                    Player hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

                    if (hostPlayer != null)
                    {
                        ActorRoot root = ((hostPlayer == null) || (hostPlayer.Captain == 0)) ? null : hostPlayer.Captain.handle;
                        if (root != null)
                        {
                            Vector2 vector = CUIUtility.WorldToScreenPoint(uiEvent.m_srcFormScript.GetCamera(), img.transform.position);
                            float   num4   = uiEvent.m_pointerEventData.position.x - vector.x;
                            float   num5   = uiEvent.m_pointerEventData.position.y - vector.y;
                            num4 = uiEvent.m_srcFormScript.ChangeScreenValueToForm(num4);
                            num5 = uiEvent.m_srcFormScript.ChangeScreenValueToForm(num5);
                            VInt3 zero = VInt3.zero;
                            zero.x = (int)(num4 * Singleton <CBattleSystem> .GetInstance().UI_world_Factor_Big.x);
                            zero.y = (root == null) ? ((int)0.15f) : ((int)((Vector3)root.location).y);
                            zero.z = (int)(num5 * Singleton <CBattleSystem> .GetInstance().UI_world_Factor_Big.y);
                            panel.SendCommand_SignalMiniMap_Position((byte)signal_id, zero);
                        }
                    }
                }
            }
        }
        private static int GetChangeValueProperty(ActorRoot targetActor, ref SSkillFuncContext inContext)
        {
            int            skillFuncParam = inContext.GetSkillFuncParam(1, true);
            int            num2           = inContext.GetSkillFuncParam(2, true);
            int            num3           = inContext.GetSkillFuncParam(3, true);
            ESkillFuncMode mode           = (ESkillFuncMode)inContext.GetSkillFuncParam(4, false);
            int            num4           = inContext.GetSkillFuncParam(5, true);

            skillFuncParam += ((num2 * targetActor.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_PHYATKPT].totalValue) / 0x2710) + ((num3 * targetActor.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_MGCATKPT].totalValue) / 0x2710);
            if (mode == ESkillFuncMode.SkillFuncMode_Constant)
            {
                return(skillFuncParam);
            }
            int num5            = 0;
            int dwSkillFuncFreq = (int)inContext.inSkillFunc.dwSkillFuncFreq;

            if (num4 <= 0)
            {
                DebugHelper.Assert(false, "ESkillFuncMode LastTime error!");
                return(skillFuncParam);
            }
            if (dwSkillFuncFreq <= 0)
            {
                dwSkillFuncFreq = 30;
            }
            num5 = num4 / dwSkillFuncFreq;
            if (num5 <= 0)
            {
                return(skillFuncParam);
            }
            if (mode == ESkillFuncMode.SkillFuncMode_Fade)
            {
                if (inContext.inDoCount == 1)
                {
                    return(skillFuncParam);
                }
                if ((inContext.inDoCount - 1) <= num5)
                {
                    return(-skillFuncParam / num5);
                }
                return(0);
            }
            if ((inContext.inDoCount != 1) && ((inContext.inDoCount - 1) <= num5))
            {
                return(skillFuncParam / num5);
            }
            return(0);
        }
        private bool TargetCollideTimeFiler(ActorRoot actor)
        {
            int  num   = 0;
            uint objID = actor.ObjID;

            if (!this.collideTimeMap.TryGetValue(objID, ref num))
            {
                return(false);
            }
            if (this.localTime - num > this.TriggerActorInterval)
            {
                return(false);
            }
            this.collideTimeMap.set_Item(objID, num);
            return(true);
        }
Пример #21
0
        public bool CheckShakeDistance(ActorRoot captain, ActorRoot user)
        {
            if (captain == null || user == null)
            {
                return(false);
            }
            if (captain == user)
            {
                return(true);
            }
            VInt3 vInt = captain.location - user.location;
            long  num  = (long)CameraShakeDuration.shakeDistance;

            num *= num;
            return(vInt.get_sqrMagnitudeLong2D() <= num);
        }
Пример #22
0
        public void OnBaronAttacked(MonsterWrapper InBaron, ActorRoot InAtacker)
        {
            if (!this.bIsClassic5V5Mode || !InAtacker.IsHostCamp())
            {
                return;
            }
            bool isAttacked = InBaron.m_isAttacked;

            if (!this.bIsBaronActived && isAttacked)
            {
                this.PlayBattleEvent("Play_Music_Dalong_S1");
                this.BaronActor      = InBaron.GetActor();
                this.bIsBaronActived = true;
                this.RegistBaronEvents();
            }
        }
Пример #23
0
        public bool CheckShakeDistance(ActorRoot captain, ActorRoot user)
        {
            if ((captain == null) || (user == null))
            {
                return(false);
            }
            if (captain == user)
            {
                return(true);
            }
            VInt3 num           = captain.location - user.location;
            long  shakeDistance = CameraShakeDuration.shakeDistance;

            shakeDistance *= shakeDistance;
            return(num.sqrMagnitudeLong2D <= shakeDistance);
        }
Пример #24
0
        public static string GetHero_Icon(ActorRoot actor, bool bSmall)
        {
            string str = string.Empty;

            if (actor != null)
            {
                IGameActorDataProvider actorDataProvider = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.ServerDataProvider);

                ActorServerData actorData = new ActorServerData();
                if ((actorDataProvider != null) && actorDataProvider.GetActorServerData(ref actor.TheActorMeta, ref actorData))
                {
                    str = GetHero_Icon((uint)actorData.TheActorMeta.ConfigId, 0, bSmall);
                }
            }
            return(str);
        }
        public void DoUpdate(float dt)
        {
            if (this.rvoAgent == null)
            {
                return;
            }
            ActorRoot handle = this.actor.handle;

            if (this.lastPosition != handle.location)
            {
                this.Teleport(handle.location);
            }
            if (this.lockWhenNotMoving)
            {
                this.locked = (this.desiredVelocity == VInt3.zero);
            }
            this.UpdateAgentProperties();
            VInt3 interpolatedPosition = this.rvoAgent.InterpolatedPosition;

            this.rvoAgent.SetYPosition(this.adjustedY);
            this.rvoAgent.DesiredVelocity = this.desiredVelocity;
            VInt3 vInt = interpolatedPosition - this.center;

            vInt.y += this.height.i >> 1;
            if (this.checkNavNode)
            {
                VInt3 delta = vInt - handle.location;
                VInt  groundY;
                VInt3 rhs   = PathfindingUtility.Move(this.actor, delta, out groundY, out handle.hasReachedNavEdge, null);
                VInt3 vInt2 = handle.location + rhs;
                handle.location = vInt2;
                handle.groundY  = groundY;
                this.rvoAgent.Teleport(vInt2);
                this.adjustedY = vInt2.y;
            }
            else
            {
                handle.location = vInt;
            }
            this.lastPosition = handle.location;
            if (this.enableRotation && this.velocity != VInt3.zero)
            {
                Vector3   forward   = (Vector3)this.velocity;
                Transform transform = base.transform;
                transform.rotation = Quaternion.Lerp(transform.rotation, Quaternion.LookRotation(forward), dt * this.rotationSpeed * Mathf.Min((float)this.velocity.magnitude, 0.2f));
            }
        }
Пример #26
0
        private void onDragon_Dead(ActorRoot actor)
        {
            DragonNode node = this.getDragonNode(actor.ObjID, actor.ActorControl.GetActorSubSoliderType());

            if (node != null)
            {
                node.SetData(actor.gameObject.transform.position, actor.ActorControl.GetActorSubSoliderType(), actor.ObjID, this.m_b5v5);
                node.ShowDead(actor.ActorControl.IsDeadState);
                node.objid = 0;
                SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

                if ((curLvelContext != null) && (curLvelContext.iLevelID == 0x4e29))
                {
                    node.Recycle();
                }
            }
        }
Пример #27
0
        private void send_signal(CUIEvent uiEvent, GameObject img, int signal_id = 0)
        {
            if ((uiEvent != null) && (img != null))
            {
                byte tag          = (byte)uiEvent.m_eventParams.tag;
                byte type         = (byte)uiEvent.m_eventParams.tag2;
                uint tagUInt      = 0;
                uint targetHeroID = 0;
                if (signal_id == 0)
                {
                    signal_id = uiEvent.m_eventParams.tag3;
                }
                if (type == 3)
                {
                    tagUInt      = uiEvent.m_eventParams.tagUInt;
                    targetHeroID = uiEvent.m_eventParams.heroId;
                }
                Singleton <CBattleSystem> .instance.GetMinimapSys().Switch(EMapType.Mini);

                Player hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

                if (hostPlayer != null)
                {
                    ActorRoot root = ((hostPlayer == null) || (hostPlayer.Captain == 0)) ? null : hostPlayer.Captain.handle;
                    if (root != null)
                    {
                        VInt    num5;
                        Vector2 vector = CUIUtility.WorldToScreenPoint(uiEvent.m_srcFormScript.GetCamera(), img.transform.position);
                        Vector3 zero   = Vector3.zero;
                        zero.x = (uiEvent.m_pointerEventData.position.x - vector.x) * Singleton <CBattleSystem> .GetInstance().UI_world_Factor_Big.x;

                        zero.y = (root == null) ? 0.15f : ((Vector3)root.location).y;
                        zero.z = (uiEvent.m_pointerEventData.position.y - vector.y) * Singleton <CBattleSystem> .GetInstance().UI_world_Factor_Big.y;

                        PathfindingUtility.GetGroundY((VInt3)zero, out num5);
                        zero.y = num5.scalar;
                        SignalPanel signalPanel = Singleton <CBattleSystem> .instance.GetSignalPanel();

                        if (signalPanel != null)
                        {
                            signalPanel.SendFrameCommand(signal_id, (int)zero.x, (int)zero.y, (int)zero.z, tag, type, tagUInt, targetHeroID);
                        }
                    }
                }
            }
        }
Пример #28
0
 private void ActionMoveLerp(ActorRoot actor, uint nDelta, bool bReset)
 {
     if (actor != null)
     {
         if (this.done_ || this.teleport)
         {
             actor.gameObject.transform.position = (Vector3)actor.location;
         }
         else
         {
             VInt3 num3;
             VInt  groundY = 0;
             VInt3 dir     = this.dir;
             if (!this.shouldUseAcceleration)
             {
                 num3 = dir.NormalizeTo((int)((this.moveSpeed * nDelta) / 0x3e8));
             }
             else
             {
                 long num4 = (this.lastLerpMoveSpeed * nDelta) + ((long)((((this.acceleration * nDelta) * nDelta) / ((ulong)2L)) / ((ulong)0x3e8L)));
                 num4 /= 0x3e8L;
                 num3  = dir.NormalizeTo((int)num4);
                 this.lastLerpMoveSpeed += ((int)(this.acceleration * nDelta)) / 0x3e8;
             }
             Vector3 position = actor.gameObject.transform.position;
             if (!this.IgnoreCollision)
             {
                 num3 = PathfindingUtility.MoveLerp(actor, (VInt3)position, num3, out groundY);
             }
             if (actor.MovementComponent.isFlying)
             {
                 float     y         = position.y;
                 Transform transform = actor.gameObject.transform;
                 transform.position += (Vector3)num3;
                 Vector3 vector2 = actor.gameObject.transform.position;
                 vector2.y = y;
                 actor.gameObject.transform.position = vector2;
             }
             else
             {
                 Transform transform2 = actor.gameObject.transform;
                 transform2.position += (Vector3)num3;
             }
         }
     }
 }
Пример #29
0
        private static void OrganVisiter(COM_PLAYERCAMP inCamp, int inParam, Action <ActorRoot, int> inFunc)
        {
            List <PoolObjHandle <ActorRoot> > .Enumerator enumerator = Singleton <GameObjMgr> .instance.OrganActors.GetEnumerator();

            while (enumerator.MoveNext())
            {
                if (enumerator.get_Current())
                {
                    PoolObjHandle <ActorRoot> current = enumerator.get_Current();
                    ActorRoot handle = current.handle;
                    if (handle.TheActorMeta.ActorCamp == inCamp)
                    {
                        inFunc.Invoke(handle, inParam);
                    }
                }
            }
        }
Пример #30
0
 private void ActionMoveLerp(ActorRoot actor, uint nDelta, bool bReset)
 {
     if (actor == null)
     {
         return;
     }
     if (this.done_ || this.teleport)
     {
         actor.myTransform.position = (Vector3)actor.location;
     }
     else
     {
         VInt  vInt  = 0;
         VInt3 vInt2 = this.dir;
         VInt3 vInt3;
         if (!this.shouldUseAcceleration)
         {
             vInt3 = vInt2.NormalizeTo(this.moveSpeed * (int)nDelta / 1000);
         }
         else
         {
             long num = (long)this.lastLerpMoveSpeed * (long)((ulong)nDelta) + (long)this.acceleration * (long)((ulong)nDelta) * (long)((ulong)nDelta) / 2L / 1000L;
             num  /= 1000L;
             vInt3 = vInt2.NormalizeTo((int)num);
             this.lastLerpMoveSpeed += (int)((long)this.acceleration * (long)((ulong)nDelta)) / 1000;
         }
         Vector3 position = actor.myTransform.position;
         if (!this.IgnoreCollision)
         {
             vInt3 = PathfindingUtility.MoveLerp(actor, (VInt3)position, vInt3, out vInt);
         }
         if (actor.MovementComponent.isFlying)
         {
             float y = position.y;
             actor.myTransform.position += (Vector3)vInt3;
             Vector3 position2 = actor.myTransform.position;
             position2.y = y;
             actor.myTransform.position = position2;
         }
         else
         {
             actor.myTransform.position += (Vector3)vInt3;
         }
     }
 }