Пример #1
0
    /// <summary>
    /// Start is called on the frame when a script is enabled just before
    /// any of the Update methods is called the first time.
    /// </summary>
    void Start()
    {
        selectionUI = GameObject.Find("UIManager").GetComponent <SelectionUI>();

        //GameObject.FindWithTag("Target").transform.position;
        pointerRectTransform = transform.Find("Pointer").GetComponent <RectTransform>();
    }
Пример #2
0
    public void Init()
    {
        if (swapUI == null)
        {
            swapUI              = UIManager.Instance.GetUI <SwapUI>("SwapUI");
            swapUI.chooseEvent += ChooseBtnClickCallback;
            swapUI.speakEvent  += SpeakBtnClickCallback;
            swapUI.SetButtonVisiable(SwapUI.BtnName.microButton, false);
            swapUI.SetButtonVisiable(SwapUI.BtnName.chooseButton, true);
        }
        if (selectUI == null)
        {
            selectUI             = UIManager.Instance.GetUI <SelectionUI>("selectionUI");
            selectUI.okEvent    += SelectUIOkBtnCallback;
            selectUI.closeEvent += CloseSelectUICallback;
        }
        UIManager.Instance.GetUI <Dialog>("Dialog").SetPos();

        UIManager.Instance.SetUIDepthTop("selectionUI");

        PeopleManager.Instance.Reset();

        LS = PeopleManager.Instance.GetPeople(PeopleTag.LS_BD).GetAnimatorOper();
        XH = PeopleManager.Instance.GetPeople(PeopleTag.XH_BD).GetAnimatorOper();
        PeopleManager.Instance.GetPeople(PeopleTag.FDLS_BD).GetAnimatorOper().gameObject.SetActive(false);
        LS.PlayForward("idle");
        XH.PlayForward("idle");
        HighLightCtrl.GetInstance().OffAllObjs();
        GetTukaObject();
    }
Пример #3
0
        public TrainCopyDialog(Train t, Timetable tt)
        {
            Eto.Serialization.Xaml.XamlReader.Load(this);

            diffValidator   = new NumberValidator(diffTextBox, false, true, errorMessage: T._("Bitte die Verschiebung als Zahl in Minuten angeben!"));
            countValidator  = new NumberValidator(countTextBox, false, true, allowNegative: false, errorMessage: T._("Bitte eine gültige Anzahl >0 neuer Züge eingeben!"));
            changeValidator = new NumberValidator(changeTextBox, false, true, errorMessage: T._("Bitte eine gültige Veränderung der Zugnummer eingeben!"));

            train              = t;
            this.tt            = tt;
            nameTextBox.Text   = t.TName;
            diffTextBox.Text   = "+20";
            countTextBox.Text  = "1";
            changeTextBox.Text = "2";

            modeSelect = new SelectionUI <CopySelectionMode>(mode => UpdateVisibility(), selectStack);
            linkSelect = new SelectionUI <LinkTypeMode>(linkType => UpdateVisibility(), linkTypeStack);

            if (tt.Type == TimetableType.Network && tt.Version.CompareTo(TimetableVersion.Extended_FPL2) < 0)
            {
                modeSelect.DisableOption(CopySelectionMode.Link);
            }

            specialNameGridView.AddColumn((SpecialNameEntry spn) => spn.RowNumber.ToString(), "");
            specialNameGridView.AddColumn((SpecialNameEntry spn) => spn.Name, T._("Zugname"), true);
            specialNameGridView.DataStore = new[] { new SpecialNameEntry(1, "") };
        }
Пример #4
0
    void OnMouseDown()
    {
        // Destroy the gameObject after clicking on it
        //Destroy(gameObject);

        //GameObject.Find("UIManager").GetComponent<SelectionUI>().enabled = true;
        select        = GameObject.Find("UIManager").GetComponentInChildren <SelectionUI>();
        select.target = gameObject as GameObject;
        //select.FindSelectionObjects();
        //gameObject.GetComponent<TargetIndicator>()
        if (gameObject.GetComponent <Target>() != null)
        {
            if (gameObject.GetComponent <Target>().indicator != null)
            {
                gameObject.GetComponent <Target>().indicator.Activate(true);
            }
            //Debug.Log(gameObject.GetComponent<Target>().indicator.isActive());
        }

        //IndicatorTarget indicator = ;
        //IndicatorViewer.TrackTarget(gameObject);
        // if (GetComponent<LandingArea>() != null)
        // {
        //     // print("landing area " + gameObject.name);
        // }
        //clear = false;
    }
