找回密码
 立即注册
查看: 6559|回复: 95

[脚本] RPC函数实现血量值同步代码

[复制链接]
发表于 2013-3-7 13:10 | 显示全部楼层 |阅读模式
  1. @RPC
  2. function controlPlayer()
  3. {
  4.                 animation.CrossFade("chujiao");  
  5.                 yield WaitForSeconds(1);//
  6.                 if(_distance<0.099f  && other.transform.position!=transform.position){
  7.                         if(currentHealth<=0)
  8.                         {
  9.                                 currentHealth=100;
  10.                         }
  11.                         else
  12.                         {
  13.                                 currentHealth-=5;
  14.                         }        
  15.                 }
  16. }
复制代码
发表于 2017-4-16 14:02 | 显示全部楼层
很不错
发表于 2017-4-16 14:20 | 显示全部楼层
好帖就是要顶
发表于 2017-4-16 14:27 | 显示全部楼层
真心顶
发表于 2017-4-16 14:00 | 显示全部楼层
难得一见的好帖
发表于 2017-4-16 14:52 | 显示全部楼层
很好哦
发表于 2017-5-4 10:58 | 显示全部楼层
楼主是超人
发表于 2017-5-4 10:29 | 显示全部楼层
好帖就是要顶
发表于 2017-5-4 10:44 | 显示全部楼层
顶顶多好
发表于 2017-5-4 10:59 | 显示全部楼层
不错不错
懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Unity开发者联盟 ( 粤ICP备20003399号 )

GMT+8, 2024-4-30 11:58 , Processed in 0.784164 second(s), 25 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表