예제 #1
0
 void Start()
 {
     playOnce = true;
     fade     = deathScreen.GetComponent <ScreenFade>();
     fade.SetScreenOverlayColor(new Color(0, 0, 0, 0));
     alpha       = 0;
     image       = deathScreen.GetComponent <Image>();
     image.color = new Color(0, 0, 0, alpha);
     deathText.transform.position = Camera.main.ViewportToScreenPoint(new Vector3(0.5f, 0.2f, 0));   // Positions the deathtext to be halfway of screen, 0.2 of screen height
 }
예제 #2
0
    // Use this for initialization
    void Start()
    {
        player    = GameObject.FindGameObjectWithTag("MainCamera");
        playerOrb = GameObject.Find("Orb");
        orbScript = playerOrb.GetComponent <Orb>();
        orbInd    = GameObject.Find("OrbIndicator").GetComponent <OrbIndicator>();
        orbP      = GameObject.Find("OrbParticle").GetComponent <ParticleSystem>();
        fade      = GameObject.Find("Player").GetComponent <ScreenFade>();
        fade.SetScreenOverlayColor(new Color(0, 0, 0, 0));
        orbHasClearSpace = true;
        canFire          = true;
        audioSource      = GetComponent <AudioSource>();
        //indicator2 = GameObject.Find("Particle Gravity Hole");

        // Particle fix (why does this happen).
        GameObject.Find("Particle Gravity Hole").transform.parent = orbInd.gameObject.transform;
        orbInd.Deactivate(orbInd.gameObject);
    }