示例#1
0
    // Start is called before the first frame update
    void Start()
    {
        gameState = Camera.main.GetComponent <GameState>();

        spriteMasks     = new Dictionary <string, SpriteMask>();
        spriteRenderers = new List <SpriteRenderer>();

        int childCount = this.transform.childCount;

        for (int childIndex = 0; childIndex < childCount; childIndex++)
        {
            GameObject child = this.transform.GetChild(childIndex).gameObject;

            if (!child.name.StartsWith("Mask"))
            {
                spriteMasks.Add(child.name, child.GetComponent <SpriteMask>());
            }
        }

        roomIds = Blueprints.GetRoomIDs();

        foreach (SpriteRenderer spriteRenderer in this.transform.GetComponentsInChildren <SpriteRenderer>())
        {
            if (!spriteRenderer.gameObject.name.Equals("MaskHelp"))
            {
                spriteRenderers.Add(spriteRenderer);
            }

            if (spriteRenderer.gameObject.name.Equals("MaskHighlight"))
            {
                highlightSprite = spriteRenderer;
            }
        }

        transform.localPosition = positionRight;
    }