Exemplo n.º 1
0
    private void CreateNewUIBar()
    {
        if (objPlayer == null)
        {
            return;
        }
        if (objUIBar != null)
        {
            Destroy(objUIBar);
        }
        objUIBar = Instantiate(prefabUIBar);
        objUIBar.SetActive(false);
        DontDestroyOnLoad(objUIBar);
        UIBar  bar    = objUIBar.GetComponent <UIBar>();
        Player player = objPlayer.GetComponent <Player>();

        player.OnChangedLevel += bar.setLevel;
        player.OnChangedExp   += bar.ExpBar.SetupValue;
        player.OnChangedHP    += bar.HpBar.SetupValue;
        player.OnChangedSP    += bar.SpBar.SetupValue;

        bar.setLevel(player.level);
        bar.HpBar.SetupValue(player.hp, player.hpMax);
        bar.SpBar.SetupValue(player.sp, player.spMax);
        bar.ExpBar.SetupValue(player.exp, player.expRequired);
    }
Exemplo n.º 2
0
    IEnumerator LoadStage(Stage stage, Vector3 vecPlayerPos)
    {
        Time.timeScale = 0f;
        objUIBar.SetActive(false);
        GameObject objFadeCanvas = Instantiate(prefabSceneFade);

        DontDestroyOnLoad(objFadeCanvas);
        Image img = objFadeCanvas.GetComponentInChildren <Image>();

        yield return(FadeEffect(FADE.OUT, img));

        AsyncOperation ao = SceneManager.LoadSceneAsync(stage.sceneName);

        while (!ao.isDone)
        {
            yield return(null);
        }
        objPlayer.transform.position = vecPlayerPos;
        yield return(FadeEffect(FADE.IN, img));

        UIBar bar = objUIBar.GetComponent <UIBar>();

        bar.setTextStage(stage.stageName);
        objUIBar.SetActive(true);

        Destroy(objFadeCanvas);
        Time.timeScale = 1f;
    }
Exemplo n.º 3
0
 void Start()
 {
     rgbd = GetComponent <Rigidbody>();
     playerInputController = GetComponent <PlayerInputController>();
     uiBar = GetComponent <UIBar>();
     hand  = GameObject.Find("mixamorig:LeftHand").transform;
 }
Exemplo n.º 4
0
    public void InitBarByScore(int pieceIndex, int barIndex, UIBar uiBar)
    {
        uiBar.startBeat = occupiedBeats;

        //QTE BAR
        if (QTEbarIndex >= 0)
        {
            uiBar.type = UIBar.barType.QTEBar;

            uiBar.ReadScore(QTEscore.QTEscore[QTEbarIndex].notes);
            uiBar.beatsThisBar = QTEscore.QTEscore[QTEbarIndex].beatsThisBar;
        }
        if (QTEbarIndex < 0)
        {
            uiBar.type = UIBar.barType.inputBar;

            //判断当前所在的段落,读取单小节乐谱
            OneBarScore _barScore = pieceIndex > 0 ? score.mainlude[barIndex] : score.prelude[barIndex];

            uiBar.ReadScore(_barScore.notes);
            uiBar.beatsThisBar = _barScore.beatsThisBar;
        }

        //        Debug.Log("startbeat=" + uiBar.startBeat);
//    Debug.Log("occupiedBeats=" + occupiedBeats);

        uiBar.Init();
        uiBar.GetComponent <UIBar>().SetPinAlpha(0);
        uiBar.GetComponent <UIBar>().active = true;

        currentEnergyNotes.AddRange(uiBar.GetComponent <UIBar>().noteList_energy);
        currentQTENotes.AddRange(uiBar.GetComponent <UIBar>().noteList_QTE);
        occupiedBeats += uiBar.beatsThisBar;
    }
    void Start()
    {
        //TESTING PURPOSES//
        i             = 0;
        aetherEssence = 10;
        sword         = GameObject.Find("ari sword");

        ///////////////////
        normalattacktimer = 2.0f;
        targetlock        = false;
        hasJumped         = true;
        combopossible     = false;
        combodone         = false;
        boulder           = GameObject.FindGameObjectWithTag("Boulder");
        boulder2          = GameObject.FindGameObjectWithTag("SecretBoulder");
        boulder3          = GameObject.FindGameObjectWithTag("SecretBoulder2");
        rbdg           = GetComponent <Rigidbody>();
        playerMovement = GetComponent <PlayerMovement>();
        // combotimer = 0f;
        attacktimer = 3.0f;
        // attackcooldown = 1.0f;

        //ELEMENTS//
        fireball = fireEffect.GetComponent <Fireball>();
        // fireEffect.SetActive(false);
        fireEffect.SetActive(false);
        waterEffect.SetActive(false);
        groundEffect.SetActive(false);
        currentAbility = airEffect;
        //////////
        uiBar = GetComponent <UIBar>();

        aetherText.text = "" + aetherEssence;
        state           = State.Moving;

        Time.timeScale      = 1;
        Time.fixedDeltaTime = .02f;

        fireball.isCharging = false;
        if (aetherBurst == null)
        {
            aetherBurst = GameObject.Find("AetherBurst").GetComponent <ParticleSystem>();
        }
        airBurst   = GameObject.Find("Air");
        fireBurst  = GameObject.Find("Fire");
        waterBurst = GameObject.Find("Water");
        airBurst.SetActive(false);
        fireBurst.SetActive(false);
        waterBurst.SetActive(false);

        sphereCollider.SetActive(false);

        animator = GetComponent <Animator>();

        nOfCombo = 0;
        canClick = true;

        hips = GameObject.Find("mixamorig:Hips").transform;
    }
    private new void Awake()
    {
        base.Awake();

        m_trashMovement       = GetComponent <TrashJuiceMovement>();
        m_trashJuiceStats     = GetComponent <CharacterStats>();
        m_trashJuiceHealthBar = GetComponent <UIBar>();
    }
