Exemple #1
0
        /** 生成处理器 */
        public void Generation()
        {
            int winId = War.sceneData.stageConfig.winId;

            if (winId <= 0)
            {
                return;
            }

            WinConfig winConfig = War.sceneData.stageConfig.winConfig;

            Debug.Log(string.Format("<color=yello>Generation winId={0} winConfig={1}</color>", winId, winConfig));
            Type type;

            if (ProcessorConfig.TryGetValue(winConfig.winType, out type))
            {
                winProcessor = gameObject.AddComponent(type) as WinProcessor;
                int        index  = ((int)winConfig.winType) - 1;
                GameObject viewGO = null;
                if (index < views.Length)
                {
                    viewGO = views[index];
                }

                winProcessor.Init(winConfig, viewGO);
                if (viewGO != null)
                {
                    viewGO.SetActive(true);
                }
            }
        }
        public override void Init(WinConfig winConfig, GameObject viewGO)
        {
            base.Init(winConfig, viewGO);

            view         = viewGO.GetComponent <Win_T1_Occupy_View>();
            view.maxTime = winConfig.t1_time;
        }
        public void Show()
        {
            winProcessor = War.winManager.winProcessor;
            if (winProcessor == null)
            {
                return;
            }

            winConfig = winProcessor.winConfig;
            int        index  = ((int)winConfig.winType) - 1;
            GameObject viewGO = null;

            if (index < views.Length)
            {
                viewGO = views[index];
            }

            if (viewGO != null)
            {
                viewGO.SetActive(true);
            }
            gameObject.SetActive(true);
            winProcessor.SetInfoPanel(viewGO);

            StartCoroutine(DelayPause());
        }
 static int ParseCsv(IntPtr L)
 {
     LuaScriptMgr.CheckArgsCount(L, 2);
     Games.Module.Wars.WinConfig obj = (Games.Module.Wars.WinConfig)LuaScriptMgr.GetNetObjectSelf(L, 1, "Games.Module.Wars.WinConfig");
     string[] objs0 = LuaScriptMgr.GetArrayString(L, 2);
     obj.ParseCsv(objs0);
     return(0);
 }
    static int ToString(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 1);
        Games.Module.Wars.WinConfig obj = (Games.Module.Wars.WinConfig)LuaScriptMgr.GetNetObjectSelf(L, 1, "Games.Module.Wars.WinConfig");
        string o = obj.ToString();

        LuaScriptMgr.Push(L, o);
        return(1);
    }
        public override void Init(WinConfig winConfig, GameObject viewGO)
        {
            base.Init(winConfig, viewGO);

            foreach (KeyValuePair <int, LegionData> kvp in  War.sceneData.legionDict)
            {
                if (kvp.Value.type != LegionType.Neutral && kvp.Value.GetRelation(War.ownLegionID) == RelationType.Enemy)
                {
                    enemySoliderAvatarId = kvp.Value.soliderData.avatarId;
                    break;
                }
            }

            view = viewGO.GetComponent <Win_T3_Attack_View>();
            view.enemySoliderAvatarId = enemySoliderAvatarId;
        }
    static int _CreateGames_Module_Wars_WinConfig(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 0)
        {
            Games.Module.Wars.WinConfig obj = new Games.Module.Wars.WinConfig();
            LuaScriptMgr.PushObject(L, obj);
            return(1);
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: Games.Module.Wars.WinConfig.New");
        }

        return(0);
    }
    static int get_winType(IntPtr L)
    {
        object o = LuaScriptMgr.GetLuaObject(L, 1);

        Games.Module.Wars.WinConfig obj = (Games.Module.Wars.WinConfig)o;

        if (obj == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name winType");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index winType on a nil value");
            }
        }

        LuaScriptMgr.Push(L, obj.winType);
        return(1);
    }
    static int set_avatar(IntPtr L)
    {
        object o = LuaScriptMgr.GetLuaObject(L, 1);

        Games.Module.Wars.WinConfig obj = (Games.Module.Wars.WinConfig)o;

        if (obj == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name avatar");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index avatar on a nil value");
            }
        }

        obj.avatar = LuaScriptMgr.GetArrayNumber <int>(L, 3);
        return(0);
    }
    static int set_paramB(IntPtr L)
    {
        object o = LuaScriptMgr.GetLuaObject(L, 1);

        Games.Module.Wars.WinConfig obj = (Games.Module.Wars.WinConfig)o;

        if (obj == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name paramB");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index paramB on a nil value");
            }
        }

        obj.paramB = (float)LuaScriptMgr.GetNumber(L, 3);
        return(0);
    }
    static int set_processDescription(IntPtr L)
    {
        object o = LuaScriptMgr.GetLuaObject(L, 1);

        Games.Module.Wars.WinConfig obj = (Games.Module.Wars.WinConfig)o;

        if (obj == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name processDescription");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index processDescription on a nil value");
            }
        }

        obj.processDescription = LuaScriptMgr.GetString(L, 3);
        return(0);
    }
Exemple #12
0
 virtual public void Init(WinConfig winConfig, GameObject viewGO)
 {
     this.winConfig = winConfig;
     this.viewGO    = viewGO;
 }
Exemple #13
0
        public override void Init(WinConfig winConfig, GameObject viewGO)
        {
            base.Init(winConfig, viewGO);

            view = viewGO.GetComponent <Win_T2_Defend_View>();
        }
Exemple #14
0
 public void AddWinConfig(WinConfig config)
 {
     winConfigs.Add(config.id, config);
 }