コード例 #1
0
        private String GetConfigString()
        {
            AtmosphereManager atmo = manager.AtmosphereManager;
            int hour = (int)atmo.Time.x;

            int min = (int)((atmo.Time.x - hour) * 60);


            String timeStr = Mogre.StringConverter.ToString(hour) + ":" + Mogre.StringConverter.ToString(min);
            String str     = "SkyX Plugin demo (Press F1 to show/hide information)";

            if (showInformation)
            {
                str += " - Simuation paused - \n";
            }
            else
            {
                str += "\n-------------------------------------------------------------\nTime: " + timeStr + "\\n";
            }

            if (showInformation)
            {
                str += "-------------------------------------------------------------\n";
                str += "Time: " + timeStr + " [1, Shift+1] (+/-).\n";
                str += "Rayleigh multiplier: " + Mogre.StringConverter.ToString(atmo.RayleighMultiplier) + " [2, Shift+2] (+/-).\n";
                str += "Mie multiplier: " + Mogre.StringConverter.ToString(atmo.MieMultiplier) + " [3, Shift+3] (+/-).\n";
                str += "Exposure: " + Mogre.StringConverter.ToString(atmo.Exposure) + " [4, Shift+4] (+/-).\n";
                str += "Inner radius: " + Mogre.StringConverter.ToString(atmo.InnerRadius) + " [5, Shift+5] (+/-).\n";
                str += "Outer radius: " + Mogre.StringConverter.ToString(atmo.OuterRadius) + " [6, Shift+6] (+/-).\n";
                str += "Number of samples: " + Mogre.StringConverter.ToString(atmo.NumberOfSamples) + " [7, Shift+7] (+/-).\n";
                str += "Height position: " + Mogre.StringConverter.ToString(atmo.HeightPosition) + " [8, Shift+8] (+/-).\n";
            }

            return(str);
        }
コード例 #2
0
 void Start()
 {
     if (instance)
     {
         Debug.LogWarning("Two atmosphere Manager instances");
         return;
     }
     instance = this;
 }
コード例 #3
0
 public void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         throw new System.Exception("Can't have multiple atmosphere manager.");
     }
 }
コード例 #4
0
 private void Start()
 {
     if (atmosphereManager == null)
     {
         atmosphereManager = PlayerManager.GetMainPlayer().ps.atmosphereManager;
         if (atmosphereManager == null)
         {
             atmosphereManager = this.GetComponentInParent <AtmosphereManager>();
         }
     }
 }
コード例 #5
0
		public AtmosphereProperties(){
			m_AtmosphereManager = FindObjectOfType<AtmosphereManager>();	
		}
コード例 #6
0
 // Use this for initialization
 void Start()
 {
     Instance = this;
     GetComponent <MeshFilter>().mesh = OctahedronSphereCreator.Create(subdivisions, radius);
 }
コード例 #7
0
ファイル: GasBridge.cs プロジェクト: VolatileAce/GGJ2K18
    public override void doSliderChange(float input)
    {
        base.doSliderChange(input);

        AtmosphereManager.SetGas(GasType, input);
    }
コード例 #8
0
 void Awake()
 {
     Instance = this;
 }
コード例 #9
0
 private void Update()
 {
     desiredValue = AtmosphereManager.GetGas(GasType).Percentage;
     currentValue = Mathf.Lerp(currentValue, desiredValue, 0.004f);
     UpdatePosition(currentValue);
 }
コード例 #10
0
    public void Evaluate()
    {
        string gasRating   = "Neutral";
        string musicRating = "Nuetral";
        string heatRating  = "Neutral";

        //Atmosphere
        float gasPenalty = 0f;

        foreach (var myGas in this.BreathableAtmosphere)
        {
            var cabinGas = AtmosphereManager.GetGas(myGas.Key);

            float diff = Mathf.Abs(cabinGas.Percentage - myGas.Value.Percentage);

            if (diff > breathableTolerance)
            {
                gasPenalty -= RatingPenaltyPerSecond * Time.deltaTime;
            }
            else
            {
                gasPenalty += RatingBonusPerSecond * Time.deltaTime;
            }
        }


        if (gasPenalty > 0)
        {
            gasRating = "Good Atmosphere: " + gasPenalty;
            ScoreManager.ImproveUberRating(gasPenalty);
        }
        else
        {
            gasRating = "Bad Atmosphere: " + gasPenalty;
            ScoreManager.DamageUberRating(-gasPenalty);
        }


        //Music
        if (RadioMusicManager.Instance.CurrentRadio.RadioType == HatedRadio.RadioType)
        {
            //I don't care what the volume is, turn it off mate.
            ScoreManager.DamageUberRating(RatingPenaltyPerSecond * Time.deltaTime);
            musicRating = "Hate Song";
        }

        if (RadioMusicManager.Instance.CurrentRadio.RadioType == LikedRadio.RadioType)
        {
            bool  withinTolerance = Mathf.Abs(RadioMusicManager.Instance.CurrentRadio.Volume - LikedRadio.Volume) < LikedRadio.Volume;
            float improvement     = RatingBonusPerSecond * Time.deltaTime;
            musicRating = "Like Song";

            //Too loud, or I can't here it? I don't enjoy it so much
            if (withinTolerance)
            {
                musicRating += " ,Bad Volume";
                improvement *= 0.5f;
            }

            ScoreManager.ImproveUberRating(improvement);
        }

        //Heat
        float diffDegrees = Mathf.Abs(HeatingManager.Instance.Heat.TemperatureDegrees - LikedHeat.TemperatureDegrees);

        //That's comfy
        if (diffDegrees < LikedHeat.ToleranceDegrees)
        {
            heatRating = "Good Heat";
            ScoreManager.ImproveUberRating(RatingBonusPerSecond * Time.deltaTime);
        }

        //Dude, too hot or cold.
        else
        {
            heatRating = "Bad Heat";
            ScoreManager.DamageUberRating(RatingPenaltyPerSecond * Time.deltaTime);
        }

        MyAlien.DebugUberText.text       = "Uber: " + ScoreManager.UberRating + " / 5";
        MyAlien.DebugAtmosphereText.text = "Gas: " + gasRating;
        MyAlien.DebugHeatText.text       = "Heat: " + heatRating;
        MyAlien.DebugMusicText.text      = "Music: " + musicRating;
    }