Ejemplo n.º 1
0
 // Update is called once per frame
 void Start()
 {
     thisStarVertex.starRef = gameObject;
     starCounter            = GameObject.FindGameObjectWithTag("StarCounter").GetComponent <StarCounter>();
     starsConnectedCounter  = GameObject.FindGameObjectWithTag("StarCounter").GetComponent <StarsConnectedCounter>();
     charge.Stop();
     fullyChargedSound.Stop();
     if (!hasPuzzle)
     {
         charge.Play();
         fullyChargedSound.Play();
         starCounter.AddCount();
         thisStarVertex.IsInPlace = true;
         thisStarVertex.CheckAndDrawLines(thisStarVertex);
     }
 }
    IEnumerator DestroyAfterTime()
    {
        StartCoroutine(Camera.main.GetComponent <ThirdPersonCamera>().LookAtTargetEnd());
        indicatorTravelSound.Stop();
        indicatorHitSound.Play();
        yield return(new WaitForSeconds(1.0f));

        thisStarVertex.IsInPlace = true;
        thisStarVertex.CheckAndDrawLines(thisStarVertex);
        GameObject.FindGameObjectWithTag("StarCounter").GetComponent <StarCounter>().AddCount();
        fullyChargedSound.Play();
        starCharge.Play();
        if (lightSwitch != null)
        {
            lightSwitch.GraduallyTurnOnLightsMethod();
        }
        if (assetSpawnSwitch != null)
        {
            assetSpawnSwitch.SpawnObjects();
        }
        Destroy(gameObject);
    }