Пример #1
0
 void AvoidNullProblem()
 {
     if (_navMesh == null)
     {
         _navMesh = GetComponent <NavMeshAgent>();
     }
     if (_anim == null)
     {
         _anim = GetComponentInChildren <Animator>();
     }
     if (_player == null)
     {
         _player = GameObject.FindGameObjectWithTag("Player").transform;
     }
     if (_EnemyCapCol == null)
     {
         _EnemyCapCol = GetComponent <CapsuleCollider>();
     }
     if (_GameManager3 == null)
     {
         Debug.LogWarning("You must added the Object to this Script");
     }
     if (_gameManagerBossStageScript == null)
     {
         _gameManagerBossStageScript = _GameManager3.GetComponent <GameManager3BOSSStage>();
     }
     if (_HealthItem == null)
     {
         Debug.Log("You must added the Object to this Script ");
     }
     if (_rgbd == null)
     {
         _rgbd = GetComponent <Rigidbody>();
     }
     if (_PopUpDamage == null)
     {
         Debug.LogWarning("That's Something You need to added ");
     }
     if (_HurtEffect == null)
     {
         Debug.LogWarning("That's something You need to Added");
     }
     if (_DeadEffect == null)
     {
         Debug.LogWarning("That's Something You need to Added ");
     }
 }
Пример #2
0
 void AvoidNullProblem()
 {
     if (_INSTANCE == null)
     {
         _INSTANCE = this;
     }
     if (_player == null)
     {
         GameObject.FindGameObjectWithTag("Player");
     }
     if (_playerCtrl == null)
     {
         _playerCtrl = _player.GetComponent <PlayerCtrl>();
     }
     if (_ClearPanelAnimation == null)
     {
         _ClearPanelAnimation = _ClrPanel.GetComponent <RectTransform>();
     }
     if (_TxtAnimation == null)
     {
         _TxtAnimation = _Txt.GetComponent <RectTransform>();
     }
     if (_txtAnimator == null)
     {
         _txtAnimator = _Txt.GetComponent <Animator>();
     }
     if (_BtnRestartAnimator == null)
     {
         _BtnRestartAnimator = _BtnRestart.GetComponent <Animator>();
     }
     if (_BtnrestartTxtAnimator == null)
     {
         _BtnrestartTxtAnimator = _BtnRestart.GetComponent <Animator>();
     }
     if (_BtnQuitAnimator == null)
     {
         _BtnQuitAnimator = _BtnQuit.GetComponent <Animator>();
     }
     if (_BtnQuitTxtAnimator == null)
     {
         _BtnQuitTxtAnimator = _BtnQuitTxt.GetComponent <Animator>();
     }
     if (_BtnQuitAnimation == null)
     {
         _BtnQuitAnimation = _BtnQuit.GetComponent <RectTransform>();
     }
     if (_BtnRestartAnimation == null)
     {
         _BtnRestartAnimation = _BtnRestart.GetComponent <RectTransform>();
     }
     if (_txtAnimatorGameOver == null)
     {
         _txtAnimatorGameOver = _GameOverTxt.GetComponent <Animator>();
     }
     if (_TxtAnimationGameOver == null)
     {
         _TxtAnimationGameOver = _GameOverTxt.GetComponent <RectTransform>();
     }
     if (_txtAnimatorWantToTryAgn == null)
     {
         _txtAnimatorWantToTryAgn = _WantTotryAgainTxt.GetComponent <Animator>();
     }
     if (_TxtAnimationWantToTryAgn == null)
     {
         _TxtAnimationWantToTryAgn = _WantTotryAgainTxt.GetComponent <RectTransform>();
     }
     if (_BtnRestartAnimatorgGameOver == null)
     {
         _BtnRestartAnimatorgGameOver = _BtnRestartGameOver.GetComponent <Animator>();
     }
     if (_BtnQuitAnimatorGameQuit == null)
     {
         _BtnQuitAnimatorGameQuit = _BtnQuitGameOver.GetComponent <Animator>();
     }
     if (_BtnRestartTxtAnimatorGameOver == null)
     {
         _BtnRestartTxtAnimatorGameOver = _BtnRestartTxtGameOver.GetComponent <Animator>();
     }
     if (_BtnQuitTxtAnimatorGameOver == null)
     {
         _BtnQuitTxtAnimatorGameOver = _BtnQuitTxtGameOver.GetComponent <Animator>();
     }
     if (_BtnPauseAnimator == null)
     {
         _BtnPauseAnimator = _PauseBtnGameObject.GetComponent <Animator>();
     }
     if (_bossScript == null)
     {
         _bossScript = _BossActiveTime.GetComponent <BOSSScript>();
     }
     if (_StartingPanel == null)
     {
         Debug.Log("That's something You need to Add Before ");
     }
     if (_StartingPanelAnim == null)
     {
         _StartingPanelAnim = _StartingPanel.GetComponent <Animator>();
     }
     if (_StartingTxt == null)
     {
         Debug.Log("That's something You need to Add");
     }
     if (_StartingTxtAnim == null)
     {
         _StartingTxtAnim = _StartingTxt.GetComponent <Animator>();
     }
     if (_RedLines == null)
     {
         Debug.Log("That's Something You need To Added Which is the Red Lines Color");
     }
     if (_SubCameras == null)
     {
         Debug.Log("That's Something You need To Added Which is Sub Camera ");
     }
     if (_PrefectTxtAnimator == null)
     {
         _PrefectTxtAnimator = _PrefectTxt.GetComponent <Animator>();
     }
     if (_PlayerLifeStatement == null)
     {
         _PlayerLifeStatement = _player.GetComponent <PlayerLifeStatement>();
     }
 }