예제 #1
0
    public void Attack()
    {
        AIShootPacket packet = new AIShootPacket();

        packet.id = localID;

        socket.Emit("ai_attack", JsonUtility.ToJson(packet));
    }
예제 #2
0
    public void OnAttack(SocketIOEvent obj)
    {
        AIShootPacket packet = JsonUtility.FromJson <AIShootPacket>(obj.data);

        if (players.ContainsKey(packet.id))
        {
            players[packet.id].GetComponent <EnemyAI>().shoot();
        }
    }