예제 #1
0
        public bool UseOnTarget(Entity self, Vector3Int pos)
        {
            SkillPanel skillPanel = UIManager.Instance.FindSkill(SkillType.Fireball);
            var        strength   = skillPanel.GetDie(DiceType.Strength).value;
            var        aoe        = skillPanel.GetDie(DiceType.AreaOfEffect)?.value != null;

            if (aoe)
            {
                Vector3Int[] toCheck =
                {
                    pos,
                    pos + MoveDirection.North.ToVec3Int(),
                    pos + MoveDirection.West.ToVec3Int(),
                    pos + MoveDirection.South.ToVec3Int(),
                    pos + MoveDirection.East.ToVec3Int()
                };

                foreach (Vector3Int v in toCheck)
                {
                    var entityAt = LevelManager.Instance.GetEntitiesAt(v);
                    foreach (Entity entity in entityAt)
                    {
                        entity.ModifyHp(strength);
                    }
                }
            }
            else
            {
                LevelManager.Instance.GetEntityAt(pos).ModifyHp(strength);
            }

            return(true);
        }
예제 #2
0
 public void Awake()
 {
     manager         = GameObject.Find("Player").GetComponent <ProgressionManager>();
     skillPanel      = GameObject.Find("SkillPanel").GetComponent <SkillPanel>();
     assignmentPanel = GameObject.Find("SkillAssignmentPanel").GetComponent <SkillPanel>();
     receivingImage  = gameObject.GetComponent <Image>();
 }
예제 #3
0
 private void HandleRaceChange()
 {
     labelRace.Text = CharacterManagerClass.CharacterManager.CharacterRace.GetRaceName();
     mainScreenAbilitiesPanel1.AbilityChange(SelectedLevel);
     mainScreenFeatsPanel1.FeatChange(SelectedLevel);
     SkillPanel.Updatevalues(SelectedLevel);
 }
예제 #4
0
    public static void CreateSkillPanel()
    {
        GameObject go = Resources.Load <GameObject>(Consts.PrefabUIDir + "SkillPanel");

        skillPanelGo = GameObject.Instantiate(go);
        skillPanelGo.transform.SetParent(personPanel.transform, false);
        skillPanelGo.transform.localScale = new Vector3(1, 1, 1);
        skillPanelGo.name = "SkillPanel";

        skillPanelGo.SetActive(false);

        Dictionary <string, List <SkillData> > skillData = SkillManager.Instance.skillData;

        //创建每个职业的技能面板
        foreach (List <SkillData> skillDataList in skillData.Values)
        {
            CreateSkillViewPort(skillDataList);
        }

        //动态添加SkillPanel脚本
        SkillPanel skillPanel = skillPanelGo.AddComponent <SkillPanel>();

        skillPanel.skillData         = skillData;
        skillPanel.skillViewPortList = skillViewPortList;

        CreateSkillIntroPanel();
    }
예제 #5
0
    public void Init(List <Character> characters)
    {
        //Initialisation des composantes
        AP           = transform.FindChild("ActionPanel").GetComponent <ActionPanel>();
        TP           = transform.FindChild("TargetPanel").GetComponent <TargetPanel>();
        mapInterface = GameObject.Find("3DDisplay");
        CPContrainer = transform.FindChild("CharPanel").gameObject;
        CP           = new CharacterPanel[4];

        //Initialise chaque character panel
        for (int i = 0; i < 4; i++)
        {
            CP[i] = transform.GetChild(0).GetChild(i + 1).GetComponent <CharacterPanel>();

            if (i < characters.Count)
            {
                CP[i].Init(characters[i]);
            }
            else
            {
                CP[i].Init(null);
            }
        }

        SP = transform.FindChild("SkillPanel").gameObject.GetComponent <SkillPanel>();
    }