Exemplo n.º 7
0
 void OnTriggerEnter(Collider col)
 {
     if (col.CompareTag("Player"))
     {
         uIBar = col.GetComponent <UIBar>();
         sphereCollider.enabled = false;
         StartCoroutine(PoisonDoT());
     }
 }
Exemplo n.º 8
0
    void Start()
    {
        GameObject starsTextGameObject = GameObject.Find("StarsNums");

        starsText = starsTextGameObject.GetComponent <StarsText> ();

        GameObject uiBarGameObject = GameObject.Find("Full Bar");

        uiBar = uiBarGameObject.GetComponent <UIBar> ();
    }
Exemplo n.º 9
0
    public void CloseBar <T>()
    {
        var uiname = typeof(T).Name;

        if (_bars.ContainsKey(uiname))
        {
            _bars[uiname].OnClose();
            _currentbar = null;
        }
    }
Exemplo n.º 10
0
 // Updates stamina/health bar.
 public void UpdateBar(UIBar bar)
 {
     if (bar == m_HealthBar)
     {
         bar.SetSize(m_Health / m_MaxHealth);
     }
     else if (bar == m_StaminaBar)
     {
         bar.SetSize((float)m_Stamina / (float)m_MaxStamina);
     }
 }
Exemplo n.º 11
0
 void Awake()
 {
     if (isHealth)
     {
         health = this;
     }
     else
     {
         mana = this;
     }
 }
Exemplo n.º 12
0
        private void HandleSelectionEffect(ItemEquippable item)
        {
            foreach (DividedBarShaderController d in m_inventoryToAmmoDisplayMapping.Values)
            {
                d.SetUnselected();
            }
            m_inventoryToAmmoDisplayMapping.TryGetValue(item.ItemDataBlock.inventorySlot, out DividedBarShaderController UIBar);

            if (UIBar)
            {
                UIBar.SetSelected();
            }
        }
Exemplo n.º 13
0
 //普通BAR转换为QTEBAR,用于QTE触发
 public void TurnBarIntoQTE(UIBar uIBar, List <Note> notes)
 {
     uIBar.type      = UIBar.barType.QTEBar;
     uIBar.bg.sprite = uIBar.bgQTE;
     //清除普通阶段的遗留音符
     currentEnergyNotes.Clear();
     InputSequenceController.Instance.CurInputSequence.Clear();
     uIBar.Empty();
     uIBar.InitLines();
     uIBar.ReadScore(notes);
     uIBar.InitNotes();
     currentQTENotes.AddRange(uIBar.GetComponent <UIBar>().noteList_QTE);
 }
Exemplo n.º 14
0
            private void Start()
            {
                charData = GetComponent <CharactersData>();
                aniCtrl  = charData.GetComponent <CharactersAniCtrl>();
                pool     = GameObject.Find("MemoryPool").GetComponent <MemoryPooling>();

                _audio = GetComponent <AudioSource>();


                if (isPlayer)
                {
                    playerUI = GetComponent <UIBar>();
                }
            }
