1
0
forked from cgvr/DeltaVR

181 Commits

Author SHA1 Message Date
1a4e932b1e add archery range and shape detection npc voiceline timelines 2026-02-03 12:45:41 +02:00
3bae534a61 complete animating mouth scale based on amplitude timeline 2026-02-03 12:26:31 +02:00
5a3f566541 WIP animate mouth scale based on precalculated voiceline amplitude timelines 2026-02-02 19:15:31 +02:00
a0d1ee35cd fix FirstPersonOcclusion invalid event handle error 2026-01-29 19:26:16 +02:00
4c6fbb30bc cafe waiter generates model and spawns it on top of plate 2026-01-29 18:47:32 +02:00
e9df211610 cafe waiter NPC goes and brings food after dialogue 2026-01-29 18:12:39 +02:00
ceee57f808 mic stand doesnt show BLANK_AUDIO 2026-01-29 17:40:05 +02:00
61a81d2728 NPC doesnt process player speech when its too soon after last processing 2026-01-29 17:31:59 +02:00
876306a2af improve text recognition reliability, unsubscribe from Whisper events when not wanted anymore 2026-01-28 16:14:27 +02:00
e0d68454c7 cafe waiter npc has states, rotates notepad when spoken to 2026-01-28 15:33:14 +02:00
a8e65514f4 refactor NPCController script, make it abstract, extendable; separate AlienNPC and CafeWaiterNPC 2026-01-28 14:23:16 +02:00
eb8e33bb3d fix voiceline occlusion 2026-01-27 18:44:33 +02:00
af27bb0230 shape scanner improvements: add handle, destroy scannable object on completion, correctly detect when new object is generated 2026-01-27 18:38:20 +02:00
77fc43bebd fix bug with player colliding with spawned model when holding it 2026-01-27 17:50:13 +02:00
15b92e92b4 enable continuous movement by default, move config.json to game folder 2026-01-27 17:25:33 +02:00
24000ec80c add some voicelines to archery range minigame 2026-01-25 16:11:08 +02:00
ec45c402af add sound effects to button, mic stand, model generation, shape scanner 2026-01-25 15:10:42 +02:00
75bd66fc36 add back minigames after merge 2026-01-25 13:11:58 +02:00
19f8efc6a7 Merge remote-tracking branch 'upstream/master' 2026-01-25 12:31:58 +02:00
48b9f12802 make copy of main scene 2026-01-25 12:11:53 +02:00
14c85c83a7 forgot to assign a variable 2026-01-21 19:35:54 +02:00
ca0a7dcc21 fixing merge issue 2026-01-21 19:33:40 +02:00
c620b9000d forgot to build the zip 2026-01-21 19:30:17 +02:00
4ee6dbb92d Final changes 2026-01-21 19:29:02 +02:00
36d6ff6d9b Merging into master 2026-01-21 19:21:36 +02:00
52701f3231 Erased debug element 2026-01-21 19:00:38 +02:00
Timur Nizamov
aeee055e18 voiceover vca and volume slider added to Unity and FMOD 2026-01-21 15:51:17 +02:00
ad6954884b trellis and invokeAI urls configurable in config 2026-01-19 18:55:25 +02:00
4292750b65 update TODO 2026-01-17 08:30:25 +00:00
Timur Nizamov
389707b5f7 added some sound in FMOD 2026-01-16 22:40:02 +02:00
b3073e66df update TODO 2026-01-16 18:33:48 +00:00
afb8af4ee2 unique seed for model generation 2026-01-16 18:35:00 +02:00
16a621c2b9 include gltf shader in build + add TODO list 2026-01-16 18:26:37 +02:00
Timur Nizamov
6def60df98 More voicelines added, PlayDialogue function updated 2026-01-16 17:37:42 +02:00
40cd5060df add TODO list 2026-01-16 17:01:07 +02:00
Timur Nizamov
641fe43472 Voiceline adding logic, fmod asset folder cleaning, fmod tweaks 2026-01-15 22:25:02 +02:00
cb4d4036e7 microphone recording working with FMOD!!! 2026-01-14 18:02:41 +02:00
96839e0e82 ShapeScanner multiple configurations, configurable in editor 2026-01-14 14:02:10 +02:00
33a40c987a generated objects are grabbable and scalable 2026-01-13 19:22:44 +02:00
1cd97e4d0a shape checker nice materials, generated object grabbable 2026-01-13 17:17:59 +02:00
31145f9735 Update README.md 2026-01-13 14:46:41 +00:00
3097c404ba set up shape detection minigame pieces 2026-01-13 16:06:13 +02:00
91275418e4 fixed backwards doors issue 2026-01-11 18:08:49 +02:00
d2ac917db3 implemented shape scanner 2026-01-11 17:48:58 +02:00
85edf6b43f fixed elevator buttons issue 2026-01-11 17:10:44 +02:00
23c89e97ce wire placement improvement 2026-01-11 15:19:45 +02:00
991f7d73b9 more wires to archery range, connecting buttons 2026-01-11 14:47:39 +02:00
a23f40787e added more time logging to python script + switched to using CGVR lab WiFi 2026-01-11 12:34:08 +02:00
997bb457ba archery range glass display tank + wire 2026-01-11 12:04:21 +02:00
Timur Nizamov
e6db72778b Colliders with Probuilder, FMOD Programmer Instrument API code start 2026-01-11 04:14:27 +02:00
ce75a1f343 replaced demo boxes with microphone stand and buttons, in archery range 2026-01-10 17:00:45 +02:00
46b1c7e1de fix FishNetworking problems from merging 2026-01-10 11:53:56 +02:00
e4d61a6648 make sprite NPC look at player 2026-01-06 18:43:59 +02:00
79dcf3bc9b fixed microphone not detecting after merge 2026-01-06 18:12:48 +02:00
Timur Nizamov
27fc11f8b2 A few reverb additions 2026-01-05 16:01:07 +02:00
5074d688f7 fixing problems from merging 2026-01-03 17:23:23 +02:00
a8bec4f5ff Update README.md 2026-01-03 14:50:22 +00:00
bd913ae549 Merge branch 'SamWorkset' 2026-01-03 13:46:54 +02:00
42e7d8c004 make copy of scene 2026-01-03 13:00:19 +02:00
4fa73e5035 logging for audio transcription, etc 2025-12-31 15:26:07 +02:00
fe2f08f7a3 fixed a typo 2025-12-31 15:17:14 +02:00
0c8c55f293 use Whisper in streaming mode 2025-12-31 14:13:25 +02:00
Timur Nizamov
50b043bad5 fixing git 2025-12-27 18:12:45 +02:00
Timur Nizamov
a65562e701 Initial testinf of ReverbRooms and Snapshots, fire alarm logic is improved 2025-12-27 17:59:09 +02:00
13c1e8a0f6 Changes in sound attributions 2025-12-27 12:17:15 +00:00
1a9746bb3c Merge branch 'SamWorkset' of https://cgvrgit.ulno.net/cgvr/DeltaVR into SamWorkset 2025-12-27 13:57:09 +02:00
Timur Nizamov
23e453de77 fire alarm done, but the button will restart it after initial pressing 2025-12-26 19:57:14 +02:00
Timur Nizamov
6a90182014 Added 1 FMOD event 2025-12-23 18:17:29 +02:00
Timur Nizamov
34d102bcf4 Some FMOD events changed 2025-12-23 18:03:10 +02:00
7bc58a48d0 add TrellisClient, use it for model generation 2025-12-22 15:07:23 +02:00
1b3b3db1bf port InvokeAI API client to Unity, use it in ImageGenerationBox 2025-12-22 13:19:28 +02:00
236f0758df make NPC character prefab + fix arrow hit detection 2025-12-22 10:59:07 +02:00
2262609cdd merge upstream 2025-12-22 08:05:55 +00:00
174582e56e fixed wierd hand offset issue, needs testing. 2025-12-22 00:39:36 +02:00
Timur Nizamov
50dba2cd81 Some fixes made, object picking logic added 2025-12-21 00:01:28 +02:00
8b037369b7 add DoTween and use it for animating mouth scaling 2025-12-19 11:36:37 +02:00
39b4a24ef3 add character sprites, mouth moving open closed 2025-12-19 11:00:22 +02:00
f184151fdb invokeAI model key can be set via env var 2025-12-19 10:11:18 +02:00
Timur Nizamov
27d5fdd68c klaviatuur parandatud 2025-12-17 20:04:12 +02:00
b424c6467b Unity pipeline scripts cleanup + enable dev build 2025-12-17 15:46:57 +02:00
409b9fbb51 small cleanup of pipeline script 2025-12-17 15:46:01 +02:00
2c19602e9b refactor image generation script + env vars 2025-12-17 13:23:59 +02:00
24543cce38 Upload files to "Doc/designs" 2025-12-16 13:59:03 +00:00
9af96fed99 Upload files to "Doc/clips" 2025-12-16 13:45:02 +00:00
90781191b7 manage spawned object node hierarchy better 2025-12-16 13:30:08 +02:00
5796887f79 properly replace archery target object's child with generated object 2025-12-16 11:56:56 +02:00
0cb92b2442 use voice transcription box and model gen box in archery range 2025-12-16 11:22:09 +02:00
32a5e4f332 test boxes change colours based on progress 2025-12-16 10:43:58 +02:00
5956b9508d test boxes collide with player in VR mode, too 2025-12-15 16:57:30 +02:00
7be20d249e model generation test box takes input prompt from voice transcription box 2025-12-15 15:57:32 +02:00
9c7536d1d4 transcribe voice to text with Whisper base model 2025-12-15 15:30:15 +02:00
0c026078d0 install whisper.unity package 2025-12-15 13:57:07 +02:00
ac87f2f8ef Update README.md
Just a small reference change
2025-12-07 22:21:10 +00:00
856ff3ca40 Update README.md
Adding myself into credits.
2025-12-07 17:10:52 +00:00
843bd141eb test different art styles, change pipeline prompt 2025-12-05 16:58:07 +02:00
693b3a572e Upload files to "Doc/designs" 2025-12-02 13:37:36 +00:00
8977957054 Upload files to "Doc/clips" 2025-12-02 13:36:51 +00:00
408949e5c2 WIP: spawn generated model as archery range target 2025-12-01 17:19:31 +02:00
40e273f51e refactored model generation code out of test box into separate pipeline manager 2025-12-01 17:06:42 +02:00
a66cb8f62c fix prompt 2025-11-28 15:29:00 +02:00
cc3c481295 try out different text-to-img and img-to-3d params 2025-11-28 15:27:37 +02:00
2980631414 decrease texture baking optimisation total steps 2025-11-21 16:30:56 +02:00
c15ae24c7a tune 3d generation params 2025-11-21 14:39:16 +02:00
7f02dccc6b use SD-XL model for img gen in pipeline 2025-11-21 12:57:53 +02:00
34a6c50598 clean up code + prompt engineering for image generation 2025-11-21 11:39:36 +02:00
191c9e66fe fix metallic property when spawning object 2025-11-21 10:32:15 +02:00
b563be1158 Upload files to "Doc/clips" 2025-11-18 14:08:38 +00:00
616532e69c Upload files to "Doc/clips" 2025-11-18 14:03:31 +00:00
450efe675a Upload files to "Doc/clips" 2025-11-18 14:00:18 +00:00
cce7492556 Upload files to "Doc/designs" 2025-11-17 19:20:02 +00:00
e197206d0a Upload files to "Doc/designs" 2025-11-17 19:07:21 +00:00
dc7aa3b9b9 Upload files to "Doc/designs" 2025-11-17 18:03:37 +00:00
d7fec73c77 added logging to file 2025-11-14 09:53:30 +02:00
590c62eadd incorporate InvokeAI into start_pipeline.py 2025-11-12 17:51:02 +02:00
fdd4ff827e reimplement function from invokeai_mcp_server to make requests to local InvokeAI 2025-11-10 18:19:16 +02:00
d2e1c7b56f fix networking UI again + tweaks to pipeline script 2025-11-07 16:56:34 +02:00
09f764c0df integrate local trellis api into start_pipeline.py 2025-11-07 16:22:13 +02:00
447449e1b3 local TRELLIS API test notebook 2025-11-07 14:54:41 +02:00
d43408cf01 move pipeline starter in map 2025-11-05 18:02:06 +02:00
henrisel
9bfc55f2d6 add glTFast package + load in model after pipeline generation 2025-11-05 17:54:48 +02:00
54d44afcec Upload files to "Doc/designs" 2025-11-04 17:32:58 +00:00
15c2e62e92 Upload files to "Doc/clips" 2025-11-04 17:28:46 +00:00
c4fafd1dd3 Delete Doc/clips/Hand-Collider-Prototype-Clip.gif 2025-11-04 17:26:11 +00:00
1c03f1773b Upload files to "Doc/clips" 2025-11-04 17:25:57 +00:00
Henri Sellis
1b0d9fd0b0 pipeline script passes generated model filepath to Unity 2025-11-02 17:20:41 +02:00
Henri Sellis
f8ca8570af fix network manager (again) 2025-11-02 16:06:36 +02:00
e25f1c75b5 update env example 2025-10-24 13:34:24 +03:00
c5c40f58ab Cube that starts generation pipeline on collision 2025-10-24 12:00:27 +03:00
Henri Sellis
2971027af2 fix start game UI 2025-10-24 10:22:53 +03:00
Henri Sellis
34a23ab94d make 3d model generation model folder loc configurable 2025-10-24 10:03:16 +03:00
Henri Sellis
8b3965d0b1 generated images and models into gitignore 2025-10-24 09:49:24 +03:00
42d7c0059b Add TODO Azure OpenAI API 2025-10-21 14:32:19 +00:00
ef3bc5da39 Upload files to "Doc/designs" 2025-10-21 14:03:55 +00:00
ed66253b06 Upload files to "Doc/clips" 2025-10-21 13:59:00 +00:00
Henri Sellis
6413d5a3d6 start pipeline script dynamically calculates absolute paths 2025-10-20 16:37:02 +03:00
Henri Sellis
e4f9423ca6 passing user prompt to pipeline script as cmd argument 2025-10-19 12:17:34 +03:00
Henri Sellis
1bb878848f combined pipeline running function 2025-10-18 16:44:38 +03:00
Henri Sellis
ae497eac6e test local text-to-image models and cloudflare API 2025-10-18 16:06:54 +03:00
Henri Sellis
2cf0a9f711 start of 3d generation pipelines 2025-10-11 18:37:46 +03:00
6b8c3b6fbb Merge pull request 'SamWorkset' (#5) from SamWorkset into master
Reviewed-on: cgvr/DeltaVR#5
2025-10-11 13:47:30 +00:00
b9448fb4c7 Upload files to "Doc/clips" 2025-10-07 10:30:34 +00:00
4b1d8ea5bd Delete Doc/clips/Player-Collide-Offset-Clip.gif 2025-10-07 10:21:00 +00:00
6a76fa038f Upload files to "Doc/clips" 2025-10-07 10:16:24 +00:00
8af4eff8c7 Upload files to "Doc/clips" 2025-10-03 13:53:59 +00:00
b38461fc52 Delete Doc/clips/Multiplayer-join-Clip.mp4 2025-10-03 13:53:37 +00:00
e5baba75cf Delete Doc/clips/Singleplayer-Join-Clip.mp4 2025-10-03 13:53:28 +00:00
b9515d50d0 Delete Doc/clips/Quit-Clip.mp4 2025-10-03 13:53:20 +00:00
e06b0206c8 Upload files to "Doc/clips" 2025-10-03 13:36:43 +00:00
f5ba95849e Delete Doc/clips/Old menu gif.gif 2025-09-19 12:06:07 +00:00
c5b90be63f Upload files to "Doc/clips" 2025-09-19 12:05:54 +00:00
5a41559b88 Upload files to "Doc/clips"
Added the old menu gif
2025-09-19 11:57:21 +00:00
5ab753f4b5 Merge pull request 'Doing minor changes' (#4) from SamWorkset into master
Reviewed-on: cgvr/DeltaVR#4
2025-09-19 11:51:52 +00:00
dab664b62a Update README.md 2025-09-15 17:57:21 +00:00
9d389a3296 Merge pull request 'SamWorkset' (#3) from SamWorkset into master
Reviewed-on: cgvr/DeltaVR#3
2025-09-15 17:55:36 +00:00
d269226b4b Update README.md 2025-06-18 08:45:31 +00:00
47d505a1ba Update README.md 2025-06-17 16:26:30 +00:00
e7ad8e6fd4 Update Readme 2025-06-17 16:23:35 +00:00
36e3b95645 Replaced clips for readme 2025-06-17 15:29:34 +00:00
b012ae17b2 Added clips for readme 2025-06-11 17:26:54 +00:00
b9ccfb1c3a Update README.md 2025-05-28 10:48:13 +00:00
cdd6a2e96d Update README.md 2025-05-27 15:29:09 +00:00
9af005b651 Merge pull request 'Added options and credits tabs for the in-game UI menu. Credits tab is blank for now. Disabled smooth locomotion to address the player controller confusion issues (see my thesis). Smooth locomotion can be reactivated via the options menu.' (#2) from SamWorkset into master
Reviewed-on: cgvr/DeltaVR#2
2025-05-27 11:20:01 +00:00
e9b013a904 Update README.md 2025-05-27 11:11:04 +00:00
262a67293e Update README.md 2025-05-27 11:10:37 +00:00
ab2406c367 Update README.md 2025-05-22 15:49:08 +00:00
0f409ddb08 Merge pull request 'SamWorkset' (#1) from SamWorkset into master
Reviewed-on: cgvr/DeltaVR#1
2025-05-22 15:43:50 +00:00
4aa139be24 Update README.md 2025-05-22 15:35:10 +00:00
b4c665abe4 Update README.md 2025-05-22 15:32:07 +00:00
jee7
b84e1b7837 Merge branch 'master' of https://cgvrgit.ulno.net/cgvr/DeltaVR 2025-05-20 22:53:54 +03:00
jee7
e9fe4cb559 Added design files 2025-05-20 22:53:35 +03:00
d2673f52e1 Update README.md 2025-05-20 19:40:24 +00:00
e6045f7775 Update README.md 2025-05-20 19:38:43 +00:00
e6ddcc7390 Update README.md 2025-05-20 19:37:40 +00:00
75cfdd7a48 Update README.md 2025-05-20 19:34:22 +00:00
jee7
071c1db4f4 Whiteboard clip fix 2025-05-20 22:14:13 +03:00
jee7
9bd8601edb Added Doc folder. Graphical elements for the Readme.md. 2025-05-20 21:58:13 +03:00
Ranno Samuel Adson
ee0b46f451 messed up the lightmap 2024-12-27 16:49:57 +02:00
Ranno Samuel Adson
2bf7f50802 worked on ground moddelling. Doing a quicksave before doing a large model alteration. 2024-12-27 16:23:50 +02:00
Ranno Samuel Adson
e9404b9b51 worked on ground moddelling. Doing a quicksave before doing a large model alteration. 2024-12-27 16:23:25 +02:00
Ranno Samuel Adson
28819a12a6 worked on ground moddelling. Doing a quicksave before altering materials. 2024-12-27 15:24:51 +02:00
Ranno Samuel Adson
7f4c83d397 making changes to lighting. This is a backup just in case 2024-12-27 14:11:36 +02:00
839 changed files with 45377 additions and 8877 deletions

View File

@@ -0,0 +1,6 @@
INVOKEAI_URL=
INVOKEAI_MODEL_KEY=
TRELLIS_URL=
CLOUDFLARE_ACCOUNT_ID=
CLOUDFLARE_API_TOKEN=

7
3d-generation-pipeline/.gitignore vendored Normal file
View File

@@ -0,0 +1,7 @@
.venv
.env
__pycache__
images/
models/
logs/
notebooks/test_resources/

View File

@@ -0,0 +1,24 @@
### TODO
* user flow: grab item? mida krabada - Raimond ise parandas, mergeda vaja
* võtta spawnitud mudeli mõõtmed: meshcollideri max x, max y, etc? bounding box? ja kontrollida spawnimisel scale'i
* shape scanner:
* peenikesemad kiired
* mitte lihtsalt ontriggerenter ja -exit, sest kui mitu objekti lähevad samal ajal sisse
* mustad kiired on halvasti nähtavad pruuni materjali taustal
* archery range:
* kui midagi laeb (wire aktiivne), siis particle'id võiks voolata mööda toru
* highscore json tühjaks
* quest marker järjest järgmise tegevuse kohal: mikrofon, siis nupud
* character billboard:
* tulnukale korraliku resolutsiooniga suu / silm liikuma
* klaas on näha temast eespool
* pööramine kaamera poole - sujuvalt (slerp)
Can't/Won't Do:
* glTF loading: vahetada ära shader Universal render pipelin Lit, mitte panna buildi kaasa glTf oma - **ei saa, objekt on siis ilma tekstuurita, lihtsalt hall**
* user prefs: settinguid meelde jätta - **juba sain continuous movementi sisse lülitada by default, rohkem pole vaja**
### Notes
* TRELLIS: added functionality to specify texture baking optimisation total steps as an argument (`texture_opt_total_steps`), to replace the hardcoded 2500. But this is not tracked in Git (because modified this https://github.com/IgorAherne/trellis-stable-projectorz/releases/tag/latest)
* Custom Shader Variant Collection to include glTF-pbrMetallicRoughness shader in build

View File

@@ -0,0 +1,61 @@
import base64
import requests
import os
from dotenv import load_dotenv
load_dotenv()
ACCOUNT_ID = os.environ["CLOUDFLARE_ACCOUNT_ID"]
API_TOKEN = os.environ["CLOUDFLARE_API_TOKEN"]
def text_to_image_cloudflare(prompt, output_path):
MODEL = "@cf/black-forest-labs/flux-1-schnell"
URL = f"https://api.cloudflare.com/client/v4/accounts/{ACCOUNT_ID}/ai/run/{MODEL}"
payload = {
"prompt": prompt,
}
headers = {
"Authorization": f"Bearer {API_TOKEN}",
"Content-Type": "application/json",
}
resp = requests.post(URL, json=payload, headers=headers, timeout=60)
resp.raise_for_status()
data = resp.json()
b64 = data["result"]["image"]
if not b64:
raise RuntimeError(f"Unexpected response structure: {data}")
img_bytes = base64.b64decode(b64)
with open(output_path, "wb") as f:
f.write(img_bytes)
return True
def refine_text_prompt(prompt):
MODEL = "@cf/meta/llama-3.2-3b-instruct"
URL = f"https://api.cloudflare.com/client/v4/accounts/{ACCOUNT_ID}/ai/run/{MODEL}"
instructions = """
User is talking about some object. Your task is to generate a short and concise description of it. Use only user's own words, keep it as short as possible.
Example:
User: 'Umm, okay, I would like a really cool sword, with for example a bright orange crossguard. And also it should be slightly curved.'
You: 'a slightly curved sword with bright orange crossguard'
"""
response = requests.post(URL,
headers={"Authorization": f"Bearer {API_TOKEN}"},
json={
"messages": [
{"role": "system", "content": instructions},
{"role": "user", "content": prompt}
]
}
)
data = response.json()
return data["result"]["response"]

View File

@@ -0,0 +1,501 @@
# Based on: https://github.com/coinstax/invokeai-mcp-server
import requests
import asyncio
import json
import logging
import httpx
import os
import time
from typing import Optional
from urllib.parse import urljoin
from dotenv import load_dotenv
# Configure logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger("invokeai-mcp")
load_dotenv()
INVOKEAI_BASE_URL = os.environ["INVOKEAI_URL"]
INVOKEAI_MODEL_KEY = os.environ["INVOKEAI_MODEL_KEY"]
DEFAULT_QUEUE_ID = "default"
# HTTP client
http_client: Optional[httpx.AsyncClient] = None
def get_client() -> httpx.AsyncClient:
"""Get or create HTTP client."""
global http_client
if http_client is None:
http_client = httpx.AsyncClient(base_url=INVOKEAI_BASE_URL, timeout=120.0)
return http_client
async def list_models(model_type: str = "main") -> list:
"""List available models."""
client = get_client()
response = await client.get("/api/v2/models/", params={"model_type": model_type})
response.raise_for_status()
data = response.json()
return data.get("models", [])
async def get_model_info(model_key: str) -> Optional[dict]:
"""Get information about a specific model."""
client = get_client()
try:
response = await client.get(f"/api/v2/models/i/{model_key}")
response.raise_for_status()
model_data = response.json()
# Ensure we have a valid dictionary
if not isinstance(model_data, dict):
logger.error(f"Model info for {model_key} is not a dictionary: {type(model_data)}")
return None
return model_data
except Exception as e:
logger.error(f"Error fetching model info for {model_key}: {e}")
return None
def download_file(url, filepath):
response = requests.get(url)
if response.status_code == 200:
with open(filepath, "wb") as file:
file.write(response.content)
else:
raise RuntimeError(f"Failed to download image. Status code: {response.status_code}")
async def get_image_url(image_name: str) -> str:
"""Get the URL for an image."""
client = get_client()
response = await client.get(f"/api/v1/images/i/{image_name}/urls")
response.raise_for_status()
data = response.json()
return data.get("image_url", "")
async def wait_for_completion(batch_id: str, queue_id: str = DEFAULT_QUEUE_ID, timeout: int = 300) -> dict:
"""Wait for a batch to complete and return the most recent image."""
client = get_client()
start_time = asyncio.get_event_loop().time()
while True:
# Check if we've exceeded timeout
if asyncio.get_event_loop().time() - start_time > timeout:
raise TimeoutError(f"Image generation timed out after {timeout} seconds")
# Get batch status
response = await client.get(f"/api/v1/queue/{queue_id}/b/{batch_id}/status")
response.raise_for_status()
status_data = response.json()
# Check for failures
failed_count = status_data.get("failed", 0)
if failed_count > 0:
# Try to get error details from the queue
queue_status_response = await client.get(f"/api/v1/queue/{queue_id}/status")
queue_status_response.raise_for_status()
queue_data = queue_status_response.json()
raise RuntimeError(
f"Image generation failed. Batch {batch_id} has {failed_count} failed item(s). "
f"Queue status: {json.dumps(queue_data, indent=2)}"
)
# Check completion
completed = status_data.get("completed", 0)
total = status_data.get("total", 0)
if completed == total and total > 0:
# Get most recent non-intermediate image
images_response = await client.get("/api/v1/images/?is_intermediate=false&limit=10")
images_response.raise_for_status()
images_data = images_response.json()
# Return the most recent image (first in the list)
if images_data.get("items"):
return {
"batch_id": batch_id,
"status": "completed",
"result": {
"outputs": {
"save_image": {
"type": "image_output",
"image": {
"image_name": images_data["items"][0]["image_name"]
}
}
}
}
}
# If no images found, return status
return status_data
# Wait before checking again
await asyncio.sleep(1)
async def enqueue_graph(graph: dict, queue_id: str = DEFAULT_QUEUE_ID) -> dict:
"""Enqueue a graph for processing."""
client = get_client()
batch = {
"batch": {
"graph": graph,
"runs": 1,
"data": None
}
}
response = await client.post(
f"/api/v1/queue/{queue_id}/enqueue_batch",
json=batch
)
response.raise_for_status()
return response.json()
async def create_text2img_graph(
prompt: str,
negative_prompt: str = "",
model_key: Optional[str] = None,
lora_key: Optional[str] = None,
lora_weight: float = 1.0,
vae_key: Optional[str] = None,
width: int = 512,
height: int = 512,
steps: int = 30,
cfg_scale: float = 7.5,
scheduler: str = "euler",
seed: Optional[int] = None
) -> dict:
"""Create a text-to-image generation graph with optional LoRA and VAE support."""
# Use default model if not specified
if model_key is None:
# Try to find an sd-1 model
models = await list_models("main")
for model in models:
if model.get("base") == "sd-1":
model_key = model["key"]
break
if model_key is None:
raise ValueError("No suitable model found")
# Get model information
model_info = await get_model_info(model_key)
if not model_info:
raise ValueError(f"Model {model_key} not found")
# Validate model info has required fields
if not isinstance(model_info, dict):
raise ValueError(f"Model {model_key} returned invalid data type: {type(model_info)}")
required_fields = ["key", "hash", "name", "base", "type"]
for field in required_fields:
if field not in model_info or model_info[field] is None:
raise ValueError(f"Model {model_key} is missing required field: {field}")
# Generate random seed if not provided
if seed is None:
import random
seed = random.randint(0, 2**32 - 1)
# Detect if this is an SDXL model
is_sdxl = model_info["base"] == "sdxl"
# Build nodes dictionary
nodes = {
# Main model loader - use sdxl_model_loader for SDXL models
"model_loader": {
"type": "sdxl_model_loader" if is_sdxl else "main_model_loader",
"id": "model_loader",
"model": {
"key": model_info["key"],
"hash": model_info["hash"],
"name": model_info["name"],
"base": model_info["base"],
"type": model_info["type"]
}
},
# Positive prompt encoding - use sdxl_compel_prompt for SDXL
"positive_prompt": {
"type": "sdxl_compel_prompt" if is_sdxl else "compel",
"id": "positive_prompt",
"prompt": prompt,
**({"style": prompt} if is_sdxl else {})
},
# Negative prompt encoding - use sdxl_compel_prompt for SDXL
"negative_prompt": {
"type": "sdxl_compel_prompt" if is_sdxl else "compel",
"id": "negative_prompt",
"prompt": negative_prompt,
**({"style": ""} if is_sdxl else {})
},
# Noise generation
"noise": {
"type": "noise",
"id": "noise",
"seed": seed,
"width": width,
"height": height,
"use_cpu": False
},
# Denoise latents (main generation step)
"denoise": {
"type": "denoise_latents",
"id": "denoise",
"steps": steps,
"cfg_scale": cfg_scale,
"scheduler": scheduler,
"denoising_start": 0,
"denoising_end": 1
},
# Convert latents to image
"latents_to_image": {
"type": "l2i",
"id": "latents_to_image"
},
# Save image
"save_image": {
"type": "save_image",
"id": "save_image",
"is_intermediate": False
}
}
# Add LoRA loader if requested
if lora_key is not None:
lora_info = await get_model_info(lora_key)
if not lora_info:
raise ValueError(f"LoRA model {lora_key} not found")
# Validate LoRA info has required fields
required_fields = ["key", "hash", "name", "base", "type"]
for field in required_fields:
if field not in lora_info or lora_info[field] is None:
raise ValueError(f"LoRA model {lora_key} is missing required field: {field}")
nodes["lora_loader"] = {
"type": "lora_loader",
"id": "lora_loader",
"lora": {
"key": lora_info["key"],
"hash": lora_info["hash"],
"name": lora_info["name"],
"base": lora_info["base"],
"type": lora_info["type"]
},
"weight": lora_weight
}
# Add VAE loader if requested (to override model's built-in VAE)
if vae_key is not None:
vae_info = await get_model_info(vae_key)
if not vae_info:
raise ValueError(f"VAE model {vae_key} not found")
# Validate VAE info has required fields
required_fields = ["key", "hash", "name", "base", "type"]
for field in required_fields:
if field not in vae_info or vae_info[field] is None:
raise ValueError(f"VAE model {vae_key} is missing required field: {field}")
nodes["vae_loader"] = {
"type": "vae_loader",
"id": "vae_loader",
"vae_model": {
"key": vae_info["key"],
"hash": vae_info["hash"],
"name": vae_info["name"],
"base": vae_info["base"],
"type": vae_info["type"]
}
}
# Build edges
edges = []
# Determine source for UNet and CLIP (model_loader or lora_loader)
unet_source = "lora_loader" if lora_key is not None else "model_loader"
clip_source = "lora_loader" if lora_key is not None else "model_loader"
# Determine source for VAE (vae_loader if specified, otherwise model_loader)
vae_source = "vae_loader" if vae_key is not None else "model_loader"
# If using LoRA, connect model_loader to lora_loader first
if lora_key is not None:
edges.extend([
{
"source": {"node_id": "model_loader", "field": "unet"},
"destination": {"node_id": "lora_loader", "field": "unet"}
},
{
"source": {"node_id": "model_loader", "field": "clip"},
"destination": {"node_id": "lora_loader", "field": "clip"}
}
])
# Note: lora_loader doesn't have a clip2 field, so for SDXL we route clip2 directly from model_loader
# Connect UNet and CLIP to downstream nodes
edges.extend([
# Connect UNet to denoise
{
"source": {"node_id": unet_source, "field": "unet"},
"destination": {"node_id": "denoise", "field": "unet"}
},
# Connect CLIP to prompts
{
"source": {"node_id": clip_source, "field": "clip"},
"destination": {"node_id": "positive_prompt", "field": "clip"}
},
{
"source": {"node_id": clip_source, "field": "clip"},
"destination": {"node_id": "negative_prompt", "field": "clip"}
},
])
# For SDXL models, also connect clip2
# Note: clip2 always comes from model_loader, even when using LoRA (lora_loader doesn't support clip2)
if is_sdxl:
edges.extend([
{
"source": {"node_id": "model_loader", "field": "clip2"},
"destination": {"node_id": "positive_prompt", "field": "clip2"}
},
{
"source": {"node_id": "model_loader", "field": "clip2"},
"destination": {"node_id": "negative_prompt", "field": "clip2"}
},
])
edges.extend([
# Connect prompts to denoise
{
"source": {"node_id": "positive_prompt", "field": "conditioning"},
"destination": {"node_id": "denoise", "field": "positive_conditioning"}
},
{
"source": {"node_id": "negative_prompt", "field": "conditioning"},
"destination": {"node_id": "denoise", "field": "negative_conditioning"}
},
# Connect noise to denoise
{
"source": {"node_id": "noise", "field": "noise"},
"destination": {"node_id": "denoise", "field": "noise"}
},
# Connect denoise to latents_to_image
{
"source": {"node_id": "denoise", "field": "latents"},
"destination": {"node_id": "latents_to_image", "field": "latents"}
},
{
"source": {"node_id": vae_source, "field": "vae"},
"destination": {"node_id": "latents_to_image", "field": "vae"}
},
# Connect latents_to_image to save_image
{
"source": {"node_id": "latents_to_image", "field": "image"},
"destination": {"node_id": "save_image", "field": "image"}
}
])
graph = {
"id": "text2img_graph",
"nodes": nodes,
"edges": edges
}
return graph
async def generate_image(arguments: dict):
# Extract parameters
prompt = arguments["prompt"]
negative_prompt = arguments.get("negative_prompt", "")
width = arguments.get("width", 512)
height = arguments.get("height", 512)
steps = arguments.get("steps", 30)
cfg_scale = arguments.get("cfg_scale", 7.5)
scheduler = arguments.get("scheduler", "euler")
seed = arguments.get("seed")
model_key = arguments.get("model_key")
lora_key = arguments.get("lora_key")
lora_weight = arguments.get("lora_weight", 1.0)
vae_key = arguments.get("vae_key")
print(f"Generating image with prompt: {prompt[:50]}...")
# Create graph
graph = await create_text2img_graph(
prompt=prompt,
negative_prompt=negative_prompt,
model_key=model_key,
lora_key=lora_key,
lora_weight=lora_weight,
vae_key=vae_key,
width=width,
height=height,
steps=steps,
cfg_scale=cfg_scale,
scheduler=scheduler,
seed=seed
)
# Enqueue and wait for completion
result = await enqueue_graph(graph)
batch_id = result["batch"]["batch_id"]
print(f"Enqueued batch {batch_id}, waiting for completion...")
completed = await wait_for_completion(batch_id)
# Extract image name from result
if "result" in completed and "outputs" in completed["result"]:
outputs = completed["result"]["outputs"]
# Find the image output
for node_id, output in outputs.items():
if output.get("type") == "image_output":
image_name = output["image"]["image_name"]
image_url = await get_image_url(image_name)
return urljoin(INVOKEAI_BASE_URL, image_url)
raise RuntimeError("Failed to generate image!")
async def text_to_image_invoke_ai(prompt, output_path):
# see available model keys via GET http://INVOKEAI_BASE_URL:9090/api/v2/models/?model_type=main
args = {
"prompt": prompt,
"width": 512,
"height": 512,
"model_key": INVOKEAI_MODEL_KEY
}
image_url = await generate_image(args)
print("Downloading image from", image_url)
time_start = time.time()
download_file(image_url, output_path)
download_time = time.time() - time_start
print(f"Image downloaded in {round(download_time, 1)} seconds")

View File

@@ -0,0 +1,77 @@
import os
import time
import requests
import base64
from dotenv import load_dotenv
load_dotenv()
API_URL = os.environ["TRELLIS_URL"]
def generate_no_preview(image_base64: str):
"""Generate 3D model from a single base64-encoded image without previews.
Args:
image_base64: Base64 string of the image (without 'data:image/...' prefix)
"""
try:
# Set generation parameters
params = {
'image_base64': image_base64,
'seed': 42,
'ss_guidance_strength': 7.5,
'ss_sampling_steps': 10,
'slat_guidance_strength': 7.5,
'slat_sampling_steps': 10,
'mesh_simplify_ratio': 0.99,
'texture_size': 1024,
#'texture_baking_mode': 'opt',
'texture_opt_total_steps': 1000,
'output_format': 'glb'
}
# Start generation
print("Generating model...")
response = requests.post(f"{API_URL}/generate_no_preview", data=params)
response.raise_for_status()
# Poll status until complete
while True:
status = requests.get(f"{API_URL}/status").json()
print(f"Progress: {status['progress']}%")
if status['status'] == 'COMPLETE':
break
elif status['status'] == 'FAILED':
raise Exception(f"Generation failed: {status['message']}")
time.sleep(1)
# Download the model
print("Downloading model...")
time_start = time.time()
response = requests.get(f"{API_URL}/download/model")
response.raise_for_status()
time_download = time.time() - time_start
print(f"Model downloaded in {round(time_download, 1)} seconds")
return response.content
except Exception as e:
print(f"Error: {str(e)}")
return None
def image_to_3d_trellis(image_path, output_path):
with open(image_path, 'rb') as image_file:
image_data = image_file.read()
base64_encoded = base64.b64encode(image_data).decode('utf-8')
model_binary = generate_no_preview(base64_encoded)
output_file = f"{output_path}.glb"
with open(output_file, 'wb') as f:
f.write(model_binary)
return output_file

View File

@@ -0,0 +1,52 @@
import os
import librosa
import numpy as np
# === CONFIG ===
FRAME_DURATION = 0.02 # 20 ms windows
GAIN = 1.0 # multiply RMS values (set to e.g. 30.0 if you want larger values)
EXTENSION = ".txt" # output file extension
def process_wav(filepath):
print(f"Processing: {filepath}")
# Load audio
audio, sr = librosa.load(filepath, mono=True)
# Frame size in samples
frame_len = int(FRAME_DURATION * sr)
hop_len = frame_len
# Compute RMS
rms = librosa.feature.rms(
y=audio,
frame_length=frame_len,
hop_length=hop_len
)[0]
# Apply optional gain
rms = rms * GAIN
# Save to .txt
out_path = os.path.splitext(filepath)[0] + EXTENSION
np.savetxt(out_path, rms, fmt="%.8f")
print(f"Saved RMS → {out_path}")
def process_folder(folder_path):
print(f"Scanning folder: {folder_path}")
for filename in os.listdir(folder_path):
if filename.lower().endswith(".wav"):
filepath = os.path.join(folder_path, filename)
process_wav(filepath)
print("Done!")
# === Run script ===
if __name__ == "__main__":
folder = input("Enter folder path: ").strip()
process_folder(folder)

View File

@@ -0,0 +1,49 @@
3.170447962475009263e-05
2.923115389421582222e-04
2.510738931596279144e-02
1.111792679876089096e-02
6.692767888307571411e-02
1.006313711404800415e-01
7.780694961547851562e-02
5.686730891466140747e-02
5.614304915070533752e-02
4.554714635014533997e-02
4.514135792851448059e-02
5.479728057980537415e-02
4.272024706006050110e-02
3.989587724208831787e-02
4.298635944724082947e-02
4.074911773204803467e-02
2.244980260729789734e-02
1.105279754847288132e-02
1.347438804805278778e-02
1.654553040862083435e-02
1.846965588629245758e-02
2.045047841966152191e-02
1.407719496637582779e-02
6.578906439244747162e-03
1.353173051029443741e-02
1.625132374465465546e-02
5.863697826862335205e-02
1.110599413514137268e-01
9.950184077024459839e-02
1.184522062540054321e-01
1.000181213021278381e-01
6.772108376026153564e-02
7.621638476848602295e-02
3.018615581095218658e-02
9.624224901199340820e-02
1.259753555059432983e-01
1.276500672101974487e-01
1.206035763025283813e-01
1.011835709214210510e-01
6.155343726277351379e-02
3.734333068132400513e-02
2.485111355781555176e-02
2.122259326279163361e-02
1.139380130916833878e-02
7.472451310604810715e-03
5.807624198496341705e-03
1.960268709808588028e-03
8.761089411564171314e-04
3.071058890782296658e-04

View File

@@ -0,0 +1,153 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "1dc6faae",
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"import base64\n",
"import requests\n",
"from dotenv import load_dotenv"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "b3107275",
"metadata": {},
"outputs": [],
"source": [
"load_dotenv()\n",
"\n",
"ACCOUNT_ID = os.environ[\"CLOUDFLARE_ACCOUNT_ID\"]\n",
"API_TOKEN = os.environ[\"CLOUDFLARE_API_TOKEN\"]"
]
},
{
"cell_type": "markdown",
"id": "999adf95",
"metadata": {},
"source": [
"## Text to image"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "40b35163",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Saved: test_resources/resolution_test_1.jpg (315728 bytes)\n"
]
}
],
"source": [
"# https://developers.cloudflare.com/workers-ai/models/flux-1-schnell/\n",
"\n",
"MODEL = \"@cf/black-forest-labs/flux-1-schnell\"\n",
"URL = f\"https://api.cloudflare.com/client/v4/accounts/{ACCOUNT_ID}/ai/run/{MODEL}\"\n",
"\n",
"payload = {\n",
" \"prompt\": \"cyborg crocodile, realistic style, single object, front and side fully visible, plain neutral background, clear details, soft studio lighting, true-to-scale\",\n",
"}\n",
"\n",
"headers = {\n",
" \"Authorization\": f\"Bearer {API_TOKEN}\",\n",
" \"Content-Type\": \"application/json\",\n",
"}\n",
"\n",
"resp = requests.post(URL, json=payload, headers=headers, timeout=60)\n",
"resp.raise_for_status()\n",
"\n",
"data = resp.json()\n",
"b64 = data[\"result\"][\"image\"]\n",
"if not b64:\n",
" raise RuntimeError(f\"Unexpected response structure: {data}\")\n",
"\n",
"img_bytes = base64.b64decode(b64)\n",
"\n",
"out_path = \"test_resources/resolution_test_1.jpg\"\n",
"with open(out_path, \"wb\") as f:\n",
" f.write(img_bytes)\n",
"\n",
"print(f\"Saved: {out_path} ({len(img_bytes)} bytes)\")"
]
},
{
"cell_type": "markdown",
"id": "14a874c4",
"metadata": {},
"source": [
"## Text prompt refinement"
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "485f6f46",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\"dark wooden battleaxe with bronze blade\"\n"
]
}
],
"source": [
"MODEL = \"@cf/meta/llama-3.2-3b-instruct\"\n",
"URL = f\"https://api.cloudflare.com/client/v4/accounts/{ACCOUNT_ID}/ai/run/{MODEL}\"\n",
"\n",
"instructions = \"\"\"\n",
"User is talking about some object. Your task is to generate a short and concise description of it. Use only user's own words, keep it as short as possible.\n",
"Example:\n",
"User: 'Umm, okay, I would like a really cool sword, with for example a bright orange crossguard. And also it should be slightly curved.'\n",
"You: 'a slightly curved sword with bright orange crossguard'\n",
"\"\"\"\n",
"prompt = \"Umm, alright, can you please give me an epic battleaxe? It should have a dark wooden shaft and bronze blade.\"\n",
"\n",
"response = requests.post(URL,\n",
" headers={\"Authorization\": f\"Bearer {API_TOKEN}\"},\n",
" json={\n",
" \"messages\": [\n",
" {\"role\": \"system\", \"content\": instructions},\n",
" {\"role\": \"user\", \"content\": prompt}\n",
" ]\n",
" }\n",
")\n",
"data = response.json()\n",
"result_text = data[\"result\"][\"response\"]\n",
"print(result_text)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.11"
}
},
"nbformat": 4,
"nbformat_minor": 5
}

