Skip to content

Commit 2888de9

Browse files
author
DYLAN-PC\Dylan
committed
Merge branch 'feature/Tweaks' into develop
2 parents c74369d + 2688746 commit 2888de9

32 files changed

+703
-421
lines changed

SPAnim/Anim/Legacy/SPAnimClip.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,11 @@ public ReadOnlyNameAttribute(string name)
583583
#region Static Utils
584584

585585
public static bool IsValid(SPAnimClip clip)
586+
{
587+
return clip != null && clip.Clip != null;
588+
}
589+
590+
public static bool IsValidAndInitialized(SPAnimClip clip)
586591
{
587592
return clip != null && clip.Clip != null && clip.Initialized;
588593
}

SPProject/SPProject.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
</Compile>
4646
<Compile Include="Project\ITextSource.cs" />
4747
<Compile Include="Project\QueryableAssetSet.cs" />
48-
<Compile Include="Project\SceneRef.cs" />
4948
<Compile Include="Project\TextDocument.cs" />
5049
<Compile Include="Project\TextRef.cs" />
5150
<Compile Include="Properties\AssemblyInfo.cs" />

SPProjectEditor/Project/SceneRefPropertyDrawer.cs

Lines changed: 0 additions & 45 deletions
This file was deleted.

SPProjectEditor/SPProjectEditor.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
<Compile Include="..\SpacepuppyUnityFramework\Properties\AssemblyVersionInfo.cs">
4747
<Link>Properties\AssemblyVersionInfo.cs</Link>
4848
</Compile>
49-
<Compile Include="Project\SceneRefPropertyDrawer.cs" />
5049
<Compile Include="Project\TextRefPropertyDrawer.cs" />
5150
<Compile Include="Project\WeightedTextDocumentInspector.cs" />
5251
<Compile Include="Properties\AssemblyInfo.cs" />

SPScenes/ISceneManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public interface ISceneManager : IService
1111
event System.EventHandler<LoadSceneWaitHandle> BeforeSceneLoaded;
1212
event System.EventHandler<SceneUnloadedEventArgs> BeforeSceneUnloaded;
1313
event System.EventHandler<SceneUnloadedEventArgs> SceneUnloaded;
14-
event System.EventHandler<SceneLoadedEventArgs> SceneLoaded;
14+
event System.EventHandler<LoadSceneWaitHandle> SceneLoaded;
1515
event System.EventHandler<ActiveSceneChangedEventArgs> ActiveSceneChanged;
1616

1717
LoadSceneWaitHandle LoadScene(string sceneName, LoadSceneMode mode = LoadSceneMode.Single, LoadSceneBehaviour behaviour = LoadSceneBehaviour.Async);

SPScenes/SPScenes.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
<Compile Include="Scenes\Events\i_LoadScene.cs" />
5050
<Compile Include="Scenes\ISceneLoadedMessageReceiver.cs" />
5151
<Compile Include="Scenes\LoadSceneAsyncWaitHandle.cs" />
52+
<Compile Include="Scenes\SceneRef.cs" />
5253
<Compile Include="Scenes\SPSceneManager.cs" />
5354
<Compile Include="Scenes\SceneManagerEventArgs.cs" />
5455
<Compile Include="Scenes\SceneManagerUtils.cs" />

SPScenes/Scenes/Events/i_LoadScene.cs

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class i_LoadScene : AutoTriggerable
1414

1515
[SerializeField]
1616
[Tooltip("Prefix with # to load by index.")]
17-
private string _sceneName;
17+
private SceneRef _scene;
1818
[SerializeField]
1919
private LoadSceneMode _mode;
2020
[SerializeField]
@@ -26,14 +26,41 @@ public class i_LoadScene : AutoTriggerable
2626

2727
#endregion
2828

29+
#region Properties
30+
31+
public SceneRef Scene
32+
{
33+
get { return _scene; }
34+
set { _scene = value; }
35+
}
36+
37+
public LoadSceneMode Mode
38+
{
39+
get { return _mode; }
40+
set { _mode = value; }
41+
}
42+
43+
public LoadSceneBehaviour Behaviour
44+
{
45+
get { return _behaviour; }
46+
set { _behaviour = value; }
47+
}
48+
49+
public object PersistentToken
50+
{
51+
get { return _persistentToken; }
52+
}
53+
54+
#endregion
55+
2956
#region Methods
3057