Exemplo n.º 15
0
    public void AddUIBar(UIBarInfo uib)
    {
        if (uib.id == "SameAsLabel")
        {
            uib.id = uib.UILabel;
        }
        RemoveUIBar(uib.id);
        GameObject newBar = Instantiate(UIBarPrefab, transform);

        uib.element = newBar;
        UIBar uibar = uib.element.GetComponent <UIBar>();

        uibar.Initialize(uib, uibars.Count);
        uib.uib = uibar;
        uibars.Add(uib.id, uib);
    }
Exemplo n.º 16
0
    void Start()
    {
        rabbitRB    = GetComponent <Rigidbody> ();
        anim        = GetComponent <Animator> ();
        pauseScript = GameObject.Find("Canvas").GetComponent <Pause> ();

        if (Prefabs.wolf == null)
        {
            print("PlayerCollisions: No wolf prefab");
        }
        if (Prefabs.loseSeconds == null)
        {
            print("PlayerCollisions: No loseSeconds prefab");
        }

        GameObject uiBarGameObject = GameObject.Find("Full Bar");

        uiBar = uiBarGameObject.GetComponent <UIBar> ();
    }
Exemplo n.º 17
0
    public T OpenBar <T>() where T : UIBar, new()
    {
        var uiname = typeof(T).Name;

        if (!_bars.ContainsKey(uiname))
        {
            var bar = new T();

            bar.OnInit(uiname);
            bar.OnOpen();

            _bars.Add(uiname, bar);

            _currentbar = bar;
            return(bar);
        }
        var ret = _bars[uiname];

        ret.OnOpen();

        _currentbar = ret;
        return(ret as T);
    }
Exemplo n.º 18
0
        private void SetUpHUD(UILayer hud)
        {
            var scoresLabelPosition = new Vector2D(10, 10);
            var scoresLabel         = new UILabel()
            {
                Text       = $"Scores: 0",
                FontColor  = Color.White,
                Background = Color.Transparent,
                Bounds     = new Rectangle(scoresLabelPosition, Size.Empty),
                Font       = new Font(FontFamily.GenericMonospace, 12),
            };

            hud.AddComponent(scoresLabel);

            var hpBarPosition = new Vector2D(scoresLabelPosition.X, scoresLabelPosition.Y + scoresLabel.Bounds.Height + 30);

            _hpBar = new UIBar(100, 100, Color.Red)
            {
                Position   = hpBarPosition,
                Background = Color.Transparent,
                Bounds     = new Rectangle(hpBarPosition, new Size(150, 15))
            };
            hud.AddComponent(_hpBar);
        }
Exemplo n.º 19
0
    void Awake()
    {
        //場景物件設定
        select_img = transform.Find("Itembar/select").GetComponent <Image>();

        list_uiitembar = new List <UIBar> ();
        Transform itemRoot = transform.Find("Itembar/Bar");

        if (itemRoot == null)
        {
            Debug.LogWarning("No Itembar Found!");
            return;
        }

        for (int i = 0; i < itemRoot.childCount; i++)
        {
            Text  _text = itemRoot.GetChild(i).GetComponentInChildren <Text> ();
            UIBar _bar  = new UIBar();
            _bar.text = _text;
            list_uiitembar.Add(_bar);
        }

        sortedlist_UIItemboxs = new List <Inventory.Itembox> ();
    }
