override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     boss          = animator.GetComponent <MissileBoss>();
     this.animator = animator;
     player        = PlayerControl1.Instance.transform;
     transform     = animator.transform;
     thing         = animator.GetComponent <Thing>();
     rb            = animator.GetComponent <Rigidbody2D>();
     if (animator.GetInteger("Stage") == 1)
     {
         currLaser = boss.laser1;
         times     = 1;
     }
     else if (animator.GetInteger("Stage") == 2)
     {
         currLaser = boss.laser2;
         times     = 1;
     }
     else if (animator.GetInteger("Stage") == 3)
     {
         currLaser = boss.laser3;
         times     = 3;
     }
     PlayerControl1.Instance.StartCoroutine(Rise());
 }
Example #2
0
 // Start is called before the first frame update
 void Start()
 {
     laserRotationInstance = laserRotation.GetComponent <LaserRotation>();
     moveMountInstance     = moveMount.GetComponent <MoveMount>();
     dialogue = new Dialogue();
     string[] new_sentences = new string[2];
     new_sentences[0]   = "Hmm, the laser seems to have triggered something..";
     new_sentences[1]   = "Check your inventory for a new item";
     dialogue.sentences = new_sentences;
 }
    IEnumerator Laser()
    {
        actualLaser = currLaser;
        currLaser.Warning();
        yield return(new WaitForSeconds(laserWarningTime));

        currLaser.Damage();
        Debug.Log("laser activate");
        yield return(new WaitForSeconds(laserDur));

        currLaser.Close();
        yield return(new WaitForSeconds(laserPostload));

        PlayerControl1.Instance.StartCoroutine(StartMisselThrow());
        yield break;
    }
Example #4
0
        public EnemyAttackProcesser(IEnumerable <EnemyAttackDataBase> data, Enemy enemy)
        {
            _ProcessList      = new IEnumerator[data.Count()];
            _ProcesserList    = new IAttackProcesser[data.Count()];
            _CompleteObserver = new Subject <Unit> ();
            IAttackProcesser processer;

            for (int i = 0; i < data.Count(); i++)
            {
                switch (data.ElementAt(i).AttackType)
                {
                case AttackType.nWayShot:
                    processer         = new nWayShot(data.ElementAt(i), enemy);
                    _ProcessList[i]   = processer.Process();
                    _ProcesserList[i] = processer;
                    break;

                case AttackType.nWayShotTargetPlayer:
                    processer         = new nWayShotTargetPlayer(data.ElementAt(i), enemy);
                    _ProcessList[i]   = processer.Process();
                    _ProcesserList[i] = processer;
                    break;

                case AttackType.nWayShotRotation:
                    processer         = new nWayShotRotation(data.ElementAt(i), enemy);
                    _ProcessList[i]   = processer.Process();
                    _ProcesserList[i] = processer;
                    break;

                case AttackType.Laser:
                    processer         = new Laser(data.ElementAt(i), enemy);
                    _ProcessList[i]   = processer.Process();
                    _ProcesserList[i] = processer;
                    break;

                case AttackType.LaserTargetPlayer:
                    processer         = new LaserTargetPlayer(data.ElementAt(i), enemy);
                    _ProcessList[i]   = processer.Process();
                    _ProcesserList[i] = processer;
                    break;

                case AttackType.LaserRotation:
                    processer         = new LaserRotation(data.ElementAt(i), enemy);
                    _ProcessList[i]   = processer.Process();
                    _ProcesserList[i] = processer;
                    break;

                case AttackType.EnemyPop:
                    processer         = new EnemyPop(data.ElementAt(i), enemy);
                    _ProcessList[i]   = processer.Process();
                    _ProcesserList[i] = processer;
                    break;

                default:
                    break;
                }
            }

            _CompleteStream = _ProcesserList[0].CompleteAsObservable();
            for (int i = 1; i < _ProcesserList.Length; i++)
            {
                _CompleteStream = _CompleteStream.Zip(_ProcesserList[i].CompleteAsObservable(), (r, l) => { return(l); });
            }
            _CompleteStream
            .First()
            .Subscribe(_ => _CompleteObserver.OnNext(Unit.Default));
        }