3158
public override bool Trigger(object sender, object arg)
3259
{
3360
if (!this.CanTrigger) return false;
34-
if (string.IsNullOrEmpty(_sceneName)) return false;
61+
if (string.IsNullOrEmpty(_scene.SceneName)) return false;
3562

36-
var nm = _sceneName;
63+
var nm = _scene.SceneName;
3764
LoadSceneWaitHandle handle;
3865
if (nm.StartsWith("#"))
3966
{
@@ -48,7 +75,7 @@ public override bool Trigger(object sender, object arg)
4875
}
4976
else
5077
{
51-
handle = SceneManagerUtils.LoadScene(_sceneName, _mode, _behaviour);
78+
handle = SceneManagerUtils.LoadScene(nm, _mode, _behaviour);
5279
}
5380

5481
if (handle != null)
Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
using System.Collections.Generic;
55
using System.Linq;
66

7-
namespace com.spacepuppy.Project
7+
namespace com.spacepuppy.Scenes
88
{
99

1010
[System.Serializable]
11-
public class SceneRef
11+
public struct SceneRef
1212
{
1313

1414
#region Fields
@@ -21,6 +21,16 @@ public class SceneRef
2121

2222
#endregion
2323

24+
#region CONSTRUCTOR
25+
26+
public SceneRef(string sceneName)
27+
{
28+
_sceneAsset = null;
29+
_sceneName = sceneName;
30+
}
31+
32+
#endregion
33+
2434
#region Properties
2535

2636
public UnityEngine.Object SceneAsset
@@ -31,6 +41,14 @@ public UnityEngine.Object SceneAsset
3141
public string SceneName
3242
{
3343
get { return _sceneName; }
44+
set
45+
{
46+
if (!string.Equals(_sceneName, value))
47+
{
48+
_sceneAsset = null;
49+
_sceneName = value;
50+
}
51+
}
3452
}
3553

3654
#endregion
@@ -43,6 +61,11 @@ public static implicit operator string(SceneRef sceneRef)
4361
return sceneRef._sceneName;
4462
}
4563

64+
public static implicit operator SceneRef(string sceneName)
65+
{
66+
return new SceneRef(sceneName);
67+
}
68+
4669
#endregion
4770

4871
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("SPScenesEditor")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("SPScenesEditor")]
13+
[assembly: AssemblyCopyright("Copyright © 2018")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("a8267310-ca39-4d9b-9a6a-a29b7d4dd970")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{A8267310-CA39-4D9B-9A6A-A29B7D4DD970}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>SPScenesEditor</RootNamespace>
11+
<AssemblyName>SPScenesEditor</AssemblyName>
12+
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16+
<DebugSymbols>true</DebugSymbols>
17+
<DebugType>full</DebugType>
18+
<Optimize>false</Optimize>
19+
<OutputPath>bin\Debug\</OutputPath>
20+
<DefineConstants>DEBUG;TRACE</DefineConstants>
21+
<ErrorReport>prompt</ErrorReport>
22+
<WarningLevel>4</WarningLevel>
23+
</PropertyGroup>
24+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25+
<DebugType>pdbonly</DebugType>
26+
<Optimize>true</Optimize>
27+
<OutputPath>bin\Release\</OutputPath>
28+
<DefineConstants>TRACE</DefineConstants>
29+
<ErrorReport>prompt</ErrorReport>
30+
<WarningLevel>4</WarningLevel>
31+
</PropertyGroup>
32+
<ItemGroup>
33+
<Reference Include="System" />
34+
<Reference Include="System.Core" />
35+
<Reference Include="System.Xml.Linq" />
36+
<Reference Include="Microsoft.CSharp" />
37+
<Reference Include="System.Xml" />
38+
<Reference Include="UnityEditor">
39+
<HintPath>..\Resources\UnityEditor.dll</HintPath>
40+
</Reference>
41+
<Reference Include="UnityEngine">
42+
<HintPath>..\Resources\UnityEngine.dll</HintPath>
43+
</Reference>
44+
</ItemGroup>
45+
<ItemGroup>
46+
<Compile Include="Properties\AssemblyInfo.cs" />
47+
<Compile Include="Scenes\SceneRefPropertyDrawer.cs" />
48+
</ItemGroup>
49+
<ItemGroup>
50+
<ProjectReference Include="..\SpacepuppyUnityFrameworkEditor\SpacepuppyUnityFrameworkEditor.csproj">
51+
<Project>{7fe0b8d6-ba29-43a6-b272-5d4f442fc4fa}</Project>
52+
<Name>SpacepuppyUnityFrameworkEditor</Name>
53+
</ProjectReference>
54+
<ProjectReference Include="..\SpacepuppyUnityFramework\SpacepuppyUnityFramework.csproj">
55+
<Project>{3b57db6b-ba67-46ad-b929-fdd8e6ae511e}</Project>
56+
<Name>SpacepuppyUnityFramework</Name>
57+
</ProjectReference>
58+
<ProjectReference Include="..\SPScenes\SPScenes.csproj">
59+
<Project>{3f77727e-5170-44a4-a3fa-3df77de6e2eb}</Project>
60+
<Name>SPScenes</Name>
61+
</ProjectReference>
62+
</ItemGroup>
63+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
64+
</Project>

0 commit comments

Comments
 (0)