Exemplo n.º 20
0
        protected override void Initialize(UIAdvPanel WindowPanel)
        {
            _spectrumAnalyzer                = new SpectrumAnalyzer();
            musicPlayer.OnProgressUpdate    += MusicPlayer_OnProgressUpdate;
            musicPlayer.OnSongPicLoaded     += MusicPlayer_OnSongPicLoaded;
            musicPlayer.OnFFTCalculated     += MusicPlayer_OnFFTCalculated;
            musicPlayer.OnMaximumCalculated += MusicPlayer_OnMaximumCalculated;
            base.Initialize(WindowPanel);
            WindowPanel.MainTexture = MusicBox.ModTexturesTable["AdvInvBack1"];
            WindowPanel.SetPadding(0);
            WindowPanel.Left.Set(Main.screenWidth / 2 - UI_PANEL_WIDTH / 2, 0f);
            WindowPanel.Top.Set(Main.screenHeight / 2 - UI_PANEL_HEIGHT / 2, 0f);
            WindowPanel.Width.Set(UI_PANEL_WIDTH, 0f);
            WindowPanel.Height.Set(UI_PANEL_HEIGHT, 0f);
            WindowPanel.Color      = Color.White;
            WindowPanel.CornerSize = 12;


            _progressBar = new UIBar();
            _progressBar.SetPadding(0);
            _progressBar.Top.Set(100f, 0.5f);
            _progressBar.Left.Set(-UI_BAR_WIDTH / 2 + UI_BAR_LEFT_OFFSET, 0.5f);
            _progressBar.Width.Set(UI_BAR_WIDTH, 0f);
            _progressBar.Height.Set(UI_BAR_HEIGHT, 0f);
            _progressBar.BarFrameTex           = MusicBox.ModTexturesTable["BarFrame"];
            _progressBar.BarFillTex            = MusicBox.ModTexturesTable["BarFiller"];
            _progressBar.BarFrameTexCornerSize = new Vector2(6, 6);
            _progressBar.FillerDrawOffset      = new Vector2(6, 6);
            _progressBar.FillerSize            = new Vector2(UI_BAR_WIDTH - 12, 6);
            WindowPanel.Append(_progressBar);

            _playButton         = new UIPicButton();
            _playButton.Texture = MusicBox.ModTexturesTable["PlayButtonN"];
            _playButton.Top.Set(135f - 15f, 0.5f);
            _playButton.Left.Set(-15 + UI_BAR_LEFT_OFFSET, 0.5f);
            _playButton.Width.Set(30, 0f);
            _playButton.Height.Set(30, 0f);
            _playButton.OnMouseHover += _playButton_OnMouseHover;
            _playButton.OnMouseOut   += _playButton_OnMouseOut;
            _playButton.OnClick      += _playButton_OnClick;
            WindowPanel.Append(_playButton);

            _playSlider         = new UISliderH();
            _playSlider.Texture = MusicBox.ModTexturesTable["PlaySliderN"];
            _playSlider.Top.Set(0, 0f);
            _playSlider.Left.Set(0, 0f);
            _playSlider.Width.Set(30, 0f);
            _playSlider.Height.Set(30, 0f);
            _playSlider.StartX         = 6f;
            _playSlider.EndX           = UI_BAR_WIDTH - 6;
            _playSlider.Scale          = 1.35f;
            _playSlider.OnValueChange += _playSlider_OnValueChange;
            _playSlider.OnMouseOver   += _playSlider_OnMouseOver;
            _playSlider.OnMouseOut    += _playSlider_OnMouseOut;
            _progressBar.Append(_playSlider);

            _volumeSlider         = new UISliderV();
            _volumeSlider.Texture = MusicBox.ModTexturesTable["PlaySliderN"];
            _volumeSlider.Top.Set(200f, 0f);
            _volumeSlider.Left.Set(-50f, 1f);
            _volumeSlider.Width.Set(30, 0f);
            _volumeSlider.Height.Set(30, 0f);
            _volumeSlider.StartY         = 200f;
            _volumeSlider.EndY           = 160f;
            _volumeSlider.Scale          = 1.35f;
            _volumeSlider.OnValueChange += _volumeSlider_OnValueChange;
            _volumeSlider.OnMouseOver   += _volumeSlider_OnMouseOver;
            _volumeSlider.OnMouseOut    += _volumeSlider_OnMouseOut;
            _volumeSlider.DragSync       = true;
            _volumeSlider.PreDraw       += (s, sb) =>
            {
                sb.Draw(MusicBox.ModTexturesTable["Box"], new Rectangle((int)(WindowPanel.GetInnerDimensions().X + WindowPanel.GetInnerDimensions().Width) - 37,
                                                                        (int)WindowPanel.GetInnerDimensions().Y + 160 - 5, 4, 50), Color.Gray * 0.5f);
                //Drawing.DrawAdvBox(sb, new Rectangle((int)(WindowPanel.GetInnerDimensions().X + WindowPanel.GetInnerDimensions().Width) - 50 - 2,
                //		(int)WindowPanel.GetInnerDimensions().Y + 200 - 2, 8, 44), Color.Gray, MusicBox.ModTexturesTable["Box"], new Vector2(8, 8));
            };
            WindowPanel.Append(_volumeSlider);

            _forwardButton         = new UIPicButton();
            _forwardButton.Texture = MusicBox.ModTexturesTable["ForwardButtonN"];
            _forwardButton.Top.Set(135f - 15f, 0.5f);
            _forwardButton.Left.Set(30f + UI_BAR_LEFT_OFFSET, 0.5f);
            _forwardButton.Width.Set(30, 0f);
            _forwardButton.Height.Set(30, 0f);
            _forwardButton.OnMouseHover += _forwardButton_OnMouseHover;
            _forwardButton.OnMouseOut   += _forwardButton_OnMouseOut;
            _forwardButton.OnClick      += _forwardButton_OnClick;
            WindowPanel.Append(_forwardButton);


            _backwardButton         = new UIPicButton();
            _backwardButton.Texture = MusicBox.ModTexturesTable["BackwardButtonN"];
            _backwardButton.Top.Set(135f - 15f, 0.5f);
            _backwardButton.Left.Set(-60f + UI_BAR_LEFT_OFFSET, 0.5f);
            _backwardButton.Width.Set(30, 0f);
            _backwardButton.Height.Set(30, 0f);
            _backwardButton.OnMouseHover += _backwardButton_OnMouseHover;
            _backwardButton.OnMouseOut   += _backwardButton_OnMouseOut;
            _backwardButton.OnClick      += _backwardButton_OnClick;
            WindowPanel.Append(_backwardButton);

            _songTexture = MusicBox.ModTexturesTable["AdvInvBack1"];
            _songImage   = new UIFixedImage(_songTexture);
            _songImage.Top.Set(60f, 0.5f);
            _songImage.Left.Set(-UI_BAR_WIDTH / 2 + UI_BAR_LEFT_OFFSET - 110f, 0.5f);
            _songImage.Width.Set(90f, 0f);
            _songImage.Height.Set(90f, 0f);
            WindowPanel.Append(_songImage);
        }
