unity – How can I play the index only once and if the same index does not play it again?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

Public class PlayConversations: MonoBehaviour
{

ConversationTrigger for static static conversation Trigger;
static instance of static PlayConversations;

private static int oldindex;

empty private Awake ()
{
conversationTrigger = GetComponent();
instance = this;
}

empty static public ConversationToPlay (int index)
{
old index = index;
ConversationTrigger.conversationsToPlay.Add (index);
instance.StartCoroutine (conversationTrigger.PlayConversations ());
ConversationTrigger.conversationsToPlay.RemoveAt (0);
}
}

Within the ConversationToPlay method I want, for example, if the value of the index is 3, the first time I add it and play. Next time to check if it is still the same index 3, do not add it and do not play again. Only if the next index will not be 3.

The same for each index. Add and play only once.

I added an oldindex help variable but I'm not sure if it's okay and how to use it for what I want.

This is the ConversationTrigger script:

using the system;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using UnityEditor;
using UnityEngine;
using UnityEditorInternal;

Public Class Conversation Trigger: MonoBehaviour
{
Public list Conversations = new list();
Public static list conversationsToPlay = new list();

    [HideInInspector]
    public canvas of GameObject;
    [HideInInspector]
    boolense public conversation
    [HideInInspector]
    public static int conversationIndex;

DialogueManager private dialoguemanager;

Private vacuum Home ()
{
conversationIndex = 0;
dialoguemanager = FindObjectOfType();
}

Play IEnumerator public conversations ()
{
conversationEnd = false;
var conversations = conversationsToPlay.ToArray (); // Copy the list
conversationsToPlay.Clear (); // Delete the original list immediately

for (int i = 0; i < conversations.Length; i++) // iterate over the array
        {
            // Now you also don't need to remove items anymore, 
            // since you already cleared the list
            yield return StartCoroutine(PlayConversation(conversations[i]));
        }
    }

    public IEnumerator PlayConversation(int index)
    {
        if (conversations.Count > 0 &&
conversations[index].Dialogues.Count> 0)
{
for (int i = 0; i <conversations[index].Dialogues.Count; i ++)
{
if (dialoguemanager! = null)
{
dialoguemanager.StartDialogue (conversations[index].Dialogos[i]);
}

while (DialogueManager.dialogueEnded == false)
{
zero performance;
}
}

conversationIndex = index;
conversationEnd = true;
canvas.SetActive (false);
Debug.Log ("Conversation Ended");
}
}

Public Empty SaveConversations ()
{
string jsonTransform = JsonHelper.ToJson (conversations.ToArray (), true);
File.WriteAllText (@ "d:  json.txt", jsonTransform);
}

Public Void LoadConversations ()
{
string jsonTransform = File.ReadAllText (@ "d:  json.txt");
conversations.Clear ();
conversations.AddRange (JsonHelper.FromJson(jsonTransform));
}
}

And example of using it:

Private vacuum update ()
{
if (torotate == true)
{
RotateRandom.RandomRotation (navi.transform);
PlayConversations.ConversationToPlay (3);

if (trigger.conversationEnd == true)
{
torotate = false;
}
}
}

In this case, while the conversation is playing, I am also rotating an object. Therefore, the rotation should be in the Update and be called all the time, but the conversation should start playing only once. But since this line is in the Update, it will be called many times: PlayConversations.ConversationToPlay (3);

NestList: How to have a parameter that is changing as a function of the nest index, n?

I have a NestList construction

