示例#1
0
    /**
     * initial
     **/
    private IEnumerator Start()
    {
#if !ORI_FIXEDUPDATE
        // 目前FPS限制30,物理計算也限制30
        //Time.fixedDeltaTime = 0.0333f;
#endif



#if !UNITY_EDITOR
        // while VSync==false in Quality settings,
        // we can use this to lock Framerate, that will lengthen battery life for this game.
        Application.targetFrameRate = 60;
#endif

        // 不進入休眠模式
        Screen.sleepTimeout = SleepTimeout.NeverSleep;



        // 一開始沒有攝影機,先清buffer,避免有些機器會有雜訊畫面
        GL.Clear(true, true, Color.black);

        // 設定LoadFromCacheOrDownload的Cache限制大小,目前為2GB
        Caching.maximumAvailableDiskSpace = 2147483648;

#if USE_NGUI
        // 使用NGUI時,會由下面的Loading畫面取代原先流程,在LoadingStartCallback中載入場景
        // 這裡只會先去抓NGUI_Root
        mGUIRoot = GetComponent <NGUI_Root>();
        m_uiRoot = GetComponent <NGUI_Root>();
        m_uiRoot.showGUI(NGUI_Root.eUIType.LOGIN);
        Localization.ReLoad = true;
#endif


        //set this gameObject always on scene
        DontDestroyOnLoad(gameObject);
        //DontDestroyOnLoadToAllChildren(gameObject);
        //set singleton access
        m_instance = this;
        Debug.Log("Loading");

        //每隔一陣子發射
        //prefab = (GameObject)UnityEngine.Object.Instantiate (Resources.Load("Sprite/Ball"));
        m_BallPrefab   = Resources.Load("Sprite/Ball") as GameObject;
        m_PlayerPrefab = GameObject.Find("Player");

        m_BallNum = 0;
        Debug.Log("startAAAA");
        GameObject bg_prefab = GameObject.Find("UI Root");

        UIEventListener.Get(bg_prefab).onDragEnd += OnDragEnd;

        yield return(null);
    }
示例#2
0
    /**
     * initial
     **/
    private IEnumerator Start()
    {
#if !ORI_FIXEDUPDATE
        // 目前FPS限制30,物理計算也限制30
        //Time.fixedDeltaTime = 0.0333f;
#endif



#if !UNITY_EDITOR
        // while VSync==false in Quality settings,
        // we can use this to lock Framerate, that will lengthen battery life for this game.
        Application.targetFrameRate = 60;
#endif

        // 不進入休眠模式
        Screen.sleepTimeout = SleepTimeout.NeverSleep;



        // 一開始沒有攝影機,先清buffer,避免有些機器會有雜訊畫面
        GL.Clear(true, true, Color.black);

        // 設定LoadFromCacheOrDownload的Cache限制大小,目前為2GB
        Caching.maximumAvailableDiskSpace = 2147483648;

#if USE_NGUI
        // 使用NGUI時,會由下面的Loading畫面取代原先流程,在LoadingStartCallback中載入場景
        // 這裡只會先去抓NGUI_Root
        mGUIRoot = GetComponent <NGUI_Root>();
        m_uiRoot = GetComponent <NGUI_Root>();
        m_uiRoot.showGUI(NGUI_Root.eUIType.LOGIN);
        Localization.ReLoad = true;
#endif

        //set this gameObject always on scene
        DontDestroyOnLoad(gameObject);
        //DontDestroyOnLoadToAllChildren(gameObject);
        //set singleton access
        m_instance = this;
        Debug.Log("Loading");

        //Attching onClick event on Tryagain button
        m_TryAgain = GameObject.Find("UI Root/Camera/tryagain");
        UIEventListener.Get(m_TryAgain).onPress = OnPressTryAgain;
        m_TryAgain.SetActive(false);
        //Attching onClick event on flash scanner
        m_FlashScanner = GameObject.Find("UI Root/Camera/flashscanner");

        UIEventListener.Get(m_FlashScanner).onPress = OnPressFlashScanner;
        //Place finger word
        m_PlaceFinger = GameObject.Find("UI Root/Camera/placefingeron");
        //MoveBar
        m_MoveBar = GameObject.Find("UI Root/Camera/movebar");

        m_AnalyStart = GameObject.Find("UI Root/Camera/analy_start");

        m_Analyzing = GameObject.Find("UI Root/Camera/analyzing");
        m_Analyzing.SetActive(false);

        m_Scanning = GameObject.Find("UI Root/Camera/scanning");
        m_Scanning.SetActive(false);
        m_IQNum = GameObject.Find("UI Root/Camera/iqnum");
        m_IQNum.SetActive(false);
        m_YourIQis = GameObject.Find("UI Root/Camera/youriqis");
        m_YourIQis.SetActive(false);

        m_iAd       = GameObject.Find("iAd");
        m_iAdScript = m_iAd.GetComponent(typeof(iAd)) as iAd;
        yield return(null);
    }
示例#3
0
	/**
	initial
	**/
	private IEnumerator Start()
	{



#if !ORI_FIXEDUPDATE
		// 目前FPS限制30,物理計算也限制30
		//Time.fixedDeltaTime = 0.0333f;
#endif



#if !UNITY_EDITOR
		// while VSync==false in Quality settings, 
		// we can use this to lock Framerate, that will lengthen battery life for this game.
		Application.targetFrameRate = 60;
#endif

		// 不進入休眠模式
		Screen.sleepTimeout = SleepTimeout.NeverSleep;


		
		// 一開始沒有攝影機,先清buffer,避免有些機器會有雜訊畫面
		GL.Clear(true, true, Color.black);

		// 設定LoadFromCacheOrDownload的Cache限制大小,目前為2GB
		Caching.maximumAvailableDiskSpace = 2147483648;

#if USE_NGUI
		// 使用NGUI時,會由下面的Loading畫面取代原先流程,在LoadingStartCallback中載入場景
		// 這裡只會先去抓NGUI_Root
		mGUIRoot = GetComponent<NGUI_Root>();
		m_uiRoot = GetComponent<NGUI_Root>();
		m_uiRoot.showGUI(NGUI_Root.eUIType.LOGIN);
		Localization.ReLoad=true;
#endif


		//set this gameObject always on scene 
		DontDestroyOnLoad( gameObject );
		//DontDestroyOnLoadToAllChildren(gameObject);
		//set singleton access
		m_instance = this;
		Debug.Log ("Loading");

		//每隔一陣子發射
		//prefab = (GameObject)UnityEngine.Object.Instantiate (Resources.Load("Sprite/Ball"));
		m_BallPrefab = Resources.Load("Sprite/Ball") as GameObject;
		m_PlayerPrefab = GameObject.Find("Player");

		m_BallNum = 0;
		Debug.Log ("startAAAA");
		GameObject bg_prefab = GameObject.Find ("UI Root");

		UIEventListener.Get(bg_prefab).onDragEnd += OnDragEnd;

		yield return null;
	}