Exemplo n.º 21
0
    // void Awake()
    // {
    //     audioManager = FindObjectOfType<AudioManager>();
    //     for (int i = 0; i < audioManager.sounds.Length; i++)
    //     {
    //         AudioManager.i.Stop(audioManager.sounds[i].name);
    //     }
    // }
    void Start()
    {
        numberOfEnemies = 0;
        // Audio
        AudioManager.i.StopAll();
        if (SceneManager.GetActiveScene().name == "HoleSection")
        {
            AudioManager.i.PlayBackground("Explore2");
            musicNumber = 2;
        }
        else if (SceneManager.GetActiveScene().name == "BossSection" || SceneManager.GetActiveScene().name == "StorageSection")
        {
            AudioManager.i.PlayBackground("Explore1");
            musicNumber = 1;
        }
        else if (SceneManager.GetActiveScene().name == "OpenSpaceSection")
        {
            musicNumber = 3;
        }
        //TESTING PURPOSES//
        i             = 0;
        aetherEssence = 10;
        sword         = GameObject.Find("ari sword");

        ///////////////////
        normalattacktimer = 2.0f;
        targetlock        = false;
        hasJumped         = true;
        combopossible     = false;
        combodone         = false;
        boulder           = GameObject.FindGameObjectWithTag("Boulder");
        boulder2          = GameObject.FindGameObjectWithTag("SecretBoulder");
        boulder3          = GameObject.FindGameObjectWithTag("SecretBoulder2");
        rbdg           = GetComponent <Rigidbody>();
        playerMovement = GetComponent <PlayerMovement>();
        // combotimer = 0f;
        attacktimer = 3.0f;
        // attackcooldown = 1.0f;

        //ELEMENTS//
        fireball = fireEffect.GetComponent <Fireball>();
        // fireEffect.SetActive(false);
        fireEffect.SetActive(false);
        waterEffect.SetActive(false);
        groundEffect.SetActive(false);
        currentAbility = airEffect;
        //////////
        uiBar = GetComponent <UIBar>();

        aetherText.text = "" + aetherEssence;
        state           = State.Moving;

        Time.timeScale      = 1;
        Time.fixedDeltaTime = .02f;

        fireball.isCharging = false;
        if (aetherBurst == null)
        {
            aetherBurst = GameObject.Find("AetherBurst").GetComponent <ParticleSystem>();
        }
        airBurst   = GameObject.Find("Air");
        fireBurst  = GameObject.Find("Fire");
        waterBurst = GameObject.Find("Water");
        airBurst.SetActive(false);
        fireBurst.SetActive(false);
        waterBurst.SetActive(false);

        sphereCollider.SetActive(false);

        animator = GetComponent <Animator>();

        nOfCombo = 0;
        canClick = true;

        hips       = GameObject.Find("mixamorig:Hips").transform;
        swordTrail = GameObject.Find("Trails").GetComponent <ParticleSystem>();

        audioManager = FindObjectOfType <AudioManager>();

        airImg    = wheelPointer.GetChild(0).Find("Air").GetComponent <Image>();
        fireImg   = wheelPointer.GetChild(0).Find("Fire").GetComponent <Image>();
        waterImg  = wheelPointer.GetChild(0).Find("Water").GetComponent <Image>();
        groundImg = wheelPointer.GetChild(0).Find("Ground").GetComponent <Image>();

        pauseMenu = aetherText.transform.parent.Find("PauseMenu");
        pauseMenu.gameObject.SetActive(false);
    }
