Beispiel #1
0
 // Token: 0x0600100C RID: 4108 RVA: 0x001C72FC File Offset: 0x001C54FC
 public void Update()
 {
     if (!this.ImgRect.gameObject.activeSelf)
     {
         return;
     }
     if (this.animImg != null)
     {
         if (this.spriteAnim != null)
         {
             this.spriteAnim.Update();
         }
         if (this.SpeedTime > 0f)
         {
             if (this.SpeedTime <= this.DeltaTime)
             {
                 this.SpeedTime = 0f;
                 this.animImg.transform.localPosition = this.Destination;
                 this.rectTransform.localRotation     = new Quaternion(0f, 0f, 0f, 0f);
                 this.spriteAnim.m_Sprites            = SheetAnimationUnitGroup.GetActionSpriteArray(0, this.State, this.Angle);
             }
             else
             {
                 this.animImg.transform.localPosition = this.Source + (this.Destination - this.Source) * (this.DeltaTime / this.SpeedTime);
                 this.DeltaTime += Time.deltaTime;
             }
         }
     }
 }
Beispiel #2
0
    // Token: 0x06000AAF RID: 2735 RVA: 0x000E5728 File Offset: 0x000E3928
    public override void RunSpecialSimuMode(LineNode node)
    {
        byte b = 0;

        SheetAnimationUnitGroup.getSpriteDirFromAngle(node.angle, out b);
        float num  = Mathf.Min(node.timeOffset * node.inverseTransferTime, 1f);
        float num2 = Mathf.Min(5f, node.touchDownDistance * 0.5f);
        float num3 = Mathf.Max(0f, GameConstants.CubicBezierCurves(new Vector2(0f, 0f), new Vector2(num2, num2), new Vector2(node.touchDownDistance, num2), new Vector2(node.touchDownDistance, 0f), node.inverseTransferTime, node.timeOffset).y);
        float num4 = 0.5f * num3 * 0.2857143f;
        float num5 = this.CheckValueVaild(Mathf.Max(0.1f, 1f - num4), 1f);
        float num6 = this.CheckValueVaild(1f + num4, 1f);

        for (int i = 0; i < this.Count; i++)
        {
            if (this.animUnit[i] != null && this.animUnit[i].SoccerUnit != 0)
            {
                if (this.animUnit[i].SoccerUnit == 1)
                {
                    this.animUnit[i].transform.localPosition  = new Vector3(0f, num3, this.animUnit[i].transform.localPosition.z);
                    this.animUnit[i].transform.localPosition += this.animUnit[i].LocalOffset;
                }
                if (b != 2 && this.animUnit[i].SoccerUnit == 1)
                {
                    this.animUnit[i].transform.localScale = new Vector3(num6, num6, num6);
                }
                if (this.animUnit[i].SoccerUnit == 2)
                {
                    this.animUnit[i].transform.localScale = new Vector3(num5, num5, num5);
                }
            }
        }
    }
Beispiel #3
0
    // Token: 0x060012AE RID: 4782 RVA: 0x0020B908 File Offset: 0x00209B08
    protected void Awake()
    {
        LandWalkerManager._instance          = this;
        this.WalkerCenter                    = new GameObject();
        this.WalkerCenter.name               = "LandWalkers";
        this.WalkerCenter.transform.position = Vector3.zero;
        SheetAnimationUnitGroup.InitResource();
        this.walkers        = new List <LandWalker>();
        this.freeWalkers    = new List <LandWalker>();
        this.WalkerMarks    = new List <ushort>();
        this.WalkerGroupIdx = new ushort[DataManager.Instance.LandWalkerData.TableCount + 1];
        int    num  = 0;
        ushort num2 = 0;
        ushort num3 = 0;

        while ((int)num3 < DataManager.Instance.LandWalkerData.TableCount)
        {
            this.walkerData = DataManager.Instance.LandWalkerData.GetRecordByIndex((int)num3);
            if (num != (int)this.walkerData.groupID)
            {
                num = (int)this.walkerData.groupID;
                this.WalkerMarks.Add(num3);
                num2 += 1;
            }
            this.WalkerGroupIdx[(int)num3] = num2;
            num3 += 1;
        }
        this.WalkerCount = new WalkerGenData[this.WalkerMarks.Count];
        LandWalkerManager.SetNewCastleLevel(GUIManager.Instance.BuildingData.GetBuildData(8, 0).Level);
        this.enabled = true;
    }