View File

@@ -0,0 +1,122 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "50e24baa",
"metadata": {},
"outputs": [],
"source": [
"from invokeai_mcp_server import create_text2img_graph, enqueue_graph, wait_for_completion, get_image_url\n",
"from urllib.parse import urljoin\n",
"\n",
"import asyncio"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0407cd9a",
"metadata": {},
"outputs": [],
"source": [
"INVOKEAI_BASE_URL = \"http://127.0.0.1:9090\"\n",
"\n",
"\n",
"async def generate_image(arguments: dict):\n",
"\n",
" # Extract parameters\n",
" prompt = arguments[\"prompt\"]\n",
" negative_prompt = arguments.get(\"negative_prompt\", \"\")\n",
" width = arguments.get(\"width\", 512)\n",
" height = arguments.get(\"height\", 512)\n",
" steps = arguments.get(\"steps\", 30)\n",
" cfg_scale = arguments.get(\"cfg_scale\", 7.5)\n",
" scheduler = arguments.get(\"scheduler\", \"euler\")\n",
" seed = arguments.get(\"seed\")\n",
" model_key = arguments.get(\"model_key\")\n",
" lora_key = arguments.get(\"lora_key\")\n",
" lora_weight = arguments.get(\"lora_weight\", 1.0)\n",
" vae_key = arguments.get(\"vae_key\")\n",
"\n",
" #logger.info(f\"Generating image with prompt: {prompt[:50]}...\")\n",
"\n",
" # Create graph\n",
" graph = await create_text2img_graph(\n",
" prompt=prompt,\n",
" negative_prompt=negative_prompt,\n",
" model_key=model_key,\n",
" lora_key=lora_key,\n",
" lora_weight=lora_weight,\n",
" vae_key=vae_key,\n",
" width=width,\n",
" height=height,\n",
" steps=steps,\n",
" cfg_scale=cfg_scale,\n",
" scheduler=scheduler,\n",
" seed=seed\n",
" )\n",
"\n",
" # Enqueue and wait for completion\n",
" result = await enqueue_graph(graph)\n",
" batch_id = result[\"batch\"][\"batch_id\"]\n",
"\n",
" #logger.info(f\"Enqueued batch {batch_id}, waiting for completion...\")\n",
"\n",
" completed = await wait_for_completion(batch_id)\n",
"\n",
" # Extract image name from result\n",
" if \"result\" in completed and \"outputs\" in completed[\"result\"]:\n",
" outputs = completed[\"result\"][\"outputs\"]\n",
" # Find the image output\n",
" for node_id, output in outputs.items():\n",
" if output.get(\"type\") == \"image_output\":\n",
" image_name = output[\"image\"][\"image_name\"]\n",
" image_url = await get_image_url(image_name)\n",
"\n",
" text=f\"Image generated successfully!\\n\\nImage Name: {image_name}\\nImage URL: {image_url}\\n\\nYou can view the image at: {urljoin(INVOKEAI_BASE_URL, f'/api/v1/images/i/{image_name}/full')}\"\n",
" print(text)\n",
"\n",
" # Fallback if we couldn't find image output\n",
" #text=f\"Image generation completed but output format was unexpected. Batch ID: {batch_id}\\n\\nResult: {json.dumps(completed, indent=2)}\""
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6cf9d879",
"metadata": {},
"outputs": [],
"source": [
"async def main():\n",
" args = {\n",
" \"prompt\": \"a golden katana with a fancy pommel\"\n",
" }\n",
" await generate_image(args)\n",
"\n",
"asyncio.run(main())"
]
}
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.11"
}
},
"nbformat": 4,
"nbformat_minor": 5
}

