IEnumerator playAnimation() { //Open door door.transform.GetChild(1).gameObject.SetActive(false); yield return(new WaitForSeconds(0f)); float yTime = 0; while (yTime < 1) { character.transform.localPosition = character.transform.localPosition - new Vector3(0, 3, 0); yTime += Time.deltaTime; yield return(new WaitForEndOfFrame()); } float xTime = 0; while (xTime < 1) { character.transform.localPosition = character.transform.localPosition + new Vector3(3, 0, 0); xTime += Time.deltaTime; yield return(new WaitForEndOfFrame()); } Twirl twirl = Camera.main.gameObject.GetComponent <Twirl>(); float twirlTime = 0; while (twirlTime < 1) { twirl.angle = Mathf.Lerp(0, 180, twirlTime / 2); twirlTime += Time.deltaTime; yield return(new WaitForEndOfFrame()); } SceneManager.LoadScene("GameDetails"); }
void Start() { main = Camera.main; twirl = main.GetComponent <Twirl>(); increase = false; decrease = false; }
internal ActionContainer(IEnumerable <JToken> actions) { _actions = actions.Select(actionJToken => { Action action; switch (Action.ParseEventType(actionJToken["eventType"]?.ToString())) { case EventType.Twirl: action = new Twirl(actionJToken); break; case EventType.SetSpeed: action = new SetSpeed(actionJToken); break; case EventType.NotAvailable: goto default; default: action = new Action(actionJToken); break; } action.ActionChanged += Action_OnActionChanged; return(action); }).ToList(); }
private void Awake() { state = States.NotPlaying; twirl = GameManager.mainCamera.GetComponent <Twirl>(); GameManager.eventSystem.Subscribe("Success", Destroy); GameManager.eventSystem.Subscribe("Failed", Failed); }
void Start() { twirl = GetComponent <Twirl> (); _slider = _slider.GetComponent <Slider> (); _sliderValue = _slider.value; _anim = GameObject.FindObjectOfType <AnimationHandler>(); }
// Specific method only for the Twirl Component. public IEnumerator TwirlSmoothStep(Twirl twirlCamera, float twirlTime, float angleStart, float angleEnd) { // Loop for how ever long twirlTime is. for (float x = 0f; x < 1.0f; x += Time.deltaTime / twirlTime) { // Alter the angle based on the time. twirlCamera.angle = Mathf.SmoothStep(angleStart, angleEnd, x); yield return(null); } // Make sure the angle is fully at the end. twirlCamera.angle = angleEnd; }
void Start() { player = FindObjectOfType <Player>(); theLight = FindObjectOfType <TheLight>(); blur = GetComponent <Blur>(); bloom = GetComponent <Bloom>(); twirl = GetComponent <Twirl>(); camera = GetComponent <Camera>(); shafts = GetComponent <SunShafts>(); motionBlur = GetComponent <CameraMotionBlur>(); }
public IEnumerator TwirlDown() { Twirl twirl = GetComponent <Twirl>(); for (float f = max_twirl; f > 0.0f;) { f -= twirl_speed * Time.deltaTime; twirl.angle = f; yield return(null); } twirl.angle = 0; }
public IEnumerator TwirlUp() { Twirl twirl = GetComponent <Twirl>(); for (float f = 0; f < max_twirl;) { f += twirl_speed * Time.deltaTime; twirl.angle = f; yield return(null); } twirl.angle = max_twirl; }
// Use this for initialization void Start() { gc = gameObject.GetComponent<GameController>(); twirl = GetComponent<Twirl>(); twirlRadius = twirl.radius.x; //twirlRadiusY = twirl.radius.y; twirlAngle = twirl.angle; randomSubtraction = Random.Range(0.1f, 0.2f); randomRadius = Random.Range(1.5f, 3f); twirl.radius.x = randomRadius; twirl.radius.y = randomRadius; twirl.angle = Random.Range(60f, 220f); }
// Use this for initialization void Start() { gc = gameObject.GetComponent <GameController>(); twirl = GetComponent <Twirl>(); twirlRadius = twirl.radius.x; //twirlRadiusY = twirl.radius.y; twirlAngle = twirl.angle; randomSubtraction = Random.Range(0.1f, 0.2f); randomRadius = Random.Range(1.5f, 3f); twirl.radius.x = randomRadius; twirl.radius.y = randomRadius; twirl.angle = Random.Range(60f, 220f); }
void Start() { twirl = GetComponent <Twirl>(); if (twirl == null) { Debug.LogError("No Twirl Component found for " + gameObject); } if (!cycle) { speed = Mathf.Abs(speed); if (from > to) { speed *= -1; } } }
public void Add(Data.Action action) { Action instance = null; switch (action.EventType) { case EventType.Twirl: if (Find(EventType.Twirl) != null) { break; } instance = new Twirl(JToken.FromObject(action)); OnActionChanged?.Invoke(CacheValue.IsClockWise); break; case EventType.SetSpeed: var setSpeedData = (Data.SetSpeed)action; if (Find(EventType.SetSpeed) is SetSpeed setSpeed) { setSpeed.SetValue(setSpeedData.SpeedType, (setSpeedData.SpeedType == SpeedType.Bpm) ? setSpeedData.BeatsPerMinute : setSpeedData.BpmMultiplier); } else { instance = new SetSpeed(JToken.FromObject(setSpeedData)); } OnActionChanged?.Invoke(CacheValue.Bpm); break; case EventType.NotAvailable: goto default; default: break; } if (instance == null) { return; } instance.ActionChanged += Action_OnActionChanged; _actions.Add(instance); }
void Start() { motionBlur = Camera.main.GetComponent<MotionBlur>(); twirl = Camera.main.GetComponent<Twirl>(); fisheye = Camera.main.GetComponent<Fisheye>(); vignette = Camera.main.GetComponent<VignetteAndChromaticAberration>(); noise = Camera.main.GetComponent<NoiseAndGrain>(); motionBlur.enabled = false; twirl.enabled = false; fisheye.enabled = false; vignette.enabled = false; noise.enabled = false; }
// Use this for initialization void Start() { state = State.NEW; player = GameObject.Find("Player"); cam = GameObject.Find("MainCameraParent"); cameraMovement = cam.GetComponent<CameraMovement>(); playerMovement = player.GetComponent<PlayerMovement>(); cameraTwirl = cam.GetComponentInChildren<Twirl>(); cameraTwirl.radius.x = cameraTwirl.radius.y = minRadius; cameraTwirl.angle = minBlur; currentPullforce = minPullForce; rumblePickup = transform.GetChild(0); }
// Use this for initialization void Start() { effect = camera.GetComponent <Twirl>(); }
// Use this for initialization void Start() { chromatic_Vignette = GetComponent <VignetteAndChromaticAberration>(); twirl = GetComponent <Twirl>(); curves = GetComponent <ColorCorrectionCurves>(); }
// Use this for initialization void Start () { tw = GetComponent<Twirl>(); g = GetComponent<Grayscale>(); v = GetComponent<VignetteAndChromaticAberration>(); Search(); }
private void Start() { _introState = IntroState.Loading; _starTime = Time.realtimeSinceStartup; _rotSpeed = 10; _lastDataCheck = -1; _storyPlaneId = 1; _webcamTex = new Texture2D(1920, 1080, TextureFormat.RGBA32, false); //_webcamTex = new Texture2D(1024, 768, TextureFormat.RGBA32, false); Planes.SetActive(false); _audioSource = GetComponent<AudioSource>(); _audioSource.clip = Resources.Load<AudioClip>("Audio/intro2"); _planeRenderer = Plane.GetComponent<Renderer>(); StoryPlane.transform.localScale = new Vector3(0.0001f, 0, 0.0001f); _tempTargetPos = new Vector3(Random.Range(-0.01f, 0.01f), Random.Range(-0.01f, 0.01f), _planeStartPos.z); var nextTex = Resources.Load<Texture2D>("Textures/Story/Story1"); StoryPlane.GetComponent<Renderer>().material.mainTexture = nextTex; _cccScriptLeft = leftCam.GetComponent<ColorCorrectionCurves>(); _cccScriptRight = rightCam.GetComponent<ColorCorrectionCurves>(); _grayScriptLeft = leftCam.GetComponent<Grayscale>(); _grayScriptRight = rightCam.GetComponent<Grayscale>(); _grayScriptLeft.enabled = false; _grayScriptRight.enabled = false; _twirlScriptLeft = leftCam.GetComponent<Twirl>(); _twirlScriptRight = rightCam.GetComponent<Twirl>(); _twirlScriptLeft.enabled = false; _twirlScriptRight.enabled = false; }