コード例 #1
0
        async Task <Uri> Noise(int EffectPercentage)
        {
            NoiseLevel level = NoiseLevel.Minimum;

            if (EffectPercentage <= 35)
            {
                level = NoiseLevel.Minimum;
            }
            else if (EffectPercentage > 70)
            {
                level = NoiseLevel.Maximum;
            }
            else
            {
                level = NoiseLevel.Medium;
            }
            using (var source = new StorageFileImageSource(imageStorageFile))
                using (var contrastEffect = new ContrastEffect(source)
                {
                    Level = 0.6
                })
                    using (var sharpnessEffect = new NoiseEffect(contrastEffect)
                    {
                        Level = level
                    })
                    {
                        LastEffect = sharpnessEffect;
                        return(await SaveToImage());
                    }
        }
コード例 #2
0
ファイル: NoiseSensor.cs プロジェクト: Azazell0/AllMinigames
 public void Reset()
 {
     Init();
     _lastNoiseColider = null;
     _noiseLevel = NoiseLevel._0;
     UpdateSprite();
 }
コード例 #3
0
 public EngineType(
     string model,
     Manufacturer manufacturer,
     TypeOfEngine engine,
     NoiseLevel noise,
     double consumptation,
     long price,
     int maxspeed,
     int ceiling,
     double runway,
     double range,
     Period<int> produced)
 {
     Model = model;
     Manufacturer = manufacturer;
     Engine = engine;
     ConsumptationModifier = consumptation;
     Price = price;
     MaxSpeed = maxspeed;
     Ceiling = ceiling;
     RunwayModifier = runway;
     RangeModifier = range;
     Produced = produced;
     Types = new List<AirlinerType>();
     Noise = noise;
 }
コード例 #4
0
    private float ComputeNoiseLevel(AudioSource source, Vector3 position)
    {
        NoiseLevel component = source.GetComponent <NoiseLevel>();

        if (component && component.Level > 0f)
        {
            float   num       = Vector3.Distance(position, source.transform.position);
            float   result    = component.Level / (num + 0.1f);
            Vector3 position2 = source.transform.position;
            return(result);
        }
        return(0f);
    }
コード例 #5
0
ファイル: EngineType.cs プロジェクト: petfol/tap-desktop
 public EngineType(string model, string manufacturer, TypeOfEngine engine, NoiseLevel noise, double consumptation, long price, int maxspeed, int ceiling, double runway, double range, Period <int> produced)
 {
     this.Model                 = model;
     this.Manufacturer          = manufacturer;
     this.Engine                = engine;
     this.ConsumptationModifier = consumptation;
     this.Price                 = price;
     this.MaxSpeed              = maxspeed;
     this.Ceiling               = ceiling;
     this.RunwayModifier        = runway;
     this.RangeModifier         = range;
     this.Produced              = produced;
     this.Types                 = new List <AirlinerType>();
 }
コード例 #6
0
ファイル: EngineType.cs プロジェクト: tehknox/tap-desktop
 public EngineType(string model, string manufacturer, TypeOfEngine engine, NoiseLevel noise, double consumptation, long price, int maxspeed, int ceiling, double runway, double range, Period<int> produced)
 {
     this.Model = model;
     this.Manufacturer = manufacturer;
     this.Engine = engine;
     this.ConsumptationModifier = consumptation;
     this.Price = price;
     this.MaxSpeed = maxspeed;
     this.Ceiling = ceiling;
     this.RunwayModifier = runway;
     this.RangeModifier = range;
     this.Produced = produced;
     this.Types = new List<AirlinerType>();
 }
コード例 #7
0
        internal static string ToSerializedValue(this NoiseLevel value)
        {
            switch (value)
            {
            case NoiseLevel.Low:
                return("Low");

            case NoiseLevel.Medium:
                return("Medium");

            case NoiseLevel.High:
                return("High");
            }
            return(null);
        }
コード例 #8
0
 void UpdateCurrentSpeedAndNoiseLevel()
 {
     if (GameInput.instance.movement == Vector2.zero)
     {
         noiseLevel   = NoiseLevel.none;
         currentSpeed = 0;
     }
     else if (GameInput.instance.isWalkingSlowly)
     {
         noiseLevel   = NoiseLevel.low;
         currentSpeed = slowWalkSpeed;
     }
     else if (GameInput.instance.isRunning)
     {
         noiseLevel   = NoiseLevel.high;
         currentSpeed = runSpeed;
     }
     else
     {
         noiseLevel   = NoiseLevel.medium;
         currentSpeed = walkSpeed;
     }
 }
