Page 377 - MDP2022-3
P. 377

public  ObjectManager  objectManager;
                    public  GameObject  EnemyA;
                    public  GameObject  EnemyB;
                    public  GameObject  EnemyC;

                    public  List<Spawn>  spawnList;
                    public  int  spawnIndex;
                    public  bool  spawnEnd;


                    public  float  nextSpawnDelay;
                    public  float  curSpawnDelay;



                      void  Start()
                    {
                            for  (int  index  =  0;  index  <  BoomImage.Length;  index++)
                            {
                                    BoomImage[index].color  =  new  Color(1,  1,  1,  0);
                            }


                    }
                    private  void  Awake()
                    {
                            spawnList  =  new  List<Spawn>();
                            enemyObjs  =  new  string[]  {  "enemyA",  "enemyB",  "enemyC","enemyZ"  };          //적개체  레벨별  구분
                            StageStart();
                    }
                    void  Update()
                    {
                            curSpawnDelay  +=  Time.deltaTime;
                            if  (curSpawnDelay  >  nextSpawnDelay&&  !spawnEnd)
                            {
                                    SpawnEnemy();                                       //적개체  소환  딜레이  설정
                                    curSpawnDelay  =  0;
                            }
                            Player  playerlogic  =  Player.GetComponent<Player>();
                            scoreText.text  =  string.Format("{0:n0}",  playerlogic.score);


                    }


                    public  void  StageStart()
                    {
                            //StageUI
                            stageAnim.SetTrigger("On");
                            stageAnim.GetComponent<Text>().text="Stage  "+stage+"\nStart";
                            ReadSpawnFile();
                            //fade  In
   372   373   374   375   376   377   378   379   380   381   382