View File

@@ -0,0 +1,152 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "d55eb3ce",
"metadata": {},
"outputs": [],
"source": [
"import requests\n",
"import base64\n",
"import time"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "77b23cd8",
"metadata": {},
"outputs": [],
"source": [
"# API endpoint\n",
"BASE_URL = \"http://127.0.0.1:7960\"\n",
"\n",
"def generate_no_preview(image_base64: str):\n",
" \"\"\"Generate 3D model from a single base64-encoded image without previews.\n",
" \n",
" Args:\n",
" image_base64: Base64 string of the image (without 'data:image/...' prefix)\n",
" \"\"\"\n",
" try:\n",
" # Set generation parameters\n",
" params = {\n",
" 'image_base64': image_base64,\n",
" 'seed': 42,\n",
" 'ss_guidance_strength': 7.5,\n",
" 'ss_sampling_steps': 30,\n",
" 'slat_guidance_strength': 7.5,\n",
" 'slat_sampling_steps': 30,\n",
" 'mesh_simplify_ratio': 0.95,\n",
" 'texture_size': 1024,\n",
" 'output_format': 'glb'\n",
" }\n",
" \n",
" # Start generation\n",
" print(\"Starting generation...\")\n",
" response = requests.post(f\"{BASE_URL}/generate_no_preview\", data=params)\n",
" print(\"Response status:\", response.status_code)\n",
" response.raise_for_status()\n",
" \n",
" # Poll status until complete\n",
" while True:\n",
" status = requests.get(f\"{BASE_URL}/status\").json()\n",
" print(f\"Progress: {status['progress']}%\")\n",
" \n",
" if status['status'] == 'COMPLETE':\n",
" break\n",
" elif status['status'] == 'FAILED':\n",
" raise Exception(f\"Generation failed: {status['message']}\")\n",
" \n",
" time.sleep(1)\n",
" \n",
" # Download the model\n",
" print(\"Downloading model...\")\n",
" response = requests.get(f\"{BASE_URL}/download/model\")\n",
" response.raise_for_status()\n",
" print(\"Model downloaded.\")\n",
" \n",
" return response.content\n",
" \n",
" except Exception as e:\n",
" print(f\"Error: {str(e)}\")\n",
" return None"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "eb122295",
"metadata": {},
"outputs": [],
"source": [
"def generate_model(image_path, output_path):\n",
" with open(image_path, 'rb') as image_file:\n",
" image_data = image_file.read()\n",
"\n",
" base64_encoded = base64.b64encode(image_data).decode('utf-8')\n",
" model = generate_no_preview(base64_encoded)\n",
" \n",
" with open(output_path, 'wb') as f:\n",
" f.write(model)\n",
" print(f\"Model saved to {output_path}\")\n"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "2ce7dfdf",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Starting generation...\n",
"Response status: 200\n",
"Progress: 100%\n",
"Downloading model...\n",
"Model downloaded.\n",
"Model saved to test_resources/style_test_3_model.glb\n"
]
}
],
"source": [
"\n",
"image_path = 'test_resources/style_test_3.jpg'\n",
"output_path = \"test_resources/style_test_3_model.glb\"\n",
"\n",
"generate_model(image_path, output_path)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a1224d13",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.11"
}
},
"nbformat": 4,
"nbformat_minor": 5
}

View File

@@ -0,0 +1,165 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "4826c91d",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'2025-10-18-16-35-47'"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from datetime import datetime\n",
"\n",
"datetime.now().strftime(\"%Y-%m-%d-%H-%M-%S\")"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "9419e692",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"STDOUT:\n",
" Device used: cuda\n",
"After Remesh 9998 19996\n",
"\n",
"STDERR:\n",
" D:\\users\\henrisel\\stable-fast-3d\\.venv\\lib\\site-packages\\timm\\models\\layers\\__init__.py:48: FutureWarning: Importing from timm.models.layers is deprecated, please import via timm.layers\n",
" warnings.warn(f\"Importing from {__name__} is deprecated, please import via timm.layers\", FutureWarning)\n",
"\n",
" 0%| | 0/1 [00:00<?, ?it/s]\n",
" 0%| | 0/1 [00:00<?, ?it/s]\n",
"Traceback (most recent call last):\n",
" File \"D:\\users\\henrisel\\stable-fast-3d\\run.py\", line 122, in <module>\n",
" mesh, glob_dict = model.run_image(\n",
" File \"D:\\users\\henrisel\\stable-fast-3d\\sf3d\\system.py\", line 286, in run_image\n",
" meshes, global_dict = self.generate_mesh(\n",
" File \"D:\\users\\henrisel\\stable-fast-3d\\sf3d\\system.py\", line 369, in generate_mesh\n",
" rast = self.baker.rasterize(\n",
" File \"D:\\users\\henrisel\\stable-fast-3d\\.venv\\lib\\site-packages\\texture_baker\\baker.py\", line 28, in rasterize\n",
" return torch.ops.texture_baker_cpp.rasterize(\n",
" File \"D:\\users\\henrisel\\stable-fast-3d\\.venv\\lib\\site-packages\\torch\\_ops.py\", line 1243, in __call__\n",
" return self._op(*args, **kwargs)\n",
"NotImplementedError: Could not run 'texture_baker_cpp::rasterize' with arguments from the 'CUDA' backend. This could be because the operator doesn't exist for this backend, or was omitted during the selective/custom build process (if using custom build). If you are a Facebook employee using PyTorch on mobile, please visit https://fburl.com/ptmfixes for possible resolutions. 'texture_baker_cpp::rasterize' is only available for these backends: [CPU, Meta, BackendSelect, Python, FuncTorchDynamicLayerBackMode, Functionalize, Named, Conjugate, Negative, ZeroTensor, ADInplaceOrView, AutogradOther, AutogradCPU, AutogradCUDA, AutogradXLA, AutogradMPS, AutogradXPU, AutogradHPU, AutogradLazy, AutogradMTIA, AutogradMAIA, AutogradMeta, Tracer, AutocastCPU, AutocastMTIA, AutocastMAIA, AutocastXPU, AutocastMPS, AutocastCUDA, FuncTorchBatched, BatchedNestedTensor, FuncTorchVmapMode, Batched, VmapMode, FuncTorchGradWrapper, PythonTLSSnapshot, FuncTorchDynamicLayerFrontMode, PreDispatch, PythonDispatcher].\n",
"\n",
"CPU: registered at texture_baker\\csrc\\baker.cpp:543 [kernel]\n",
"Meta: registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\core\\MetaFallbackKernel.cpp:23 [backend fallback]\n",
"BackendSelect: fallthrough registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\core\\BackendSelectFallbackKernel.cpp:3 [backend fallback]\n",
"Python: registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\core\\PythonFallbackKernel.cpp:194 [backend fallback]\n",
"FuncTorchDynamicLayerBackMode: registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\functorch\\DynamicLayer.cpp:479 [backend fallback]\n",
"Functionalize: registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\FunctionalizeFallbackKernel.cpp:375 [backend fallback]\n",
"Named: registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\core\\NamedRegistrations.cpp:7 [backend fallback]\n",
"Conjugate: registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\ConjugateFallback.cpp:17 [backend fallback]\n",
"Negative: registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\native\\NegateFallback.cpp:18 [backend fallback]\n",
"ZeroTensor: registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\ZeroTensorFallback.cpp:86 [backend fallback]\n",
"ADInplaceOrView: fallthrough registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\core\\VariableFallbackKernel.cpp:104 [backend fallback]\n",
"AutogradOther: registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\core\\VariableFallbackKernel.cpp:63 [backend fallback]\n",
"AutogradCPU: registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\core\\VariableFallbackKernel.cpp:67 [backend fallback]\n",
"AutogradCUDA: registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\core\\VariableFallbackKernel.cpp:75 [backend fallback]\n",
"AutogradXLA: registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\core\\VariableFallbackKernel.cpp:87 [backend fallback]\n",
"AutogradMPS: registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\core\\VariableFallbackKernel.cpp:95 [backend fallback]\n",
"AutogradXPU: registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\core\\VariableFallbackKernel.cpp:71 [backend fallback]\n",
"AutogradHPU: registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\core\\VariableFallbackKernel.cpp:108 [backend fallback]\n",
"AutogradLazy: registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\core\\VariableFallbackKernel.cpp:91 [backend fallback]\n",
"AutogradMTIA: registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\core\\VariableFallbackKernel.cpp:79 [backend fallback]\n",
"AutogradMAIA: registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\core\\VariableFallbackKernel.cpp:83 [backend fallback]\n",
"AutogradMeta: registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\core\\VariableFallbackKernel.cpp:99 [backend fallback]\n",
"Tracer: registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\torch\\csrc\\autograd\\TraceTypeManual.cpp:294 [backend fallback]\n",
"AutocastCPU: fallthrough registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\autocast_mode.cpp:322 [backend fallback]\n",
"AutocastMTIA: fallthrough registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\autocast_mode.cpp:466 [backend fallback]\n",
"AutocastMAIA: fallthrough registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\autocast_mode.cpp:504 [backend fallback]\n",
"AutocastXPU: fallthrough registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\autocast_mode.cpp:542 [backend fallback]\n",
"AutocastMPS: fallthrough registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\autocast_mode.cpp:209 [backend fallback]\n",
"AutocastCUDA: fallthrough registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\autocast_mode.cpp:165 [backend fallback]\n",
"FuncTorchBatched: registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\functorch\\LegacyBatchingRegistrations.cpp:731 [backend fallback]\n",
"BatchedNestedTensor: registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\functorch\\LegacyBatchingRegistrations.cpp:758 [backend fallback]\n",
"FuncTorchVmapMode: fallthrough registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\functorch\\VmapModeRegistrations.cpp:27 [backend fallback]\n",
"Batched: registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\LegacyBatchingRegistrations.cpp:1075 [backend fallback]\n",
"VmapMode: fallthrough registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\VmapModeRegistrations.cpp:33 [backend fallback]\n",
"FuncTorchGradWrapper: registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\functorch\\TensorWrapper.cpp:210 [backend fallback]\n",
"PythonTLSSnapshot: registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\core\\PythonFallbackKernel.cpp:202 [backend fallback]\n",
"FuncTorchDynamicLayerFrontMode: registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\functorch\\DynamicLayer.cpp:475 [backend fallback]\n",
"PreDispatch: registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\core\\PythonFallbackKernel.cpp:206 [backend fallback]\n",
"PythonDispatcher: registered at C:\\actions-runner\\_work\\pytorch\\pytorch\\pytorch\\aten\\src\\ATen\\core\\PythonFallbackKernel.cpp:198 [backend fallback]\n",
"\n",
"\n",
"Return Code: 1\n"
]
}
],
"source": [
"import subprocess\n",
"\n",
"MODEL_FOLDER = r\"D:\\users\\henrisel\\stable-fast-3d\"\n",
"PROJECT_FOLDER = r\"D:\\users\\henrisel\\DeltaVR3DModelGeneration\\3d-generation-pipeline\"\n",
"\n",
"# Path to the Python interpreter in the other virtual environment\n",
"venv_python = MODEL_FOLDER + r\"\\.venv\\Scripts\\python.exe\"\n",
"\n",
"# Path to the .py file you want to run\n",
"script_path = MODEL_FOLDER + r\"\\run.py\"\n",
"\n",
"# Optional: arguments to pass to the script\n",
"args = [MODEL_FOLDER + r\"\\demo_files\\examples\\chair1.png\", \"--output-dir\", PROJECT_FOLDER + r\"\\images\"]\n",
"\n",
"# Build the command\n",
"command = [venv_python, script_path] + args\n",
"\n",
"try:\n",
" # Run the subprocess\n",
" result = subprocess.run(command, capture_output=True, text=True)\n",
"\n",
" # Print output and errors\n",
" print(\"STDOUT:\\n\", result.stdout)\n",
" print(\"STDERR:\\n\", result.stderr)\n",
" print(\"Return Code:\", result.returncode)\n",
"\n",
"except Exception as e:\n",
" print(f\"Error occurred: {e}\")\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ee480ba6",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.0"
}
},
"nbformat": 4,
"nbformat_minor": 5
}

View File

@@ -0,0 +1,7 @@
#torch==2.8.0+cu129 https://pytorch.org/get-started/previous-versions/
transformers==4.57.0
git+https://github.com/huggingface/diffusers.git
accelerate==1.10.1
huggingface_hub[hf_xet]==1.1.10
sentencepiece==0.2.1
protobuf==6.32.1

View File

@@ -0,0 +1,60 @@
import argparse
import asyncio
import logging
import time
from pathlib import Path
from datetime import datetime
from dotenv import load_dotenv
from generate_image_local import text_to_image_invoke_ai
from generate_model_local import image_to_3d_trellis
load_dotenv()
def get_timestamp():
return datetime.now().strftime("%Y-%m-%d-%H-%M-%S")
def setup_logger(base_folder, timestamp):
log_dir = base_folder / Path("logs")
log_dir.mkdir(parents=True, exist_ok=True)
logging.basicConfig(
filename=log_dir / f"{timestamp}.log",
level=logging.INFO,
force=True
)
async def main():
parser = argparse.ArgumentParser(description="Text to 3D model pipeline")
parser.add_argument("--prompt", type=str, required=True, help="User text prompt")
args = parser.parse_args()
input_prompt = args.prompt
print(f"Input prompt: {input_prompt}")
image_generation_prompt = input_prompt + ", single object, front and side fully visible, realistic style, plain neutral background, clear details, soft studio lighting, true-to-scale"
pipeline_folder = Path(__file__).resolve().parent
timestamp = get_timestamp()
setup_logger(pipeline_folder, timestamp)
time_checkpoint = time.time()
image_path = pipeline_folder / "images" / f"{timestamp}.jpg"
await text_to_image_invoke_ai(image_generation_prompt, image_path)
image_generation_time = time.time() - time_checkpoint
time_checkpoint = time.time()
logging.info(f"Image generation time: {round(image_generation_time, 1)} s")
print(f"Generated image file: {image_path}")
model_path = pipeline_folder / "models" / timestamp
model_file = image_to_3d_trellis(image_path, model_path)
model_generation_time = time.time() - time_checkpoint
logging.info(f"Model generation time: {round(model_generation_time, 1)} s")
print(f"Generated 3D model file: {model_file}")
if __name__ == "__main__":
asyncio.run(main())

8
Assets/DOTween.meta Normal file
View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 66ebf073af91d5d499f9caa84e8d2b26
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

3107
Assets/DOTween/DOTween.XML Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 8c2b80b45dcee1949bdce20ee5996721
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/DOTween/DOTween.dll LFS Normal file

Binary file not shown.

View File

