static int GetRandomAnimationID(IntPtr L) { LuaScriptMgr.CheckArgsCount(L, 2); BaseDataConfig2 obj = (BaseDataConfig2)LuaScriptMgr.GetNetObjectSelf(L, 1, "BaseDataConfig2"); uint arg0 = (uint)LuaScriptMgr.GetNumber(L, 2); uint o = obj.GetRandomAnimationID(arg0); LuaScriptMgr.Push(L, o); return(1); }
// Update is called once per frame void Update() { if (_modelID != 0) { int posID = 0; if (_player.gameObject && !_player.gameObject.GetComponent <Animation>().isPlaying&& _repeatTimes >= 0) { posID = _initAnimID; _repeatTimes -= 1; } if (_repeatTimes < 0) { posID = (int)_baseDataConfig.GetRandomAnimationID(_player.m_id); _repeatTimes = Random.Range(1, 4); } CommonFunction.PlayAnimation(_player, posID, _playNeedBall); } }