Пример #5
0
    void FixedUpdate()
    {
        // playerStats.playerData._position = prefabLocation.position;
        // playerStats.playerData._rotation = prefabLocation.rotation;
        // playerStats.playerData._spacePrefabName = spacePrefab.name;
        // playerStats.playerData._groundPrefabName = groundPrefab.name;
        // playerStats.playerData._tag = prefabLocation.gameObject.tag;
        // playerStats.playerData._location = playerLocation;
        // playerStats.playerData.sceneName = SceneManager.GetActiveScene().name;

        // if (!updateTargets.Equals(false)){
        //     //if (selectionUI != null)
        //GameObject.Find("UIManager").GetComponentInChildren<SelectionUI>().enabled = true;
        selectionUI = GameObject.Find("UIManager").GetComponent <SelectionUI> ();
        //Debug.Log(selectionUI);
        selectionUI.FindSelectionObjects();
        //this.currentPrefab = locatePlayerPrefab();
        //Debug.Log(locatePlayerPrefab());
        //playerStatsJSON.name = "currentPlayer.name";
        //playerStatsJSON.score = "100";
        //playerStats.playerData.
        //playerStatsJSON = JsonUtility.ToJson(playerStats);
        //Debug.Log(playerStatsJSON);
        //Debug.Log(currentPlayer);
        // updateTargets = false;
        // }
    }
Пример #6
0
 private void Awake()
 {
     selectionUI    = GameObject.Find("UIManager").GetComponent <SelectionUI>();
     targetPosition = selectionUI.target.transform.position;
     //GameObject.FindWithTag("Target").transform.position;
     pointerRectTransform = transform.Find("Pointer").GetComponent <RectTransform>();
 }
Пример #7
0
        public EditPatternForm(string property)
        {
            Eto.Serialization.Xaml.XamlReader.Load(this);

            propertyLabel.Text = property;

            typeSelection = new SelectionUI(null, typeSelectionStack, "beginnt mit", "endet mit", "enthält", "ist");
        }
Пример #8
0
 private void Awake()
 {
     if (_instance != null && _instance != this)
     {
         Destroy(this.gameObject);
     }
     else
     {
         _instance = this;
     }
 }
Пример #9
0
        public EditPatternForm(string property, FilterTarget target)
        {
            Eto.Serialization.Xaml.XamlReader.Load(this);

            propertyLabel.Text = property;

            typeSelection = new SelectionUI <PatternSelectionType>(null, typeSelectionStack);
            if (target == FilterTarget.Train)
            {
                typeSelection.DisableOption(PatternSelectionType.StationType);
            }
        }
Пример #10
0
 void Start()
 {
     selectionUI   = GameObject.Find("UIManager").GetComponent <SelectionUI>();
     thisTransform = transform;
     if (useMainCamera)
     {
         cam = Camera.main;
     }
     else
     {
         cam = cameraToUse;
     }
     camTransform = cam.transform;
 }
Пример #11
0
        /*
         * Selecting logic
         */
        public void OnBeginDrag(PointerEventData eventData)
        {
            if (eventData.button != PointerEventData.InputButton.Left)
            {
                return;
            }

            if (!InputData.shouldAddSelection)
            {
                ClearSelection();
            }

            _selectionUi = Instantiate(_selectionUiInstance, _rectObjectsList).GetComponent <SelectionUI>();
            _selectionUi.Init(eventData);
        }
Пример #12
0
    // Start is called before the first frame update
    void Start()
    {
        prefabManager    = GameObject.Find("PrefabManager").GetComponent <PrefabManager> ();
        spawnManager     = GameObject.Find("SpawnManager").GetComponent <SpawnManager> ();
        inventoryManager = GameObject.Find("InventoryManager").GetComponent <InventoryManager> ();

        follow    = GameObject.Find("MainCamera").GetComponent <CamFollow> ();
        mapFollow = GameObject.Find("MapCamera").GetComponent <CamFollow> ();
        //playerStats = GameObject.Find("GameManager").GetComponent<PlayerStats>();

        selectionUI = GameObject.Find("UIManager").GetComponent <SelectionUI> ();
        if (!selectionUI.Equals(null))
        {
            selectionUI.FindSelectionObjects();
        }
    }
