internal void OnAddedToBattle(string rid, string skillId, int lvl, VBio caster, VBio target, Vector3 targetPoint) { this._rid = rid; this._data = ModelFactory.GetBuffData(Utils.GetIDFromRID(this._rid)); this.skillData = ModelFactory.GetSkillData(skillId); this.caster = caster; this.target = target; this.targetPoint = targetPoint; this.property.Init(this._data); this.ApplyLevel(lvl); }
public VBattle(BattleParams param) { this.collider = GameObject.Find("Collider").GetComponent <BoxCollider>(); this._rid = param.id; this.data = ModelFactory.GetBattleData(Utils.GetIDFromRID(this._rid)); Camera mainCamera = GameObject.Find("Camera").GetComponent <Camera>(); this.camera = new GodCamera(mainCamera, this.data.camera); this.input = new PointerInput(mainCamera); this.input.RegisterInteractive(this); this.interaction = new Interaction(this); this._debugDrawer = new DebugDrawer(); this.graphicManager = new GraphicManager(); this._entityManager = new VEntityManager(this); this._buffManager = new VBuffManager(this); EventCenter.AddListener(SyncEventType.BATTLE_DESTROIED, this.HandleBattleDestroied); EventCenter.AddListener(SyncEventType.SPAWN_ENTITY, this.HandleSpawnEntity); EventCenter.AddListener(SyncEventType.DESPAWN_ENTITY, this.HandleDespawnEntity); EventCenter.AddListener(SyncEventType.ENTITY_ATTR_CHANGED, this.HandleEntityAttrChanged); EventCenter.AddListener(SyncEventType.SKILL_ATTR_CHANGED, this.HandleSkillAttrChanged); EventCenter.AddListener(SyncEventType.BUFF_ATTR_CHANGED, this.HandleBuffAttrChanged); EventCenter.AddListener(SyncEventType.ENTITY_ATTR_INITIALIZED, this.HandleEntityAttrInitialized); EventCenter.AddListener(SyncEventType.BUFF_ATTR_INITIALIZED, this.HandleBuffAttrInitialized); EventCenter.AddListener(SyncEventType.ENTITY_STATE_CHANGED, this.HandleEntityStateChanged); EventCenter.AddListener(SyncEventType.SPAWN_BUFF, this.HandleSpawnBuff); EventCenter.AddListener(SyncEventType.DESPAWN_BUFF, this.HandleDespawnBuff); EventCenter.AddListener(SyncEventType.ENTER_BUFF, this.HandleEnterBuff); EventCenter.AddListener(SyncEventType.EXIT_BUFF, this.HandleExitBuff); EventCenter.AddListener(SyncEventType.BUFF_TRIGGERED, this.HandleBuffTriggered); EventCenter.AddListener(SyncEventType.TRIGGER_TARGET, this.HandleTriggerTarget); EventCenter.AddListener(SyncEventType.BUFF_STATE_ADDED, this.HandleBuffStateAdded); EventCenter.AddListener(SyncEventType.BUFF_STATE_REMOVED, this.HandleBuffStateRemoved); EventCenter.AddListener(SyncEventType.BUFF_STATE_TRIGGERED, this.HandleBuffStateTriggered); EventCenter.AddListener(SyncEventType.ENTITY_RELIVE, this.HandleRelive); EventCenter.AddListener(SyncEventType.DAMAGE, this.HandleDamage); EventCenter.AddListener(SyncEventType.ENTITY_DIE, this.HandleEntityDie); EventCenter.AddListener(SyncEventType.MISSILE_COMPLETE, this.HandleMissileComplete); EventCenter.AddListener(SyncEventType.DEBUG_DRAW, this.HandleDebugDraw); }