Ejemplo n.º 1
0
    public static void SaveString2()
    {
        TextAsset test = Resources.Load <TextAsset>("code/Skill001.lua");

        XLua.LuaEnv luaenv = new XLua.LuaEnv();
        //luaenv.DoString("CS.UnityEngine.Debug.Log('hello world')");
        luaenv.DoString(test.text);
        luaenv.Dispose();
        Debug.Log(test);
        return;

        CustomSkill skill = SkillUtils.MakeCustomSkill("001");

        skill.id = 001;
        skill.Trigger(CustomSkill.TriggerType.fight);
        return;

        FormulaUtils.GetTowerExtraAttributes(false);
        return;

        for (int i = 0; i < 10; i++)
        {
            Debug.Log(UnityEngine.Random.Range(0, 0.5f));
        }
        return;

        //PlayerSQLPrefs.yzTowerLevel = 10;
        //PlayerSQLPrefs.yzTowerABSLevel = 10;
        PlayerOtherItem.ReduceItem(GameInstance.GameDatabase.otherItem[0].Id, 10);
    }
Ejemplo n.º 2
0
        //public static PlayerItem CreateActorItemWithLevel(ICharacter itemData, int level)
        //{
        //    if (level <= 0)
        //        level = 1;
        //    //var itemTier = itemData.itemTier;
        //    var sumExp = 0;
        //    var result = new PlayerItem(PlayerItem.ItemType.character);
        //    result.itemType = PlayerItem.ItemType.character;
        //    for (var i = 1; i < level; ++i)
        //    {
        //        //sumExp += itemTier.expTable.Calculate(i + 1, itemTier.maxLevel);
        //        sumExp += Const.NextEXP;
        //    }
        //    result.ItemID = itemData.guid;
        //    //if(!isplayer)
        //    //result.GUID = itemData.;
        //    result.Exp = sumExp;
        //    result.ExtrAttributesData = GetExtraAttributes(type);
        //    return result;
        //}
        static CalculationAttributes GetExtraAttributes(Const.StageType type)
        {
            switch (type)
            {
            case Const.StageType.Normal:
                return(null);

                break;

            case Const.StageType.Tower:
                return(FormulaUtils.GetTowerExtraAttributes(false));

                break;
            }
            return(null);
        }