コード例 #9
0
        public EllipseDrawing(int width, int height, NoiseLevel level, Color color)
        {
            m_width  = width;
            m_height = height;
            m_color  = color;
            int m1 = 1;
            int m2 = 1;

            switch (level)
            {
            case NoiseLevel.None:
                return;

            case NoiseLevel.Low:
                m1 = 100;    // 15 points
                m2 = 25;     // 8 size
                break;

            case NoiseLevel.Medium:
                m1 = 60;     // 25 points
                m2 = 30;     // 6 size
                break;

            case NoiseLevel.High:
                m1 = 40;     // 35 points
                m2 = 40;     // 5 size
                break;

            case NoiseLevel.Extreme:
                m1 = 30;     // 50 points
                m2 = 50;     // 4 size
                break;
            }

            m_maxSize = Convert.ToInt32(Math.Max(width, height) / m2);
            m_count   = Convert.ToInt32(width * height / m1);
        }
コード例 #10
0
        public CurveDrawing(int width, int height, NoiseLevel level, Color color)
        {
            m_width  = width;
            m_height = height;
            m_color  = color;

            switch (level)
            {
            case NoiseLevel.None:
                return;

            case NoiseLevel.Low:
                m_pointsCount = 4;
                m_penWidth    = height / 38f;  // width 2
                m_linesCount  = 1;
                break;

            case NoiseLevel.Medium:
                m_pointsCount = 3;
                m_penWidth    = height / 30f;  // width 2.5
                m_linesCount  = 2;
                break;

            case NoiseLevel.High:
                m_pointsCount = 3;
                m_penWidth    = height / 25f;  // width 3
                m_linesCount  = 3;
                break;

            case NoiseLevel.Extreme:
                m_pointsCount = 4;
                m_penWidth    = height / 23f;  // width 3
                m_linesCount  = 3;
                break;
            }
        }
コード例 #11
0
        public void Update()
        {
            GameObject gameObject  = null;
            float      num         = 10000f;
            GameObject gameObject2 = GameObject.FindGameObjectWithTag("MainCamera");

            if (gameObject2 == null)
            {
                return;
            }
            Vector3 position = gameObject2.transform.position;
            bool    flag     = false;

            for (int i = 0; i < this.sources.Count; i++)
            {
                GameObject gameObject3 = this.sources[i];
                if (gameObject3)
                {
                    float num2 = Vector3.Distance(gameObject3.transform.position, position) / (0.25f + gameObject3.GetComponent <AudioSource>().volume);
                    if (num2 < num)
                    {
                        num        = num2;
                        gameObject = gameObject3;
                    }
                }
                else
                {
                    flag = true;
                }
            }
            if (this.activeSound)
            {
                float num3 = 0f;
                if (gameObject)
                {
                    for (int j = 0; j < this.sources.Count; j++)
                    {
                        GameObject gameObject4 = this.sources[j];
                        if (gameObject4 != null && gameObject4 != gameObject)
                        {
                            num3 += 0.7f * gameObject4.GetComponent <AudioSource>().volume *(4f / (4f + Vector3.Distance(gameObject.transform.position, gameObject4.transform.position)));
                        }
                    }
                    float max = Mathf.Min(1.75f * this.prefab.GetComponent <AudioSource>().volume, 1f);
                    this.activeSound.GetComponent <AudioSource>().volume = Mathf.Clamp(gameObject.GetComponent <AudioSource>().volume + num3, 0f, max);
                }
            }
            if (!gameObject)
            {
                if (this.activeSound)
                {
                    Singleton <AudioManager> .Instance.StopLoopingEffect(this.activeSound.GetComponent <AudioSource>());
                }
            }
            else if (!this.activeSound)
            {
                this.activeSound = UnityEngine.Object.Instantiate <AudioSource>(this.prefab).gameObject;
                this.activeSound.gameObject.name = "LoopingSoundCombined-" + this.prefab.GetComponent <AudioSource>().clip.name;
                NoiseLevel component = this.activeSound.GetComponent <NoiseLevel>();
                if (component)
                {
                    UnityEngine.Object.Destroy(component);
                }
                Singleton <AudioManager> .Instance.StartLoopingEffect(this.activeSound.GetComponent <AudioSource>(), gameObject.transform.parent);
            }
            else if (!this.activeSound.GetComponent <AudioSource>().isPlaying&& !Singleton <AudioManager> .Instance.Paused && this.activeSound.activeInHierarchy && this.activeSound.GetComponent <AudioSource>().enabled)
            {
                Singleton <AudioManager> .Instance.StartLoopingEffect(this.activeSound.GetComponent <AudioSource>(), gameObject.transform.parent);
            }
            if (gameObject && this.activeSound && this.activeSound.transform.parent != gameObject.transform.parent)
            {
                this.activeSound.transform.parent        = gameObject.transform.parent;
                this.activeSound.transform.localPosition = Vector3.zero;
            }
            if (flag)
            {
                for (int k = 0; k < this.sources.Count; k++)
                {
                    if (!this.sources[k])
                    {
                        this.sources.RemoveAt(k);
                        break;
                    }
                }
            }
        }
