public void Initialize(MovementFeedbackResources resources, Material material, uint renderLayerMask)
        {
            //IL_001f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0025: Expected O, but got Unknown
            //IL_0064: Unknown result type (might be due to invalid IL or missing references)
            //IL_006e: Expected O, but got Unknown
            Sprite     allyCursorSprite = resources.allyCursorSprite;
            GameObject val = new GameObject("", new Type[1]
            {
                typeof(CellPointer)
            });
            CellPointer component = val.GetComponent <CellPointer>();

            component.Initialize(material, renderLayerMask);
            component.SetSprite(allyCursorSprite);
            val.SetActive(false);
            Object.DontDestroyOnLoad(val);
            GameObject  obj        = Object.Instantiate <GameObject>(val);
            CellPointer component2 = obj.GetComponent <CellPointer>();

            component2.Initialize(material, renderLayerMask);
            obj.SetActive(true);
            m_pool   = new GameObjectPool(val, 4);
            m_prefab = val;
            m_cursor = component2;
            CellPointer.Initialize();
        }
Exemple #2
0
        public void Setup(MovementFeedbackResources resources, List <Vector2Int> path, Vector2Int?target)
        {
            //IL_0031: Unknown result type (might be due to invalid IL or missing references)
            //IL_0036: 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)
            //IL_003f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0041: Unknown result type (might be due to invalid IL or missing references)
            //IL_0043: Unknown result type (might be due to invalid IL or missing references)
            //IL_00a4: Unknown result type (might be due to invalid IL or missing references)
            //IL_00b2: Unknown result type (might be due to invalid IL or missing references)
            //IL_00b4: Unknown result type (might be due to invalid IL or missing references)
            //IL_00bb: Unknown result type (might be due to invalid IL or missing references)
            //IL_00c0: 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_00c4: Unknown result type (might be due to invalid IL or missing references)
            //IL_00dd: Unknown result type (might be due to invalid IL or missing references)
            //IL_0102: Unknown result type (might be due to invalid IL or missing references)
            //IL_0106: Unknown result type (might be due to invalid IL or missing references)
            //IL_0123: Unknown result type (might be due to invalid IL or missing references)
            //IL_013a: Unknown result type (might be due to invalid IL or missing references)
            //IL_0155: Unknown result type (might be due to invalid IL or missing references)
            //IL_0163: Unknown result type (might be due to invalid IL or missing references)
            //IL_0165: Unknown result type (might be due to invalid IL or missing references)
            //IL_016c: Unknown result type (might be due to invalid IL or missing references)
            //IL_0171: Unknown result type (might be due to invalid IL or missing references)
            //IL_0173: Unknown result type (might be due to invalid IL or missing references)
            //IL_0175: Unknown result type (might be due to invalid IL or missing references)
            //IL_0191: Unknown result type (might be due to invalid IL or missing references)
            //IL_01b5: Unknown result type (might be due to invalid IL or missing references)
            //IL_01b7: Unknown result type (might be due to invalid IL or missing references)
            //IL_01be: Unknown result type (might be due to invalid IL or missing references)
            //IL_01c3: Unknown result type (might be due to invalid IL or missing references)
            //IL_01c5: Unknown result type (might be due to invalid IL or missing references)
            //IL_01c7: Unknown result type (might be due to invalid IL or missing references)
            //IL_01dc: Unknown result type (might be due to invalid IL or missing references)
            //IL_0204: Unknown result type (might be due to invalid IL or missing references)
            //IL_0208: Unknown result type (might be due to invalid IL or missing references)
            //IL_021d: Unknown result type (might be due to invalid IL or missing references)
            //IL_022c: Unknown result type (might be due to invalid IL or missing references)
            //IL_0239: Unknown result type (might be due to invalid IL or missing references)
            //IL_0247: Unknown result type (might be due to invalid IL or missing references)
            //IL_0249: Unknown result type (might be due to invalid IL or missing references)
            //IL_0250: Unknown result type (might be due to invalid IL or missing references)
            //IL_0255: Unknown result type (might be due to invalid IL or missing references)
            //IL_0257: Unknown result type (might be due to invalid IL or missing references)
            //IL_0259: Unknown result type (might be due to invalid IL or missing references)
            //IL_026e: Unknown result type (might be due to invalid IL or missing references)
            //IL_0296: Unknown result type (might be due to invalid IL or missing references)
            //IL_029a: Unknown result type (might be due to invalid IL or missing references)
            //IL_02af: Unknown result type (might be due to invalid IL or missing references)
            //IL_02be: Unknown result type (might be due to invalid IL or missing references)
            int count = path.Count;

            if (count < 2)
            {
                Clear();
                return;
            }
            Sprite[]              sprites     = resources.sprites;
            DirectionAngle        mapRotation = m_mapRotation;
            List <SpriteRenderer> active      = m_active;
            int        count2     = active.Count;
            Vector2Int val        = path[0];
            Vector2Int val2       = path[1];
            Direction  direction  = val.GetDirectionTo(val2).Rotate(mapRotation);
            Direction  direction2 = direction;

            if (count2 >= count)
            {
                for (int num = count2 - 1; num >= count; num--)
                {
                    SpriteRenderer val3 = active[num];
                    m_pool.Release(val3.get_gameObject());
                    m_active.RemoveAt(num);
                }
                SetStartSprite(sprites, active[0], val, direction2);
                for (int i = 1; i < count - 1; i++)
                {
                    val        = val2;
                    val2       = path[i + 1];
                    direction2 = val.GetDirectionTo(val2).Rotate(mapRotation);
                    SetSprite(sprites, active[i], val, direction2, direction);
                    direction = direction2;
                }
                if (target.HasValue)
                {
                    direction2 = val2.GetDirectionTo(target.Value).Rotate(mapRotation);
                    SetSprite(sprites, active[count - 1], val2, direction2, direction);
                }
                else
                {
                    SetEndSprite(sprites, active[count - 1], val2, direction2);
                }
            }
            else if (count2 > 0)
            {
                SetStartSprite(sprites, active[0], val, direction2);
                for (int j = 1; j < count2; j++)
                {
                    val        = val2;
                    val2       = path[j + 1];
                    direction2 = val.GetDirectionTo(val2).Rotate(mapRotation);
                    SetSprite(sprites, active[j], path[j], direction2, direction);
                    direction = direction2;
                }
                for (int k = count2; k < count - 1; k++)
                {
                    val        = val2;
                    val2       = path[k + 1];
                    direction2 = val.GetDirectionTo(val2).Rotate(mapRotation);
                    SetSprite(sprites, null, path[k], direction2, direction);
                    direction = direction2;
                }
                if (target.HasValue)
                {
                    direction2 = val2.GetDirectionTo(target.Value).Rotate(mapRotation);
                    SetSprite(sprites, null, val2, direction2, direction);
                }
                else
                {
                    SetEndSprite(sprites, null, val2, direction2);
                }
            }
            else
            {
                SetStartSprite(sprites, null, val, direction2);
                for (int l = 1; l < count - 1; l++)
                {
                    val        = val2;
                    val2       = path[l + 1];
                    direction2 = val.GetDirectionTo(val2).Rotate(mapRotation);
                    SetSprite(sprites, null, path[l], direction2, direction);
                    direction = direction2;
                }
                if (target.HasValue)
                {
                    direction2 = val2.GetDirectionTo(target.Value).Rotate(mapRotation);
                    SetSprite(sprites, null, val2, direction2, direction);
                }
                else
                {
                    SetEndSprite(sprites, null, val2, direction2);
                }
            }
        }