示例#1
0
 private void Awake()
 {
     promptGraphics = promptUICanvas.GetComponentsInChildren <Graphic>();
     letterGraphics = letterUICanvas.GetComponentsInChildren <Graphic>();
     blurComponent  = Camera.main.GetComponent <UnityStandardAssets.ImageEffects.BlurOptimized>();
     audioSource    = GetComponentInParent <AudioSource>();
 }
示例#2
0
    void Awake()
    {
        blur = Camera.main.GetComponent <UnityStandardAssets.ImageEffects.BlurOptimized>();

        press = false;
        t     = 0.0f;
    }
示例#3
0
文件: GameManager.cs 项目: skidne/KKK
    void Start()
    {
        float wid;

        topLimitHeight = topLimitObj.position.y;
        _gArrowRect    = gaugeArrow.GetComponent <RectTransform>();
        lanes          = new LaneClass[3];
        for (int i = 0; i < 3; i++)
        {
            lanes[i]        = new LaneClass();
            lanes[i].isFree = true;
        }
        obstacleDist        = Screen.height * 35 / 100;
        playerTransform     = GameObject.FindGameObjectWithTag("Player").transform;
        wid                 = deathZone.parent.GetComponent <RectTransform>().rect.width;
        deathZone.sizeDelta = new Vector2(wid, 200);
        deathZone.GetComponent <BoxCollider2D>().size = deathZone.sizeDelta;
        _maxSpeed         = 4f;
        _minSpeed         = 0f;
        savedMaxSpeed     = _maxSpeed;
        savedSpeed        = generalSpeed;
        _curRunCoins      = 0;
        _o2charges        = 4;
        blurComp          = Camera.main.GetComponent <UnityStandardAssets.ImageEffects.BlurOptimized>();
        blurComp.blurSize = 0f;
    }
示例#4
0
 // Use this for initialization
 void Start()
 {
     if (awakenEyes)
     {
         eyes[0].gameObject.SetActive(true);
     }
     blur = GetComponent <BlurOptimized>();
 }
示例#5
0
 void Awake()
 {
     _blur = GetComponent <UnityStandardAssets.ImageEffects.BlurOptimized>();
     if (_blur == null)
     {
         _blur = GetComponentInChildren <UnityStandardAssets.ImageEffects.BlurOptimized>();
     }
     t = this;
 }
    public void PartialBlindness()
    {
        int random = Random.Range(0, 2);

        UnityStandardAssets.ImageEffects.BlurOptimized comp = cameraParent.GetComponents <UnityStandardAssets.ImageEffects.BlurOptimized>()[random];

        activeVisualDisorders.Add(comp);
        comp.enabled = true;
    }
示例#7
0
    // Start is called before the first frame update
    void Start()
    {
        //if (enabled)
        //{
        //    Debug.LogWarning("This camera should be off and only for mannual render");
        //    enabled = false;
        //}

        blurModule = GetComponent <UnityStandardAssets.ImageEffects.BlurOptimized>();
    }
    void Start()
    {
        defaultFog           = RenderSettings.fog;
        defaultFogColor      = RenderSettings.fogColor;
        defaultFogDensity    = RenderSettings.fogDensity;
        defaultSkybox        = RenderSettings.skybox;
        defaultStartDistance = RenderSettings.fogStartDistance;

        Camera.main.backgroundColor = new Color(0, 0.4f, 0.7f, 1);

        blurOptimized = GetComponent <UnityStandardAssets.ImageEffects.BlurOptimized>();

        underwaterLevel = waterUp.transform.position.y;
    }
示例#9
0
    //===================================================================================================================

    private IEnumerator Start()
    {
        //Try to GET the current time.
        WWW www = new WWW(URL);

        yield return(www);

        //If get fails, try again every 3 seconds.
        while (!string.IsNullOrEmpty(www.error))
        {
            yield return(new WaitForSeconds(3));

            www = new WWW(URL);
            yield return(www);
        }

        //Get some components.
        GameObject g = GameObject.FindWithTag("Player");

        move = g.GetComponent <MoveCtrl>();
        blur = g.GetComponentInChildren <UnityStandardAssets.ImageEffects.BlurOptimized>();

        // Prepare received data.
        TimeJson timeJson = new TimeJson();

        JsonUtility.FromJsonOverwrite(www.text, timeJson);

        //Unix timestamp is seconds past epoch
        System.DateTime dtDateTime  = new System.DateTime(1970, 1, 1, 0, 0, 0, 0, System.DateTimeKind.Utc);
        string          currentDate = dtDateTime.AddSeconds(timeJson.timestamp - timeJson.gmtOffset).ToLocalTime().ToString();

        //Set up current time and end time.
        System.DateTime currentTime = System.DateTime.Parse(currentDate);
        System.DateTime startTime   = new System.DateTime(1991, 5, 8, 15, 15, 0);

        //Build the first room.
        GameObject r     = Instantiate(roomPrefab, Vector3.zero, Quaternion.identity) as GameObject;
        RoomCtrl   rCtrl = r.GetComponent <RoomCtrl>();

        rCtrl.setEndTime(startTime.AddYears(1), currentTime);
        rCtrl.setName(0);

        //Pass the current time to the time controller, it'll take it from here.
        GetComponent <TimeCtrl>().setCurrentTime(currentTime);

        //Tell the UI that we are ready, we can start the game.
        GameObject.FindWithTag("UI").GetComponent <UICtrl>().Ready = true;
    }