Exemplo n.º 22
0
 public override void OnEnable()
 {
     base.OnEnable();
     _picker = new PrefabPicker(UIType.Bar);
     _bar    = target as UIBar;
 }
Exemplo n.º 23
0
        public GameManager(RenderWindow window)
        {
            UIWindow CharSheet = new UIWindow(new Vector2f(window.Size.X / 3 * 2, 0),
                                              new Vector2f(window.Size.X / 3, window.Size.Y),
                                              "../../../Resources/Images/Game/Book.png");

            CharSheet.Visible = false;
            Vector2f buttonPos  = new Vector2f(CharSheet.Size.X / 18 * 15 + 1, CharSheet.Size.Y / 13);
            Vector2f buttonSize = new Vector2f(CharSheet.Size.X / 18 - 2, CharSheet.Size.Y / 26 - 2);
            Vector2f textPos    = new Vector2f(CharSheet.Size.X / 18 * 4 + 1, CharSheet.Size.Y / 13);
            UIButton vigor      = new UIButton(
                new Vector2f(buttonPos.X, buttonPos.Y * 4 + 1) + CharSheet.Position,
                buttonSize, new Color(229, 57, 53), "+",
                new Vector2f(3, 3), "", VigorPlusButton);
            UIButton strength = new UIButton(
                new Vector2f(buttonPos.X, buttonPos.Y * 5 + 1) + CharSheet.Position,
                buttonSize, new Color(229, 57, 53), "+",
                new Vector2f(3, 3), "", StrengthPlusButton);
            UIButton agility = new UIButton(
                new Vector2f(buttonPos.X, buttonPos.Y * 6 + 1) + CharSheet.Position,
                buttonSize, new Color(229, 57, 53), "+",
                new Vector2f(3, 3), "", AgilityPlusButton);
            UIButton intelligence = new UIButton(
                new Vector2f(buttonPos.X, buttonPos.Y * 7 + 1) + CharSheet.Position,
                buttonSize, new Color(229, 57, 53), "+",
                new Vector2f(3, 3), "", IntelligencePlusButton);
            UIButton spirit = new UIButton(
                new Vector2f(buttonPos.X, buttonPos.Y * 8 + 1) + CharSheet.Position,
                buttonSize, new Color(229, 57, 53), "+",
                new Vector2f(3, 3), "", SpiritPlusButton);
            UITextField vigorText = new UITextField(new Vector2f(textPos.X, textPos.Y * 4 + 1) + CharSheet.Position,
                                                    new Vector2f(buttonSize.X * 10 + 18, buttonSize.Y), new Color(215, 168, 100),
                                                    new Vector2f(3, 3), "VIGOR");
            UITextField strengthText = new UITextField(new Vector2f(textPos.X, textPos.Y * 5 + 1) + CharSheet.Position,
                                                       new Vector2f(buttonSize.X * 10 + 18, buttonSize.Y), new Color(215, 168, 100),
                                                       new Vector2f(3, 3), "STRENGTH");
            UITextField agilityText = new UITextField(new Vector2f(textPos.X, textPos.Y * 6 + 1) + CharSheet.Position,
                                                      new Vector2f(buttonSize.X * 10 + 18, buttonSize.Y), new Color(215, 168, 100),
                                                      new Vector2f(3, 3), "AGILITY");
            UITextField intelligenceText = new UITextField(new Vector2f(textPos.X, textPos.Y * 7 + 1) + CharSheet.Position,
                                                           new Vector2f(buttonSize.X * 10 + 18, buttonSize.Y), new Color(215, 168, 100),
                                                           new Vector2f(3, 3), "INTELLIGENCE");
            UITextField spiritText = new UITextField(new Vector2f(textPos.X, textPos.Y * 8 + 1) + CharSheet.Position,
                                                     new Vector2f(buttonSize.X * 10 + 18, buttonSize.Y), new Color(215, 168, 100),
                                                     new Vector2f(3, 3), "SPIRIT");
            UITextField levelText = new UITextField(new Vector2f(textPos.X, textPos.Y * 2 + 1) + CharSheet.Position,
                                                    new Vector2f(buttonSize.X * 10 + 18, buttonSize.Y), new Color(215, 168, 100),
                                                    new Vector2f(3, 3), "LEVEL");
            UITextField skillText = new UITextField(new Vector2f(textPos.X, textPos.Y * 3 + 1) + CharSheet.Position,
                                                    new Vector2f(buttonSize.X * 10 + 18, buttonSize.Y), new Color(215, 168, 100),
                                                    new Vector2f(3, 3), "SKILL POINTS LEFT");
            UITextField levelNumText = new UITextField(new Vector2f(buttonPos.X, buttonPos.Y * 2 + 1) + CharSheet.Position,
                                                       new Vector2f(buttonSize.X, buttonSize.Y), new Color(215, 168, 100),
                                                       new Vector2f(3, 3), "");
            UITextField skillNumText = new UITextField(new Vector2f(buttonPos.X, buttonPos.Y * 3 + 1) + CharSheet.Position,
                                                       new Vector2f(buttonSize.X, buttonSize.Y), new Color(215, 168, 100),
                                                       new Vector2f(3, 3), "");

            CharSheet.Elements.Add(vigor);
            CharSheet.Elements.Add(strength);
            CharSheet.Elements.Add(agility);
            CharSheet.Elements.Add(intelligence);
            CharSheet.Elements.Add(spirit);
            CharSheet.Elements.Add(vigorText);
            CharSheet.Elements.Add(strengthText);
            CharSheet.Elements.Add(agilityText);
            CharSheet.Elements.Add(intelligenceText);
            CharSheet.Elements.Add(spiritText);
            CharSheet.Elements.Add(levelText);
            CharSheet.Elements.Add(skillText);
            CharSheet.Elements.Add(levelNumText);
            CharSheet.Elements.Add(skillNumText);
            UIBar Health = new UIBar(new Vector2f(10, 10),
                                     new Vector2f(window.Size.X / 3, window.Size.Y / 20),
                                     new Color(183, 28, 28), "Health");
            UIBar Mana = new UIBar(new Vector2f(10, window.Size.Y / 20 + 20),
                                   new Vector2f(window.Size.X / 3, window.Size.Y / 20), new Color(26, 35, 126), "Mana");
            UIBar XP = new UIBar(new Vector2f(10, window.Size.Y / 20 * 2 + 30),
                                 new Vector2f(window.Size.X / 3, window.Size.Y / 20), new Color(251, 192, 45), "Experience");
            float       timerHeight   = window.Size.Y / 10;
            float       timerDistance = window.Size.Y / 20;
            UITimerIcon Attack1       =
                new UITimerIcon(
                    new Vector2f((window.Size.X - 3 * timerDistance - 4 * timerHeight) / 2,
                                 window.Size.Y - timerDistance - timerHeight), new Vector2f(timerHeight, timerHeight),
                    new Color(84, 110, 122, 125), "Attack");
            UITimerIcon Attack2 =
                new UITimerIcon(
                    new Vector2f((window.Size.X - 3 * timerDistance - 4 * timerHeight) / 2 + timerDistance + timerHeight,
                                 window.Size.Y - timerDistance - timerHeight), new Vector2f(timerHeight, timerHeight),
                    new Color(84, 110, 122, 125), "Throw");
            UITimerIcon Attack3 =
                new UITimerIcon(
                    new Vector2f((window.Size.X - 3 * timerDistance - 4 * timerHeight) / 2 + timerDistance * 2 + timerHeight * 2,
                                 window.Size.Y - timerDistance - timerHeight), new Vector2f(timerHeight, timerHeight),
                    new Color(84, 110, 122, 125), "Whirlwind");
            UITimerIcon Attack4 =
                new UITimerIcon(
                    new Vector2f((window.Size.X - 3 * timerDistance - 4 * timerHeight) / 2 + timerDistance * 3 + timerHeight * 3,
                                 window.Size.Y - timerDistance - timerHeight), new Vector2f(timerHeight, timerHeight),
                    new Color(84, 110, 122, 125), "Lunge");

            Elements.Add(CharSheet);
            Elements.Add(Health);
            Elements.Add(Mana);
            Elements.Add(XP);
            Elements.Add(Attack1);
            Elements.Add(Attack2);
            Elements.Add(Attack3);
            Elements.Add(Attack4);
        }
