Example #1
0
    // 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();
    }
Example #2
0
    //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();
    }
Example #3
0
 //"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();
 }
Example #4
0
        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);
        }
Example #5
0
        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);
        }
Example #6
0
 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();
 }
Example #7
0
    public void Init()
    {
        if (!_initalized)
        {
            _uiRef = UIHolder.UIInstance;
            SetUI();
            _initalized = true;
        }

        GameUpdate.PlayerSubscribe += TryMoveSelectedUI;
    }
Example #8
0
 //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       = "";
 }
Example #9
0
 // Start is called before the first frame update
 void Start()
 {
     if (instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
     }
     DontDestroyOnLoad(gameObject);
     unfade = true;
 }
Example #10
0
    //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();
    }
Example #11
0
    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;
    }
Example #12
0
    //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;
    }
Example #13
0
 void Init()
 {
     uiHolder = UIHolder.Instance();
 }
Example #14
0
 private void Start()
 {
     uIHolder = GetComponent <UIHolder>();
 }
Example #15
0
 public void Start()
 {
     player = GameObject.FindObjectOfType<FirstPersonController>();
     useSound = GetComponent<AudioSource>();
     uiHolder = UIHolder.Instance();
     if (GetComponent<Renderer>() != null)
         mat = GetComponent<Renderer>().material;
     localizer = Localizer.Instance();
 }