NestList[STEP[#] &, m0, NT]

where a function that acts on a list is called repeatedly and returns a list, for more details, see here.

Let NT in NestList denote a discrete time, and let's say that I would like to have a parameter that is passed to the STEP function Depending on the discrete time..

In other words, I would like to pass a temperature parameter that is like:

temperature = table[ii/NT,{ii,1,NT}] 

to my STEP function through NestList.

I'm sure there's an easy way to do this, but it seems I can not solve it.

mysql – Why does not the last table use the index to join?

With the help of other members, I get an idea of ‚Äč‚Äčconsultation for my previous problem. But after writing this, the EXPLAIN showing that my last table does not use the index to join but the union ROW is PRIMARY KEYthe table is using EXPLORATION OF COMPLETE TABLE.

Below is that query:

CON cte AS (SELECT MAX (m.id) id
FROM the messages
JOIN messages_thread_user mtu USING (threadId)
WHERE mtu.userId = 1
GROUP BY mtu.threadId
order by identification desc
limit 50 offset 0)
select m1. *, u.userName
of cte
Inner union messages m1 in cte.id = m1.id
internal user of union u in m1.userId = u.userId;

Here is the explanation of the query:

+ ---- + ------------- + ------------ + ------------ + ---- ---- + --------------------------------- + ----------- ----------------- + --------- + --------------------- + ------ + ---------- + -------------------------------- -------------------- +
| id | select_type | table | partitions | type | possible_keywords | key | key_len | ref | rows | filtered | Extra |
+ ---- + ------------- + ------------ + ------------ + ---- ---- + --------------------------------- + ----------- ----------------- + --------- + --------------------- + ------ + ---------- + -------------------------------- -------------------- +
| 1 | PRIMARY |  | NULL | All | NULL | NULL | NULL | NULL | 8 | 100.00 | Using where |
| 1 | PRIMARY | m1 | NULL | eq_ref | PRIMARY, messages_user_userId_fk | PRIMARY | 8 | cte.id | 1 | 100.00 | NULL |
| 1 | PRIMARY | u | NULL | All | PRIMARY | NULL | NULL | NULL | 3 | 50.00 | Using where; Using join buffer (Block nested loop) |
| 2 | DERIVED | mtu | NULL | ref | PRIMARY, messages_thread_user_pk | messages_thread_user_pk | 3 | const | 2 | 100.00 | Using the index; Temporary use; Using filesort |
| 2 | DERIVED | m | NULL | ref | messages_threadId_id_index | messages_threadId_id_index | 3 | to_let.mtu.threadId | 4 | 100.00 | Using the index |
+ ---- + ------------- + ------------ + ------------ + ---- ---- + --------------------------------- + ----------- ----------------- + --------- + --------------------- + ------ + ---------- + -------------------------------- -------------------- +
5 rows together, 1 warning (0.00 sec)

This is a visual explanation:

enter the description of the image here

This is messages structure of the table:

CREATE TABLE & # 39; messages & # 39; (
`id` bigint (20) unsigned NOT NULL AUTO_INCREMENT,
`userId` mediumint (8) unsigned NOT NULL,
`threadId` mediumint (8) unsigned NOT NULL,
`status` tinyint (3) unsigned DEFAULT & # 39; 0 & # 39; COMMENT & # 39; 0-> sent, 1-> deliveryied, 2-> seen & # 39 ;,
`time` datetime DEFAULT CURRENT_TIMESTAMP,
`message` text NOT NULL,
`data_url` varchar (512) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `messages_user_userId_fk` (` userId`),
KEY `messages_threadId_id_index` (` threadId`, `id`),
CONSTRAINT `messages_messages_thread_id_fk` FOREIGN KEY (` threadId`) REFERENCES `messages_thread` (` id`),
CONSTRAINT `messages_user_userId_fk` FOREIGN KEY (` userId`) REFERENCES `user` (` userId`)
) MOTOR = InnoDB AUTO_INCREMENT = 13 CHARSET BY DEFAULT = utf8

This is messages_thread_user structure of the table:

CREATE TABLE `messages_thread_user` (
`threadId` mediumint (8) unsigned NOT NULL,
`userId` mediumint (8) unsigned NOT NULL,
PRIMARY KEY (`threadId`,` userId`),
UNIQUE CODE `messages_thread_user_pk` (` userId`, `threadId`),
CONSTRAINT `message_thread_user_messages_thread_id_fk` FOREIGN KEY (` threadId`) REFERENCES `messages_thread` (` id`),
CONSTRAINT `message_thread_user_user_userId_fk` FOREIGN KEY (` userId`) REFERENCES `user` (` userId`)
) MOTOR = InnoDB DEFAULT CHARSET = utf8

This is user structure of the table:

CREATE TABLE `user` (
`userId` mediumint (8) unsigned NOT NULL AUTO_INCREMENT,
`userName` varchar (31) SET OF CHARACTERS utf8 COLLATE utf8_unicode_ci NOT NULL,
`userNumber` bigint (20) unsigned NOT NULL,
`userPassword` varchar (64) SET OF CHARACTERS utf8 COLLATE utf8_unicode_ci NOT NULL,
`userStatus` tinyint (4) NO NULL DEFAULT & # 39; 0 & # 39 ;,
`userRegIp` varchar (35) SET OF CHARACTERS utf8 COLLATE utf8_unicode_ci NOT NULL,
PRIMARY CODE (`userId`),
KEY `user_userNumber_index` (` userNumber`)
) MOTOR = InnoDB AUTO_INCREMENT = 6 CHARSET BY DEFAULT = utf8

If you see above, explain visual or text that you saw that. user u table you do not use any KEY or INDEX. Why does this happen? is supposed to use INDEX. Please explain the reason.

finder – Elimination of the Spotlight index for a Time Machine unit that no longer exists

Suppose an old Time Machine unit is connected to a new macOS installation and configured as the main backup storage (but a backup of the new position has not been initiated). Spotlight started indexing the old disk, as usual.

How do I erase the indexing data and those related to this disk, if they have been deleted successively (ExFAT) with the Disk Utility?

seo – Will Google index and assign keyword value to content in closed accordion sections?

It depends on you and you do not have to worry about leaving the accordion open or closed.

Let's say that the content is hidden for the user, the accordions use JavaScript to hide or show the content, as long as the javascript is accessible for Googlebot, it will not have any problem with its SEO, since Google can access the Javascript code and understand that you are using to hide the content and you can also analyze or read the hidden content of the source code.

You should check that the robots.txt file on your website is not blocking Google to understand that the hidden content is temporary. To go yourdomain.com/robots.txt and make sure that no folder or file containing the accordion javascript code is blocked as

User agent: *
Do not allow: / folder / accordion / javascript
or
Do not allow: / javascript

sql server – Benefit of an additional index with the key column moved to includes

Say I have an index Foo with:

Keys [A, B, C] and columns included (D, E)

Is there any reason for performance to have an additional index? Pub with:

Keys [A, B] and columns included (C, D, E)

I guess a key is not necessary in the finish it would be treated in the same way as an included column where the

How to block all robots to crawl / index all html pages within my website

How to block all robots from indexing / crawling all the html pages on my website. I can not block the folders because all those html pages are distributed in so many folders. So I just want all robots NOT to index / crawl all the html pages within my website.

index – How to update a column of numerical type to avoid many decimal points-Postgresql

Suppose I have a table with these entries:

    thing: position:

1001.25 ball
Pensil 1001.0625
car 1002.5
watch 1003.0035

And I want to execute a function or query in the whole position column to change the numbers and eliminate the decimal point, but keep the type as a numeric type and keep the same positions (ordering). So I want to see it as the following after the update:

I want the table to look like this after the query: ->

thing: position:

ball 2
pensil 1
car 3
watch 4

so when I order by position asc I still get the correct order but I cleaned the decimal points.

pensil 1
ball 2
car 3
watch 4

What is a good approach to do this in order to update the entire position column?

mongodb – How to apply the index for this selection query in mongo db?

Suppose I have a collection "launch" where the fields are department, userId, launch_status, booster

I want to have

{department: "xxx", userId: "john", launch_status: {$ no: {$ eq:
"LAUNCHED"}, reinforcement: {$ exists: true}}}

How do I apply the index to this query?
A similar query is activated several times in my application, with the NOT and EXISTS condition.
I have applied index in all these columns as

db.launch.createIndex ({department: 1, userId: 1, launch_status: 1,
reinforcement: 1})

Indexing is not working

Mongo DB is reaching its threshold because indexing is not being applied
Please help

Latest binary options Trading Volatility 25 index Digits Under Winning Strategy

Latest binary options Trading Volatility 25 index Digits Under Winning Strategy

Subscribe to our new YouTube channel !!

https://www.youtube.com/channel/UCfD8krMQxi29Z0EUI4AMeTA

Hello merchants, we have launched new strategies on our new channel below.

Video downloaded today July 5, 2019

Carefully read all instructions to follow as indicated in the description of the YouTube video.

follow the free steps here … Click here to register for a free Trading account

OR

use the link in the video description of youtube. Make sure you are watching from the youtube page!

"Read all the steps in the video description on youtube to configure the interface!

how to sign up

interface for commerce,

everything indicated in the description of the video on youtube.

Strategy – (Latest binary options Trading Volatility 25 indexes indexed under the winning strategy)

link – watch the strategy video here –

Subscribe now https://www.youtube.com/channel/UCfD8krMQxi29Z0EUI4AMeTA

Link in the description of the video!

Read this description of the video, simply click on the link in the channel url to subscribe,
Share with friends.

Make sure to subscribe to this channel, we will launch all the next ones
Strategies in the new channels too!

happy trade!

Outdoor