Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- Coke Theme Example -->
- <VariableBinders>
- <SensorBinder type="linear_acceleration">
- <Variable name="linear_acceleration_x" index="0" />
- <Variable name="linear_acceleration_y" index="1" />
- <Variable name="linear_acceleration_z" index="2" />
- </SensorBinder>
- </VariableBinders>
- <!-- 三个方向的甩动计数 -->
- <Var name="line_x" expression="#linear_acceleration_x" threshold="1">
- <Trigger>
- <VariableCommand name="plus_x" expression="ifelse((le(#line_x,-3)+ge(#line_x,3))*le(#pre_line_x*#line_x,0),1,0)" />
- <VariableCommand name="shake_time" expression="#shake_time+1" condition="#plus_x" />
- <VariableCommand name="pre_line_x" expression="ifelse(#plus_x,#line_x,#pre_line_x)" />
- </Trigger>
- </Var>
- <Var name="line_y" expression="#linear_acceleration_y" threshold="1">
- <Trigger>
- <VariableCommand name="plus_y" expression="ifelse((le(#line_y,-3)+ge(#line_y,3))*le(#pre_line_y*#line_y,0),1,0)" />
- <VariableCommand name="shake_time" expression="#shake_time+1" condition="#plus_y" />
- <VariableCommand name="pre_line_y" expression="ifelse(#plus_y,#line_y,#pre_line_y)" />
- </Trigger>
- </Var>
- <Var name="line_z" expression="#linear_acceleration_z" threshold="1">
- <Trigger>
- <VariableCommand name="plus_z" expression="ifelse((le(#line_z,-3)+ge(#line_z,3))*le(#pre_line_z*#line_z,0),1,0)" />
- <VariableCommand name="shake_time" expression="#shake_time+1" condition="#plus_z" />
- <VariableCommand name="pre_line_z" expression="ifelse(#plus_z,#line_z,#pre_line_z)" />
- </Trigger>
- </Var>
- <!-- 摇晃动画 -->
- <Var name="line" expression="#linear_acceleration_x+10*#linear_acceleration_y+100*#linear_acceleration_z" threshold="1">
- <Trigger>
- <VariableCommand name="rock_angle" expression="-10" condition="ge(#shake_time,2)" />
- <Comman target="coke_n.animation" value="play" condition="ge(#shake_time,2)" />
- <VariableCommand name="rock_angle" expression="0" delay="1500" delayCondition="le((abs(#line_x)+abs(#line_y)+abs(#line_z)),2)" />
- <VariableCommand name="shake_time" expression="0" delay="100" condition="ge(#shake_time,2)" />
- <!-- <SoundCommand sound="silence.mp3" volume="1" keepCur="false" delay="1500" delayCondition="le((abs(#line_x)+abs(#line_y)+abs(#line_z)),2)" /> -->
- </Trigger>
- </Var>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement