public void Fire()
 {
     if (!isFired)
     {
         isFired = true;
         OnFireEvent?.Invoke();
         StartCoroutine(fire());
     }
 }
示例#2
0
    private void ExecuteFireEvents()
    {
        OnFireEvent temp = (OnFireEvent)eventTable["FireEvent"];

        if (temp != null)
        {
            temp();
        }
    }
示例#3
0
 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();
 }
示例#4
0
    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);
    }
示例#5
0
    public override void OnFire()
    {
        if (!CanUse())
        {
            return;
        }

        GameUIManager.Instance.SetCD(1f);
        mAttackWorking       = true;
        mCurrentDuration     = mDuration;
        mCurrentHit          = 0;
        mDurationBetweenHits = mDuration / mHitCount;
        OnFireEvent?.Invoke();

        HitOnce();
    }