Ejemplo n.º 1
0
        public static IEnumerator DoAction(this IObjectWithAction objectWithAction, Vector2Int position, Vector2Int target)
        {
            //IL_000e: Unknown result type (might be due to invalid IL or missing references)
            //IL_000f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0015: Unknown result type (might be due to invalid IL or missing references)
            //IL_0016: Unknown result type (might be due to invalid IL or missing references)
            CellObject cellObject = objectWithAction.cellObject;

            if (cellObject.coords != position)
            {
                Log.Warning($"Was not on the specified cell of an attack sequence: {cellObject.coords} instead of {position} ({objectWithAction.gameObject.get_name()}).", 51, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Maps\\Objects\\IObjectWithAction.cs");
                CellObject cellObject2 = cellObject.parentMap.GetCellObject(position.get_x(), position.get_y());
                objectWithAction.SetCellObject(cellObject2);
            }
            Direction direction = position.GetDirectionTo(target);

            if (!direction.IsAxisAligned())
            {
                direction = direction.GetAxisAligned(objectWithAction.direction);
            }
            bool waitForAnimationEndOnMissingLabel = !position.IsAdjacentTo(target);

            yield return(objectWithAction.PlayActionAnimation(direction, waitForAnimationEndOnMissingLabel));

            objectWithAction.TriggerActionEffect(target);
        }
Ejemplo n.º 2
0
        public void CopyPhysics(CellObject referenceCell, bool isSleeping, float deltaTime, float gravityVelocity)
        {
            //IL_005f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0065: Unknown result type (might be due to invalid IL or missing references)
            //IL_006b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0070: Unknown result type (might be due to invalid IL or missing references)
            List <DynamicObject> rootDynamicChildren = m_rootDynamicChildren;
            int   count = rootDynamicChildren.Count;
            float controlledLocalHeight = referenceCell.m_controlledLocalHeight;

            if (isSleeping && m_isSleeping)
            {
                for (int i = 0; i < count; i++)
                {
                    rootDynamicChildren[i].ResolvePhysics(deltaTime, gravityVelocity);
                }
                m_controlledVelocity = 0f;
            }
            else
            {
                float num  = controlledLocalHeight - m_controlledLocalHeight;
                float num2 = num / deltaTime;
                this.get_transform().set_localPosition(m_originalLocalPosition + m_localUpVector * controlledLocalHeight);
                for (int j = 0; j < count; j++)
                {
                    rootDynamicChildren[j].ResolvePhysics(deltaTime, num, num2, gravityVelocity);
                }
                m_controlledVelocity = num2;
            }
            m_controlledLocalHeight  = controlledLocalHeight;
            m_controlledHeightBuffer = 0f;
            m_isSleeping             = true;
        }
Ejemplo n.º 3
0
        public virtual void SetCellObject([NotNull] CellObject containerCell)
        {
            //IL_0010: Unknown result type (might be due to invalid IL or missing references)
            //IL_001b: Unknown result type (might be due to invalid IL or missing references)
            //IL_002f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0034: Unknown result type (might be due to invalid IL or missing references)
            //IL_0039: Unknown result type (might be due to invalid IL or missing references)
            //IL_0040: Unknown result type (might be due to invalid IL or missing references)
            //IL_0045: Unknown result type (might be due to invalid IL or missing references)
            //IL_004a: Unknown result type (might be due to invalid IL or missing references)
            //IL_0051: Unknown result type (might be due to invalid IL or missing references)
            //IL_0056: Unknown result type (might be due to invalid IL or missing references)
            //IL_005b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0073: Unknown result type (might be due to invalid IL or missing references)
            //IL_0078: Unknown result type (might be due to invalid IL or missing references)
            //IL_007a: Unknown result type (might be due to invalid IL or missing references)
            //IL_007f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0087: Unknown result type (might be due to invalid IL or missing references)
            //IL_008c: Unknown result type (might be due to invalid IL or missing references)
            //IL_0098: Unknown result type (might be due to invalid IL or missing references)
            //IL_00ba: Unknown result type (might be due to invalid IL or missing references)
            //IL_00bf: Unknown result type (might be due to invalid IL or missing references)
            //IL_00d1: Unknown result type (might be due to invalid IL or missing references)
            //IL_00d3: Unknown result type (might be due to invalid IL or missing references)
            //IL_00dc: Unknown result type (might be due to invalid IL or missing references)
            //IL_00e1: Unknown result type (might be due to invalid IL or missing references)
            //IL_00e6: Unknown result type (might be due to invalid IL or missing references)
            //IL_00ed: Unknown result type (might be due to invalid IL or missing references)
            if (containerCell == m_cellObject)
            {
                return;
            }
            float     num       = Vector3.Dot(m_localUpVector, this.get_transform().get_localPosition());
            Transform transform = containerCell.get_transform();

            m_localRightVector   = transform.InverseTransformDirection(Vector3.get_right());
            m_localForwardVector = transform.InverseTransformDirection(Vector3.get_forward());
            m_localUpVector      = transform.InverseTransformDirection(Vector3.get_up());
            this.get_transform().SetParent(transform, true);
            Vector3 localPosition = this.get_transform().get_localPosition();
            float   num2          = Vector3.Dot(m_localRightVector, localPosition);
            float   num3          = Vector3.Dot(m_localForwardVector, localPosition);

            innerCellPosition = new Vector2(num2, num3);
            if (null == m_cellObject)
            {
                containerCell.AcquireIsoObject(this);
            }
            else
            {
                float num4 = Vector3.Dot(m_localUpVector, localPosition);
                if (!Mathf.Approximately(num, num4))
                {
                    localPosition += m_localUpVector * (num - num4);
                    this.get_transform().set_localPosition(localPosition);
                }
                containerCell.AcquireIsoObject(this, m_cellObject);
            }
            m_cellObject = containerCell;
        }
        public override void Teleport(Vector2Int target)
        {
            //IL_0023: Unknown result type (might be due to invalid IL or missing references)
            //IL_0028: Unknown result type (might be due to invalid IL or missing references)
            //IL_0068: Unknown result type (might be due to invalid IL or missing references)
            if (!(null != m_cellObject))
            {
                return;
            }
            IMap parentMap = m_cellObject.parentMap;

            if (parentMap != null)
            {
                Direction direction = m_cellObject.coords.GetDirectionTo(target);
                if (!direction.IsAxisAligned())
                {
                    direction = direction.GetAxisAligned(this.direction);
                }
                this.direction = direction;
                CellObject cellObject = parentMap.GetCellObject(target.get_x(), target.get_y());
                SetCellObject(cellObject);
                SetCellObjectInnerPosition(Vector2.get_zero());
                PlayIdleAnimation();
            }
        }
Ejemplo n.º 5
0
        protected IEnumerator MoveToDoActionRoutine(Vector2Int[] movementCells, Direction actionDirection)
        {
            int movementCellsCount = movementCells.Length;

            if (movementCellsCount != 0)
            {
                CellObject cellObject = m_cellObject;
                IMap       parentMap  = cellObject.parentMap;
                Vector2Int val        = movementCells[0];
                if (cellObject.coords != val)
                {
                    Log.Warning($"Was not on the start cell of a new movement sequence: {cellObject.coords} instead of {val} ({this.get_gameObject().get_name()}).", 341, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Maps\\Objects\\FightCharacterObject.cs");
                    CellObject cellObject2 = parentMap.GetCellObject(val.get_x(), val.get_y());
                    SetCellObject(cellObject2);
                }
                Animator2D animator = m_animator2D;
                foreach (CharacterAnimationInfo item in CharacterFightMovementSequencer.ComputeMovementToAction(movementCells, actionDirection, m_mapRotation))
                {
                    CharacterAnimationInfo sequenceItem = item;
                    SetPosition(parentMap, sequenceItem.position);
                    StartFightAnimation(sequenceItem);
                    while (!CharacterObjectUtility.HasAnimationEnded(animator, sequenceItem))
                    {
                        yield return(null);
                    }
                }
                Vector2Int val2 = movementCells[movementCellsCount - 1];
                SetPosition(parentMap, Vector2Int.op_Implicit(val2));
                if (m_cellObject.TryGetIsoObject(out IObjectWithActivation _))
                {
                    direction = actionDirection;
                    PlayIdleAnimation();
                }
            }
        }
Ejemplo n.º 6
0
 public void DetachFromCell()
 {
     if (null != m_cellObject)
     {
         m_cellObject.RemoveIsoObject(this);
         m_cellObject = null;
     }
 }
Ejemplo n.º 7
0
        public unsafe void SetCellObject([CanBeNull] CellObject previousCell, [NotNull] CellObject containerCell)
        {
            //IL_0069: Unknown result type (might be due to invalid IL or missing references)
            //IL_0079: Unknown result type (might be due to invalid IL or missing references)
            //IL_00a0: Unknown result type (might be due to invalid IL or missing references)
            //IL_00a5: Unknown result type (might be due to invalid IL or missing references)
            //IL_00aa: Unknown result type (might be due to invalid IL or missing references)
            //IL_00c2: Unknown result type (might be due to invalid IL or missing references)
            //IL_00c7: Unknown result type (might be due to invalid IL or missing references)
            //IL_00c9: Unknown result type (might be due to invalid IL or missing references)
            //IL_00cc: Unknown result type (might be due to invalid IL or missing references)
            //IL_00d6: Unknown result type (might be due to invalid IL or missing references)
            //IL_00d9: Unknown result type (might be due to invalid IL or missing references)
            //IL_00e4: Unknown result type (might be due to invalid IL or missing references)
            //IL_00e9: Unknown result type (might be due to invalid IL or missing references)
            //IL_00ee: Unknown result type (might be due to invalid IL or missing references)
            //IL_00f6: Unknown result type (might be due to invalid IL or missing references)
            DynamicObject parent = m_parent;

            if (null == parent)
            {
                if (null == previousCell)
                {
                    containerCell.AddRootDynamicObject(this);
                }
                else
                {
                    float num = containerCell.AcquireRootDynamicObject(this, previousCell);
                    m_localHeight += num;
                }
            }
            else
            {
                parent.m_children.Remove(this);
                if (null == previousCell)
                {
                    containerCell.AddRootDynamicObject(this);
                }
                else
                {
                    float num2 = containerCell.AcquireDynamicObject(this, previousCell);
                    float num3 = ((IntPtr)(void *)this.get_transform().get_position()).y - (((IntPtr)(void *)previousCell.get_transform().get_position()).y + 0.5f);
                    m_localHeight = num2 + num3;
                }
            }
            m_localUpVector = this.get_transform().get_parent().InverseTransformDirection(Vector3.get_up());
            if (m_localHeight <= 0f)
            {
                Vector3 localPosition = this.get_transform().get_localPosition();
                localPosition += m_localUpVector * (0.5f - Vector3.Dot(localPosition, m_localUpVector));
                this.get_transform().set_localPosition(localPosition);
                m_localHeight       = 0f;
                m_inheritedVelocity = 0f;
            }
        }
Ejemplo n.º 8
0
        public void AcquireIsoObject([NotNull] IsoObject isoObject, [NotNull] CellObject other)
        {
            //IL_0029: Unknown result type (might be due to invalid IL or missing references)
            m_childrenIsoObjects.Add(isoObject);
            other.m_childrenIsoObjects.Remove(isoObject);
            Area area = isoObject.area;
            Area copy = area.GetCopy();

            area.MoveTo(coords);
            parentMap.MoveArea(copy, area);
        }
Ejemplo n.º 9
0
        public void TriggerActionEffect(Vector2Int target)
        {
            CharacterEffect actionEffect = m_characterData.actionEffect;

            if (!(null == actionEffect))
            {
                CellObject cellObject = m_cellObject.parentMap.GetCellObject(target.get_x(), target.get_y());
                Component  val        = actionEffect.Instantiate(cellObject.get_transform(), this);
                if (null != val)
                {
                    this.StartCoroutine(actionEffect.DestroyWhenFinished(val));
                }
            }
        }
        public static IEnumerator AnimateActivation(this IObjectWithActivationAnimation objectWithActivationAnimation, Vector2Int position)
        {
            //IL_000e: Unknown result type (might be due to invalid IL or missing references)
            //IL_000f: Unknown result type (might be due to invalid IL or missing references)
            CellObject cellObject = objectWithActivationAnimation.cellObject;

            if (cellObject.coords != position)
            {
                Log.Warning($"Was not on the specified cell of an attack sequence: {cellObject.coords} instead of {position} ({objectWithActivationAnimation.gameObject.get_name()}).", 23, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Maps\\Objects\\IObjectWithActivationAnimation.cs");
                CellObject cellObject2 = cellObject.parentMap.GetCellObject(position.get_x(), position.get_y());
                objectWithActivationAnimation.SetCellObject(cellObject2);
            }
            yield return(objectWithActivationAnimation.PlayActivationAnimation());
        }
Ejemplo n.º 11
0
 public virtual void Teleport(Vector2Int target)
 {
     //IL_003a: Unknown result type (might be due to invalid IL or missing references)
     if (null != m_cellObject)
     {
         IMap parentMap = m_cellObject.parentMap;
         if (parentMap != null)
         {
             CellObject cellObject = parentMap.GetCellObject(target.get_x(), target.get_y());
             SetCellObject(cellObject);
             SetCellObjectInnerPosition(Vector2.get_zero());
             PlayIdleAnimation();
         }
     }
 }
Ejemplo n.º 12
0
        public override void AttachToCell(CellObject containerCell)
        {
            //IL_000d: Unknown result type (might be due to invalid IL or missing references)
            //IL_0012: Unknown result type (might be due to invalid IL or missing references)
            //IL_0014: Unknown result type (might be due to invalid IL or missing references)
            //IL_0019: Unknown result type (might be due to invalid IL or missing references)
            //IL_0021: Unknown result type (might be due to invalid IL or missing references)
            //IL_0026: Unknown result type (might be due to invalid IL or missing references)
            //IL_0030: Unknown result type (might be due to invalid IL or missing references)
            base.AttachToCell(containerCell);
            Vector3 localPosition = this.get_transform().get_localPosition();
            float   num           = Vector3.Dot(m_localRightVector, localPosition);
            float   num2          = Vector3.Dot(m_localForwardVector, localPosition);

            innerCellPosition = new Vector2(num, num2);
        }
Ejemplo n.º 13
0
        public static IEnumerator Hit(this IObjectWithArmoredLife objectWithLife, Vector2Int position)
        {
            //IL_0008: Unknown result type (might be due to invalid IL or missing references)
            //IL_000d: Unknown result type (might be due to invalid IL or missing references)
            //IL_001b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0025: Unknown result type (might be due to invalid IL or missing references)
            CellObject cellObject = objectWithLife.cellObject;

            if (cellObject.coords != position)
            {
                Log.Warning($"Was not on the specified cell of hit sequence: {cellObject.coords} instead of {position} ({objectWithLife.gameObject.get_name()}).", 31, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Maps\\Objects\\IObjectWithArmoredLife.cs");
                CellObject cellObject2 = cellObject.parentMap.GetCellObject(position.get_x(), position.get_y());
                objectWithLife.SetCellObject(cellObject2);
            }
            return(objectWithLife.PlayHitAnimation());
        }
Ejemplo n.º 14
0
        public static void LethalHit(this IObjectWithArmoredLife objectWithLife, Vector2Int position)
        {
            //IL_0008: Unknown result type (might be due to invalid IL or missing references)
            //IL_000d: Unknown result type (might be due to invalid IL or missing references)
            //IL_001b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0025: Unknown result type (might be due to invalid IL or missing references)
            //IL_0069: Unknown result type (might be due to invalid IL or missing references)
            //IL_007a: Expected O, but got Unknown
            CellObject cellObject = objectWithLife.cellObject;

            if (cellObject.coords != position)
            {
                Log.Warning($"Was not on the specified cell of hit sequence: {cellObject.coords} instead of {position} ({objectWithLife.gameObject.get_name()}).", 49, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Maps\\Objects\\IObjectWithArmoredLife.cs");
                CellObject cellObject2 = cellObject.parentMap.GetCellObject(position.get_x(), position.get_y());
                objectWithLife.SetCellObject(cellObject2);
            }
            MonoBehaviourExtensions.StartCoroutineImmediateSafe(objectWithLife, objectWithLife.PlayLethalHitAnimation(), null);
        }
Ejemplo n.º 15
0
        public void SetPosition(IMap map, Vector2 position)
        {
            //IL_0000: Unknown result type (might be due to invalid IL or missing references)
            //IL_0001: Unknown result type (might be due to invalid IL or missing references)
            //IL_0006: Unknown result type (might be due to invalid IL or missing references)
            //IL_0023: Unknown result type (might be due to invalid IL or missing references)
            //IL_0024: Unknown result type (might be due to invalid IL or missing references)
            //IL_0025: Unknown result type (might be due to invalid IL or missing references)
            //IL_002a: Unknown result type (might be due to invalid IL or missing references)
            //IL_002f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0031: Unknown result type (might be due to invalid IL or missing references)
            Vector2Int val        = position.RoundToInt();
            CellObject cellObject = map.GetCellObject(val.get_x(), val.get_y());

            SetCellObject(cellObject);
            Vector2 cellObjectInnerPosition = position - Vector2Int.op_Implicit(val);

            SetCellObjectInnerPosition(cellObjectInnerPosition);
        }
Ejemplo n.º 16
0
        public override void CheckParentCellIndicator()
        {
            //IL_0035: Unknown result type (might be due to invalid IL or missing references)
            //IL_003a: Unknown result type (might be due to invalid IL or missing references)
            CellObject cellObject = m_cellObject;

            if (null == cellObject)
            {
                m_uiContainer.SetCellIndicator(MapCellIndicator.None);
                return;
            }
            IMap parentMap = cellObject.parentMap;

            if (parentMap == null)
            {
                m_uiContainer.SetCellIndicator(MapCellIndicator.None);
                return;
            }
            Vector2Int       coords        = cellObject.coords;
            MapCellIndicator cellIndicator = parentMap.GetCellIndicator(coords.get_x(), coords.get_y());

            m_uiContainer.SetCellIndicator(cellIndicator);
        }
Ejemplo n.º 17
0
 public virtual void AttachToCell([NotNull] CellObject containerCell)
 {
     m_cellObject = containerCell;
 }
Ejemplo n.º 18
0
        protected unsafe IEnumerator SlideRoutine(Vector2Int[] movementCells, bool followDirection)
        {
            int movementCellsCount = movementCells.Length;

            if (movementCellsCount == 0)
            {
                yield break;
            }
            CellObject cellObject = base.cellObject;
            IMap       parentMap  = cellObject.parentMap;
            Vector2Int val        = movementCells[0];

            if (cellObject.coords != val)
            {
                Log.Warning($"Was not on the start cell of a new movement sequence: {cellObject.coords} instead of {val} ({this.get_gameObject().get_name()}).", 528, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Maps\\Objects\\CharacterObject.cs");
                CellObject cellObject2 = parentMap.GetCellObject(val.get_x(), val.get_y());
                SetCellObject(cellObject2);
            }
            if (movementCellsCount > 1)
            {
                Direction direction = followDirection ? val.GetDirectionTo(movementCells[1]) : movementCells[1].GetDirectionTo(val);
                if (!direction.IsAxisAligned())
                {
                    direction = direction.GetAxisAligned(this.direction);
                }
                ChangeDirection(direction);
            }
            Vector2Int val2 = val;
            float      cellTraversalDuration = 2f / (float)GetAnimator().get_frameRate();
            int        num;

            for (int i = 1; i < movementCellsCount; i = num)
            {
                Vector2Int cellCoords   = movementCells[i];
                CellObject movementCell = parentMap.GetCellObject(cellCoords.get_x(), cellCoords.get_y());
                bool       goingUp      = ((IntPtr)(void *)movementCell.get_transform().get_position()).y >= ((IntPtr)(void *)cellObject.get_transform().get_position()).y;
                Vector2    innerPositionStart;
                Vector2    innerPositionEnd;
                if (goingUp)
                {
                    SetCellObject(movementCell);
                    innerPositionStart = Vector2Int.op_Implicit(val2 - cellCoords);
                    innerPositionEnd   = Vector2.get_zero();
                }
                else
                {
                    innerPositionStart = Vector2.get_zero();
                    innerPositionEnd   = Vector2Int.op_Implicit(cellCoords - val2);
                }
                float animationTime = 0f;
                do
                {
                    Vector2 cellObjectInnerPosition = Vector2.Lerp(innerPositionStart, innerPositionEnd, animationTime / cellTraversalDuration);
                    SetCellObjectInnerPosition(cellObjectInnerPosition);
                    yield return(null);

                    animationTime += Time.get_deltaTime();
                }while (animationTime < cellTraversalDuration);
                SetCellObjectInnerPosition(innerPositionEnd);
                if (!goingUp)
                {
                    SetCellObject(movementCell);
                }
                val2       = cellCoords;
                cellObject = movementCell;
                if (i < movementCellsCount - 1 && movementCell.TryGetIsoObject(out IObjectWithActivation isoObject))
                {
                    isoObject.PlayDetectionAnimation();
                }
                cellCoords = default(Vector2Int);
                num        = i + 1;
            }
        }
Ejemplo n.º 19
0
        protected unsafe IEnumerator MoveToRoutine(Vector2Int[] movementCells)
        {
            int movementCellsCount = movementCells.Length;

            if (movementCellsCount == 0)
            {
                yield break;
            }
            CellObject cellObj   = m_cellObject;
            IMap       parentMap = cellObj.parentMap;
            Animator2D animator  = m_animator2D;

            AnimatedFightCharacterData.IdleToRunTransitionMode idleToRunTransitionMode = m_characterData.idleToRunTransitionMode;
            Vector2Int startCell = movementCells[0];
            Vector2Int endCell   = movementCells[movementCellsCount - 1];

            if (cellObj.coords != startCell)
            {
                Log.Warning($"Was not on the start cell of a new movement sequence: {cellObj.coords} instead of {startCell} ({this.get_gameObject().get_name()}).", 232, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Maps\\Objects\\FightCharacterObject.cs");
                CellObject cellObject = parentMap.GetCellObject(startCell.get_x(), startCell.get_y());
                SetCellObject(cellObject);
            }
            if (idleToRunTransitionMode.HasFlag(AnimatedFightCharacterData.IdleToRunTransitionMode.IdleToRun))
            {
                Direction direction = (movementCellsCount >= 2) ? startCell.GetDirectionTo(movementCells[1]) : this.direction;
                CharacterAnimationInfo transitionAnimationInfo2 = new CharacterAnimationInfo(Vector2Int.op_Implicit(startCell), "idle_run", "idle-to-run", loops: false, direction, m_mapRotation);
                StartFightAnimation(transitionAnimationInfo2);
                while (!CharacterObjectUtility.HasAnimationEnded(animator, transitionAnimationInfo2))
                {
                    yield return(null);
                }
            }
            Vector2Int val = startCell;
            float      cellTraversalDuration = ((movementCellsCount <= 2) ? 5f : 4f) / (float)animator.get_frameRate();

            foreach (CharacterAnimationInfo item in CharacterFightMovementSequencer.ComputeMovement(movementCells, m_mapRotation))
            {
                Vector2Int cellCoords   = item.position.RoundToInt();
                CellObject movementCell = parentMap.GetCellObject(cellCoords.get_x(), cellCoords.get_y());
                bool       goingUp      = ((IntPtr)(void *)movementCell.get_transform().get_position()).y >= ((IntPtr)(void *)cellObj.get_transform().get_position()).y;
                Vector2    innerPositionStart;
                Vector2    innerPositionEnd;
                if (goingUp)
                {
                    SetCellObject(movementCell);
                    innerPositionStart = Vector2Int.op_Implicit(val - cellCoords);
                    innerPositionEnd   = Vector2.get_zero();
                }
                else
                {
                    innerPositionStart = Vector2.get_zero();
                    innerPositionEnd   = Vector2Int.op_Implicit(cellCoords - val);
                }
                StartFightAnimation(item, null, null, restart: false);
                float animationTime = 0f;
                do
                {
                    Vector2 cellObjectInnerPosition = Vector2.Lerp(innerPositionStart, innerPositionEnd, animationTime / cellTraversalDuration);
                    SetCellObjectInnerPosition(cellObjectInnerPosition);
                    yield return(null);

                    animationTime += Time.get_deltaTime();
                }while (animationTime < cellTraversalDuration);
                SetCellObjectInnerPosition(innerPositionEnd);
                if (!goingUp)
                {
                    SetCellObject(movementCell);
                }
                val     = cellCoords;
                cellObj = movementCell;
                if (cellCoords != endCell && movementCell.TryGetIsoObject(out IObjectWithActivation isoObject))
                {
                    isoObject.PlayDetectionAnimation();
                }
                cellCoords = default(Vector2Int);
            }
            if (idleToRunTransitionMode.HasFlag(AnimatedFightCharacterData.IdleToRunTransitionMode.RunToIdle))
            {
                CharacterAnimationInfo transitionAnimationInfo2 = new CharacterAnimationInfo(Vector2Int.op_Implicit(val), "run_idle", "run-to-idle", loops: false, this.direction, m_mapRotation);
                StartFightAnimation(transitionAnimationInfo2);
                while (!CharacterObjectUtility.HasAnimationEnded(animator, transitionAnimationInfo2))
                {
                    yield return(null);
                }
            }
        }
Ejemplo n.º 20
0
 public float AcquireRootDynamicObject([NotNull] DynamicObject dynamicObject, [NotNull] CellObject other)
 {
     m_rootDynamicChildren.Add(dynamicObject);
     other.m_rootDynamicChildren.Remove(dynamicObject);
     return(other.m_controlledLocalHeight - m_controlledLocalHeight);
 }