Beispiel #4
0
 // Token: 0x06001009 RID: 4105 RVA: 0x001C71D4 File Offset: 0x001C53D4
 public void SetAnimState(UIAlliance_Control.eRankState state)
 {
     if (state == UIAlliance_Control.eRankState.RankUp || state == UIAlliance_Control.eRankState.RankEqual)
     {
         this.State = 9;
     }
     else
     {
         this.State = 22;
     }
     this.Angle = 270f;
     this.spriteAnim.m_Sprites = SheetAnimationUnitGroup.GetActionSpriteArray(0, this.State, this.Angle);
     this.spriteAnim.SetSpriteIndex(0);
 }
Beispiel #5
0
 // Token: 0x0600100A RID: 4106 RVA: 0x001C7238 File Offset: 0x001C5438
 public void MoveTo(Transform DestTran, float Z, float angle, float speed = 1f)
 {
     this.Source        = this.animImg.transform.localPosition;
     this.Destination   = DestTran.localPosition;
     this.DeltaTime     = 0f;
     this.Destination.z = Z;
     this.Source.z      = Z;
     if (angle > 180f)
     {
         this.rectTransform.localRotation = new Quaternion(0f, 180f, 0f, 0f);
     }
     this.spriteAnim.m_Sprites = SheetAnimationUnitGroup.GetActionSpriteArray(0, this.State, angle);
     this.spriteAnim.SetSpriteIndex(0);
     this.SpeedTime = speed;
 }
Beispiel #6
0
    // Token: 0x06000AA7 RID: 2727 RVA: 0x000E52C8 File Offset: 0x000E34C8
    private SheetAnimationUnit GetFreeUnit(byte Side, byte Kind, byte dir, bool bMirror, bool AttackerDirection = false, bool reverse = false)
    {
        uint actionID = SheetAnimationUnitGroup.GetActionID(Side, Kind, dir);

        if (this.IsSoccer(Kind) != 0)
        {
            SheetAnimationUnitGroup.InitSoccerRes();
        }
        Material material = (this.IsSoccer(Kind) == 0) ? SheetAnimationUnitGroup.sharedMat : SheetAnimationUnitGroup.sharedSoccerMat;

        if (SheetAnimationUnitGroup.m_FreeList.Count == 0)
        {
            return(new SheetAnimationUnit(actionID, SheetAnimationUnitGroup.AnimMap, material, bMirror, 1f, AttackerDirection, reverse));
        }
        SheetAnimationUnit sheetAnimationUnit = SheetAnimationUnitGroup.m_FreeList[SheetAnimationUnitGroup.m_FreeList.Count - 1];

        SheetAnimationUnitGroup.m_FreeList.RemoveAt(SheetAnimationUnitGroup.m_FreeList.Count - 1);
        sheetAnimationUnit.ResetUnit(actionID, SheetAnimationUnitGroup.AnimMap, material, bMirror, 1f, AttackerDirection, reverse);
        return(sheetAnimationUnit);
    }
    // Token: 0x06000AC9 RID: 2761 RVA: 0x000E740C File Offset: 0x000E560C
    private void addAnimUnit(byte Side, byte Kind, byte dir, bool bMirror, Vector3 localOffset, int zOrder = 0, bool AttackerDirection = false)
    {
        uint actionID = SheetAnimationUnitGroup.GetActionID(Side, Kind, dir);

        if (SheetAnimationUnitGroupNewbie.m_FreeList.Count == 0)
        {
            SheetAnimationUnit sheetAnimationUnit = new SheetAnimationUnit(actionID, SheetAnimationUnitGroupNewbie.AnimMap, SheetAnimationUnitGroupNewbie.sharedMat, bMirror, 1f, AttackerDirection, false);
            this.animUnit[this.Count] = sheetAnimationUnit;
        }
        else
        {
            this.animUnit[this.Count] = SheetAnimationUnitGroupNewbie.m_FreeList[SheetAnimationUnitGroupNewbie.m_FreeList.Count - 1];
            SheetAnimationUnitGroupNewbie.m_FreeList.RemoveAt(SheetAnimationUnitGroupNewbie.m_FreeList.Count - 1);
            this.animUnit[this.Count].ResetUnit(actionID, SheetAnimationUnitGroupNewbie.AnimMap, SheetAnimationUnitGroupNewbie.sharedMat, bMirror, 1f, AttackerDirection, false);
        }
        this.animUnit[this.Count].transform.parent = this.transform;
        localOffset.z = (float)zOrder * -0.01f;
        this.animUnit[this.Count].transform.localPosition = localOffset;
        this.animUnit[this.Count].transform.localScale    = Vector3.one;
        this.Count++;
    }