Пример #13
0
        public TrainCopyDialog(Train t, Timetable tt)
        {
            Eto.Serialization.Xaml.XamlReader.Load(this);

            offsetValidator = new NumberValidator(offsetTextBox, false, true, errorMessage: "Bitte die Verschiebung als Zahl in Minuten angeben!");
            countValidator  = new NumberValidator(countTextBox, false, true, errorMessage: "Bitte eine gültige Anzahl neuer Züge eingeben!");
            changeValidator = new NumberValidator(changeTextBox, false, true, errorMessage: "Bitte eine gültige Veränderung der Zugnummer eingeben!");

            train              = t;
            this.tt            = tt;
            nameTextBox.Text   = t.TName;
            offsetTextBox.Text = "+20";
            countTextBox.Text  = "1";
            changeTextBox.Text = "2";

            modeSelect = new SelectionUI(SelectMode, selectStack, "Zug kopieren", "Zug verschieben");
        }
Пример #14
0
    void Awake()
    {
        selectionUI = GameObject.Find("UIManager").GetComponent <SelectionUI> ();
        //Variables.App.Set("name", "David Crispin");
        spawnManager     = GameObject.Find("SpawnManager").GetComponent <SpawnManager>();
        prefabManager    = GameObject.Find("PrefabManager").GetComponent <PrefabManager>();
        characterManager = GameObject.Find("CharacterManager").GetComponent <CharacterManager>();
        selectionUI.FindSelectionObjects();
        //GameObject.Find("UIManager").GetComponent<SelectionUI>().FindSelectionObjects();
        //Debug.Log("Awake");
        //if (spawnManager.findPlayer() == null)  _SpawnPlayer();
        // spawnName = "none";
        follow    = GameObject.Find("MainCamera").GetComponent <CamFollow> ();
        mapFollow = GameObject.Find("MapCamera").GetComponent <CamFollow> ();

        follow.target    = prefabManager.currentPrefab.transform;
        mapFollow.target = prefabManager.currentPrefab.transform;
        //DontDestroyOnLoad(this.gameObject);
    }
Пример #15
0
        public TrainSortDialog(TrainDirection dir, Timetable tt)
        {
            Eto.Serialization.Xaml.XamlReader.Load(this);

            direction = dir;
            this.tt   = tt;

            sortSelection = new SelectionUI <SortSelectionType>(SelectMode, sortSelectionStack);

            stationsComboBox.ItemTextBinding = Binding.Delegate <Station, string>(s => s.SName);
            stationsComboBox.DataStore       = tt.Stations;

            if (dir == TrainDirection.tr) // Netzwerk-Fahrplan
            {
                // deaktiviert "von unten nach oben", "von oben nach unten" in Netzwerk-Fahrplänen
                sortSelection.DisableOption(SortSelectionType.TimeDown);
                sortSelection.DisableOption(SortSelectionType.TimeUp);
            }
        }
Пример #16
0
        public TrainSortDialog(TrainDirection dir, Timetable tt)
        {
            Eto.Serialization.Xaml.XamlReader.Load(this);

            direction = dir;
            this.tt   = tt;

            //TODO: Investigate & re-enable linear sorting top-to-bottom/bottom-to-top
            //sortSelection = new SelectionUI(SelectMode, sortSelectionStack, "Nach Namen", "Nach Zugnummern (Name ohne Zugart)", "Nach Zeit, an Station", "Von oben nach unten", "Von unten nach oben");
            sortSelection = new SelectionUI(SelectMode, sortSelectionStack, "Nach Namen", "Nach Zugnummern (Name ohne Zugart)", "Nach Zeit, an Station");

            stationsComboBox.ItemTextBinding = Binding.Property <Station, string>(s => s.SName);
            stationsComboBox.DataStore       = tt.Stations;

            //TODO: Investigate & re-enable linear sorting top-to-bottom/bottom-to-top
            //if (dir == TrainDirection.tr) // Netzwerk-Fahrplan
            //{
            //    // deaktiviert "von unten nach oben", "von oben nach unten"
            //    sortSelection.DisableOption(3);
            //    sortSelection.DisableOption(4);
            //}
        }
