예제 #1
0
    private void Start()
    {
        playerTransform        = GetComponent <Transform>();
        playerAgent            = GetComponent <NavMeshAgent>();
        hammerBehaviour        = GetComponentInChildren <HammerBehaviour>();
        basicAttackTrigger     = GetComponentInChildren <AttackTrigger>();
        cameraBehaviour        = GameObject.FindWithTag("CameraController").GetComponent <CameraBehaviour>();
        thorAnimator           = GetComponentInChildren <Animator>();
        timeManager            = GameObject.FindWithTag("manager").GetComponent <TimeManager>();
        audioPlayer            = GetComponent <AudioPlayer>();
        musicAmbientController = GameObject.FindWithTag("MusicAmbientController").GetComponent <MusicAmbientController>();

        foreach (AnimationClip animation in thorAnimator.runtimeAnimatorController.animationClips)
        {
            //animationsList.Add(new AnimationClipName(animation.name, animation));

            if (animation.name == "throwHammer")
            {
                throwDuration = animation.length / 1.4f;
            }
            if (animation.name == "hit_01")
            {
                attackDuration = animation.length;
            }
            if (animation.name == "slowArea")
            {
                slowAreaInitDelay = animation.length / 1.3f;
            }
            if (animation.name == "lightboltRain")
            {
                lightRainCastInitDuration = animation.length;
            }
        }

        agentSpeed = playerAgent.speed;

        maxLife         = life;
        playerHealthBar = GameObject.Find("GameplayUI").GetComponent <PlayerHealthBar>();
        StartCoroutine(SetInitLife());

        endingPlayer = playerHealthBar.gameObject.GetComponent <PlayEnding>();

        passiveInitDuration = passiveDuration;

        particleInstancer = GameObject.FindWithTag("ParticleInstancer").GetComponent <ParticleInstancer>();
    }
예제 #2
0
 void Start()
 {
     hammerBehaviour   = GetComponentInParent <HammerBehaviour>();
     playerAudioPlayer = GetComponentInParent <AudioPlayer>();
     cameraBehaviour   = GameObject.FindWithTag("CameraController").GetComponent <CameraBehaviour>();
 }