public override void Tick() { if (!SuccessfulSetup) { return; } if (!counting.Exists("Count")) { return; } Anima.Instance.WriteLine($"Attempting to send network messages"); var message = Anima.Serialize(new KeyValuePair <string, int>("Count", counting.Pool["Count"])); var tasks = outBoundClients.Where(tup => tup.Value > (MaxFailures * -1)).Select(tup => TrySendMessage(tup.Key, message)).ToArray(); Task.WaitAll(tasks); foreach (var task in tasks) { if (task.Result.Item1) { outBoundClients[task.Result.Item2]++; } else { outBoundClients[task.Result.Item2]--; } } }
public Storyboard Shuffle() { if (Vertices[0] is VerticeControl v && v.IsLoaded) { canvas.IsHitTestVisible = false; var tempV = new List <IVertice <int> >(Vertices); var pts = new Point[Vertices.Count]; var r = new Random(); for (int i = 0; i < pts.Length; i++) { var len = tempV.Count; var idx = r.Next() % len; if (idx == i) { i--; continue; } var vc = tempV[idx] as VerticeControl; pts[i] = new Point(vc.CanvasLeft, vc.CanvasTop); tempV.RemoveAt(idx); } var sb = new Storyboard(); for (int i = 0; i < pts.Length; i++) { var vc = Vertices[i] as VerticeControl; sb.Children.Add(Anima.TranslateAnimation(pts[i], vc, Anima.NormalDuration)); } //sb.Completed += (o, e) => { canvas.IsHitTestVisible = true; }; //sb.Begin(); return(sb); } return(null); }
public void getAnimas(string username) { //a list if animas the user owns, or a check if one exists new GameSparks.Api.Requests.LogEventRequest().SetEventKey("getAnimas") .SetEventAttribute("username", username) .Send((response) => { if (!response.HasErrors) { var allAnimas = response.ScriptData.GetGSDataList("collectedAnimas"); Debug.Log(allAnimas.Count + " Animas found for this user."); for (int i = 0; i < allAnimas.Count; i++) { Anima newAni = JsonUtility.FromJson <Anima>(allAnimas[i].JSON); Debug.Log(newAni.animaname); if (!controller.GetComponent <UserInfo>().unlockedAnima.Contains(newAni.animaname)) { controller.GetComponent <UserInfo>().unlockedAnima.Add(newAni.animaname); } } } else { Debug.Log("Could not get animas!"); Debug.Log(response.Errors.ToString()); } }); }
public override void Tick() { Message m; var messageReference = new List <Message>(); var serverPayload = new List <NetMessage>(); while ((m = Anima.Instance.MailBoxes.GetMessage(this)) is not null) { try { messageReference.Add(m); var nm = Anima.Deserialize <NetMessage>(m.Value); //Anima.Instance.WriteLine($"Sending from: {m.Sender}, {Anima.Serialize(nm)}"); serverPayload.Add(nm); } catch (Exception e) { Anima.Instance.ErrorStream.WriteLine($"Could not deserialize a message: {m} {Anima.NewLineChar}because: {e.Message}"); } } var GetRequest = new NetMessage(true); serverPayload.Add(GetRequest); var payload = serverPayload.ToArray(); var serializedPayload = Anima.Serialize(payload); //Anima.Instance.WriteLine($"About to try and send: {serializedPayload}"); var tcpClient = Helper.TryConnectClient(serverAddress, port); //Anima.Instance.WriteLine($"Tried to connect: {tcpClient}"); var t = Helper.TrySendMessage(tcpClient, serializedPayload); //Anima.Instance.WriteLine($"Sent off: {t.Status}"); t.Wait(); //Anima.Instance.WriteLine($"It's done: {t.Status}, {t.Result}"); if (!t.Result.Item1) { Anima.Instance.WriteLine($"Couldn't send messages, saving them for later: {t.Result}, {t.Status}"); //If we couldn't send them, we need to put them back for later foreach (var msg in messageReference) { Anima.Instance.MailBoxes.PostMessage(msg); } return; } var replyReader = new StreamReader(tcpClient.GetStream()); //Anima.Instance.WriteLine($"Waiting for reply: {replyReader}"); var reply = Helper.ReadFromStreamUntilEnd(replyReader); //Anima.Instance.WriteLine($"Got: {reply} in reply"); var messageQueue = Anima.Deserialize <Queue <NetMessage> >(reply); foreach (var message in messageQueue) { var msg = new Message(message.SendPlugin, message.ReceivePlugin, "Remote", message.Value); Anima.Instance.MailBoxes.PostMessage(msg); } tcpClient.Close(); }
// Your block initialization public void BlockInit() { // No point to run this script if is a dedicated server because there's no graphics if (Anima.DedicatedServer) { return; } // Create the main Anima class m_anima = new Anima(); // Initialize Anima if (!m_anima.Init(Entity as MyEntity, "Holographic Radar", "Holo")) { throw new ArgumentException("Anima failed to initialize!"); } // Add parts m_part_1 = m_anima.AddPart(null, @"Radar\Radar_Part1"); m_part_2 = m_anima.AddPart(m_part_1, @"Radar\Radar_Part2"); m_part_3 = m_anima.AddPart(m_part_2, @"Radar\Radar_Part3"); // Assign sequences coreFunctionality(m_part_1); m_part_1.OnComplete = coreFunctionality; // Play sequences m_part_1.Play(Anima.Playback.LOOP); m_part_2.Play(Anima.Playback.LOOP); m_part_3.Play(Anima.Playback.LOOP); // Update each frame, note this may not work for all object's types! Entity.NeedsUpdate |= MyEntityUpdateEnum.EACH_FRAME; }
static void Main(string[] args) { Anima anima = null; var state = new FileInfo("AnimaState.json"); if (state.Exists) { using (var fs = new StreamReader(state.OpenRead())) { var contents = fs.ReadToEnd(); if (!String.IsNullOrWhiteSpace(contents)) { anima = Anima.Deserialize <Anima>(contents); if (anima is null) { Console.WriteLine("Loading failed"); } Console.WriteLine("Loaded in from state file"); } } } else { Console.WriteLine($"Could not find: {state.FullName}"); } anima ??= Anima.Instance; Console.CancelKeyPress += delegate(object sender, ConsoleCancelEventArgs e) { //Save state var newState = Anima.Serialize(anima); //Quick way to remake file fresh state.Delete(); using (var fs = new StreamWriter(state.Create())) { fs.Write(newState); } }; try { anima.Run(); } finally { //Save state var newState = Anima.Serialize(anima); //Quick way to remake file fresh state.Delete(); using (var fs = new StreamWriter(state.Create())) { fs.Write(newState); } } }
public Storyboard ToHoveredAnima() { var sb = new Storyboard(); sb.Children.Add(Anima.ScaleAnimation(TopRatioOrigin, topEllipse, Anima.BlinkDuration)); sb.Children.Add(Anima.ScaleAnimation(MiddleRatioAlternate, middleEllipse, Anima.BlinkDuration)); sb.Children.Add(Anima.ScaleAnimation(BottomRatioOrigin, bottomEllipse, Anima.BlinkDuration)); if (PreviewColor.HasValue) { sb.Children.Add(Anima.ForegroundAnimation(originalColor, this, Anima.BlinkDuration)); } return(sb); }
public Storyboard ToHighlightAnima() { var sb = new Storyboard(); sb.Children.Add(Anima.ScaleAnimation(TopRatioAlternate, topEllipse, Anima.BlinkDuration)); sb.Children.Add(Anima.ScaleAnimation(MiddleRatioOrigin, middleEllipse, Anima.BlinkDuration)); sb.Children.Add(Anima.ScaleAnimation(BottomRatioAlternate, bottomEllipse, Anima.BlinkDuration)); if (PreviewColor != null) { sb.Children.Add(Anima.ForegroundAnimation(PreviewColor.Value, this, Anima.BlinkDuration)); } return(sb); }
public override void attack() { for (int i = 0; i < BuCount; i++) { float R = (Mathf.PI * 2f / BuCount) * i; Vector3 vect = new Vector3(Mathf.Cos(R), Mathf.Sin(R), 0f); var bullet = Instantiate(Bullet, transform.position, Quaternion.identity).GetComponent <FunBullet>(); bullet.Level = Level; bullet.vect = vect; } Anima.SetTrigger("IsAttack"); attackTime = AttackCD; }
public void Navigate(string page) { if (string.IsNullOrEmpty(page)) { mainGrid.Children.Add(MainSection); currentPage = MainSectionKey; return; } if (page == CurrentPage) { return; } switch (page) { case MainSectionKey: // Navigate from GameSetting to MainSection if (CurrentPage == GameSettingSectionKey) { if (!mainGrid.Children.Contains(MainSection)) { mainGrid.Children.Add(MainSection); } var sb = Anima.TransitionRight(mainGrid, GameSettingSection, MainSection); sb.Completed += (o, e) => { mainGrid.Children.Remove(GameSettingSection); }; sb.Begin(); } break; case GameSettingSectionKey: // Navigate from MainSection to GameSetting if (CurrentPage == MainSectionKey) { if (!mainGrid.Children.Contains(GameSettingSection)) { mainGrid.Children.Add(GameSettingSection); } var sb = Anima.TransitionLeft(mainGrid, MainSection, GameSettingSection); sb.Completed += (o, e) => { mainGrid.Children.Remove(MainSection); }; sb.Begin(); } break; } currentPage = page; }
private static void OnHightlightedChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { var edgeControl = sender as EdgeControl; var newValue = (bool)e.NewValue; if (newValue) { var sb = new Storyboard(); sb.Children.Add(Anima.StrokeThicknessAnimation(edgeControl.Size * BottomLineHighlightRatio, edgeControl.bottomLine, Anima.BlinkDuration)); sb.Children.Add(Anima.StrokeThicknessAnimation(edgeControl.Size * TopLineHighlightRatio, edgeControl.topLine, Anima.BlinkDuration)); sb.Begin(); } else { var sb = new Storyboard(); sb.Children.Add(Anima.StrokeThicknessAnimation(edgeControl.Size, edgeControl.bottomLine, Anima.BlinkDuration)); sb.Children.Add(Anima.StrokeThicknessAnimation(edgeControl.Size, edgeControl.topLine, Anima.BlinkDuration)); sb.Begin(); } }
static void Main(string[] args) { Anima gato = new Anima(); gato.SetName("pelota"); gato.Sound = "meow"; Console.WriteLine("O gato se chama {0} e faz {1}", gato.GetName(), gato.Sound); gato.Propietario = "Brunão"; Console.WriteLine("O dono do {0} é o {1}", gato.GetName(), gato.Propietario); Console.WriteLine("O id do {0} é {1}", gato.GetName(), gato.idNum); Anima dog = new Anima(); Console.WriteLine("# numero de animais: {0}", Anima.NumDeAnimais); Console.ReadLine(); }
private void HandleRequests() { while (true) { try { var client = listener.AcceptTcpClient(); var strem = new StreamReader(client.GetStream()); string ReadContents = Helper.ReadFromStreamUntilEnd(strem); var netMessages = Anima.Deserialize <NetMessage[]>(ReadContents); bool AnyGetRequests = netMessages.Any(nm => nm.GetRequest); if (AnyGetRequests) { var host = netMessages.First()?.SendHost; if (host is null) { Anima.Instance.WriteLine($"Unable to get send host name: {netMessages.Length}"); } if (relayBuffer.ContainsKey(netMessages.First().SendHost)) { string Messages = Anima.Serialize(relayBuffer[host]); var t = Helper.TrySendMessage(client, Messages); t.Wait(); if (!t.Result.Item1) { Anima.Instance.ErrorStream.WriteLine("Was unable to send reply"); } else { //Successfully sent reply. Can clear buffer relayBuffer[host].Clear(); } } else { Anima.Instance.WriteLine($"No messages for: {netMessages.First().SendHost}"); } } foreach (var netMessage in netMessages) { if (string.IsNullOrWhiteSpace(netMessage.ReceiveHost)) { continue; } netMessage.GetRequest = false; if (relayBuffer.ContainsKey(netMessage.ReceiveHost) && (relayBuffer[netMessage.ReceiveHost] is not null)) { relayBuffer[netMessage.ReceiveHost].Enqueue(netMessage); } else { relayBuffer.Add(netMessage.ReceiveHost, new Queue <NetMessage>()); relayBuffer[netMessage.ReceiveHost].Enqueue(netMessage); } } client.Close(); } catch (SocketException se) { if (se.SocketErrorCode == SocketError.AddressFamilyNotSupported) { Anima.Instance.ErrorStream.WriteLine(se.Message); } else { Anima.Instance.ErrorStream.WriteLine(se.Message); } } catch (Exception e) { Anima.Instance.ErrorStream.WriteLine(e); } } }
IEnumerator Start() { audioSource = gameObject.GetComponent <AudioSource>(); Hukidashi = GameObject.Find("Image"); Hukidashi.GetComponent <Anima>(); Anima anima = Hukidashi.GetComponent <Anima>(); Hukidashi2 = GameObject.Find("Image2"); Hukidashi2.GetComponent <Anima2>(); Anima2 anima2 = Hukidashi2.GetComponent <Anima2>(); textbox.text = " "; yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); anima2.Dasu(); yield return(new WaitForSeconds(0.1f)); textbox2.text = "あ!リンゴの芽がある!"; audioSource.PlayOneShot(sound01); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); anima2.Kesu(); anima.Dasu(); textbox2.text = " "; yield return(new WaitForSeconds(0.1f)); textbox.text = "そういえばお腹すいちゃったな"; audioSource.PlayOneShot(sound02); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); anima2.Kesu2(); anima.Kesu(); textbox.text = " "; yield return(new WaitForSeconds(0.1f)); textbox2.text = "ねえ試しに色を移してリンゴと 赤を取ってみましょ?"; audioSource.PlayOneShot(sound03); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); textbox2.text = "赤は後で必要になりそうだしね"; audioSource.PlayOneShot(sound04); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); anima2.Kesu(); anima.Kesu2(); textbox2.text = " "; yield return(new WaitForSeconds(0.1f)); textbox.text = "色を移してリンゴなんてできるの?"; audioSource.PlayOneShot(sound05); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); anima2.Kesu2(); anima.Kesu(); textbox.text = " "; yield return(new WaitForSeconds(0.1f)); textbox2.text = "ふふっ私が教えてあげるって 言ったでしょ?"; audioSource.PlayOneShot(sound06); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); Scene(); }
private static Timeline StrokeThicknessAnima(double toValue, TimeSpan duration, DependencyObject target) { return(Anima.StrokeThicknessAnimation(toValue, target, new Duration(duration))); }
IEnumerator Start() { audioSource = gameObject.GetComponent <AudioSource>(); Hukidashi = GameObject.Find("Image"); Hukidashi.GetComponent <Anima>(); Anima anima = Hukidashi.GetComponent <Anima>(); Hukidashi2 = GameObject.Find("Image2"); Hukidashi2.GetComponent <Anima2>(); Anima2 anima2 = Hukidashi2.GetComponent <Anima2>(); textbox.text = " "; yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); anima2.Dasu(); yield return(new WaitForSeconds(0.1f)); textbox2.text = "お~い!ちょっと待って~!"; audioSource.PlayOneShot(sound01); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); textbox2.text = "ちょっとキミ、1人で色を全部戻せると思っているの?"; audioSource.PlayOneShot(sound02); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); anima2.Kesu(); anima.Dasu(); textbox2.text = " "; yield return(new WaitForSeconds(0.1f)); textbox.text = "…あなたは誰?"; audioSource.PlayOneShot(sound03); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); anima2.Kesu2(); anima.Kesu(); textbox.text = " "; yield return(new WaitForSeconds(0.1f)); textbox2.text = "私は魔女だよ。キミに協力してって王様から言われたんだ。 色々教えてあげるよ。"; audioSource.PlayOneShot(sound04); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); anima2.Kesu(); anima.Kesu2(); textbox2.text = " "; yield return(new WaitForSeconds(0.1f)); textbox.text = "そうだったんだ。確かに何も分からないまま出てきちゃったな…。"; audioSource.PlayOneShot(sound05); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); textbox.text = "それじゃ、これからよろしく おねがいします。"; audioSource.PlayOneShot(sound06); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); Scene(); }
IEnumerator Start() { audioSource = gameObject.GetComponent <AudioSource>(); Hukidashi = GameObject.Find("Image"); Hukidashi.GetComponent <Anima>(); Anima anima = Hukidashi.GetComponent <Anima>(); Hukidashi2 = GameObject.Find("Image2"); Hukidashi2.GetComponent <Anima2>(); Anima2 anima2 = Hukidashi2.GetComponent <Anima2>(); Shiro.SetActive(false); textbox.text = " "; yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); //最初にレインが話す場合 anima.Dasu(); yield return(new WaitForSeconds(0.1f)); textbox.text = "あった…"; audioSource.PlayOneShot(sound01); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); //レインから魔女1 anima2.Dasu(); anima.Kesu(); textbox.text = " "; yield return(new WaitForSeconds(0.1f)); textbox2.text = "伝説では聞いていたけれどまさか地下にあるとはね…"; audioSource.PlayOneShot(sound02); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); textbox2.text = "さあその杖を使ってみて"; audioSource.PlayOneShot(sound03); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); //魔女からレインに代わる場合2 anima2.Kesu(); anima.Kesu2(); textbox2.text = " "; yield return(new WaitForSeconds(0.1f)); textbox.text = "あれ…"; audioSource.PlayOneShot(sound04); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); //レインから魔女 anima2.Kesu2(); anima.Kesu(); textbox.text = " "; yield return(new WaitForSeconds(0.1f)); textbox2.text = "ありゃ、やっぱり魔力が足りないか、キミは魔法使いじゃないしね"; audioSource.PlayOneShot(sound05); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); textbox2.text = "私も力を貸すわ。さぁいくよ!"; audioSource.PlayOneShot(sound06); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); anima2.Kesu(); textbox2.text = " "; Shiro.SetActive(true); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); //魔女からレインに代わる場合2 anima.Kesu2(); textbox2.text = " "; yield return(new WaitForSeconds(0.1f)); textbox.text = "魔法使えたんだね"; audioSource.PlayOneShot(sound07); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); //レインから魔女 anima2.Kesu2(); anima.Kesu(); textbox.text = " "; yield return(new WaitForSeconds(0.1f)); textbox2.text = "王様の息子だからって失礼ね魔女だって言ってるじゃない。"; audioSource.PlayOneShot(sound08); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); //魔女からレインに代わる場合2 anima2.Kesu(); anima.Kesu2(); textbox2.text = " "; yield return(new WaitForSeconds(0.1f)); textbox.text = "ふふっ、冗談だよ。"; audioSource.PlayOneShot(sound09); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); textbox.text = "本当にありがとう。あなたが いなかったらもうこの景色は見れなかったと思う"; audioSource.PlayOneShot(sound10); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); //レインから魔女 anima2.Kesu2(); anima.Kesu(); textbox.text = " "; yield return(new WaitForSeconds(0.1f)); textbox2.text = "お褒めの言葉光栄ですわ。 レイン王子。"; audioSource.PlayOneShot(sound11); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); //魔女からレインに代わる場合2 anima2.Kesu(); anima.Kesu2(); textbox2.text = " "; yield return(new WaitForSeconds(0.1f)); textbox.text = "さぁ城に戻ろうか"; audioSource.PlayOneShot(sound12); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); Scene(); }
IEnumerator Start() { audioSource = gameObject.GetComponent <AudioSource>(); Hukidashi = GameObject.Find("Image"); Hukidashi.GetComponent <Anima>(); Anima anima = Hukidashi.GetComponent <Anima>(); Hukidashi2 = GameObject.Find("Image2"); Hukidashi2.GetComponent <Anima2>(); Anima2 anima2 = Hukidashi2.GetComponent <Anima2>(); textbox.text = " "; yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); //最初にレインが話す場合 anima.Dasu(); yield return(new WaitForSeconds(0.1f)); textbox.text = "ここに虹の石が置かれてる 台座があるはずなんだけれど"; audioSource.PlayOneShot(sound01); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); //レインから魔女1 anima2.Dasu(); anima.Kesu(); textbox.text = " "; yield return(new WaitForSeconds(0.1f)); textbox2.text = "うーん…"; audioSource.PlayOneShot(sound02); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); textbox2.text = "爆発でどっかいちゃったかな~?"; audioSource.PlayOneShot(sound03); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); //魔女からレインに代わる場合2 anima2.Kesu(); anima.Kesu2(); textbox2.text = " "; yield return(new WaitForSeconds(0.1f)); textbox.text = "そんな…どうすれば…"; audioSource.PlayOneShot(sound04); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); //レインから魔女 anima2.Kesu2(); anima.Kesu(); textbox.text = " "; yield return(new WaitForSeconds(0.1f)); textbox2.text = "大丈夫よ、方法はあるはず 私も考えるわ"; audioSource.PlayOneShot(sound05); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); Scene(); }
IEnumerator Start() { audioSource = gameObject.GetComponent <AudioSource>(); Hukidashi = GameObject.Find("Image"); Hukidashi.GetComponent <Anima>(); Anima anima = Hukidashi.GetComponent <Anima>(); Hukidashi2 = GameObject.Find("Image2"); Hukidashi2.GetComponent <Anima2>(); Anima2 anima2 = Hukidashi2.GetComponent <Anima2>(); textbox.text = " "; yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); //最初に魔女が話す場合 anima2.Dasu(); yield return(new WaitForSeconds(0.1f)); textbox2.text = "私の思った通り氷をどかせたわね"; audioSource.PlayOneShot(sound01); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); //魔女からレインに代わる場合1 anima2.Kesu(); anima.Dasu(); textbox2.text = " "; yield return(new WaitForSeconds(0.1f)); textbox.text = "これで遺跡にむかえるね"; audioSource.PlayOneShot(sound02); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); //レインから魔女 anima2.Kesu2(); anima.Kesu(); textbox.text = " "; yield return(new WaitForSeconds(0.1f)); textbox2.text = "ええ、さっそく向かいましょ!"; audioSource.PlayOneShot(sound03); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); Scene(); }
void Awake() { instance = this; }
IEnumerator Start() { audioSource = gameObject.GetComponent <AudioSource>(); Hukidashi = GameObject.Find("Image"); Hukidashi.GetComponent <Anima>(); Anima anima = Hukidashi.GetComponent <Anima>(); Hukidashi2 = GameObject.Find("Image2"); Hukidashi2.GetComponent <Anima2>(); Anima2 anima2 = Hukidashi2.GetComponent <Anima2>(); textbox.text = " "; yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); anima2.Dasu(); yield return(new WaitForSeconds(0.1f)); textbox2.text = "おいしい~!"; audioSource.PlayOneShot(sound01); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); anima2.Kesu(); anima.Dasu(); textbox2.text = " "; yield return(new WaitForSeconds(0.1f)); textbox.text = "うん、おいしいね"; audioSource.PlayOneShot(sound02); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); textbox.text = "そういえばなんで魔女は 色があるの?"; audioSource.PlayOneShot(sound03); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); anima2.Kesu2(); anima.Kesu(); textbox.text = " "; yield return(new WaitForSeconds(0.1f)); textbox2.text = "ふふっ、それはね…"; audioSource.PlayOneShot(sound04); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); textbox2.text = "魔女だからよ"; audioSource.PlayOneShot(sound05); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); textbox2.text = "そんなことより先に行きましょ"; audioSource.PlayOneShot(sound06); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); Scene(); }
IEnumerator Start() { audioSource = gameObject.GetComponent <AudioSource>(); Hukidashi = GameObject.Find("Image"); Hukidashi.GetComponent <Anima>(); Anima anima = Hukidashi.GetComponent <Anima>(); Hukidashi2 = GameObject.Find("Image2"); Hukidashi2.GetComponent <Anima2>(); Anima2 anima2 = Hukidashi2.GetComponent <Anima2>(); textbox.text = " "; yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); //最初にレインが話す場合 anima.Dasu(); yield return(new WaitForSeconds(0.1f)); textbox.text = "うっここは寒いね…"; audioSource.PlayOneShot(sound01); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); //レインから魔女1 anima2.Dasu(); anima.Kesu(); textbox.text = " "; yield return(new WaitForSeconds(0.1f)); textbox2.text = "そうね、出来るだけ早くここを 抜けましょ"; audioSource.PlayOneShot(sound02); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); textbox2.text = "おっと…"; audioSource.PlayOneShot(sound03); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); //魔女からレインに代わる場合2 anima2.Kesu(); anima.Kesu2(); textbox2.text = " "; yield return(new WaitForSeconds(0.1f)); textbox.text = "氷の柱が邪魔して 通れないね…"; audioSource.PlayOneShot(sound04); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); //レインから魔女 anima2.Kesu2(); anima.Kesu(); textbox.text = " "; yield return(new WaitForSeconds(0.1f)); textbox2.text = "でも遺跡に向かうにはここを 通るしかないのよね"; audioSource.PlayOneShot(sound05); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); audioSource.Stop(); textbox2.text = "どうにかしてこの柱をどかしましょ"; audioSource.PlayOneShot(sound06); yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Space))); yield return(null); Scene(); }