Commit 7ea17601 authored by Егор Парфенов's avatar Егор Парфенов
Browse files

Add docs and remove not used

Add documentation to key and most difficult classe in program and remove outdated editor code
Showing with 0 additions and 268 deletions
+0 -268
fileFormatVersion: 2
guid: 9c37431936bffcb4c929f92fee8cc50a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: d9f4218690a54c1f9ef4cb461079c351
timeCreated: 1650266520
\ No newline at end of file
using Creator.UI.Elements.BehaviourSystem.InputFields;
using Mechanics.Ghost;
using UnityEngine;
namespace LevelCreator.Device
{
public class EnvironmentSetUpManager : MonoBehaviour
{
[SerializeField] private Vector3InputField startField;
[SerializeField] private Vector3InputField endField;
private SinglePosChanger<LevelStartPoint> startPointChanger;
private SinglePosChanger<LevelEndPoint> endPointChanger;
private void OnEnable()
{
startPointChanger = new SinglePosChanger<LevelStartPoint>(startField);
endPointChanger = new SinglePosChanger<LevelEndPoint>(endField);
}
private void OnDisable()
{
startPointChanger.Dispose();
endPointChanger.Dispose();
startPointChanger = null;
endPointChanger = null;
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 7eb39a7a5ed7473ba643b0698b766cdf
timeCreated: 1663828062
\ No newline at end of file
using Creator;
namespace LevelCreator.Device
{
public interface IRequireGridData
{
GridData GridData { get; set; }
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: e709d506d86f44b09157edf654751000
timeCreated: 1650271409
\ No newline at end of file
using System;
using Creator.UI.Elements.BehaviourSystem.InputFields;
using UnityEngine;
using Object = UnityEngine.Object;
namespace LevelCreator.Device
{
/// <summary>
/// This class is used to change pos of start/end point
/// </summary>
public class SinglePosChanger<T>:IDisposable where T: MonoBehaviour
{
private T savedPoint;
private Vector3InputField field;
private T point
{
get
{
if (!savedPoint)
savedPoint = Object.FindObjectOfType<T>();
//field.value = savedPoint.transform.position;
return savedPoint;
}
}
public SinglePosChanger(Vector3InputField field)
{
this.field = field;
//field.onPreChange += FieldOnPreChange;
}
private void FieldOnPreChange(Vector3 pos)
{
pos.z = 0;
point.transform.position = pos;
}
public void Dispose()
{
//field.onPreChange -= FieldOnPreChange;
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: b8597d23caf543efa6aa41feb270b83e
timeCreated: 1663829229
\ No newline at end of file
using UnityEngine.Events;
namespace LevelCreator
{
public static class GlobalEventsManager
{
public static UnityEvent EnvironmentChangeEvent = new UnityEvent();
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: fcaa1b23105d4ebfa258cc944fc84f2e
timeCreated: 1650294441
\ No newline at end of file
fileFormatVersion: 2
guid: 26be42f9daae460d845ff43c2e2d8346
timeCreated: 1650096834
\ No newline at end of file
using Creator.Groups;
using UnityEngine;
namespace LevelCreator.ItemDisplay
{
public class ActionDisplay : MonoBehaviour
{
private MeshRenderer _renderer;
private void Start()
{
_renderer = GetComponent<MeshRenderer>();
_renderer.material.color = new Color(1, 1, 1, .5f);
}
public void OnDisplayChange(DisplayType displayType)
{
switch (displayType)
{
case DisplayType.None:
_renderer.material.color = new Color(1, 1, 1, .5f);
break;
case DisplayType.Selected:
_renderer.material.color = new Color(1, 0.92f, 0.016f, .5f);
break;
case DisplayType.OutOfGroup:
_renderer.material.color = new Color(.5f, .5f, .5f, .5f);
break;
}
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: efc6722d5bf6482db9caaa944bf410cb
timeCreated: 1650096856
\ No newline at end of file
using Creator.Groups;
using UnityEngine;
namespace LevelCreator.ItemDisplay
{
public class AnchorDisplay: MonoBehaviour
{
private MeshRenderer _renderer;
private void Start()
{
_renderer = GetComponent<MeshRenderer>();
}
public void OnDisplayChange(DisplayType displayType)
{
switch (displayType)
{
case DisplayType.None:
_renderer.material.color = Color.white;
break;
case DisplayType.Selected:
_renderer.material.color = Color.yellow;
break;
case DisplayType.OutOfGroup:
_renderer.material.color = Color.gray;
break;
}
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: d7a8bccaeab649f3af53268094b84319
timeCreated: 1651051370
\ No newline at end of file
fileFormatVersion: 2
guid: 8938b2d5ece047d5b78b0bc03089591b
timeCreated: 1650290989
\ No newline at end of file
using System.IO;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
namespace LevelCreator.LevelManagement
{
[CreateAssetMenu(fileName = "EditorManager", menuName = "Custom/levelLoaderManager")]
public class EditorLevelChangerData: ScriptableObject
{
public string currentLevelName;
public string GetLevelString(string levelName)
{
return Resources.Load<TextAsset>($"Levels/{levelName}").text;
}
public void SetLevelString(string data)
{
File.WriteAllText(Path.Combine(Application.dataPath,"Resources" ,"Levels" , currentLevelName + ".json"), data);
}
public string GetLevelString()
{
return File.ReadAllText(Path.Combine(Application.dataPath,"Resources" ,"Levels" , currentLevelName + ".json"));
}
public void CreateNew()
{
string emptyLevelData = File.ReadAllText(Path.Combine(Application.dataPath,"Resources" ,"Levels" , "Empty.json"));
File.WriteAllText(Path.Combine(Application.dataPath,"Resources" ,"Levels" , currentLevelName + ".json"), emptyLevelData);
}
}
#if UNITY_EDITOR
[CustomEditor(typeof(EditorLevelChangerData))]
public class EditorLevelChangerDataEditor : Editor
{
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
if(GUILayout.Button("Create"))
((EditorLevelChangerData)target).CreateNew();
}
}
#endif
}
\ No newline at end of file
fileFormatVersion: 2
guid: b1a66b841462e5749be73c5d78ff8201
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
namespace LevelCreator.LevelManagement
{
[CreateAssetMenu(fileName = "items_data", menuName = "Custom/itemsdata", order = 0)]
public class ItemsData : ScriptableObject
{
[SerializeField] private GameObject[] items;
public GameObject GetItem(int i) => items[i];
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 2a43d69c30c247cfb048e2d0e2bcef56
timeCreated: 1650293052
\ 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