@@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: b15602494c0418a40bd3c1bcc37276af
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5582eb58dc5efba4bb7d5c01e7e4fa61
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,144 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>DOTweenEditor</name>
</assembly>
<members>
<member name="T:DG.DOTweenEditor.EditorCompatibilityUtils">
<summary>
Contains compatibility methods taken from DemiEditor (for when DOTween is without it)
</summary>
</member>
<member name="M:DG.DOTweenEditor.EditorCompatibilityUtils.FindObjectOfType``1(System.Boolean)">
<summary>
Warning: some versions of this method don't have the includeInactive parameter so it won't be taken into account
</summary>
</member>
<member name="M:DG.DOTweenEditor.EditorCompatibilityUtils.FindObjectOfType(System.Type,System.Boolean)">
<summary>
Warning: some versions of this method don't have the includeInactive parameter so it won't be taken into account
</summary>
</member>
<member name="M:DG.DOTweenEditor.EditorCompatibilityUtils.FindObjectsOfType``1(System.Boolean)">
<summary>
Warning: some versions of this method don't have the includeInactive parameter so it won't be taken into account
</summary>
</member>
<member name="M:DG.DOTweenEditor.EditorCompatibilityUtils.FindObjectsOfType(System.Type,System.Boolean)">
<summary>
Warning: some versions of this method don't have the includeInactive parameter so it won't be taken into account
</summary>
</member>
<member name="M:DG.DOTweenEditor.DOTweenEditorPreview.Start(System.Action)">
<summary>
Starts the update loop of tween in the editor. Has no effect during playMode.
</summary>
<param name="onPreviewUpdated">Eventual callback to call after every update</param>
</member>
<member name="M:DG.DOTweenEditor.DOTweenEditorPreview.Stop(System.Boolean,System.Boolean)">
<summary>
Stops the update loop and clears the onPreviewUpdated callback.
</summary>
<param name="resetTweenTargets">If TRUE also resets the tweened objects to their original state.
Note that this works by calling Rewind on all tweens, so it will work correctly
only if you have a single tween type per object and it wasn't killed</param>
<param name="clearTweens">If TRUE also kills any cached tween</param>
</member>
<member name="M:DG.DOTweenEditor.DOTweenEditorPreview.PrepareTweenForPreview(DG.Tweening.Tween,System.Boolean,System.Boolean,System.Boolean)">
<summary>
Readies the tween for editor preview by setting its UpdateType to Manual plus eventual extra settings.
</summary>
<param name="t">The tween to ready</param>
<param name="clearCallbacks">If TRUE (recommended) removes all callbacks (OnComplete/Rewind/etc)</param>
<param name="preventAutoKill">If TRUE prevents the tween from being auto-killed at completion</param>
<param name="andPlay">If TRUE starts playing the tween immediately</param>
</member>
<member name="F:DG.DOTweenEditor.EditorVersion.Version">
<summary>Full major version + first minor version (ex: 2018.1f)</summary>
</member>
<member name="F:DG.DOTweenEditor.EditorVersion.MajorVersion">
<summary>Major version</summary>
</member>
<member name="F:DG.DOTweenEditor.EditorVersion.MinorVersion">
<summary>First minor version (ex: in 2018.1 it would be 1)</summary>
</member>
<member name="M:DG.DOTweenEditor.EditorUtils.SetEditorTexture(UnityEngine.Texture2D,UnityEngine.FilterMode,System.Int32)">
<summary>
Checks that the given editor texture use the correct import settings,
and applies them if they're incorrect.
</summary>
</member>
<member name="M:DG.DOTweenEditor.EditorUtils.DOTweenSetupRequired">
<summary>
Returns TRUE if setup is required
</summary>
</member>
<member name="M:DG.DOTweenEditor.EditorUtils.AssetExists(System.String)">
<summary>
Returns TRUE if the file/directory at the given path exists.
</summary>
<param name="adbPath">Path, relative to Unity's project folder</param>
<returns></returns>
</member>
<member name="M:DG.DOTweenEditor.EditorUtils.ADBPathToFullPath(System.String)">
<summary>
Converts the given project-relative path to a full path,
with backward (\) slashes).
</summary>
</member>
<member name="M:DG.DOTweenEditor.EditorUtils.FullPathToADBPath(System.String)">
<summary>
Converts the given full path to a path usable with AssetDatabase methods
(relative to Unity's project folder, and with the correct Unity forward (/) slashes).
</summary>
</member>
<member name="M:DG.DOTweenEditor.EditorUtils.ConnectToSourceAsset``1(System.String,System.Boolean)">
<summary>
Connects to a <see cref="T:UnityEngine.ScriptableObject"/> asset.
If the asset already exists at the given path, loads it and returns it.
Otherwise, either returns NULL or automatically creates it before loading and returning it
(depending on the given parameters).
</summary>
<typeparam name="T">Asset type</typeparam>
<param name="adbFilePath">File path (relative to Unity's project folder)</param>
<param name="createIfMissing">If TRUE and the requested asset doesn't exist, forces its creation</param>
</member>
<member name="M:DG.DOTweenEditor.EditorUtils.GetAssemblyFilePath(System.Reflection.Assembly)">
<summary>
Full path for the given loaded assembly, assembly file included
</summary>
</member>
<member name="M:DG.DOTweenEditor.EditorUtils.AddGlobalDefine(System.String)">
<summary>
Adds the given global define if it's not already present
</summary>
</member>
<member name="M:DG.DOTweenEditor.EditorUtils.RemoveGlobalDefine(System.String)">
<summary>
Removes the given global define if it's present
</summary>
</member>
<member name="M:DG.DOTweenEditor.EditorUtils.HasGlobalDefine(System.String,System.Nullable{UnityEditor.BuildTargetGroup})">
<summary>
Returns TRUE if the given global define is present in all the <see cref="T:UnityEditor.BuildTargetGroup"/>
or only in the given <see cref="T:UnityEditor.BuildTargetGroup"/>, depending on passed parameters.<para/>
</summary>
<param name="id"></param>
<param name="buildTargetGroup"><see cref="T:UnityEditor.BuildTargetGroup"/>to use. Leave NULL to check in all of them.</param>
</member>
<member name="T:DG.DOTweenEditor.DOTweenDefines">
<summary>
Not used as menu item anymore, but as a utility function
</summary>
</member>
<member name="F:DG.DOTweenEditor.UnityEditorVersion.Version">
<summary>Full major version + first minor version (ex: 2018.1f)</summary>
</member>
<member name="F:DG.DOTweenEditor.UnityEditorVersion.MajorVersion">
<summary>Major version</summary>
</member>
<member name="F:DG.DOTweenEditor.UnityEditorVersion.MinorVersion">
<summary>First minor version (ex: in 2018.1 it would be 1)</summary>
</member>
</members>
</doc>

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 31782b3953dc990468d4e8b6c1017400
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: beebd8d31e343b9448dd7b28b4aeb523
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 71c839e23e9ed784c8cede7c3b86a315
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,148 @@
fileFormatVersion: 2
guid: 390e1c3ea4bc5a44f8627597321e5431
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Windows Store Apps
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,148 @@
fileFormatVersion: 2
guid: e2137267062d94a449f62c97fcfcd110
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Windows Store Apps
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,148 @@
fileFormatVersion: 2
guid: 9c1b97cb1d363e848abf408bc0df12e7
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 2
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 256
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Windows Store Apps
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,148 @@
fileFormatVersion: 2
guid: 5ffd4a4cfbad93d479b2d6cbe55d354b
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Windows Store Apps
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,148 @@
fileFormatVersion: 2
guid: f65a320597fa974419397f6cc500a188
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 2
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 512
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Windows Store Apps
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0a781078dc1ef2e4c82d5a005b52df6f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,198 @@
// Author: Daniele Giardini - http://www.demigiant.com
// Created: 2018/07/13
#if true // MODULE_MARKER
using System;
using DG.Tweening.Core;
using DG.Tweening.Plugins.Options;
using UnityEngine;
using UnityEngine.Audio; // Required for AudioMixer
#pragma warning disable 1591
namespace DG.Tweening
{
public static class DOTweenModuleAudio
{
#region Shortcuts
#region Audio
/// <summary>Tweens an AudioSource's volume to the given value.
/// Also stores the AudioSource as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach (0 to 1)</param><param name="duration">The duration of the tween</param>
public static TweenerCore<float, float, FloatOptions> DOFade(this AudioSource target, float endValue, float duration)
{
if (endValue < 0) endValue = 0;
else if (endValue > 1) endValue = 1;
TweenerCore<float, float, FloatOptions> t = DOTween.To(() => target.volume, x => target.volume = x, endValue, duration);
t.SetTarget(target);
return t;
}
/// <summary>Tweens an AudioSource's pitch to the given value.
/// Also stores the AudioSource as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
public static TweenerCore<float, float, FloatOptions> DOPitch(this AudioSource target, float endValue, float duration)
{
TweenerCore<float, float, FloatOptions> t = DOTween.To(() => target.pitch, x => target.pitch = x, endValue, duration);
t.SetTarget(target);
return t;
}
#endregion
#region AudioMixer
/// <summary>Tweens an AudioMixer's exposed float to the given value.
/// Also stores the AudioMixer as the tween's target so it can be used for filtered operations.
/// Note that you need to manually expose a float in an AudioMixerGroup in order to be able to tween it from an AudioMixer.</summary>
/// <param name="floatName">Name given to the exposed float to set</param>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
public static TweenerCore<float, float, FloatOptions> DOSetFloat(this AudioMixer target, string floatName, float endValue, float duration)
{
TweenerCore<float, float, FloatOptions> t = DOTween.To(()=> {
float currVal;
target.GetFloat(floatName, out currVal);
return currVal;
}, x=> target.SetFloat(floatName, x), endValue, duration);
t.SetTarget(target);
return t;
}
#region Operation Shortcuts
/// <summary>
/// Completes all tweens that have this target as a reference
/// (meaning tweens that were started from this target, or that had this target added as an Id)
/// and returns the total number of tweens completed
/// (meaning the tweens that don't have infinite loops and were not already complete)
/// </summary>
/// <param name="withCallbacks">For Sequences only: if TRUE also internal Sequence callbacks will be fired,
/// otherwise they will be ignored</param>
public static int DOComplete(this AudioMixer target, bool withCallbacks = false)
{
return DOTween.Complete(target, withCallbacks);
}
/// <summary>
/// Kills all tweens that have this target as a reference
/// (meaning tweens that were started from this target, or that had this target added as an Id)
/// and returns the total number of tweens killed.
/// </summary>
/// <param name="complete">If TRUE completes the tween before killing it</param>
public static int DOKill(this AudioMixer target, bool complete = false)
{
return DOTween.Kill(target, complete);
}
/// <summary>
/// Flips the direction (backwards if it was going forward or viceversa) of all tweens that have this target as a reference
/// (meaning tweens that were started from this target, or that had this target added as an Id)
/// and returns the total number of tweens flipped.
/// </summary>
public static int DOFlip(this AudioMixer target)
{
return DOTween.Flip(target);
}
/// <summary>
/// Sends to the given position all tweens that have this target as a reference
/// (meaning tweens that were started from this target, or that had this target added as an Id)
/// and returns the total number of tweens involved.
/// </summary>
/// <param name="to">Time position to reach
/// (if higher than the whole tween duration the tween will simply reach its end)</param>
/// <param name="andPlay">If TRUE will play the tween after reaching the given position, otherwise it will pause it</param>
public static int DOGoto(this AudioMixer target, float to, bool andPlay = false)
{
return DOTween.Goto(target, to, andPlay);
}
/// <summary>
/// Pauses all tweens that have this target as a reference
/// (meaning tweens that were started from this target, or that had this target added as an Id)
/// and returns the total number of tweens paused.
/// </summary>
public static int DOPause(this AudioMixer target)
{
return DOTween.Pause(target);
}
/// <summary>
/// Plays all tweens that have this target as a reference
/// (meaning tweens that were started from this target, or that had this target added as an Id)
/// and returns the total number of tweens played.
/// </summary>
public static int DOPlay(this AudioMixer target)
{
return DOTween.Play(target);
}
/// <summary>
/// Plays backwards all tweens that have this target as a reference
/// (meaning tweens that were started from this target, or that had this target added as an Id)
/// and returns the total number of tweens played.
/// </summary>
public static int DOPlayBackwards(this AudioMixer target)
{
return DOTween.PlayBackwards(target);
}
/// <summary>
/// Plays forward all tweens that have this target as a reference
/// (meaning tweens that were started from this target, or that had this target added as an Id)
/// and returns the total number of tweens played.
/// </summary>
public static int DOPlayForward(this AudioMixer target)
{
return DOTween.PlayForward(target);
}
/// <summary>
/// Restarts all tweens that have this target as a reference
/// (meaning tweens that were started from this target, or that had this target added as an Id)
/// and returns the total number of tweens restarted.
/// </summary>
public static int DORestart(this AudioMixer target)
{
return DOTween.Restart(target);
}
/// <summary>
/// Rewinds all tweens that have this target as a reference
/// (meaning tweens that were started from this target, or that had this target added as an Id)
/// and returns the total number of tweens rewinded.
/// </summary>
public static int DORewind(this AudioMixer target)
{
return DOTween.Rewind(target);
}
/// <summary>
/// Smoothly rewinds all tweens that have this target as a reference
/// (meaning tweens that were started from this target, or that had this target added as an Id)
/// and returns the total number of tweens rewinded.
/// </summary>
public static int DOSmoothRewind(this AudioMixer target)
{
return DOTween.SmoothRewind(target);
}
/// <summary>
/// Toggles the paused state (plays if it was paused, pauses if it was playing) of all tweens that have this target as a reference
/// (meaning tweens that were started from this target, or that had this target added as an Id)
/// and returns the total number of tweens involved.
/// </summary>
public static int DOTogglePause(this AudioMixer target)
{
return DOTween.TogglePause(target);
}
#endregion
#endregion
#endregion
}
}
#endif

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 79f8954f1d80fd54db33351ed2152039
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,146 @@
using UnityEngine;
#if false || EPO_DOTWEEN // MODULE_MARKER
using EPOOutline;
using DG.Tweening.Plugins.Options;
using DG.Tweening;
using DG.Tweening.Core;
namespace DG.Tweening
{
public static class DOTweenModuleEPOOutline
{
public static int DOKill(this SerializedPass target, bool complete)
{
return DOTween.Kill(target, complete);
}
public static TweenerCore<float, float, FloatOptions> DOFloat(this SerializedPass target, string propertyName, float endValue, float duration)
{
var tweener = DOTween.To(() => target.GetFloat(propertyName), x => target.SetFloat(propertyName, x), endValue, duration);
tweener.SetOptions(true).SetTarget(target);
return tweener;
}
public static TweenerCore<Color, Color, ColorOptions> DOFade(this SerializedPass target, string propertyName, float endValue, float duration)
{
var tweener = DOTween.ToAlpha(() => target.GetColor(propertyName), x => target.SetColor(propertyName, x), endValue, duration);
tweener.SetOptions(true).SetTarget(target);
return tweener;
}
public static TweenerCore<Color, Color, ColorOptions> DOColor(this SerializedPass target, string propertyName, Color endValue, float duration)
{
var tweener = DOTween.To(() => target.GetColor(propertyName), x => target.SetColor(propertyName, x), endValue, duration);
tweener.SetOptions(false).SetTarget(target);
return tweener;
}
public static TweenerCore<Vector4, Vector4, VectorOptions> DOVector(this SerializedPass target, string propertyName, Vector4 endValue, float duration)
{
var tweener = DOTween.To(() => target.GetVector(propertyName), x => target.SetVector(propertyName, x), endValue, duration);
tweener.SetOptions(false).SetTarget(target);
return tweener;
}
public static TweenerCore<float, float, FloatOptions> DOFloat(this SerializedPass target, int propertyId, float endValue, float duration)
{
var tweener = DOTween.To(() => target.GetFloat(propertyId), x => target.SetFloat(propertyId, x), endValue, duration);
tweener.SetOptions(true).SetTarget(target);
return tweener;
}
public static TweenerCore<Color, Color, ColorOptions> DOFade(this SerializedPass target, int propertyId, float endValue, float duration)
{
var tweener = DOTween.ToAlpha(() => target.GetColor(propertyId), x => target.SetColor(propertyId, x), endValue, duration);
tweener.SetOptions(true).SetTarget(target);
return tweener;
}
public static TweenerCore<Color, Color, ColorOptions> DOColor(this SerializedPass target, int propertyId, Color endValue, float duration)
{
var tweener = DOTween.To(() => target.GetColor(propertyId), x => target.SetColor(propertyId, x), endValue, duration);
tweener.SetOptions(false).SetTarget(target);
return tweener;
}
public static TweenerCore<Vector4, Vector4, VectorOptions> DOVector(this SerializedPass target, int propertyId, Vector4 endValue, float duration)
{
var tweener = DOTween.To(() => target.GetVector(propertyId), x => target.SetVector(propertyId, x), endValue, duration);
tweener.SetOptions(false).SetTarget(target);
return tweener;
}
public static int DOKill(this Outlinable.OutlineProperties target, bool complete = false)
{
return DOTween.Kill(target, complete);
}
public static int DOKill(this Outliner target, bool complete = false)
{
return DOTween.Kill(target, complete);
}
/// <summary>
/// Controls the alpha (transparency) of the outline
/// </summary>
public static TweenerCore<Color, Color, ColorOptions> DOFade(this Outlinable.OutlineProperties target, float endValue, float duration)
{
var tweener = DOTween.ToAlpha(() => target.Color, x => target.Color = x, endValue, duration);
tweener.SetOptions(true).SetTarget(target);
return tweener;
}
/// <summary>
/// Controls the color of the outline
/// </summary>
public static TweenerCore<Color, Color, ColorOptions> DOColor(this Outlinable.OutlineProperties target, Color endValue, float duration)
{
var tweener = DOTween.To(() => target.Color, x => target.Color = x, endValue, duration);
tweener.SetOptions(false).SetTarget(target);
return tweener;
}
/// <summary>
/// Controls the amount of blur applied to the outline
/// </summary>
public static TweenerCore<float, float, FloatOptions> DOBlurShift(this Outlinable.OutlineProperties target, float endValue, float duration, bool snapping = false)
{
var tweener = DOTween.To(() => target.BlurShift, x => target.BlurShift = x, endValue, duration);
tweener.SetOptions(snapping).SetTarget(target);
return tweener;
}
/// <summary>
/// Controls the amount of blur applied to the outline
/// </summary>
public static TweenerCore<float, float, FloatOptions> DOBlurShift(this Outliner target, float endValue, float duration, bool snapping = false)
{
var tweener = DOTween.To(() => target.BlurShift, x => target.BlurShift = x, endValue, duration);
tweener.SetOptions(snapping).SetTarget(target);
return tweener;
}
/// <summary>
/// Controls the amount of dilation applied to the outline
/// </summary>
public static TweenerCore<float, float, FloatOptions> DODilateShift(this Outlinable.OutlineProperties target, float endValue, float duration, bool snapping = false)
{
var tweener = DOTween.To(() => target.DilateShift, x => target.DilateShift = x, endValue, duration);
tweener.SetOptions(snapping).SetTarget(target);
return tweener;
}
/// <summary>
/// Controls the amount of dilation applied to the outline
/// </summary>
public static TweenerCore<float, float, FloatOptions> DODilateShift(this Outliner target, float endValue, float duration, bool snapping = false)
{
var tweener = DOTween.To(() => target.DilateShift, x => target.DilateShift = x, endValue, duration);
tweener.SetOptions(snapping).SetTarget(target);
return tweener;
}
}
}
#endif

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e3611d721df002f45933ceed8a9ae1ee
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,216 @@
// Author: Daniele Giardini - http://www.demigiant.com
// Created: 2018/07/13
#if true // MODULE_MARKER
using System;
using DG.Tweening.Core;
using DG.Tweening.Core.Enums;
using DG.Tweening.Plugins;
using DG.Tweening.Plugins.Core.PathCore;
using DG.Tweening.Plugins.Options;
using UnityEngine;
#pragma warning disable 1591
namespace DG.Tweening
{
public static class DOTweenModulePhysics
{
#region Shortcuts
#region Rigidbody
/// <summary>Tweens a Rigidbody's position to the given value.
/// Also stores the rigidbody as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static TweenerCore<Vector3, Vector3, VectorOptions> DOMove(this Rigidbody target, Vector3 endValue, float duration, bool snapping = false)
{
TweenerCore<Vector3, Vector3, VectorOptions> t = DOTween.To(() => target.position, target.MovePosition, endValue, duration);
t.SetOptions(snapping).SetTarget(target);
return t;
}
/// <summary>Tweens a Rigidbody's X position to the given value.
/// Also stores the rigidbody as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static TweenerCore<Vector3, Vector3, VectorOptions> DOMoveX(this Rigidbody target, float endValue, float duration, bool snapping = false)
{
TweenerCore<Vector3, Vector3, VectorOptions> t = DOTween.To(() => target.position, target.MovePosition, new Vector3(endValue, 0, 0), duration);
t.SetOptions(AxisConstraint.X, snapping).SetTarget(target);
return t;
}
/// <summary>Tweens a Rigidbody's Y position to the given value.
/// Also stores the rigidbody as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static TweenerCore<Vector3, Vector3, VectorOptions> DOMoveY(this Rigidbody target, float endValue, float duration, bool snapping = false)
{
TweenerCore<Vector3, Vector3, VectorOptions> t = DOTween.To(() => target.position, target.MovePosition, new Vector3(0, endValue, 0), duration);
t.SetOptions(AxisConstraint.Y, snapping).SetTarget(target);
return t;
}
/// <summary>Tweens a Rigidbody's Z position to the given value.
/// Also stores the rigidbody as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static TweenerCore<Vector3, Vector3, VectorOptions> DOMoveZ(this Rigidbody target, float endValue, float duration, bool snapping = false)
{
TweenerCore<Vector3, Vector3, VectorOptions> t = DOTween.To(() => target.position, target.MovePosition, new Vector3(0, 0, endValue), duration);
t.SetOptions(AxisConstraint.Z, snapping).SetTarget(target);
return t;
}
/// <summary>Tweens a Rigidbody's rotation to the given value.
/// Also stores the rigidbody as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="mode">Rotation mode</param>
public static TweenerCore<Quaternion, Vector3, QuaternionOptions> DORotate(this Rigidbody target, Vector3 endValue, float duration, RotateMode mode = RotateMode.Fast)
{
TweenerCore<Quaternion, Vector3, QuaternionOptions> t = DOTween.To(() => target.rotation, target.MoveRotation, endValue, duration);
t.SetTarget(target);
t.plugOptions.rotateMode = mode;
return t;
}
/// <summary>Tweens a Rigidbody's rotation so that it will look towards the given position.
/// Also stores the rigidbody as the tween's target so it can be used for filtered operations</summary>
/// <param name="towards">The position to look at</param><param name="duration">The duration of the tween</param>
/// <param name="axisConstraint">Eventual axis constraint for the rotation</param>
/// <param name="up">The vector that defines in which direction up is (default: Vector3.up)</param>
public static TweenerCore<Quaternion, Vector3, QuaternionOptions> DOLookAt(this Rigidbody target, Vector3 towards, float duration, AxisConstraint axisConstraint = AxisConstraint.None, Vector3? up = null)
{
TweenerCore<Quaternion, Vector3, QuaternionOptions> t = DOTween.To(() => target.rotation, target.MoveRotation, towards, duration)
.SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetLookAt);
t.plugOptions.axisConstraint = axisConstraint;
t.plugOptions.up = (up == null) ? Vector3.up : (Vector3)up;
return t;
}
#region Special
/// <summary>Tweens a Rigidbody's position to the given value, while also applying a jump effect along the Y axis.
/// Returns a Sequence instead of a Tweener.
/// Also stores the Rigidbody as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param>
/// <param name="jumpPower">Power of the jump (the max height of the jump is represented by this plus the final Y offset)</param>
/// <param name="numJumps">Total number of jumps</param>
/// <param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static Sequence DOJump(this Rigidbody target, Vector3 endValue, float jumpPower, int numJumps, float duration, bool snapping = false)
{
if (numJumps < 1) numJumps = 1;
float startPosY = 0;
float offsetY = -1;
bool offsetYSet = false;
Sequence s = DOTween.Sequence();
Tween yTween = DOTween.To(() => target.position, target.MovePosition, new Vector3(0, jumpPower, 0), duration / (numJumps * 2))
.SetOptions(AxisConstraint.Y, snapping).SetEase(Ease.OutQuad).SetRelative()
.SetLoops(numJumps * 2, LoopType.Yoyo)
.OnStart(() => startPosY = target.position.y);
s.Append(DOTween.To(() => target.position, target.MovePosition, new Vector3(endValue.x, 0, 0), duration)
.SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear)
).Join(DOTween.To(() => target.position, target.MovePosition, new Vector3(0, 0, endValue.z), duration)
.SetOptions(AxisConstraint.Z, snapping).SetEase(Ease.Linear)
).Join(yTween)
.SetTarget(target).SetEase(DOTween.defaultEaseType);
yTween.OnUpdate(() => {
if (!offsetYSet) {
offsetYSet = true;
offsetY = s.isRelative ? endValue.y : endValue.y - startPosY;
}
Vector3 pos = target.position;
pos.y += DOVirtual.EasedValue(0, offsetY, yTween.ElapsedPercentage(), Ease.OutQuad);
target.MovePosition(pos);
});
return s;
}
/// <summary>Tweens a Rigidbody's position through the given path waypoints, using the chosen path algorithm.
/// Also stores the Rigidbody as the tween's target so it can be used for filtered operations.
/// <para>NOTE: to tween a rigidbody correctly it should be set to kinematic at least while being tweened.</para>
/// <para>BEWARE: doesn't work on Windows Phone store (waiting for Unity to fix their own bug).
/// If you plan to publish there you should use a regular transform.DOPath.</para></summary>
/// <param name="path">The waypoints to go through</param>
/// <param name="duration">The duration of the tween</param>
/// <param name="pathType">The type of path: Linear (straight path), CatmullRom (curved CatmullRom path) or CubicBezier (curved with control points)</param>
/// <param name="pathMode">The path mode: 3D, side-scroller 2D, top-down 2D</param>
/// <param name="resolution">The resolution of the path (useless in case of Linear paths): higher resolutions make for more detailed curved paths but are more expensive.
/// Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints</param>
/// <param name="gizmoColor">The color of the path (shown when gizmos are active in the Play panel and the tween is running)</param>
public static TweenerCore<Vector3, Path, PathOptions> DOPath(
this Rigidbody target, Vector3[] path, float duration, PathType pathType = PathType.Linear,
PathMode pathMode = PathMode.Full3D, int resolution = 10, Color? gizmoColor = null
)
{
if (resolution < 1) resolution = 1;
TweenerCore<Vector3, Path, PathOptions> t = DOTween.To(PathPlugin.Get(), () => target.position, target.MovePosition, new Path(pathType, path, resolution, gizmoColor), duration)
.SetTarget(target).SetUpdate(UpdateType.Fixed);
t.plugOptions.isRigidbody = true;
t.plugOptions.mode = pathMode;
return t;
}
/// <summary>Tweens a Rigidbody's localPosition through the given path waypoints, using the chosen path algorithm.
/// Also stores the Rigidbody as the tween's target so it can be used for filtered operations
/// <para>NOTE: to tween a rigidbody correctly it should be set to kinematic at least while being tweened.</para>
/// <para>BEWARE: doesn't work on Windows Phone store (waiting for Unity to fix their own bug).
/// If you plan to publish there you should use a regular transform.DOLocalPath.</para></summary>
/// <param name="path">The waypoint to go through</param>
/// <param name="duration">The duration of the tween</param>
/// <param name="pathType">The type of path: Linear (straight path), CatmullRom (curved CatmullRom path) or CubicBezier (curved with control points)</param>
/// <param name="pathMode">The path mode: 3D, side-scroller 2D, top-down 2D</param>
/// <param name="resolution">The resolution of the path: higher resolutions make for more detailed curved paths but are more expensive.
/// Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints</param>
/// <param name="gizmoColor">The color of the path (shown when gizmos are active in the Play panel and the tween is running)</param>
public static TweenerCore<Vector3, Path, PathOptions> DOLocalPath(
this Rigidbody target, Vector3[] path, float duration, PathType pathType = PathType.Linear,
PathMode pathMode = PathMode.Full3D, int resolution = 10, Color? gizmoColor = null
)
{
if (resolution < 1) resolution = 1;
Transform trans = target.transform;
TweenerCore<Vector3, Path, PathOptions> t = DOTween.To(PathPlugin.Get(), () => trans.localPosition, x => target.MovePosition(trans.parent == null ? x : trans.parent.TransformPoint(x)), new Path(pathType, path, resolution, gizmoColor), duration)
.SetTarget(target).SetUpdate(UpdateType.Fixed);
t.plugOptions.isRigidbody = true;
t.plugOptions.mode = pathMode;
t.plugOptions.useLocalPosition = true;
return t;
}
// Used by path editor when creating the actual tween, so it can pass a pre-compiled path
internal static TweenerCore<Vector3, Path, PathOptions> DOPath(
this Rigidbody target, Path path, float duration, PathMode pathMode = PathMode.Full3D
)
{
TweenerCore<Vector3, Path, PathOptions> t = DOTween.To(PathPlugin.Get(), () => target.position, target.MovePosition, path, duration)
.SetTarget(target);
t.plugOptions.isRigidbody = true;
t.plugOptions.mode = pathMode;
return t;
}
internal static TweenerCore<Vector3, Path, PathOptions> DOLocalPath(
this Rigidbody target, Path path, float duration, PathMode pathMode = PathMode.Full3D
)
{
Transform trans = target.transform;
TweenerCore<Vector3, Path, PathOptions> t = DOTween.To(PathPlugin.Get(), () => trans.localPosition, x => target.MovePosition(trans.parent == null ? x : trans.parent.TransformPoint(x)), path, duration)
.SetTarget(target);
t.plugOptions.isRigidbody = true;
t.plugOptions.mode = pathMode;
t.plugOptions.useLocalPosition = true;
return t;
}
#endregion
#endregion
#endregion
}
}
#endif

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 5bc7756ef72354148a2e7f8a92d26937
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,193 @@
// Author: Daniele Giardini - http://www.demigiant.com
// Created: 2018/07/13
#if true // MODULE_MARKER
using System;
using DG.Tweening.Core;
using DG.Tweening.Plugins;
using DG.Tweening.Plugins.Core.PathCore;
using DG.Tweening.Plugins.Options;
using UnityEngine;
#pragma warning disable 1591
namespace DG.Tweening
{
public static class DOTweenModulePhysics2D
{
#region Shortcuts
#region Rigidbody2D Shortcuts
/// <summary>Tweens a Rigidbody2D's position to the given value.
/// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static TweenerCore<Vector2, Vector2, VectorOptions> DOMove(this Rigidbody2D target, Vector2 endValue, float duration, bool snapping = false)
{
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => target.position, target.MovePosition, endValue, duration);
t.SetOptions(snapping).SetTarget(target);
return t;
}
/// <summary>Tweens a Rigidbody2D's X position to the given value.
/// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static TweenerCore<Vector2, Vector2, VectorOptions> DOMoveX(this Rigidbody2D target, float endValue, float duration, bool snapping = false)
{
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => target.position, target.MovePosition, new Vector2(endValue, 0), duration);
t.SetOptions(AxisConstraint.X, snapping).SetTarget(target);
return t;
}
/// <summary>Tweens a Rigidbody2D's Y position to the given value.
/// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static TweenerCore<Vector2, Vector2, VectorOptions> DOMoveY(this Rigidbody2D target, float endValue, float duration, bool snapping = false)
{
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => target.position, target.MovePosition, new Vector2(0, endValue), duration);
t.SetOptions(AxisConstraint.Y, snapping).SetTarget(target);
return t;
}
/// <summary>Tweens a Rigidbody2D's rotation to the given value.
/// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
public static TweenerCore<float, float, FloatOptions> DORotate(this Rigidbody2D target, float endValue, float duration)
{
TweenerCore<float, float, FloatOptions> t = DOTween.To(() => target.rotation, target.MoveRotation, endValue, duration);
t.SetTarget(target);
return t;
}
#region Special
/// <summary>Tweens a Rigidbody2D's position to the given value, while also applying a jump effect along the Y axis.
/// Returns a Sequence instead of a Tweener.
/// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations.
/// <para>IMPORTANT: a rigidbody2D can't be animated in a jump arc using MovePosition, so the tween will directly set the position</para></summary>
/// <param name="endValue">The end value to reach</param>
/// <param name="jumpPower">Power of the jump (the max height of the jump is represented by this plus the final Y offset)</param>
/// <param name="numJumps">Total number of jumps</param>
/// <param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static Sequence DOJump(this Rigidbody2D target, Vector2 endValue, float jumpPower, int numJumps, float duration, bool snapping = false)
{
if (numJumps < 1) numJumps = 1;
float startPosY = 0;
float offsetY = -1;
bool offsetYSet = false;
Sequence s = DOTween.Sequence();
Tween yTween = DOTween.To(() => target.position, x => target.position = x, new Vector2(0, jumpPower), duration / (numJumps * 2))
.SetOptions(AxisConstraint.Y, snapping).SetEase(Ease.OutQuad).SetRelative()
.SetLoops(numJumps * 2, LoopType.Yoyo)
.OnStart(() => startPosY = target.position.y);
s.Append(DOTween.To(() => target.position, x => target.position = x, new Vector2(endValue.x, 0), duration)
.SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear)
).Join(yTween)
.SetTarget(target).SetEase(DOTween.defaultEaseType);
yTween.OnUpdate(() => {
if (!offsetYSet) {
offsetYSet = true;
offsetY = s.isRelative ? endValue.y : endValue.y - startPosY;
}
Vector3 pos = target.position;
pos.y += DOVirtual.EasedValue(0, offsetY, yTween.ElapsedPercentage(), Ease.OutQuad);
target.MovePosition(pos);
});
return s;
}
/// <summary>Tweens a Rigidbody2D's position through the given path waypoints, using the chosen path algorithm.
/// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations.
/// <para>NOTE: to tween a Rigidbody2D correctly it should be set to kinematic at least while being tweened.</para>
/// <para>BEWARE: doesn't work on Windows Phone store (waiting for Unity to fix their own bug).
/// If you plan to publish there you should use a regular transform.DOPath.</para></summary>
/// <param name="path">The waypoints to go through</param>
/// <param name="duration">The duration of the tween</param>
/// <param name="pathType">The type of path: Linear (straight path), CatmullRom (curved CatmullRom path) or CubicBezier (curved with control points)</param>
/// <param name="pathMode">The path mode: 3D, side-scroller 2D, top-down 2D</param>
/// <param name="resolution">The resolution of the path (useless in case of Linear paths): higher resolutions make for more detailed curved paths but are more expensive.
/// Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints</param>
/// <param name="gizmoColor">The color of the path (shown when gizmos are active in the Play panel and the tween is running)</param>
public static TweenerCore<Vector3, Path, PathOptions> DOPath(
this Rigidbody2D target, Vector2[] path, float duration, PathType pathType = PathType.Linear,
PathMode pathMode = PathMode.Full3D, int resolution = 10, Color? gizmoColor = null
)
{
if (resolution < 1) resolution = 1;
int len = path.Length;
Vector3[] path3D = new Vector3[len];
for (int i = 0; i < len; ++i) path3D[i] = path[i];
TweenerCore<Vector3, Path, PathOptions> t = DOTween.To(PathPlugin.Get(), () => target.position, x => target.MovePosition(x), new Path(pathType, path3D, resolution, gizmoColor), duration)
.SetTarget(target).SetUpdate(UpdateType.Fixed);
t.plugOptions.isRigidbody2D = true;
t.plugOptions.mode = pathMode;
return t;
}
/// <summary>Tweens a Rigidbody2D's localPosition through the given path waypoints, using the chosen path algorithm.
/// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations
/// <para>NOTE: to tween a Rigidbody2D correctly it should be set to kinematic at least while being tweened.</para>
/// <para>BEWARE: doesn't work on Windows Phone store (waiting for Unity to fix their own bug).
/// If you plan to publish there you should use a regular transform.DOLocalPath.</para></summary>
/// <param name="path">The waypoint to go through</param>
/// <param name="duration">The duration of the tween</param>
/// <param name="pathType">The type of path: Linear (straight path), CatmullRom (curved CatmullRom path) or CubicBezier (curved with control points)</param>
/// <param name="pathMode">The path mode: 3D, side-scroller 2D, top-down 2D</param>
/// <param name="resolution">The resolution of the path: higher resolutions make for more detailed curved paths but are more expensive.
/// Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints</param>
/// <param name="gizmoColor">The color of the path (shown when gizmos are active in the Play panel and the tween is running)</param>
public static TweenerCore<Vector3, Path, PathOptions> DOLocalPath(
this Rigidbody2D target, Vector2[] path, float duration, PathType pathType = PathType.Linear,
PathMode pathMode = PathMode.Full3D, int resolution = 10, Color? gizmoColor = null
)
{
if (resolution < 1) resolution = 1;
int len = path.Length;
Vector3[] path3D = new Vector3[len];
for (int i = 0; i < len; ++i) path3D[i] = path[i];
Transform trans = target.transform;
TweenerCore<Vector3, Path, PathOptions> t = DOTween.To(PathPlugin.Get(), () => trans.localPosition, x => target.MovePosition(trans.parent == null ? x : trans.parent.TransformPoint(x)), new Path(pathType, path3D, resolution, gizmoColor), duration)
.SetTarget(target).SetUpdate(UpdateType.Fixed);
t.plugOptions.isRigidbody2D = true;
t.plugOptions.mode = pathMode;
t.plugOptions.useLocalPosition = true;
return t;
}
// Used by path editor when creating the actual tween, so it can pass a pre-compiled path
internal static TweenerCore<Vector3, Path, PathOptions> DOPath(
this Rigidbody2D target, Path path, float duration, PathMode pathMode = PathMode.Full3D
)
{
TweenerCore<Vector3, Path, PathOptions> t = DOTween.To(PathPlugin.Get(), () => target.position, x => target.MovePosition(x), path, duration)
.SetTarget(target);
t.plugOptions.isRigidbody2D = true;
t.plugOptions.mode = pathMode;
return t;
}
internal static TweenerCore<Vector3, Path, PathOptions> DOLocalPath(
this Rigidbody2D target, Path path, float duration, PathMode pathMode = PathMode.Full3D
)
{
Transform trans = target.transform;
TweenerCore<Vector3, Path, PathOptions> t = DOTween.To(PathPlugin.Get(), () => trans.localPosition, x => target.MovePosition(trans.parent == null ? x : trans.parent.TransformPoint(x)), path, duration)
.SetTarget(target);
t.plugOptions.isRigidbody2D = true;
t.plugOptions.mode = pathMode;
t.plugOptions.useLocalPosition = true;
return t;
}
#endregion
#endregion
#endregion
}
}
#endif

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 8b9c98f0231c596479d7c201d1a23ebe
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,93 @@
// Author: Daniele Giardini - http://www.demigiant.com
// Created: 2018/07/13
#if true // MODULE_MARKER
using System;
using UnityEngine;
using DG.Tweening.Core;
using DG.Tweening.Plugins.Options;
#pragma warning disable 1591
namespace DG.Tweening
{
public static class DOTweenModuleSprite
{
#region Shortcuts
#region SpriteRenderer
/// <summary>Tweens a SpriteRenderer's color to the given value.
/// Also stores the spriteRenderer as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
public static TweenerCore<Color, Color, ColorOptions> DOColor(this SpriteRenderer target, Color endValue, float duration)
{
TweenerCore<Color, Color, ColorOptions> t = DOTween.To(() => target.color, x => target.color = x, endValue, duration);
t.SetTarget(target);
return t;
}
/// <summary>Tweens a Material's alpha color to the given value.
/// Also stores the spriteRenderer as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
public static TweenerCore<Color, Color, ColorOptions> DOFade(this SpriteRenderer target, float endValue, float duration)
{
TweenerCore<Color, Color, ColorOptions> t = DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration);
t.SetTarget(target);
return t;
}
/// <summary>Tweens a SpriteRenderer's color using the given gradient
/// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
/// Also stores the image as the tween's target so it can be used for filtered operations</summary>
/// <param name="gradient">The gradient to use</param><param name="duration">The duration of the tween</param>
public static Sequence DOGradientColor(this SpriteRenderer target, Gradient gradient, float duration)
{
Sequence s = DOTween.Sequence();
GradientColorKey[] colors = gradient.colorKeys;
int len = colors.Length;
for (int i = 0; i < len; ++i) {
GradientColorKey c = colors[i];
if (i == 0 && c.time <= 0) {
target.color = c.color;
continue;
}
float colorDuration = i == len - 1
? duration - s.Duration(false) // Verifies that total duration is correct
: duration * (i == 0 ? c.time : c.time - colors[i - 1].time);
s.Append(target.DOColor(c.color, colorDuration).SetEase(Ease.Linear));
}
s.SetTarget(target);
return s;
}
#endregion
#region Blendables
#region SpriteRenderer
/// <summary>Tweens a SpriteRenderer's color to the given value,
/// in a way that allows other DOBlendableColor tweens to work together on the same target,
/// instead than fight each other as multiple DOColor would do.
/// Also stores the SpriteRenderer as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The value to tween to</param><param name="duration">The duration of the tween</param>
public static Tweener DOBlendableColor(this SpriteRenderer target, Color endValue, float duration)
{
endValue = endValue - target.color;
Color to = new Color(0, 0, 0, 0);
return DOTween.To(() => to, x => {
Color diff = x - to;
to = x;
target.color += diff;
}, endValue, duration)
.Blendable().SetTarget(target);
}
#endregion
#endregion
#endregion
}
}
#endif

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ed0c803071031de43a04893cf85633a4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,662 @@
// Author: Daniele Giardini - http://www.demigiant.com
// Created: 2018/07/13
#if true // MODULE_MARKER
using System;
using System.Globalization;
using UnityEngine;
using UnityEngine.UI;
using DG.Tweening.Core;
using DG.Tweening.Core.Enums;
using DG.Tweening.Plugins;
using DG.Tweening.Plugins.Options;
using Outline = UnityEngine.UI.Outline;
using Text = UnityEngine.UI.Text;
#pragma warning disable 1591
namespace DG.Tweening
{
public static class DOTweenModuleUI
{
#region Shortcuts
#region CanvasGroup
/// <summary>Tweens a CanvasGroup's alpha color to the given value.
/// Also stores the canvasGroup as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
public static TweenerCore<float, float, FloatOptions> DOFade(this CanvasGroup target, float endValue, float duration)
{
TweenerCore<float, float, FloatOptions> t = DOTween.To(() => target.alpha, x => target.alpha = x, endValue, duration);
t.SetTarget(target);
return t;
}
#endregion
#region Graphic
/// <summary>Tweens an Graphic's color to the given value.
/// Also stores the image as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
public static TweenerCore<Color, Color, ColorOptions> DOColor(this Graphic target, Color endValue, float duration)
{
TweenerCore<Color, Color, ColorOptions> t = DOTween.To(() => target.color, x => target.color = x, endValue, duration);
t.SetTarget(target);
return t;
}
/// <summary>Tweens an Graphic's alpha color to the given value.
/// Also stores the image as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
public static TweenerCore<Color, Color, ColorOptions> DOFade(this Graphic target, float endValue, float duration)
{
TweenerCore<Color, Color, ColorOptions> t = DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration);
t.SetTarget(target);
return t;
}
#endregion
#region Image
/// <summary>Tweens an Image's color to the given value.
/// Also stores the image as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
public static TweenerCore<Color, Color, ColorOptions> DOColor(this Image target, Color endValue, float duration)
{
TweenerCore<Color, Color, ColorOptions> t = DOTween.To(() => target.color, x => target.color = x, endValue, duration);
t.SetTarget(target);
return t;
}
/// <summary>Tweens an Image's alpha color to the given value.
/// Also stores the image as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
public static TweenerCore<Color, Color, ColorOptions> DOFade(this Image target, float endValue, float duration)
{
TweenerCore<Color, Color, ColorOptions> t = DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration);
t.SetTarget(target);
return t;
}
/// <summary>Tweens an Image's fillAmount to the given value.
/// Also stores the image as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach (0 to 1)</param><param name="duration">The duration of the tween</param>
public static TweenerCore<float, float, FloatOptions> DOFillAmount(this Image target, float endValue, float duration)
{
if (endValue > 1) endValue = 1;
else if (endValue < 0) endValue = 0;
TweenerCore<float, float, FloatOptions> t = DOTween.To(() => target.fillAmount, x => target.fillAmount = x, endValue, duration);
t.SetTarget(target);
return t;
}
/// <summary>Tweens an Image's colors using the given gradient
/// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
/// Also stores the image as the tween's target so it can be used for filtered operations</summary>
/// <param name="gradient">The gradient to use</param><param name="duration">The duration of the tween</param>
public static Sequence DOGradientColor(this Image target, Gradient gradient, float duration)
{
Sequence s = DOTween.Sequence();
GradientColorKey[] colors = gradient.colorKeys;
int len = colors.Length;
for (int i = 0; i < len; ++i) {
GradientColorKey c = colors[i];
if (i == 0 && c.time <= 0) {
target.color = c.color;
continue;
}
float colorDuration = i == len - 1
? duration - s.Duration(false) // Verifies that total duration is correct
: duration * (i == 0 ? c.time : c.time - colors[i - 1].time);
s.Append(target.DOColor(c.color, colorDuration).SetEase(Ease.Linear));
}
s.SetTarget(target);
return s;
}
#endregion
#region LayoutElement
/// <summary>Tweens an LayoutElement's flexibleWidth/Height to the given value.
/// Also stores the LayoutElement as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static TweenerCore<Vector2, Vector2, VectorOptions> DOFlexibleSize(this LayoutElement target, Vector2 endValue, float duration, bool snapping = false)
{
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => new Vector2(target.flexibleWidth, target.flexibleHeight), x => {
target.flexibleWidth = x.x;
target.flexibleHeight = x.y;
}, endValue, duration);
t.SetOptions(snapping).SetTarget(target);
return t;
}
/// <summary>Tweens an LayoutElement's minWidth/Height to the given value.
/// Also stores the LayoutElement as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static TweenerCore<Vector2, Vector2, VectorOptions> DOMinSize(this LayoutElement target, Vector2 endValue, float duration, bool snapping = false)
{
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => new Vector2(target.minWidth, target.minHeight), x => {
target.minWidth = x.x;
target.minHeight = x.y;
}, endValue, duration);
t.SetOptions(snapping).SetTarget(target);
return t;
}
/// <summary>Tweens an LayoutElement's preferredWidth/Height to the given value.
/// Also stores the LayoutElement as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static TweenerCore<Vector2, Vector2, VectorOptions> DOPreferredSize(this LayoutElement target, Vector2 endValue, float duration, bool snapping = false)
{
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => new Vector2(target.preferredWidth, target.preferredHeight), x => {
target.preferredWidth = x.x;
target.preferredHeight = x.y;
}, endValue, duration);
t.SetOptions(snapping).SetTarget(target);
return t;
}
#endregion
#region Outline
/// <summary>Tweens a Outline's effectColor to the given value.
/// Also stores the Outline as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
public static TweenerCore<Color, Color, ColorOptions> DOColor(this Outline target, Color endValue, float duration)
{
TweenerCore<Color, Color, ColorOptions> t = DOTween.To(() => target.effectColor, x => target.effectColor = x, endValue, duration);
t.SetTarget(target);
return t;
}
/// <summary>Tweens a Outline's effectColor alpha to the given value.
/// Also stores the Outline as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
public static TweenerCore<Color, Color, ColorOptions> DOFade(this Outline target, float endValue, float duration)
{
TweenerCore<Color, Color, ColorOptions> t = DOTween.ToAlpha(() => target.effectColor, x => target.effectColor = x, endValue, duration);
t.SetTarget(target);
return t;
}
/// <summary>Tweens a Outline's effectDistance to the given value.
/// Also stores the Outline as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
public static TweenerCore<Vector2, Vector2, VectorOptions> DOScale(this Outline target, Vector2 endValue, float duration)
{
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => target.effectDistance, x => target.effectDistance = x, endValue, duration);
t.SetTarget(target);
return t;
}
#endregion
#region RectTransform
/// <summary>Tweens a RectTransform's anchoredPosition to the given value.
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static TweenerCore<Vector2, Vector2, VectorOptions> DOAnchorPos(this RectTransform target, Vector2 endValue, float duration, bool snapping = false)
{
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, endValue, duration);
t.SetOptions(snapping).SetTarget(target);
return t;
}
/// <summary>Tweens a RectTransform's anchoredPosition X to the given value.
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static TweenerCore<Vector2, Vector2, VectorOptions> DOAnchorPosX(this RectTransform target, float endValue, float duration, bool snapping = false)
{
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, new Vector2(endValue, 0), duration);
t.SetOptions(AxisConstraint.X, snapping).SetTarget(target);
return t;
}
/// <summary>Tweens a RectTransform's anchoredPosition Y to the given value.
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static TweenerCore<Vector2, Vector2, VectorOptions> DOAnchorPosY(this RectTransform target, float endValue, float duration, bool snapping = false)
{
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, new Vector2(0, endValue), duration);
t.SetOptions(AxisConstraint.Y, snapping).SetTarget(target);
return t;
}
/// <summary>Tweens a RectTransform's anchoredPosition3D to the given value.
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static TweenerCore<Vector3, Vector3, VectorOptions> DOAnchorPos3D(this RectTransform target, Vector3 endValue, float duration, bool snapping = false)
{
TweenerCore<Vector3, Vector3, VectorOptions> t = DOTween.To(() => target.anchoredPosition3D, x => target.anchoredPosition3D = x, endValue, duration);
t.SetOptions(snapping).SetTarget(target);
return t;
}
/// <summary>Tweens a RectTransform's anchoredPosition3D X to the given value.
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static TweenerCore<Vector3, Vector3, VectorOptions> DOAnchorPos3DX(this RectTransform target, float endValue, float duration, bool snapping = false)
{
TweenerCore<Vector3, Vector3, VectorOptions> t = DOTween.To(() => target.anchoredPosition3D, x => target.anchoredPosition3D = x, new Vector3(endValue, 0, 0), duration);
t.SetOptions(AxisConstraint.X, snapping).SetTarget(target);
return t;
}
/// <summary>Tweens a RectTransform's anchoredPosition3D Y to the given value.
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static TweenerCore<Vector3, Vector3, VectorOptions> DOAnchorPos3DY(this RectTransform target, float endValue, float duration, bool snapping = false)
{
TweenerCore<Vector3, Vector3, VectorOptions> t = DOTween.To(() => target.anchoredPosition3D, x => target.anchoredPosition3D = x, new Vector3(0, endValue, 0), duration);
t.SetOptions(AxisConstraint.Y, snapping).SetTarget(target);
return t;
}
/// <summary>Tweens a RectTransform's anchoredPosition3D Z to the given value.
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static TweenerCore<Vector3, Vector3, VectorOptions> DOAnchorPos3DZ(this RectTransform target, float endValue, float duration, bool snapping = false)
{
TweenerCore<Vector3, Vector3, VectorOptions> t = DOTween.To(() => target.anchoredPosition3D, x => target.anchoredPosition3D = x, new Vector3(0, 0, endValue), duration);
t.SetOptions(AxisConstraint.Z, snapping).SetTarget(target);
return t;
}
/// <summary>Tweens a RectTransform's anchorMax to the given value.
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static TweenerCore<Vector2, Vector2, VectorOptions> DOAnchorMax(this RectTransform target, Vector2 endValue, float duration, bool snapping = false)
{
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => target.anchorMax, x => target.anchorMax = x, endValue, duration);
t.SetOptions(snapping).SetTarget(target);
return t;
}
/// <summary>Tweens a RectTransform's anchorMin to the given value.
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static TweenerCore<Vector2, Vector2, VectorOptions> DOAnchorMin(this RectTransform target, Vector2 endValue, float duration, bool snapping = false)
{
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => target.anchorMin, x => target.anchorMin = x, endValue, duration);
t.SetOptions(snapping).SetTarget(target);
return t;
}
/// <summary>Tweens a RectTransform's pivot to the given value.
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
public static TweenerCore<Vector2, Vector2, VectorOptions> DOPivot(this RectTransform target, Vector2 endValue, float duration)
{
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => target.pivot, x => target.pivot = x, endValue, duration);
t.SetTarget(target);
return t;
}
/// <summary>Tweens a RectTransform's pivot X to the given value.
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
public static TweenerCore<Vector2, Vector2, VectorOptions> DOPivotX(this RectTransform target, float endValue, float duration)
{
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => target.pivot, x => target.pivot = x, new Vector2(endValue, 0), duration);
t.SetOptions(AxisConstraint.X).SetTarget(target);
return t;
}
/// <summary>Tweens a RectTransform's pivot Y to the given value.
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
public static TweenerCore<Vector2, Vector2, VectorOptions> DOPivotY(this RectTransform target, float endValue, float duration)
{
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => target.pivot, x => target.pivot = x, new Vector2(0, endValue), duration);
t.SetOptions(AxisConstraint.Y).SetTarget(target);
return t;
}
/// <summary>Tweens a RectTransform's sizeDelta to the given value.
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static TweenerCore<Vector2, Vector2, VectorOptions> DOSizeDelta(this RectTransform target, Vector2 endValue, float duration, bool snapping = false)
{
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => target.sizeDelta, x => target.sizeDelta = x, endValue, duration);
t.SetOptions(snapping).SetTarget(target);
return t;
}
/// <summary>Punches a RectTransform's anchoredPosition towards the given direction and then back to the starting one
/// as if it was connected to the starting position via an elastic.
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
/// <param name="punch">The direction and strength of the punch (added to the RectTransform's current position)</param>
/// <param name="duration">The duration of the tween</param>
/// <param name="vibrato">Indicates how much will the punch vibrate</param>
/// <param name="elasticity">Represents how much (0 to 1) the vector will go beyond the starting position when bouncing backwards.
/// 1 creates a full oscillation between the punch direction and the opposite direction,
/// while 0 oscillates only between the punch and the start position</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static Tweener DOPunchAnchorPos(this RectTransform target, Vector2 punch, float duration, int vibrato = 10, float elasticity = 1, bool snapping = false)
{
return DOTween.Punch(() => target.anchoredPosition, x => target.anchoredPosition = x, punch, duration, vibrato, elasticity)
.SetTarget(target).SetOptions(snapping);
}
/// <summary>Shakes a RectTransform's anchoredPosition with the given values.
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
/// <param name="duration">The duration of the tween</param>
/// <param name="strength">The shake strength</param>
/// <param name="vibrato">Indicates how much will the shake vibrate</param>
/// <param name="randomness">Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware).
/// Setting it to 0 will shake along a single direction.</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
/// <param name="fadeOut">If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not</param>
/// <param name="randomnessMode">Randomness mode</param>
public static Tweener DOShakeAnchorPos(this RectTransform target, float duration, float strength = 100, int vibrato = 10, float randomness = 90, bool snapping = false, bool fadeOut = true, ShakeRandomnessMode randomnessMode = ShakeRandomnessMode.Full)
{
return DOTween.Shake(() => target.anchoredPosition, x => target.anchoredPosition = x, duration, strength, vibrato, randomness, true, fadeOut, randomnessMode)
.SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetShake).SetOptions(snapping);
}
/// <summary>Shakes a RectTransform's anchoredPosition with the given values.
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
/// <param name="duration">The duration of the tween</param>
/// <param name="strength">The shake strength on each axis</param>
/// <param name="vibrato">Indicates how much will the shake vibrate</param>
/// <param name="randomness">Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware).
/// Setting it to 0 will shake along a single direction.</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
/// <param name="fadeOut">If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not</param>
/// <param name="randomnessMode">Randomness mode</param>
public static Tweener DOShakeAnchorPos(this RectTransform target, float duration, Vector2 strength, int vibrato = 10, float randomness = 90, bool snapping = false, bool fadeOut = true, ShakeRandomnessMode randomnessMode = ShakeRandomnessMode.Full)
{
return DOTween.Shake(() => target.anchoredPosition, x => target.anchoredPosition = x, duration, strength, vibrato, randomness, fadeOut, randomnessMode)
.SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetShake).SetOptions(snapping);
}
#region Special
/// <summary>Tweens a RectTransform's anchoredPosition to the given value, while also applying a jump effect along the Y axis.
/// Returns a Sequence instead of a Tweener.
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param>
/// <param name="jumpPower">Power of the jump (the max height of the jump is represented by this plus the final Y offset)</param>
/// <param name="numJumps">Total number of jumps</param>
/// <param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static Sequence DOJumpAnchorPos(this RectTransform target, Vector2 endValue, float jumpPower, int numJumps, float duration, bool snapping = false)
{
if (numJumps < 1) numJumps = 1;
float startPosY = 0;
float offsetY = -1;
bool offsetYSet = false;
// Separate Y Tween so we can elaborate elapsedPercentage on that insted of on the Sequence
// (in case users add a delay or other elements to the Sequence)
Sequence s = DOTween.Sequence();
Tween yTween = DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, new Vector2(0, jumpPower), duration / (numJumps * 2))
.SetOptions(AxisConstraint.Y, snapping).SetEase(Ease.OutQuad).SetRelative()
.SetLoops(numJumps * 2, LoopType.Yoyo)
.OnStart(()=> startPosY = target.anchoredPosition.y);
s.Append(DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, new Vector2(endValue.x, 0), duration)
.SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear)
).Join(yTween)
.SetTarget(target).SetEase(DOTween.defaultEaseType);
s.OnUpdate(() => {
if (!offsetYSet) {
offsetYSet = true;
offsetY = s.isRelative ? endValue.y : endValue.y - startPosY;
}
Vector2 pos = target.anchoredPosition;
pos.y += DOVirtual.EasedValue(0, offsetY, s.ElapsedDirectionalPercentage(), Ease.OutQuad);
target.anchoredPosition = pos;
});
return s;
}
#endregion
#endregion
#region ScrollRect
/// <summary>Tweens a ScrollRect's horizontal/verticalNormalizedPosition to the given value.
/// Also stores the ScrollRect as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static Tweener DONormalizedPos(this ScrollRect target, Vector2 endValue, float duration, bool snapping = false)
{
return DOTween.To(() => new Vector2(target.horizontalNormalizedPosition, target.verticalNormalizedPosition),
x => {
target.horizontalNormalizedPosition = x.x;
target.verticalNormalizedPosition = x.y;
}, endValue, duration)
.SetOptions(snapping).SetTarget(target);
}
/// <summary>Tweens a ScrollRect's horizontalNormalizedPosition to the given value.
/// Also stores the ScrollRect as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static Tweener DOHorizontalNormalizedPos(this ScrollRect target, float endValue, float duration, bool snapping = false)
{
return DOTween.To(() => target.horizontalNormalizedPosition, x => target.horizontalNormalizedPosition = x, endValue, duration)
.SetOptions(snapping).SetTarget(target);
}
/// <summary>Tweens a ScrollRect's verticalNormalizedPosition to the given value.
/// Also stores the ScrollRect as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static Tweener DOVerticalNormalizedPos(this ScrollRect target, float endValue, float duration, bool snapping = false)
{
return DOTween.To(() => target.verticalNormalizedPosition, x => target.verticalNormalizedPosition = x, endValue, duration)
.SetOptions(snapping).SetTarget(target);
}
#endregion
#region Slider
/// <summary>Tweens a Slider's value to the given value.
/// Also stores the Slider as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static TweenerCore<float, float, FloatOptions> DOValue(this Slider target, float endValue, float duration, bool snapping = false)
{
TweenerCore<float, float, FloatOptions> t = DOTween.To(() => target.value, x => target.value = x, endValue, duration);
t.SetOptions(snapping).SetTarget(target);
return t;
}
#endregion
#region Text
/// <summary>Tweens a Text's color to the given value.
/// Also stores the Text as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
public static TweenerCore<Color, Color, ColorOptions> DOColor(this Text target, Color endValue, float duration)
{
TweenerCore<Color, Color, ColorOptions> t = DOTween.To(() => target.color, x => target.color = x, endValue, duration);
t.SetTarget(target);
return t;
}
/// <summary>
/// Tweens a Text's text from one integer to another, with options for thousands separators
/// </summary>
/// <param name="fromValue">The value to start from</param>
/// <param name="endValue">The end value to reach</param>
/// <param name="duration">The duration of the tween</param>
/// <param name="addThousandsSeparator">If TRUE (default) also adds thousands separators</param>
/// <param name="culture">The <see cref="CultureInfo"/> to use (InvariantCulture if NULL)</param>
public static TweenerCore<int, int, NoOptions> DOCounter(
this Text target, int fromValue, int endValue, float duration, bool addThousandsSeparator = true, CultureInfo culture = null
){
int v = fromValue;
CultureInfo cInfo = !addThousandsSeparator ? null : culture ?? CultureInfo.InvariantCulture;
TweenerCore<int, int, NoOptions> t = DOTween.To(() => v, x => {
v = x;
target.text = addThousandsSeparator
? v.ToString("N0", cInfo)
: v.ToString();
}, endValue, duration);
t.SetTarget(target);
return t;
}
/// <summary>Tweens a Text's alpha color to the given value.
/// Also stores the Text as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
public static TweenerCore<Color, Color, ColorOptions> DOFade(this Text target, float endValue, float duration)
{
TweenerCore<Color, Color, ColorOptions> t = DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration);
t.SetTarget(target);
return t;
}
/// <summary>Tweens a Text's text to the given value.
/// Also stores the Text as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end string to tween to</param><param name="duration">The duration of the tween</param>
/// <param name="richTextEnabled">If TRUE (default), rich text will be interpreted correctly while animated,
/// otherwise all tags will be considered as normal text</param>
/// <param name="scrambleMode">The type of scramble mode to use, if any</param>
/// <param name="scrambleChars">A string containing the characters to use for scrambling.
/// Use as many characters as possible (minimum 10) because DOTween uses a fast scramble mode which gives better results with more characters.
/// Leave it to NULL (default) to use default ones</param>
public static TweenerCore<string, string, StringOptions> DOText(this Text target, string endValue, float duration, bool richTextEnabled = true, ScrambleMode scrambleMode = ScrambleMode.None, string scrambleChars = null)
{
if (endValue == null) {
if (Debugger.logPriority > 0) Debugger.LogWarning("You can't pass a NULL string to DOText: an empty string will be used instead to avoid errors");
endValue = "";
}
TweenerCore<string, string, StringOptions> t = DOTween.To(() => target.text, x => target.text = x, endValue, duration);
t.SetOptions(richTextEnabled, scrambleMode, scrambleChars)
.SetTarget(target);
return t;
}
#endregion
#region Blendables
#region Graphic
/// <summary>Tweens a Graphic's color to the given value,
/// in a way that allows other DOBlendableColor tweens to work together on the same target,
/// instead than fight each other as multiple DOColor would do.
/// Also stores the Graphic as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The value to tween to</param><param name="duration">The duration of the tween</param>
public static Tweener DOBlendableColor(this Graphic target, Color endValue, float duration)
{
endValue = endValue - target.color;
Color to = new Color(0, 0, 0, 0);
return DOTween.To(() => to, x => {
Color diff = x - to;
to = x;
target.color += diff;
}, endValue, duration)
.Blendable().SetTarget(target);
}
#endregion
#region Image
/// <summary>Tweens a Image's color to the given value,
/// in a way that allows other DOBlendableColor tweens to work together on the same target,
/// instead than fight each other as multiple DOColor would do.
/// Also stores the Image as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The value to tween to</param><param name="duration">The duration of the tween</param>
public static Tweener DOBlendableColor(this Image target, Color endValue, float duration)
{
endValue = endValue - target.color;
Color to = new Color(0, 0, 0, 0);
return DOTween.To(() => to, x => {
Color diff = x - to;
to = x;
target.color += diff;
}, endValue, duration)
.Blendable().SetTarget(target);
}
#endregion
#region Text
/// <summary>Tweens a Text's color BY the given value,
/// in a way that allows other DOBlendableColor tweens to work together on the same target,
/// instead than fight each other as multiple DOColor would do.
/// Also stores the Text as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The value to tween to</param><param name="duration">The duration of the tween</param>
public static Tweener DOBlendableColor(this Text target, Color endValue, float duration)
{
endValue = endValue - target.color;
Color to = new Color(0, 0, 0, 0);
return DOTween.To(() => to, x => {
Color diff = x - to;
to = x;
target.color += diff;
}, endValue, duration)
.Blendable().SetTarget(target);
}
#endregion
#endregion
#region Shapes
/// <summary>Tweens a RectTransform's anchoredPosition so that it draws a circle around the given center.
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations.<para/>
/// IMPORTANT: SetFrom(value) requires a <see cref="Vector2"/> instead of a float, where the X property represents the "from degrees value"</summary>
/// <param name="center">Circle-center/pivot around which to rotate (in UI anchoredPosition coordinates)</param>
/// <param name="endValueDegrees">The end value degrees to reach (to rotate counter-clockwise pass a negative value)</param>
/// <param name="duration">The duration of the tween</param>
/// <param name="relativeCenter">If TRUE the <see cref="center"/> coordinates will be considered as relative to the target's current anchoredPosition</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static TweenerCore<Vector2, Vector2, CircleOptions> DOShapeCircle(
this RectTransform target, Vector2 center, float endValueDegrees, float duration, bool relativeCenter = false, bool snapping = false
)
{
TweenerCore<Vector2, Vector2, CircleOptions> t = DOTween.To(
CirclePlugin.Get(), () => target.anchoredPosition, x => target.anchoredPosition = x, center, duration
);
t.SetOptions(endValueDegrees, relativeCenter, snapping).SetTarget(target);
return t;
}
#endregion
#endregion
// █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
// ███ INTERNAL CLASSES ████████████████████████████████████████████████████████████████████████████████████████████████
// █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
public static class Utils
{
/// <summary>
/// Converts the anchoredPosition of the first RectTransform to the second RectTransform,
/// taking into consideration offset, anchors and pivot, and returns the new anchoredPosition
/// </summary>
public static Vector2 SwitchToRectTransform(RectTransform from, RectTransform to)
{
Vector2 localPoint;
Vector2 fromPivotDerivedOffset = new Vector2(from.rect.width * 0.5f + from.rect.xMin, from.rect.height * 0.5f + from.rect.yMin);
Vector2 screenP = RectTransformUtility.WorldToScreenPoint(null, from.position);
screenP += fromPivotDerivedOffset;
RectTransformUtility.ScreenPointToLocalPointInRectangle(to, screenP, null, out localPoint);
Vector2 pivotDerivedOffset = new Vector2(to.rect.width * 0.5f + to.rect.xMin, to.rect.height * 0.5f + to.rect.yMin);
return to.anchoredPosition + localPoint - pivotDerivedOffset;
}
}
}
}
#endif

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0939b1841b95a9b4582da04055191349
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,389 @@
// Author: Daniele Giardini - http://www.demigiant.com
// Created: 2018/07/13
using System;
using UnityEngine;
using DG.Tweening.Core;
using DG.Tweening.Plugins.Options;
//#if UNITY_2018_1_OR_NEWER && (NET_4_6 || NET_STANDARD_2_0)
//using Task = System.Threading.Tasks.Task;
//#endif
#pragma warning disable 1591
namespace DG.Tweening
{
/// <summary>
/// Shortcuts/functions that are not strictly related to specific Modules
/// but are available only on some Unity versions
/// </summary>
public static class DOTweenModuleUnityVersion
{
#region Material
/// <summary>Tweens a Material's color using the given gradient
/// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
/// Also stores the image as the tween's target so it can be used for filtered operations</summary>
/// <param name="gradient">The gradient to use</param><param name="duration">The duration of the tween</param>
public static Sequence DOGradientColor(this Material target, Gradient gradient, float duration)
{
Sequence s = DOTween.Sequence();
GradientColorKey[] colors = gradient.colorKeys;
int len = colors.Length;
for (int i = 0; i < len; ++i) {
GradientColorKey c = colors[i];
if (i == 0 && c.time <= 0) {
target.color = c.color;
continue;
}
float colorDuration = i == len - 1
? duration - s.Duration(false) // Verifies that total duration is correct
: duration * (i == 0 ? c.time : c.time - colors[i - 1].time);
s.Append(target.DOColor(c.color, colorDuration).SetEase(Ease.Linear));
}
s.SetTarget(target);
return s;
}
/// <summary>Tweens a Material's named color property using the given gradient
/// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
/// Also stores the image as the tween's target so it can be used for filtered operations</summary>
/// <param name="gradient">The gradient to use</param>
/// <param name="property">The name of the material property to tween (like _Tint or _SpecColor)</param>
/// <param name="duration">The duration of the tween</param>
public static Sequence DOGradientColor(this Material target, Gradient gradient, string property, float duration)
{
Sequence s = DOTween.Sequence();
GradientColorKey[] colors = gradient.colorKeys;
int len = colors.Length;
for (int i = 0; i < len; ++i) {
GradientColorKey c = colors[i];
if (i == 0 && c.time <= 0) {
target.SetColor(property, c.color);
continue;
}
float colorDuration = i == len - 1
? duration - s.Duration(false) // Verifies that total duration is correct
: duration * (i == 0 ? c.time : c.time - colors[i - 1].time);
s.Append(target.DOColor(c.color, property, colorDuration).SetEase(Ease.Linear));
}
s.SetTarget(target);
return s;
}
#endregion
#region CustomYieldInstructions
/// <summary>
/// Returns a <see cref="CustomYieldInstruction"/> that waits until the tween is killed or complete.
/// It can be used inside a coroutine as a yield.
/// <para>Example usage:</para><code>yield return myTween.WaitForCompletion(true);</code>
/// </summary>
public static CustomYieldInstruction WaitForCompletion(this Tween t, bool returnCustomYieldInstruction)
{
if (!t.active) {
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
return null;
}
return new DOTweenCYInstruction.WaitForCompletion(t);
}
/// <summary>
/// Returns a <see cref="CustomYieldInstruction"/> that waits until the tween is killed or rewinded.
/// It can be used inside a coroutine as a yield.
/// <para>Example usage:</para><code>yield return myTween.WaitForRewind();</code>
/// </summary>
public static CustomYieldInstruction WaitForRewind(this Tween t, bool returnCustomYieldInstruction)
{
if (!t.active) {
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
return null;
}
return new DOTweenCYInstruction.WaitForRewind(t);
}
/// <summary>
/// Returns a <see cref="CustomYieldInstruction"/> that waits until the tween is killed.
/// It can be used inside a coroutine as a yield.
/// <para>Example usage:</para><code>yield return myTween.WaitForKill();</code>
/// </summary>
public static CustomYieldInstruction WaitForKill(this Tween t, bool returnCustomYieldInstruction)
{
if (!t.active) {
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
return null;
}
return new DOTweenCYInstruction.WaitForKill(t);
}
/// <summary>
/// Returns a <see cref="CustomYieldInstruction"/> that waits until the tween is killed or has gone through the given amount of loops.
/// It can be used inside a coroutine as a yield.
/// <para>Example usage:</para><code>yield return myTween.WaitForElapsedLoops(2);</code>
/// </summary>
/// <param name="elapsedLoops">Elapsed loops to wait for</param>
public static CustomYieldInstruction WaitForElapsedLoops(this Tween t, int elapsedLoops, bool returnCustomYieldInstruction)
{
if (!t.active) {
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
return null;
}
return new DOTweenCYInstruction.WaitForElapsedLoops(t, elapsedLoops);
}
/// <summary>
/// Returns a <see cref="CustomYieldInstruction"/> that waits until the tween is killed
/// or has reached the given time position (loops included, delays excluded).
/// It can be used inside a coroutine as a yield.
/// <para>Example usage:</para><code>yield return myTween.WaitForPosition(2.5f);</code>
/// </summary>
/// <param name="position">Position (loops included, delays excluded) to wait for</param>
public static CustomYieldInstruction WaitForPosition(this Tween t, float position, bool returnCustomYieldInstruction)
{
if (!t.active) {
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
return null;
}
return new DOTweenCYInstruction.WaitForPosition(t, position);
}
/// <summary>
/// Returns a <see cref="CustomYieldInstruction"/> that waits until the tween is killed or started
/// (meaning when the tween is set in a playing state the first time, after any eventual delay).
/// It can be used inside a coroutine as a yield.
/// <para>Example usage:</para><code>yield return myTween.WaitForStart();</code>
/// </summary>
public static CustomYieldInstruction WaitForStart(this Tween t, bool returnCustomYieldInstruction)
{
if (!t.active) {
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
return null;
}
return new DOTweenCYInstruction.WaitForStart(t);
}
#endregion
#if UNITY_2018_1_OR_NEWER
#region Unity 2018.1 or Newer
#region Material
/// <summary>Tweens a Material's named texture offset property with the given ID to the given value.
/// Also stores the material as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param>
/// <param name="propertyID">The ID of the material property to tween (also called nameID in Unity's manual)</param>
/// <param name="duration">The duration of the tween</param>
public static TweenerCore<Vector2, Vector2, VectorOptions> DOOffset(this Material target, Vector2 endValue, int propertyID, float duration)
{
if (!target.HasProperty(propertyID)) {
if (Debugger.logPriority > 0) Debugger.LogMissingMaterialProperty(propertyID);
return null;
}
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => target.GetTextureOffset(propertyID), x => target.SetTextureOffset(propertyID, x), endValue, duration);
t.SetTarget(target);
return t;
}
/// <summary>Tweens a Material's named texture scale property with the given ID to the given value.
/// Also stores the material as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param>
/// <param name="propertyID">The ID of the material property to tween (also called nameID in Unity's manual)</param>
/// <param name="duration">The duration of the tween</param>
public static TweenerCore<Vector2, Vector2, VectorOptions> DOTiling(this Material target, Vector2 endValue, int propertyID, float duration)
{
if (!target.HasProperty(propertyID)) {
if (Debugger.logPriority > 0) Debugger.LogMissingMaterialProperty(propertyID);
return null;
}
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => target.GetTextureScale(propertyID), x => target.SetTextureScale(propertyID, x), endValue, duration);
t.SetTarget(target);
return t;
}
#endregion
#region .NET 4.6 or Newer
#if UNITY_2018_1_OR_NEWER && (NET_4_6 || NET_STANDARD_2_0)
#region Async Instructions
/// <summary>
/// Returns an async <see cref="System.Threading.Tasks.Task"/> that waits until the tween is killed or complete.
/// It can be used inside an async operation.
/// <para>Example usage:</para><code>await myTween.WaitForCompletion();</code>
/// </summary>
public static async System.Threading.Tasks.Task AsyncWaitForCompletion(this Tween t)
{
if (!t.active) {
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
return;
}
while (t.active && !t.IsComplete()) await System.Threading.Tasks.Task.Yield();
}
/// <summary>
/// Returns an async <see cref="System.Threading.Tasks.Task"/> that waits until the tween is killed or rewinded.
/// It can be used inside an async operation.
/// <para>Example usage:</para><code>await myTween.AsyncWaitForRewind();</code>
/// </summary>
public static async System.Threading.Tasks.Task AsyncWaitForRewind(this Tween t)
{
if (!t.active) {
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
return;
}
while (t.active && (!t.playedOnce || t.position * (t.CompletedLoops() + 1) > 0)) await System.Threading.Tasks.Task.Yield();
}
/// <summary>
/// Returns an async <see cref="System.Threading.Tasks.Task"/> that waits until the tween is killed.
/// It can be used inside an async operation.
/// <para>Example usage:</para><code>await myTween.AsyncWaitForKill();</code>
/// </summary>
public static async System.Threading.Tasks.Task AsyncWaitForKill(this Tween t)
{
if (!t.active) {
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
return;
}
while (t.active) await System.Threading.Tasks.Task.Yield();
}
/// <summary>
/// Returns an async <see cref="System.Threading.Tasks.Task"/> that waits until the tween is killed or has gone through the given amount of loops.
/// It can be used inside an async operation.
/// <para>Example usage:</para><code>await myTween.AsyncWaitForElapsedLoops();</code>
/// </summary>
/// <param name="elapsedLoops">Elapsed loops to wait for</param>
public static async System.Threading.Tasks.Task AsyncWaitForElapsedLoops(this Tween t, int elapsedLoops)
{
if (!t.active) {
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
return;
}
while (t.active && t.CompletedLoops() < elapsedLoops) await System.Threading.Tasks.Task.Yield();
}
/// <summary>
/// Returns an async <see cref="System.Threading.Tasks.Task"/> that waits until the tween is killed or started
/// (meaning when the tween is set in a playing state the first time, after any eventual delay).
/// It can be used inside an async operation.
/// <para>Example usage:</para><code>await myTween.AsyncWaitForPosition();</code>
/// </summary>
/// <param name="position">Position (loops included, delays excluded) to wait for</param>
public static async System.Threading.Tasks.Task AsyncWaitForPosition(this Tween t, float position)
{
if (!t.active) {
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
return;
}
while (t.active && t.position * (t.CompletedLoops() + 1) < position) await System.Threading.Tasks.Task.Yield();
}
/// <summary>
/// Returns an async <see cref="System.Threading.Tasks.Task"/> that waits until the tween is killed.
/// It can be used inside an async operation.
/// <para>Example usage:</para><code>await myTween.AsyncWaitForKill();</code>
/// </summary>
public static async System.Threading.Tasks.Task AsyncWaitForStart(this Tween t)
{
if (!t.active) {
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
return;
}
while (t.active && !t.playedOnce) await System.Threading.Tasks.Task.Yield();
}
#endregion
#endif
#endregion
#endregion
#endif
}
// █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
// ███ CLASSES █████████████████████████████████████████████████████████████████████████████████████████████████████████
// █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
public static class DOTweenCYInstruction
{
public class WaitForCompletion : CustomYieldInstruction
{
public override bool keepWaiting { get {
return t.active && !t.IsComplete();
}}
readonly Tween t;
public WaitForCompletion(Tween tween)
{
t = tween;
}
}
public class WaitForRewind : CustomYieldInstruction
{
public override bool keepWaiting { get {
return t.active && (!t.playedOnce || t.position * (t.CompletedLoops() + 1) > 0);
}}
readonly Tween t;
public WaitForRewind(Tween tween)
{
t = tween;
}
}
public class WaitForKill : CustomYieldInstruction
{
public override bool keepWaiting { get {
return t.active;
}}
readonly Tween t;
public WaitForKill(Tween tween)
{
t = tween;
}
}
public class WaitForElapsedLoops : CustomYieldInstruction
{
public override bool keepWaiting { get {
return t.active && t.CompletedLoops() < elapsedLoops;
}}
readonly Tween t;
readonly int elapsedLoops;
public WaitForElapsedLoops(Tween tween, int elapsedLoops)
{
t = tween;
this.elapsedLoops = elapsedLoops;
}
}
public class WaitForPosition : CustomYieldInstruction
{
public override bool keepWaiting { get {
return t.active && t.position * (t.CompletedLoops() + 1) < position;
}}
readonly Tween t;
readonly float position;
public WaitForPosition(Tween tween, float position)
{
t = tween;
this.position = position;
}
}
public class WaitForStart : CustomYieldInstruction
{
public override bool keepWaiting { get {
return t.active && !t.playedOnce;
}}
readonly Tween t;
public WaitForStart(Tween tween)
{
t = tween;
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 2323c1e96e57fd14ca6aa6b9d3403f10
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,167 @@
// Author: Daniele Giardini - http://www.demigiant.com
// Created: 2018/07/13
using System;
using System.Reflection;
using UnityEngine;
using DG.Tweening.Core;
using DG.Tweening.Plugins.Core.PathCore;
using DG.Tweening.Plugins.Options;
#pragma warning disable 1591
namespace DG.Tweening
{
/// <summary>
/// Utility functions that deal with available Modules.
/// Modules defines:
/// - DOTAUDIO
/// - DOTPHYSICS
/// - DOTPHYSICS2D
/// - DOTSPRITE
/// - DOTUI
/// Extra defines set and used for implementation of external assets:
/// - DOTWEEN_TMP ► TextMesh Pro
/// - DOTWEEN_TK2D ► 2D Toolkit
/// </summary>
public static class DOTweenModuleUtils
{
static bool _initialized;
#region Reflection
/// <summary>
/// Called via Reflection by DOTweenComponent on Awake
/// </summary>
#if UNITY_2018_1_OR_NEWER
[UnityEngine.Scripting.Preserve]
#endif
public static void Init()
{
if (_initialized) return;
_initialized = true;
DOTweenExternalCommand.SetOrientationOnPath += Physics.SetOrientationOnPath;
#if UNITY_EDITOR
#if UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1
UnityEditor.EditorApplication.playmodeStateChanged += PlaymodeStateChanged;
#else
UnityEditor.EditorApplication.playModeStateChanged += PlaymodeStateChanged;
#endif
#endif
}
#if UNITY_2018_1_OR_NEWER
#pragma warning disable
[UnityEngine.Scripting.Preserve]
// Just used to preserve methods when building, never called
static void Preserver()
{
Assembly[] loadedAssemblies = AppDomain.CurrentDomain.GetAssemblies();
MethodInfo mi = typeof(MonoBehaviour).GetMethod("Stub");
}
#pragma warning restore
#endif
#endregion
#if UNITY_EDITOR
// Fires OnApplicationPause in DOTweenComponent even when Editor is paused (otherwise it's only fired at runtime)
#if UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1
static void PlaymodeStateChanged()
#else
static void PlaymodeStateChanged(UnityEditor.PlayModeStateChange state)
#endif
{
if (DOTween.instance == null) return;
DOTween.instance.OnApplicationPause(UnityEditor.EditorApplication.isPaused);
}
#endif
// █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
// ███ INTERNAL CLASSES ████████████████████████████████████████████████████████████████████████████████████████████████
// █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
public static class Physics
{
// Called via DOTweenExternalCommand callback
public static void SetOrientationOnPath(PathOptions options, Tween t, Quaternion newRot, Transform trans)
{
#if true // PHYSICS_MARKER
if (options.isRigidbody) ((Rigidbody)t.target).rotation = newRot;
else trans.rotation = newRot;
#else
trans.rotation = newRot;
#endif
}
// Returns FALSE if the DOTween's Physics2D Module is disabled, or if there's no Rigidbody2D attached
public static bool HasRigidbody2D(Component target)
{
#if true // PHYSICS2D_MARKER
return target.GetComponent<Rigidbody2D>() != null;
#else
return false;
#endif
}
#region Called via Reflection
// Called via Reflection by DOTweenPathInspector
// Returns FALSE if the DOTween's Physics Module is disabled, or if there's no rigidbody attached
#if UNITY_2018_1_OR_NEWER
[UnityEngine.Scripting.Preserve]
#endif
public static bool HasRigidbody(Component target)
{
#if true // PHYSICS_MARKER
return target.GetComponent<Rigidbody>() != null;
#else
return false;
#endif
}
// Called via Reflection by DOTweenPath
#if UNITY_2018_1_OR_NEWER
[UnityEngine.Scripting.Preserve]
#endif
public static TweenerCore<Vector3, Path, PathOptions> CreateDOTweenPathTween(
MonoBehaviour target, bool tweenRigidbody, bool isLocal, Path path, float duration, PathMode pathMode
){
TweenerCore<Vector3, Path, PathOptions> t = null;
bool rBodyFoundAndTweened = false;
#if true // PHYSICS_MARKER
if (tweenRigidbody) {
Rigidbody rBody = target.GetComponent<Rigidbody>();
if (rBody != null) {
rBodyFoundAndTweened = true;
t = isLocal
? rBody.DOLocalPath(path, duration, pathMode)
: rBody.DOPath(path, duration, pathMode);
}
}
#endif
#if true // PHYSICS2D_MARKER
if (!rBodyFoundAndTweened && tweenRigidbody) {
Rigidbody2D rBody2D = target.GetComponent<Rigidbody2D>();
if (rBody2D != null) {
rBodyFoundAndTweened = true;
t = isLocal
? rBody2D.DOLocalPath(path, duration, pathMode)
: rBody2D.DOPath(path, duration, pathMode);
}
}
#endif
if (!rBodyFoundAndTweened) {
t = isLocal
? target.transform.DOLocalPath(path, duration, pathMode)
: target.transform.DOPath(path, duration, pathMode);
}
return t;
}
#endregion
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 34faaadcd2d3ead45a8edf1ece51a14e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

29
Assets/DOTween/readme.txt Normal file
View File

@@ -0,0 +1,29 @@
DOTween and DOTween Pro are copyright (c) 2014-2018 Daniele Giardini - Demigiant
// IMPORTANT!!! /////////////////////////////////////////////
// Upgrading DOTween from versions older than 1.2.000 ///////
// (or DOTween Pro older than 1.0.000) //////////////////////
-------------------------------------------------------------
If you're upgrading your project from a version of DOTween older than 1.2.000 (or DOTween Pro older than 1.0.000) please follow these instructions carefully.
1) Import the new version in the same folder as the previous one, overwriting old files. A lot of errors will appear but don't worry
2) Close and reopen Unity (and your project). This is fundamental: skipping this step will cause a bloodbath
3) Open DOTween's Utility Panel (Tools > Demigiant > DOTween Utility Panel) if it doesn't open automatically, then press "Setup DOTween...": this will run the upgrade setup
4) From the Add/Remove Modules panel that opens, activate/deactivate Modules for Unity systems and for external assets (Pro version only)
// GET STARTED //////////////////////////////////////////////
- After importing a new DOTween update, select DOTween's Utility Panel from the "Tools/Demigiant" menu (if it doesn't open automatically) and press the "Setup DOTween..." button to activate/deactivate Modules. You can also access a Preferences Tab from there to choose default settings for DOTween.
- In your code, add "using DG.Tweening" to each class where you want to use DOTween.
- You're ready to tween. Check out the links below for full documentation and license info.
// LINKS ///////////////////////////////////////////////////////
DOTween website (documentation, examples, etc): http://dotween.demigiant.com
DOTween license: http://dotween.demigiant.com/license.php
DOTween repository (Google Code): https://code.google.com/p/dotween/
Demigiant website (documentation, examples, etc): http://www.demigiant.com
// NOTES //////////////////////////////////////////////////////
- DOTween's Utility Panel can be found under "Tools > Demigiant > DOTween Utility Panel" and also contains other useful options, plus a tab to set DOTween's preferences

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 46ecd50ddb7804d488bee4738799bba9
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,144 @@
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;
[CustomPropertyDrawer(typeof(ShapeScannerConfiguration))]
public class BoolMatrixDrawer : PropertyDrawer
{
private const float ToggleSize = 18f;
private const float RowLabelWidth = 24f;
private const float Padding = 2f;
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
{
var rowsProp = property.FindPropertyRelative("rows");
var columnsProp = property.FindPropertyRelative("columns");
int rows = rowsProp != null ? rowsProp.arraySize : 0;
int cols = Mathf.Max(0, columnsProp != null ? columnsProp.intValue : 0);
// Header (one line), columns field (one line), buttons (one line), then one line per row
int totalLines = 1 + 1 + 1 + Mathf.Max(1, rows);
float lineHeight = EditorGUIUtility.singleLineHeight + Padding;
return totalLines * lineHeight + Padding;
}
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
EditorGUI.BeginProperty(position, label, property);
var rowsProp = property.FindPropertyRelative("rows");
var columnsProp = property.FindPropertyRelative("columns");
if (rowsProp == null || columnsProp == null)
{
EditorGUI.HelpBox(position, "BoolMatrix is missing 'rows' or 'columns' properties.", MessageType.Error);
EditorGUI.EndProperty();
return;
}
// Layout helper
float lineHeight = EditorGUIUtility.singleLineHeight;
Rect line = new Rect(position.x, position.y, position.width, lineHeight);
// Header
EditorGUI.LabelField(line, label, EditorStyles.boldLabel);
line.y += lineHeight + Padding;
// Draw requiredCorrectPercentage
var requiredCorrectProp = property.FindPropertyRelative("requiredCorrectPercentage");
EditorGUI.PropertyField(line, requiredCorrectProp, new GUIContent("Required Correct Percentage"));
line.y += lineHeight + Padding;
// Columns field
EditorGUI.BeginChangeCheck();
int cols = Mathf.Max(0, EditorGUI.IntField(line, "Columns", columnsProp.intValue));
if (EditorGUI.EndChangeCheck())
{
columnsProp.intValue = cols;
// Resize each row to match new column count
for (int r = 0; r < rowsProp.arraySize; r++)
{
var rowProp = rowsProp.GetArrayElementAtIndex(r);
var cellsProp = rowProp.FindPropertyRelative("cells");
ResizeBoolArray(cellsProp, cols);
}
}
line.y += lineHeight + Padding;
// Row controls (Add/Remove)
using (new EditorGUI.IndentLevelScope())
{
Rect left = new Rect(line.x, line.y, 120, lineHeight);
if (GUI.Button(left, "Add Row"))
{
int newIndex = rowsProp.arraySize;
rowsProp.InsertArrayElementAtIndex(newIndex);
var rowProp = rowsProp.GetArrayElementAtIndex(newIndex);
var cellsProp = rowProp.FindPropertyRelative("cells");
ResizeBoolArray(cellsProp, columnsProp.intValue);
}
Rect right = new Rect(line.x + 130, line.y, 140, lineHeight);
if (GUI.Button(right, "Remove Last Row") && rowsProp.arraySize > 0)
{
rowsProp.DeleteArrayElementAtIndex(rowsProp.arraySize - 1);
}
}
line.y += lineHeight + Padding;
// Draw grid
int rowCount = rowsProp.arraySize;
int colCount = Mathf.Max(0, columnsProp.intValue);
for (int r = 0; r < rowCount; r++)
{
var rowProp = rowsProp.GetArrayElementAtIndex(r);
var cellsProp = rowProp.FindPropertyRelative("cells");
// Ensure row width
if (cellsProp.arraySize != colCount)
ResizeBoolArray(cellsProp, colCount);
// Row label
Rect rowLabel = new Rect(line.x, line.y, RowLabelWidth, lineHeight);
EditorGUI.LabelField(rowLabel, $"R{r}");
// Toggle strip
float startX = rowLabel.x + RowLabelWidth + Padding;
for (int c = 0; c < colCount; c++)
{
Rect toggleRect = new Rect(startX + c * (ToggleSize + 2), line.y, ToggleSize, lineHeight);
var cellProp = cellsProp.GetArrayElementAtIndex(c);
bool newVal = EditorGUI.Toggle(toggleRect, GUIContent.none, cellProp.boolValue);
if (newVal != cellProp.boolValue) cellProp.boolValue = newVal;
}
line.y += lineHeight + Padding;
}
EditorGUI.EndProperty();
}
private void ResizeBoolArray(SerializedProperty listProp, int newSize)
{
if (listProp == null) return;
newSize = Mathf.Max(0, newSize);
// Grow
while (listProp.arraySize < newSize)
{
int i = listProp.arraySize;
listProp.InsertArrayElementAtIndex(i);
var elem = listProp.GetArrayElementAtIndex(i);
elem.boolValue = false;
}
// Shrink
while (listProp.arraySize > newSize)
{
listProp.DeleteArrayElementAtIndex(listProp.arraySize - 1);
}
}
}
#endif

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e3da5d98c11c1b54fb05eda4624de9e3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,78 +1,113 @@
fileFormatVersion: 2
guid: 684d4d47a018ed14080e15f4c99b8e86
PluginImporter:
serializedVersion: 1
iconMap: {}
executionOrder: {}
isPreloaded: 0
platformData:
Android:
enabled: 0
settings:
CPU: AnyCPU
Any:
enabled: 0
settings: {}
Editor:
enabled: 1
settings:
CPU: x86_64
DefaultValueInitialized: true
OS: Windows
Linux:
enabled: 1
settings:
CPU: None
Linux64:
enabled: 1
settings:
CPU: x86_64
LinuxUniversal:
enabled: 1
settings:
CPU: AnyCPU
OSXIntel:
enabled: 1
settings:
CPU: None
OSXIntel64:
enabled: 1
settings:
CPU: AnyCPU
OSXUniversal:
enabled: 1
settings:
CPU: AnyCPU
SamsungTV:
enabled: 0
settings:
STV_MODEL: STANDARD_13
WP8:
enabled: 0
settings:
CPU: AnyCPU
DontProcess: False
PlaceholderPath:
Win:
enabled: 0
settings:
CPU: None
Win64:
enabled: 1
settings:
CPU: AnyCPU
WindowsStoreApps:
enabled: 0
settings:
CPU: AnyCPU
DontProcess: False
PlaceholderPath:
SDK: AnySDK
iOS:
enabled: 0
settings:
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 684d4d47a018ed14080e15f4c99b8e86
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Linux
second:
enabled: 1
settings:
CPU: None
- first:
: LinuxUniversal
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
: OSXIntel
second:
enabled: 1
settings:
CPU: None
- first:
: OSXIntel64
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
: SamsungTV
second:
enabled: 0
settings:
STV_MODEL: STANDARD_13
- first:
: WP8
second:
enabled: 0
settings:
CPU: AnyCPU
DontProcess: False
PlaceholderPath:
- first:
Android: Android
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
CPU: x86_64
DefaultValueInitialized: true
OS: Windows
- first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Standalone: OSXUniversal
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
DontProcess: False
PlaceholderPath:
SDK: AnySDK
- first:
iPhone: iOS
second:
enabled: 0
settings:
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c804fa0053329e542b265d63913b22f9
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3ca33810cadcc3f438e1c22aef4b84e2
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: fdd84c412b9f8e54190abf5fb9d822e8
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,168 @@
0.00000005
0.00976478
0.06966095
0.11400993
0.09826222
0.10716633
0.11156878
0.11386923
0.11293598
0.09519649
0.05549636
0.03186045
0.00799335
0.00208657
0.01089917
0.02948251
0.07600929
0.15814704
0.13448687
0.08875589
0.06960066
0.05465629
0.05383034
0.03375315
0.01798626
0.00903232
0.00799542
0.02053360
0.06305894
0.09196710
0.07186788
0.07499532
0.09185784
0.11605315
0.08948176
0.06202143
0.02427259
0.01920115
0.03728020
0.02404936
0.01609998
0.00542380
0.00179925
0.03281874
0.12393293
0.11669078
0.07150501
0.07261675
0.05895000
0.02683805
0.00744165
0.01501589
0.09919582
0.12428769
0.09655690
0.08892953
0.07542110
0.06164465
0.05283893
0.03832930
0.01229283
0.00557980
0.01542125
0.02689189
0.06319195
0.06572682
0.05012595
0.02069737
0.00488327
0.00045144
0.01276009
0.03819229
0.13480978
0.10705144
0.12480368
0.09681138
0.09063327
0.08301903
0.08833897
0.05224864
0.06203420
0.06825771
0.08839153
0.10655218
0.09285064
0.07988417
0.02825463
0.00807424
0.01627477
0.06356759
0.09227574
0.06330188
0.04019375
0.07792944
0.11176777
0.10798519
0.09169098
0.08477106
0.05246169
0.04429314
0.03014688
0.03684431
0.05006878
0.06097272
0.11005671
0.08410334
0.06912398
0.07506070
0.09146897
0.11297650
0.09489990
0.06680481
0.05964828
0.04534741
0.03887988
0.03742144
0.03260198
0.08300947
0.10424797
0.07701992
0.04767869
0.03736623
0.01780312
0.05935202
0.05695170
0.08781324
0.08706025
0.07263785
0.04034188
0.01208277
0.00273624
0.02033784
0.05659007
0.11546759
0.09032799
0.08144097
0.05791039
0.06622963
0.07879984
0.08420734
0.07772876
0.08824874
0.09339322
0.08510461
0.10374726
0.10016365
0.09146269
0.08228803
0.06607678
0.07305381
0.12082936
0.07801384
0.04382810
0.02706146
0.00702685
0.00179999
0.00032635
0.00767739
0.02098716
0.06297999
0.11500420
0.09405034
0.07954524
0.06857828
0.02575643
0.00888365
0.00215102
0.00031409

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: c09ef060761f3cf4d9526e32e9220761
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: b95ea1a21a2515b428e818f2ba0071ab
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,92 @@
0.00434861
0.15225612
0.18499607
0.14871970
0.09575270
0.05960602
0.05033638
0.07510921
0.04664830
0.02834563
0.01082086
0.00668127
0.04675438
0.14858925
0.14371063
0.05670096
0.02300100
0.00552528
0.00250856
0.01825455
0.07576559
0.14419381
0.06392843
0.02534810
0.00747134
0.00151390
0.00022807
0.02429605
0.02091622
0.06989617
0.07635597
0.03454457
0.03409107
0.02278890
0.00715933
0.00192519
0.00030613
0.00000284
0.02385169
0.10222999
0.14190714
0.11639863
0.03321828
0.01192793
0.00470718
0.01410322
0.05166848
0.06286184
0.05359680
0.05048560
0.03622537
0.02455385
0.01695082
0.01145297
0.00445301
0.00150740
0.00562047
0.01800491
0.03364548
0.11804645
0.08759149
0.04836771
0.12022526
0.13559093
0.07077730
0.04081443
0.04367446
0.10380383
0.10307117
0.10235971
0.07419233
0.02037669
0.00552032
0.00176534
0.02639177
0.06864288
0.11804061
0.06189754
0.03686416
0.01236848
0.00286383
0.00033570
0.01245204
0.01039247
0.03769197
0.06433371
0.05127039
0.03981606
0.01605481
0.00355853
0.00043253
0.00000782

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 908fe8959c7f28c4f924a81be3fb6aac
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 6a5c837d928416b468e7886bb15a44ea
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,90 @@
0.00000005
0.00000004
0.00000000
0.00000000
0.00514347
0.12242249
0.16971119
0.13582765
0.12333524
0.08698384
0.07375294
0.03015414
0.01129228
0.00300087
0.00589529
0.05051940
0.15055235
0.07481380
0.02764326
0.02446531
0.02695649
0.00903005
0.12266055
0.12336259
0.10076692
0.06106191
0.01532460
0.00757407
0.00167595
0.02291654
0.11288993
0.12273274
0.09359326
0.08250733
0.04036976
0.03188109
0.00954785
0.00236195
0.00023309
0.01550246
0.07376833
0.11958984
0.10579686
0.09450035
0.06891822
0.02370342
0.01322692
0.01963426
0.01369390
0.00609310
0.00832349
0.01532572
0.08368593
0.08076419
0.07584491
0.05285665
0.07504742
0.10419378
0.12409391
0.09046285
0.07618727
0.07667787
0.06099373
0.09733831
0.10310517
0.10288658
0.08806517
0.05028646
0.01904663
0.00516759
0.00126559
0.04444221
0.07765476
0.09415349
0.03209703
0.01003896
0.00358076
0.00421197
0.03286948
0.12230144
0.12415840
0.10367641
0.09912375
0.09256881
0.07025180
0.03993273
0.02144943
0.00589098
0.00086268
0.00002253

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 5f5a85facf612164b99c5a9a34c378fd
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: d6c33fb52eb7c5d48b88b1ce923918e4
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,181 @@
0.00000005
0.00000003
0.00134183
0.13024299
0.12468736
0.07844518
0.02632027
0.03940329
0.03637667
0.03451734
0.04975815
0.10780431
0.10106440
0.06787032
0.05280538
0.02538008
0.03272702
0.03500053
0.02327127
0.01346107
0.00640443
0.00112193
0.00092438
0.00030068
0.00001169
0.00000006
0.00000004
0.00000004
0.00000003
0.00000003
0.00000003
0.00000002
0.00000002
0.00000002
0.00000002
0.00000001
0.00000001
0.00000001
0.00000001
0.03499965
0.08563241
0.12597364
0.10322613
0.11053512
0.11199702
0.10472351
0.10365929
0.08029900
0.08644674
0.07661451
0.06823436
0.06495754
0.05017138
0.01795574
0.00577139
0.05051259
0.10167977
0.10805573
0.08757588
0.09493958
0.08166013
0.04920715
0.03913362
0.04947521
0.05074035
0.04346962
0.04095999
0.07345695
0.10197105
0.11581951
0.10427098
0.05640880
0.01756050
0.00630845
0.02360720
0.09064519
0.09982020
0.07884745
0.06099218
0.07507920
0.06901558
0.03501711
0.00988735
0.00216163
0.01661992
0.11633921
0.11436959
0.11475692
0.09225911
0.11577103
0.10790673
0.11090566
0.08682907
0.12614785
0.09752236
0.08634012
0.08609299
0.07784101
0.04710400
0.05606398
0.06765103
0.11536230
0.07678806
0.05070975
0.04437205
0.03378493
0.00822868
0.00808467
0.02768021
0.06495066
0.07356765
0.08016616
0.06206624
0.02906631
0.02971899
0.08445830
0.07069516
0.01808286
0.00556112
0.03590908
0.12194905
0.12015835
0.09904143
0.05646089
0.02886644
0.00999502
0.00305107
0.00798466
0.02665779
0.07483964
0.08626766
0.07748236
0.05114794
0.03580339
0.00761036
0.00409649
0.01140328
0.12555751
0.13516958
0.11267319
0.10786965
0.10757268
0.10438777
0.06993058
0.03142576
0.01754347
0.03943891
0.11406928
0.09105960
0.02574994
0.00848062
0.00273720
0.00044038
0.00000258
0.00959425
0.02373138
0.08384808
0.05525417
0.02376885
0.00782859
0.01055001
0.15324524
0.11578597
0.05352928
0.01489034
0.01905741
0.02479430
0.07339220
0.07774475
0.10909086
0.10109514
0.09618052
0.08066712
0.05435868
0.04085002
0.03733978
0.01905741
0.00566248
0.00257108
0.00016242
0.00000371

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 52e006025737f724ea66fdf9a5d8f22f
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 659e5b6b771c6e84288fab70870e71ca
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,175 @@
0.00000008
0.05711631
0.13727279
0.11459202
0.03337459
0.01819381
0.03223292
0.03467755
0.03427369
0.04487722
0.08197841
0.11049814
0.07563315
0.05749729
0.06850608
0.10744919
0.10065494
0.06882607
0.02798240
0.01315300
0.00428146
0.00108857
0.00006360
0.00000024
0.00000006
0.00000006
0.00000006
0.00000008
0.00000020
0.00000004
0.00000007
0.00000006
0.00000007
0.00000006
0.01391471
0.06861996
0.12066421
0.11351002
0.11520540
0.10860203
0.10926522
0.11349389
0.10871581
0.11524959
0.08125452
0.07995488
0.05898436
0.04797968
0.05085546
0.06513986
0.01848445
0.00758190
0.02371630
0.06067926
0.10132238
0.11432362
0.10586330
0.05982589
0.04446789
0.04420068
0.03777865
0.03665984
0.03350522
0.03234584
0.12710874
0.13773943
0.08997412
0.05824554
0.01627955
0.00571881
0.01870689
0.06255665
0.07465204
0.08244786
0.07169620
0.07131994
0.05613898
0.04447524
0.01333401
0.02116397
0.10237920
0.12451947
0.13596430
0.13040395
0.09396405
0.10652626
0.08535663
0.10782580
0.13579737
0.09642343
0.08209698
0.05839134
0.03152125
0.03501086
0.05183903
0.07905335
0.08026721
0.04216202
0.04066528
0.04985600
0.02265272
0.00599996
0.00608675
0.00826208
0.00877988
0.01136276
0.04591941
0.16162856
0.13798247
0.08383475
0.05110219
0.01848392
0.00885163
0.00196739
0.01497450
0.03129566
0.06956071
0.10771310
0.08054388
0.05364374
0.01935722
0.00480090
0.00056256
0.00292951
0.01596380
0.08476386
0.11729466
0.06863342
0.07483341
0.04754725
0.01636336
0.00562554
0.01703124
0.12976801
0.12646583
0.10015881
0.11218950
0.10905908
0.10649553
0.06135194
0.04505662
0.02538692
0.03665165
0.07867492
0.07667469
0.06711641
0.03183642
0.01399610
0.01375836
0.00698296
0.00207029
0.01024103
0.01465667
0.04541592
0.05201961
0.07101289
0.05806474
0.04519088
0.17134388
0.12499588
0.06555651
0.03151344
0.01197932
0.01835134
0.03336206
0.07903263
0.10734255
0.09655602
0.08513983
0.06991321
0.05536121
0.03464093
0.01632907
0.00167515
0.00001044

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 485f61bc00718904aa5fa8df5e288f29
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: a802a304ac7a06f4aa7ec3a5343ec6ca
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,54 @@
0.00000005
0.00000003
0.00000000
0.00046962
0.04368704
0.09481914
0.09917746
0.09798139
0.09720682
0.07568779
0.05746364
0.02935625
0.00886832
0.00160193
0.03799986
0.05539151
0.08533625
0.09498303
0.09084434
0.10286050
0.10712945
0.08620108
0.05779895
0.02999892
0.01107864
0.01394148
0.08225059
0.11010544
0.14526850
0.10906731
0.09490130
0.06208584
0.04646730
0.04695348
0.08823004
0.08648589
0.08562476
0.08226661
0.07583391
0.07191155
0.05825438
0.08988712
0.11800215
0.09934701
0.11600174
0.10284381
0.09446625
0.09187573
0.04557432
0.02692474
0.01360523
0.00308691
0.00068955
0.00001893

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 763ce7fc421c98b47b38fd863f5303b6
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 9d9d2a3944a244a4cb506fe9a06b6eab
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,176 @@
0.00035734
0.00317895
0.00522986
0.01126348
0.01625622
0.00403369
0.00128680
0.00025250
0.01376316
0.13387848
0.16045359
0.11010874
0.05988159
0.02221663
0.00872939
0.00279509
0.03551053
0.03648495
0.04531212
0.07673535
0.10955378
0.13902943
0.07736161
0.04115365
0.01760411
0.00529819
0.01142427
0.02385265
0.08705520
0.12682062
0.08821530
0.04272503
0.03402210
0.11988512
0.11482846
0.10272246
0.05937527
0.08768967
0.09089566
0.08039393
0.09804015
0.11620566
0.08121215
0.05067646
0.02063093
0.02843744
0.05073565
0.11158347
0.10401250
0.07668661
0.05409725
0.01623925
0.00549514
0.02640846
0.06240885
0.10545796
0.10017704
0.08905054
0.09294581
0.06916250
0.03144984
0.00853616
0.00214288
0.00033765
0.00031021
0.00009906
0.00000003
0.00000007
0.00000011
0.00000010
0.00000012
0.01188716
0.12818666
0.12017393
0.10633220
0.08355843
0.07541411
0.03788725
0.01852310
0.00303940
0.01135555
0.05099490
0.14416704
0.07741622
0.07464023
0.05391997
0.06022602
0.03167658
0.00930351
0.00299611
0.01921055
0.02565342
0.08661601
0.12806430
0.13362658
0.11605786
0.08956026
0.11099907
0.09601893
0.12107093
0.12747106
0.05225842
0.02421024
0.05594429
0.01192079
0.03146134
0.06648590
0.07210974
0.06605974
0.07960039
0.06560139
0.05629542
0.09063371
0.07429472
0.07451615
0.04158938
0.07059839
0.10493130
0.13294564
0.11721240
0.08723471
0.04541561
0.01706385
0.02076782
0.01165404
0.02795471
0.07473504
0.14457630
0.12650295
0.09319439
0.03555974
0.01783938
0.00517579
0.00071079
0.00000897
0.00000038
0.00030529
0.00613103
0.03505980
0.08634492
0.10601639
0.06033953
0.02520386
0.05365517
0.04069392
0.06724963
0.09476259
0.08799524
0.06538707
0.06248809
0.05721865
0.06171366
0.04908372
0.05924495
0.05382480
0.05593704
0.05312730
0.06173056
0.05453867
0.07989717
0.11181595
0.10462585
0.04600155
0.02939134
0.04698037
0.06139401
0.09290544
0.12652060
0.11471691
0.08270022
0.06177935
0.02388656
0.00733134
0.00337623
0.00054495
0.00010149

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 568528151b48dde41afb57442e9fb79c
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 45fe15686901bcf4d806b3fcfa9767af
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,179 @@
0.00006651
0.00272296
0.00416831
0.00613240
0.01400007
0.00611815
0.00172745
0.00035091
0.00542576
0.05730513
0.10239989
0.09973215
0.07135049
0.04593844
0.01314271
0.00341648
0.00919481
0.03490015
0.11891712
0.14427045
0.14089674
0.11541290
0.06114697
0.01245919
0.02396511
0.02041544
0.04967305
0.08356208
0.10683713
0.04407730
0.01939667
0.05765126
0.11775328
0.08568342
0.07941543
0.04329414
0.03034952
0.05300198
0.07545046
0.09811859
0.12698843
0.11008044
0.04125893
0.01690617
0.00559947
0.03229237
0.11572060
0.13573837
0.10000201
0.06665666
0.02862320
0.00988190
0.00491564
0.00317531
0.07727695
0.13759853
0.11148883
0.04313809
0.03761870
0.02492973
0.02110572
0.00512524
0.00042069
0.00016137
0.00000437
0.00000018
0.00000012
0.00000011
0.00000780
0.02584597
0.09738695
0.11136233
0.10692869
0.08470456
0.07692712
0.04786270
0.01502901
0.00441649
0.01230767
0.08723252
0.10682777
0.08738386
0.06790664
0.06157994
0.05408455
0.03372269
0.00904522
0.00611802
0.01275058
0.01515854
0.09083287
0.10450071
0.13025539
0.11917285
0.10834516
0.09689986
0.14618123
0.07720425
0.03433722
0.02967872
0.06113090
0.09168280
0.10633759
0.07331663
0.06737662
0.06489260
0.07385729
0.07205108
0.09435874
0.11798398
0.12480668
0.10564166
0.12307809
0.06730109
0.02228388
0.00726003
0.00543956
0.01570472
0.04078079
0.04808420
0.09414001
0.11596058
0.09565762
0.06237603
0.03154003
0.01635168
0.00217235
0.00029528
0.01236050
0.01586983
0.01257687
0.00767481
0.00340793
0.01702167
0.01174621
0.03607225
0.06784455
0.07041398
0.08319151
0.05716323
0.13491862
0.07062941
0.01842327
0.00566531
0.03429366
0.04546195
0.08834475
0.13020474
0.11044439
0.11442656
0.08893354
0.06367651
0.05020634
0.07907210
0.07676227
0.04939859
0.03887330
0.05178530
0.06513581
0.06614438
0.09262551
0.11383794
0.11059330
0.06562757
0.02820417
0.01545060
0.03237373
0.05024768
0.04197123
0.05402189
0.12459128
0.10853425
0.08427958
0.05402030
0.02389842
0.01399011
0.00611045
0.00143074
0.00027289

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: a0c231d5f740ac34597ebcbc02cd300c
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: d0a0941231c25de4599a045b84fbbbe4
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,96 @@
0.00000005
0.01019074
0.06427509
0.15702626
0.10349131
0.07500124
0.07648914
0.05543821
0.05572528
0.01877004
0.02965689
0.09465924
0.09512092
0.09429209
0.06876548
0.05024434
0.03935412
0.02597354
0.01265635
0.01399479
0.10712919
0.11683569
0.09561371
0.06471479
0.04369099
0.03436543
0.03138619
0.03612176
0.10426113
0.13121501
0.11742863
0.08312004
0.08122931
0.06909545
0.05385699
0.03251035
0.01527070
0.08774096
0.14272647
0.11196662
0.09227988
0.10476685
0.08853462
0.04513133
0.03557255
0.04379258
0.11774463
0.12224647
0.10066806
0.07491268
0.05584900
0.02648071
0.00879717
0.00250664
0.00654262
0.01390163
0.08358222
0.07648711
0.08615513
0.08187077
0.05667368
0.04580418
0.04100892
0.04243864
0.05289780
0.06898235
0.08837414
0.07720532
0.06877820
0.04004143
0.08344561
0.10198337
0.08649224
0.07357670
0.05660766
0.05770121
0.05283090
0.04178210
0.07306314
0.10479591
0.09217550
0.07612564
0.06798731
0.09084788
0.08643017
0.07017878
0.08629854
0.07757853
0.04865915
0.02346797
0.01781903
0.00757137
0.00145925
0.00213453
0.00095217
0.00004763

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: d062a33816617264ca4af05b01057ae6
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 18de2bee3762c3d42aade5e9a1105f2d
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,253 @@
0.00000006
0.00000004
0.00761530
0.02372499
0.18112624
0.18295501
0.15015282
0.11161552
0.08549889
0.04024626
0.01824978
0.00622564
0.01819922
0.07918092
0.13432275
0.11699784
0.12408932
0.07769494
0.03263141
0.01082999
0.00369861
0.04625941
0.09377275
0.06972123
0.04340839
0.03398569
0.02273669
0.00849879
0.00228230
0.00042531
0.00002738
0.02690202
0.14915887
0.10081410
0.11624254
0.12475611
0.11638901
0.10972477
0.06713505
0.02612207
0.02690891
0.01470955
0.00350165
0.02938388
0.09164439
0.10037519
0.06948389
0.02402627
0.00704134
0.00340573
0.06186428
0.13352928
0.12644723
0.09811366
0.06588145
0.03065532
0.01940942
0.00623135
0.00113915
0.00022903
0.00004646
0.00002043
0.03945133
0.13618532
0.15403919
0.12107417
0.10283324
0.08136178
0.07846233
0.05062351
0.05210162
0.08307648
0.08895227
0.07534208
0.08555108
0.07151275
0.10253356
0.11380573
0.14133190
0.06870494
0.07032948
0.03235435
0.00728361
0.00188178
0.00437712
0.00563290
0.10130417
0.14208825
0.15139544
0.09576591
0.08176865
0.09506901
0.05657209
0.02998489
0.02223587
0.01166321
0.01493446
0.00959634
0.00253925
0.00056367
0.00004326
0.00000018
0.00000009
0.00000012
0.00000012
0.00000012
0.00000011
0.00000012
0.00000011
0.00000011
0.00000010
0.00133482
0.03514139
0.14958730
0.15455140
0.11128354
0.09542409
0.02897310
0.01059265
0.02017378
0.04071121
0.04277394
0.05423436
0.09081916
0.08782864
0.06853335
0.08100801
0.09960809
0.09265953
0.05195294
0.01871615
0.00581145
0.01714720
0.04497458
0.09403843
0.11116246
0.11774849
0.08392474
0.04672236
0.01819239
0.00342889
0.00092174
0.00007114
0.00000066
0.00001772
0.03772246
0.09165097
0.09358907
0.09343258
0.04967652
0.02884209
0.00764706
0.03021757
0.07730241
0.10254525
0.11653031
0.07226698
0.03478890
0.02956227
0.01532503
0.01339547
0.03553957
0.11484702
0.10937911
0.12912853
0.08374450
0.07559040
0.05593618
0.03857393
0.01801690
0.00676345
0.01251562
0.08935788
0.12568295
0.14073858
0.14342763
0.11744731
0.12331198
0.07777787
0.04797470
0.05334346
0.04123482
0.03008132
0.03993239
0.12230677
0.09061263
0.09127291
0.05985545
0.05928823
0.04056094
0.01359506
0.00395394
0.00729265
0.04655721
0.07918903
0.07004683
0.09082823
0.06127002
0.01671598
0.00383636
0.00604208
0.01788624
0.04956786
0.09722503
0.07643412
0.04734993
0.01334304
0.00248720
0.06265882
0.10026165
0.07324047
0.07227907
0.06611378
0.09675421
0.08106042
0.04954623
0.02076192
0.00370063
0.00068489
0.00001209
0.00000051
0.00193862
0.00977144
0.04305735
0.07626142
0.08680253
0.08378484
0.05658313
0.01788181
0.00422465
0.01629818
0.07559661
0.07953563
0.09430075
0.07922930
0.04408175
0.03681345
0.05698681
0.12577643
0.07098714
0.05581276
0.04261805
0.04626781
0.04376284
0.05016053
0.05078668
0.04293551
0.02949942
0.02242714
0.01308054
0.00438526
0.00117566
0.00013197

Some files were not shown because too many files have changed in this diff Show More