示例#1
0
    public Nr3DCharBase GetCollisionChar(Nr3DCharBase kChar, Vector2 movepos)
    {
        if (kChar.GetCharController() == null)
        {
            return(null);
        }
        Vector3      vector       = Vector3.zero;
        float        num          = -3.40282347E+38f;
        NkBattleChar nkBattleChar = null;

        NkBattleChar[] charArray = this.GetCharArray();
        for (int i = 0; i < charArray.Length; i++)
        {
            NkBattleChar nkBattleChar2 = charArray[i];
            if (nkBattleChar2 != null)
            {
                if (nkBattleChar2.GetBUID() != kChar.GetParentBattleChar().GetBUID())
                {
                    if (!(nkBattleChar2.Get3DChar().GetCharController() == null))
                    {
                        vector = nkBattleChar2.Get3DChar().GetCharController().transform.position;
                        float num2 = kChar.GetParentBattleChar().GetCharHalfBound() + nkBattleChar2.GetCharHalfBound();
                        float num3 = Vector2.Distance(movepos, new Vector2(vector.x, vector.z));
                        if (num3 <= num2 && num2 - num3 > num)
                        {
                            num          = num2 - num3;
                            nkBattleChar = nkBattleChar2;
                        }
                    }
                }
            }
        }
        if (nkBattleChar != null)
        {
            return(nkBattleChar.Get3DChar());
        }
        return(null);
    }