Ejemplo n.º 1
0
 // Token: 0x06000AA1 RID: 2721 RVA: 0x000E47A0 File Offset: 0x000E29A0
 public override void RecoverUnit()
 {
     for (int i = 0; i < this.Count; i++)
     {
         if (this.animUnit[i] != null)
         {
             SheetAnimationUnit sheetAnimationUnit = this.animUnit[i];
             this.animUnit[i] = null;
             sheetAnimationUnit.transform.parent = null;
             sheetAnimationUnit.gameObject.SetActive(false);
             SheetAnimationUnitGroup.m_FreeList.Add(sheetAnimationUnit);
         }
     }
     this.Count = 0;
 }
Ejemplo n.º 2
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++;
    }