public bool CastSkill(int id) { if (!_map.ContainsKey(id)) { return(false); } SkillLog.Log("======================释放技能:[{0}]======================", id); _currSequece = _map[id]; _currSequece.Start(_entity); /* //if (!CanCastSkill()) return false; * EntityEventFactory.ChangeInEntityState(_entity, E_StateId.attack); * //SkillLog.Assert(!_test, "释放技能bug:[{0}]", id); * SkillLog.Log("======================释放技能:[{0}]======================", id); * //_test = true; * _canCastSkill = false; * * _currSequece = SkillFactory.Create(); * _currSequece.GetBlackBorad().SetValue(SequenceSelfConst.TARGET_POSITION1, new Vector3(1.87f, 0.1f, 3.76f)); * * _currSequece.GetBlackBorad().SetValue(SequenceSelfConst.TARGET_POSITION2, _entity.EntityController.WroldPosition); * * _currSequece.GetBlackBorad().SetValue(SequenceSelfConst.TARGET_SELF_ENTITY, _entity); * _currSequece.Start();*/ return(true); }
public bool CastSkill(int id) { if (!CanCastSkill()) { return(false); } EntityEventFactory.ChangeInEntityState(_entity, E_StateId.attack); SkillLog.Assert(!_test, "释放技能bug:[{0}]", id); SkillLog.Log("======================释放技能:[{0}]======================", id); _test = true; _can_cast_skill = false; // TODO QAQ:有bug的可能性很大,例如技能释放到一半的时候,释放了另外一个技能,这样就需要破坏掉原来的技能 _curr_sequece = _sequence_map[id]; //_curr_sequece.OnStart(); _last_time = TimeModule.RealtimeSinceStartup; return(true); }
private void Init() { _map.Clear(); TextAsset textAsset = Resources.Load <TextAsset>("Config/Skill/02"); ResMd resMd = new ResMd(); resMd.ParseText(textAsset.text); List <EdNode> nodes = resMd._root_node.GetNodes("Sequence"); int length = nodes.Count; for (int i = 0; i < length; i++) { SequenceLine line = SkillFactory.Create(nodes[i]); if (line == null) { continue; } _map.Add(line.Id, line); } }
public void BindingContext(SequenceLine context, int frameLength) { _frameLength = frameLength; _context = context; }
public void OnFinish() { _curr_sequece = null; }