public void Fire() { if (!isFired) { isFired = true; OnFireEvent?.Invoke(); StartCoroutine(fire()); } }
private void ExecuteFireEvents() { OnFireEvent temp = (OnFireEvent)eventTable["FireEvent"]; if (temp != null) { temp(); } }
static void Main(string[] args) { OnFireEvent += SomeSimpleEvent1; OnFireEvent += SomeSimpleEvent2; OnFireNiceEvent += SomeStandardEvent1; OnFireNiceEvent += SomeStandardEvent2; Console.WriteLine("Firing events....."); OnFireEvent?.Invoke(3); OnFireNiceEvent?.Invoke(null, new SomeStandardArgs("Fred")); //Console.WriteLine($"{HeightSensorTypes.Keyence_IL030}:{(int)HeightSensorTypes.Keyence_IL030}"); Console.ReadLine(); }
public override void OnFire() { Transform pj = PoolManager.instance.dicPool[projectile.name].Spwan(); bool isLeft = false; pj.position = GetMuzzle(out isLeft).position; ProjectileData data = new ProjectileData(); data.damage = 1; data.projectilePoolName = projectile.name; data.impactPoolName = impact.name; data.isRight = !isLeft; pj.localScale = Vector2.one * extraSize; pj.GetComponent <ProjectileControl>().Setup(data); OnFireEvent?.Invoke(isLeft); }
public override void OnFire() { if (!CanUse()) { return; } GameUIManager.Instance.SetCD(1f); mAttackWorking = true; mCurrentDuration = mDuration; mCurrentHit = 0; mDurationBetweenHits = mDuration / mHitCount; OnFireEvent?.Invoke(); HitOnce(); }