예제 #6
0
        private void LevelButton_Click(object sender, EventArgs e)
        {
            int    buttonIndex;
            Button levelButton;
            string buttonName;

            buttonIndex = GetButtonIndex(sender);
            if (buttonIndex != SelectedLevel)
            {
                //Ok lets set the previous selected button to nonselected style
                buttonName            = "LevelButton" + SelectedLevel;
                levelButton           = (Button)this.Controls[buttonName];
                levelButton.BackColor = ButtonNotSelectedStyle.Color2;
                levelButton.ForeColor = ButtonNotSelectedStyle.Color1;
                levelButton.Font      = ButtonNotSelectedStyle.Font;

                //now we can set the selected button
                SelectedLevel         = buttonIndex;
                buttonName            = "LevelButton" + SelectedLevel;
                levelButton           = (Button)this.Controls[buttonName];
                levelButton.BackColor = ButtonSelectedStyle.Color2;
                levelButton.ForeColor = ButtonSelectedStyle.Color1;
                levelButton.Font      = ButtonSelectedStyle.Font;

                //Now we need refresh our screens based on the new level selected
                mainScreenFeatsPanel1.FeatChange(SelectedLevel);
                mainScreenAbilitiesPanel1.AbilityChange(SelectedLevel);
                SkillPanel.Updatevalues(SelectedLevel);
                labelClasses.Text = CharacterManagerClass.CharacterManager.CharacterClass.GetClassSplit(SelectedLevel);
            }
        }
예제 #7
0
    public void OnUseHammerClick(PointerEventData eventData, SkillPanel skillPanel, int coins)
    {
        if (this.isCanHammer == false)
        {
            return;
        }
        List <RaycastResult> results = new List <RaycastResult>();

        EventSystem.current.RaycastAll(eventData, results);
        TriangelItem triangel = getTriangelItemRayCat(results);

        if (triangel != null)
        {
            if (this._mapData[triangel.Row, triangel.Col].Color == ColorType.NONE)
            {
                this.CancelHammer();
            }
            else
            {
                this.CancelHammer();
                //////oogleAnalyticsV4.getInstance().LogEvent("SKILL", "Use Skill Hammer Success", string.Empty, 0L);

                UserProfile.Instance.ReduceDiamond(coins);
                this._mapData[triangel.Row, triangel.Col].Color = ColorType.NONE;
                this._mapUI[triangel.Row, triangel.Col].ClearPatternTriangle();
                SoundManager.Instance.PlaySfx(SFX.Clear);
            }
        }
        else
        {
            this.CancelHammer();
        }
        skillPanel.callbackUseSkill = null;
        skillPanel.gameObject.SetActive(false);
    }
예제 #8
0
    // Use this for initialization
    void Start()
    {
        skillPanel = GameObject.Find("SkillPanel").GetComponent <SkillPanel>();

        /// initial binding
        for (int idx = 0; idx < slots.Length; idx++)
        {
            if (slots[idx].skillObject != null)
            {
                BindToSlot(slots[idx].skillObject, slots[idx]);
            }
        }

        /// pad key code transform
        var mov = GetComponent <PlayerMovement>();

        if (mov.pad)
        {
            for (int i = 0; i < slots.Length; ++i)
            {
                slots[i].keyCode += "_pad" + mov.playerId;
            }
        }

        for (int idx = 0; idx < slots.Length; idx++)
        {
            if (slots[idx].skillObject != null)
            {
                BindToSlot(slots[idx].skillObject, slots[idx]);
                skillPanel.skillButtons[idx].SetSkill(slots[idx].skillObject);
            }
        }
    }
예제 #9
0
    public void OnUseDeleteClick(PointerEventData eventData, SkillPanel skillPanel, int coins)
    {
        List <RaycastResult> results = new List <RaycastResult>();

        EventSystem.current.RaycastAll(eventData, results);
        HexaPattern pattern = getHexaPattern(results);

        if (pattern != null)
        {
            //////oogleAnalyticsV4.getInstance().LogEvent("SKILL", "Use Skill Delete Success ", string.Empty, 0L);

            GameObject gameObject = this.InitDataPattern(pattern.IndexInPanel, false);
            gameObject.transform.position = this.listPosPattern[pattern.IndexInPanel].position;
            UserProfile.Instance.ReduceDiamond(coins);
            pattern.DestroyPattern();
            this.listPattern.Remove(pattern);
            SoundManager.Instance.PlaySfx(SFX.Clear);
            this.CancelSkillDelete();
        }
        else
        {
            this.CancelSkillDelete();
        }
        skillPanel.callbackUseSkill = null;
        skillPanel.gameObject.SetActive(false);
    }