示例#10
0
    // Use this for initialization
    private void Start()
    {
        for (int i = 0; i < Enum.GetNames(typeof(UIPanel)).Length; ++i)
        {
            UILIST[i].SetActive(false);
            uilist[i] = UILIST[i];
        }

        inputhandler = FindObjectOfType <InputHandler>();
        overheating  = FindObjectOfType <OverHeating>();
        ammosystem   = FindObjectOfType <AmmoSystem>();
        manager      = FindObjectOfType <EnemyManager>();
        timer        = FindObjectOfType <Timer>();

        BlurEffect         = Camera.main.gameObject.GetComponent <UnityStandardAssets.ImageEffects.BlurOptimized>();
        BlurEffect.enabled = false;
    }
示例#11
0
     // Use this for initialization
     void Start()
 {
             BlurOptimized       =         GetComponent <UnityStandardAssets.ImageEffects.BlurOptimized>();
             MotionBlur          =            GetComponent <UnityStandardAssets.ImageEffects.MotionBlur>();
             FishEye             =               GetComponent <UnityStandardAssets.ImageEffects.Fisheye>();
             NoiseAndScratches   =     GetComponent <UnityStandardAssets.ImageEffects.NoiseAndScratches>();
             flashLight          =            GameObject.Find("[FlashLight]");
             flashLightObject    =      GameObject.Find("Taschenlampe");
             breathe1AudioSource =   GameObject.Find("[Audio]/Breathe_Zone_1").GetComponent <AudioSource>();
             breathe2AudioSource =   GameObject.Find("[Audio]/Breathe_Zone_2").GetComponent <AudioSource>();
             breathe3AudioSource =   GameObject.Find("[Audio]/Breathe_Zone_3").GetComponent <AudioSource>();
             heart1AudioSource   =     GameObject.Find("[Audio]/Heart_beat_1").GetComponent <AudioSource>();
             heart2AudioSource   =     GameObject.Find("[Audio]/Heart_beat_2").GetComponent <AudioSource>();
     // All effects on
     AllEffectsOn();
         
 }
示例#12
0
	public void Init(bool alwaysActive)
	{
		GetComponent<Camera>().nearClipPlane = 0.01f;
		GetComponent<Camera>().farClipPlane = 3f;
		mGetPictrue = false;
		mBlurEffect = gameObject.AddComponent<BlurEffect>();
#if UNITY_5
		mBlurEffect.blurIterations = 0;
		mBlurEffect.blurSize = 0;
#else
		mBlurEffect.iterations = 0;
		mBlurEffect.blurSpread = 0;
#endif
		mLight = new Light[2];
		mLight[0] = transform.FindChild("Pointlight1").GetComponent<Light>();
		mLight[1] = transform.FindChild("Pointlight2").GetComponent<Light>();
		mAlwaysActive = alwaysActive;
		
		mRenderTexture = new RenderTexture(512, 512,16);
		mRenderTexture.isCubemap = false;
		GetComponent<Camera>().targetTexture = mRenderTexture;
	}
示例#13
0
 void Awake()
 {
     settingsManger = FindObjectOfType <SettingsManager>();
     navigation     = new LinkedList <GameObject>();
     blurComponent  = Camera.main.GetComponent <UnityStandardAssets.ImageEffects.BlurOptimized>();
 }
示例#14
0
        void Awake()
        {
            instance=this;
            thisT=transform;
            thisObj=gameObject;

            cam=thisObj.GetComponentInChildren<Camera>();
            camT=cam.transform;

            defaultZoom=camT.localPosition.z;
            defaultZoomOrtho=cam.orthographicSize;

            blurEffect=thisObj.GetComponentInChildren<BlurOptimized>();
            if(blurEffect!=null) blurEffect.enabled=false;
        }
示例#15
0
 public static void FadeBlur(BlurOptimized blurEff, float startValue=0, float targetValue=0)
 {
     if(blurEff==null && instance==null) return;
     instance.StartCoroutine(instance.FadeBlurRoutine(blurEff, startValue, targetValue));
 }
示例#16
0
        //change the blur component blur size from startValue to targetValue over 0.25 second
        IEnumerator FadeBlurRoutine(BlurOptimized blurEff, float startValue=0, float targetValue=0)
        {
            blurEff.enabled=true;

            float duration=0;
            while(duration<1){
                float value=Mathf.Lerp(startValue, targetValue, duration);
                blurEff.blurSize=value;
                duration+=Time.unscaledDeltaTime*4f;	//multiply by 4 so it only take 1/4 of a second
                yield return null;
            }
            blurEff.blurSize=targetValue;

            if(targetValue==0) blurEff.enabled=false;
            if(targetValue==1) blurEff.enabled=true;
        }
示例#17
0
 void Awake()
 {
     Inst = this;
 }