コード例 #1
0
    /// <summary>
    /// 设置子弹位置
    /// <para>bullet</para>
    /// <para>posX</para>
    /// <para>posY</para>
    /// </summary>
    /// <param name="luaState"></param>
    /// <returns></returns>
    public static int SetBulletPos(ILuaState luaState)
    {
        EnemyBulletBase bullet = luaState.ToUserData(-3) as EnemyBulletBase;
        float           posX   = (float)luaState.ToNumber(-2);
        float           posY   = (float)luaState.ToNumber(-1);

        luaState.Pop(3);
        bullet.SetPosition(posX, posY);
        return(0);
    }