forked from cgvr/DeltaVR
Compare commits
21 Commits
876306a2af
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 30c0652453 | |||
| 85beb73f51 | |||
| 011d9dfdda | |||
| 2e7dc403ad | |||
| 4bda55baca | |||
| ba1f0c855d | |||
| 415484c1f0 | |||
| 2347d27c62 | |||
| 74c2ca6a98 | |||
| f3d0f206af | |||
| f9b2084876 | |||
| 53c6b04d23 | |||
| 91e44c5dae | |||
| 216e2660df | |||
| 57222f0bb0 | |||
| 768ed39abe | |||
| 89b9b5bd7a | |||
| 901334b6bf | |||
| 1885b1fbe8 | |||
| f81bc2f7fd | |||
| a4a6535779 |
6
.gitignore
vendored
6
.gitignore
vendored
@@ -102,4 +102,8 @@ fmod_editor.log
|
||||
NetrworkManagerUI.prefab
|
||||
NetrworkManagerUI.prefab.meta
|
||||
CustomNetworkManager.prefab
|
||||
CustomNetworkManager.prefab.meta
|
||||
CustomNetworkManager.prefab.meta
|
||||
|
||||
|
||||
# Project-specific files
|
||||
config.json
|
||||
@@ -1,6 +0,0 @@
|
||||
INVOKEAI_URL=
|
||||
INVOKEAI_MODEL_KEY=
|
||||
TRELLIS_URL=
|
||||
|
||||
CLOUDFLARE_ACCOUNT_ID=
|
||||
CLOUDFLARE_API_TOKEN=
|
||||
7
3d-generation-pipeline/.gitignore
vendored
7
3d-generation-pipeline/.gitignore
vendored
@@ -1,7 +0,0 @@
|
||||
.venv
|
||||
.env
|
||||
__pycache__
|
||||
images/
|
||||
models/
|
||||
logs/
|
||||
notebooks/test_resources/
|
||||
@@ -1,26 +0,0 @@
|
||||
### TODO
|
||||
* user flow: grab item? mida krabada
|
||||
* võtta spawnitud mudeli mõõtmed: meshcollideri max x, max y, etc? bounding box?
|
||||
* 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
|
||||
* speech-to-text:
|
||||
* vana tekst ei kao ära
|
||||
* kogu tekst muutub ootamatult "Silence"-iks
|
||||
* 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:
|
||||
* 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
|
||||
@@ -1,61 +0,0 @@
|
||||
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"]
|
||||
@@ -1,501 +0,0 @@
|
||||
# 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")
|
||||
@@ -1,77 +0,0 @@
|
||||
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
|
||||
|
||||
@@ -1,153 +0,0 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
@@ -1,122 +0,0 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
@@ -1,152 +0,0 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
@@ -1,165 +0,0 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
#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
|
||||
@@ -1,60 +0,0 @@
|
||||
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())
|
||||
File diff suppressed because it is too large
Load Diff
BIN
Assets/DOTween/DOTween.dll
LFS
BIN
Assets/DOTween/DOTween.dll
LFS
Binary file not shown.
@@ -1,33 +0,0 @@
|
||||
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:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5582eb58dc5efba4bb7d5c01e7e4fa61
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,144 +0,0 @@
|
||||
<?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>
|
||||
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 31782b3953dc990468d4e8b6c1017400
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -1,33 +0,0 @@
|
||||
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:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 71c839e23e9ed784c8cede7c3b86a315
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -1,148 +0,0 @@
|
||||
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.
@@ -1,148 +0,0 @@
|
||||
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.
@@ -1,148 +0,0 @@
|
||||
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.
@@ -1,148 +0,0 @@
|
||||
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.
@@ -1,148 +0,0 @@
|
||||
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:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0a781078dc1ef2e4c82d5a005b52df6f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,198 +0,0 @@
|
||||
// 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
|
||||
@@ -1,146 +0,0 @@
|
||||
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
|
||||
@@ -1,216 +0,0 @@
|
||||
// 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
|
||||
@@ -1,193 +0,0 @@
|
||||
// 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
|
||||
@@ -1,93 +0,0 @@
|
||||
// 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
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ed0c803071031de43a04893cf85633a4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,662 +0,0 @@
|
||||
// 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
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0939b1841b95a9b4582da04055191349
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,389 +0,0 @@
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2323c1e96e57fd14ca6aa6b9d3403f10
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,167 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 34faaadcd2d3ead45a8edf1ece51a14e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,29 +0,0 @@
|
||||
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
|
||||
Binary file not shown.
@@ -1,144 +0,0 @@
|
||||
|
||||
#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
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e3da5d98c11c1b54fb05eda4624de9e3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
61
Assets/Fish-Networking-Discovery-main/.gitignore
vendored
61
Assets/Fish-Networking-Discovery-main/.gitignore
vendored
@@ -1,61 +0,0 @@
|
||||
# This .gitignore file should be placed at the root of your Unity project directory
|
||||
#
|
||||
# Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore
|
||||
#
|
||||
/[Ll]ibrary/
|
||||
/[Tt]emp/
|
||||
/[Oo]bj/
|
||||
/[Bb]uild/
|
||||
/[Bb]uilds/
|
||||
/[Ll]ogs/
|
||||
/[Mm]emoryCaptures/
|
||||
|
||||
# Asset meta data should only be ignored when the corresponding asset is also ignored
|
||||
!/[Aa]ssets/**/*.meta
|
||||
|
||||
# Uncomment this line if you wish to ignore the asset store tools plugin
|
||||
# /[Aa]ssets/AssetStoreTools*
|
||||
|
||||
# Autogenerated Jetbrains Rider plugin
|
||||
[Aa]ssets/Plugins/Editor/JetBrains*
|
||||
|
||||
# Visual Studio cache directory
|
||||
.vs/
|
||||
|
||||
# Gradle cache directory
|
||||
.gradle/
|
||||
|
||||
# Autogenerated VS/MD/Consulo solution and project files
|
||||
ExportedObj/
|
||||
.consulo/
|
||||
*.csproj
|
||||
*.unityproj
|
||||
*.sln
|
||||
*.suo
|
||||
*.tmp
|
||||
*.user
|
||||
*.userprefs
|
||||
*.pidb
|
||||
*.booproj
|
||||
*.svd
|
||||
*.pdb
|
||||
*.mdb
|
||||
*.opendb
|
||||
*.VC.db
|
||||
|
||||
# Unity3D generated meta files
|
||||
*.pidb.meta
|
||||
*.pdb.meta
|
||||
*.mdb.meta
|
||||
*.meta
|
||||
|
||||
# Unity3D generated file on crash reports
|
||||
sysinfo.txt
|
||||
|
||||
# Builds
|
||||
*.apk
|
||||
*.unitypackage
|
||||
|
||||
# Crashlytics generated file
|
||||
crashlytics-build.properties
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f6c028f06eda5904eae3f7a7418b8416
|
||||
guid: 4939e812d2cae8a448666fc57569da59
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 79f8954f1d80fd54db33351ed2152039
|
||||
guid: e8cb728e8e288c947a1e0870382445bd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@@ -81,6 +81,7 @@ public class NetworkMenuUI : MonoBehaviour
|
||||
}
|
||||
private void OnStartPlaying()
|
||||
{
|
||||
Debug.Log("START PRESSED");
|
||||
statusText.text = "Starting host...";
|
||||
StartCoroutine(HostAndSearchRoutine());
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e3611d721df002f45933ceed8a9ae1ee
|
||||
guid: 49f99c1c0ae8c774eb6bdcbc83c2cfef
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5bc7756ef72354148a2e7f8a92d26937
|
||||
guid: e928fc8fc03e26a46ad7f8520d468e41
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 46ecd50ddb7804d488bee4738799bba9
|
||||
guid: 8d77d91c1b4e73044b53ddce11333fea
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a4870b318dece4e4fb86232bcbe55386
|
||||
guid: 474f76f05fac11a4e8e1ed68314fba90
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
23
Assets/FishNet.Config.XML
Normal file
23
Assets/FishNet.Config.XML
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ConfigurationData xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<Loaded>true</Loaded>
|
||||
<PrefabGenerator>
|
||||
<Enabled>true</Enabled>
|
||||
<LogToConsole>true</LogToConsole>
|
||||
<FullRebuild>false</FullRebuild>
|
||||
<SaveChanges>true</SaveChanges>
|
||||
<DefaultPrefabObjectsPath>Assets\DefaultPrefabObjects.asset</DefaultPrefabObjectsPath>
|
||||
<SearchScope>1</SearchScope>
|
||||
<ExcludedFolders />
|
||||
<IncludedFolders>
|
||||
<string>Assets\_PROJECT</string>
|
||||
</IncludedFolders>
|
||||
</PrefabGenerator>
|
||||
<CodeStripping>
|
||||
<IsBuilding>false</IsBuilding>
|
||||
<IsDevelopment>false</IsDevelopment>
|
||||
<IsHeadless>false</IsHeadless>
|
||||
<StripReleaseBuilds>false</StripReleaseBuilds>
|
||||
<StrippingType>0</StrippingType>
|
||||
</CodeStripping>
|
||||
</ConfigurationData>
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8c2b80b45dcee1949bdce20ee5996721
|
||||
guid: fdec8b985bdf2364cac858b4136da794
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
@@ -319,9 +319,12 @@ namespace FishNet.Editing.PrefabCollectionGenerator
|
||||
{
|
||||
foreach (string path in GetPrefabFiles("Assets", excludedPaths, true))
|
||||
{
|
||||
|
||||
NetworkObject nob = AssetDatabase.LoadAssetAtPath<NetworkObject>(path);
|
||||
if (nob != null)
|
||||
foundNobs.Add(nob);
|
||||
else
|
||||
UnityEngine.Debug.LogWarning("Last loading error with: " + path);
|
||||
}
|
||||
}
|
||||
//Specific folders.
|
||||
|
||||
Binary file not shown.
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c804fa0053329e542b265d63913b22f9
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 23fe3883e9cc804429bc54fb860d18f1
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,10 +1,9 @@
|
||||
using _PROJECT.Scripts.Bow;
|
||||
using FishNet.Component.Transforming;
|
||||
using FishNet.Object;
|
||||
using FishNet.Object.Synchronizing;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using _PROJECT.Scripts.Bow;
|
||||
using FishNet.Object;
|
||||
using FishNet.Object.Synchronizing;
|
||||
using TMPro;
|
||||
using Unity.XR.CoreUtils;
|
||||
using UnityEngine;
|
||||
@@ -21,14 +20,11 @@ public class ArcheryRange : NetworkBehaviour
|
||||
public GameObject targetPrefab;
|
||||
public StartTarget startTarget;
|
||||
|
||||
public GameObject archeryTargetPointsText;
|
||||
|
||||
public Vector3 minRandomOffset = new Vector3(0f, -2f, -5f);
|
||||
public Vector3 maxRandomOffset = new Vector3(0f, 2f, 5f);
|
||||
public float roundLength = 60f;
|
||||
public float targetSpawnTime = 3f;
|
||||
|
||||
public ArcheryRangeModelGenerationController modelGenerationController;
|
||||
public KeyboardManager keyboardManager;
|
||||
|
||||
private List<ArcheryTarget> _targets;
|
||||
@@ -122,48 +118,24 @@ public class ArcheryRange : NetworkBehaviour
|
||||
|
||||
var randomPos = targetStartPosition.position + new Vector3(
|
||||
Random.Range(minRandomOffset.x, maxRandomOffset.x),
|
||||
(float) Math.Round(Random.Range(minRandomOffset.y, maxRandomOffset.y)),
|
||||
Random.Range(minRandomOffset.z, maxRandomOffset.z)
|
||||
);
|
||||
(float)Math.Round(Random.Range(minRandomOffset.y, maxRandomOffset.y)),
|
||||
Random.Range(minRandomOffset.z, maxRandomOffset.z));
|
||||
|
||||
var target = SpawnTarget(randomPos);
|
||||
|
||||
_targets.Add(target);
|
||||
}
|
||||
|
||||
private ArcheryTarget SpawnTarget(Vector3 randomPos)
|
||||
{
|
||||
GameObject targetObject;
|
||||
if (modelGenerationController.GeneratedModel == null)
|
||||
{
|
||||
// spawn default UFO
|
||||
targetObject = Instantiate(targetPrefab, randomPos, Quaternion.identity, null);
|
||||
} else
|
||||
{
|
||||
// spawn generated model
|
||||
targetObject = Instantiate(modelGenerationController.GeneratedModel, randomPos, Quaternion.identity, null);
|
||||
InitializeArcheryTargetObject(targetObject);
|
||||
}
|
||||
|
||||
ArcheryTarget target = targetObject.GetComponent<ArcheryTarget>();
|
||||
var prefab = Instantiate(targetPrefab, randomPos, Quaternion.identity, null);
|
||||
ArcheryTarget target = prefab.GetComponent<ArcheryTarget>();
|
||||
target.endPosition = targetEndPosition.position;
|
||||
target.addScore = AddScore;
|
||||
Spawn(targetObject);
|
||||
Spawn(prefab);
|
||||
return target;
|
||||
}
|
||||
|
||||
private void InitializeArcheryTargetObject(GameObject targetObject)
|
||||
{
|
||||
ArcheryTarget archeryTarget = targetObject.AddComponent<ArcheryTarget>();
|
||||
archeryTarget.pointsText = archeryTargetPointsText;
|
||||
|
||||
Rigidbody rigidbody = targetObject.AddComponent<Rigidbody>();
|
||||
rigidbody.useGravity = false;
|
||||
rigidbody.isKinematic = true;
|
||||
|
||||
targetObject.AddComponent<NetworkObject>();
|
||||
targetObject.AddComponent<NetworkTransform>();
|
||||
}
|
||||
|
||||
|
||||
public void ResetRange()
|
||||
{
|
||||
@@ -176,7 +148,7 @@ public class ArcheryRange : NetworkBehaviour
|
||||
_targets = new List<ArcheryTarget>();
|
||||
if (_maxScore < _score) _maxScore = _score;
|
||||
|
||||
if (_presentPlayers.Count != 0) // If there are players in the area.
|
||||
if(_presentPlayers.Count != 0) // If there are players in the area.
|
||||
{
|
||||
// Gives the score to the player longest-lasting in the area. It would be better to give it to the player that fired the starting arrow, but I'm not spending 10 hours on this.
|
||||
|
||||
@@ -206,7 +178,6 @@ public class ArcheryRange : NetworkBehaviour
|
||||
public void StartRound()
|
||||
{
|
||||
if (!IsServer) return;
|
||||
|
||||
_roundEndTime = Time.time + roundLength;
|
||||
_nextTargetTime = Time.time;
|
||||
_roundActive = true;
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
using System;
|
||||
using _PROJECT.Scripts.Bow;
|
||||
using _PROJECT.Scripts.Bow.Extra;
|
||||
using FishNet.Object;
|
||||
using FishNet.Object.Synchronizing;
|
||||
using UnityEngine;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
|
||||
public class ArcheryTarget : NetworkBehaviour, IArrowHittable
|
||||
@@ -11,10 +14,12 @@ public class ArcheryTarget : NetworkBehaviour, IArrowHittable
|
||||
public Vector3 endPosition;
|
||||
public float forwardSpeed = 2f;
|
||||
public Action<float> addScore;
|
||||
|
||||
private bool _flipDirection;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
|
||||
_flipDirection = Random.value > 0.5f;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
@@ -24,12 +29,11 @@ public class ArcheryTarget : NetworkBehaviour, IArrowHittable
|
||||
float step = forwardSpeed * Time.deltaTime;
|
||||
var position = transform.position;
|
||||
|
||||
if (Math.Abs(position.x - endPosition.x) < 0.1)
|
||||
{
|
||||
Destroy(gameObject);
|
||||
}
|
||||
if (Math.Abs(position.x - endPosition.x) < 0.1) Destroy(gameObject);
|
||||
|
||||
transform.position = Vector3.MoveTowards(position, new Vector3(endPosition.x, position.y, position.z), step);
|
||||
|
||||
transform.position = Vector3.MoveTowards(position,
|
||||
new Vector3(endPosition.x, position.y, position.z), step);
|
||||
}
|
||||
|
||||
public void Hit(Arrow arrow)
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using _PROJECT.Multiplayer.NewBow;
|
||||
using System.Collections;
|
||||
using _PROJECT.Multiplayer.NewBow;
|
||||
using _PROJECT.Scripts.Bow;
|
||||
using FishNet.Object;
|
||||
using UnityEngine;
|
||||
using UnityEngine.XR.Interaction.Toolkit;
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ public class ArrowCaster : NetworkBehaviour
|
||||
yield return null;
|
||||
}
|
||||
|
||||
Debug.Log("Arrow hit transform: " + _hit.transform.name);
|
||||
Debug.Log(_hit.transform.name);
|
||||
|
||||
// Once the arrow has stopped flying
|
||||
DisablePhysics();
|
||||
@@ -114,8 +114,6 @@ public class ArrowCaster : NetworkBehaviour
|
||||
private void CheckForHittable(RaycastHit hit)
|
||||
{
|
||||
if (hit.transform.TryGetComponent(out IArrowHittable hittable))
|
||||
{
|
||||
hittable.Hit(_arrow);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ GameObject:
|
||||
- component: {fileID: 8764262191404547501}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_l_pinky0
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -68,7 +68,7 @@ GameObject:
|
||||
- component: {fileID: 1723365827026859764}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_l_thumb3
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -123,7 +123,7 @@ GameObject:
|
||||
- component: {fileID: 2608288486353606751}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_l_grip
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -155,7 +155,7 @@ GameObject:
|
||||
- component: {fileID: 1944697586618938354}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_l_index1
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -210,7 +210,7 @@ GameObject:
|
||||
- component: {fileID: 4543854955624006782}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_l_ring1
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -243,7 +243,7 @@ GameObject:
|
||||
- component: {fileID: 4269470585016323320}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_l_index3
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -298,7 +298,7 @@ GameObject:
|
||||
- component: {fileID: 5275753966706537763}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_l_thumb_ignore
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -329,7 +329,7 @@ GameObject:
|
||||
- component: {fileID: 2961322539409618699}
|
||||
m_Layer: 21
|
||||
m_Name: Hand transform target
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -361,7 +361,7 @@ GameObject:
|
||||
- component: {fileID: 6986205080506681598}
|
||||
m_Layer: 21
|
||||
m_Name: Thumb collider
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -415,7 +415,7 @@ GameObject:
|
||||
- component: {fileID: 1637212737629950891}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_l_hand_ignore
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -447,7 +447,7 @@ GameObject:
|
||||
- component: {fileID: 2120999288498951984}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_l_index2
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -502,7 +502,7 @@ GameObject:
|
||||
- component: {fileID: 5750800257835108047}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_l_ring_ignore
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -534,7 +534,7 @@ GameObject:
|
||||
- component: {fileID: 716960368701313914}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_l_pinky2
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -590,7 +590,7 @@ GameObject:
|
||||
- component: {fileID: 3386814274893541678}
|
||||
m_Layer: 21
|
||||
m_Name: hands:Lhand
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -699,7 +699,7 @@ GameObject:
|
||||
- component: {fileID: 5919874647378539971}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_l_pinky_ignore
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -732,7 +732,7 @@ GameObject:
|
||||
- component: {fileID: 6957428246676485499}
|
||||
m_Layer: 21
|
||||
m_Name: hands:l_hand_world
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -804,7 +804,7 @@ GameObject:
|
||||
- component: {fileID: 5887795241378656881}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_l_middle_ignore
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -836,7 +836,7 @@ GameObject:
|
||||
- component: {fileID: 4322167853205774804}
|
||||
m_Layer: 21
|
||||
m_Name: Ring collider
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -890,7 +890,7 @@ GameObject:
|
||||
- component: {fileID: 7553050096824511736}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_l_index_ignore
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -922,7 +922,7 @@ GameObject:
|
||||
- component: {fileID: 1415566195781121907}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_l_pinky3
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -978,7 +978,7 @@ GameObject:
|
||||
- component: {fileID: 4386306177358856345}
|
||||
m_Layer: 21
|
||||
m_Name: Index collider
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -1033,7 +1033,7 @@ GameObject:
|
||||
- component: {fileID: 6789557385548509388}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_l_thumb2
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -1088,7 +1088,7 @@ GameObject:
|
||||
- component: {fileID: 2944632011470922523}
|
||||
m_Layer: 21
|
||||
m_Name: Palm colliders
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -1125,7 +1125,7 @@ GameObject:
|
||||
- component: {fileID: 3014115217857052780}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_l_middle1
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -1181,7 +1181,7 @@ GameObject:
|
||||
- component: {fileID: 8109105434051733588}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_l_middle3
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -1237,7 +1237,7 @@ GameObject:
|
||||
- component: {fileID: 3769065761299449432}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_l_ring3
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -1293,7 +1293,7 @@ GameObject:
|
||||
- component: {fileID: 8506477102816967445}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_l_hand
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -1356,7 +1356,7 @@ GameObject:
|
||||
- component: {fileID: 1591964882275427419}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_l_ring2
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -1412,7 +1412,7 @@ GameObject:
|
||||
- component: {fileID: 8576740011717174536}
|
||||
m_Layer: 21
|
||||
m_Name: Left Hand Colliding Prefab
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -1468,7 +1468,7 @@ GameObject:
|
||||
- component: {fileID: 1079438441252743571}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_l_thumb1
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -1524,7 +1524,7 @@ GameObject:
|
||||
- component: {fileID: 2798374626865133994}
|
||||
m_Layer: 21
|
||||
m_Name: Middle collider
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -1579,7 +1579,7 @@ GameObject:
|
||||
- component: {fileID: 5949439093540659439}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_l_pinky1
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -1634,7 +1634,7 @@ GameObject:
|
||||
- component: {fileID: 8548538124938550778}
|
||||
m_Layer: 21
|
||||
m_Name: hands:hands_geom
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -1667,7 +1667,7 @@ GameObject:
|
||||
- component: {fileID: 1579608193995075263}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_l_middle2
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -1723,7 +1723,7 @@ GameObject:
|
||||
- component: {fileID: 919376631072681037}
|
||||
m_Layer: 21
|
||||
m_Name: Pinky collider
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
|
||||
@@ -12,7 +12,7 @@ GameObject:
|
||||
- component: {fileID: 8052033317495986407}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_r_middle1
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -67,7 +67,7 @@ GameObject:
|
||||
- component: {fileID: 2906946168806256316}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_r_thumb_ignore
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -99,7 +99,7 @@ GameObject:
|
||||
- component: {fileID: 3715643930745057324}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_r_middle2
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -154,7 +154,7 @@ GameObject:
|
||||
- component: {fileID: 7300301753511705056}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_r_hand
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -194,7 +194,7 @@ GameObject:
|
||||
- component: {fileID: 2690371468463167305}
|
||||
m_Layer: 21
|
||||
m_Name: Thumb collider
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -248,7 +248,7 @@ GameObject:
|
||||
- component: {fileID: 5327335418779228248}
|
||||
m_Layer: 21
|
||||
m_Name: Palm colliders
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -284,7 +284,7 @@ GameObject:
|
||||
- component: {fileID: 3590037039866930948}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_r_ring_ignore
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -316,7 +316,7 @@ GameObject:
|
||||
- component: {fileID: 7768949610396455723}
|
||||
m_Layer: 21
|
||||
m_Name: Right Hand Colliding Prefab
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -371,7 +371,7 @@ GameObject:
|
||||
- component: {fileID: 2252869937798432446}
|
||||
m_Layer: 21
|
||||
m_Name: Hand transform target
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -403,7 +403,7 @@ GameObject:
|
||||
- component: {fileID: 4819224731497084625}
|
||||
m_Layer: 21
|
||||
m_Name: Ring collider
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -458,7 +458,7 @@ GameObject:
|
||||
- component: {fileID: 5988830187266270822}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_r_index2
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -514,7 +514,7 @@ GameObject:
|
||||
- component: {fileID: 3490267647208294616}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_r_pinky1
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -569,7 +569,7 @@ GameObject:
|
||||
- component: {fileID: 6375747935274843628}
|
||||
m_Layer: 21
|
||||
m_Name: hands:hands_geom
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -603,7 +603,7 @@ GameObject:
|
||||
- component: {fileID: 5764046989862461349}
|
||||
m_Layer: 21
|
||||
m_Name: hands:r_hand_world
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -676,7 +676,7 @@ GameObject:
|
||||
- component: {fileID: 6416395892737682491}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_r_ring1
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -732,7 +732,7 @@ GameObject:
|
||||
- component: {fileID: 2137975461030589968}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_r_thumb1
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -788,7 +788,7 @@ GameObject:
|
||||
- component: {fileID: 3641471949121660872}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_r_middle3
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -844,7 +844,7 @@ GameObject:
|
||||
- component: {fileID: 1533912411679244991}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_r_thumb2
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -900,7 +900,7 @@ GameObject:
|
||||
- component: {fileID: 7674578750026270476}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_r_index3
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -956,7 +956,7 @@ GameObject:
|
||||
- component: {fileID: 4783864064774963216}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_r_index1
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -1012,7 +1012,7 @@ GameObject:
|
||||
- component: {fileID: 8883393763632736373}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_r_pinky3
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -1068,7 +1068,7 @@ GameObject:
|
||||
- component: {fileID: 4631915003324200488}
|
||||
m_Layer: 21
|
||||
m_Name: Index collider
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -1123,7 +1123,7 @@ GameObject:
|
||||
- component: {fileID: 5712925273267891514}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_r_ring3
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -1178,7 +1178,7 @@ GameObject:
|
||||
- component: {fileID: 4156920047406755595}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_r_middle_ignore
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -1210,7 +1210,7 @@ GameObject:
|
||||
- component: {fileID: 6299028004636604754}
|
||||
m_Layer: 21
|
||||
m_Name: hands:Rhand
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -1320,7 +1320,7 @@ GameObject:
|
||||
- component: {fileID: 2117998936123800384}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_r_thumb3
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -1376,7 +1376,7 @@ GameObject:
|
||||
- component: {fileID: 4519742811004900486}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_r_ring2
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -1431,7 +1431,7 @@ GameObject:
|
||||
- component: {fileID: 2440932897317841026}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_r_grip
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -1462,7 +1462,7 @@ GameObject:
|
||||
- component: {fileID: 8288052402374024699}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_r_hand_ignore
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -1494,7 +1494,7 @@ GameObject:
|
||||
- component: {fileID: 2652303807040277245}
|
||||
m_Layer: 21
|
||||
m_Name: Pinky collider
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -1548,7 +1548,7 @@ GameObject:
|
||||
- component: {fileID: 2250556033546852906}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_r_pinky_ignore
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -1579,7 +1579,7 @@ GameObject:
|
||||
- component: {fileID: 9123958269350278631}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_r_index_ignore
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -1610,7 +1610,7 @@ GameObject:
|
||||
- component: {fileID: 6538895829321691740}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_r_pinky0
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -1643,7 +1643,7 @@ GameObject:
|
||||
- component: {fileID: 7691745531460669440}
|
||||
m_Layer: 21
|
||||
m_Name: hands:b_r_pinky2
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -1699,7 +1699,7 @@ GameObject:
|
||||
- component: {fileID: 8227723562108441212}
|
||||
m_Layer: 21
|
||||
m_Name: Middle collider
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
|
||||
@@ -11,7 +11,7 @@ GameObject:
|
||||
- component: {fileID: 6766972025625897185}
|
||||
m_Layer: 0
|
||||
m_Name: hands:hands_geom
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -43,7 +43,7 @@ GameObject:
|
||||
- component: {fileID: 6766972025625897187}
|
||||
m_Layer: 0
|
||||
m_Name: hands:l_hand_world
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -76,7 +76,7 @@ GameObject:
|
||||
- component: {fileID: 6766972025630685681}
|
||||
m_Layer: 0
|
||||
m_Name: hands:Lhand
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -186,7 +186,7 @@ GameObject:
|
||||
- component: {fileID: 6766972025634883377}
|
||||
m_Layer: 0
|
||||
m_Name: Left Hand Prefab
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -228,7 +228,6 @@ Animator:
|
||||
m_HasTransformHierarchy: 1
|
||||
m_AllowConstantClipSamplingOptimization: 1
|
||||
m_KeepAnimatorStateOnDisable: 0
|
||||
m_WriteDefaultValuesOnDisable: 0
|
||||
--- !u!1 &6766972025625408657
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -240,7 +239,7 @@ GameObject:
|
||||
- component: {fileID: 6766972025625897201}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_l_ring1
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -272,7 +271,7 @@ GameObject:
|
||||
- component: {fileID: 6766972025625897203}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_l_ring2
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -304,7 +303,7 @@ GameObject:
|
||||
- component: {fileID: 6766972025625897205}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_l_ring3
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -336,7 +335,7 @@ GameObject:
|
||||
- component: {fileID: 6766972025625897207}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_l_ring_ignore
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -367,7 +366,7 @@ GameObject:
|
||||
- component: {fileID: 6766972025625897209}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_l_thumb1
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -399,7 +398,7 @@ GameObject:
|
||||
- component: {fileID: 6766972025625897211}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_l_thumb2
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -431,7 +430,7 @@ GameObject:
|
||||
- component: {fileID: 6766972025625897213}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_l_thumb3
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -463,7 +462,7 @@ GameObject:
|
||||
- component: {fileID: 6766972025625897215}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_l_thumb_ignore
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -494,7 +493,7 @@ GameObject:
|
||||
- component: {fileID: 6766972025625897153}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_l_middle2
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -526,7 +525,7 @@ GameObject:
|
||||
- component: {fileID: 6766972025625897155}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_l_middle3
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -558,7 +557,7 @@ GameObject:
|
||||
- component: {fileID: 6766972025625897157}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_l_middle_ignore
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -589,7 +588,7 @@ GameObject:
|
||||
- component: {fileID: 6766972025625897159}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_l_pinky0
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -621,7 +620,7 @@ GameObject:
|
||||
- component: {fileID: 6766972025625897161}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_l_pinky1
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -653,7 +652,7 @@ GameObject:
|
||||
- component: {fileID: 6766972025625897163}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_l_pinky2
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -685,7 +684,7 @@ GameObject:
|
||||
- component: {fileID: 6766972025625897165}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_l_pinky3
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -717,7 +716,7 @@ GameObject:
|
||||
- component: {fileID: 6766972025625897167}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_l_pinky_ignore
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -748,7 +747,7 @@ GameObject:
|
||||
- component: {fileID: 6766972025625897169}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_l_grip
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -779,7 +778,7 @@ GameObject:
|
||||
- component: {fileID: 6766972025625897171}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_l_hand
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -817,7 +816,7 @@ GameObject:
|
||||
- component: {fileID: 6766972025625897173}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_l_hand_ignore
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -848,7 +847,7 @@ GameObject:
|
||||
- component: {fileID: 6766972025625897175}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_l_index1
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -880,7 +879,7 @@ GameObject:
|
||||
- component: {fileID: 6766972025625897177}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_l_index2
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -912,7 +911,7 @@ GameObject:
|
||||
- component: {fileID: 6766972025625897179}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_l_index3
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -944,7 +943,7 @@ GameObject:
|
||||
- component: {fileID: 6766972025625897181}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_l_index_ignore
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -975,7 +974,7 @@ GameObject:
|
||||
- component: {fileID: 6766972025625897183}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_l_middle1
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
|
||||
@@ -11,7 +11,7 @@ GameObject:
|
||||
- component: {fileID: 5553551016358058816}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_r_thumb2
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -43,7 +43,7 @@ GameObject:
|
||||
- component: {fileID: 5553551016358058818}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_r_thumb1
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -75,7 +75,7 @@ GameObject:
|
||||
- component: {fileID: 5553551016358058820}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_r_thumb_ignore
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -106,7 +106,7 @@ GameObject:
|
||||
- component: {fileID: 5553551016358058822}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_r_thumb3
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -138,7 +138,7 @@ GameObject:
|
||||
- component: {fileID: 5553551016358058824}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_r_ring2
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -170,7 +170,7 @@ GameObject:
|
||||
- component: {fileID: 5553551016358058826}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_r_ring1
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -202,7 +202,7 @@ GameObject:
|
||||
- component: {fileID: 5553551016358058828}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_r_ring_ignore
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -233,7 +233,7 @@ GameObject:
|
||||
- component: {fileID: 5553551016358058830}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_r_ring3
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -265,7 +265,7 @@ GameObject:
|
||||
- component: {fileID: 5553551016358058840}
|
||||
m_Layer: 0
|
||||
m_Name: hands:r_hand_world
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -297,7 +297,7 @@ GameObject:
|
||||
- component: {fileID: 5553551016358058842}
|
||||
m_Layer: 0
|
||||
m_Name: hands:hands_geom
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -330,7 +330,7 @@ GameObject:
|
||||
- component: {fileID: 5553551016367944842}
|
||||
m_Layer: 0
|
||||
m_Name: Right Hand Prefab
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -372,7 +372,6 @@ Animator:
|
||||
m_HasTransformHierarchy: 1
|
||||
m_AllowConstantClipSamplingOptimization: 1
|
||||
m_KeepAnimatorStateOnDisable: 0
|
||||
m_WriteDefaultValuesOnDisable: 0
|
||||
--- !u!1 &5553551016358545214
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -385,7 +384,7 @@ GameObject:
|
||||
- component: {fileID: 5553551016372144714}
|
||||
m_Layer: 0
|
||||
m_Name: hands:Rhand
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -494,7 +493,7 @@ GameObject:
|
||||
- component: {fileID: 5553551016358058848}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_r_index3
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -526,7 +525,7 @@ GameObject:
|
||||
- component: {fileID: 5553551016358058850}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_r_index2
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -558,7 +557,7 @@ GameObject:
|
||||
- component: {fileID: 5553551016358058852}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_r_middle1
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -590,7 +589,7 @@ GameObject:
|
||||
- component: {fileID: 5553551016358058854}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_r_index_ignore
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -621,7 +620,7 @@ GameObject:
|
||||
- component: {fileID: 5553551016358058856}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_r_hand
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -659,7 +658,7 @@ GameObject:
|
||||
- component: {fileID: 5553551016358058858}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_r_grip
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -690,7 +689,7 @@ GameObject:
|
||||
- component: {fileID: 5553551016358058860}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_r_index1
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -722,7 +721,7 @@ GameObject:
|
||||
- component: {fileID: 5553551016358058862}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_r_hand_ignore
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -753,7 +752,7 @@ GameObject:
|
||||
- component: {fileID: 5553551016358058864}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_r_pinky2
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -785,7 +784,7 @@ GameObject:
|
||||
- component: {fileID: 5553551016358058866}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_r_pinky1
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -817,7 +816,7 @@ GameObject:
|
||||
- component: {fileID: 5553551016358058868}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_r_pinky_ignore
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -848,7 +847,7 @@ GameObject:
|
||||
- component: {fileID: 5553551016358058870}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_r_pinky3
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -880,7 +879,7 @@ GameObject:
|
||||
- component: {fileID: 5553551016358058872}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_r_middle3
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -912,7 +911,7 @@ GameObject:
|
||||
- component: {fileID: 5553551016358058874}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_r_middle2
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -944,7 +943,7 @@ GameObject:
|
||||
- component: {fileID: 5553551016358058876}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_r_pinky0
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -976,7 +975,7 @@ GameObject:
|
||||
- component: {fileID: 5553551016358058878}
|
||||
m_Layer: 0
|
||||
m_Name: hands:b_r_middle_ignore
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ace7b466e839d9141a22fb265a7f4dab
|
||||
guid: 261e77f9774b3224b9f61ebaff302284
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
@@ -103,30 +103,6 @@ TextureImporter:
|
||||
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: []
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9e16c783900f92a4c8942f7d34faa968
|
||||
guid: 262dce796e1903548b7a2a7909d20be4
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7cd0596f37c5d844293f7a3e27f206de
|
||||
guid: ab1a16880e37cfa499309fc8fd4250ba
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
@@ -103,30 +103,6 @@ TextureImporter:
|
||||
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: []
|
||||
@@ -119,7 +119,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &2888630431832822380
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -128,7 +128,7 @@ RectTransform:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 674832405591274748}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 6.199966}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 6}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
@@ -137,8 +137,8 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 198, y: 29.999985}
|
||||
m_SizeDelta: {x: 178.01, y: 338.4}
|
||||
m_AnchoredPosition: {x: 25.8, y: -57.9}
|
||||
m_SizeDelta: {x: 485, y: 46.5}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7009866660814900916
|
||||
CanvasRenderer:
|
||||
@@ -168,9 +168,7 @@ MonoBehaviour:
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_text: 'Warning:
|
||||
|
||||
High speeds may cause nausea'
|
||||
m_text: High speeds may cause nausea!
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: d564a6b9a8a781b438125b614edcc297, type: 2}
|
||||
m_sharedMaterial: {fileID: 2467261418627247352, guid: d564a6b9a8a781b438125b614edcc297,
|
||||
@@ -205,7 +203,7 @@ MonoBehaviour:
|
||||
m_fontSizeMin: 18
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 1
|
||||
m_HorizontalAlignment: 4
|
||||
m_VerticalAlignment: 256
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 0
|
||||
@@ -236,7 +234,7 @@ MonoBehaviour:
|
||||
m_VertexBufferAutoSizeReduction: 0
|
||||
m_useMaxVisibleDescender: 1
|
||||
m_pageToDisplay: 1
|
||||
m_margin: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_margin: {x: 1.8959656, y: 6.638962, z: 3.9048767, w: 1.7601442}
|
||||
m_isUsingLegacyAnimationComponent: 0
|
||||
m_isVolumetricText: 0
|
||||
m_hasFontAssetChanged: 0
|
||||
@@ -399,7 +397,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &4260766096620860208
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -582,6 +580,7 @@ Transform:
|
||||
- {fileID: 7867682990484010893}
|
||||
- {fileID: 385502688868600332}
|
||||
- {fileID: 8911245181170312639}
|
||||
- {fileID: 4369549003892251738}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@@ -711,8 +710,8 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: -371.7, y: 0.000015258789}
|
||||
m_SizeDelta: {x: 469.55, y: 50.48}
|
||||
m_AnchoredPosition: {x: -429.3, y: 0.000015258789}
|
||||
m_SizeDelta: {x: 319.7, y: 50.48}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &1756154180137300123
|
||||
CanvasRenderer:
|
||||
@@ -808,7 +807,7 @@ MonoBehaviour:
|
||||
m_VertexBufferAutoSizeReduction: 0
|
||||
m_useMaxVisibleDescender: 1
|
||||
m_pageToDisplay: 1
|
||||
m_margin: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_margin: {x: 2.8457031, y: 0, z: 2.8460312, w: 0}
|
||||
m_isUsingLegacyAnimationComponent: 0
|
||||
m_isVolumetricText: 0
|
||||
m_hasFontAssetChanged: 0
|
||||
@@ -1140,6 +1139,149 @@ RectTransform:
|
||||
m_AnchoredPosition: {x: -5.404525, y: 60.661545}
|
||||
m_SizeDelta: {x: 100, y: 100}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!1 &1647071810007517722
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4369549003892251738}
|
||||
- component: {fileID: 18611445735460691}
|
||||
- component: {fileID: 8343075384873062513}
|
||||
- component: {fileID: 5285357331933866282}
|
||||
- component: {fileID: 1310480035629572623}
|
||||
- component: {fileID: 1510780549024052800}
|
||||
- component: {fileID: 4307275810096043329}
|
||||
- component: {fileID: 143507707063213418}
|
||||
m_Layer: 12
|
||||
m_Name: Settings
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &4369549003892251738
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1647071810007517722}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 5343771095006709614}
|
||||
m_RootOrder: -1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &18611445735460691
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1647071810007517722}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 26a0dd79a025e5041a41f576b1aa4968, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
turnOffButton: {fileID: 3645818974320619446}
|
||||
turnOnButton: {fileID: 1311809556432207317}
|
||||
moveSpeedSlider: {fileID: 6956878155406096985}
|
||||
locomotion: {fileID: 1565464911732960072}
|
||||
--- !u!114 &8343075384873062513
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1647071810007517722}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: ebe1ab889a9bed940995d4f47bc743ef, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
target: 0
|
||||
slider: {fileID: 7370795858478176567}
|
||||
--- !u!114 &5285357331933866282
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1647071810007517722}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: ebe1ab889a9bed940995d4f47bc743ef, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
target: 3
|
||||
slider: {fileID: 8524569723447833986}
|
||||
--- !u!114 &1310480035629572623
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1647071810007517722}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: ebe1ab889a9bed940995d4f47bc743ef, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
target: 5
|
||||
slider: {fileID: 3954205046647893400}
|
||||
--- !u!114 &1510780549024052800
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1647071810007517722}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: ebe1ab889a9bed940995d4f47bc743ef, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
target: 4
|
||||
slider: {fileID: 7262865820799039206}
|
||||
--- !u!114 &4307275810096043329
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1647071810007517722}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: ebe1ab889a9bed940995d4f47bc743ef, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
target: 1
|
||||
slider: {fileID: 512852062931003448}
|
||||
--- !u!114 &143507707063213418
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1647071810007517722}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 1ebe1a3f8ef35a041a8ef39da672dd49, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
valueControllers:
|
||||
- {fileID: 18611445735460691}
|
||||
- {fileID: 8343075384873062513}
|
||||
- {fileID: 5285357331933866282}
|
||||
- {fileID: 1310480035629572623}
|
||||
- {fileID: 1510780549024052800}
|
||||
- {fileID: 4307275810096043329}
|
||||
--- !u!1 &1694677102371321062
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1298,7 +1440,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!224 &5995638939731525439
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -2219,7 +2361,6 @@ GameObject:
|
||||
- component: {fileID: 5495779272626688296}
|
||||
- component: {fileID: 270386226070323618}
|
||||
- component: {fileID: 7370795858478176567}
|
||||
- component: {fileID: 9192465668386235667}
|
||||
m_Layer: 5
|
||||
m_Name: Button
|
||||
m_TagString: Untagged
|
||||
@@ -2346,19 +2487,6 @@ MonoBehaviour:
|
||||
minValue: 0
|
||||
maxValue: 1
|
||||
slideareaOffsetMultiplier: 0.9
|
||||
--- !u!114 &9192465668386235667
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3421967330093517364}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: ebe1ab889a9bed940995d4f47bc743ef, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
target: 0
|
||||
--- !u!1 &3434260850308121859
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -2412,7 +2540,6 @@ GameObject:
|
||||
- component: {fileID: 5857106340495004348}
|
||||
- component: {fileID: 467034009919322666}
|
||||
- component: {fileID: 3954205046647893400}
|
||||
- component: {fileID: 8737582689073729793}
|
||||
m_Layer: 5
|
||||
m_Name: Button
|
||||
m_TagString: Untagged
|
||||
@@ -2539,19 +2666,6 @@ MonoBehaviour:
|
||||
minValue: 0
|
||||
maxValue: 1
|
||||
slideareaOffsetMultiplier: 0.9
|
||||
--- !u!114 &8737582689073729793
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3504227185401202113}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: ebe1ab889a9bed940995d4f47bc743ef, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
target: 5
|
||||
--- !u!1 &3847096334227967442
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -2858,6 +2972,153 @@ MonoBehaviour:
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!1 &4399914816600051466
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 3664260978476899140}
|
||||
- component: {fileID: 7108608958374546862}
|
||||
- component: {fileID: 2424293117796193332}
|
||||
- component: {fileID: 5839269911837038846}
|
||||
- component: {fileID: 8403009779207699600}
|
||||
m_Layer: 5
|
||||
m_Name: Restore Defaults Button
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &3664260978476899140
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4399914816600051466}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -5.9}
|
||||
m_LocalScale: {x: 0.05, y: 0.05, z: 0.05}
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children: []
|
||||
m_Father: {fileID: 4738851406616228330}
|
||||
m_RootOrder: -1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 399.3, y: 266.8}
|
||||
m_SizeDelta: {x: 2155, y: 1076}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7108608958374546862
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4399914816600051466}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &2424293117796193332
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4399914816600051466}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: ab1a16880e37cfa499309fc8fd4250ba, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &5839269911837038846
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4399914816600051466}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 0
|
||||
m_WrapAround: 0
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 2
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 21300000, guid: 261e77f9774b3224b9f61ebaff302284,
|
||||
type: 3}
|
||||
m_PressedSprite: {fileID: 21300000, guid: 261e77f9774b3224b9f61ebaff302284, type: 3}
|
||||
m_SelectedSprite: {fileID: 21300000, guid: ab1a16880e37cfa499309fc8fd4250ba, type: 3}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 2424293117796193332}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 143507707063213418}
|
||||
m_TargetAssemblyTypeName: RestoreDefaultsController, Assembly-CSharp
|
||||
m_MethodName: OnRestoreDefaults
|
||||
m_Mode: 1
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
--- !u!114 &8403009779207699600
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4399914816600051466}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 9c648a319c5c6aa47b3ef152a10657bf, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &4745390056551288905
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -3036,7 +3297,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: -1849.8, y: 30}
|
||||
m_SizeDelta: {x: 90.1, y: 50.5}
|
||||
m_SizeDelta: {x: 89, y: 50.5}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &1344781521441133505
|
||||
CanvasRenderer:
|
||||
@@ -3539,7 +3800,7 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: -2404.8, y: 34.7}
|
||||
m_AnchoredPosition: {x: -2600, y: 34.7}
|
||||
m_SizeDelta: {x: 220, y: 49.6}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2306375091028476275
|
||||
@@ -3605,7 +3866,7 @@ MonoBehaviour:
|
||||
m_fontSizeMin: 18
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 1
|
||||
m_HorizontalAlignment: 4
|
||||
m_VerticalAlignment: 512
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 0
|
||||
@@ -3636,7 +3897,7 @@ MonoBehaviour:
|
||||
m_VertexBufferAutoSizeReduction: 0
|
||||
m_useMaxVisibleDescender: 1
|
||||
m_pageToDisplay: 1
|
||||
m_margin: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_margin: {x: 14.186401, y: 0, z: -0.9451599, w: 0}
|
||||
m_isUsingLegacyAnimationComponent: 0
|
||||
m_isVolumetricText: 0
|
||||
m_hasFontAssetChanged: 0
|
||||
@@ -3655,7 +3916,6 @@ GameObject:
|
||||
- component: {fileID: 4467346825075014904}
|
||||
- component: {fileID: 1078020185355697329}
|
||||
- component: {fileID: 7262865820799039206}
|
||||
- component: {fileID: 8463522706283787556}
|
||||
m_Layer: 5
|
||||
m_Name: Button
|
||||
m_TagString: Untagged
|
||||
@@ -3782,19 +4042,6 @@ MonoBehaviour:
|
||||
minValue: 0
|
||||
maxValue: 1
|
||||
slideareaOffsetMultiplier: 0.9
|
||||
--- !u!114 &8463522706283787556
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5731468542189211806}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: ebe1ab889a9bed940995d4f47bc743ef, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
target: 4
|
||||
--- !u!1 &5770108565631511295
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -3848,7 +4095,7 @@ GameObject:
|
||||
- component: {fileID: 6319035899684778083}
|
||||
m_Layer: 0
|
||||
m_Name: Left Hand
|
||||
m_TagString: Player Left Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -5374,6 +5621,7 @@ RectTransform:
|
||||
m_LocalScale: {x: 0.15, y: 0.15, z: 0.15}
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children:
|
||||
- {fileID: 3664260978476899140}
|
||||
- {fileID: 3355479367658290507}
|
||||
- {fileID: 4818343909123725175}
|
||||
m_Father: {fileID: 1774211016983706491}
|
||||
@@ -5429,13 +5677,14 @@ MonoBehaviour:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6798620428918177696}
|
||||
m_Enabled: 1
|
||||
m_Enabled: 0
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 26a0dd79a025e5041a41f576b1aa4968, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
turnOffButton: {fileID: 3645818974320619446}
|
||||
turnOnButton: {fileID: 1311809556432207317}
|
||||
moveSpeedSlider: {fileID: 6956878155406096985}
|
||||
locomotion: {fileID: 1565464911732960072}
|
||||
--- !u!1 &6976341305452677775
|
||||
GameObject:
|
||||
@@ -5463,7 +5712,7 @@ RectTransform:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6976341305452677775}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 1.0000267}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 1}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
@@ -5472,8 +5721,8 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: -406.48022, y: 260}
|
||||
m_SizeDelta: {x: 383.04, y: 50.5}
|
||||
m_AnchoredPosition: {x: -446.3, y: 255.3}
|
||||
m_SizeDelta: {x: 327.3, y: 50.5}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &8334943640923905114
|
||||
CanvasRenderer:
|
||||
@@ -5569,7 +5818,7 @@ MonoBehaviour:
|
||||
m_VertexBufferAutoSizeReduction: 0
|
||||
m_useMaxVisibleDescender: 1
|
||||
m_pageToDisplay: 1
|
||||
m_margin: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_margin: {x: 0, y: 0, z: 0.9477234, w: 0}
|
||||
m_isUsingLegacyAnimationComponent: 0
|
||||
m_isVolumetricText: 0
|
||||
m_hasFontAssetChanged: 0
|
||||
@@ -5625,7 +5874,6 @@ GameObject:
|
||||
- component: {fileID: 7392776148620295955}
|
||||
- component: {fileID: 623723497249906612}
|
||||
- component: {fileID: 8524569723447833986}
|
||||
- component: {fileID: 2518031444015721236}
|
||||
m_Layer: 5
|
||||
m_Name: Button
|
||||
m_TagString: Untagged
|
||||
@@ -5752,19 +6000,6 @@ MonoBehaviour:
|
||||
minValue: 0
|
||||
maxValue: 1
|
||||
slideareaOffsetMultiplier: 0.9
|
||||
--- !u!114 &2518031444015721236
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7116268483853744053}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: ebe1ab889a9bed940995d4f47bc743ef, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
target: 3
|
||||
--- !u!1 &7137625347935658456
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -6181,7 +6416,7 @@ GameObject:
|
||||
- component: {fileID: 2428925342826453737}
|
||||
m_Layer: 0
|
||||
m_Name: Right Hand
|
||||
m_TagString: Player Right Hand
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -6850,7 +7085,7 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: -2404.8, y: 30}
|
||||
m_AnchoredPosition: {x: -2424, y: 30}
|
||||
m_SizeDelta: {x: 186.1, y: 50.5}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &6159749963066026057
|
||||
@@ -6916,7 +7151,7 @@ MonoBehaviour:
|
||||
m_fontSizeMin: 18
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 1
|
||||
m_HorizontalAlignment: 4
|
||||
m_VerticalAlignment: 512
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 0
|
||||
@@ -6966,7 +7201,6 @@ GameObject:
|
||||
- component: {fileID: 4806540607707404536}
|
||||
- component: {fileID: 1263225200033619485}
|
||||
- component: {fileID: 512852062931003448}
|
||||
- component: {fileID: 5185990981600041478}
|
||||
m_Layer: 5
|
||||
m_Name: Button
|
||||
m_TagString: Untagged
|
||||
@@ -7093,19 +7327,6 @@ MonoBehaviour:
|
||||
minValue: 0
|
||||
maxValue: 1
|
||||
slideareaOffsetMultiplier: 0.9
|
||||
--- !u!114 &5185990981600041478
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7795711801980221647}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: ebe1ab889a9bed940995d4f47bc743ef, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
target: 1
|
||||
--- !u!1 &7941339244779152679
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -7851,7 +8072,7 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: -3755, y: 30}
|
||||
m_AnchoredPosition: {x: -3897, y: 30}
|
||||
m_SizeDelta: {x: 131.9, y: 50.5}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7891019527381773321
|
||||
@@ -8112,7 +8333,7 @@ MonoBehaviour:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8807789255226040880}
|
||||
m_Enabled: 1
|
||||
m_Enabled: 0
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 0bf296fc962d7184ab14ad1841598d5f, type: 3}
|
||||
m_Name:
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
abstract public class AbstractSlider : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler
|
||||
{
|
||||
|
||||
public RectTransform sliderBackground; // Assign in Inspector
|
||||
public float minValue = 0f;
|
||||
public float maxValue = 1f;
|
||||
public float slideareaOffsetMultiplier = 0.9f;
|
||||
public float CurrentValue { get; private set; }
|
||||
public float CurrentNormalizedValue { get; private set; }
|
||||
|
||||
private RectTransform handleRect;
|
||||
private Vector2 backgroundStart;
|
||||
private float backgroundWidth;
|
||||
|
||||
public System.Action<float, bool> OnValueChanged;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
if (null == handleRect)
|
||||
{
|
||||
handleRect = GetComponent<RectTransform>();
|
||||
}
|
||||
|
||||
if (sliderBackground != null)
|
||||
{
|
||||
backgroundStart = sliderBackground.position;
|
||||
backgroundWidth = sliderBackground.rect.width;
|
||||
}
|
||||
|
||||
UpdateHandlePosition();
|
||||
}
|
||||
|
||||
virtual public void OnBeginDrag(PointerEventData eventData)
|
||||
{
|
||||
UpdateSlider(eventData);
|
||||
}
|
||||
|
||||
virtual public void OnDrag(PointerEventData eventData)
|
||||
{
|
||||
UpdateSlider(eventData);
|
||||
}
|
||||
|
||||
virtual public void OnEndDrag(PointerEventData eventData)
|
||||
{
|
||||
UpdateSlider(eventData, true);
|
||||
EventSystem.current.SetSelectedGameObject(null);
|
||||
}
|
||||
|
||||
virtual public void SetHandleValue(float unnormalizedValue)
|
||||
{
|
||||
SetValuesFromValue(unnormalizedValue);
|
||||
UpdateHandlePosition();
|
||||
}
|
||||
|
||||
virtual public void SetHandleNormalizedValue(float normalizedValue)
|
||||
{
|
||||
SetValuesFromNormalizedValue(normalizedValue);
|
||||
UpdateHandlePosition();
|
||||
}
|
||||
|
||||
virtual protected void UpdateHandlePosition()
|
||||
{
|
||||
if (null == handleRect) return; // The options menu might not be opened yet
|
||||
|
||||
float halfWidth = sliderBackground.rect.width * 0.5f;
|
||||
float limit = halfWidth * slideareaOffsetMultiplier;
|
||||
|
||||
float x = Mathf.Lerp(-limit, limit, CurrentNormalizedValue);
|
||||
handleRect.localPosition = new Vector3(x, handleRect.localPosition.y, 0);
|
||||
}
|
||||
|
||||
virtual protected void UpdateSlider(PointerEventData eventData, bool draggingEnded = false)
|
||||
{
|
||||
Vector2 localPoint;
|
||||
RectTransformUtility.ScreenPointToLocalPointInRectangle(sliderBackground, eventData.position, eventData.pressEventCamera, out localPoint);
|
||||
float halfWidth = sliderBackground.rect.width * 0.5f;
|
||||
|
||||
// Only allow dragging within 90% of the slider width, centered
|
||||
float limit = halfWidth * slideareaOffsetMultiplier;
|
||||
float clampedX = Mathf.Clamp(localPoint.x, -limit, limit);
|
||||
|
||||
|
||||
Vector3 newPosition = new Vector3(clampedX, handleRect.localPosition.y, handleRect.localPosition.z);
|
||||
handleRect.localPosition = newPosition;
|
||||
|
||||
// Normalize within the limited 90% range
|
||||
float normalized = (clampedX + limit) / (limit * 2f);
|
||||
SetValuesFromValue(Mathf.Lerp(minValue, maxValue, normalized));
|
||||
|
||||
OnValueChanged?.Invoke(CurrentValue, draggingEnded);
|
||||
|
||||
}
|
||||
|
||||
protected void SetValuesFromNormalizedValue(float normalizedValue)
|
||||
{
|
||||
CurrentNormalizedValue = normalizedValue;
|
||||
CurrentValue = CurrentNormalizedValue * (maxValue - minValue) + minValue;
|
||||
}
|
||||
|
||||
protected void SetValuesFromValue(float unnormalizedValue)
|
||||
{
|
||||
CurrentValue = unnormalizedValue;
|
||||
CurrentNormalizedValue = (CurrentValue - minValue) / (maxValue - minValue);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8b9c98f0231c596479d7c201d1a23ebe
|
||||
guid: 8fe704cafb6cf2441a62a6497d58f229
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
[Serializable]
|
||||
abstract public class AbstractValueController : MonoBehaviour
|
||||
{
|
||||
abstract public void RestoreFromConfig();
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dfd6e172b2a79944788029ce9d4220dd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -4,87 +4,8 @@ using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
public class AudioSliderDragHandler : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler
|
||||
public class AudioSliderDragHandler : AbstractSlider, IBeginDragHandler, IDragHandler, IEndDragHandler
|
||||
{
|
||||
|
||||
public RectTransform sliderBackground; // Assign in Inspector
|
||||
public float minValue = 0f;
|
||||
public float maxValue = 1f;
|
||||
public float slideareaOffsetMultiplier = 0.9f;
|
||||
public float CurrentValue { get; private set; }
|
||||
|
||||
private RectTransform handleRect;
|
||||
private Vector2 backgroundStart;
|
||||
private float backgroundWidth;
|
||||
|
||||
public System.Action<float> OnValueChanged;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
handleRect = GetComponent<RectTransform>();
|
||||
|
||||
if (sliderBackground != null)
|
||||
{
|
||||
backgroundStart = sliderBackground.position;
|
||||
backgroundWidth = sliderBackground.rect.width;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void OnBeginDrag(PointerEventData eventData)
|
||||
{
|
||||
UpdateSlider(eventData);
|
||||
}
|
||||
|
||||
public void SetHandlePosition(float normalizedValue)
|
||||
{
|
||||
float halfWidth = sliderBackground.rect.width * 0.5f;
|
||||
float limit = halfWidth * slideareaOffsetMultiplier;
|
||||
|
||||
float x = Mathf.Lerp(-limit, limit, normalizedValue);
|
||||
handleRect.localPosition = new Vector3(x, handleRect.localPosition.y, 0);
|
||||
|
||||
CurrentValue = normalizedValue;
|
||||
}
|
||||
|
||||
|
||||
public void OnDrag(PointerEventData eventData)
|
||||
{
|
||||
UpdateSlider(eventData);
|
||||
}
|
||||
|
||||
public void OnEndDrag(PointerEventData eventData)
|
||||
{
|
||||
UpdateSlider(eventData);
|
||||
//notify FMOD
|
||||
}
|
||||
private void UpdateSlider(PointerEventData eventData)
|
||||
{
|
||||
|
||||
//Debug.Log("UpDating Slider");
|
||||
Vector2 localPoint;
|
||||
RectTransformUtility.ScreenPointToLocalPointInRectangle(sliderBackground, eventData.position, eventData.pressEventCamera, out localPoint);
|
||||
|
||||
float halfWidth = sliderBackground.rect.width * 0.5f;
|
||||
|
||||
|
||||
|
||||
// Only allow dragging within 90% of the slider width, centered
|
||||
float limit = halfWidth * slideareaOffsetMultiplier;
|
||||
float clampedX = Mathf.Clamp(localPoint.x, -limit, limit);
|
||||
|
||||
Vector3 newPosition = new Vector3(clampedX, handleRect.localPosition.y, handleRect.localPosition.z);
|
||||
handleRect.localPosition = newPosition;
|
||||
|
||||
// Normalize within the limited 90% range
|
||||
float normalized = (clampedX + limit) / (limit * 2f);
|
||||
//Debug.Log(normalized);
|
||||
CurrentValue = Mathf.Lerp(minValue, maxValue, normalized);
|
||||
|
||||
//Debug.Log(warningThreshholdValue);
|
||||
OnValueChanged?.Invoke(CurrentValue);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,12 +3,14 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
//using UnityEngine.UIElements;
|
||||
using UnityEngine.XR.Interaction.Toolkit;
|
||||
|
||||
public class ContinuoslocomotionConfigurator : MonoBehaviour
|
||||
public class ContinuoslocomotionConfigurator : AbstractValueController
|
||||
{
|
||||
public Button turnOffButton;
|
||||
public Button turnOnButton;
|
||||
public MoveSliderDragHandler moveSpeedSlider;
|
||||
public ContinuousMoveProviderBase locomotion;
|
||||
|
||||
// Events for listeners
|
||||
@@ -19,13 +21,28 @@ public class ContinuoslocomotionConfigurator : MonoBehaviour
|
||||
{
|
||||
turnOnButton.onClick.AddListener(enableLocomotion);
|
||||
turnOffButton.onClick.AddListener(disableLocomotion);
|
||||
turnOnButton.gameObject.SetActive(false);
|
||||
|
||||
RestoreFromConfig();
|
||||
}
|
||||
|
||||
override public void RestoreFromConfig()
|
||||
{
|
||||
bool isContinuousLocomotion = ConfigManager.instance.GetIsContinuousLocomotion();
|
||||
turnOffButton.gameObject.SetActive(isContinuousLocomotion);
|
||||
turnOnButton.gameObject.SetActive(!isContinuousLocomotion);
|
||||
locomotion.enabled = isContinuousLocomotion;
|
||||
OnLocomotionToggled?.Invoke(isContinuousLocomotion);
|
||||
|
||||
float continuousLocomotionSpeed = ConfigManager.instance.GetContinuousLocomotionSpeed();
|
||||
moveSpeedSlider.SetHandleValue(continuousLocomotionSpeed);
|
||||
locomotion.moveSpeed = continuousLocomotionSpeed;
|
||||
}
|
||||
|
||||
public void UpdateSpeed(float speed)
|
||||
{
|
||||
locomotion.moveSpeed = speed;
|
||||
OnSpeedChanged?.Invoke(speed);
|
||||
WriteToConfig();
|
||||
}
|
||||
|
||||
private void enableLocomotion()
|
||||
@@ -35,6 +52,7 @@ public class ContinuoslocomotionConfigurator : MonoBehaviour
|
||||
turnOnButton.gameObject.SetActive(false);
|
||||
turnOffButton.gameObject.SetActive(true);
|
||||
OnLocomotionToggled?.Invoke(true);
|
||||
WriteToConfig();
|
||||
}
|
||||
|
||||
private void disableLocomotion()
|
||||
@@ -44,5 +62,12 @@ public class ContinuoslocomotionConfigurator : MonoBehaviour
|
||||
turnOnButton.gameObject.SetActive(true);
|
||||
turnOffButton.gameObject.SetActive(false);
|
||||
OnLocomotionToggled?.Invoke(false);
|
||||
WriteToConfig();
|
||||
}
|
||||
|
||||
protected void WriteToConfig()
|
||||
{
|
||||
ConfigManager.instance.SetIsContinuousLocomotion(locomotion.enabled);
|
||||
ConfigManager.instance.SetContinuousLocomotionSpeed(locomotion.moveSpeed);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,82 +3,35 @@ using UnityEngine.UI;
|
||||
using UnityEngine.EventSystems;
|
||||
using TMPro;
|
||||
|
||||
public class MoveSliderDragHandler : MonoBehaviour, IDragHandler, IBeginDragHandler, IEndDragHandler
|
||||
public class MoveSliderDragHandler : AbstractSlider, IDragHandler, IBeginDragHandler, IEndDragHandler
|
||||
{
|
||||
public RectTransform sliderBackground; // Assign in Inspector
|
||||
public float minValue = 2f;
|
||||
public float maxValue = 5f;
|
||||
public float slideareaOffsetMultiplier = 0.9f;
|
||||
public TMP_Text warningText;
|
||||
public float warningThreshholdValue = 0.65f;
|
||||
public float CurrentValue { get; private set; }
|
||||
|
||||
public ContinuoslocomotionConfigurator configurator;
|
||||
|
||||
private RectTransform handleRect;
|
||||
private Vector2 backgroundStart;
|
||||
private float backgroundWidth;
|
||||
|
||||
void Awake()
|
||||
override public void OnEndDrag(PointerEventData eventData)
|
||||
{
|
||||
handleRect = GetComponent<RectTransform>();
|
||||
|
||||
if (sliderBackground != null)
|
||||
{
|
||||
backgroundStart = sliderBackground.position;
|
||||
backgroundWidth = sliderBackground.rect.width;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void OnBeginDrag(PointerEventData eventData)
|
||||
{
|
||||
UpdateSlider(eventData);
|
||||
}
|
||||
|
||||
public void OnDrag(PointerEventData eventData)
|
||||
{
|
||||
UpdateSlider(eventData);
|
||||
}
|
||||
|
||||
public void OnEndDrag(PointerEventData eventData)
|
||||
{
|
||||
UpdateSlider(eventData);
|
||||
base.OnEndDrag(eventData);
|
||||
configurator.UpdateSpeed(CurrentValue);
|
||||
|
||||
EventSystem.current.SetSelectedGameObject(null);
|
||||
}
|
||||
private void UpdateSlider(PointerEventData eventData)
|
||||
|
||||
override protected void UpdateSlider(PointerEventData eventData, bool draggingEnded = false)
|
||||
{
|
||||
Debug.Log("UpDating Slider");
|
||||
Vector2 localPoint;
|
||||
RectTransformUtility.ScreenPointToLocalPointInRectangle(sliderBackground, eventData.position, eventData.pressEventCamera, out localPoint);
|
||||
base.UpdateSlider(eventData, draggingEnded);
|
||||
DisplayWarningTextIfNecessary();
|
||||
}
|
||||
|
||||
float halfWidth = sliderBackground.rect.width * 0.5f;
|
||||
override protected void UpdateHandlePosition()
|
||||
{
|
||||
base.UpdateHandlePosition();
|
||||
DisplayWarningTextIfNecessary();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Only allow dragging within 90% of the slider width, centered
|
||||
float limit = halfWidth * slideareaOffsetMultiplier;
|
||||
float clampedX = Mathf.Clamp(localPoint.x, -limit, limit);
|
||||
|
||||
Vector3 newPosition = new Vector3(clampedX, handleRect.localPosition.y, handleRect.localPosition.z);
|
||||
handleRect.localPosition = newPosition;
|
||||
|
||||
// Normalize within the limited 90% range
|
||||
float normalized = (clampedX + limit) / (limit * 2f);
|
||||
//Debug.Log(normalized);
|
||||
CurrentValue = Mathf.Lerp(minValue, maxValue, normalized);
|
||||
|
||||
// Displaying the warning.
|
||||
|
||||
if (CurrentValue > (warningThreshholdValue*(maxValue - minValue) + minValue)) warningText.gameObject.SetActive(true);
|
||||
|
||||
protected void DisplayWarningTextIfNecessary()
|
||||
{
|
||||
if (CurrentValue > (warningThreshholdValue * (maxValue - minValue) + minValue)) warningText.gameObject.SetActive(true);
|
||||
else warningText.gameObject.SetActive(false);
|
||||
|
||||
//Debug.Log(warningThreshholdValue);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
public class RegularButtonView : MonoBehaviour, IPointerEnterHandler, IPointerClickHandler
|
||||
{
|
||||
|
||||
public void OnPointerEnter(PointerEventData eventData)
|
||||
{
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Hover, this.gameObject);
|
||||
}
|
||||
public void OnPointerClick(PointerEventData eventData)
|
||||
{
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Click, this.gameObject);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9c648a319c5c6aa47b3ef152a10657bf
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,20 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Unity.Burst;
|
||||
using UnityEngine;
|
||||
|
||||
public class RestoreDefaultsController : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
public List<AbstractValueController> valueControllers = new List<AbstractValueController>();
|
||||
|
||||
public void OnRestoreDefaults()
|
||||
{
|
||||
ConfigManager.instance.RestoreDefaultConfig();
|
||||
|
||||
foreach (AbstractValueController avc in valueControllers)
|
||||
{
|
||||
avc.RestoreFromConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1ebe1a3f8ef35a041a8ef39da672dd49
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,6 +1,6 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class SliderToVCA : MonoBehaviour
|
||||
public class SliderToVCA : AbstractValueController
|
||||
{
|
||||
public enum VCATarget
|
||||
{
|
||||
@@ -13,76 +13,85 @@ public class SliderToVCA : MonoBehaviour
|
||||
}
|
||||
|
||||
public VCATarget target;
|
||||
private AudioSliderDragHandler slider;
|
||||
public AudioSliderDragHandler slider;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
slider = GetComponent<AudioSliderDragHandler>();
|
||||
slider.OnValueChanged += ApplyVolume;
|
||||
}
|
||||
private void Start()
|
||||
{
|
||||
float initialValue = GetInitialValueFromAudioManager();
|
||||
slider.SetHandlePosition(initialValue); // we will add this function
|
||||
}
|
||||
|
||||
|
||||
private float GetInitialValueFromAudioManager()
|
||||
{
|
||||
switch (target)
|
||||
{
|
||||
case VCATarget.Master:
|
||||
return AudioManager.Instance.MasterVolume;
|
||||
case VCATarget.Ambiences:
|
||||
return AudioManager.Instance.AmbienceVolume;
|
||||
case VCATarget.Music:
|
||||
return AudioManager.Instance.MusicVolume;
|
||||
case VCATarget.SFX:
|
||||
return AudioManager.Instance.SFXVolume;
|
||||
case VCATarget.UI:
|
||||
return AudioManager.Instance.UIVolume;
|
||||
case VCATarget.Voiceovers:
|
||||
return AudioManager.Instance.VoiceoverVolume;
|
||||
default:
|
||||
return 0.5f;
|
||||
}
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
// Constantly push slider value to the VCA
|
||||
ApplyVolume(slider.CurrentValue);
|
||||
//Debug.Log("CurrentValue: " + slider.CurrentValue);
|
||||
RestoreFromConfig();
|
||||
}
|
||||
|
||||
private void ApplyVolume(float value)
|
||||
override public void RestoreFromConfig()
|
||||
{
|
||||
float initialValue = GetInitialValue();
|
||||
slider.SetHandleValue(initialValue);
|
||||
}
|
||||
|
||||
private float GetInitialValue()
|
||||
{
|
||||
switch (target)
|
||||
{
|
||||
case VCATarget.Master:
|
||||
return ConfigManager.instance.getVolumeMaster();
|
||||
case VCATarget.Ambiences:
|
||||
return ConfigManager.instance.getVolumeAmbient();
|
||||
case VCATarget.Music:
|
||||
return ConfigManager.instance.getVolumeMusic();
|
||||
case VCATarget.SFX:
|
||||
return ConfigManager.instance.getVolumeSFX();
|
||||
case VCATarget.UI:
|
||||
return ConfigManager.instance.getVolumeUI();
|
||||
case VCATarget.Voiceovers:
|
||||
return ConfigManager.instance.getVolumeVO();
|
||||
default:
|
||||
return 0.5f;
|
||||
}
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
// Constantly push slider value to the VCA
|
||||
ApplyVolume(slider.CurrentValue, false);
|
||||
//Debug.Log("CurrentValue: " + slider.CurrentValue);
|
||||
}
|
||||
|
||||
private void ApplyVolume(float value, bool isLastChange)
|
||||
{
|
||||
switch (target)
|
||||
{
|
||||
case VCATarget.Master:
|
||||
AudioManager.Instance.SetMasterVCA(value);
|
||||
//Debug.LogError(value);
|
||||
break;
|
||||
if (isLastChange) ConfigManager.instance.SetVolumeMaster(value);
|
||||
break;
|
||||
|
||||
case VCATarget.Ambiences:
|
||||
AudioManager.Instance.SetAmbientVCA(value);
|
||||
if (isLastChange) ConfigManager.instance.SetVolumeAmbient(value);
|
||||
break;
|
||||
|
||||
case VCATarget.Music:
|
||||
AudioManager.Instance.SetMusicVCA(value);
|
||||
if (isLastChange) ConfigManager.instance.SetVolumeMusic(value);
|
||||
break;
|
||||
|
||||
case VCATarget.SFX:
|
||||
AudioManager.Instance.SetSFXVCA(value);
|
||||
if (isLastChange) ConfigManager.instance.SetVolumeSFX(value);
|
||||
break;
|
||||
|
||||
case VCATarget.UI:
|
||||
AudioManager.Instance.SetUIVCA(value);
|
||||
if (isLastChange) ConfigManager.instance.SetVolumeUI(value);
|
||||
break;
|
||||
|
||||
case VCATarget.Voiceovers:
|
||||
AudioManager.Instance.SetVoiceoverVCA(value);
|
||||
if (isLastChange) ConfigManager.instance.SetVolumeVO(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
@@ -44,6 +45,26 @@ namespace _PROJECT.NewHandPresence
|
||||
|
||||
private GameObject _billboard;
|
||||
|
||||
public enum TutorialInfoKey
|
||||
{
|
||||
Initialized,
|
||||
LeftHintController,
|
||||
RightHintController,
|
||||
LeftSmartHandPresence,
|
||||
RightSmartHandPresence
|
||||
}
|
||||
protected Dictionary<TutorialInfoKey, bool> initializationInfoStatus = new Dictionary<TutorialInfoKey, bool>();
|
||||
protected Coroutine initializationInfoCoroutine;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
initializationInfoStatus.Add(TutorialInfoKey.Initialized, false);
|
||||
initializationInfoStatus.Add(TutorialInfoKey.LeftHintController, false);
|
||||
initializationInfoStatus.Add(TutorialInfoKey.RightHintController, false);
|
||||
initializationInfoStatus.Add(TutorialInfoKey.LeftSmartHandPresence, false);
|
||||
initializationInfoStatus.Add(TutorialInfoKey.RightSmartHandPresence, false);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (_state == TutorialState.Initializing)
|
||||
@@ -149,7 +170,7 @@ namespace _PROJECT.NewHandPresence
|
||||
{
|
||||
if (leftHand == null || rightHand == null)
|
||||
{
|
||||
//Debug.Log("Left or right hand is null");
|
||||
Debug.Log("Left or right hand is null");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -177,29 +198,33 @@ namespace _PROJECT.NewHandPresence
|
||||
private void TryInitialize()
|
||||
{
|
||||
if (!CanInitialize()) return;
|
||||
if (null == initializationInfoCoroutine)
|
||||
{
|
||||
initializationInfoCoroutine = StartCoroutine(InitializationInfoCoroutine());
|
||||
}
|
||||
|
||||
_camera = Camera.main;
|
||||
|
||||
Debug.Log("Initializing tutorial");
|
||||
//Debug.Log("Initializing tutorial");
|
||||
|
||||
_leftHintController = leftHand.GetComponentInChildren<XRControllerHintController>();
|
||||
_rightHintController = rightHand.GetComponentInChildren<XRControllerHintController>();
|
||||
|
||||
Debug.Log($"Left hint controller: {_leftHintController}");
|
||||
Debug.Log($"Right hint controller: {_rightHintController}");
|
||||
initializationInfoStatus[TutorialInfoKey.LeftHintController] = null != _leftHintController;
|
||||
initializationInfoStatus[TutorialInfoKey.RightHintController] = null != _rightHintController;
|
||||
|
||||
_leftSmartHandPresence = leftHand.GetComponentInChildren<SmartHandPresence>();
|
||||
_rightSmartHandPresence = rightHand.GetComponentInChildren<SmartHandPresence>();
|
||||
|
||||
Debug.Log($"Left smart hand presence: {_leftSmartHandPresence}");
|
||||
Debug.Log($"Right smart hand presence: {_rightSmartHandPresence}");
|
||||
initializationInfoStatus[TutorialInfoKey.LeftSmartHandPresence] = null != _leftSmartHandPresence;
|
||||
initializationInfoStatus[TutorialInfoKey.RightSmartHandPresence] = null != _rightSmartHandPresence;
|
||||
|
||||
if (_leftHintController == null ||
|
||||
_rightHintController == null ||
|
||||
_leftSmartHandPresence == null ||
|
||||
_rightSmartHandPresence == null)
|
||||
{
|
||||
Debug.Log("Hint controller or smart hand presence is null");
|
||||
//Debug.Log("Hint controller or smart hand presence is null");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -216,6 +241,7 @@ namespace _PROJECT.NewHandPresence
|
||||
|
||||
UpdateState(_state.Next());
|
||||
Debug.Log("Tutorial initialized");
|
||||
StopCoroutine(initializationInfoCoroutine);
|
||||
}
|
||||
|
||||
private void OnGripPerformed(SelectEnterEventArgs arg0)
|
||||
@@ -307,5 +333,35 @@ namespace _PROJECT.NewHandPresence
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
IEnumerator InitializationInfoCoroutine()
|
||||
{
|
||||
string CombineMessage(TutorialInfoKey key, object value, string prefix)
|
||||
{
|
||||
bool isAvailable = initializationInfoStatus.GetValueOrDefault(key);
|
||||
|
||||
return prefix + ": " + (isAvailable ? value.ToString() : "NULL") + "\r\n";
|
||||
}
|
||||
|
||||
bool isInitialized = initializationInfoStatus.GetValueOrDefault(TutorialInfoKey.Initialized);
|
||||
while (!isInitialized)
|
||||
{
|
||||
isInitialized = initializationInfoStatus.GetValueOrDefault(TutorialInfoKey.Initialized);
|
||||
|
||||
string infoMessage = "Tutorial not yet initialized!" + "\r\n";
|
||||
infoMessage += "(click me for more info)" + "\r\n";
|
||||
infoMessage += "Hint controllers" + "\r\n";
|
||||
infoMessage += CombineMessage(TutorialInfoKey.LeftHintController, _leftHintController, "Left");
|
||||
infoMessage += CombineMessage(TutorialInfoKey.RightHintController, _rightHintController, "Right");
|
||||
infoMessage += "Smart hand presence" + "\r\n";
|
||||
infoMessage += CombineMessage(TutorialInfoKey.LeftSmartHandPresence, _leftSmartHandPresence, "Left");
|
||||
infoMessage += CombineMessage(TutorialInfoKey.RightSmartHandPresence, _rightSmartHandPresence, "Right");
|
||||
Debug.Log(infoMessage);
|
||||
|
||||
yield return new WaitForSeconds(7);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,22 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class PlayAnimationOnTrigger : MonoBehaviour
|
||||
{
|
||||
[SerializeField] public Animator animator; // Reference to the Animator component
|
||||
[SerializeField] public string animationName = "YourAnimation"; // Name of the animation to play
|
||||
public enum KnownAnimations
|
||||
{
|
||||
UFOFlight1
|
||||
}
|
||||
|
||||
protected Dictionary<KnownAnimations, string> animationNames = new Dictionary<KnownAnimations, string>();
|
||||
|
||||
[SerializeField] public Animator animator; // Reference to the Animator component
|
||||
[SerializeField] public KnownAnimations animationName = KnownAnimations.UFOFlight1; // Name of the animation to play
|
||||
|
||||
protected void Awake()
|
||||
{
|
||||
animationNames[KnownAnimations.UFOFlight1] = "UFO group flight 1";
|
||||
}
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
@@ -15,15 +27,16 @@ public class PlayAnimationOnTrigger : MonoBehaviour
|
||||
return;
|
||||
}
|
||||
|
||||
string animationNameString = animationNames[animationName];
|
||||
|
||||
// Check if the animation is already playing
|
||||
if (animator.GetCurrentAnimatorStateInfo(0).IsName(animationName) && animator.GetCurrentAnimatorStateInfo(0).normalizedTime < 1)
|
||||
if (animator.GetCurrentAnimatorStateInfo(0).IsName(animationNameString) && animator.GetCurrentAnimatorStateInfo(0).normalizedTime < 1)
|
||||
{
|
||||
Debug.Log("Animation is already playing.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Play the animation
|
||||
animator.Play(animationName, 0, 0f);
|
||||
Debug.Log("Playing animation: " + animationName);
|
||||
animator.Play(animationNameString, 0, 0f);
|
||||
Debug.Log("Playing animation: " + animationNameString);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,42 +47,32 @@ PrefabInstance:
|
||||
type: 3}
|
||||
propertyPath: _networkBehaviours.Array.data[0]
|
||||
value:
|
||||
objectReference: {fileID: 0}
|
||||
objectReference: {fileID: 5202846571429040564}
|
||||
- target: {fileID: 1047001759896168042, guid: ffcd2a74c5d65454eb9a9df7cdee282d,
|
||||
type: 3}
|
||||
propertyPath: _networkBehaviours.Array.data[1]
|
||||
value:
|
||||
objectReference: {fileID: 0}
|
||||
objectReference: {fileID: 1679634901522453674}
|
||||
- target: {fileID: 1047001759896168042, guid: ffcd2a74c5d65454eb9a9df7cdee282d,
|
||||
type: 3}
|
||||
propertyPath: _networkBehaviours.Array.data[2]
|
||||
value:
|
||||
objectReference: {fileID: 0}
|
||||
objectReference: {fileID: 6661770736086048195}
|
||||
- target: {fileID: 1047001759896168042, guid: ffcd2a74c5d65454eb9a9df7cdee282d,
|
||||
type: 3}
|
||||
propertyPath: _networkBehaviours.Array.data[3]
|
||||
value:
|
||||
objectReference: {fileID: 0}
|
||||
objectReference: {fileID: 2131991500650195796}
|
||||
- target: {fileID: 1047001759896168042, guid: ffcd2a74c5d65454eb9a9df7cdee282d,
|
||||
type: 3}
|
||||
propertyPath: _networkBehaviours.Array.data[4]
|
||||
value:
|
||||
objectReference: {fileID: 0}
|
||||
objectReference: {fileID: 427371208704957824}
|
||||
- target: {fileID: 1047001759896168042, guid: ffcd2a74c5d65454eb9a9df7cdee282d,
|
||||
type: 3}
|
||||
propertyPath: _sceneNetworkObjects.Array.data[0]
|
||||
value:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2689384198849609103, guid: ffcd2a74c5d65454eb9a9df7cdee282d,
|
||||
type: 3}
|
||||
propertyPath: <PrefabId>k__BackingField
|
||||
value: 3
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2689384198849609103, guid: ffcd2a74c5d65454eb9a9df7cdee282d,
|
||||
type: 3}
|
||||
propertyPath: <AssetPathHash>k__BackingField
|
||||
value: 11307787013377802985
|
||||
objectReference: {fileID: 0}
|
||||
objectReference: {fileID: 9003568064594053937}
|
||||
- target: {fileID: 3316891016740450456, guid: ffcd2a74c5d65454eb9a9df7cdee282d,
|
||||
type: 3}
|
||||
propertyPath: _componentIndexCache
|
||||
@@ -98,11 +88,6 @@ PrefabInstance:
|
||||
propertyPath: _componentIndexCache
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7983999977322064054, guid: ffcd2a74c5d65454eb9a9df7cdee282d,
|
||||
type: 3}
|
||||
propertyPath: m_Name
|
||||
value: TargetUFO Variant
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8062271296867124751, guid: ffcd2a74c5d65454eb9a9df7cdee282d,
|
||||
type: 3}
|
||||
propertyPath: _componentIndexCache
|
||||
@@ -172,5 +157,108 @@ PrefabInstance:
|
||||
- {fileID: 3572526038880022669, guid: ffcd2a74c5d65454eb9a9df7cdee282d, type: 3}
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_AddedComponents:
|
||||
- targetCorrespondingSourceObject: {fileID: 93219228833127587, guid: ffcd2a74c5d65454eb9a9df7cdee282d,
|
||||
type: 3}
|
||||
insertIndex: -1
|
||||
addedObject: {fileID: 8322216027534318572}
|
||||
m_SourcePrefab: {fileID: 100100000, guid: ffcd2a74c5d65454eb9a9df7cdee282d, type: 3}
|
||||
--- !u!114 &427371208704957824 stripped
|
||||
MonoBehaviour:
|
||||
m_CorrespondingSourceObject: {fileID: 8618473685913268443, guid: ffcd2a74c5d65454eb9a9df7cdee282d,
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 8247405925049036123}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: a2836e36774ca1c4bbbee976e17b649c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!114 &1679634901522453674 stripped
|
||||
MonoBehaviour:
|
||||
m_CorrespondingSourceObject: {fileID: 7294680161384397297, guid: ffcd2a74c5d65454eb9a9df7cdee282d,
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 8247405925049036123}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: a2836e36774ca1c4bbbee976e17b649c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!114 &2131991500650195796 stripped
|
||||
MonoBehaviour:
|
||||
m_CorrespondingSourceObject: {fileID: 8062271296867124751, guid: ffcd2a74c5d65454eb9a9df7cdee282d,
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 8247405925049036123}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: a2836e36774ca1c4bbbee976e17b649c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!114 &5202846571429040564 stripped
|
||||
MonoBehaviour:
|
||||
m_CorrespondingSourceObject: {fileID: 4197516043068701935, guid: ffcd2a74c5d65454eb9a9df7cdee282d,
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 8247405925049036123}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8304503138865017336}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: a2836e36774ca1c4bbbee976e17b649c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!114 &6661770736086048195 stripped
|
||||
MonoBehaviour:
|
||||
m_CorrespondingSourceObject: {fileID: 3316891016740450456, guid: ffcd2a74c5d65454eb9a9df7cdee282d,
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 8247405925049036123}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: a2836e36774ca1c4bbbee976e17b649c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &8304503138865017336 stripped
|
||||
GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 93219228833127587, guid: ffcd2a74c5d65454eb9a9df7cdee282d,
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 8247405925049036123}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!95 &8322216027534318572
|
||||
Animator:
|
||||
serializedVersion: 5
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8304503138865017336}
|
||||
m_Enabled: 1
|
||||
m_Avatar: {fileID: 0}
|
||||
m_Controller: {fileID: 9100000, guid: 36e85fed2c7547d4f8c33da43172c8e7, type: 2}
|
||||
m_CullingMode: 0
|
||||
m_UpdateMode: 0
|
||||
m_ApplyRootMotion: 0
|
||||
m_LinearVelocityBlending: 0
|
||||
m_StabilizeFeet: 0
|
||||
m_WarningMessage:
|
||||
m_HasTransformHierarchy: 1
|
||||
m_AllowConstantClipSamplingOptimization: 1
|
||||
m_KeepAnimatorStateOnDisable: 0
|
||||
m_WriteDefaultValuesOnDisable: 0
|
||||
--- !u!114 &9003568064594053937 stripped
|
||||
MonoBehaviour:
|
||||
m_CorrespondingSourceObject: {fileID: 1047001759896168042, guid: ffcd2a74c5d65454eb9a9df7cdee282d,
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 8247405925049036123}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8304503138865017336}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
|
||||
@@ -29,7 +29,15 @@ namespace _PROJECT.Multiplayer.NewBow
|
||||
if (_notch == null)
|
||||
Debug.LogError("Notch not found");
|
||||
|
||||
CreateArrowServer();
|
||||
//CreateArrowServer();
|
||||
}
|
||||
|
||||
public override void OnOwnershipServer(NetworkConnection prevOwner)
|
||||
{
|
||||
base.OnOwnershipServer(prevOwner);
|
||||
|
||||
if (Owner.IsValid)
|
||||
CreateArrowServer();
|
||||
}
|
||||
|
||||
public override void OnStartClient()
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8f8b6fc486b30ec42a6744dd854848ae
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 09862e5840b398045b21a0cf8c5d0062
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user