예제 #10
0
 void Start()
 {
     Player = GetComponent <BasePlayer>();
     RB     = GetComponent <Rigidbody>();
     Anim   = GetComponent <Animator>();
     m_Cam  = Camera.main.transform;
     agent  = GetComponent <UnityEngine.AI.NavMeshAgent>();
     StartCoroutine(Wait());
     SkillPanel.SetActive(false);
 }
예제 #11
0
        public bool UseOnTarget(Entity self, Vector3Int pos)
        {
            Entity     e          = LevelManager.Instance.GetEntityAt(pos);
            SkillPanel skillPanel = UIManager.Instance.FindSkill(SkillType.Melee);
            var        str        = skillPanel.GetDie(DiceType.Strength).value;

            e.ModifyHp(str);

            return(true);

            throw new NotImplementedException();
        }
예제 #12
0
    void Start()
    {
        skillPanel            = skillPanelObj.GetComponent <SkillPanel>();
        skillSlotImage        = GetComponent <Image>();
        skillSlotImage.sprite = null;

        GetComponent <Button>().onClick.AddListener(() => { ShowSkillsOfCharacter(); });
        skillPanelOKBtn.onClick.AddListener(() => { HideSkillPanelAndSave(); });
        skillPanelCancelBtn.onClick.AddListener(() => { HideSkillPanel(); });

        HideSkillPanel();
    }
예제 #13
0
    // Update is called once per frame
    void Update()
    {
        var        reload     = GetComponent <Reload>();
        SkillPanel skillPanel = GetComponent <SkillPanel>();

        if (kingSkill)
        {
            KingTime();
            //kingSkill = true;
        }

        if (Input.GetMouseButton(0))
        {
            //クリックして、オブジェクトがあったら
            GameObject obj = getClickObject();
            if (obj != null)
            {
                if (obj.tag == "Skill")
                {
                    Debug.Log("skill");
                    if (!kingSkill)
                    {
                        switch (obj.layer)
                        {
                        //皇:8
                        case 8:

                            if (!ready)
                            {
                                readySe.PlayOneShot(readySe.clip);
                                Ready = Instantiate(ReadyPanelPrefab, new Vector3(0, 0, 1), transform.rotation) as GameObject;
                            }
                            ready = true;
                            //GameObject KingPanel = Instantiate(KingPanelPrefab, new Vector3(50, 0, 1), transform.rotation) as GameObject;
                            //kingSkill = true;
                            //bgm++;
                            Debug.Log("王様");
                            break;

                        ////フロスト:9
                        //case 9:
                        //    //フロストの必殺技呼び出し
                        //    Debug.Log("フロスト");
                        //    break;
                        default:
                            Debug.Log("??");
                            break;
                        }
                    }
                }
            }
        }
    }
예제 #14
0
 public void OnclickBT()
 {
     if (!GameObject.FindGameObjectWithTag("PANEL"))
     {
         SkillPanel skillPanel = Instantiate(skillPrefab, transform.parent.parent).GetComponent <SkillPanel>();
     }
     else
     {
         PanelManager game = GameObject.FindGameObjectWithTag("PANEL").GetComponent <PanelManager>();
         game.Close();
         SkillPanel skillPanel = Instantiate(skillPrefab, transform.parent.parent).GetComponent <SkillPanel>();
     }
 }
예제 #15
0
 public void OpenSkillPanel()
 {
     if (!SkillPanelOpen)
     {
         SkillPanel.SetActive(true);
         InventoryPanel.SetActive(false);
         SkillPanelOpen = true;
         InventoryOpen  = false;
     }
     else
     {
         SkillPanel.SetActive(false);
         SkillPanelOpen = false;
     }
 }
예제 #16
0
 private void Awake()
 {
     instance = this;
     for (int i = 0; i < hotSkills.Length; ++i)
     {
         int clickedIndex = i;
         hotSkills[i].button.onClick.AddListener(() =>
         {
             if (OnClick != null)
             {
                 OnClick(clickedIndex);
             }
         });
     }
 }
