예제 #1
0
        private mg_jr_Environment AddNewEnvironment(mg_jr_EnvironmentID _id)
        {
            mg_jr_Environment mg_jr_Environment2 = mg_jr_Environment.CreateEnvironment(_id.Type, _id.Variant, m_speed);

            mg_jr_Environment2.transform.parent = base.transform;
            mg_jr_Environment2.gameObject.SetActive(value: false);
            m_environments.Add(_id, mg_jr_Environment2);
            return(mg_jr_Environment2);
        }
예제 #2
0
        public void ChangeEnvironment()
        {
            mg_jr_EnvironmentID id = CurrentEnvironment.Id;

            Assert.NotNull(id, "Environment id should never be null");
            List <mg_jr_EnvironmentID> list = new List <mg_jr_EnvironmentID>(m_environments.Keys);

            list.Remove(new mg_jr_EnvironmentID(id.Type, EnvironmentVariant.DEFAULT));
            list.Remove(new mg_jr_EnvironmentID(id.Type, EnvironmentVariant.NIGHT));
            mg_jr_EnvironmentID environmentId = list[Random.Range(0, list.Count)];

            ChangeEnvironment(environmentId);
        }
예제 #3
0
 public void ChangeEnvironment(mg_jr_EnvironmentID _environmentId)
 {
     Assert.NotNull(_environmentId, "Environment id can't be null");
     if (!(CurrentEnvironment != null) || !(_environmentId == CurrentEnvironment.Id))
     {
         if (m_environments.ContainsKey(_environmentId))
         {
             CurrentEnvironment.gameObject.SetActive(value: false);
             CurrentEnvironment = m_environments[_environmentId];
             CurrentEnvironment.gameObject.SetActive(value: true);
         }
         else
         {
             DisneyMobile.CoreUnitySystems.Logger.LogWarning(this, "No environment found for id, environment remaina the same");
         }
     }
 }
예제 #4
0
 public static mg_jr_Environment CreateEnvironment(mg_jr_EnvironmentID _id, mg_jr_ScrollingSpeed _scrolling)
 {
     return(CreateEnvironment(_id.Type, _id.Variant, _scrolling));
 }