Commit e7903962 authored by Дмитрий Макаров's avatar Дмитрий Макаров
Browse files

Merge branch 'Guid' into 'master'

Add guid to play mode

See merge request !25
1 merge request!25Add guid to play mode
Pipeline #522 passed with stages
in 4 minutes and 11 seconds
Showing with 95 additions and 168 deletions
+95 -168
fileFormatVersion: 2
guid: 22ee244447ae4c61ba941e2be2db829a
timeCreated: 1663933569
\ No newline at end of file
fileFormatVersion: 2
guid: a3d5d29e654a4a899b5965708bdc1f5e
timeCreated: 1663933576
\ No newline at end of file
using System;
namespace GamePlay
{
public static class GamePlayGlobalEventsManager
{
public static Action onGhostDie;
public static Action onLevelFinish;
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 254c77f156a945588f85418f8077cdfe
timeCreated: 1663937265
\ No newline at end of file
using System.Collections;
using LevelCreator.Transitions;
using LevelLoading;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.VFX;
using VRUI.VRUIElements;
namespace GamePlay
{
public class PlayManager : MonoBehaviour
{
[SerializeField] private GameObject ui;
[SerializeField] private ButtonElement startButton;
[SerializeField] private PlayModeGroupsLoader loader;
[SerializeField] private string[] levelsToPlay;
[SerializeField] private GuidManager guid;
private int currentLevel;
private bool levelStartInProgress;
private void OnEnable()
{
startButton.onClick += StartButtonOnClick;
guid.onGuidFinish += GuidOnGuidFinish;
GamePlayGlobalEventsManager.onGhostDie += OnGhostDie;
GamePlayGlobalEventsManager.onLevelFinish += OnLevelFinish;
}
private void OnLevelFinish()
{
StartCoroutine(StartLevel(++currentLevel));
}
private void OnGhostDie()
{
StartCoroutine(StartLevel(currentLevel));
}
private void GuidOnGuidFinish()
{
ui.SetActive(true);
}
private void StartButtonOnClick()
{
startButton.gameObject.SetActive(false);
}
private void OnDisable()
{
startButton.onClick -= StartButtonOnClick;
guid.onGuidFinish -= GuidOnGuidFinish;
GamePlayGlobalEventsManager.onGhostDie -= OnGhostDie;
GamePlayGlobalEventsManager.onLevelFinish -= OnLevelFinish;
}
private void Update()
{
if (Input.GetKeyDown(KeyCode.Space))
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
}
private IEnumerator StartLevel(int i)
{
if (levelStartInProgress)
yield break;
if (i >= levelsToPlay.Length)
{
GameObject.FindGameObjectWithTag("WinVFX").transform.GetChild(0).gameObject.SetActive(true);
yield break;
}
levelStartInProgress = true;
yield return new WaitForSeconds(1);
levelStartInProgress = false;
}
}
}
fileFormatVersion: 2
guid: bf3a464b6ac0e51448a7cb07f25a89f4
folderAsset: yes
DefaultImporter:
guid: 27a3146bbc0d9ad41939658a9b0429f9
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 02419dcc896105c4796e0f2f73b5604e
MonoImporter:
guid: 8eb65ad0fb272cb43a9c4bd927831293
NativeFormatImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
{"sJ":"{\"sC\":[{\"sC\":[{\"sC\":[],\"sP\":{\"x\":10,\"y\":110,\"z\":210},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":4,\"sB\":[],\"sIb\":[]},{\"sC\":[],\"sP\":{\"x\":0,\"y\":110,\"z\":180},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":4,\"sB\":[],\"sIb\":[]},{\"sC\":[],\"sP\":{\"x\":-20,\"y\":110,\"z\":140},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":4,\"sB\":[],\"sIb\":[]}],\"sP\":{\"x\":0,\"y\":110,\"z\":200},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":100,\"y\":100,\"z\":100},\"sIi\":-1,\"sB\":[\"RotationGroupBehaviourData:{\\\"savedCenterOfRotation\\\":{\\\"x\\\":0,\\\"y\\\":140,\\\"z\\\":200},\\\"savedAxisDirection\\\":{\\\"x\\\":0,\\\"y\\\":140,\\\"z\\\":230}}\",\"EmptyBehaviourData:{}\"],\"sIb\":[]},{\"sC\":[{\"sC\":[],\"sP\":{\"x\":20,\"y\":110,\"z\":200},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":4,\"sB\":[],\"sIb\":[]},{\"sC\":[],\"sP\":{\"x\":60,\"y\":110,\"z\":230},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]}],\"sP\":{\"x\":40,\"y\":110,\"z\":200},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":100,\"y\":100,\"z\":100},\"sIi\":-1,\"sB\":[\"RotationGroupBehaviourData:{\\\"savedCenterOfRotation\\\":{\\\"x\\\":50,\\\"y\\\":110,\\\"z\\\":160},\\\"savedAxisDirection\\\":{\\\"x\\\":10,\\\"y\\\":110,\\\"z\\\":160}}\"],\"sIb\":[]},{\"sC\":[{\"sC\":[],\"sP\":{\"x\":50,\"y\":110,\"z\":170},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sC\":[],\"sP\":{\"x\":-40,\"y\":110,\"z\":210},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":4,\"sB\":[],\"sIb\":[]}],\"sP\":{\"x\":0,\"y\":110,\"z\":200},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":100,\"y\":100,\"z\":100},\"sIi\":-1,\"sB\":[\"RotationGroupBehaviourData:{\\\"savedCenterOfRotation\\\":{\\\"x\\\":20,\\\"y\\\":140,\\\"z\\\":150},\\\"savedAxisDirection\\\":{\\\"x\\\":20,\\\"y\\\":110,\\\"z\\\":150}}\"],\"sIb\":[]},{\"sC\":[{\"sC\":[],\"sP\":{\"x\":40,\"y\":110,\"z\":160},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":4,\"sB\":[],\"sIb\":[]},{\"sC\":[],\"sP\":{\"x\":30,\"y\":110,\"z\":200},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":4,\"sB\":[],\"sIb\":[]}],\"sP\":{\"x\":40,\"y\":110,\"z\":200},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":100,\"y\":100,\"z\":100},\"sIi\":-1,\"sB\":[\"RotationGroupBehaviourData:{\\\"savedCenterOfRotation\\\":{\\\"x\\\":10,\\\"y\\\":140,\\\"z\\\":200},\\\"savedAxisDirection\\\":{\\\"x\\\":10,\\\"y\\\":140,\\\"z\\\":210}}\"],\"sIb\":[]},{\"sC\":[{\"sC\":[],\"sP\":{\"x\":-10,\"y\":110,\"z\":160},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":4,\"sB\":[],\"sIb\":[]},{\"sC\":[],\"sP\":{\"x\":-30,\"y\":110,\"z\":240},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":4,\"sB\":[],\"sIb\":[]}],\"sP\":{\"x\":-20,\"y\":110,\"z\":200},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":100,\"y\":100,\"z\":100},\"sIi\":-1,\"sB\":[\"RotationGroupBehaviourData:{\\\"savedCenterOfRotation\\\":{\\\"x\\\":-10,\\\"y\\\":130,\\\"z\\\":160},\\\"savedAxisDirection\\\":{\\\"x\\\":10,\\\"y\\\":130,\\\"z\\\":160}}\"],\"sIb\":[]}],\"sP\":{\"x\":0,\"y\":0,\"z\":0},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":100,\"y\":100,\"z\":100},\"sIi\":-1,\"sB\":[],\"sIb\":[]}","sS":{"x":0.10000000149011612,"y":1.0,"z":0.0},"sE":{"x":0.0,"y":0.9000000357627869,"z":0.0}}
\ No newline at end of file
{"sJ":"{\"sId\":1,\"sC\":[{\"sId\":2,\"sC\":[{\"sId\":3,\"sC\":[],\"sP\":{\"x\":0,\"y\":0,\"z\":0},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":0,\"y\":0,\"z\":0},\"sIi\":4,\"sB\":[],\"sIb\":[]},{\"sId\":4,\"sC\":[],\"sP\":{\"x\":0,\"y\":0,\"z\":0},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":0,\"y\":0,\"z\":0},\"sIi\":4,\"sB\":[],\"sIb\":[]}],\"sP\":{\"x\":0,\"y\":0,\"z\":0},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":0.0},\"sS\":{\"x\":0,\"y\":0,\"z\":0},\"sIi\":-1,\"sB\":[\"RotationGroupBehaviourData:{\\\"savedCenterOfRotation\\\":{\\\"x\\\":-10,\\\"y\\\":130,\\\"z\\\":160},\\\"savedAxisDirection\\\":{\\\"x\\\":10,\\\"y\\\":130,\\\"z\\\":160}}\"],\"sIb\":[]},{\"sId\":5,\"sC\":[{\"sId\":6,\"sC\":[],\"sP\":{\"x\":0,\"y\":0,\"z\":0},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":0,\"y\":0,\"z\":0},\"sIi\":4,\"sB\":[],\"sIb\":[]},{\"sId\":7,\"sC\":[],\"sP\":{\"x\":0,\"y\":0,\"z\":0},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":0,\"y\":0,\"z\":0},\"sIi\":4,\"sB\":[],\"sIb\":[]},{\"sId\":8,\"sC\":[],\"sP\":{\"x\":0,\"y\":0,\"z\":0},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":0,\"y\":0,\"z\":0},\"sIi\":4,\"sB\":[],\"sIb\":[]}],\"sP\":{\"x\":0,\"y\":0,\"z\":0},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":0.0},\"sS\":{\"x\":0,\"y\":0,\"z\":0},\"sIi\":-1,\"sB\":[\"RotationGroupBehaviourData:{\\\"savedCenterOfRotation\\\":{\\\"x\\\":0,\\\"y\\\":140,\\\"z\\\":200},\\\"savedAxisDirection\\\":{\\\"x\\\":0,\\\"y\\\":140,\\\"z\\\":230}}\",\"EmptyBehaviourData:{}\"],\"sIb\":[]},{\"sId\":9,\"sC\":[{\"sId\":10,\"sC\":[],\"sP\":{\"x\":0,\"y\":0,\"z\":0},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":0,\"y\":0,\"z\":0},\"sIi\":4,\"sB\":[],\"sIb\":[]},{\"sId\":11,\"sC\":[],\"sP\":{\"x\":0,\"y\":0,\"z\":0},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":0,\"y\":0,\"z\":0},\"sIi\":0,\"sB\":[],\"sIb\":[]}],\"sP\":{\"x\":0,\"y\":0,\"z\":0},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":0.0},\"sS\":{\"x\":0,\"y\":0,\"z\":0},\"sIi\":-1,\"sB\":[\"RotationGroupBehaviourData:{\\\"savedCenterOfRotation\\\":{\\\"x\\\":50,\\\"y\\\":110,\\\"z\\\":160},\\\"savedAxisDirection\\\":{\\\"x\\\":10,\\\"y\\\":110,\\\"z\\\":160}}\"],\"sIb\":[]},{\"sId\":12,\"sC\":[{\"sId\":13,\"sC\":[],\"sP\":{\"x\":0,\"y\":0,\"z\":0},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":0,\"y\":0,\"z\":0},\"sIi\":4,\"sB\":[],\"sIb\":[]},{\"sId\":14,\"sC\":[],\"sP\":{\"x\":0,\"y\":0,\"z\":0},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":0,\"y\":0,\"z\":0},\"sIi\":4,\"sB\":[],\"sIb\":[]}],\"sP\":{\"x\":0,\"y\":0,\"z\":0},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":0.0},\"sS\":{\"x\":0,\"y\":0,\"z\":0},\"sIi\":-1,\"sB\":[\"RotationGroupBehaviourData:{\\\"savedCenterOfRotation\\\":{\\\"x\\\":10,\\\"y\\\":140,\\\"z\\\":200},\\\"savedAxisDirection\\\":{\\\"x\\\":10,\\\"y\\\":140,\\\"z\\\":210}}\"],\"sIb\":[]},{\"sId\":15,\"sC\":[{\"sId\":16,\"sC\":[],\"sP\":{\"x\":0,\"y\":0,\"z\":0},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":0,\"y\":0,\"z\":0},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":17,\"sC\":[],\"sP\":{\"x\":0,\"y\":0,\"z\":0},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":0,\"y\":0,\"z\":0},\"sIi\":4,\"sB\":[],\"sIb\":[]}],\"sP\":{\"x\":0,\"y\":0,\"z\":0},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":0.0},\"sS\":{\"x\":0,\"y\":0,\"z\":0},\"sIi\":-1,\"sB\":[\"RotationGroupBehaviourData:{\\\"savedCenterOfRotation\\\":{\\\"x\\\":20,\\\"y\\\":140,\\\"z\\\":150},\\\"savedAxisDirection\\\":{\\\"x\\\":20,\\\"y\\\":110,\\\"z\\\":150}}\"],\"sIb\":[]}],\"sP\":{\"x\":0,\"y\":0,\"z\":0},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":0.0},\"sS\":{\"x\":0,\"y\":0,\"z\":0},\"sIi\":-1,\"sB\":[],\"sIb\":[]}","sS":{"x":0.10000000149011612,"y":1.0,"z":0.0},"sE":{"x":0.0,"y":0.9000000357627869,"z":0.0}}
\ No newline at end of file
{"sJ":"{\"sId\":1,\"sC\":[{\"sId\":2,\"sC\":[],\"sP\":{\"x\":-40,\"y\":110,\"z\":140},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":3,\"sC\":[{\"sId\":4,\"sC\":[],\"sP\":{\"x\":-60,\"y\":100,\"z\":140},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":5,\"sC\":[],\"sP\":{\"x\":-70,\"y\":100,\"z\":140},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":6,\"sC\":[],\"sP\":{\"x\":-80,\"y\":100,\"z\":140},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]}],\"sP\":{\"x\":0,\"y\":0,\"z\":0},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":0.0},\"sS\":{\"x\":0,\"y\":0,\"z\":0},\"sIi\":-1,\"sB\":[],\"sIb\":[]},{\"sId\":7,\"sC\":[{\"sId\":8,\"sC\":[],\"sP\":{\"x\":-80,\"y\":90,\"z\":150},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":9,\"sC\":[],\"sP\":{\"x\":-90,\"y\":90,\"z\":150},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":10,\"sC\":[],\"sP\":{\"x\":-80,\"y\":80,\"z\":150},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":11,\"sC\":[],\"sP\":{\"x\":-90,\"y\":80,\"z\":150},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":12,\"sC\":[],\"sP\":{\"x\":-80,\"y\":90,\"z\":160},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":13,\"sC\":[],\"sP\":{\"x\":-90,\"y\":90,\"z\":160},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":14,\"sC\":[],\"sP\":{\"x\":-80,\"y\":80,\"z\":160},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":15,\"sC\":[],\"sP\":{\"x\":-90,\"y\":80,\"z\":160},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":16,\"sC\":[],\"sP\":{\"x\":-80,\"y\":90,\"z\":170},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":17,\"sC\":[],\"sP\":{\"x\":-90,\"y\":90,\"z\":170},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":18,\"sC\":[],\"sP\":{\"x\":-80,\"y\":80,\"z\":170},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":19,\"sC\":[],\"sP\":{\"x\":-90,\"y\":80,\"z\":170},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]}],\"sP\":{\"x\":0,\"y\":0,\"z\":0},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":0.0},\"sS\":{\"x\":0,\"y\":0,\"z\":0},\"sIi\":-1,\"sB\":[\"AxisMotionGroupBehaviourData:{\\\"savedStartPoint\\\":{\\\"x\\\":0,\\\"y\\\":0,\\\"z\\\":0},\\\"savedEndPoint\\\":{\\\"x\\\":0,\\\"y\\\":0,\\\"z\\\":0},\\\"savedCenterPoint\\\":{\\\"x\\\":0,\\\"y\\\":0,\\\"z\\\":0}}\"],\"sIb\":[]}],\"sP\":{\"x\":0,\"y\":0,\"z\":0},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":0.0},\"sS\":{\"x\":0,\"y\":0,\"z\":0},\"sIi\":-1,\"sB\":[],\"sIb\":[]}","sS":{"x":0.0,"y":1.0,"z":0.0},"sE":{"x":-1.0,"y":1.100000023841858,"z":0.0}}
\ No newline at end of file
{"sJ":"{\"sId\":1,\"sC\":[{\"sId\":2,\"sC\":[{\"sId\":3,\"sC\":[],\"sP\":{\"x\":-30,\"y\":110,\"z\":120},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]}],\"sP\":{\"x\":0,\"y\":0,\"z\":0},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":0.0},\"sS\":{\"x\":0,\"y\":0,\"z\":0},\"sIi\":-1,\"sB\":[],\"sIb\":[]},{\"sId\":4,\"sC\":[{\"sId\":5,\"sC\":[],\"sP\":{\"x\":-50,\"y\":110,\"z\":120},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]}],\"sP\":{\"x\":0,\"y\":0,\"z\":0},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":0.0},\"sS\":{\"x\":0,\"y\":0,\"z\":0},\"sIi\":-1,\"sB\":[],\"sIb\":[]},{\"sId\":6,\"sC\":[{\"sId\":7,\"sC\":[],\"sP\":{\"x\":-50,\"y\":130,\"z\":120},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":8,\"sC\":[],\"sP\":{\"x\":-60,\"y\":130,\"z\":120},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]}],\"sP\":{\"x\":0,\"y\":0,\"z\":0},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":0.0},\"sS\":{\"x\":0,\"y\":0,\"z\":0},\"sIi\":-1,\"sB\":[],\"sIb\":[]},{\"sId\":9,\"sC\":[{\"sId\":10,\"sC\":[],\"sP\":{\"x\":-70,\"y\":110,\"z\":130},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]}],\"sP\":{\"x\":0,\"y\":0,\"z\":0},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":0.0},\"sS\":{\"x\":0,\"y\":0,\"z\":0},\"sIi\":-1,\"sB\":[],\"sIb\":[]},{\"sId\":11,\"sC\":[{\"sId\":12,\"sC\":[],\"sP\":{\"x\":-70,\"y\":140,\"z\":130},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":13,\"sC\":[],\"sP\":{\"x\":-80,\"y\":140,\"z\":130},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":14,\"sC\":[],\"sP\":{\"x\":-90,\"y\":140,\"z\":130},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":15,\"sC\":[],\"sP\":{\"x\":-70,\"y\":130,\"z\":130},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":16,\"sC\":[],\"sP\":{\"x\":-80,\"y\":130,\"z\":130},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":17,\"sC\":[],\"sP\":{\"x\":-90,\"y\":130,\"z\":130},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":18,\"sC\":[],\"sP\":{\"x\":-70,\"y\":140,\"z\":140},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":19,\"sC\":[],\"sP\":{\"x\":-80,\"y\":140,\"z\":140},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":20,\"sC\":[],\"sP\":{\"x\":-90,\"y\":140,\"z\":140},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":21,\"sC\":[],\"sP\":{\"x\":-70,\"y\":130,\"z\":140},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":22,\"sC\":[],\"sP\":{\"x\":-80,\"y\":130,\"z\":140},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":23,\"sC\":[],\"sP\":{\"x\":-90,\"y\":130,\"z\":140},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":24,\"sC\":[],\"sP\":{\"x\":-70,\"y\":140,\"z\":150},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":25,\"sC\":[],\"sP\":{\"x\":-80,\"y\":140,\"z\":150},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":26,\"sC\":[],\"sP\":{\"x\":-90,\"y\":140,\"z\":150},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":27,\"sC\":[],\"sP\":{\"x\":-70,\"y\":130,\"z\":150},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":28,\"sC\":[],\"sP\":{\"x\":-80,\"y\":130,\"z\":150},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":29,\"sC\":[],\"sP\":{\"x\":-90,\"y\":130,\"z\":150},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]}],\"sP\":{\"x\":0,\"y\":0,\"z\":0},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":0.0},\"sS\":{\"x\":0,\"y\":0,\"z\":0},\"sIi\":-1,\"sB\":[],\"sIb\":[]},{\"sId\":30,\"sC\":[{\"sId\":31,\"sC\":[],\"sP\":{\"x\":-40,\"y\":100,\"z\":120},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":32,\"sC\":[],\"sP\":{\"x\":-30,\"y\":100,\"z\":120},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":33,\"sC\":[],\"sP\":{\"x\":-20,\"y\":100,\"z\":120},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":34,\"sC\":[],\"sP\":{\"x\":-40,\"y\":90,\"z\":120},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":35,\"sC\":[],\"sP\":{\"x\":-30,\"y\":90,\"z\":120},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":36,\"sC\":[],\"sP\":{\"x\":-20,\"y\":90,\"z\":120},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":37,\"sC\":[],\"sP\":{\"x\":-40,\"y\":100,\"z\":130},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":38,\"sC\":[],\"sP\":{\"x\":-30,\"y\":100,\"z\":130},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":39,\"sC\":[],\"sP\":{\"x\":-20,\"y\":100,\"z\":130},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":40,\"sC\":[],\"sP\":{\"x\":-40,\"y\":90,\"z\":130},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":41,\"sC\":[],\"sP\":{\"x\":-30,\"y\":90,\"z\":130},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]},{\"sId\":42,\"sC\":[],\"sP\":{\"x\":-20,\"y\":90,\"z\":130},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0},\"sS\":{\"x\":10,\"y\":10,\"z\":10},\"sIi\":0,\"sB\":[],\"sIb\":[]}],\"sP\":{\"x\":0,\"y\":0,\"z\":0},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":0.0},\"sS\":{\"x\":0,\"y\":0,\"z\":0},\"sIi\":-1,\"sB\":[],\"sIb\":[]}],\"sP\":{\"x\":0,\"y\":0,\"z\":0},\"sR\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":0.0},\"sS\":{\"x\":0,\"y\":0,\"z\":0},\"sIi\":-1,\"sB\":[],\"sIb\":[]}","sS":{"x":0.9000000357627869,"y":1.399999976158142,"z":0.0},"sE":{"x":-0.30000001192092898,"y":1.5,"z":0.0}}
\ No newline at end of file
No preview for this file type
No preview for this file type
File added
fileFormatVersion: 2
guid: 5d4d67e49003a02438ac65e51b828ef4
folderAsset: yes
DefaultImporter:
guid: 4918f6fcfae23604b8e588510d02c35a
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
......
No preview for this file type
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
......@@ -43,8 +43,9 @@ namespace Creator
root.RefreshId();
_startPod = UnityEngine.Object.Instantiate(Resources.Load<GameObject>("PlayMode/Start"), levelData.start, Quaternion.identity);
_startPod.gameObject.SetActive(true);
_endPod = UnityEngine.Object.Instantiate(Resources.Load<GameObject>("PlayMode/End"), levelData.end, Quaternion.identity);
_endPod.gameObject.SetActive(true);
}
public void Dispose()
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Creator.ResourceContainers;
using Cysharp.Threading.Tasks;
using LevelSaving;
......@@ -120,6 +121,14 @@ namespace Creator.Groups
foreach (var child in _children)
child.Rotate(axis, angle);
foreach (BaseBehaviourData behaviourData in _groupData)
foreach (PropertyInfo property in behaviourData.GetType().GetProperties())
foreach (Attribute attribute in property.GetCustomAttributes())
{
if(property.PropertyType == typeof(Vector3) && attribute.GetType() == typeof(EditorPropertyAttribute))
property.SetValue(behaviourData, Quaternion.AngleAxis(angle, axis) * (Vector3)property.GetValue(behaviourData));
}
}
/// <summary>
......@@ -371,6 +380,16 @@ namespace Creator.Groups
}
if(_relatedObject)
relatedObject.transform.Translate(moveDirection);
foreach (BaseBehaviourData behaviourData in _groupData)
foreach (PropertyInfo property in behaviourData.GetType().GetProperties())
foreach (Attribute attribute in property.GetCustomAttributes())
{
if(property.PropertyType == typeof(Vector3) && attribute.GetType() == typeof(EditorPropertyAttribute))
property.SetValue(behaviourData, (Vector3)property.GetValue(behaviourData) + moveDirection);
}
}
/// <summary>
......
......@@ -44,7 +44,7 @@ namespace Creator.Instruments
else
strategies[_currentStrategy].OnTriggerRelease();
}
public void PerformSelection(bool selected, int strategy)
public void PerformSelection(bool selected, int strategy = 0)
{
if (isSelected && selected)
{
......
......@@ -85,6 +85,8 @@ namespace Creator.Instruments
Object.Destroy(_createdObjects.Last());
_createdObjects.RemoveAt(_createdObjects.Count - 1);
}
if(_createdObjects.Count == 0)
_createdObjects.Add(instrument._itemCreator.CreateItem(instrument._itemId, ItemCreator.Mode.Edit));
_createdObjects[0].transform.position = instrument.gridData.GetCoordOnGrid(instrument.position);
}
else
......@@ -130,37 +132,37 @@ namespace Creator.Instruments
public override void OnTriggerPress()
{
Debug.Log("ItemPlacer.OnTriggerPress");
if (_state == State.FirstPoint)
_state = State.SecondPoint;
startPoint = _createdObjects[0].transform.position;
}
public override void OnTriggerRelease()
{
//Checks if possible to place
bool possibleToPlace = true;
foreach (var createdObject in _createdObjects)
if (instrument._selector.root.ExistAtPosition(createdObject.transform.position))
possibleToPlace = false;
//Places all blocks
if (possibleToPlace)
{
_state = State.SecondPoint;
startPoint = _createdObjects[0].transform.position;
List<Group> createdGroups = new();
foreach (GameObject createdObject in _createdObjects)
createdGroups.Add(instrument._selector.parentOfSelection.AddItem(instrument._itemId, createdObject.transform.position));
instrument._selector.parentOfSelection.GroupChildren(createdGroups);
instrument._selector.root.RefreshId();
Debug.unityLogger.Log($"{nameof(LineStrategy)}.{nameof(OnTriggerPress)}", $"Placed {createdGroups.Count} items");
}
else
//Destroys All created objects
for (int i = 0; i < _createdObjects.Count; i++)
{
bool possibleToPlace = true;
foreach (var createdObject in _createdObjects)
if (instrument._selector.root.ExistAtPosition(createdObject.transform.position))
possibleToPlace = false;
if (possibleToPlace)
{
List<Group> createdGroups = new();
foreach (GameObject createdObject in _createdObjects)
createdGroups.Add(instrument._selector.parentOfSelection.AddItem(instrument._itemId, createdObject.transform.position));
instrument._selector.parentOfSelection.GroupChildren(createdGroups);
instrument._selector.root.RefreshId();
}
for (int i = 0; i < _createdObjects.Count; i++)
{
Object.Destroy(_createdObjects.Last());
_createdObjects.RemoveAt(_createdObjects.Count - 1);
}
_state = State.FirstPoint;
Object.Destroy(_createdObjects.Last());
_createdObjects.RemoveAt(_createdObjects.Count - 1);
}
_state = State.FirstPoint;
}
}
......@@ -183,7 +185,6 @@ namespace Creator.Instruments
_createdObjects.Add(instrument._itemCreator.CreateItem(instrument._itemId, ItemCreator.Mode.Edit));
_createdObjects[0].transform.position = instrument.gridData.GetCoordOnGrid(instrument.position);
}
public override void OnDeselect()
{
foreach (GameObject createdObject in _createdObjects)
......@@ -193,7 +194,6 @@ namespace Creator.Instruments
_createdObjects.Clear();
_createdObjects = null;
}
public override void OnPositionChanged()
{
if (_state == State.FirstPoint)
......@@ -204,6 +204,8 @@ namespace Creator.Instruments
Object.Destroy(_createdObjects.Last());
_createdObjects.RemoveAt(_createdObjects.Count - 1);
}
if(_createdObjects.Count == 0)
_createdObjects.Add(instrument._itemCreator.CreateItem(instrument._itemId, ItemCreator.Mode.Edit));
_createdObjects[0].transform.position = instrument.gridData.GetCoordOnGrid(instrument.position);
}
else
......@@ -243,7 +245,6 @@ namespace Creator.Instruments
_createdObjects.Last().transform.position = pos;
}
}
}
}
......@@ -254,39 +255,34 @@ namespace Creator.Instruments
}
}
}
public override void OnTriggerPress()
{
if (_state == State.FirstPoint)
{
_state = State.SecondPoint;
startPoint = _createdObjects[0].transform.position;
}
else
{
bool possibleToPlace = true;
foreach (var createdObject in _createdObjects)
if (instrument._selector.root.ExistAtPosition(createdObject.transform.position))
possibleToPlace = false;
_state = State.SecondPoint;
startPoint = _createdObjects[0].transform.position;
}
public override void OnTriggerRelease()
{
bool possibleToPlace = true;
foreach (var createdObject in _createdObjects)
if (instrument._selector.root.ExistAtPosition(createdObject.transform.position))
possibleToPlace = false;
if (possibleToPlace)
{
List<Group> createdGroups = new();
foreach (GameObject createdObject in _createdObjects)
createdGroups.Add(instrument._selector.parentOfSelection.AddItem(instrument._itemId, createdObject.transform.position));
if (possibleToPlace)
{
List<Group> createdGroups = new();
foreach (GameObject createdObject in _createdObjects)
createdGroups.Add(instrument._selector.parentOfSelection.AddItem(instrument._itemId, createdObject.transform.position));
instrument._selector.parentOfSelection.GroupChildren(createdGroups);
instrument._selector.root.RefreshId();
}
instrument._selector.parentOfSelection.GroupChildren(createdGroups);
instrument._selector.root.RefreshId();
}
for (int i = 0; i < _createdObjects.Count; i++)
{
Object.Destroy(_createdObjects.Last());
_createdObjects.RemoveAt(_createdObjects.Count - 1);
}
_state = State.FirstPoint;
for (int i = 0; i < _createdObjects.Count; i++)
{
Object.Destroy(_createdObjects.Last());
_createdObjects.RemoveAt(_createdObjects.Count - 1);
}
_state = State.FirstPoint;
}
}
......
using System.Collections.Generic;
using Creator.UI.Elements.TabSaving;
using UnityEngine;
namespace Creator.Settings
......@@ -8,5 +10,7 @@ namespace Creator.Settings
[field: SerializeField] public Vector3 openTabOffset { get; private set; }
[field: SerializeField] public Vector3 openTabRotationEuler { get; private set; }
[field:SerializeField] public float deadZone { get; private set; }
[SerializeField] public List<TabContentData> openedTabs = new();
}
}
\ No newline at end of file
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