예제 #17
0
        public void CheckUiUpdates(SkillPanel s)
        {
            switch (s.data.type)
            {
            case SkillType.Movement:
                DiceScript diceScript = s.GetDie(DiceType.Range);

                if (diceScript != null)
                {
                    moves = maxMoves = diceScript.value;
                    GameManager.Instance.UpdateUI();
                }

                break;
            }
        }
예제 #18
0
파일: SkillItem.cs 프로젝트: WsScode/Scode
    private void Awake()
    {
        m_SkillIcon   = transform.Find("SkillIcon").GetComponent <Image>();
        m_SkillName   = transform.Find("SkillName").GetComponent <Text>();
        m_SkillLevel  = transform.Find("SkillLevel").GetComponent <Text>();
        m_AddLevel    = transform.Find("AddButton").GetComponent <Button>();
        m_ClickBox    = transform.Find("ClickBox").GetComponent <Button>();
        m_ReduceLevel = transform.Find("ReduceButton").GetComponent <Button>();
        m_ClickBox    = transform.Find("ClickBox").GetComponent <Button>();
        m_ClickBoxIMG = transform.Find("ClickBox").GetComponent <Image>();

        skillpanel   = transform.parent.parent.parent.parent.gameObject;
        m_SkillsInfo = skillpanel.GetComponent <SkillsInfo>();
        m_SkillPanel = skillpanel.GetComponent <SkillPanel>();
        m_ClickBox.onClick.AddListener(UpdateShowDesc);
    }
예제 #19
0
        public override void Initialize()
        {
            base.Initialize();

            var itemPanel = new ItemPanel(
                this.Unit,
                PanelDirection.Bottom,
                new Vector2(this.HealthBar.Size.Y * 3, (float)(this.HealthBar.Size.Y * 2.2)));

            this.RightPanel.AddElement(itemPanel);
            var spellPanel = new SkillPanel(
                this.Unit,
                PanelDirection.Bottom,
                new Vector2(this.HealthBar.Size.Y * 3),
                skill => !skill.IsItem,
                o => 10 - (uint)o.Skill.SourceAbility.AbilitySlot);

            this.LeftPanel.AddElement(spellPanel);
        }
예제 #20
0
    public SkillAtkDlg()
    {
        _root = UIManager.instance.Add("UIPrefabs/FightUI/SkillAtkDlg", UILayer.FightUI);

        for (int i = 0; i < GameSetting.MaxSkillNum; ++i)
        {
            var skillPanel = new SkillPanel();

            var index = (i + 1);
            //var index = i;
            string panelName = "SkillPanel" + index.ToString();
            skillPanel.btn       = _root.Find <Button>(panelName);
            skillPanel.countDown = _root.Find <Image>(panelName + "/CountDownImage");
            skillPanel.cDText    = _root.Find <Text>(panelName + "/CountDownLabel");


            skillPanel.btn.onClick.AddListener(() => OnSkillClick(index));

            _allSkillPanel.Add(skillPanel);
        }
        TimerMgr.instance.CreateTimerAndStart(0.08f, -1, UpdatedCD);
    }
예제 #21
0
 private void HandlePastLifeChange()
 {
     mainScreenAbilitiesPanel1.AbilityChange(SelectedLevel);
     mainScreenFeatsPanel1.FeatChange(SelectedLevel);
     SkillPanel.Updatevalues(SelectedLevel);
 }
예제 #22
0
 private void SetSkillCD(SkillPanel skillPanel, float percent)
 {
     skillPanel.countDown.fillAmount = percent;
 }
