Commit 1b1592b9 authored by saad's avatar saad

add some pliers

parent eb0c27bb
......@@ -5,7 +5,6 @@ using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
using static UnityEngine.Windows.WebCam.VideoCapture;
namespace AL_Arcade.DialogueSystem.Scripts
{
......
......@@ -32,7 +32,7 @@ ModelImporter:
extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations: []
isReadable: 0
isReadable: 1
meshes:
lODScreenPercentages: []
globalScale: 1
......
......@@ -3119,6 +3119,11 @@ PrefabInstance:
propertyPath: m_ConstrainProportionsScale
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8759531601909846707, guid: bbdeff09fea42b34baef4d5aee1926e0,
type: 3}
propertyPath: outlineWidth
value: 3.04
objectReference: {fileID: 0}
- target: {fileID: 9019275256872145588, guid: bbdeff09fea42b34baef4d5aee1926e0,
type: 3}
propertyPath: m_Name
......
......@@ -12,6 +12,8 @@ GameObject:
- component: {fileID: 3944800286380083876}
- component: {fileID: 8597538289810706562}
- component: {fileID: 8299607319623816837}
- component: {fileID: 8759531601909846707}
- component: {fileID: 5101824334617674510}
m_Layer: 0
m_Name: Wire 1
m_TagString: Untagged
......@@ -108,8 +110,48 @@ MonoBehaviour:
_button: {fileID: 5459509267802171274}
_fadeCanvasAndLine: {fileID: 4924190921142732258}
_floatingObject: {fileID: 91300033064305310}
_outlineRenderer: {fileID: 8759531601909846707}
CorrectCutParticles: {fileID: 4286736223692924257}
WrongcutParticles: {fileID: 7528912567480112244}
--- !u!114 &8759531601909846707
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9019275256872145588}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5fea29bb7c508c244a1f805a5fd3fc4d, type: 3}
m_Name:
m_EditorClassIdentifier:
outlineMode: 0
outlineColor: {r: 0, g: 0, b: 0, a: 1}
outlineWidth: 1.15
precomputeOutline: 0
bakeKeys: []
bakeValues: []
--- !u!65 &5101824334617674510
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9019275256872145588}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 0.0046682265, y: 0.0030387468, z: 0.0014300388}
m_Center: {x: -0.0005777449, y: -0.00056703144, z: -0.000054602562}
--- !u!1001 &5747940244456248903
PrefabInstance:
m_ObjectHideFlags: 0
......@@ -151,32 +193,32 @@ PrefabInstance:
- target: {fileID: 3117071613802403931, guid: 39a0d4a1f4fe2a649af24d0e64bde45a,
type: 3}
propertyPath: m_Positions.Array.data[0].x
value: -28.942194
value: -0.111194625
objectReference: {fileID: 0}
- target: {fileID: 3117071613802403931, guid: 39a0d4a1f4fe2a649af24d0e64bde45a,
type: 3}
propertyPath: m_Positions.Array.data[0].y
value: 1.1643001
value: 0.013300069
objectReference: {fileID: 0}
- target: {fileID: 3117071613802403931, guid: 39a0d4a1f4fe2a649af24d0e64bde45a,
type: 3}
propertyPath: m_Positions.Array.data[0].z
value: -28.07675
value: 0.024602678
objectReference: {fileID: 0}
- target: {fileID: 3117071613802403931, guid: 39a0d4a1f4fe2a649af24d0e64bde45a,
type: 3}
propertyPath: m_Positions.Array.data[1].x
value: -29.012352
value: -0.18135262
objectReference: {fileID: 0}
- target: {fileID: 3117071613802403931, guid: 39a0d4a1f4fe2a649af24d0e64bde45a,
type: 3}
propertyPath: m_Positions.Array.data[1].y
value: 1.2221012
value: 0.07110119
objectReference: {fileID: 0}
- target: {fileID: 3117071613802403931, guid: 39a0d4a1f4fe2a649af24d0e64bde45a,
type: 3}
propertyPath: m_Positions.Array.data[1].z
value: -28.051907
value: 0.049446106
objectReference: {fileID: 0}
- target: {fileID: 3784596669894271944, guid: 39a0d4a1f4fe2a649af24d0e64bde45a,
type: 3}
......@@ -577,7 +619,8 @@ PrefabInstance:
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_RemovedGameObjects:
- {fileID: 2097414752014147601, guid: 9deec30e5bac4d645b6a75d1949b3315, type: 3}
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 9deec30e5bac4d645b6a75d1949b3315, type: 3}
......
fileFormatVersion: 2
guid: 8b4d5f28f72f3f1429d1e54e587c5d02
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Quick Outline
=============
Developed by Chris Nolet (c) 2018
Instructions
------------
To add an outline to an object, drag-and-drop the Outline.cs
script onto the object. The outline materials will be loaded
at runtime.
You can also add outlines programmatically with:
var outline = gameObject.AddComponent<Outline>();
outline.OutlineMode = Outline.Mode.OutlineAll;
outline.OutlineColor = Color.yellow;
outline.OutlineWidth = 5f;
The outline script does a small amount of work in Awake().
For best results, use outline.enabled to toggle the outline.
Avoid removing and re-adding the component if possible.
For large meshes, you may also like to enable 'Precompute
Outline' in the editor. This will reduce the amount of work
performed in Awake().
Troubleshooting
---------------
If the outline appears off-center, please try the following:
1. Set 'Read/Write Enabled' on each model's import settings.
2. Disable 'Optimize Mesh Data' in the player settings.
fileFormatVersion: 2
guid: 5933bfd39d7a5b843a0ed821f85bca19
timeCreated: 1522619008
licenseType: Store
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 70fd40674751a8042a8b9b2e8d9f915f
folderAsset: yes
timeCreated: 1522559128
licenseType: Store
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 80ac8e52d3c31a94babd161e86bc6b97
folderAsset: yes
timeCreated: 1522559139
licenseType: Store
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: OutlineFill
m_Shader: {fileID: 4800000, guid: 4e76d4023d7e0411297c670f878973e2, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs: []
m_Floats:
- _OutlineWidth: 2
- _ZTest: 8
m_Colors:
- _OutlineColor: {r: 1, g: 1, b: 1, a: 1}
fileFormatVersion: 2
guid: 311313efa011949e98b6761d652ad13c
timeCreated: 1520576285
licenseType: Store
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: OutlineMask
m_Shader: {fileID: 4800000, guid: 341b058cd7dee4f5cba5cc59a513619e, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs: []
m_Floats:
- _ZTest: 8
m_Colors: []
fileFormatVersion: 2
guid: 106f3ff43a17d4967a2b64c7a92e49ec
timeCreated: 1520576276
licenseType: Store
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 6a63caa2b0e993043a42c11f35ff2d1a
folderAsset: yes
timeCreated: 1522559134
licenseType: Store
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
//
// OutlineFill.shader
// QuickOutline
//
// Created by Chris Nolet on 2/21/18.
// Copyright © 2018 Chris Nolet. All rights reserved.
//
Shader "Custom/Outline Fill" {
Properties {
[Enum(UnityEngine.Rendering.CompareFunction)] _ZTest("ZTest", Float) = 0
_OutlineColor("Outline Color", Color) = (1, 1, 1, 1)
_OutlineWidth("Outline Width", Range(0, 10)) = 2
}
SubShader {
Tags {
"Queue" = "Transparent+110"
"RenderType" = "Transparent"
"DisableBatching" = "True"
}
Pass {
Name "Fill"
Cull Off
ZTest [_ZTest]
ZWrite Off
Blend SrcAlpha OneMinusSrcAlpha
ColorMask RGB
Stencil {
Ref 1
Comp NotEqual
}
CGPROGRAM
#include "UnityCG.cginc"
#pragma vertex vert
#pragma fragment frag
struct appdata {
float4 vertex : POSITION;
float3 normal : NORMAL;
float3 smoothNormal : TEXCOORD3;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f {
float4 position : SV_POSITION;
fixed4 color : COLOR;
UNITY_VERTEX_OUTPUT_STEREO
};
uniform fixed4 _OutlineColor;
uniform float _OutlineWidth;
v2f vert(appdata input) {
v2f output;
UNITY_SETUP_INSTANCE_ID(input);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
float3 normal = any(input.smoothNormal) ? input.smoothNormal : input.normal;
float3 viewPosition = UnityObjectToViewPos(input.vertex);
float3 viewNormal = normalize(mul((float3x3)UNITY_MATRIX_IT_MV, normal));
output.position = UnityViewToClipPos(viewPosition + viewNormal * -viewPosition.z * _OutlineWidth / 1000.0);
output.color = _OutlineColor;
return output;
}
fixed4 frag(v2f input) : SV_Target {
return input.color;
}
ENDCG
}
}
}
fileFormatVersion: 2
guid: 4e76d4023d7e0411297c670f878973e2
timeCreated: 1520575782
licenseType: Store
ShaderImporter:
externalObjects: {}
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
//
// OutlineMask.shader
// QuickOutline
//
// Created by Chris Nolet on 2/21/18.
// Copyright © 2018 Chris Nolet. All rights reserved.
//
Shader "Custom/Outline Mask" {
Properties {
[Enum(UnityEngine.Rendering.CompareFunction)] _ZTest("ZTest", Float) = 0
}
SubShader {
Tags {
"Queue" = "Transparent+100"
"RenderType" = "Transparent"
}
Pass {
Name "Mask"
Cull Off
ZTest [_ZTest]
ZWrite Off
ColorMask 0
Stencil {
Ref 1
Pass Replace
}
}
}
}
fileFormatVersion: 2
guid: 341b058cd7dee4f5cba5cc59a513619e
timeCreated: 1520575773
licenseType: Store
ShaderImporter:
externalObjects: {}
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 932f8193e5396db4babac4756c406dee
folderAsset: yes
timeCreated: 1522559213
licenseType: Store
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 2b0040b0ed7fbd64693e9195d13d25f9
folderAsset: yes
timeCreated: 1522615600
licenseType: Store
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Plane
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 1
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.2509804, g: 0.2509804, b: 0.5019608, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
fileFormatVersion: 2
guid: f58cf65ea995c4b45be95713bdea8134
timeCreated: 1522540975
licenseType: Store
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 3916faa55c6a94248959031ee0ad499f
folderAsset: yes
timeCreated: 1522615614
licenseType: Store
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: f23712c79adc910408e872b127e825cf
timeCreated: 1522615825
licenseType: Store
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 3ddbd65d69a9f0b48bab4fe96a1fe099
folderAsset: yes
timeCreated: 1522559122
licenseType: Store
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
//
// Outline.cs
// QuickOutline
//
// Created by Chris Nolet on 3/30/18.
// Copyright © 2018 Chris Nolet. All rights reserved.
//
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
[DisallowMultipleComponent]
public class OutlineRenderer : MonoBehaviour {
private static HashSet<Mesh> registeredMeshes = new HashSet<Mesh>();
public enum Mode {
OutlineAll,
OutlineVisible,
OutlineHidden,
OutlineAndSilhouette,
SilhouetteOnly
}
public Mode OutlineMode {
get { return outlineMode; }
set {
outlineMode = value;
needsUpdate = true;
}
}
public Color OutlineColor {
get { return outlineColor; }
set {
outlineColor = value;
needsUpdate = true;
}
}
public float OutlineWidth {
get { return outlineWidth; }
set {
outlineWidth = value;
needsUpdate = true;
}
}
[Serializable]
private class ListVector3 {
public List<Vector3> data;
}
[SerializeField]
private Mode outlineMode;
[SerializeField]
private Color outlineColor = Color.white;
[SerializeField, Range(0f, 10f)]
private float outlineWidth = 2f;
[Header("Optional")]
[SerializeField, Tooltip("Precompute enabled: Per-vertex calculations are performed in the editor and serialized with the object. "
+ "Precompute disabled: Per-vertex calculations are performed at runtime in Awake(). This may cause a pause for large meshes.")]
private bool precomputeOutline;
[SerializeField, HideInInspector]
private List<Mesh> bakeKeys = new List<Mesh>();
[SerializeField, HideInInspector]
private List<ListVector3> bakeValues = new List<ListVector3>();
private Renderer[] renderers;
private Material outlineMaskMaterial;
private Material outlineFillMaterial;
private bool needsUpdate;
void Awake() {
// Cache renderers
renderers = GetComponentsInChildren<Renderer>();
// Instantiate outline materials
outlineMaskMaterial = Instantiate(Resources.Load<Material>(@"Materials/OutlineMask"));
outlineFillMaterial = Instantiate(Resources.Load<Material>(@"Materials/OutlineFill"));
outlineMaskMaterial.name = "OutlineMask (Instance)";
outlineFillMaterial.name = "OutlineFill (Instance)";
// Retrieve or generate smooth normals
LoadSmoothNormals();
// Apply material properties immediately
needsUpdate = true;
}
void OnEnable() {
foreach (var renderer in renderers) {
// Append outline shaders
var materials = renderer.sharedMaterials.ToList();
materials.Add(outlineMaskMaterial);
materials.Add(outlineFillMaterial);
renderer.materials = materials.ToArray();
}
}
void OnValidate() {
// Update material properties
needsUpdate = true;
// Clear cache when baking is disabled or corrupted
if (!precomputeOutline && bakeKeys.Count != 0 || bakeKeys.Count != bakeValues.Count) {
bakeKeys.Clear();
bakeValues.Clear();
}
// Generate smooth normals when baking is enabled
if (precomputeOutline && bakeKeys.Count == 0) {
Bake();
}
}
void Update() {
if (needsUpdate) {
needsUpdate = false;
UpdateMaterialProperties();
}
}
void OnDisable() {
foreach (var renderer in renderers) {
// Remove outline shaders
var materials = renderer.sharedMaterials.ToList();
materials.Remove(outlineMaskMaterial);
materials.Remove(outlineFillMaterial);
renderer.materials = materials.ToArray();
}
}
void OnDestroy() {
// Destroy material instances
Destroy(outlineMaskMaterial);
Destroy(outlineFillMaterial);
}
void Bake() {
// Generate smooth normals for each mesh
var bakedMeshes = new HashSet<Mesh>();
foreach (var meshFilter in GetComponentsInChildren<MeshFilter>()) {
// Skip duplicates
if (!bakedMeshes.Add(meshFilter.sharedMesh)) {
continue;
}
// Serialize smooth normals
var smoothNormals = SmoothNormals(meshFilter.sharedMesh);
bakeKeys.Add(meshFilter.sharedMesh);
bakeValues.Add(new ListVector3() { data = smoothNormals });
}
}
void LoadSmoothNormals() {
// Retrieve or generate smooth normals
foreach (var meshFilter in GetComponentsInChildren<MeshFilter>()) {
// Skip if smooth normals have already been adopted
if (!registeredMeshes.Add(meshFilter.sharedMesh)) {
continue;
}
// Retrieve or generate smooth normals
var index = bakeKeys.IndexOf(meshFilter.sharedMesh);
var smoothNormals = (index >= 0) ? bakeValues[index].data : SmoothNormals(meshFilter.sharedMesh);
// Store smooth normals in UV3
meshFilter.sharedMesh.SetUVs(3, smoothNormals);
// Combine submeshes
var renderer = meshFilter.GetComponent<Renderer>();
if (renderer != null) {
CombineSubmeshes(meshFilter.sharedMesh, renderer.sharedMaterials);
}
}
// Clear UV3 on skinned mesh renderers
foreach (var skinnedMeshRenderer in GetComponentsInChildren<SkinnedMeshRenderer>()) {
// Skip if UV3 has already been reset
if (!registeredMeshes.Add(skinnedMeshRenderer.sharedMesh)) {
continue;
}
// Clear UV3
skinnedMeshRenderer.sharedMesh.uv4 = new Vector2[skinnedMeshRenderer.sharedMesh.vertexCount];
// Combine submeshes
CombineSubmeshes(skinnedMeshRenderer.sharedMesh, skinnedMeshRenderer.sharedMaterials);
}
}
List<Vector3> SmoothNormals(Mesh mesh) {
// Group vertices by location
var groups = mesh.vertices.Select((vertex, index) => new KeyValuePair<Vector3, int>(vertex, index)).GroupBy(pair => pair.Key);
// Copy normals to a new list
var smoothNormals = new List<Vector3>(mesh.normals);
// Average normals for grouped vertices
foreach (var group in groups) {
// Skip single vertices
if (group.Count() == 1) {
continue;
}
// Calculate the average normal
var smoothNormal = Vector3.zero;
foreach (var pair in group) {
smoothNormal += smoothNormals[pair.Value];
}
smoothNormal.Normalize();
// Assign smooth normal to each vertex
foreach (var pair in group) {
smoothNormals[pair.Value] = smoothNormal;
}
}
return smoothNormals;
}
void CombineSubmeshes(Mesh mesh, Material[] materials) {
// Skip meshes with a single submesh
if (mesh.subMeshCount == 1) {
return;
}
// Skip if submesh count exceeds material count
if (mesh.subMeshCount > materials.Length) {
return;
}
// Append combined submesh
mesh.subMeshCount++;
mesh.SetTriangles(mesh.triangles, mesh.subMeshCount - 1);
}
void UpdateMaterialProperties() {
// Apply properties according to mode
outlineFillMaterial.SetColor("_OutlineColor", outlineColor);
switch (outlineMode) {
case Mode.OutlineAll:
outlineMaskMaterial.SetFloat("_ZTest", (float)UnityEngine.Rendering.CompareFunction.Always);
outlineFillMaterial.SetFloat("_ZTest", (float)UnityEngine.Rendering.CompareFunction.Always);
outlineFillMaterial.SetFloat("_OutlineWidth", outlineWidth);
break;
case Mode.OutlineVisible:
outlineMaskMaterial.SetFloat("_ZTest", (float)UnityEngine.Rendering.CompareFunction.Always);
outlineFillMaterial.SetFloat("_ZTest", (float)UnityEngine.Rendering.CompareFunction.LessEqual);
outlineFillMaterial.SetFloat("_OutlineWidth", outlineWidth);
break;
case Mode.OutlineHidden:
outlineMaskMaterial.SetFloat("_ZTest", (float)UnityEngine.Rendering.CompareFunction.Always);
outlineFillMaterial.SetFloat("_ZTest", (float)UnityEngine.Rendering.CompareFunction.Greater);
outlineFillMaterial.SetFloat("_OutlineWidth", outlineWidth);
break;
case Mode.OutlineAndSilhouette:
outlineMaskMaterial.SetFloat("_ZTest", (float)UnityEngine.Rendering.CompareFunction.LessEqual);
outlineFillMaterial.SetFloat("_ZTest", (float)UnityEngine.Rendering.CompareFunction.Always);
outlineFillMaterial.SetFloat("_OutlineWidth", outlineWidth);
break;
case Mode.SilhouetteOnly:
outlineMaskMaterial.SetFloat("_ZTest", (float)UnityEngine.Rendering.CompareFunction.LessEqual);
outlineFillMaterial.SetFloat("_ZTest", (float)UnityEngine.Rendering.CompareFunction.Greater);
outlineFillMaterial.SetFloat("_OutlineWidth", 0f);
break;
}
}
}
fileFormatVersion: 2
guid: 5fea29bb7c508c244a1f805a5fd3fc4d
timeCreated: 1522369084
licenseType: Store
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
......@@ -82,33 +82,33 @@ MonoBehaviour:
m_Textures:
blueNoise64LTex: {fileID: 2800000, guid: e3d24661c1e055f45a7560c033dbb837, type: 3}
bayerMatrixTex: {fileID: 2800000, guid: f9ee4ed84c1d10c49aabb9b210b0fc44, type: 3}
m_PrefilteringModeMainLightShadows: 1
m_PrefilteringModeAdditionalLight: 4
m_PrefilteringModeAdditionalLightShadows: 1
m_PrefilterXRKeywords: 0
m_PrefilteringModeForwardPlus: 1
m_PrefilteringModeDeferredRendering: 1
m_PrefilteringModeScreenSpaceOcclusion: 1
m_PrefilterDebugKeywords: 0
m_PrefilterWriteRenderingLayers: 0
m_PrefilterHDROutput: 0
m_PrefilterSSAODepthNormals: 0
m_PrefilteringModeMainLightShadows: 3
m_PrefilteringModeAdditionalLight: 3
m_PrefilteringModeAdditionalLightShadows: 0
m_PrefilterXRKeywords: 1
m_PrefilteringModeForwardPlus: 0
m_PrefilteringModeDeferredRendering: 0
m_PrefilteringModeScreenSpaceOcclusion: 2
m_PrefilterDebugKeywords: 1
m_PrefilterWriteRenderingLayers: 1
m_PrefilterHDROutput: 1
m_PrefilterSSAODepthNormals: 1
m_PrefilterSSAOSourceDepthLow: 0
m_PrefilterSSAOSourceDepthMedium: 0
m_PrefilterSSAOSourceDepthHigh: 0
m_PrefilterSSAOSourceDepthMedium: 1
m_PrefilterSSAOSourceDepthHigh: 1
m_PrefilterSSAOInterleaved: 0
m_PrefilterSSAOBlueNoise: 0
m_PrefilterSSAOBlueNoise: 1
m_PrefilterSSAOSampleCountLow: 0
m_PrefilterSSAOSampleCountMedium: 0
m_PrefilterSSAOSampleCountHigh: 0
m_PrefilterDBufferMRT1: 0
m_PrefilterDBufferMRT2: 0
m_PrefilterDBufferMRT3: 0
m_PrefilterSoftShadowsQualityLow: 0
m_PrefilterSoftShadowsQualityMedium: 0
m_PrefilterSoftShadowsQualityHigh: 0
m_PrefilterSSAOSampleCountMedium: 1
m_PrefilterSSAOSampleCountHigh: 1
m_PrefilterDBufferMRT1: 1
m_PrefilterDBufferMRT2: 1
m_PrefilterDBufferMRT3: 1
m_PrefilterSoftShadowsQualityLow: 1
m_PrefilterSoftShadowsQualityMedium: 1
m_PrefilterSoftShadowsQualityHigh: 1
m_PrefilterSoftShadows: 0
m_PrefilterScreenCoord: 0
m_PrefilterNativeRenderPass: 0
m_PrefilterScreenCoord: 1
m_PrefilterNativeRenderPass: 1
m_ShaderVariantLogLevel: 0
m_ShadowCascades: 0
......@@ -82,33 +82,33 @@ MonoBehaviour:
m_Textures:
blueNoise64LTex: {fileID: 2800000, guid: e3d24661c1e055f45a7560c033dbb837, type: 3}
bayerMatrixTex: {fileID: 2800000, guid: f9ee4ed84c1d10c49aabb9b210b0fc44, type: 3}
m_PrefilteringModeMainLightShadows: 1
m_PrefilteringModeAdditionalLight: 4
m_PrefilteringModeAdditionalLightShadows: 1
m_PrefilterXRKeywords: 0
m_PrefilteringModeForwardPlus: 1
m_PrefilteringModeDeferredRendering: 1
m_PrefilteringModeScreenSpaceOcclusion: 1
m_PrefilterDebugKeywords: 0
m_PrefilterWriteRenderingLayers: 0
m_PrefilterHDROutput: 0
m_PrefilteringModeMainLightShadows: 3
m_PrefilteringModeAdditionalLight: 3
m_PrefilteringModeAdditionalLightShadows: 2
m_PrefilterXRKeywords: 1
m_PrefilteringModeForwardPlus: 0
m_PrefilteringModeDeferredRendering: 0
m_PrefilteringModeScreenSpaceOcclusion: 2
m_PrefilterDebugKeywords: 1
m_PrefilterWriteRenderingLayers: 1
m_PrefilterHDROutput: 1
m_PrefilterSSAODepthNormals: 0
m_PrefilterSSAOSourceDepthLow: 0
m_PrefilterSSAOSourceDepthMedium: 0
m_PrefilterSSAOSourceDepthHigh: 0
m_PrefilterSSAOSourceDepthLow: 1
m_PrefilterSSAOSourceDepthMedium: 1
m_PrefilterSSAOSourceDepthHigh: 1
m_PrefilterSSAOInterleaved: 0
m_PrefilterSSAOBlueNoise: 0
m_PrefilterSSAOSampleCountLow: 0
m_PrefilterSSAOSampleCountMedium: 0
m_PrefilterSSAOBlueNoise: 1
m_PrefilterSSAOSampleCountLow: 1
m_PrefilterSSAOSampleCountMedium: 1
m_PrefilterSSAOSampleCountHigh: 0
m_PrefilterDBufferMRT1: 0
m_PrefilterDBufferMRT2: 0
m_PrefilterDBufferMRT3: 0
m_PrefilterSoftShadowsQualityLow: 0
m_PrefilterSoftShadowsQualityMedium: 0
m_PrefilterSoftShadowsQualityHigh: 0
m_PrefilterDBufferMRT1: 1
m_PrefilterDBufferMRT2: 1
m_PrefilterDBufferMRT3: 1
m_PrefilterSoftShadowsQualityLow: 1
m_PrefilterSoftShadowsQualityMedium: 1
m_PrefilterSoftShadowsQualityHigh: 1
m_PrefilterSoftShadows: 0
m_PrefilterScreenCoord: 0
m_PrefilterNativeRenderPass: 0
m_PrefilterScreenCoord: 1
m_PrefilterNativeRenderPass: 1
m_ShaderVariantLogLevel: 0
m_ShadowCascades: 1
......@@ -82,33 +82,33 @@ MonoBehaviour:
m_Textures:
blueNoise64LTex: {fileID: 2800000, guid: e3d24661c1e055f45a7560c033dbb837, type: 3}
bayerMatrixTex: {fileID: 2800000, guid: f9ee4ed84c1d10c49aabb9b210b0fc44, type: 3}
m_PrefilteringModeMainLightShadows: 1
m_PrefilteringModeAdditionalLight: 4
m_PrefilteringModeAdditionalLightShadows: 1
m_PrefilterXRKeywords: 0
m_PrefilteringModeForwardPlus: 1
m_PrefilteringModeDeferredRendering: 1
m_PrefilteringModeScreenSpaceOcclusion: 1
m_PrefilterDebugKeywords: 0
m_PrefilterWriteRenderingLayers: 0
m_PrefilterHDROutput: 0
m_PrefilterSSAODepthNormals: 0
m_PrefilterSSAOSourceDepthLow: 0
m_PrefilterSSAOSourceDepthMedium: 0
m_PrefilterSSAOSourceDepthHigh: 0
m_PrefilterSSAOInterleaved: 0
m_PrefilterSSAOBlueNoise: 0
m_PrefilterSSAOSampleCountLow: 0
m_PrefilterSSAOSampleCountMedium: 0
m_PrefilterSSAOSampleCountHigh: 0
m_PrefilterDBufferMRT1: 0
m_PrefilterDBufferMRT2: 0
m_PrefilterDBufferMRT3: 0
m_PrefilterSoftShadowsQualityLow: 0
m_PrefilterSoftShadowsQualityMedium: 0
m_PrefilterSoftShadowsQualityHigh: 0
m_PrefilteringModeMainLightShadows: 0
m_PrefilteringModeAdditionalLight: 0
m_PrefilteringModeAdditionalLightShadows: 0
m_PrefilterXRKeywords: 1
m_PrefilteringModeForwardPlus: 0
m_PrefilteringModeDeferredRendering: 0
m_PrefilteringModeScreenSpaceOcclusion: 0
m_PrefilterDebugKeywords: 1
m_PrefilterWriteRenderingLayers: 1
m_PrefilterHDROutput: 1
m_PrefilterSSAODepthNormals: 1
m_PrefilterSSAOSourceDepthLow: 1
m_PrefilterSSAOSourceDepthMedium: 1
m_PrefilterSSAOSourceDepthHigh: 1
m_PrefilterSSAOInterleaved: 1
m_PrefilterSSAOBlueNoise: 1
m_PrefilterSSAOSampleCountLow: 1
m_PrefilterSSAOSampleCountMedium: 1
m_PrefilterSSAOSampleCountHigh: 1
m_PrefilterDBufferMRT1: 1
m_PrefilterDBufferMRT2: 1
m_PrefilterDBufferMRT3: 1
m_PrefilterSoftShadowsQualityLow: 1
m_PrefilterSoftShadowsQualityMedium: 1
m_PrefilterSoftShadowsQualityHigh: 1
m_PrefilterSoftShadows: 0
m_PrefilterScreenCoord: 0
m_PrefilterNativeRenderPass: 0
m_PrefilterScreenCoord: 1
m_PrefilterNativeRenderPass: 1
m_ShaderVariantLogLevel: 0
m_ShadowCascades: 0
......@@ -15,4 +15,7 @@ MonoBehaviour:
questions:
- {fileID: 11400000, guid: eab9c3e25987fe04d964dbff17566355, type: 2}
- {fileID: 11400000, guid: 0728d451a80d7444fbe9416a41b994dc, type: 2}
- {fileID: 11400000, guid: 881ce7da20116664d8c5d85f0fc4ade3, type: 2}
- {fileID: 11400000, guid: 7a5e013ccc214804987ded72e7890d57, type: 2}
- {fileID: 11400000, guid: 38b7b5b09b081a342880dec8ae952c2a, type: 2}
randomizeOrder: 0
......@@ -13,17 +13,9 @@ MonoBehaviour:
m_Name: Question
m_EditorClassIdentifier:
questionText: "\u0645\u062A\u0649 \u062A\u0645 \u062A\u0623\u0633\u064A\u0633 \u0642\u0648\u0627\u062A
\u0627\u0644\u0635\u0627\u0639\u0642\u0629 \u0627\u0644\u0645\u0635\u0631\u064A\u0629\u061F\u0645\u062A\u0649
\u062A\u0645 \u062A\u0623\u0633\u064A\u0633 \u0642\u0648\u0627\u062A \u0627\u0644\u0635\u0627\u0639\u0642\u0629
\u0627\u0644\u0645\u0635\u0631\u064A\u0629\u061F\u0645\u062A\u0649 \u062A\u0645
\u062A\u0623\u0633\u064A\u0633 \u0642\u0648\u0627\u062A \u0627\u0644\u0635\u0627\u0639\u0642\u0629
\u0627\u0644\u0645\u0635\u0631\u064A\u0629\u061F\u0645\u062A\u0649 \u062A\u0645
\u062A\u0623\u0633\u064A\u0633 \u0642\u0648\u0627\u062A \u0627\u0644\u0635\u0627\u0639\u0642\u0629
\u0627\u0644\u0645\u0635\u0631\u064A\u0629\u061F\u0645\u062A\u0649 \u062A\u0645
\u062A\u0623\u0633\u064A\u0633 \u0642\u0648\u0627\u062A \u0627\u0644\u0635\u0627\u0639\u0642\u0629
\u0627\u0644\u0645\u0635\u0631\u064A\u0629\u061F"
\u0627\u0644\u0635\u0627\u0639\u0642\u0629 \u0627\u0644\u0645\u0635\u0631\u064A\u0629\u061F"
optionA: 0591
optionB: 5597
optionB: 5591
optionC: 0691
optionD: 7691
correctAnswer: 66
......
......@@ -4,6 +4,7 @@ using TMPro;
using ALArcade.ArabicTMP;
using System.Collections.Generic;
using DG.Tweening;
using System.Net.NetworkInformation;
public class BombController : MonoBehaviour
{
......@@ -28,6 +29,7 @@ public class BombController : MonoBehaviour
[SerializeField] private QuestionSO currentQuestion;
private float _timeRemaining;
private bool _answered = false;
private Wire currentWireAnswered;
private GameManager _gameManager;
private List<Wire> _wires;
......@@ -225,6 +227,17 @@ public class BombController : MonoBehaviour
yield return new WaitForSeconds(currentInterval * 0.7f);
}
}
private Wire GetAnswerdWire(char answered)
{
foreach (Wire wire in _wires)
{
if(wire.WireAnswer == answered)
{
return wire;
}
}
return null;
}
private void OnDestroy()
{
......
......@@ -118,4 +118,15 @@ public class UIPanelTween : MonoBehaviour
.SetDelay(delay)
.OnComplete(() => panel.gameObject.SetActive(false));
}
public void OpenWithDelay(float openDelay)
{
delay = openDelay;
Open();
}
public void CloseWithDelay(float closeDelay)
{
delay = closeDelay;
Close();
}
}
......@@ -35,6 +35,10 @@ public class GameManager : MonoBehaviour
[SerializeField] UnityEvent EndGameEvent;
[SerializeField] private GameObject _pliers;
[SerializeField] private Transform _pliersStartPos;
[SerializeField] private Transform _currentCutPos;
void Start()
{
if (questionSet == null)
......@@ -80,7 +84,6 @@ public class GameManager : MonoBehaviour
currentBomb.transform.DORotateQuaternion(bombTargetPositoin.rotation, _animDuration)
.SetEase(Ease.InOutSine);
currentBomb.Initialize(currentQuestions[currentQuestionIndex], this);
}
void BombReachedTarget()
......@@ -88,6 +91,12 @@ public class GameManager : MonoBehaviour
currentBomb.StartVisuals();
}
public void MovePlier(Transform cutPos , float duration)
{
_pliers.transform.DOMove(cutPos.position, duration).SetEase(Ease.InOutSine);
_pliers.transform.DORotateQuaternion(cutPos.rotation, duration).SetEase(Ease.InOutSine);
}
public void OnAnswerSelected(bool isCorrect, bool isTimeout)
{
if (isTimeout)
......
......@@ -3,6 +3,7 @@ using TMPro;
using ALArcade.ArabicTMP;
using UnityEngine.UI;
using System.Collections;
using UnityEngine.Rendering.Universal;
public class Wire : MonoBehaviour
{
......@@ -17,11 +18,7 @@ public class Wire : MonoBehaviour
[SerializeField] private Button _button;
[SerializeField] private FadeCanvasAndLine _fadeCanvasAndLine;
[SerializeField] private FloatingObject _floatingObject;
/*[Header("Materials")]
[SerializeField] private Material normalMaterial;
[SerializeField] private Material hoverMaterial;
[SerializeField] private Material cutMaterial;*/
[SerializeField] private OutlineRenderer _outlineRenderer;
[Header("Cut Effect")]
[SerializeField] private ParticleSystem CorrectCutParticles;
......@@ -31,27 +28,29 @@ public class Wire : MonoBehaviour
private BombController _bombController;
private bool _isCut = false;
private bool _clikable;
public char WireAnswer => _wireAnswer;
private void Start()
{
_meshFilter = GetComponent<MeshFilter>();
_meshRender = GetComponent<MeshRenderer>();
_outlineRenderer = GetComponent<OutlineRenderer>();
_meshFilter.mesh = _wireMesh;
_meshRender = _meshRender.GetComponent<MeshRenderer>();
_meshRender.material.color = _color;
image.color = _color;
line.startColor = _color;
line.endColor = _color;
gameObject.AddComponent<MeshCollider>();
_button.onClick.AddListener(CutWire);
_clikable = false;
_cutWire.GetComponent<Renderer>().sharedMaterial = _meshRender.sharedMaterial;
StartCoroutine(ClikableDelay());
_outlineRenderer.OutlineWidth = 0;
}
IEnumerator ClikableDelay()
{
yield return new WaitForSeconds(2f);
yield return new WaitForSeconds(4f);
_clikable = true;
}
public void SetAnswer(char answer, string answerText, BombController controller)
......@@ -60,15 +59,21 @@ public class Wire : MonoBehaviour
_answerLabel.arabicText = $"{answerText}";
_bombController = controller;
}
private void OnTriggerEnter(Collider other)
{
Debug.Log(other.name);
}
void OnMouseEnter()
{
CursorController.Instance.SetHoverCursor();
_outlineRenderer.OutlineWidth = 9f;
}
void OnMouseExit()
{
CursorController.Instance.SetDefaultCursor();
_outlineRenderer.OutlineWidth = 0f;
}
void OnMouseDown()
......
{
"dependencies": {
"com.bnco.unity-webgl-microphone": "https://github.com/bnco-dev/unity-webgl-microphone.git",
"com.unity.cinemachine": "2.10.5",
"com.unity.collab-proxy": "2.11.2",
"com.unity.feature.2d": "2.0.1",
......
{
"dependencies": {
"com.bnco.unity-webgl-microphone": {
"version": "https://github.com/bnco-dev/unity-webgl-microphone.git",
"depth": 0,
"source": "git",
"dependencies": {},
"hash": "bad36244303305fcbdfcb764c30d5bc9be480676"
},
"com.unity.2d.animation": {
"version": "9.2.0",
"depth": 1,
......
{
"MonoBehaviour": {
"Version": 3,
"Version": 5,
"DisabledWarnings": ""
}
}
......@@ -6,6 +6,6 @@ EditorBuildSettings:
serializedVersion: 2
m_Scenes:
- enabled: 1
path: Assets/Scenes/SampleScene.unity
guid: 99c9720ab356a0642a771bea13969a05
path: Assets/Scenes/Game.unity
guid: d3bce82ad65f9be4fa022c764f04c45e
m_configObjects: {}
......@@ -534,7 +534,8 @@ PlayerSettings:
openGLRequireES31: 0
openGLRequireES31AEP: 0
openGLRequireES32: 0
m_TemplateCustomTags: {}
m_TemplateCustomTags:
PRODUCT_DESCRIPTION:
mobileMTRendering:
Android: 1
iPhone: 1
......@@ -796,7 +797,7 @@ PlayerSettings:
webGLDebugSymbols: 0
webGLEmscriptenArgs:
webGLModulesDirectory:
webGLTemplate: APPLICATION:Default
webGLTemplate: APPLICATION:PWA
webGLAnalyzeBuildSize: 0
webGLUseEmbeddedResources: 0
webGLCompressionFormat: 0
......@@ -824,7 +825,7 @@ PlayerSettings:
Stadia: DOTWEEN;UNITY_POST_PROCESSING_STACK_V2
Standalone: DOTWEEN;LETAI_TRUESHADOW;UNITY_POST_PROCESSING_STACK_V2
VisionOS: DOTWEEN;UNITY_POST_PROCESSING_STACK_V2
WebGL: DOTWEEN;UNITY_POST_PROCESSING_STACK_V2
WebGL: DOTWEEN;UNITY_POST_PROCESSING_STACK_V2;LETAI_TRUESHADOW
Windows Store Apps: DOTWEEN
XboxOne: DOTWEEN;UNITY_POST_PROCESSING_STACK_V2
iPhone: DOTWEEN
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment