void CmdUltimate() { currentFuriousThrow = Instantiate(furiousThrow).GetComponent <FuriousThrow>(); NetworkServer.Spawn(currentFuriousThrow.gameObject); currentFuriousThrow.caster = this; currentFuriousThrow.transform.position = transform.position + transform.forward * 2.0f + Vector3.up; currentFuriousThrow.transform.rotation = transform.rotation; RpcUltiObjectOnce(currentFuriousThrow.gameObject); }
public IEnumerator IsChannelingUltimate() { animator.SetBool("Ulti", true); float timer = 0.0f; Slow(0.0f, 0.3f, () => { return(timer >= furiousThrowChannelTime); }); if (DataManager.instance.isMulti) { CmdPlaySound(1, 14, 1.0f, 0, 0, 0.0f, 0, false, AudioType.Voice); CmdPlaySound(1, 68, 1.0f, 0, 0, 0.0f, 0, false, AudioType.SFX); } else { SoundCharacter(1, 14, 1.0f, AudioType.Voice); SoundCharacter(1, 68, 1.0f, AudioType.SFX); } isChannelingUltimate = true; isAttacking = true; yield return(new WaitUntil(() => { timer += Time.deltaTime; if (isStunned) { timer = furiousThrowChannelTime; } return timer >= furiousThrowChannelTime; })); if (!isStunned) { if (DataManager.instance.isMulti) { CmdUltimate(); } else { Vector3 tempPosition = transform.position + transform.forward * 2.0f; currentFuriousThrow = Instantiate(furiousThrow, tempPosition + Vector3.up, transform.rotation).GetComponent <FuriousThrow>(); currentFuriousThrow.caster = this; currentFuriousThrow.GetComponentInChildren <SkinnedMeshRenderer>().material.SetColor("_EmissionColor", DataManager.instance.playerColor[colorIndex]); } } isChannelingUltimate = false; isAttacking = false; animator.SetBool("Ulti", isChannelingUltimate); }