Exemplo n.º 1
0
 public XBullet(XBulletData data)
 {
     _data    = data;
     _elapsed = 0.0f;
     _hits    = data.Hits;
     _bullet  = XResources.Load <GameObject>(data.Prefab, AssetType.Prefab);
     _bullet.transform.position = _data.BulletRay.origin;
     _bullet.transform.rotation = _data.Velocity > 0 ? Quaternion.LookRotation(_data.BulletRay.direction) : Quaternion.LookRotation(_data.Firer.Transform.forward);
     _data.Firer.ShownTransform = _bullet.transform;
 }
Exemplo n.º 2
0
    public void Destroy()
    {
        XTimerMgr.singleton.RemoveTimer(_tail_results_token);
        if (_data.Skill.Result[_data.Sequnce].LongAttackData.TriggerAtEnd_Count == 0)
        {
            TailResult(true);
        }

        if (_bullet != null)
        {
            GameObject.Destroy(_bullet);
        }
        foreach (XBulletTarget bt in _hurt_target.Values)
        {
            XTimerMgr.singleton.RemoveTimer(bt.TimerToken);
        }
        _bullet = null;
        _data   = null;
    }