private async void brianButton_Clicked(object sender, EventArgs e) { if (counter % 2 == 0) { await Brian.TranslateTo(0, 0, 2000, Easing.Linear); counter++; } else { await Brian.TranslateTo(0, 300, 2000, Easing.Linear); counter++; } }
private void Start() { animationDeathIsFinished = true; exitFromPingPong = false; inPingPong = false; isStart = false; isDead = false; isFinishGame = false; isTeleport = false; isHit = false; playerName = ""; countAlivePlayer = 3; isJump = false; backgroundSpeed = 3; inBodyColider = false; float deltaSpeed = 1f / ((Screen.width / (float)Screen.height) / (1280f / 720f)); speed = 5.2f / deltaSpeed; float a = (float)Screen.width / (float)Screen.height; float k = a / relation; float y = 1000 / k; parentPanel.transform.localScale = new Vector3(1000, y, 0); circle = new GameObject[3]; circle[0] = GameObject.Find("Interface/Brian"); circle[1] = GameObject.Find("Interface/Eva"); circle[2] = GameObject.Find("Interface/Zak"); disableScreen = GameObject.Find("DisableScreen/Block"); setDefault = new SetDefaultValue(SetDefaultValueMessageSystem); fail = new FailPanel(OpenFailPanel); pong = new PingPong(StartPingPong); speedy = new Rizen(RizeSpeed); Brian = hero[0]; Eva = hero[1]; Zak = hero[2]; BrianIDLE = hero[3]; EvaIDLE = hero[4]; ZakIDLE = hero[5]; constraints = Brian.GetComponent <Rigidbody2D>().constraints; if (!hash.ContainsKey(Brian.name)) { hash.Add(Brian.name, 0); } if (!hash.ContainsKey(Eva.name)) { hash.Add(Eva.name, 1); } if (!hash.ContainsKey(Zak.name)) { hash.Add(Zak.name, 2); } int size = 5; storageVoid.InstMemory("void", size, 3); storageVoid[0, 0] = (p) => player = BrianIDLE; storageVoid[0, 1] = (p) => player = EvaIDLE; storageVoid[0, 2] = (p) => player = ZakIDLE; storageVoid[1, 0] = (p) => player = Brian; storageVoid[1, 1] = (p) => player = Eva; storageVoid[1, 2] = (p) => player = Zak; storageVoid[2, 0] = (p) => { circle[0].GetComponent <BoxCollider2D>().enabled = false; activeCircleCollider[0] = false; }; storageVoid[2, 1] = (p) => { circle[1].GetComponent <BoxCollider2D>().enabled = false; activeCircleCollider[1] = false; }; storageVoid[2, 2] = (p) => { circle[2].GetComponent <BoxCollider2D>().enabled = false; activeCircleCollider[2] = false; }; storageVoid[3, 0] = (obj) => { GameObject buf = (GameObject)obj; buf.GetComponent <Animation>().Play("BufBrian"); }; storageVoid[3, 1] = (obj) => { GameObject buf = (GameObject)obj; buf.GetComponent <Animation>().Play("BufEva"); }; storageVoid[3, 2] = (obj) => { GameObject buf = (GameObject)obj; buf.GetComponent <Animation>().Play("BufZak"); }; storageVoid[4, 0] = (p) => { TapToHero.InstantiateSpeed("Brian"); SelectHero(Brian); }; storageVoid[4, 1] = (p) => { TapToHero.InstantiateSpeed("Eva"); SelectHero(Eva); }; storageVoid[4, 2] = (p) => { TapToHero.InstantiateSpeed("Zak"); SelectHero(Zak); }; staticClips = new AudioClip[clips.Length]; for (int i = 0; i < clips.Length; i++) { staticClips[i] = clips[i]; } SetDefaultValueMessageSystem(); audioSource = GetComponent <AudioSource>(); for (int i = 0; i < clips.Length; i++) { listAudio.Add(clips[i]); } playMusic = new PlayMusic(StartPlaySound); ADS.ShowAdMobBanner(); staticDefaultClip = defaultClip; SetupVolume(); }