public override void SetMode(PartMode mode)
    {
        this.mode = mode;

        switch (mode)
        {
        case PartMode.Build:
            spriteRenderer.enabled = false;
            break;

        case PartMode.BuildGhost:
            // spriteRenderer.color = new Color(1f, 1f, 1f, 0.4f);
            spriteRenderer.sortingLayerName = "Ghost Attachment Points";
            if (!attachedPart)
            {
                spriteRenderer.enabled = true;
            }
            break;

        default:
            spriteRenderer.color            = Color.white;
            spriteRenderer.sortingLayerName = "Attachment Points";
            spriteRenderer.enabled          = false;
            break;
        }
    }
Пример #2
0
    public void SetMode(PartMode mode)
    {
        this.mode = mode;

        switch (mode)
        {
        case PartMode.Build:
            foreach (var attachmentPoint in attachmentPoints)
            {
                attachmentPoint.SetMode(mode);
            }
            break;

        case PartMode.BuildGhost:
            spriteRenderer.color            = new Color(1f, 1f, 1f, 0.4f);
            spriteRenderer.sortingLayerName = "Ghost";
            collider.enabled = false;
            foreach (var attachmentPoint in attachmentPoints)
            {
                attachmentPoint.SetMode(mode);
            }
            break;

        default:
            spriteRenderer.color            = Color.white;
            spriteRenderer.sortingLayerName = "Default";
            collider.enabled = true;
            foreach (var attachmentPoint in attachmentPoints)
            {
                attachmentPoint.SetMode(mode);
            }
            break;
        }
    }
Пример #3
0
    public virtual void SetMode(PartMode mode)
    {
        this.mode = mode;

        switch (mode)
        {
        case PartMode.Build:
            spriteRenderer.enabled = true;
            break;

        default:
            spriteRenderer.enabled = false;
            break;
        }
    }