Ejemplo n.º 1
0
 public void ApplyCellObjectAnimation([NotNull] CellObjectAnimationParameters parameters, Vector2Int origin, Quaternion rotation, float strength, float time)
 {
     //IL_000c: 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)
     if (parameters.isValid)
     {
         CellObjectAnimationInstance item = new CellObjectAnimationInstance(parameters, origin, rotation, strength, time);
         m_cellObjectAnimationInstances.Add(item);
     }
 }
Ejemplo n.º 2
0
        private void LateUpdate()
        {
            //IL_0096: Unknown result type (might be due to invalid IL or missing references)
            //IL_0131: Unknown result type (might be due to invalid IL or missing references)
            if (m_feedbackNeedsUpdate)
            {
                UpdateFeedbacks();
                m_feedbackNeedsUpdate = false;
            }
            MapVirtualGrid    virtualGrid    = m_virtualGrid;
            List <CellObject> referenceCells = m_referenceCells;
            List <CellObject> linkedCells    = m_linkedCells;
            List <CellObjectAnimationInstance> cellObjectAnimationInstances = m_cellObjectAnimationInstances;
            float deltaTime       = Time.get_deltaTime();
            float gravityVelocity = deltaTime * m_gravity;

            if (m_virtualGridIsDirty)
            {
                referenceCells.Clear();
                virtualGrid.GetReferenceCellsNoAlloc(referenceCells);
                m_virtualGridIsDirty = false;
            }
            int count  = referenceCells.Count;
            int count2 = cellObjectAnimationInstances.Count;

            if (count2 > 0)
            {
                for (int i = 0; i < count2; i++)
                {
                    CellObjectAnimationInstance cellObjectAnimationInstance = cellObjectAnimationInstances[i];
                    for (int j = 0; j < count; j++)
                    {
                        CellObject cellObject  = referenceCells[j];
                        float      heightDelta = cellObjectAnimationInstance.Resolve(cellObject.coords);
                        cellObject.ApplyAnimation(heightDelta);
                    }
                }
                cellObjectAnimationInstances.Clear();
                m_cellObjectNeedsCleanup = true;
            }
            else if (m_cellObjectNeedsCleanup)
            {
                bool flag = false;
                for (int k = 0; k < count; k++)
                {
                    flag = (referenceCells[k].CleanupAnimation(deltaTime, gravityVelocity) | flag);
                }
                m_cellObjectNeedsCleanup = flag;
            }
            for (int l = 0; l < count; l++)
            {
                CellObject cellObject2 = referenceCells[l];
                bool       isSleeping  = cellObject2.ResolvePhysics(deltaTime, gravityVelocity);
                linkedCells.Clear();
                virtualGrid.GetLinkedCellsNoAlloc(cellObject2.coords, linkedCells);
                int count3 = linkedCells.Count;
                for (int m = 0; m < count3; m++)
                {
                    linkedCells[m].CopyPhysics(cellObject2, isSleeping, deltaTime, gravityVelocity);
                }
            }
        }