Ejemplo n.º 1
0
        public void Clone(Bloom src)
        {
            tweakMode       = src.tweakMode;
            screenBlendMode = src.screenBlendMode;

            hdr = src.hdr;

            sepBlurSpread = src.sepBlurSpread;

            quality = src.quality;

            bloomIntensity      = src.bloomIntensity;
            bloomThreshold      = src.bloomThreshold;
            bloomThresholdColor = src.bloomThresholdColor;
            bloomBlurIterations = src.bloomBlurIterations;

            hollywoodFlareBlurIterations = src.hollywoodFlareBlurIterations;
            flareRotation       = src.flareRotation;
            lensflareMode       = src.lensflareMode;
            hollyStretchWidth   = src.hollyStretchWidth;
            lensflareIntensity  = src.lensflareIntensity;
            lensflareThreshold  = src.lensflareThreshold;
            lensFlareSaturation = src.lensFlareSaturation;
            flareColorA         = new Color(src.flareColorA.r, src.flareColorA.g, src.flareColorA.b, src.flareColorA.a);
            flareColorB         = new Color(src.flareColorB.r, src.flareColorB.g, src.flareColorB.b, src.flareColorB.a);
            flareColorC         = new Color(src.flareColorC.r, src.flareColorC.g, src.flareColorC.b, src.flareColorC.a);
            flareColorD         = new Color(src.flareColorD.r, src.flareColorD.g, src.flareColorD.b, src.flareColorD.a);
        }
Ejemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        bool    bumper        = _input.BumperDown;
        bool    touch         = _input.TouchActive;
        bool    trigger       = _input.TriggerDown;
        Vector2 touchPosition = _input.TouchPosition;

        if (trigger && !_isTriggerDown)
        {
            _isZ = !_isZ;
            Debug.Log("AXIS: " + (_isZ ? "Z" : "Y"));
        }

        switch (_mode)
        {
        case TweakMode.TRANSLATION:
            if (bumper && !_isBumperDown)
            {
                _mode = TweakMode.SCALE;
                Debug.Log("SCALE mode");
            }
            if (touch && !_isTouchDown)
            {
                Vector3 translation = new Vector3(touchPosition.x * TranslationStep,
                                                  _isZ ? 0 : touchPosition.y * TranslationStep, _isZ ? touchPosition.y * TranslationStep : 0);
                ChildObject.transform.position += translation;
                Debug.Log("Translated by " + translation + " to: " + ChildObject.transform.position);
            }
            break;

        case TweakMode.SCALE:
            if (bumper && !_isBumperDown)
            {
                _mode = TweakMode.ROTATION;
                Debug.Log("ROTATION mode");
            }
            if (touch && !_isTouchDown)
            {
                Vector3 rotation = new Vector3(touchPosition.x * RotationStep,
                                               _isZ ? 0 : touchPosition.y * RotationStep, _isZ ? touchPosition.y * RotationStep : 0);
                ChildObject.transform.rotation *= Quaternion.LookRotation(rotation);
                Debug.Log("Rotated by + " + rotation + " to: " + ChildObject.transform.rotation.eulerAngles);
            }
            break;

        case TweakMode.ROTATION:
            if (bumper && !_isBumperDown)
            {
                _mode = TweakMode.TRANSLATION;
                Debug.Log("TRANSLATION mode");
            }

            if (touch && !_isTouchDown)
            {
                Vector3 scale = new Vector3(touchPosition.x * TranslationStep,
                                            touchPosition.x * ScaleStep, touchPosition.x * TranslationStep);
                ChildObject.transform.localScale += scale;
                Debug.Log("Scaled by " + scale + " to: " + ChildObject.transform.localScale);
            }
            break;
        }

        _isBumperDown  = bumper;
        _isTouchDown   = touch;
        _isTriggerDown = trigger;
    }