Exemplo n.º 24
0
    void Update()
    {
        if (!photonView.isMine) {
            transform.position = Vector3.Lerp(transform.position, this.correctPlayerPos, Time.deltaTime * 5);
            transform.rotation = Quaternion.Lerp(transform.rotation, this.correctPlayerRot, Time.deltaTime * 5);
        } else {
            if (!gotFirstUpdate) {

                photonView.RPC("setNick", PhotonTargets.OthersBuffered, PhotonNetwork.player.name);

                healthBar = GameObject.Find ("Canvas/PlayerPanel/HP Orb").GetComponent<UIBar>();
                expBar = GameObject.Find ("Canvas/PlayerPanel/ExpBar").GetComponent<UIBar>();
                manaBar = GameObject.Find ("Canvas/PlayerPanel/Mana Semicircle").GetComponent<UIBar>();

                healthBar.updateVertical(characterData.health, characterData.maxHealth);
                expBar.updateHoritzontal(characterData.exp, 100);
                manaBar.updateHoritzontal(characterData.mana, characterData.maxMana);

                gotFirstUpdate = true;
            }

            //looks like player is falling
            if (transform.position.y < -100) {
                transform.position = GameObject.Find("SpawnPoints/FirstJoin").transform.position;
            }
        }
    }
Exemplo n.º 25
0
 void Start()
 {
     playerInputController = FindObjectOfType <PlayerInputController>();
     uiBar = GetComponentInParent <UIBar>();
 }