Beispiel #8
0
    // Token: 0x060012AC RID: 4780 RVA: 0x0020B850 File Offset: 0x00209A50
    public static void Release()
    {
        if (LandWalkerManager._instance == null)
        {
            return;
        }
        LandWalkerManager._instance.ClearWalkers();
        for (int i = 0; i < LandWalkerManager._instance.freeWalkers.Count; i++)
        {
            LandWalkerManager._instance.freeWalkers[i].movingUnit.RecoverUnit();
            LandWalkerManager._instance.freeWalkers[i].movingUnit = null;
        }
        LandWalkerManager._instance.freeWalkers.Clear();
        LandWalkerManager instance = LandWalkerManager._instance;

        LandWalkerManager._instance = null;
        SheetAnimationUnitGroup.FreeResource();
        if (instance.WalkerCenter != null)
        {
            UnityEngine.Object.Destroy(instance.WalkerCenter);
        }
    }
Beispiel #9
0
 // Token: 0x06000A9E RID: 2718 RVA: 0x000E46B8 File Offset: 0x000E28B8
 public Material GetSoccerSharedMat()
 {
     SheetAnimationUnitGroup.InitSoccerRes();
     return(SheetAnimationUnitGroup.sharedSoccerMat);
 }
Beispiel #10
0
    // Token: 0x06000AA5 RID: 2725 RVA: 0x000E4E24 File Offset: 0x000E3024
    public void setupLandAnimUnit(byte Side, byte lineFlag, int angle)
    {
        this.Count = 0;
        byte b = 0;

        angle = (560 - angle) % 360;
        bool          spriteDirFromAngle = SheetAnimationUnitGroup.getSpriteDirFromAngle((float)angle, out b);
        MarchPaltform recordByKey        = DataManager.Instance.MarchPaltformTable.GetRecordByKey((ushort)lineFlag);
        int           num  = 0;
        int           num2 = 0;

        if (b == 0)
        {
            num  = (int)recordByKey.UpStartID;
            num2 = (int)recordByKey.UpEndID;
        }
        else if (b == 1)
        {
            num  = (int)recordByKey.UpRightStartID;
            num2 = (int)recordByKey.UpRightEndID;
        }
        else if (b == 2)
        {
            num  = (int)recordByKey.RightStartID;
            num2 = (int)recordByKey.RightEndID;
        }
        else if (b == 3)
        {
            num  = (int)recordByKey.DownRightStartID;
            num2 = (int)recordByKey.DownRightEndID;
        }
        else if (b == 4)
        {
            num  = (int)recordByKey.DownStartID;
            num2 = (int)recordByKey.DownEndID;
        }
        int num3 = num2 - num;
        int i    = 0;

        while (i <= num3)
        {
            MarchOffset recordByKey2 = DataManager.Instance.MarchOffsetTable.GetRecordByKey((ushort)(num + i));
            float       x            = (float)recordByKey2.OffsetX * 0.001f * (float)((recordByKey2.SignedX != 0) ? -1 : 1) * (float)((!spriteDirFromAngle) ? 1 : -1);
            float       y            = (float)recordByKey2.OffsetY * 0.001f * (float)((recordByKey2.SignedY != 0) ? -1 : 1);
            switch (recordByKey2.Kind)
            {
            case 5:
                switch (recordByKey2.AttackerDirection)
                {
                case 0:
                    this.addAnimUnit(Side, recordByKey2.Kind, 0, spriteDirFromAngle, new Vector3(x, y, 0f), 0, false, null, null, false);
                    break;

                case 1:
                    this.addAnimUnit(0, recordByKey2.Kind, 0, false, new Vector3(x, y, 0f), 0, false, null, null, false);
                    break;

                case 2:
                    this.addAnimUnit(0, recordByKey2.Kind, 0, true, new Vector3(x, y, 0f), 0, false, null, null, false);
                    break;

                case 3:
                    this.addAnimUnit(0, recordByKey2.Kind, 0, false, new Vector3(x, y, 0f), 0, true, null, null, false);
                    break;

                case 4:
                    this.addAnimUnit(0, recordByKey2.Kind, 0, true, new Vector3(x, y, 0f), 0, true, null, null, false);
                    break;

                case 5:
                    this.addAnimUnit(1, recordByKey2.Kind, 0, false, new Vector3(x, y, 0f), 0, false, null, null, false);
                    break;

                case 6:
                    this.addAnimUnit(1, recordByKey2.Kind, 0, true, new Vector3(x, y, 0f), 0, false, null, null, false);
                    break;

                case 7:
                    this.addAnimUnit(1, recordByKey2.Kind, 0, false, new Vector3(x, y, 0f), 0, true, null, null, false);
                    break;

                case 8:
                    this.addAnimUnit(1, recordByKey2.Kind, 0, true, new Vector3(x, y, 0f), 0, true, null, null, false);
                    break;
                }
                break;

            case 6:
                goto IL_429;

            case 7:
            case 8:
                this.addAnimUnit(0, recordByKey2.Kind, b, spriteDirFromAngle, new Vector3(x, y, 0f), 0, false, null, null, false);
                break;

            case 9:
                this.addAnimUnit(0, recordByKey2.Kind, 0, spriteDirFromAngle, new Vector3(x, y, 0f), 0, false, null, null, false);
                break;

            default:
                goto IL_429;
            }
IL_463:
            i++;
            continue;
IL_429:
            this.addAnimUnit(Side, recordByKey2.Kind, b, spriteDirFromAngle, new Vector3(x, y, 0f), 0, false, null, null, false);
            goto IL_463;
        }
    }
