参见:MonoBehaviour 和 Component.
static int _CreateUnityEngine_Behaviour(IntPtr L) { #if UNITY_EDITOR ToluaProfiler.AddCallRecord("UnityEngine.Behaviour.ctor"); #endif try { int count = LuaDLL.lua_gettop(L); if (count == 0) { UnityEngine.Behaviour obj = new UnityEngine.Behaviour(); ToLua.Push(L, obj); return(1); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: UnityEngine.Behaviour.New")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static void Behaviour_isActiveAndEnabled(JSVCall vc) { UnityEngine.Behaviour _this = (UnityEngine.Behaviour)vc.csObj; var result = _this.isActiveAndEnabled; JSApi.setBooleanS((int)JSApi.SetType.Rval, (System.Boolean)(result)); }
static public int constructor(IntPtr l) { UnityEngine.Behaviour o; o = new UnityEngine.Behaviour(); pushObject(l, o); return(1); }
static int GetActive(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 1 && TypeChecker.CheckTypes(L, 1, typeof(UnityEngine.GameObject))) { UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.ToObject(L, 1); bool o = NGUITools.GetActive(arg0); LuaDLL.lua_pushboolean(L, o); return(1); } else if (count == 1 && TypeChecker.CheckTypes(L, 1, typeof(UnityEngine.Behaviour))) { UnityEngine.Behaviour arg0 = (UnityEngine.Behaviour)ToLua.ToObject(L, 1); bool o = NGUITools.GetActive(arg0); LuaDLL.lua_pushboolean(L, o); return(1); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: NGUITools.GetActive")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
void SwitchGroup(Behaviour[] behaviours, bool bGroupOn) { for (int i = 0; i < behaviours.Length; ++i) { behaviours[i].enabled = bGroupOn; } }
private void Shuffle() { Behaviour lastRunningNode = null; if (CurrentStatus == BehaviourStatus.Running) { lastRunningNode = _children[_lastIndex]; } for (int i = base.ChildrenCount; i >= 0; i--) { int toSwitch = Random.Range(0, i); Behaviour tmp = _children[i - 1]; _children[i - 1] = _children[toSwitch]; _children[toSwitch] = tmp; } if (lastRunningNode == null) { return; } for (int i = 0; i < base.ChildrenCount; i++) { if (_children[i] == lastRunningNode) { Behaviour tmp = _children[i]; _children[i] = _children[0]; _children[0] = tmp; break; } } }
static public int get_isActiveAndEnabled(IntPtr l) { try { #if DEBUG var method = System.Reflection.MethodBase.GetCurrentMethod(); string methodName = GetMethodName(method); #if UNITY_5_5_OR_NEWER UnityEngine.Profiling.Profiler.BeginSample(methodName); #else Profiler.BeginSample(methodName); #endif #endif UnityEngine.Behaviour self = (UnityEngine.Behaviour)checkSelf(l); pushValue(l, true); pushValue(l, self.isActiveAndEnabled); return(2); } catch (Exception e) { return(error(l, e)); } #if DEBUG finally { #if UNITY_5_5_OR_NEWER UnityEngine.Profiling.Profiler.EndSample(); #else Profiler.EndSample(); #endif } #endif }
public static int obj_hash(long L) { UnityEngine.Behaviour obj = FCGetObj.GetObj <UnityEngine.Behaviour>(L); if (obj != null) { return(obj.GetHashCode()); } return(0); }
static public int set_enabled(IntPtr l) { UnityEngine.Behaviour o = (UnityEngine.Behaviour)checkSelf(l); bool v; checkType(l, 2, out v); o.enabled = v; return(0); }
public override void Reset() { gameObject = null; script = null; component = null; enable = true; allScripts = false; inclChildren = false; }
static public int get_isActiveAndEnabled(IntPtr l) { try { UnityEngine.Behaviour self = (UnityEngine.Behaviour)checkSelf(l); pushValue(l, self.isActiveAndEnabled); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int get_enabled(IntPtr l) { try { UnityEngine.Behaviour self = (UnityEngine.Behaviour)checkSelf(l); pushValue(l, self.enabled); return(1); } catch (Exception e) { LuaDLL.luaL_error(l, e.ToString()); return(0); } }
static public int constructor(IntPtr l) { try { UnityEngine.Behaviour o; o = new UnityEngine.Behaviour(); pushValue(l, o); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int constructor(IntPtr l) { try { UnityEngine.Behaviour o; o=new UnityEngine.Behaviour(); pushValue(l,true); pushValue(l,o); return 2; } catch(Exception e) { return error(l,e); } }
static public int set_enabled(IntPtr l) { try { UnityEngine.Behaviour self = (UnityEngine.Behaviour)checkSelf(l); bool v; checkType(l, 2, out v); self.enabled = v; return(0); } catch (Exception e) { return(error(l, e)); } }
public static int constructor(IntPtr l) { try { UnityEngine.Behaviour o; o=new UnityEngine.Behaviour(); pushValue(l,o); return 1; } catch(Exception e) { LuaDLL.luaL_error(l, e.ToString()); return 0; } }
static public int constructor(IntPtr l) { try { UnityEngine.Behaviour o; o = new UnityEngine.Behaviour(); pushValue(l, o); return(1); } catch (Exception e) { LuaDLL.luaL_error(l, e.ToString()); return(0); } }
static public int constructor(IntPtr l) { LuaDLL.lua_remove(l, 1); UnityEngine.Behaviour o; if (matchType(l, 1)) { o = new UnityEngine.Behaviour(); pushObject(l, o); return(1); } LuaDLL.luaL_error(l, "New object failed."); return(0); }
public static bool obj_equal(long L, long R) { UnityEngine.Behaviour left = FCGetObj.GetObj <UnityEngine.Behaviour>(L); UnityEngine.Behaviour right = FCGetObj.GetObj <UnityEngine.Behaviour>(R); if (left != null) { return(left.Equals(right)); } if (right != null) { return(right.Equals(left)); } return(true); }
public int GetCurrentBehaviourIndex(Behaviour []methodList, Behaviour currentBehaviour) { if(currentBehaviour != null) { int objectCount = methodList.Length; for(int i = 0; i < objectCount; ++i) { if(string.Equals(methodList[i].ToString(), currentBehaviour.ToString()) == true) return i; } } return 0; }
public static int set_enabled_wrap(long L) { try { long nThisPtr = FCLibHelper.fc_get_inport_obj_ptr(L); UnityEngine.Behaviour ret = get_obj(nThisPtr); bool arg0 = FCLibHelper.fc_get_bool(L, 0); ret.enabled = arg0; } catch (Exception e) { Debug.LogException(e); } return(0); }
public static int get_enabled_wrap(long L) { try { long nThisPtr = FCLibHelper.fc_get_inport_obj_ptr(L); UnityEngine.Behaviour ret = get_obj(nThisPtr); long ret_ptr = FCLibHelper.fc_get_return_ptr(L); FCLibHelper.fc_set_value_bool(ret_ptr, ret.enabled); } catch (Exception e) { Debug.LogException(e); } return(0); }
// fields // properties static void Behaviour_enabled(JSVCall vc) { if (vc.bGet) { UnityEngine.Behaviour _this = (UnityEngine.Behaviour)vc.csObj; var result = _this.enabled; JSApi.setBooleanS((int)JSApi.SetType.Rval, (System.Boolean)(result)); } else { System.Boolean arg0 = (System.Boolean)JSApi.getBooleanS((int)JSApi.GetType.Arg); UnityEngine.Behaviour _this = (UnityEngine.Behaviour)vc.csObj; _this.enabled = arg0; } }
static int set_enabled(IntPtr L) { UnityEngine.Behaviour obj = (UnityEngine.Behaviour)ToLua.ToObject(L, 1); bool arg0 = LuaDLL.luaL_checkboolean(L, 2); try { obj.enabled = arg0; } catch (Exception e) { return(LuaDLL.luaL_error(L, obj == null ? "attempt to index enabled on a nil value" : e.Message)); } return(0); }
static int get_isActiveAndEnabled(IntPtr L) { UnityEngine.Behaviour obj = (UnityEngine.Behaviour)ToLua.ToObject(L, 1); bool ret; try { ret = obj.isActiveAndEnabled; } catch (Exception e) { return(LuaDLL.luaL_error(L, obj == null ? "attempt to index isActiveAndEnabled on a nil value" : e.Message)); } LuaDLL.lua_pushboolean(L, ret); return(1); }
static int _CreateUnityEngine_Behaviour(IntPtr L) { int count = LuaDLL.lua_gettop(L); if (count == 0) { UnityEngine.Behaviour obj = new UnityEngine.Behaviour(); ToLua.Push(L, obj); return(1); } else { LuaDLL.luaL_error(L, "invalid arguments to method: UnityEngine.Behaviour.New"); } return(0); }
static int set_enabled(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.Behaviour obj = (UnityEngine.Behaviour)o; bool arg0 = LuaDLL.luaL_checkboolean(L, 2); obj.enabled = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index enabled on a nil value")); } }
static int get_isActiveAndEnabled(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.Behaviour obj = (UnityEngine.Behaviour)o; bool ret = obj.isActiveAndEnabled; LuaDLL.lua_pushboolean(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index isActiveAndEnabled on a nil value" : e.Message)); } }
static int QPYX__CreateUnityEngine_Behaviour_YXQP(IntPtr L_YXQP) { try { int QPYX_count_YXQP = LuaDLL.lua_gettop(L_YXQP); if (QPYX_count_YXQP == 0) { UnityEngine.Behaviour QPYX_obj_YXQP = new UnityEngine.Behaviour(); ToLua.Push(L_YXQP, QPYX_obj_YXQP); return(1); } else { return(LuaDLL.luaL_throw(L_YXQP, "invalid arguments to ctor method: UnityEngine.Behaviour.New")); } } catch (Exception e_YXQP) { return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP)); } }
static int get_isActiveAndEnabled(IntPtr L) { #if UNITY_EDITOR ToluaProfiler.AddCallRecord("UnityEngine.Behaviour.isActiveAndEnabled"); #endif object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.Behaviour obj = (UnityEngine.Behaviour)o; bool ret = obj.isActiveAndEnabled; LuaDLL.lua_pushboolean(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index isActiveAndEnabled on a nil value")); } }
static int set_enabled(IntPtr L) { #if UNITY_EDITOR ToluaProfiler.AddCallRecord("UnityEngine.Behaviour.enabled"); #endif object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.Behaviour obj = (UnityEngine.Behaviour)o; bool arg0 = LuaDLL.luaL_checkboolean(L, 2); obj.enabled = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index enabled on a nil value")); } }
void DoEnableBehaviour(GameObject go) { if (go == null) return; if (component != null) { componentTarget = component as Behaviour; } else { componentTarget = go.GetComponent(behaviour.Value) as Behaviour; } if (componentTarget == null) { LogWarning(" " + go.name + " missing behaviour: " + behaviour.Value); return; } componentTarget.enabled = enable.Value; }
static int _CreateUnityEngine_Behaviour(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 0) { UnityEngine.Behaviour obj = new UnityEngine.Behaviour(); ToLua.Push(L, obj); return(1); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: UnityEngine.Behaviour.New")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int _CreateUnityEngine_Behaviour(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 0) { UnityEngine.Behaviour obj = new UnityEngine.Behaviour(); ToLua.Push(L, obj); return 1; } else { return LuaDLL.luaL_throw(L, "invalid arguments to ctor method: UnityEngine.Behaviour.New"); } } catch(Exception e) { return LuaDLL.toluaL_exception(L, e); } }
public DirectorBehaviourControlEventArgs(UnityEngine.Behaviour behaviour, DirectorBehaviourControl control) { this.Behaviour = behaviour; this.Control = control; }
/// <summary> /// MonoBehaviour是否激活 /// </summary> /// <param name="mb"></param> /// <returns></returns> public static bool GetActive(Behaviour mb) { return mb && mb.enabled && mb.gameObject.activeInHierarchy; }
//! 子要素から取得可能条件 private bool Findable(Behaviour b) { // Pausableはdisableしない && すでにdisableのものは取得しない(Resumeでenableになってしまうので) return b != this && b.enabled; }
TweenParms KeepEnabled(Behaviour[] p_targets, bool p_enabled) { manageBehaviours = true; if (p_enabled) managedBehavioursOn = p_targets; else managedBehavioursOff = p_targets; return this; }
/// <summary> /// Keeps the given components disabled while the tween is playing /// </summary> public TweenParms KeepDisabled(Behaviour[] p_targets) { return KeepEnabled(p_targets, false); }
/// <summary> /// Keeps the given component disabled while the tween is playing /// </summary> public TweenParms KeepDisabled(Behaviour p_target) { if (p_target == null) { manageBehaviours = false; return this; } return KeepEnabled(new[] { p_target }, false); }
/// <summary> /// Keeps the given components enabled while the tween is playing /// </summary> public TweenParms KeepEnabled(Behaviour[] p_targets) { return KeepEnabled(p_targets, true); }
void DoEnableScript(GameObject go) { if (go == null) { return; } if (component != null) { componentTarget = component as Behaviour; componentTarget.enabled = enable.Value; } else { (go.gameObject.GetComponent(script.Value) as Behaviour).enabled = enable.Value; } if (inclChildren.Value == true) { for(int i=0; i< go.transform.childCount; i++) { var child = go.transform.GetChild(i).gameObject; if(child != null){ if (!string.IsNullOrEmpty(script.Value)) { (child.gameObject.GetComponent(script.Value) as Behaviour).enabled = enable.Value; } else if (string.IsNullOrEmpty(script.Value)){ Debug.LogWarning("!!!!!! Dropdown does not work with incl child. Please input script name !!!!!!"); return; } } } } }
private void StartAction(Behaviour actionToStart) { FacePlayer(); ActiveBehaviour = actionToStart; _rigidBody2D.velocity = new Vector2(0.0f, _rigidBody2D.velocity.y); _timedActionTimer = 0.0f; switch (actionToStart) { case Behaviour.Resting: StartResting(); break; case Behaviour.Walking: StartWalking(); break; case Behaviour.Jumping: SetAnimationFlags("Jumping"); break; case Behaviour.Stamping: SetAnimationFlags("Stamping"); break; case Behaviour.Firing: SetAnimationFlags("Firing"); break; } }
public Component(UnityEngine.Component source) { id = IdManager.Instance.CreateComponentId(); UnityEngine.Behaviour behaviour = source as UnityEngine.Behaviour; enabled = behaviour ? behaviour.enabled : true; }
// =================================================================================== // BEHAVIOURS/GAMEOBJECT MANAGEMENT METHODS ------------------------------------------ /// <summary> /// Keeps the given component enabled while the tween is playing /// </summary> public SequenceParms KeepEnabled(Behaviour p_target) { if (p_target == null) { manageBehaviours = false; return this; } return KeepEnabled(new[] { p_target }, true); }
public List<string> LoadMethodsFromGameObject(Behaviour []ListOfMethods) { List<string> listOfMethods = new List<string>(); int objectCount = ListOfMethods.Length; char[] Seperators = new char[2]; Seperators[0] = '('; Seperators[1] = ')'; for(int i = 0; i < objectCount; ++i) { string[] listOfTempNameStrings = ListOfMethods[i].ToString().Split(Seperators); listOfMethods.Add(listOfTempNameStrings[1]); } return listOfMethods; }
/// <summary> /// Keeps the given components disabled while the tween is playing /// </summary> public SequenceParms KeepDisabled(Behaviour[] p_targets) { return KeepEnabled(p_targets, false); }
public sBehaviour(Behaviour b) { enabled = b.enabled; }
public SidebarControlEventArgs(UnityEngine.Behaviour behaviour, DirectorEditor.SidebarControl control) { this.Behaviour = behaviour; this.SidebarControl = control; }