Exemplo n.º 26
0
        public UIPlayerProfileHead()
        {
            textName = new UIText("");
            textName.Top.Set(0, 0f);
            textName.Left.Set(RANK_LEFT_OFFSET + 32, 0f);
            Append(textName);

            rankBar = new UIBar
            {
                BarFrameTex           = ServerSideCharacter2.ModTexturesTable["BarFrameRank"],
                BarFillTex            = Main.magicPixel,
                BarFrameTexCornerSize = new Vector2(6, 6),
                FillerDrawOffset      = new Vector2(6, 6),
                FillerSize            = new Vector2(RANK_BAR_WIDTH - 12, RANK_BAR_HEIGHT - 12)
            };
            rankBar.Top.Set(20f, 0f);
            rankBar.Left.Set(RANK_LEFT_OFFSET, 0f);
            rankBar.Width.Set(RANK_BAR_WIDTH, 0f);
            rankBar.Height.Set(RANK_BAR_HEIGHT, 0f);
            rankBar.Value = 0.3f;
            Append(rankBar);


            rankimage = new UIImageResizable(ServerSideCharacter2.ModTexturesTable["Crown"]);
            rankimage.Top.Set(-10, 0f);
            rankimage.Left.Set(RANK_LEFT_OFFSET, 0f);
            rankimage.UsePosition = false;
            center = new Vector2(RANK_LEFT_OFFSET + 16f, 6);
            Append(rankimage);

            rankLabel = new UIText("300/1000");
            rankLabel.Top.Set(20 + RANK_BAR_HEIGHT + 2f, 0f);
            rankLabel.Left.Set(RANK_LEFT_OFFSET, 0f);
            Append(rankLabel);

            var infopanel = new UIPanel();

            infopanel.Top.Set(20 + RANK_BAR_HEIGHT + 30f, 0f);
            infopanel.Left.Set(0f, 0f);
            infopanel.Width.Set(300f, 0f);
            infopanel.Height.Set(500f, 0f);
            infopanel.SetPadding(10f);

            infoList = new UIAdvList {
                StartPadding = 5f, ListPadding = 10f
            };
            infoList.Width.Set(0f, 1f);
            infoList.Height.Set(0f, 1f);
            infopanel.Append(infoList);


            var uiscrollbar = new UIAdvScrollBar();

            uiscrollbar.SetView(100f, 1000f);
            uiscrollbar.Height.Set(0f, 1f);
            uiscrollbar.HAlign = 1f;
            infopanel.Append(uiscrollbar);
            infoList.SetScrollbar(uiscrollbar);


            gucoinText = new UIText("0");
            gucoinText.MarginBottom = 5f;
            gucoinText.TextColor    = Color.Yellow;
            gucoinText.VAlign       = 1f;
            gucoinText.HAlign       = 0.5f;
            infopanel.Append(gucoinText);
            Append(infopanel);
        }