Beispiel #11
0
    // Token: 0x06000AA4 RID: 2724 RVA: 0x000E4A40 File Offset: 0x000E2C40
    public override void setupAnimUnit(byte Side, byte lineFlag, float angle, byte setupFlag = 0)
    {
        if (this.transform.childCount != 0)
        {
            this.RecoverUnit();
        }
        this.Count         = 0;
        this.hasSoccerBall = false;
        byte   b       = 0;
        bool   flag    = SheetAnimationUnitGroup.getSpriteDirFromAngle(angle, out b);
        ushort inKey   = 0;
        bool   reverse = false;
        bool   flag2   = (setupFlag & 2) != 0;
        bool   flag3   = (setupFlag & 4) != 0;
        bool   flag4   = (setupFlag & 8) != 0;
        bool   flag5   = (setupFlag & 16) != 0;

        if (flag2)
        {
            inKey = PetManager.Instance.MapDamageEffTable.GetRecordByKey((ushort)lineFlag).PaltformKey;
        }
        else if (flag3)
        {
            inKey   = 33;
            reverse = (b == 4 || flag);
            b       = ((b != 4) ? b : 0);
        }
        else if (flag4)
        {
            inKey = 36;
        }
        else
        {
            switch (lineFlag)
            {
            case 5:
            case 6:
            case 10:
            case 11:
            case 14:
            case 15:
            case 17:
            case 20:
                inKey = 5;
                break;

            case 7:
                inKey = 4;
                break;

            case 8:
            case 18:
                inKey = 30;
                break;

            case 9:
            case 19:
                inKey = 9;
                break;

            case 12:
                inKey = 7;
                break;

            case 13:
                inKey = 1;
                break;

            case 16:
                inKey = 3;
                break;

            case 21:
                inKey = 2;
                break;

            case 22:
                inKey = 10;
                break;

            case 23:
                inKey = 6;
                flag  = false;
                b     = 0;
                break;

            case 24:
            case 25:
                inKey = 6;
                flag  = false;
                b     = 0;
                break;

            case 26:
                inKey = 31;
                flag  = false;
                b     = 0;
                break;

            case 27:
                inKey = 11;
                flag  = false;
                break;

            case 28:
            case 29:
                inKey = 34;
                break;

            case 30:
                if (flag5)
                {
                    inKey = 37;
                }
                else
                {
                    inKey = 35;
                }
                break;
            }
        }
        if ((setupFlag & 1) != 0)
        {
            flag = true;
        }
        MarchPaltform recordByKey = DataManager.Instance.MarchPaltformTable.GetRecordByKey(inKey);
        int           num         = 0;
        int           num2        = 0;

        if (b == 0)
        {
            num  = (int)recordByKey.UpStartID;
            num2 = (int)recordByKey.UpEndID;
        }
        else if (b == 1)
        {
            num  = (int)recordByKey.UpRightStartID;
            num2 = (int)recordByKey.UpRightEndID;
        }
        else if (b == 2)
        {
            num  = (int)recordByKey.RightStartID;
            num2 = (int)recordByKey.RightEndID;
        }
        else if (b == 3)
        {
            num  = (int)recordByKey.DownRightStartID;
            num2 = (int)recordByKey.DownRightEndID;
        }
        else if (b == 4)
        {
            num  = (int)recordByKey.DownStartID;
            num2 = (int)recordByKey.DownEndID;
        }
        int num3 = num2 - num;

        for (int i = 0; i <= num3; i++)
        {
            MarchOffset recordByKey2 = DataManager.Instance.MarchOffsetTable.GetRecordByKey((ushort)(num + i));
            float       x            = (float)recordByKey2.OffsetX * 0.001f * (float)((recordByKey2.SignedX != 0) ? -1 : 1) * (float)((!flag) ? 1 : -1);
            float       y            = (float)recordByKey2.OffsetY * 0.001f * (float)((recordByKey2.SignedY != 0) ? -1 : 1);
            if (flag2 && (recordByKey2.Kind == 10 || recordByKey2.Kind == 11 || recordByKey2.Kind == 12))
            {
                flag = false;
                int   num4  = (int)(recordByKey2.Kind - 10);
                Color value = this.GetColorByMapDamageTb((ushort)lineFlag, (byte)num4);
                this.addAnimUnit(Side, recordByKey2.Kind, b, flag, new Vector3(x, y, 0f), i, false, new Color?(value), new float?(180f + angle), false);
            }
            else
            {
                this.addAnimUnit(Side, recordByKey2.Kind, b, flag, new Vector3(x, y, 0f), i, false, null, null, reverse);
            }
        }
    }
