CamerettaUnity 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Assets/Cameretta.meta +8 -0
- data/Assets/Cameretta/Cameretta.cs +159 -0
- data/Assets/Cameretta/Cameretta.cs.meta +11 -0
- data/Assets/Cameretta/DupLowPoly.cs +48 -0
- data/Assets/Cameretta/DupLowPoly.cs.meta +11 -0
- data/Assets/Cameretta/LowPoly.cs +110 -0
- data/Assets/Cameretta/LowPoly.cs.meta +11 -0
- data/Assets/Cameretta/RetroLetto.cs +94 -0
- data/Assets/Cameretta/RetroLetto.cs.meta +11 -0
- data/Assets/Cameretta/Scrivania.cs +31 -0
- data/Assets/Cameretta/Scrivania.cs.meta +11 -0
- data/Assets/Resources.meta +8 -0
- data/Assets/Resources/Color.meta +8 -0
- data/Assets/Scenes.meta +8 -0
- data/Assets/Scenes/SampleScene.unity +590 -0
- data/Assets/Scenes/SampleScene.unity.meta +7 -0
- data/Library/APIUpdater/project-dependencies.graph +0 -0
- data/Library/BuildPlayer.prefs +0 -0
- data/Library/BuildSettings.asset +0 -0
- data/Library/CurrentLayout-default.dwlt +1630 -0
- data/Library/CurrentMaximizeLayout.dwlt +1539 -0
- data/Library/EditorOnlyScriptingSettings.json +1 -0
- data/Library/EditorSnapSettings.asset +20 -0
- data/Library/EditorUserBuildSettings.asset +0 -0
- data/Library/EditorUserSettings.asset +19 -0
- data/Library/InspectorExpandedItems.asset +0 -0
- data/Library/LastSceneManagerSetup.txt +5 -0
- data/Library/LibraryFormatVersion.txt +2 -0
- data/Library/MonoManager.asset +0 -0
- data/Library/SceneVisibilityState.asset +0 -0
- data/Library/ScriptAssemblies/Assembly-CSharp.dll +0 -0
- data/Library/ScriptAssemblies/Assembly-CSharp.pdb +0 -0
- data/Library/ScriptAssemblies/BuiltinAssemblies.stamp +1 -0
- data/Library/ScriptAssemblies/Unity.CollabProxy.Editor.dll +0 -0
- data/Library/ScriptAssemblies/Unity.CollabProxy.Editor.pdb +0 -0
- data/Library/ScriptAssemblies/Unity.Rider.Editor.dll +0 -0
- data/Library/ScriptAssemblies/Unity.Rider.Editor.pdb +0 -0
- data/Library/ScriptAssemblies/Unity.TextMeshPro.Editor.dll +0 -0
- data/Library/ScriptAssemblies/Unity.TextMeshPro.Editor.pdb +0 -0
- data/Library/ScriptAssemblies/Unity.TextMeshPro.dll +0 -0
- data/Library/ScriptAssemblies/Unity.TextMeshPro.pdb +0 -0
- data/Library/ScriptAssemblies/Unity.Timeline.Editor.dll +0 -0
- data/Library/ScriptAssemblies/Unity.Timeline.Editor.pdb +0 -0
- data/Library/ScriptAssemblies/Unity.Timeline.dll +0 -0
- data/Library/ScriptAssemblies/Unity.Timeline.pdb +0 -0
- data/Library/ScriptAssemblies/Unity.VSCode.Editor.dll +0 -0
- data/Library/ScriptAssemblies/Unity.VSCode.Editor.pdb +0 -0
- data/Library/ScriptAssemblies/UnityEditor.TestRunner.dll +0 -0
- data/Library/ScriptAssemblies/UnityEditor.TestRunner.pdb +0 -0
- data/Library/ScriptAssemblies/UnityEditor.UI.dll +0 -0
- data/Library/ScriptAssemblies/UnityEditor.UI.pdb +0 -0
- data/Library/ScriptAssemblies/UnityEngine.TestRunner.dll +0 -0
- data/Library/ScriptAssemblies/UnityEngine.TestRunner.pdb +0 -0
- data/Library/ScriptAssemblies/UnityEngine.UI.dll +0 -0
- data/Library/ScriptAssemblies/UnityEngine.UI.pdb +0 -0
- data/Library/ShaderCache.db +0 -0
- data/Library/SpriteAtlasDatabase.asset +0 -0
- data/Library/Style.catalog +0 -0
- data/Library/shadercompiler-UnityShaderCompiler0.log +2 -0
- data/Library/shadercompiler-UnityShaderCompiler1.log +2 -0
- data/Library/shadercompiler-UnityShaderCompiler2.log +4 -0
- data/Library/shadercompiler-UnityShaderCompiler3.log +4 -0
- data/Logs/Packages-Update.log +45 -0
- data/Packages/manifest.json +42 -0
- data/Packages/packages-lock.json +312 -0
- data/ProjectSettings/AudioManager.asset +19 -0
- data/ProjectSettings/ClusterInputManager.asset +6 -0
- data/ProjectSettings/DynamicsManager.asset +34 -0
- data/ProjectSettings/EditorBuildSettings.asset +8 -0
- data/ProjectSettings/EditorSettings.asset +29 -0
- data/ProjectSettings/GraphicsSettings.asset +63 -0
- data/ProjectSettings/InputManager.asset +295 -0
- data/ProjectSettings/NavMeshAreas.asset +91 -0
- data/ProjectSettings/PackageManagerSettings.asset +38 -0
- data/ProjectSettings/Physics2DSettings.asset +56 -0
- data/ProjectSettings/PresetManager.asset +7 -0
- data/ProjectSettings/ProjectSettings.asset +671 -0
- data/ProjectSettings/ProjectVersion.txt +2 -0
- data/ProjectSettings/QualitySettings.asset +232 -0
- data/ProjectSettings/TagManager.asset +43 -0
- data/ProjectSettings/TimeManager.asset +9 -0
- data/ProjectSettings/UnityConnectSettings.asset +34 -0
- data/ProjectSettings/VFXManager.asset +12 -0
- data/ProjectSettings/XRSettings.asset +10 -0
- metadata +126 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: eb18f141d8c6947fa78cad733feb2f80b4491fb74f237bde1fa03a0f2f9b33b5
|
4
|
+
data.tar.gz: 430de705bb5f148e35aa71401cc5516281741a68307bfd7f9095b9060d75a76e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3f098e9b6094cc6349f0afcc0a011672ccf3f4a04cc9a1d312b2378fe0da8276bcca445b9c5beefca9318c4351c798f61b89af235615e8068cb108e5ba48be5d
|
7
|
+
data.tar.gz: 807327ba8c3b2075eb0f73571b0003000ba6909729707c872a40131875daf6a866a271ee12876aa6ba1f19762de50ea391b2a170e68a8e74a744d7e98d9e8432
|
@@ -0,0 +1,159 @@
|
|
1
|
+
using System.Collections;
|
2
|
+
using System.Collections.Generic;
|
3
|
+
using UnityEngine;
|
4
|
+
|
5
|
+
public class Cameretta : MonoBehaviour
|
6
|
+
{
|
7
|
+
// Start is called before the first frame update
|
8
|
+
static GameObject pareti;
|
9
|
+
static internal Vector3 sSP;
|
10
|
+
static Vector3 sPDX;
|
11
|
+
static Vector3 pPDX;
|
12
|
+
static Vector3 pPN;
|
13
|
+
static Vector3 sPN;
|
14
|
+
static Vector3 sP3;
|
15
|
+
static Vector3 sP4;
|
16
|
+
string nome;
|
17
|
+
|
18
|
+
static internal void ok()
|
19
|
+
{
|
20
|
+
Debug.LogFormat("ok in....");
|
21
|
+
}
|
22
|
+
|
23
|
+
static internal Vector3 PosizionaObjectMain(string objName, Vector3 objScale, Vector3 objPos, Vector3 rifObjectScale, string[] piuOmeno)
|
24
|
+
{
|
25
|
+
pareti = GameObject.Find($"{objName}");
|
26
|
+
sPN.x = objScale.x;
|
27
|
+
sPN.y = objScale.y;
|
28
|
+
sPN.z = objScale.z;
|
29
|
+
|
30
|
+
pareti.transform.localScale = new Vector3(sPN.x, sPN.y, sPN.z);
|
31
|
+
pPN = new Vector3();
|
32
|
+
|
33
|
+
if (piuOmeno[0] == "+")
|
34
|
+
{
|
35
|
+
pPN.x += (rifObjectScale.x / 2) - (sPN.x / 2);
|
36
|
+
}
|
37
|
+
else if (piuOmeno[0] == "-")
|
38
|
+
{
|
39
|
+
pPN.x -= (rifObjectScale.x / 2) - (sPN.x / 2);
|
40
|
+
}
|
41
|
+
|
42
|
+
if (piuOmeno[1] == "+")
|
43
|
+
{
|
44
|
+
pPN.y += (rifObjectScale.y / 2) + (sPN.y / 2);
|
45
|
+
}
|
46
|
+
else if (piuOmeno[1] == "-")
|
47
|
+
{
|
48
|
+
pPN.y -= (rifObjectScale.y / 2) + (sPN.y / 2);
|
49
|
+
}
|
50
|
+
|
51
|
+
if (piuOmeno[2] == "+")
|
52
|
+
{
|
53
|
+
pPN.z += (rifObjectScale.z / 2) - (sPN.z / 2); // piu sull'asse z con riferimento object
|
54
|
+
}
|
55
|
+
else if (piuOmeno[2] == "-")
|
56
|
+
{
|
57
|
+
pPN.z -= (rifObjectScale.z / 2) - (sPN.z / 2);
|
58
|
+
}
|
59
|
+
//pPN.z += (rifObjectScale.z / 2) - (sPN.z / 2);
|
60
|
+
pareti.transform.position = new Vector3(pPN.x, pPN.y, pPN.z);
|
61
|
+
return pPN;
|
62
|
+
}
|
63
|
+
|
64
|
+
void Start()
|
65
|
+
{
|
66
|
+
sSP.x = 500; // ^^^^^^^^^ Riferimento Object per posizionamento ^^^^^^^^^^^
|
67
|
+
sSP.y = 20;
|
68
|
+
sSP.z = 400;
|
69
|
+
transform.localScale = new Vector3(sSP.x, sSP.y, sSP.z); // Scala pavimento
|
70
|
+
|
71
|
+
int i = 0;
|
72
|
+
while (i < 5)
|
73
|
+
{
|
74
|
+
i++;
|
75
|
+
pareti = GameObject.CreatePrimitive(PrimitiveType.Cube);
|
76
|
+
|
77
|
+
nome = "parete";
|
78
|
+
pareti.name = $"{nome} {i}";
|
79
|
+
//pareti.transform.parent = transform;
|
80
|
+
}
|
81
|
+
|
82
|
+
|
83
|
+
pareti = GameObject.Find($"{nome} 1");
|
84
|
+
sPDX.x = 10;
|
85
|
+
sPDX.y = 270;
|
86
|
+
sPDX.z = 400;
|
87
|
+
pareti.transform.localScale = new Vector3(sPDX.x, sPDX.y, sPDX.z); // Scala parete DX
|
88
|
+
|
89
|
+
pPDX.x += (sSP.x / 2) - (sPDX.x / 2);
|
90
|
+
pPDX.y += (sSP.y / 2) + (sPDX.y / 2);
|
91
|
+
pPDX.z += (sSP.z / 2) - (sPDX.z / 2);
|
92
|
+
pareti.transform.position = new Vector3(pPDX.x, pPDX.y, pPDX.z); // x = 239.5f
|
93
|
+
|
94
|
+
|
95
|
+
pareti = GameObject.Find($"{nome} 2");
|
96
|
+
PosizionaObjectMain(pareti.name, sPDX, new Vector3(), sSP, new string[] {"-", "+", "+"});
|
97
|
+
/*pareti.transform.localScale = new Vector3(sPDX.x, sPDX.y, sPDX.z);
|
98
|
+
pPDX = new Vector3();
|
99
|
+
pPDX.x -= (sSP.x / 2) - (sPDX.x / 2);
|
100
|
+
pPDX.y += (sSP.y / 2) + (sPDX.y / 2);
|
101
|
+
pPDX.z += (sSP.z / 2) - (sPDX.z / 2);
|
102
|
+
pareti.transform.position = new Vector3(pPDX.x, pPDX.y, pPDX.z); */
|
103
|
+
|
104
|
+
pareti = GameObject.Find($"{nome} 3");
|
105
|
+
sPDX.x = 410;
|
106
|
+
sPDX.y = 270;
|
107
|
+
sPDX.z = 10;
|
108
|
+
PosizionaObjectMain(pareti.name, sPDX, new Vector3(), sSP, new string[] {"+", "+", "+"});
|
109
|
+
sP3 = pareti.transform.localScale;
|
110
|
+
|
111
|
+
/*sPDX.x = 410;
|
112
|
+
sPDX.y = 270;
|
113
|
+
sPDX.z = 10;
|
114
|
+
pareti.transform.localScale = new Vector3(sPDX.x, sPDX.y, sPDX.z);
|
115
|
+
pP3 = pareti.transform.localScale;
|
116
|
+
pPDX = new Vector3();
|
117
|
+
pPDX.x += (sSP.x / 2) - (sPDX.x / 2);
|
118
|
+
pPDX.y += (sSP.y / 2) + (sPDX.y / 2);
|
119
|
+
pPDX.z += (sSP.z / 2) - (sPDX.z / 2);
|
120
|
+
pareti.transform.position = new Vector3(pPDX.x, pPDX.y, pPDX.z); */
|
121
|
+
|
122
|
+
pareti = GameObject.Find($"{nome} 4");
|
123
|
+
|
124
|
+
sPDX.x = 80;
|
125
|
+
sPDX.y = 60;
|
126
|
+
sPDX.z = 10;
|
127
|
+
pareti.transform.localScale = new Vector3(sPDX.x, sPDX.y, sPDX.z);
|
128
|
+
PosizionaObjectMain(pareti.name, sPDX, new Vector3(), sSP, new string[] {"+", "+", "+"});
|
129
|
+
sP4 = pareti.transform.localScale;
|
130
|
+
|
131
|
+
pPDX = new Vector3();
|
132
|
+
pPDX.x += (sSP.x / 2) - (sPDX.x / 2) - sP3.x;
|
133
|
+
pPDX.y += (sSP.y / 2) + (sPDX.y / 2) + (sP3.y - sPDX.y);
|
134
|
+
pPDX.z += (sSP.z / 2) - (sPDX.z / 2);
|
135
|
+
pareti.transform.position = new Vector3(pPDX.x, pPDX.y, pPDX.z);
|
136
|
+
|
137
|
+
pareti = GameObject.Find($"{nome} 5");
|
138
|
+
|
139
|
+
sPDX.x = 10;
|
140
|
+
sPDX.y = 210;
|
141
|
+
sPDX.z = 10;
|
142
|
+
pareti.transform.localScale = new Vector3(sPDX.x, sPDX.y, sPDX.z);
|
143
|
+
PosizionaObjectMain(pareti.name, sPDX, new Vector3(), sSP, new string[] {"+", "+", "+"});
|
144
|
+
|
145
|
+
pPDX = new Vector3();
|
146
|
+
pPDX.x += (sSP.x / 2) - (sPDX.x / 2) - sP3.x - sP4.x + sPDX.x;
|
147
|
+
pPDX.y += (sSP.y / 2) + (sPDX.y / 2) + sP3.y - sPDX.y - sP4.y;
|
148
|
+
pPDX.z += (sSP.z / 2) - (sPDX.z / 2);
|
149
|
+
pareti.transform.position = new Vector3(pPDX.x, pPDX.y, pPDX.z);
|
150
|
+
// posizione parete DX = + (xSP / 2) - o + (xSPDX / 2) Formula posizionamento su superficie oggetto
|
151
|
+
RetroLetto.Start();
|
152
|
+
}
|
153
|
+
|
154
|
+
// Update is called once per frame
|
155
|
+
void Update()
|
156
|
+
{
|
157
|
+
|
158
|
+
}
|
159
|
+
}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
using System.Collections;
|
2
|
+
using System.Collections.Generic;
|
3
|
+
using UnityEngine;
|
4
|
+
|
5
|
+
public class DupLowPoly : MonoBehaviour
|
6
|
+
{
|
7
|
+
static public GameObject dupLowPoly, duplicate;
|
8
|
+
static Vector3 sDP, pDP;
|
9
|
+
|
10
|
+
// Start is called before the first frame update
|
11
|
+
static int i = 0;
|
12
|
+
static internal void Duplica()
|
13
|
+
{
|
14
|
+
i++;
|
15
|
+
if (i < 3)
|
16
|
+
{
|
17
|
+
dupLowPoly = GameObject.Find("LowPoly");
|
18
|
+
duplicate = Instantiate(dupLowPoly);
|
19
|
+
duplicate.name = $"duplicate {i}";
|
20
|
+
}
|
21
|
+
Debug.LogFormat($"ok {duplicate.name}");
|
22
|
+
return;
|
23
|
+
}
|
24
|
+
|
25
|
+
static internal void Start()
|
26
|
+
{
|
27
|
+
GameObject cameretta = GameObject.Find("Cameretta");
|
28
|
+
|
29
|
+
duplicate = GameObject.Find("LowPoly");
|
30
|
+
pDP = duplicate.transform.position = new Vector3(0, (cameretta.transform.localScale.y / 2), 0);
|
31
|
+
sDP = duplicate.transform.localScale = new Vector3(1, 1, 1);
|
32
|
+
|
33
|
+
duplicate = GameObject.Find("duplicate 1");
|
34
|
+
|
35
|
+
pDP = duplicate.transform.position = new Vector3(1, (cameretta.transform.localScale.y / 2), 0);
|
36
|
+
sDP = duplicate.transform.localScale = new Vector3(1, 1, 1);
|
37
|
+
|
38
|
+
duplicate = GameObject.Find("duplicate 2");
|
39
|
+
pDP = duplicate.transform.position = new Vector3(2, (cameretta.transform.localScale.y / 2), 0);
|
40
|
+
sDP = duplicate.transform.localScale = new Vector3(1, 1, 1);
|
41
|
+
}
|
42
|
+
|
43
|
+
// Update is called once per frame
|
44
|
+
void Update()
|
45
|
+
{
|
46
|
+
|
47
|
+
}
|
48
|
+
}
|
@@ -0,0 +1,110 @@
|
|
1
|
+
using System.Collections;
|
2
|
+
using System.Collections.Generic;
|
3
|
+
using UnityEngine;
|
4
|
+
|
5
|
+
[RequireComponent(typeof(MeshFilter))]
|
6
|
+
public class LowPoly : MonoBehaviour
|
7
|
+
{
|
8
|
+
static Mesh mesh;
|
9
|
+
static Vector3[] vertici;
|
10
|
+
static int[] triangle;
|
11
|
+
public MeshFilter filter;
|
12
|
+
static public GameObject dupLowPoly, duplicate, duplicate1, duplicate2, duplicate3;
|
13
|
+
static Vector3 sDP, pDP;
|
14
|
+
|
15
|
+
// Start is called before the first frame update
|
16
|
+
static internal void CostruisciData(Vector3[] vert)
|
17
|
+
{
|
18
|
+
vertici = new Vector3[]{ vert[0], vert[1], vert[2]};
|
19
|
+
triangle = new int[]{ 0,1,2 };
|
20
|
+
}
|
21
|
+
|
22
|
+
static internal void CreaMesh(GameObject dup)
|
23
|
+
{
|
24
|
+
mesh = dup.GetComponent<MeshFilter>().mesh;
|
25
|
+
mesh.Clear();
|
26
|
+
mesh.vertices = vertici;
|
27
|
+
mesh.triangles = triangle;
|
28
|
+
}
|
29
|
+
|
30
|
+
static int i = 0;
|
31
|
+
static internal void Duplica()
|
32
|
+
{
|
33
|
+
i++;
|
34
|
+
if (i <= 3)
|
35
|
+
{
|
36
|
+
dupLowPoly = GameObject.Find("LowPoly");
|
37
|
+
duplicate = Instantiate(dupLowPoly);
|
38
|
+
duplicate.name = $"duplicate {i}";
|
39
|
+
}
|
40
|
+
Debug.LogFormat($"ok {duplicate.name}");
|
41
|
+
return;
|
42
|
+
}
|
43
|
+
|
44
|
+
void Awake()
|
45
|
+
{
|
46
|
+
mesh = GetComponent<MeshFilter>().mesh;
|
47
|
+
}
|
48
|
+
|
49
|
+
void Start()
|
50
|
+
{
|
51
|
+
Vector3 x, y, z;
|
52
|
+
GameObject cameretta = GameObject.Find("Cameretta");
|
53
|
+
duplicate = GameObject.Find("LowPoly");
|
54
|
+
x = new Vector3(0, 0, 0);
|
55
|
+
y = new Vector3(0, 0, 1);
|
56
|
+
z = new Vector3(2, 0, 0);
|
57
|
+
|
58
|
+
CostruisciData(new Vector3[]{x, y, z});
|
59
|
+
CreaMesh(duplicate);
|
60
|
+
Duplica();
|
61
|
+
|
62
|
+
pDP = duplicate.transform.position = new Vector3(0, (cameretta.transform.localScale.y / 2), 0);
|
63
|
+
sDP = duplicate.transform.localScale = new Vector3(1, 1, 1);
|
64
|
+
|
65
|
+
duplicate1 = GameObject.Find("duplicate 1");
|
66
|
+
duplicate1.transform.parent = duplicate.transform;
|
67
|
+
|
68
|
+
x = new Vector3(0, 0, 0); // vertice sinistro
|
69
|
+
y = new Vector3(0, 3, 0); // vertice su
|
70
|
+
z = new Vector3(4, 3, 0); // vertice destro
|
71
|
+
|
72
|
+
CostruisciData(new Vector3[]{x, y, z});
|
73
|
+
CreaMesh(duplicate1);
|
74
|
+
|
75
|
+
pDP = duplicate1.transform.position = new Vector3(1, (cameretta.transform.localScale.y / 2) + 300, 0);
|
76
|
+
sDP = duplicate1.transform.localScale = new Vector3(10, 10, 10);
|
77
|
+
|
78
|
+
duplicate2 = GameObject.Find("duplicate 2");
|
79
|
+
duplicate2.transform.parent = duplicate.transform;
|
80
|
+
|
81
|
+
x = new Vector3(0, 0, 0);
|
82
|
+
y = new Vector3(4, 3, 0);
|
83
|
+
z = new Vector3(4, 0, 0);
|
84
|
+
|
85
|
+
CostruisciData(new Vector3[]{x, y, z});
|
86
|
+
CreaMesh(duplicate2);
|
87
|
+
|
88
|
+
pDP = duplicate2.transform.position = new Vector3(1, (cameretta.transform.localScale.y / 2) + 300, 0);
|
89
|
+
sDP = duplicate2.transform.localScale = new Vector3(10, 10, 10);
|
90
|
+
|
91
|
+
duplicate3 = GameObject.Find("duplicate 3");
|
92
|
+
duplicate3.transform.parent = duplicate.transform;
|
93
|
+
|
94
|
+
x = new Vector3(4, 0, 0);
|
95
|
+
y = new Vector3(4, 3, 0);
|
96
|
+
z = new Vector3(6, 0, 0.5f);
|
97
|
+
|
98
|
+
CostruisciData(new Vector3[]{x, y, z});
|
99
|
+
CreaMesh(duplicate3);
|
100
|
+
|
101
|
+
pDP = duplicate3.transform.position = new Vector3(1, (cameretta.transform.localScale.y / 2) + 300, 0);
|
102
|
+
sDP = duplicate3.transform.localScale = new Vector3(10, 10, 10);
|
103
|
+
}
|
104
|
+
|
105
|
+
// Update is called once per frame
|
106
|
+
void Update()
|
107
|
+
{
|
108
|
+
|
109
|
+
}
|
110
|
+
}
|
@@ -0,0 +1,94 @@
|
|
1
|
+
using System.Collections;
|
2
|
+
using System.Collections.Generic;
|
3
|
+
using UnityEngine;
|
4
|
+
|
5
|
+
public class RetroLetto : MonoBehaviour
|
6
|
+
{
|
7
|
+
// Start is called before the first frame update
|
8
|
+
static GameObject retro, cameretta, parete, pezzi;
|
9
|
+
static Vector3 sSP1, sRL, pRL, sP;
|
10
|
+
static MeshRenderer render;
|
11
|
+
static Material mat;
|
12
|
+
static string nome;
|
13
|
+
|
14
|
+
static internal void Start()
|
15
|
+
{
|
16
|
+
retro = GameObject.Find("RetroLetto");
|
17
|
+
cameretta = GameObject.Find("Cameretta");
|
18
|
+
parete = GameObject.Find("parete 1");
|
19
|
+
|
20
|
+
sP = parete.transform.localScale;
|
21
|
+
sSP1 = cameretta.transform.localScale;
|
22
|
+
sRL = retro.transform.localScale = new Vector3(5, 190, 270);
|
23
|
+
|
24
|
+
int i = 0;
|
25
|
+
while (i < 5)
|
26
|
+
{
|
27
|
+
i++;
|
28
|
+
pezzi = GameObject.CreatePrimitive(PrimitiveType.Cube);
|
29
|
+
|
30
|
+
nome = "pezzoRL";
|
31
|
+
pezzi.name = $"{nome} {i}";
|
32
|
+
}
|
33
|
+
|
34
|
+
Cameretta.ok();
|
35
|
+
//pRL = Cameretta.PosizionaObjectMain(retro.name, sRL, new Vector3(), sSP1, new string[] {"+", "+", "-"});
|
36
|
+
|
37
|
+
pRL.x += (sSP1.x / 2) - (sRL.x / 2) - sP.x;
|
38
|
+
pRL.y += (sSP1.y / 2) + (sRL.y / 2);
|
39
|
+
pRL.z += (sSP1.z / 2) - (sRL.z / 2) - 70;
|
40
|
+
|
41
|
+
pRL = retro.transform.position = new Vector3(pRL.x, pRL.y, pRL.z);
|
42
|
+
|
43
|
+
// Settaggio Colore RetroLetto
|
44
|
+
render = retro.GetComponent<MeshRenderer>();
|
45
|
+
mat = Resources.Load($"Color/ColorRL", typeof(Material)) as Material;
|
46
|
+
render.material = mat;
|
47
|
+
|
48
|
+
int l = 0;
|
49
|
+
int space = 0;
|
50
|
+
while (l < i) // Posizionamento pezzi del RetroLetto
|
51
|
+
{
|
52
|
+
space += 30;
|
53
|
+
l++;
|
54
|
+
pezzi = GameObject.Find($"{nome} {l}");
|
55
|
+
|
56
|
+
sRL = pezzi.transform.localScale = new Vector3(2, 3, 270);
|
57
|
+
|
58
|
+
pRL = new Vector3();
|
59
|
+
pRL.x += (sSP1.x / 2) - (sRL.x / 2) - sP.x - retro.transform.localScale.x + 1.5f;
|
60
|
+
pRL.y += (sSP1.y / 2) + (sRL.y / 2) + 10 + space;
|
61
|
+
pRL.z += (sSP1.z / 2) - (sRL.z / 2) - 70;
|
62
|
+
|
63
|
+
pRL = pezzi.transform.position = new Vector3(pRL.x, pRL.y, pRL.z);
|
64
|
+
|
65
|
+
// Settaggio colore pezzi RetroLetto
|
66
|
+
render = pezzi.GetComponent<MeshRenderer>();
|
67
|
+
mat = Resources.Load($"Color/ColorPZ", typeof(Material)) as Material;
|
68
|
+
render.material = mat;
|
69
|
+
}
|
70
|
+
|
71
|
+
// Settaggio colore RetroLetto
|
72
|
+
render = retro.GetComponent<MeshRenderer>();
|
73
|
+
mat = Resources.Load($"Color/ColorRL", typeof(Material)) as Material;
|
74
|
+
render.material = mat;
|
75
|
+
|
76
|
+
Debug.LogFormat($"{retro.name} {sSP1} {pRL} {sP.x}");
|
77
|
+
|
78
|
+
// Settaggio colore parete 1
|
79
|
+
render = parete.GetComponent<MeshRenderer>();
|
80
|
+
mat = Resources.Load($"Color/ColorP1", typeof(Material)) as Material;
|
81
|
+
render.material = mat;
|
82
|
+
|
83
|
+
Debug.LogFormat($"{render}");
|
84
|
+
|
85
|
+
Scrivania.Start();
|
86
|
+
|
87
|
+
}
|
88
|
+
|
89
|
+
// Update is called once per frame
|
90
|
+
void Update()
|
91
|
+
{
|
92
|
+
|
93
|
+
}
|
94
|
+
}
|