This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Project.Views | |
{ | |
// nasza klasa musi dziedziczyć po VisualElement, abyśmy mogli jej używać | |
public class CharacterElement : VisualElement | |
{ | |
// elementy widoku (podwidoki) np. Button, Label, Text itd. | |
private Button closeButton; | |
private Label mainLabel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#character-list { | |
flex-grow: 1; | |
} | |
#footer { | |
margin-top: auto; | |
flex-direction: row; | |
} | |
.row-direction { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- za pomocą editor-extension-mode="False" dajemy znać, że tego widoku używamy w runtimie gry --> | |
<ui:UXML xmlns:ui="UnityEngine.UIElements" noNamespaceSchemaLocation="../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False"> | |
<!-- podciągamy style zdefiniowane w pliku Test.uss --> | |
<Style src="/Assets/UI/Uss/Styles.uss" /> | |
<!-- poniżej definiujemy własny bardziej skomplikowany element znajdujący się w innym pliku .uxml --> | |
<ui:Template name="character-template" src="CharacterTemplate.uxml" /> | |
<!-- pełna klasyfikacja klasy C# (włącznie z namespace'em) --> | |
<Project.Views.CharacterElement> | |
<!-- możemy też nadpisywać domyślne stylowanie za pomocą atrybutu style --> | |
<ui:Label name="main-label" text="Label" class="one-third-width dialog-font" style="-unity-text-align: middle-center;" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if UNITY_EDITOR | |
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Linq; | |
using UnityEditor; | |
using Debug = UnityEngine.Debug; | |
namespace Project.Editor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rem Ustawiamy ścieżkę do .exe edytora | |
set unity="C:\Program Files\Unity\Hub\Editor\2020.2.0f1\Editor\Unity.exe" | |
rem Ustawiamy ścieżkę do 7zipa | |
set zip="C:\Program Files\7-Zip\7z" | |
rem Ustawiamy nazwę platformy | |
set platform=Windows | |
rem ! Uruchamiamy metodę w klasie - pobieramy przez C# numer aktualnej rewizji, update'ujemy PlayerSetting.version i zapisujemy go w pliku version.log | |
%unity% -batchmode -projectPath ./ -executeMethod Project.Editor.Builder.SetVersionSVNRevision -logFile build.log -quit | |
rem nazwa projektu | |
set title=Projekt |