Beispiel #12
0
    // Token: 0x06000AA2 RID: 2722 RVA: 0x000E4810 File Offset: 0x000E2A10
    public static Sprite[] GetActionSpriteArray(byte Side, byte lineFlag, float angle)
    {
        byte   b = 0;
        bool   spriteDirFromAngle = SheetAnimationUnitGroup.getSpriteDirFromAngle(angle, out b);
        ushort inKey = 0;

        switch (lineFlag)
        {
        case 5:
        case 6:
        case 10:
        case 11:
        case 14:
        case 15:
        case 17:
        case 20:
            inKey = 5;
            break;

        case 7:
            inKey = 4;
            break;

        case 8:
        case 18:
            inKey = 30;
            break;

        case 9:
        case 19:
            inKey = 9;
            Side  = 0;
            break;

        case 12:
            inKey = 7;
            break;

        case 13:
            inKey = 1;
            break;

        case 16:
            inKey = 3;
            break;

        case 21:
            inKey = 2;
            break;

        case 22:
            inKey = 10;
            Side  = 0;
            break;

        case 23:
            inKey = 6;
            b     = 0;
            break;

        case 24:
        case 25:
            inKey = 6;
            b     = 0;
            break;

        case 26:
            inKey = 31;
            b     = 0;
            break;

        case 27:
            inKey = 11;
            b     = 0;
            Side  = 0;
            break;
        }
        MarchPaltform recordByKey = DataManager.Instance.MarchPaltformTable.GetRecordByKey(inKey);
        int           num         = 0;

        if (b == 0)
        {
            num = (int)recordByKey.UpStartID;
        }
        else if (b == 1)
        {
            num = (int)recordByKey.UpRightStartID;
        }
        else if (b == 2)
        {
            num = (int)recordByKey.RightStartID;
        }
        else if (b == 3)
        {
            num = (int)recordByKey.DownRightStartID;
        }
        else if (b == 4)
        {
            num = (int)recordByKey.DownStartID;
        }
        uint actionID = SheetAnimationUnitGroup.GetActionID(Side, DataManager.Instance.MarchOffsetTable.GetRecordByKey((ushort)num).Kind, b);

        return((!SheetAnimationUnitGroup.AnimMap.ContainsKey(actionID)) ? null : SheetAnimationUnitGroup.AnimMap[actionID]);
    }