void newCallTuto(NodeController HostHomme, NodeController HostFemme) { NodeController caller = HostHomme; caller.status = NodeController.Status.calling; NodeController reciever = HostFemme; reciever.status = NodeController.Status.waitingCall; Call call = new Call(true);//true = chrono infini caller.GetComponent <SpriteRenderer>().color = GetColorFromId(call.id); reciever.GetComponent <SpriteRenderer>().color = GetColorFromId(call.id); callsInTransmission.Add(call); caller.call = call; reciever.call = call; call.caller = caller; call.reciever = reciever; caller.DisplayMessageBox(true); call.status = Call.Status.calling; }
private void StartingCall() { /*if(score<10) * timerBeforeNextCall = Random.Range(10,20); * if(score<50) * timerBeforeNextCall = Random.Range(8,14); * else * timerBeforeNextCall = Random.Range(7,10);*/ /*if(score<10) * timerBeforeNextCall = Random.Range(10,20); * if(score<50) * timerBeforeNextCall = Random.Range(7,12); * else * timerBeforeNextCall = Random.Range(5,7);*/ //Balancing Calls timerBeforeNextCall = Call.durationBetweenCall(score); if (availableHosts.Count >= 2 && callsInTransmission.Count < maxCalls) { Debug.Log("Au moins 2 travaillent"); int randomCaller = Random.Range(0, availableHosts.Count); NodeController caller = availableHosts[randomCaller]; availableHosts.Remove(caller); unavailableHosts.Add(caller); caller.status = NodeController.Status.calling; int randomReciever = Random.Range(0, availableHosts.Count); NodeController reciever = availableHosts[randomReciever]; availableHosts.Remove(reciever); unavailableHosts.Add(reciever); reciever.status = NodeController.Status.waitingCall; Debug.Log(caller.name + " is calling " + reciever.name); Call call = new Call(); if (level == 3) { call.node_obligatory = randomNode(); if (call.node_obligatory != null) { call.node_obligatory.GetComponent <SpriteRenderer>().color = GetColorFromId(call.id); call.node_obligatory.call = call; call.node_obligatory.isUsed = false; } } caller.GetComponent <SpriteRenderer>().color = GetColorFromId(call.id); reciever.GetComponent <SpriteRenderer>().color = GetColorFromId(call.id); callsInTransmission.Add(call); caller.call = call; reciever.call = call; call.caller = caller; call.reciever = reciever; caller.DisplayMessageBox(true); call.status = Call.Status.calling; } }