Example #1
0
	public static bool Execute(SetUserHpSpDataUserCmd_S cmd)
	{
		var my = MainRole.Instance;
		if (my != null && cmd.charid == my.Role.ServerInfo.charid)
		{
			MainRole.Instance.gameObject.GetComponent<HpProtocol>().hp = cmd.hp;
            MainRole.Instance.gameObject.GetComponent<HpProtocol>().maxhp = cmd.maxhp;
			MainRole.Instance.SetSp(cmd.sp, cmd.maxsp);
			return true;
		}
		return false;
	}
Example #2
0
	public static void Execute(SetUserHpSpDataUserCmd_S cmd)
	{
		if (MainRole.Execute(cmd))
			return;

		var target = All[cmd.charid];
		if (target == null) 
			return;

		target.gameObject.GetComponent<HpProtocol>().hp = cmd.hp;
        target.gameObject.GetComponent<HpProtocol>().maxhp = cmd.maxhp;
		//target.SetSp(cmd.sp, cmd.maxsp);
	}