// static List<Character> _turnOrder; // public static List<Character> GetTurnOrder; //Base Constructor public static void Init() { _uiRef = UIHolder.UIInstance; _enemiesToMake = 2; _spawnedCharacters = new List <Character>(); CreateEnemies(); }
//initialize //loads empty that holds the entire field (all tiles and characters) public void Init() { if (!_initialized) { _uiRef = UIHolder.UIInstance; GameObject field = Resources.Load <GameObject>("GridObjects/BattleFieldHolder"); GameObject newfield = Instantiate(field, Vector3.zero, Quaternion.identity, null); _battlefield = newfield.GetComponent <WorldGridHandler>(); _battlefield.Init(); GridHandler.Init(); _initialized = true; SetUI(); } else { _battlefield.Init(); GridHandler.Init(); } ChangeGrid(); }
//"Constructor" if UI is used public static void Init(int numberOfEnemies) { _uiRef = UIHolder.UIInstance; _enemiesToMake = numberOfEnemies; _spawnedCharacters = new List <Character>(); CreateEnemies(); //HistoryHandler.AddToCurrentAction("Battle Start!"); //HistoryHandler.FinalizeAction(); }
public T InstantiateAndWrap <T>(UIHolder holderPrefab, T wrapperPrefab, UILayer layer, bool visible) where T : UIHolderWrapper { var holderInstance = UObj.Instantiate(holderPrefab, _layers[layer]); var wrapperInstance = UObj.Instantiate(wrapperPrefab, holderInstance.ContentRoot); wrapperInstance.WrapHolder(holderInstance); wrapperInstance.SetInitialVisibility(visible); return(wrapperInstance); }
public T InstantiateWrapped <T>(UIHolder prefab, UILayer layer, bool visible) where T : UIHolderWrapper { var holderInstance = UObj.Instantiate(prefab, _layers[layer]); var wrapperInstance = holderInstance.ContentRoot.GetComponent <T>(); wrapperInstance.WrapHolder(holderInstance); wrapperInstance.SetInitialVisibility(visible); return(wrapperInstance); }
public static void Init(int numberOfEnemies, List <DraggableCharacter> playerstospawn) { _uiRef = UIHolder.UIInstance; _enemiesToMake = numberOfEnemies; _spawnedCharacters = new List <Character>(); CreatePlayerTeam(playerstospawn); CreateEnemies(numberOfEnemies); _spawnedCharacters = RollForInitiative(_spawnedCharacters); //HistoryHandler.AddToCurrentAction("Battle Start!"); //HistoryHandler.FinalizeAction(); }
public void Init() { if (!_initalized) { _uiRef = UIHolder.UIInstance; SetUI(); _initalized = true; } GameUpdate.PlayerSubscribe += TryMoveSelectedUI; }
//initialize public static void Init(UIHolder reference) { _uiRef = reference; _history = new Stack <string>(); _alteredHistory = new Stack <string>(); _gridhistory = new Stack <string>(); _alteredGridHistory = new Stack <string>(); _characterInfo = new Stack <string>(); _alteredCharacterInfo = new Stack <string>(); _actionSentence = ""; }
// Start is called before the first frame update void Start() { if (instance != null) { Destroy(gameObject); } else { instance = this; } DontDestroyOnLoad(gameObject); unfade = true; }
//Init is the first thing that happens private void Awake() { if (_uiInstance != null && _uiInstance != this) { Destroy(this.gameObject); } else { _uiInstance = this; } SpellBook.LoadSpellBook(); LoadUIRefs(); ShowCharacterSelect(); }
public static UIHolder Instance() { if (!uiHolder) { uiHolder = FindObjectOfType(typeof(UIHolder)) as UIHolder; if (!uiHolder) { GameObject uiHolderObject = new GameObject("UIHolder"); uiHolderObject.AddComponent<UIHolder>(); uiHolder = uiHolderObject.GetComponent<UIHolder>(); } } return uiHolder; }
//initalize public void Init(CameraFollow camref) { if (!_initialized) { _uiRef = UIHolder.UIInstance; _battleCam = camref; _selector = Instantiate <GameObject>(Resources.Load <GameObject>("GridObjects/Selector")); _selector.SetActive(false); SetUI(); } else { _timeRef.ContinueFight(); } _battleCam.ChangeToBattleMode(); _interactState = UIInteractions.FREE; }
void Init() { uiHolder = UIHolder.Instance(); }
private void Start() { uIHolder = GetComponent <UIHolder>(); }
public void Start() { player = GameObject.FindObjectOfType<FirstPersonController>(); useSound = GetComponent<AudioSource>(); uiHolder = UIHolder.Instance(); if (GetComponent<Renderer>() != null) mat = GetComponent<Renderer>().material; localizer = Localizer.Instance(); }