Esempio n. 1
0
 /*********************************************************************************
  *
  * PRIVATE METHDOS
  *
  *********************************************************************************/
 private void NextSunsetStep()
 {
     //Debug.Log("AnimateSky.NextSunsetStep(): sunsetScreen=" + sunsetScreen);
     if(sunsetAnimationTextureSet.Length > sunsetScreen) {
         SetSkyTextureSet(sunsetAnimationTextureSet[sunsetScreen++]);
         Invoke("NextSunsetStep", sunsetSpeed);
     }
     else {
         //Debug.Log("AnimateSky.NextSunsetStep() ready. It is night");
         timeOfDay = GameTime.TIME_OF_DAY.NIGHT;
         SetSkyTextureSet(nightTextureSet);
     }
 }
Esempio n. 2
0
    // Use this for initialization
    void Start()
    {
        Init();

        // registering to receice changes in QualitySetting in animation menu
        LocationAnimQuality.RegisterListener(this);

        // get the initial value and enable or disable Behaviour based on it
        enabled = LocationAnimQuality.Enabled();
        animationEnabled = enabled;

        GameTime.RegisterTimeOfDayListener(this);
        cameraEffectScript = mainCamera.GetComponent(typeof(ColorCorrectionEffect)) as ColorCorrectionEffect;

        // We want to switch image effects on and off. So we need to check if effect is supported
        // Effect does this, but we do not know if it disabled itself because effect or shader is not supported
        imageEffectSupported = SystemInfo.supportsImageEffects;
        if(imageEffectSupported) {
            imageEffectSupported = cameraEffectScript.shader.isSupported;
        }
        Debug.Log("AnimateSky.Start():  image effects and effect shader supported: " + imageEffectSupported);

        GameObject pc = CharacterManager.GetPC();
        pcState = pc.GetComponent(typeof(CharacterState)) as CharacterState;

        //SetSkyTextureSet(dayTexureSet);
        //timeOfDay=GameTime.TIME_OF_DAY.DAY;
        timeOfDay = GameTime.GetTimeOfDay();

        switch(timeOfDay) {
            case GameTime.TIME_OF_DAY.DAY:
                SetSkyTextureSet(dayTexureSet);
                break;
            case GameTime.TIME_OF_DAY.NIGHT:
                SetSkyTextureSet(nightTextureSet);
                break;
        }
    }
Esempio n. 3
0
 // This is called if it is a day and dunrise time was skipped
 public void SetNight()
 {
     Debug.Log("AnimateSky.SetNight()");
     StopSunsetAnimationIfNeeded();
     timeOfDay = GameTime.TIME_OF_DAY.NIGHT;
     SetSkyTextureSet(nightTextureSet);
 }
Esempio n. 4
0
 /*********************************************************************************
  *
  * INTERFACE METHDOS, from TimeOfDayListener
  *
  *********************************************************************************/
 public void SetSunset()
 {
     Debug.Log("AnimateSky.SetSunset()");
     if(animationEnabled) {
         StopSunsetAnimationIfNeeded();
         timeOfDay = GameTime.TIME_OF_DAY.SUNSET;
         sunsetScreen=0;
         Invoke("NextSunsetStep", sunsetSpeed);
     }
     else {
         //Debug.Log("-- QualityFactor  below Good, skipping sunset animation");
         SetNight();
     }
 }
Esempio n. 5
0
 public void SetDay()
 {
     Debug.Log("AnimateSky.SetDay()");
     StopSunsetAnimationIfNeeded();
     timeOfDay = GameTime.TIME_OF_DAY.DAY;
     SetSkyTextureSet(dayTexureSet);
 }
 public void SetDay()
 {
     Debug.Log("AnimateWater.SetDay()");
             StopSunsetAnimationIfNeeded();
             timeOfDay = GameTime.TIME_OF_DAY.DAY;
             SetTexture(dayTexture);
 }
    /*********************************************************************************
     *
     * OVERLOADED METHDOS, from MonoBehaviour
     *
     *********************************************************************************/
    // Use this for initialization
    void Start()
    {
        Init();
        // registering to receice changes in QualitySetting in animation menu
        LocationAnimQuality.RegisterListener(this);

        // get the initial value and enable or disable Behaviour based on it
        enabled = LocationAnimQuality.Enabled();
        animationEnabled = 	enabled;

        timeOfDay = GameTime.GetTimeOfDay();

                switch(timeOfDay) {
                        case GameTime.TIME_OF_DAY.DAY:
                                SetTexture(dayTexture);
                                break;
                        case GameTime.TIME_OF_DAY.NIGHT:
                                SetTexture(nightTexture);
                                break;
                }
                GameTime.RegisterTimeOfDayListener(this);
    }
 /*********************************************************************************
  *
  * PRIVATE METHDOS
  *
  *********************************************************************************/
 private void NextSunsetStep()
 {
     //Debug.Log("AnimateWater.NextSunsetStep(): sunsetScreen=" + sunsetScreen);
     if(waterSunsetTextures.Length > sunsetScreen) {
                     SetTexture(waterSunsetTextures[sunsetScreen++]);
                     Invoke("NextSunsetStep", sunsetSpeed);
     }
     else {
                     //Debug.Log("AnimateSky.NextSunsetStep() ready. It is night");
                     timeOfDay = GameTime.TIME_OF_DAY.NIGHT;
                     SetTexture(nightTexture);
     }
 }
 /*********************************************************************************
 *
 * INTERFACE METHDOS, from TimeOfDayListener
 *
 *********************************************************************************/
 public void SetSunset()
 {
     Debug.Log("AnimateWater.SetSunset()");
            	if(animationEnabled) {
                 StopSunsetAnimationIfNeeded();
                 timeOfDay = GameTime.TIME_OF_DAY.SUNSET;
                 sunsetScreen=0;
                 Invoke("NextSunsetStep", sunsetSpeed);
            	}
            	else {
            		SetNight();
            	}
 }