示例#1
0
    public void UpdateLine(bool throughinsidewall, float width)
    {
        Vector3 vector = (new Vector3(MathDxx.Sin(base.transform.eulerAngles.y + 90f), 0f, MathDxx.Cos(base.transform.eulerAngles.y + 90f)) * width) / 2f;

        RayCastManager.CastMinDistance(base.transform.position + vector, base.transform.eulerAngles.y, throughinsidewall, out float num);
        RayCastManager.CastMinDistance(base.transform.position - vector, base.transform.eulerAngles.y, throughinsidewall, out float num2);
        float length = (num >= num2) ? num2 : num;

        this.SetLine(true, length);
    }
示例#2
0
    protected override void OnInstall()
    {
        base.AttackEffect = "WeaponHand1066Effect";
        this.redline      = Object.Instantiate <GameObject>(ResourceManager.Load <GameObject>("Game/Bullet/Bullet1066_RedLine"));
        this.redline.SetParentNormal(base.m_Entity.m_Body.transform);
        this.ctrl = this.redline.GetComponent <BulletRedLineCtrl>();
        this.ctrl.SetLine(true, 0f);
        this.time = 0f;
        Vector3 vector = new Vector3(MathDxx.Sin(base.m_Entity.eulerAngles.y + 90f), 0f, MathDxx.Cos(base.m_Entity.eulerAngles.y + 90f)) * 0.5f;

        RayCastManager.CastMinDistance(base.m_Entity.m_Body.transform.position + vector, base.m_Entity.eulerAngles.y, false, out float num);
        RayCastManager.CastMinDistance(base.m_Entity.m_Body.transform.position - vector, base.m_Entity.eulerAngles.y, false, out float num2);
        this.mindis = (num >= num2) ? num2 : num;
        Updater.AddUpdate("Weapon1066", new Action <float>(this.OnUpdate), false);
        base.OnInstall();
    }
示例#3
0
    private void UpdateLineLength(int index)
    {
        this.RedLineList[index].transform.position = new Vector3(this.resultpos.x, this.m_Entity.m_Body.LeftBullet.transform.position.y, this.resultpos.z);
        this.RedLineList[index].transform.rotation = Quaternion.Euler(0f, this.resultangle, 0f);
        Vector3 vector2 = this.nextpos - this.resultpos;

        RayCastManager.CastMinDistance(this.RedLineList[index].transform.position, vector2.normalized, this.bThroughWall, out float num, out this.resultpos, out Collider collider);
        this.lineCtrlList[index].SetLine(index == (this.RedLineList.Count - 1), num);
        if (collider != null)
        {
            this.resultangle = Utils.ExcuteReboundWallRedLine(this.RedLineList[index].transform, collider);
        }
        float x = MathDxx.Sin(this.resultangle);
        float z = MathDxx.Cos(this.resultangle);

        this.nextpos = this.resultpos + (new Vector3(x, 0f, z) * 40f);
    }
示例#4
0
 public void Init(EntityBase entity, int count, float[] angles)
 {
     this.Deinit();
     this.time = 0f;
     for (int i = 0; i < count; i++)
     {
         GameObject child = Object.Instantiate <GameObject>(ResourceManager.Load <GameObject>("Game/Bullet/Bullet1066_RedLine"));
         child.SetParentNormal(entity.m_Body.transform);
         child.transform.localRotation = Quaternion.Euler(0f, angles[i], 0f);
         BulletRedLineCtrl component = child.GetComponent <BulletRedLineCtrl>();
         component.SetLine(true, 0f);
         Vector3 vector = new Vector3(MathDxx.Sin(angles[i] + 90f), 0f, MathDxx.Cos(angles[i] + 90f)) * 0.5f;
         RayCastManager.CastMinDistance(entity.m_Body.transform.position + vector, entity.eulerAngles.y, false, out float num2);
         RayCastManager.CastMinDistance(entity.m_Body.transform.position - vector, entity.eulerAngles.y, false, out float num3);
         this.mindiss.Add((num2 >= num3) ? num3 : num2);
         this.list.Add(component);
     }
     Updater.AddUpdate("Weapon1066", new Action <float>(this.OnUpdate), false);
 }