예제 #23
0
        public override void Initialize()
        {
            base.Initialize();

            this.BotPanel.AddElement(
                new ItemPanel(
                    this.Unit,
                    PanelDirection.Bottom,
                    new Vector2(this.HealthBar.Size.Y * 3, (float)(this.HealthBar.Size.Y * 2.2))));
            this.skillbook         = this.Unit.SkillBook as InvokerSkillBook;
            this.InvokerSkillPanel = new InvokerSkillPanel(
                this.Unit,
                PanelDirection.Bottom,
                new Vector2(this.HealthBar.Size.Y * 3),
                skill =>
                !skill.IsItem && skill.Name != "invoker_empty1" && skill.Name != "invoker_empty2" &&
                !(skill.SourceAbility.AbilitySlot == AbilitySlot.Slot_1 ||
                  skill.SourceAbility.AbilitySlot == AbilitySlot.Slot_2 ||
                  skill.SourceAbility.AbilitySlot == AbilitySlot.Slot_3 ||
                  skill.SourceAbility.AbilitySlot == AbilitySlot.Slot_6) &&
                (!skill.SourceAbility.IsHidden ||
                 skill.SkillHandle.Equals(this.skillbook?.InvokableSkill?.SkillHandle)));

            // {
            // OrderFunction =
            // skill =>
            // skill.SourceAbility.IsHidden ? 0 : 10 + (uint)skill.SourceAbility.AbilitySlot
            // };
            // this.spellPanel1.PositionFromHealthBarFunc = () => new Vector2(-this.spellPanel1.Size.X, 0);
            this.LeftPanel.AddElement(this.InvokerSkillPanel);
            this.spellPanel2 = new SkillPanel(
                this.Unit,
                PanelDirection.Bottom,
                new Vector2(this.HealthBar.Size.Y * 2),
                skill =>
                !skill.IsItem &&
                !(skill.SourceAbility.AbilitySlot == AbilitySlot.Slot_1 ||
                  skill.SourceAbility.AbilitySlot == AbilitySlot.Slot_2 ||
                  skill.SourceAbility.AbilitySlot == AbilitySlot.Slot_3 ||
                  skill.SourceAbility.AbilitySlot == AbilitySlot.Slot_6) && skill.Name != "invoker_empty1" &&
                skill.Name != "invoker_empty2" && skill.SourceAbility.IsHidden &&
                !skill.Equals(this.skillbook.InvokableSkill),
                o => o.Skill.Json.CastPriority);

            // this.spellPanel2.PositionFromHealthBarLeftFunc =
            // () => new Vector2(-this.spellPanel1.Size.X - this.spellPanel2.Size.X, 0);
            this.LeftPanel.AddElement(this.spellPanel2);
            this.skillAddObserver           = new DataObserver <SkillAdd>(this.OnNext);
            this.modifiers                  = this.Unit.Modifiers as InvokerModifiers;
            this.invokableSkillChangeAction = () =>
            {
                this.InvokerSkillPanel.UpdateSkills();
                this.spellPanel2.UpdateSkills();
            };
            this.skillbook.InvokableSkillChange.Subscribe(this.invokableSkillChangeAction);
            this.becomeVisibleAction = () =>
            {
                this.InvokerSkillPanel.UpdateSkills();
                this.spellPanel2.UpdateSkills();
            };
            this.Unit.Visibility.BecomeVisibleNotifier.Subscribe(this.becomeVisibleAction);
        }
예제 #24
0
 private void HandleClassChange()
 {
     labelClasses.Text = CharacterManagerClass.CharacterManager.CharacterClass.GetClassSplit(SelectedLevel);
     mainScreenFeatsPanel1.FeatChange(SelectedLevel);
     SkillPanel.Updatevalues(SelectedLevel);
 }
예제 #25
0
 public void OnClickRightButton()
 {
     Close();
     SkillPanel skillPanela = Instantiate(skillPanel, transform.parent).GetComponent <SkillPanel>();
 }
예제 #26
0
 private void HandleAbilityChange()
 {
     mainScreenAbilitiesPanel1.AbilityChange(SelectedLevel);
     SkillPanel.Updatevalues(SelectedLevel);
     CharacterManagerClass.CharacterManager.CharacterSkill.IntChange();
 }
예제 #27
0
 private void HandleSkillChange()
 {
     SkillPanel.Updatevalues(SelectedLevel);
 }
예제 #28
0
 private void Awake()
 {
     _instance = this;
     alpha     = GetComponent <TweenAlpha>();
     alpha.PlayReverse();//先隐藏
 }
예제 #29
0
 public void OnclickLeftBT()
 {
     Close();
     SkillPanel skillPanel = Instantiate(questPrefab, transform.parent).GetComponent <SkillPanel>();
 }
예제 #30
0
 private void Awake()
 {
     instance = this;
 }