コード例 #12
0
ファイル: Par2Library.cs プロジェクト: jlacube/Par2NET
 public static void SetNoiseLevel(NoiseLevel newNoiseLevel)
 {
     noiseLevel = newNoiseLevel;
 }
コード例 #13
0
 void OnTriggerEnter(Collider other)
 {
     Debug.Log ("start enter event");
     if (!MiniGame22_Manager.instance.isPlay) {
         return;
     }
     NoiseSource ns = other.GetComponent<NoiseSource>();
     if (ns != null)
     {
         _lastNoiseColider = other;
         noiseSource = ns;
         noiseLevel = ns.noiseLevel;
     }
     Debug.Log ("finish enter event");
 }
コード例 #14
0
ファイル: Par2Library.cs プロジェクト: jhdscript/Par2NET
 public static void SetNoiseLevel(NoiseLevel newNoiseLevel)
 {
     noiseLevel = newNoiseLevel;
 }
コード例 #15
0
        void OnTriggerExit(Collider other)
        {
            Debug.Log ("start exit event");
            if (!MiniGame22_Manager.instance.isPlay || _lastNoiseColider == null) {
                Debug.Log ("finish exit event");
                return; }

            if (_lastNoiseColider == other)
            {
                noiseSource = null;
                noiseLevel = NoiseLevel._0;
                _lastNoiseColider = null;
            }
            Debug.Log ("finish exit event");
        }
コード例 #16
0
 /// <summary>
 /// Initializes a new instance of the Noise class.
 /// </summary>
 /// <param name="noiseLevel">An enum value indicating level of noise.
 /// Possible values include: 'Low', 'Medium', 'High'</param>
 /// <param name="value">A number indicating level of noise level
 /// ranging from 0 to 1. [0, 0.25) is under exposure. [0.25, 0.75) is
 /// good exposure. [0.75, 1] is over exposure. [0, 0.3) is low noise
 /// level. [0.3, 0.7) is medium noise level. [0.7, 1] is high noise
 /// level.</param>
 public Noise(NoiseLevel noiseLevel = default(NoiseLevel), double value = default(double))
 {
     NoiseLevel = noiseLevel;
     Value      = value;
     CustomInit();
 }
コード例 #17
0
ファイル: NoiseSensor.cs プロジェクト: Azazell0/AllMinigames
        void OnTriggerEnter(Collider other)
        {
            if (!MiniGame22_Manager.instance.isPlay)
                return;

            NoiseSource ns = other.GetComponent<NoiseSource>();
            if (ns != null)
            {
                _lastNoiseColider = other;
                noiseLevel = ns.noiseLevel;
                MiniGame22_Manager.instance.WasFindNoise(ns);
            }
        }
コード例 #18
0
ファイル: NoiseSensor.cs プロジェクト: Azazell0/AllMinigames
        void OnTriggerExit(Collider other)
        {
            if (!MiniGame22_Manager.instance.isPlay || _lastNoiseColider == null)
                return;

            if (_lastNoiseColider == other)
            {
                noiseLevel = NoiseLevel._0;
                _lastNoiseColider = null;
            }
        }