コード例 #1
0
ファイル: NcBillboard.cs プロジェクト: whztt07/mobahero_src
    private void Update()
    {
        if (Camera.main == null)
        {
            return;
        }
        Vector3 worldUp;

        if (this.m_bFixedObjectUp)
        {
            worldUp = base.transform.up;
        }
        else
        {
            worldUp = Camera.main.transform.rotation * Vector3.up;
        }
        if (this.m_bCameraLookAt)
        {
            base.transform.LookAt(Camera.main.transform, worldUp);
        }
        else
        {
            base.transform.LookAt(base.transform.position + Camera.main.transform.rotation * Vector3.back, worldUp);
        }
        switch (this.m_FrontAxis)
        {
        case NcBillboard.AXIS_TYPE.AXIS_BACK:
            base.transform.Rotate(base.transform.up, 180f, Space.World);
            break;

        case NcBillboard.AXIS_TYPE.AXIS_RIGHT:
            base.transform.Rotate(base.transform.up, 270f, Space.World);
            break;

        case NcBillboard.AXIS_TYPE.AXIS_LEFT:
            base.transform.Rotate(base.transform.up, 90f, Space.World);
            break;

        case NcBillboard.AXIS_TYPE.AXIS_UP:
            base.transform.Rotate(base.transform.right, 90f, Space.World);
            break;

        case NcBillboard.AXIS_TYPE.AXIS_DOWN:
            base.transform.Rotate(base.transform.right, 270f, Space.World);
            break;
        }
        if (this.m_bFixedStand)
        {
            base.transform.rotation = Quaternion.Euler(new Vector3(0f, base.transform.rotation.eulerAngles.y, base.transform.rotation.eulerAngles.z));
        }
        if (this.m_RatationMode == NcBillboard.ROTATION.RND)
        {
            base.transform.localRotation *= Quaternion.Euler((this.m_RatationAxis != NcBillboard.AXIS.X) ? 0f : this.m_fRndValue, (this.m_RatationAxis != NcBillboard.AXIS.Y) ? 0f : this.m_fRndValue, (this.m_RatationAxis != NcBillboard.AXIS.Z) ? 0f : this.m_fRndValue);
        }
        if (this.m_RatationMode == NcBillboard.ROTATION.ROTATE)
        {
            float num = NcEffectBehaviour.GetEngineDeltaTime() * this.m_fRotationValue;
            base.transform.Rotate((this.m_RatationAxis != NcBillboard.AXIS.X) ? 0f : num, (this.m_RatationAxis != NcBillboard.AXIS.Y) ? 0f : num, (this.m_RatationAxis != NcBillboard.AXIS.Z) ? 0f : num, Space.Self);
        }
    }
コード例 #2
0
 private void Update()
 {
     if (NcEffectBehaviour.GetEngineTime() < this.m_fStartTime + this.m_fDelayTime)
     {
         return;
     }
     if (this.m_fTurnSpeed != 0f)
     {
         base.transform.Rotate(base.transform.up * NcEffectBehaviour.GetEngineDeltaTime() * this.m_fTurnSpeed, Space.World);
     }
 }
コード例 #3
0
 private void Update()
 {
     if (NcEffectBehaviour.GetEngineTime() < this.m_fStartTime + this.m_fDelayTime)
     {
         return;
     }
     if (this.m_fTurnSpeed != 0f)
     {
         base.get_transform().Rotate(base.get_transform().get_up() * NcEffectBehaviour.GetEngineDeltaTime() * this.m_fTurnSpeed, 0);
     }
 }
コード例 #4
0
ファイル: NcRotation.cs プロジェクト: unseen-code/tianqi_src
 private void Update()
 {
     base.get_transform().Rotate(NcEffectBehaviour.GetEngineDeltaTime() * this.m_vRotationValue.x, NcEffectBehaviour.GetEngineDeltaTime() * this.m_vRotationValue.y, NcEffectBehaviour.GetEngineDeltaTime() * this.m_vRotationValue.z, (!this.m_bWorldSpace) ? 1 : 0);
 }
コード例 #5
0
    private void Update()
    {
        if (Camera.get_main() == null)
        {
            return;
        }
        Vector3 vector;

        if (this.m_bFixedObjectUp)
        {
            vector = base.get_transform().get_up();
        }
        else
        {
            vector = Camera.get_main().get_transform().get_rotation() * Vector3.get_up();
        }
        if (this.m_bCameraLookAt)
        {
            base.get_transform().LookAt(Camera.get_main().get_transform(), vector);
        }
        else
        {
            base.get_transform().LookAt(base.get_transform().get_position() + Camera.get_main().get_transform().get_rotation() * Vector3.get_back(), vector);
        }
        switch (this.m_FrontAxis)
        {
        case NcBillboard.AXIS_TYPE.AXIS_BACK:
            base.get_transform().Rotate(base.get_transform().get_up(), 180f, 0);
            break;

        case NcBillboard.AXIS_TYPE.AXIS_RIGHT:
            base.get_transform().Rotate(base.get_transform().get_up(), 270f, 0);
            break;

        case NcBillboard.AXIS_TYPE.AXIS_LEFT:
            base.get_transform().Rotate(base.get_transform().get_up(), 90f, 0);
            break;

        case NcBillboard.AXIS_TYPE.AXIS_UP:
            base.get_transform().Rotate(base.get_transform().get_right(), 90f, 0);
            break;

        case NcBillboard.AXIS_TYPE.AXIS_DOWN:
            base.get_transform().Rotate(base.get_transform().get_right(), 270f, 0);
            break;
        }
        if (this.m_bFixedStand)
        {
            base.get_transform().set_rotation(Quaternion.Euler(new Vector3(0f, base.get_transform().get_rotation().get_eulerAngles().y, base.get_transform().get_rotation().get_eulerAngles().z)));
        }
        if (this.m_RatationMode == NcBillboard.ROTATION.RND)
        {
            Transform expr_1E6 = base.get_transform();
            expr_1E6.set_localRotation(expr_1E6.get_localRotation() * Quaternion.Euler((this.m_RatationAxis != NcBillboard.AXIS.X) ? 0f : this.m_fRndValue, (this.m_RatationAxis != NcBillboard.AXIS.Y) ? 0f : this.m_fRndValue, (this.m_RatationAxis != NcBillboard.AXIS.Z) ? 0f : this.m_fRndValue));
        }
        if (this.m_RatationMode == NcBillboard.ROTATION.ROTATE)
        {
            float num = this.m_fTotalRotationValue + NcEffectBehaviour.GetEngineDeltaTime() * this.m_fRotationValue;
            base.get_transform().Rotate((this.m_RatationAxis != NcBillboard.AXIS.X) ? 0f : num, (this.m_RatationAxis != NcBillboard.AXIS.Y) ? 0f : num, (this.m_RatationAxis != NcBillboard.AXIS.Z) ? 0f : num, 1);
            this.m_fTotalRotationValue = num;
        }
    }
コード例 #6
0
 private void Update()
 {
     base.transform.Rotate(NcEffectBehaviour.GetEngineDeltaTime() * this.m_vRotationValue.x, NcEffectBehaviour.GetEngineDeltaTime() * this.m_vRotationValue.y, NcEffectBehaviour.GetEngineDeltaTime() * this.m_vRotationValue.z, (!this.m_bWorldSpace) ? Space.Self : Space.World);
 }