public static FloatEvent CreateEvent(string eventName, UnityAction <float, float> listener) { FloatEvent thisEvent = new FloatEvent(); Instance.eventDictionary.Add(eventName, thisEvent); return(thisEvent); }
static public int constructor(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 FloatEvent o; o = new FloatEvent(); pushValue(l, true); pushValue(l, o); 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 void CreateAnimationUnit(string name, AnimatorControllerParameterType type, BoolVariable boolVariable = null, IntVariable intVariable = null, FloatVariable floatVariable = null, AtomEvent atomEvent = null) { AnimationUnit unit = ScriptableObject.CreateInstance <AnimationUnit>(); unit.name = name; if (boolVariable != null) { unit.boolVariable = boolVariable; BoolEvent boolEvent = ScriptableObject.CreateInstance <BoolEvent>(); boolVariable.Changed = boolEvent; } else if (intVariable != null) { unit.intVariable = intVariable; IntEvent intEvent = ScriptableObject.CreateInstance <IntEvent>(); intVariable.Changed = intEvent; } else if (floatVariable != null) { unit.floatVariable = floatVariable; FloatEvent floatEvent = ScriptableObject.CreateInstance <FloatEvent>(); floatVariable.Changed = floatEvent; } else if (atomEvent != null) { unit.atomEvent = atomEvent; } AddToAnimationUnits(unit); SetUpAnimationUnit(unit); }
protected override void Awake() { base.Awake(); _normalScaleEvent = new FloatEvent(); _slowScaleEvent = new FloatEvent(); //_normalFixedDeltaTime = Time.fixedDeltaTime; }
public override void OnInspectorGUI() { FloatEvent script = (FloatEvent)target; //Event Description GUILayout.BeginVertical(); EditorGUILayout.LabelField("Event Description", EditorStyles.centeredGreyMiniLabel); EditorStyles.textField.wordWrap = true; script.EventDescription = EditorGUILayout.TextArea(script.EventDescription, GUILayout.MinHeight(100)); GUILayout.EndVertical(); //Test Event Button GUILayout.BeginVertical(EditorStyles.helpBox); EditorGUILayout.LabelField("Test Event", EditorStyles.centeredGreyMiniLabel); value = EditorGUILayout.FloatField("Value ", value); if (GUILayout.Button("Raise")) { if (Application.isPlaying) { script.Raise(value); } } GUILayout.EndVertical(); }
/* </Immunity */ // Start is called before the first frame update void Awake() { deathEvent = new UnityEvent(); healEvent = new FloatEvent(); damageEvent = new FloatEvent(); damageEvent.AddListener(TakeDamage); }
public SAxis(string[] names, bool sendWhenZeroToo) { this.names = names; this.sendWhenZeroToo = sendWhenZeroToo; events = new ButtonEvents(); AxisValue = null; isPressed = false; }
public static void TriggerEvent(GlobalEvents eventName, float val) { FloatEvent thisEvent = null; if (floatEventDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.Invoke(val); } }
public void OnEventRaised(float value) { FloatEvent floatEvent = gameEvent as FloatEvent; if (floatEvent) { floatResponse.Invoke(value); } }
// public static void TriggerGlobalEvent (string globalEventName, int value) // { // IntEvent thisEvent = null; // if (instance.IntEventDictionary.TryGetValue (globalEventName, out thisEvent)) // { // thisEvent.Invoke (value); // } // } public static void TriggerGlobalEvent(string globalEventName, float value) { FloatEvent thisEvent = null; if (instance.floatEventDictionary.TryGetValue(globalEventName, out thisEvent)) { thisEvent.Invoke(value); } }
public void StopListening(string eventName, UnityAction <object> listener) { FloatEvent thisEvent = null; if (eventDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.RemoveListener(listener); } }
public static void SafeInvoke(this FloatEvent e, Single value) { if (e == null) { return; } e.Invoke(value); }
public void TriggerEvent(string eventName, object obj) { FloatEvent thisEvent = null; if (eventDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.Invoke(obj); } }
public KeyToEventPair(string _axisName, params UnityAction <float>[] _floatAction) { axisName = _axisName; floatEvent = new FloatEvent(); foreach (UnityAction <float> ua in _floatAction) { floatEvent.AddListener(ua); } }
public static void TriggerEvent(string eventName, float parameter) { FloatEvent thisEvent = null; if (instance.eventDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.Invoke(parameter); } }
public static void Subscribe(this FloatEvent e, UnityAction <Single> action) { if (e == null || action == null) { return; } e.AddListener(action); }
public void AddBaseDamage(float val) { FloatEvent ev = new FloatEvent() { Value = val }; OnAddBaseDamage(ev); BlzSetUnitBaseDamage(_Self, R2I(ev.Value), 0); }
public static void TriggerEvent(Object obj, string eventName, float value) { FloatEvent thisEvent = null; string domain = GetDomain(obj, eventName); if (instance.floatEventDictionary.TryGetValue(domain, out thisEvent)) { thisEvent.Invoke(value); } }
private void Update() { if (Input.GetKeyDown(KeyCode.Space)) { _spaceCount++; FloatEvent?.Invoke(_spaceCount); ActionEvent?.Invoke(true, 56); } }
public SVector(Joystick[] names, NormalizationMode normalizationMode, bool sendWhenZeroToo) { this.names = names; this.normalizationMode = normalizationMode; this.sendWhenZeroToo = sendWhenZeroToo; events = new ButtonEvents(); JoystickValue = null; JoystickMagnitude = null; isPressed = false; }
public static void StopListeningFloatEvent(string eventName, UnityAction <float> listener) { Init(); FloatEvent thisFloatEvent = null; if (floatEventDictionary.TryGetValue(eventName, out thisFloatEvent)) { thisFloatEvent.RemoveListener(listener); } }
private FloatEvent GetOrCreateFloatEvent(string eventName) { UnityEventBase currentEvent = null; if (!Instance.m_EventDict.TryGetValue(eventName, out currentEvent)) { currentEvent = new FloatEvent(); Instance.m_EventDict.Add(eventName, currentEvent); } return(currentEvent as FloatEvent); }
public void AddGreyArmor(float val) { FloatEvent parsEvent = new FloatEvent() { Value = val }; OnAddGreyArmor(parsEvent); GreyArmor += parsEvent.Value; BlzSetUnitArmor(_Self, val + GreenArmor); }
public void AddBonusDamageFlat(int val) { BonusDamage += val; FloatEvent ev = new FloatEvent() { Value = BonusDamage }; OnAddBonusDamage(ev); SetGreenDamage(R2I(ev.Value + BlzGetUnitBaseDamage(_Self, 0) * BonusDamagePercent + Utils.ROUND_DOWN_CONST_OVERHEAD)); }
public void AddGreenArmor(float val) { FloatEvent parseEvent = new FloatEvent() { Value = val }; OnAddGreenArmor(parseEvent); GreenArmor += parseEvent.Value; SetGreenArmor(val); }
public void Reset() { DataDumpProperty = null; OnStringUpdated = null; OnIntUpdated = null; OnIntUpdatedAsString = null; OnFloatUpdated = null; OnFloatUpdatedAsString = null; OnBoolUpdated = null; OnBoolUpdatedAsString = null; }
public static void TriggerFloatEvent(string eventName, float value) { Init(); FloatEvent thisEvent = null; if (floatEventDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.Invoke(value); } }
// Update is called once per frame void Awake() { if (OnShootEvent == null) { OnShootEvent = new FloatEvent(); } if (OnFinishEntering == null) { OnFinishEntering = new UnityEvent(); } }
static public int constructor(IntPtr l) { try { FloatEvent o; o=new FloatEvent(); pushValue(l,true); pushValue(l,o); return 2; } catch(Exception e) { return error(l,e); } }
static public int constructor(IntPtr l) { try { FloatEvent o; o = new FloatEvent(); pushValue(l, true); pushValue(l, o); return(2); } catch (Exception e) { return(error(l, e)); } }
public static void StopListening(string eventName, UnityAction <float> listener) { if (eventManager == null) { return; } FloatEvent thisEvent = null; if (instance.eventDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.RemoveListener(listener); } }