Esempio n. 1
0
        public void Construct(LevelAgent attacker, List <LevelAgent> targets, List <DamageInfo> skillDamages, long skillUniqueID, bool blSkillEdit = false)
        {
            this.attacker           = attacker;
            this.targets            = targets;
            this.skillDamages       = skillDamages;
            skillManage             = GameObject.Instantiate(Resources.Load <SkillManage>("Prefab/Skill/" + skillUniqueID));
            skillManage.OnComplete += OnComplete;

            attack_phase = new StateMachine <AttackPhase>();
            attack_phase.AddState(AttackPhase.Intro, null, SkillIntro);
            attack_phase.AddState(AttackPhase.Attack, null, SkillAttack);
            attack_phase.AddState(AttackPhase.Done);
            attack_phase.SetState(AttackPhase.Intro);
        }
Esempio n. 2
0
        public void OnSkillState(SkillData skillState)
        {
            //buffs = new Dictionary<int, BuffInfo>();
            this.skillState = skillState;
            buffs           = new Dictionary <int, int[]>();
            for (int i = 0; i < skillState.skillDamages.Count; i++)
            {
                if (skillState.skillDamages[i].buffInfo != null)
                {
                    buffs.Add(i, skillState.skillDamages[i].buffInfo);
                }
            }


            SkillManage skillManage = Instantiate(Resources.Load <SkillManage>("Prefab/Skill/" + skillState.skillInfo.Id));

            skillManage.Init(skillState.attacker, skillState.targets, skillState.skillDamages);
            skillManage.OnComplete += OnComplete;
        }
Esempio n. 3
0
    // Use this for initialization
    void Start()
    {
        this._shoot = GetComponentInChildren<ShootManage>();
        ErrorLog.CheckComponentExist(this._shoot, "ShootManage", this.name);
        this._shoot.transform.rotation = Quaternion.identity;
        this._angleZ = 0;

        this._move = GetComponent<Move>();
        ErrorLog.CheckComponentExist(this._move, "Move", this.name);

        this._skill = GetComponentInChildren<SkillManage>();
        ErrorLog.CheckComponentExist(this._skill, "SkillManage", this.name);

        this._controller = ControllerFactory.create(Player);
        ErrorLog.CheckComponentExist(this._controller, "Controller", this.name);
    }