Beispiel #1
0
    // Token: 0x06000059 RID: 89 RVA: 0x00008F00 File Offset: 0x00007100
    private void Start()
    {
        this.whiteTexture = (Texture2D)Resources.Load("Images/whiteTexture", typeof(Texture2D));
        if (!this.timeTexture)
        {
            this.timeTexture = this.whiteTexture;
        }
        this.fontSizes    = new Vector2(100f, 65.454544f) * (float)Screen.width / 1101f;
        Screen.lockCursor = false;
        Screen.showCursor = true;
        GameObject gameObject = GameObject.FindGameObjectWithTag("Audio");

        if (gameObject != null)
        {
            MyUnitySingleton component = gameObject.GetComponent <MyUnitySingleton>();
            this.seconds = new Vector2(component.playerTime, component.worldTime);
            component.PlayEndMusic();
        }
        while (this.seconds.x > 60f)
        {
            this.seconds.x = this.seconds.x - 60f;
            this.minutes.x = this.minutes.x + 1f;
            if (this.minutes.x > 60f)
            {
                this.minutes.x = this.minutes.x - 60f;
                this.hours.x   = this.hours.x + 1f;
            }
        }
        while (this.seconds.y > 60f)
        {
            this.seconds.y = this.seconds.y - 60f;
            this.minutes.y = this.minutes.y + 1f;
            if (this.minutes.y > 60f)
            {
                this.minutes.y = this.minutes.y - 60f;
                this.hours.y   = this.hours.y + 1f;
            }
        }
        this.times[0] = string.Concat(new string[]
        {
            this.hours.x.ToString("00"),
            ":",
            this.minutes.x.ToString("00"),
            ":",
            this.seconds.x.ToString("00.000")
        });
        this.times[1] = string.Concat(new string[]
        {
            this.hours.y.ToString("00"),
            ":",
            this.minutes.y.ToString("00"),
            ":",
            this.seconds.y.ToString("00.000")
        });
        this.size  = new Vector2((float)Screen.width, (float)Screen.height);
        this.scale = new Vector2(this.size.x / 2560f, this.size.y / 1440f);
    }
 void Awake()
 {
     if (instance != null && instance != this) {
         Destroy(this.gameObject);
         return;
     } else {
         instance = this;
     }
     DontDestroyOnLoad(this.gameObject);
 }
Beispiel #3
0
    // Token: 0x0600003B RID: 59 RVA: 0x00006090 File Offset: 0x00004290
    private void Start()
    {
        Screen.showCursor = true;
        Screen.lockCursor = false;
        Texture2D texture2D = (Texture2D)Resources.Load("Images/blackTexture", typeof(Texture2D));

        if (!this.menuTexture)
        {
            this.menuTexture = texture2D;
        }
        this.blackTexture = texture2D;
        this.size         = new Vector2((float)Screen.width, Mathf.Min((float)Screen.width * 2560f / 1440f, (float)Screen.height));
        if (Screen.width > this.menuTexture.width)
        {
            this.size       = new Vector2((float)this.menuTexture.width, (float)this.menuTexture.height);
            this.difference = new Vector2((float)Screen.width - this.size.x, (float)Screen.height - this.size.y) / 2f;
        }
        this.difference        = new Vector2(Mathf.Max((float)Screen.width - this.size.x, 0f), Mathf.Max((float)Screen.height - this.size.y, 0f)) / 2f;
        this.scale             = new Vector2(this.size.x / this.originalMenuSize.x, this.size.y / this.originalMenuSize.y);
        this.menuTextureSize   = this.ScaleVector(this.menuTextureSize);
        this.menuTexturePos    = this.ScaleVector(this.menuTexturePos);
        this.checkBoxSize      = this.ScaleVector(this.checkBoxSize);
        this.saturatedPos      = this.ScaleVector(this.saturatedPos);
        this.deSaturatedPos    = this.ScaleVector(this.deSaturatedPos);
        this.sliderBoxSize     = this.ScaleVector(this.sliderBoxSize);
        this.volumeSliderPos   = this.ScaleVector(this.volumeSliderPos);
        this.mouseSliderPos    = this.ScaleVector(this.mouseSliderPos);
        this.playTexturePos    = this.ScaleVector(this.playTexturePos);
        this.creditTexturePos  = this.ScaleVector(this.creditTexturePos);
        this.quitTexturePos    = this.ScaleVector(this.quitTexturePos);
        this.optionTexturePos  = this.ScaleVector(this.optionTexturePos);
        this.playTextureSize   = this.ScaleVector(this.playTextureSize);
        this.creditTextureSize = this.ScaleVector(this.creditTextureSize);
        this.quitTextureSize   = this.ScaleVector(this.quitTextureSize);
        this.optionTextureSize = this.ScaleVector(this.optionTextureSize);
        this.sliderLength      = 904f * this.scale.x - this.sliderBoxSize.x * 1.2f;
        GameObject gameObject = GameObject.FindGameObjectWithTag("Audio");

        if (gameObject)
        {
            MyUnitySingleton component = gameObject.GetComponent <MyUnitySingleton>();
            this.mouseSensitivity = component.mouseSensitivity;
            this.volume           = component.volume;
        }
        this.volumeRect   = new Rect(this.volume * this.sliderLength + this.volumeSliderPos.x, this.volumeSliderPos.y, this.sliderBoxSize.x, this.sliderBoxSize.y);
        this.mouseRect    = new Rect(this.mouseSensitivity * this.sliderLength + this.mouseSliderPos.x, this.mouseSliderPos.y, this.sliderBoxSize.x, this.sliderBoxSize.y);
        this.singleton    = GameObject.FindGameObjectWithTag("Audio").GetComponent <MyUnitySingleton>();
        this.selectSplits = this.singleton.SelectSplits;
        if (Time.realtimeSinceStartup < 2 && skipMenuOnFirstLoad)
        {
            GameObject.FindGameObjectWithTag("Audio").GetComponent <MyUnitySingleton>().fadeOut = true;
            Application.LoadLevel(3);
        }
    }
