public void Attack() { AIShootPacket packet = new AIShootPacket(); packet.id = localID; socket.Emit("ai_attack", JsonUtility.ToJson(packet)); }
public void OnAttack(SocketIOEvent obj) { AIShootPacket packet = JsonUtility.FromJson <AIShootPacket>(obj.data); if (players.ContainsKey(packet.id)) { players[packet.id].GetComponent <EnemyAI>().shoot(); } }