Exemple #1
0
        private void SetupBar(Color barColor, Vector3 localScale, int sortingOrder)
        {
            GameObject barGO = new GameObject("Bar");

            bar = barGO.transform;
            bar.SetParent(transform);
            bar.localPosition = new Vector3(-localScale.x / 2f, 0, 0);
            bar.localScale    = new Vector3(1, 1, 1);
            Transform barIn = UtilsClass.CreateWorldSprite(bar, "BarIn", Assets.i.s_White, new Vector3(localScale.x / 2f, 0), localScale, sortingOrder, barColor).transform;
        }
Exemple #2
0
 private void SetupBackground(Color backgroundColor, Vector3 localScale, int sortingOrder)
 {
     background = UtilsClass.CreateWorldSprite(
         transform,
         "Background",
         Assets.i.s_White,
         new Vector3(0, 0),
         localScale,
         sortingOrder,
         backgroundColor
         ).transform;
 }
Exemple #3
0
 private void SetupOutline(Outline outline, Vector3 localScale, int sortingOrder)
 {
     UtilsClass.CreateWorldSprite(
         transform,
         "Outline",
         Assets.i.s_White,
         new Vector3(0, 0),
         localScale + new Vector3(outline.size, outline.size),
         sortingOrder,
         outline.color
         );
 }
Exemple #4
0
        public World_Sprite(Transform parent, Vector3 localPosition, Vector3 localScale,
                            Sprite sprite, Color color, int sortingOrderOffset)
        {
            int sortingOrder = GetSortingOrder(localPosition, sortingOrderOffset);

            gameObject = UtilsClass.CreateWorldSprite(
                parent,
                "Sprite",
                sprite,
                localPosition,
                localScale,
                sortingOrder,
                color
                );
            transform      = gameObject.transform;
            spriteRenderer = gameObject.GetComponent <SpriteRenderer>();
        }