Chip away at this some more

This commit is contained in:
Sollace 2023-06-11 12:39:49 +01:00
parent 1d2f20bc23
commit 703218b53b
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB
4 changed files with 21 additions and 36 deletions

View file

@ -4797,10 +4797,10 @@
</ItemGroup>
<ItemGroup>
<Reference Include="UnityEditor, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\Unity3D.SDK.2017.4.37.1\lib\UnityEditor.dll</HintPath>
<HintPath>packages\Unity3D.SDK.2018.4.11.1\lib\UnityEditor.dll</HintPath>
</Reference>
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\Unity3D.SDK.2017.4.37.1\lib\UnityEngine.dll</HintPath>
<HintPath>packages\Unity3D.UnityEngine.2018.3.5.1\lib\UnityEngine.dll</HintPath>
</Reference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Unity3D.SDK" version="2017.4.37.1" targetFramework="net20" />
<package id="UnityEngine" version="1.0.0" targetFramework="net20" />
<package id="Unity3D.SDK" version="2018.4.11.1" targetFramework="net20" />
<package id="Unity3D.UnityEngine" version="2018.3.5.1" targetFramework="net20" />
</packages>

View file

@ -1,25 +1,20 @@
using Photon;
using UnityEngine;
namespace Fie.Manager
{
namespace Fie.Manager {
[FieManagerExists(FieManagerExistSceneFlag.ANYTIME_DESTROY)]
public abstract class FieManagerBase : Photon.MonoBehaviour
{
public abstract class FieManagerBase : Photon.MonoBehaviour {
private bool _isEndStartup;
private bool _isDestroyed;
public bool isDestroyed => _isDestroyed;
protected virtual void StartUpEntity()
{
protected virtual void StartUpEntity() {
}
public void StartUp()
{
if (!_isEndStartup)
{
public void StartUp() {
if (!_isEndStartup) {
StartUpEntity();
_isEndStartup = true;
}

View file

@ -1,27 +1,21 @@
using UnityEngine;
namespace Fie.Manager
{
public class FieManagerBehaviour<T> : FieManagerBase where T : FieManagerBase
{
namespace Fie.Manager {
public class FieManagerBehaviour<T> : FieManagerBase where T : FieManagerBase {
[SerializeField]
private bool _isAutoStartUp;
private static T instance;
public static T I
{
get
{
if ((UnityEngine.Object)instance != (UnityEngine.Object)null && instance.isDestroyed)
{
instance = (T)null;
public static T I {
get {
if (instance != null && instance.isDestroyed) {
instance = null;
}
if ((UnityEngine.Object)instance == (UnityEngine.Object)null)
if (instance == null)
{
instance = UnityEngine.Object.FindObjectOfType<T>();
if ((UnityEngine.Object)instance == (UnityEngine.Object)null || instance.isDestroyed)
{
if (instance == null || instance.isDestroyed) {
GameObject gameObject = new GameObject();
UnityEngine.Object.DontDestroyOnLoad(gameObject);
instance = gameObject.AddComponent<T>();
@ -31,18 +25,14 @@ namespace Fie.Manager
}
return instance;
}
set
{
set {
instance = value;
}
}
private void Start()
{
if (_isAutoStartUp)
{
T i = I;
i.StartUp();
private void Start() {
if (_isAutoStartUp) {
I.StartUp();
}
}
}