Example #1
0
 private void Start()
 {
     if (_ballDetector == null)
     {
         _ballDetector = GetComponent <BallDetector>();
     }
 }
Example #2
0
 void Awake()
 {
     gameController = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameManager>();
     shootBall      = GameObject.FindObjectOfType <ShootBalloon>();
     ballDetector   = GameObject.FindObjectOfType <BallDetector>();
     attackUI       = GameObject.FindObjectOfType <AttackUIActions>();
     spawnManager   = GameObject.FindObjectOfType <SpawnManager>();
     spawnManager.GenerateRandomShootPosition();
     whistleSource = GetComponent <AudioSource>();
 }
Example #3
0
    private void Start()
    {
        state       = DoggoState.ROAMING;
        audioSource = GetComponent <AudioSource>();

        status          = GetComponent <DogStatus>();
        agent           = GetComponent <NavMeshAgent>();
        pb              = GetComponent <PhysicsBehaviour>();
        foodDetector    = GetComponentInChildren <FoodDetector>();
        ballDetector    = GetComponentInChildren <BallDetector>();
        myTransform     = transform;
        playerTransform = FindObjectOfType <Player>().transform;
        animator        = GetComponent <Animator>();

        audioSource.Play();
        spawnDespawnParticleSystem.Play();
        AudioSource.PlayClipAtPoint(spawnClip, transform.position);

        StartCoroutine(BarkRandomly());
    }