Beispiel #4
0
 void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
         return;
     }
     else
     {
         instance = this;
     }
     DontDestroyOnLoad(this.gameObject);
 }
 void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject); return;
     }
     else
     {
         instance = this;
     }
     FindObjectOfType <AudioSource> ().volume = PlayerPrefs.GetFloat("Volume");
     DontDestroyOnLoad(this.gameObject);
 }     // any other methods you need
 void Awake()
 {
     if (instance != null && instance != this)
         {
             Destroy(this.gameObject);
             return;
         }
     else
         {
             instance = this;
         }
     DontDestroyOnLoad(this.gameObject);
     audio.Play();
     audio.loop = true;
 }
Beispiel #7
0
    // Token: 0x06000035 RID: 53
    private void Start()
    {
        Screen.showCursor = true;
        Screen.lockCursor = false;
        Texture2D blackTx = (Texture2D)Resources.Load("Images/blackTexture", typeof(Texture2D));

        if (!this.menuTexture)
        {
            this.menuTexture = blackTx;
        }
        this.blackTexture = blackTx;
        this.size         = new Vector2((float)Screen.width, Mathf.Min((float)Screen.width * 2560f / 1440f, (float)Screen.height));
        if (Screen.width > this.menuTexture.width)
        {
            this.size       = new Vector2((float)this.menuTexture.width, (float)this.menuTexture.height);
            this.difference = new Vector2((float)Screen.width - this.size.x, (float)Screen.height - this.size.y) / 2f;
        }
        this.difference        = new Vector2(Mathf.Max((float)Screen.width - this.size.x, 0f), Mathf.Max((float)Screen.height - this.size.y, 0f)) / 2f;
        this.scale             = new Vector2(this.size.x / this.originalMenuSize.x, this.size.y / this.originalMenuSize.y);
        this.menuTextureSize   = this.ScaleVector(this.menuTextureSize);
        this.menuTexturePos    = this.ScaleVector(this.menuTexturePos);
        this.checkBoxSize      = this.ScaleVector(this.checkBoxSize);
        this.saturatedPos      = this.ScaleVector(this.saturatedPos);
        this.deSaturatedPos    = this.ScaleVector(this.deSaturatedPos);
        this.sliderBoxSize     = this.ScaleVector(this.sliderBoxSize);
        this.volumeSliderPos   = this.ScaleVector(this.volumeSliderPos);
        this.mouseSliderPos    = this.ScaleVector(this.mouseSliderPos);
        this.playTexturePos    = this.ScaleVector(this.playTexturePos);
        this.creditTexturePos  = this.ScaleVector(this.creditTexturePos);
        this.quitTexturePos    = this.ScaleVector(this.quitTexturePos);
        this.optionTexturePos  = this.ScaleVector(this.optionTexturePos);
        this.playTextureSize   = this.ScaleVector(this.playTextureSize);
        this.creditTextureSize = this.ScaleVector(this.creditTextureSize);
        this.quitTextureSize   = this.ScaleVector(this.quitTextureSize);
        this.optionTextureSize = this.ScaleVector(this.optionTextureSize);
        this.sliderLength      = 904f * this.scale.x - this.sliderBoxSize.x * 1.2f;
        GameObject audio = GameObject.FindGameObjectWithTag("Audio");

        if (audio)
        {
            MyUnitySingleton singleton = audio.GetComponent <MyUnitySingleton>();
            this.mouseSensitivity = singleton.mouseSensitivity;
            this.volume           = singleton.volume;
        }
        this.volumeRect = new Rect(this.volume * this.sliderLength + this.volumeSliderPos.x, this.volumeSliderPos.y, this.sliderBoxSize.x, this.sliderBoxSize.y);
        this.mouseRect  = new Rect(this.mouseSensitivity * this.sliderLength + this.mouseSliderPos.x, this.mouseSliderPos.y, this.sliderBoxSize.x, this.sliderBoxSize.y);
    }
Beispiel #8
0
    // Use this for initialization
    void Start()
    {
        clip = GetComponent <AudioSource>().clip;
        GameObject gameMusic = GameObject.Find("Game Music");

        if (gameMusic != null)
        {
            MyUnitySingleton myUnitySingleton = gameMusic.GetComponent <MyUnitySingleton>();
            myUnitySingleton.StopMusic();
            myUnitySingleton.GetComponent <AudioSource>().clip = clip;
            myUnitySingleton.StartMusic();
        }
        else
        {
            GetComponent <AudioSource>().Play();
        }
    }
    void Awake()
    {
        if (instance != null && instance != this)
        {
            Destroy(this.gameObject);
            return;
        }
        else
        {
            AudioSource soundtrack = GameObject.Find("soundtrack").GetComponent <AudioSource> ();
            if (soundtrack != null && !soundtrack.isPlaying)
            {
                soundtrack.Play();
            }

            instance = this;
        }

        DontDestroyOnLoad(this.gameObject);
    }
Beispiel #10
0
 void Awake()
 {
     if (instance != null && instance != this)
     {
         print("instance: " + instance.name);
         // print("this: " + this.name);
         if (instance.name != this.name)
         {
             Destroy(instance.gameObject);
             instance = this;
         }
         else
         {
             Destroy(this.gameObject);
         }
         return;
     }
     else
     {
         instance = this;
     }
     DontDestroyOnLoad(this.gameObject);
 }