示例#1
0
 public void Init(ConstructionPrototype prototype)
 {
     Prototype = prototype;
     Stage     = 1;
     if (prototype.Stages[1].Icon != null)
     {
         Sprite.AddLayerWithSprite(prototype.Stages[1].Icon);
     }
     else
     {
         Sprite.AddLayerWithSprite(prototype.Icon);
     }
 }
 protected override void Startup()
 {
     base.Startup();
     RecalculateColor();
     if (!string.IsNullOrEmpty(_fillInitState))
     {
         _spriteComponent = Owner.GetComponent <SpriteComponent>();
         _fillPath        = new ResourcePath(_fillPathString);
         _fillSprite      = new SpriteSpecifier.Rsi(_fillPath, _fillInitState + (_fillInitSteps - 1));
         _spriteComponent.AddLayerWithSprite(_fillSprite);
         UpdateFillIcon();
     }
 }
 public void Init(ConstructionPrototype prototype)
 {
     Prototype = prototype;
     Stage     = 1;
     Sprite.AddLayerWithSprite(prototype.Stages[1].Icon);
 }