示例#1
0
    public static bool GetLightUserDataField(object userData, TValue key, out TValue res)
    {
        switch (userData.GetType().Name)
        {
        //Stage
        case "ExtraTaskManager":
            return(StageTaskLuaInterface.Get(userData, key, out res));

        // Character
        case "Reimu":
            return(ReimuALuaInterface.Get(userData, key, out res));

        case "MarisaA":
            return(MarisaALuaInterface.Get(userData, key, out res));

        // EnemyBullet
        case "EnemySimpleBullet":
            return(EnemySimpleBulletLuaInterface.Get(userData, key, out res));

        case "EnemyLaser":
            return(EnemyLaserLuaInterface.Get(userData, key, out res));

        case "EnemyLinearLaser":
            return(LinearLaserLuaInterface.Get(userData, key, out res));

        case "EnemyCurveLaser":
            return(CurveLaserLuaInterface.Get(userData, key, out res));

        case "NormalEnemy":
            return(NormalEnemyLuaInterface.Get(userData, key, out res));

        case "Boss":
            return(BossLuaInterface.Get(userData, key, out res));

        case "STGSpriteEffect":
            return(STGObjectLuaInterface.Get(userData, key, out res));

        // Collider
        case "ColliderCircle":
            return(ColliderCircleLuaInterface.Get(userData, key, out res));

        case "ColliderRect":
            return(ColliderRectLuaInterface.Get(userData, key, out res));

        case "ColliderItalicRect":
            return(ColliderItalicRectLuaInterface.Get(userData, key, out res));
        }
        res = new TValue();
        res.SetSValue(string.Format("GetField from userData fail!Invalid userData of type {0}", userData.GetType().Name));
        return(false);
    }
示例#2
0
    public static void RegisterLightUserDataLuaInterface()
    {
        UniLua.Utl.RegisterGetLightUserDataPropValueFunctionDelegate(GetLightUserDataField);
        UniLua.Utl.RegisterSetLightUserDataPropValueFunctionDelegate(SetLightUserDataField);

        StageTaskLuaInterface.Init();

        EnemySimpleBulletLuaInterface.Init();
        EnemyLaserLuaInterface.Init();
        LinearLaserLuaInterface.Init();
        CurveLaserLuaInterface.Init();
        NormalEnemyLuaInterface.Init();
        BossLuaInterface.Init();
        STGObjectLuaInterface.Init();

        ColliderCircleLuaInterface.Init();
        ColliderRectLuaInterface.Init();
        ColliderItalicRectLuaInterface.Init();

        ReimuALuaInterface.Init();
        MarisaALuaInterface.Init();
    }