static int _m_Begin(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); UnityEngine.Profiling.CustomSampler __cl_gen_to_be_invoked = (UnityEngine.Profiling.CustomSampler)translator.FastGetCSObj(L, 1); int __gen_param_count = LuaAPI.lua_gettop(L); try { if (__gen_param_count == 1) { __cl_gen_to_be_invoked.Begin( ); return(0); } if (__gen_param_count == 2 && translator.Assignable <UnityEngine.Object>(L, 2)) { UnityEngine.Object targetObject = (UnityEngine.Object)translator.GetObject(L, 2, typeof(UnityEngine.Object)); __cl_gen_to_be_invoked.Begin(targetObject); return(0); } } catch (System.Exception __gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e)); } return(LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.Profiling.CustomSampler.Begin!")); }
/// <summary> /// Execute the system immediately. /// </summary> public void Update() { #if UNITY_EDITOR m_Sampler?.Begin(); #endif InternalUpdate(); #if UNITY_EDITOR m_Sampler?.End(); #endif }
static StackObject *Begin_1(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj) { CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject *ptr_of_this_method; StackObject *__ret = ILIntepreter.Minus(__esp, 1); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); UnityEngine.Profiling.CustomSampler instance_of_this_method = (UnityEngine.Profiling.CustomSampler) typeof(UnityEngine.Profiling.CustomSampler).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); instance_of_this_method.Begin(); return(__ret); }
private bool IsCanAttack(Actor attacker, Actor defender, ref bool show_tips) { if (attacker == null) { return(false); } if (defender == null) { return(false); } sampler.Begin(); bool is_enemy = IsEnemyRelation(attacker, defender, ref show_tips); sampler.End(); if (is_enemy == false) { if (show_tips) { bool is_friend = IsFriendRelation(attacker, defender); if (is_friend) { show_tips = false; ShowMessage(xc.DBConstText.GetText("SKILL_CANNT_ATTACK_FRIEND")); } } return(false); } if (defender.CanBeHited() == false) {//defender不可以被攻击 if (show_tips) { if (defender.IsPlayer() && defender.BuffCtrl != null && defender.BuffCtrl.HasActive(m_gamePKReviveBuffId)) { ShowMessage(xc.DBConstText.GetText("TRY_ATTACK_PLAYER_IN_REVIVE_BUFF")); } else {//目标处于不可攻击状态 ShowMessage(xc.DBConstText.GetText("TRY_ATTACK_TARGET_IN_CANT_BE_HITED")); } show_tips = false; } return(false); } return(true); }
public DisposableStruct(UnityEngine.Profiling.CustomSampler customSampler) { _sampler = customSampler; _sampler.Begin(); }