예제 #1
0
    public void Generate(ColorOption colorOption, Vector2[] points)
    {
        RebuildMeshes(points);
        EnsureInternalHighlightable();

        UpdateCollider();

        ColorOption = colorOption;
        UpdateRendererColors(ColorOption.GetColor(), ColorOption.GetColor());
        UpdateRendererCutoff(0.0f, 0.0f);
    }
 private void TryClearDesiredColor(Pawn pawn, Apparel apparel, ColorOption colorOption)
 {
     if (apparel.DesiredColor.HasValue && apparel.DesiredColor.Value == colorOption.GetColor(pawn))
     {
         apparel.DesiredColor = null;
         if (pawn.CurJobDef == JobDefOf.RecolorApparel)
         {
             pawn.jobs.StopAll();
         }
     }
 }
예제 #3
0
    private void UpdateRenderer()
    {
        if (_renderer == null)
        {
            _renderer      = GetComponent <MeshRenderer>();
            _materialBlock = new MaterialPropertyBlock();
        }

        if (_colorPropertyID == -1)
        {
            _colorPropertyID = Shader.PropertyToID("_Color");
        }

        _materialBlock.SetColor(_colorPropertyID, colorOption.GetColor());
        _renderer.SetPropertyBlock(_materialBlock);
    }