Beispiel #1
0
    protected override void Start()
    {
        base.Start();
        cdGrid      = GetComponentsInChildren <UICD>();
        skillSprite = new UISprite[cdGrid.Length];
        cdTime      = new float[cdGrid.Length];
        nowTime     = new float[cdGrid.Length];
        player      = GameObject.FindGameObjectWithTag("Player");
        chSkill     = player.GetComponent <CharacterSkillManager>();
        chInput     = player.GetComponent <CharacterInputController>();

        for (int i = 0; i < cdGrid.Length; i++)
        {
            UISceneWidget mButton_Skill = cdGrid[i].GetComponent <UISceneWidget>();
            if (mButton_Skill != null)
            {
                mButton_Skill.OnMouseClick = this.ButtonSkillOnClick;
            }
            cdGrid[i].InitWidgets();
            cdGrid[i].index = i;
            cdGrid[i].SetIcon(SkillManager.Instance.mSkillInfo[i].skillIcon);
            GetSkillCD(SkillManager.Instance.mSkillInfo[i].id, out cd, out mp);
            cdGrid[i].GetComponent <UISceneWidget>().Throughtime = cd;
            cdTime[i]        = nowTime[i] = cd;
            skillSprite[i]   = cdGrid[i].mSprite_CD;
            cdGrid[i].costSp = mp;
        }

        mButton_Attack = GetWidget("BaseSkill");
        if (mButton_Attack != null)
        {
            mButton_Attack.OnMousePress = this.ButtonAttackOnPress;
        }
    }
Beispiel #2
0
 /// <summary>
 /// 初始化
 /// </summary>
 private void Start()
 {
     chAnim        = GetComponent <CharacterAnimation>();
     skillMgr      = GetComponent <CharacterSkillManager>();
     triggerRecord = GetComponent <EnterTriggerRecord>();
     // 2 注册事件 攻击 > 释放技能
     GetComponentInChildren <AnimationEventBehaviour>().attackHandler += DeploySkill;
 }
Beispiel #3
0
 //方法
 private void Start()
 {
     chAnim   = GetComponent <CharacterAnimation>();
     skillMgr = GetComponent <CharacterSkillManager>();
     //使用攻击事件 注册  动画组件 》动画片段》
     //调用方法 OnAttack 触发事件》施放技能
     GetComponentInChildren <AnimationEventBehaviour>().
     attackHandler += DeploySkill;    //使用事件 调用施放技能的方法
 }
Beispiel #4
0
        private void Start()
        {
            chAnim = GetComponent <CharacterAnimation>();

            skillMgr = GetComponent <CharacterSkillManager>();

            //使用攻击事件 调用动画组件 动画播放 调用方法OnAttack
            GetComponentInChildren <AnimationEventBehaviour>().attackHandler += DeploySkill;
        }
 void Start()
 {
     chAnim   = GetComponent <CharacterAnimation>();
     skillMgr = GetComponent <CharacterSkillManager>();
     //攻击动画事件 注册
     GetComponentInChildren <AnimationEventBehaviour>().
     attackHandler += DeploySkill;
     //攻击》释放技能:播放动画
 }
 //查找角色
 private void Awake()
 {
     //整个项目中只有这样一个类型可以这么找
     joystick      = FindObjectOfType <ETCJoystick>();
     moter         = GetComponent <CharacterMotor>();
     playersStatus = GetComponent <PlayerStatus>();
     animator      = GetComponentInChildren <Animator>();
     etcButtons    = FindObjectsOfType <ETCButton>();
     playerSkills  = GetComponent <CharacterSkillManager>();
     skillSystem   = GetComponent <CharacterSkillSystem>();
 }
Beispiel #7
0
    public void WriterSkill()
    {
        CharacterSkillManager magr = null;
        SkillData             data = new SkillData();
        string name = null;

        //
        for (int i = 0; i < names.Count; i++)
        {
            name         = names[i];
            magr         = SkillDataObject.skillObject[name];
            data.skillID = int.Parse
                               (skillManger[name]["SkillID"]);
            SkillDataObject.WriterSkillData(magr, data);
        }
    }
Beispiel #8
0
    protected override void Start()
    {
        base.Start();
        mButton_Attack = GetWidget("BaseSkill");
        if (mButton_Attack != null)
        {
            mButton_Attack.OnMouseClick = this.ButtonAttackOnClick;             //单击按钮
            mButton_Attack.OnMousePress = this.ButtonAttackOnPress;             //按下按钮
        }
        player  = GameObject.FindGameObjectWithTag("Player");
        chInput = player.GetComponent <CharacterInputController>();             //玩家输入控制
        chSkill = player.GetComponent <CharacterSkillManager>();

        cdGrid = GetComponentsInChildren <UICD>();
        Debug.Log("cdGrid.Length" + cdGrid.Length);
        skillSprite = new UISprite[cdGrid.Length];
        cdTime      = new float[cdGrid.Length];
        nowTime     = new float[cdGrid.Length];
        for (int i = 0; i < cdGrid.Length; ++i)
        {
            UISceneWidget mButton_Skil = GetWidget("Skill" + (i + 1));
            if (mButton_Skil != null)
            {
                mButton_Skil.OnMouseClick = this.ButtonSkillOnClick;
            }

            cdGrid[i]       = mButton_Skil.GetComponent <UICD>();             //初始化技能按钮数组
            cdGrid[i].index = i;
            cdGrid[i].InitWidgets();                                          //初始化技能icon
            cdGrid[i].SetIcon(SkillManager.Instance.mSkillInfo[i].skillIcon); //设置技能icon
            skillSprite[i]           = cdGrid[i].mSprite_CD;                  //初始化cd数组
            mButton_Skil.Throughtime = GetSkillCD(SkillManager.Instance.mSkillInfo[i].id);
            cdTime[i] = nowTime[i] = (mButton_Skil.Throughtime + 1f);
            Debug.Log(mButton_Skil.Throughtime);
        }
    }
 private void start()
 {
     skillManager = GetComponent <CharacterSkillManager>();
     animator     = GetComponentInChildren <Animator>();
     GetComponentInChildren <AnimationEventBehaviour>().attackHandler += DeploySkill;
 }
Beispiel #10
0
 public static void WriterSkillData(CharacterSkillManager chSkillManager
                                    , SkillData skillData)
 {
     chSkillManager.skills.Add(skillData);
 }
Beispiel #11
0
 void Start()
 {
     skillManager = GetComponent <CharacterSkillManager>();
     chState      = GetComponent <CharacterState>();
     anim         = GetComponent <AnimatorPlay>();
 }
 //初始化
 public void Start()
 {
     chSkillMgr = GetComponent <CharacterSkillManager>();
     chStatus   = GetComponent <CharacterStatus>();
     chAnim     = GetComponent <CharacterAnimation>();
 }