Пример #17
0
 void FixedUpdate()
 {
     //GameObject.Find("UIManager").GetComponent<SelectionUI>().enabled = true;
     select = GameObject.Find("UIManager").GetComponent <SelectionUI>();
 }
Пример #18
0
    public void _SpawnPlayer()
    {
        //spawnManager.refreshSpawnPoints();
        spawnIndex = spawnManager.FindSpawnByName(spawnManager.spawnName);

        // Debug.Log("called _SpawnPlayer() method");
        mainCamera  = GameObject.Find("MainCamera").GetComponent <Camera> ();
        mapCamera   = GameObject.Find("MapCamera").GetComponent <Camera> ();
        selectionUI = GameObject.Find("UIManager").GetComponent <SelectionUI> ();
        GameObject[] find = GameObject.FindGameObjectsWithTag("Player");
        foreach (GameObject tmp in find)
        {
            if (tmp)
            {
                Destroy(tmp);
            }
        }
        selectionUI.FindSelectionObjects();
        //SpawnPoints = GameObject.FindGameObjectsWithTag ("SpawnPoint");

        // if (isLanding)
        // {

        spawnIndex = spawnManager.FindSpawnByName(spawnManager.spawnName);
        //spawnName = "none";

        //camOffset = mainCamOffset;
        if (spawnIndex != -1)
        {
            player = GameObject.FindWithTag("Player");
            if (playerLocation == locationType.Space)
            {
                //     //Vector3 spawn = new Vector3()

                player = Instantiate(prefabManager.spacePrefab, spawnManager.SpawnPoints[spawnIndex].transform.position - (hoverPlayer * 2), spawnManager.SpawnPoints[spawnIndex].transform.rotation);
                //currentPrefab = Instantiate(spacePrefab, SpawnPoints[spawnIndex].transform.position, SpawnPoints[spawnIndex].transform.rotation);
                shipControls = player.GetComponent <ShipControls>();
                //characterManager.characterData.shipControls = shipControls;
                shipControls.hoverHeight = hoverHeight;
            }

            if (playerLocation == locationType.Air)
            {
                player       = Instantiate(prefabManager.spacePrefab, spawnManager.SpawnPoints[spawnIndex].transform.position - hoverPlayer, spawnManager.SpawnPoints[spawnIndex].transform.rotation);
                shipControls = player.GetComponent <ShipControls>();
                //characterManager.characterData.shipControls = shipControls;
                shipControls.hoverHeight = airHoverHeight;
                //GameObject.Find(spawnName).SetActive(true);
            }

            if (playerLocation.Equals(locationType.Ground))
            {
                landPlayerShip();
            }

            if (playerLocation == locationType.Building)
            {
                player = Instantiate(prefabManager.groundPrefab, spawnManager.SpawnPoints[spawnIndex].transform.position, spawnManager.SpawnPoints[spawnIndex].transform.rotation);
                //camOffset = buildingCamOffset;
                follow.offset_move = new Vector3(0, _buildingOffset, 0);
            }

            if (playerLocation != locationType.Building)
            {
            }
            //Debug.Log("player prefab -> " + player);

            prefabManager.currentPrefab = player;
            follow.target    = player.transform;
            mapFollow.target = player.transform;

            mainCamera.transform.position = player.transform.position + mainOffset;
            mapCamera.transform.position  = player.transform.position + mapOffset;
        }
        else
        {
        }
    }
Пример #19
0
 void Start()
 {
     select = GameObject.Find("UIManager").GetComponent <SelectionUI>();
 }
Пример #20
0
    //Camera camera;

    // Start is called before the first frame update
    void Start()
    {
        selectUI = GameObject.Find("UIManager").GetComponent <SelectionUI>();
        //camera = GameObject.FindWithTag("MainCamera").GetComponent<Camera>();
    }