Exemplo n.º 1
0
 public override void OnStart(StartState state)
 {
     base.OnStart(state);
     if (state == StartState.Editor)
     {
         //init global limits
         if (minAspect < 0)
         {
             minAspect = ResizerGlobals.Instance.AbsMinAspect;
         }
         if (maxAspect < 0)
         {
             maxAspect = ResizerGlobals.Instance.AbsMaxAspect;
         }
         //get TechTree limits
         var limits = ResizerConfig.GetLimits(TechGroupID);
         if (limits != null)
         {
             init_limit(limits.minAspect, ref minAspect, Mathf.Min(aspect, orig_aspect));
             init_limit(limits.maxAspect, ref maxAspect, Mathf.Max(aspect, orig_aspect));
         }
     }
     else
     {
         UpdateDragCube();
     }
     just_loaded = true;
 }
 public override void OnStart(StartState state)
 {
     base.OnStart(state);
     if (state == StartState.Editor)
     {
         //init global limits
         if (minSize < 0)
         {
             minSize = ResizerGlobals.Instance.AbsMinSize;
         }
         if (maxSize < 0)
         {
             maxSize = ResizerGlobals.Instance.AbsMaxSize;
         }
         //get TechTree limits
         var limits = ResizerConfig.GetLimits(TechGroupID);
         if (limits != null)
         {
             init_limit(limits.minSize, ref minSize, Mathf.Min(size, orig_size));
             init_limit(limits.maxSize, ref maxSize, Mathf.Max(size, orig_size));
         }
         //setup sliders
         if (sizeOnly && aspectOnly)
         {
             aspectOnly = false;
         }
         if (aspectOnly || minSize.Equals(maxSize))
         {
             Fields["size"].guiActiveEditor = false;
         }
         else
         {
             setup_field(Fields["size"], minSize, maxSize, sizeStepLarge, sizeStepSmall);
         }
         if (sizeOnly || minAspect.Equals(maxAspect))
         {
             Fields["aspect"].guiActiveEditor = false;
         }
         else
         {
             setup_field(Fields["aspect"], minAspect, maxAspect, aspectStepLarge, aspectStepSmall);
         }
         Fields["size"].uiControlEditor.onFieldChanged = on_size_changed;
     }
     Rescale();
 }