Beispiel #1
0
 public void SetSkateboardTexture(SkateboardItem boardItem)
 {
     foreach (Transform child in GetPlayerSkateboard().GetComponentsInChildren <Transform>())
     {
         if (this.boardMaterials.Contains <string>(child.name))
         {
             Renderer component = child.GetComponent <Renderer>();
             if (component != null)
             {
                 component.sharedMaterial.SetTexture(boardTextureName, (Texture)boardItem.texture);
             }
         }
     }
 }
Beispiel #2
0
        public SkateboardItem[] GetCustomSkateboards()
        {
            if (Directory.Exists(SXLCustomization.MOD_PATH + "\\Skateboard"))
            {
                string[]         boardPaths = Directory.GetFiles(SXLCustomization.MOD_PATH + "\\Skateboard", "*.png");
                SkateboardItem[] boardItems = new SkateboardItem[boardPaths.Length];

                for (int i = 0; i < boardPaths.Length; i++)
                {
                    boardItems[i] = new SkateboardItem(SXLFile.LoadImageFromFile(boardPaths[i]));
                }

                return(boardItems);
            }
            return(new SkateboardItem[0]);
        }