void Start()
    {
        particleInstancer = GameObject.FindWithTag("ParticleInstancer").GetComponent <ParticleInstancer>();
        audioPlayer       = GetComponent <AudioPlayer>();

        enemyRenderer = this.GetComponentInChildren <Renderer>();
        enemyCollider = this.GetComponent <Collider>();
        enemyAnimator = this.GetComponentInChildren <Animator>();

        defaultShader = enemyRenderer.material.shader;
        outlineShader = Shader.Find("Custom/Mobile Diffuse Outline Soften Edge");

        enemyHealthBar = GameObject.Find("GameplayUI").GetComponent <EnemyHealthBar>();
        pauseGameplay  = enemyHealthBar.gameObject.GetComponent <PauseGameplay>();

        switch (enemyType)
        {
        case EnemyType.Skull:
            SkullInit();
            break;

        case EnemyType.Fenrir:
            FenrirInit();
            break;

        default:
            break;
        }

        enemyBehaviour = this.GetComponent <EnemyBehaviour>();
        enemyBehaviour.SetLife(life);
    }
    private void Start()
    {
        playerBehaviour = GameObject.FindWithTag("Player").GetComponent <CharacterBehaviour>();
        leverAnimator   = GetComponentInChildren <Animator>();
        leverAnimator.SetInteger("leverState", (int)leverState);
        pauseGameplay = GameObject.FindWithTag("GameplayUI").GetComponent <PauseGameplay>();

        outlineShader  = GetComponentInChildren <Renderer>().material.shader;
        standardShader = Shader.Find("Standard");
    }
Ejemplo n.º 3
0
 public void SetScripts()
 {
     if (GameObject.FindGameObjectWithTag("Player") != null)
     {
         player             = GameObject.FindWithTag("Player");
         playerBehaviour    = player.GetComponent <CharacterBehaviour>();
         playerCamBehaviour = GameObject.FindGameObjectWithTag("CameraController").GetComponentInChildren <CameraBehaviour>();
         playerCamRaycaster = GameObject.FindGameObjectWithTag("MainCamera").GetComponentInChildren <CameraRaycaster>();
         pauseGameplay      = GameObject.Find("GameplayUI").GetComponent <PauseGameplay>();
         endingPlayer       = pauseGameplay.gameObject.GetComponent <PlayEnding>();
     }
     else
     {
         player             = null;
         playerBehaviour    = null;
         playerCamBehaviour = null;
         playerCamRaycaster = null;
         pauseGameplay      = null;
         endingPlayer       = null;
     }
 }