Ejemplo n.º 1
0
 public void Init(GDSKit.SkillConfig skillConfig, Transform rootTf)
 {
     mSkillConfig = skillConfig;
     GameMain.Instance.ResMgr.LoadResourceAsync(this, "jostickSkillOpe", typeof(GameObject), delegate(UnityEngine.Object prefab)
     {
         mObj = GameObject.Instantiate <GameObject>(prefab as GameObject);
         mObj.transform.SetParent(rootTf);
         mObj.transform.Reset();
         mJostickControl = new JostickController();
         mJostickControl.Init(mObj.transform, null, delegate()
         {
             UpdateAreaEffectState();
             UpdateCastDisEffectState();
         }, delegate()
         {
             UpdateAreaEffectState();
             UpdateAreaEffect();
             UpdateCastDisEffectState();
             OperatorManager.Instance.UseAreaSkill(mSkillConfig.id, mJostickControl.movementVector);
         }
                              );
     }, delegate(string errorCode)
     {
     });
     CreateAreaEffect();
     CreateCastDisEffect();
     TimerManager.Instance.RepeatCall(ulong.MaxValue, UpdateAreaEffect);
     TimerManager.Instance.RepeatCall(ulong.MaxValue, UpdateCastDisEffect);
 }
Ejemplo n.º 2
0
 public void Init(GDSKit.SkillConfig skillConfig, Transform rootTf)
 {
     mSkillConfig = skillConfig;
     GameMain.Instance.ResMgr.LoadResourceAsync(this, "selectSkillOpe", typeof(GameObject), delegate(UnityEngine.Object prefab)
     {
         mObj = GameObject.Instantiate <GameObject>(prefab as GameObject);
         mObj.transform.SetParent(rootTf);
         mObj.transform.Reset();
         mBtn = mObj.GetComponent <Button>();
         EventTriggerListener.Get(mBtn.gameObject).onClick = delegate(GameObject obj) {
         };
     }, delegate(string errorCode)
     {
     });
 }
Ejemplo n.º 3
0
    public override void OnOpend(object openParam)
    {
        base.OnOpend(openParam);
        List <int> selfSkillList = openParam as List <int>;

        mSkillOpes = new SkillViewOpe[selfSkillList.Count];
        for (int i = 0; i < selfSkillList.Count; ++i)
        {
            int skillId = selfSkillList[i];
            GDSKit.SkillConfig skillConfig = GDSKit.SkillConfig.GetInstance(skillId);
            Transform          tf          = PrefabTf.Find("skill" + i);
            switch ((SkillType)skillConfig.targetInfo.type)
            {
            case SkillType.NoTargetSkill:
                break;

            case SkillType.UnitTargetSkill:
                break;

            case SkillType.AreaTargetSkill:
                if (skillConfig.distance <= 0)
                {
                    SkillViewClickOpe clickOpe = new SkillViewClickOpe();
                    clickOpe.Init(skillConfig, tf);
                    mSkillOpes[i] = clickOpe;
                }
                else
                {
                    SkillViewJostickOpe jostickOpe = new SkillViewJostickOpe();
                    jostickOpe.Init(skillConfig, tf);
                    mSkillOpes[i] = jostickOpe;
                }
                break;

            default:
                throw new System.NotImplementedException("技能界面未实现的技能类型 " + skillConfig.targetInfo.type);
            }
        }
    }
Ejemplo n.º 4
0
 public void Init(GDSKit.SkillConfig skillConfig, Transform rootTf)
 {
     mSkillConfig = skillConfig;
     GameMain.Instance.ResMgr.LoadResourceAsync(this, "clickSkillOpe", typeof(GameObject), delegate(UnityEngine.Object prefab)
     {
         mObj = GameObject.Instantiate <GameObject>(prefab as GameObject);
         mObj.transform.SetParent(rootTf);
         mObj.transform.Reset();
         mBtn = mObj.GetComponent <Button>();
         EventTriggerListener.Get(mBtn.gameObject).onClick = delegate(GameObject obj) {
             if (mSkillConfig.targetInfo.type == (short)SkillType.NoTargetSkill)
             {
                 OperatorManager.Instance.UseNoTargetSkill(mSkillConfig.id);
             }
             else
             {
                 OperatorManager.Instance.UseAreaSkill(mSkillConfig.id, Vector2.zero);
             }
         };
     }, delegate(string errorCode)
     {
     });
 }