Paint - Capi-Metaverse/Template GitHub Wiki

Table of Contents

Introduction

This package contains two prefabs, one dedicated to single player mode and the other to multiplayer mode.
The general structure of this prefab consists of a canvas panel where you can draw, a camera that must focus on the panel and a small interface to show the user the button to press to start painting.

giftPaint

Features

  • Let users draw in a panel on a Unity Scene.

  • Users can change the brush color and its thickness.

  • Users can upload an image to the canvas to draw on top of it.

How to start

  1. Add the prefab to the scene.

  2. Adjust the Box Collider of the prefab.

  3. Add to your character the player tag.

  4. Add to your camera the main camera tag.

  5. Call in your script SetRunner from PaintZonePhoton if it’s online.

  6. Call in your script SetCurrentPlayer from PaintZonePhoton if it’s online.

  7. Play the scene.

Prefab components

  • Box Collider: This collider is used to specify the zone where the user will be allowed to switch to drawing mode. It can be moved and its dimensions can be modified.

  • Paint Zone && PaintZonePhoton: These are the main script of the component and control all collision zone operation and user input for mode change. The Photon one is specific to multiplayer.

  • RPCPaint: This script works with the Photon RPCs to send draw information to the other users.

  • UploadImage This script uploads an image to the canvas. This script is in progress.

Renderer components

  • Box Collider: This collider is used to specify the zone where the user will be allowed to draw.

  • Draw Lines && Draw Lines Photon: These scripts are in charge of drawing the lines drawn by the user with the cursor.

ColorPicker

  • ColorPicker Script: This script lets you change the color of the brush.

  • ToggleVisibility: This script is in charge of activating and deactivating the color selector.

URL

⚠️ **GitHub.com Fallback** ⚠️