コード例 #1
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            avatar.ChangeEmote(0);
            onAvatarEmote.Invoke(0);
        }
        if (Input.GetKeyDown(KeyCode.Alpha2))
        {
            avatar.ChangeEmote(1);
            onAvatarEmote.Invoke(1);
        }
        if (Input.GetKeyDown(KeyCode.Alpha3))
        {
            avatar.ChangeEmote(2);
            onAvatarEmote.Invoke(2);
        }
        if (Input.GetKeyDown(KeyCode.Alpha4))
        {
            avatar.ChangeEmote(3);
            onAvatarEmote.Invoke(3);
        }
        if (Input.GetKeyDown(KeyCode.E))
        {
            onAvatarInteract.Invoke();
        }
        sendTimer += Time.deltaTime;

        if (sendTimer >= sendInterval)
        {
            sendTimer = 0f;
            onAvatarMove.Invoke(avatar.transform.position, avatar.transform.rotation);
        }
    }