-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
876 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2015 ParkitectNexus | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{FA17F423-2365-4230-88E5-BD736956F809}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<NoStandardLibraries>false</NoStandardLibraries> | ||
<AssemblyName>ClassLibrary</AssemblyName> | ||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<RootNamespace>Custom_Scenery</RootNamespace> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="Assembly-CSharp"> | ||
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Parkitect\Parkitect_Data\Managed\Assembly-CSharp.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Depender"> | ||
<HintPath>..\Depender\bin\Depender.dll</HintPath> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="System.Xml" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="UnityEngine"> | ||
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Parkitect\Parkitect_Data\Managed\UnityEngine.dll</HintPath> | ||
</Reference> | ||
<Reference Include="UnityEngine.UI"> | ||
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Parkitect\Parkitect_Data\Managed\UnityEngine.UI.dll</HintPath> | ||
</Reference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Content Include=".gitignore" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="mod.json" /> | ||
<None Include="README.md" /> | ||
<None Include="scenery.json" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="ModSparkLoader\FlatRideLoader.cs" /> | ||
<Compile Include="ModSparkLoader\Main.cs" /> | ||
<Compile Include="ModSparkLoader\ModLoader.cs" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSHARP.Targets" /> | ||
<ProjectExtensions> | ||
<VisualStudio AllowExistingFolder="true" /> | ||
</ProjectExtensions> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 14 | ||
VisualStudioVersion = 14.0.23107.0 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModSparkLoader", "ModSparkLoader.csproj", "{FA17F423-2365-4230-88E5-BD736956F809}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{FA17F423-2365-4230-88E5-BD736956F809}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{FA17F423-2365-4230-88E5-BD736956F809}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{FA17F423-2365-4230-88E5-BD736956F809}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{FA17F423-2365-4230-88E5-BD736956F809}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,173 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Xml; | ||
using System.Xml.Linq; | ||
using Depender.Types.FlatRides; | ||
using Depender.AnimationMotors; | ||
using Depender.AnimationEvents; | ||
|
||
public class FlatRideLoader | ||
{ | ||
public static List<motor> LoadMotors(XmlNode ObjNode, GameObject GO) | ||
{ | ||
List<motor> motors = new List<motor>(); | ||
|
||
foreach (XmlNode motorN in ObjNode.SelectSingleNode("Animation/motors").ChildNodes) | ||
{ | ||
switch (motorN.Name) | ||
{ | ||
|
||
case "Rotator": | ||
RotatorHP R = GO.AddComponent<RotatorHP>(); | ||
R.Identifier = motorN["Identifier"].InnerText; | ||
R.axisPath = motorN["axis"].InnerText; | ||
R.axis = GO.transform.FindChild(motorN["axis"].InnerText); | ||
R.maxSpeed = float.Parse(motorN["maxSpeed"].InnerText); | ||
R.accelerationSpeed = float.Parse(motorN["accelerationSpeed"].InnerText); | ||
R.rotationAxis = getVector3(motorN["rotationAxis"].InnerText); | ||
motors.Add(R); | ||
break; | ||
case "RotateBetween": | ||
RotateBetweenHP RB = GO.AddComponent<RotateBetweenHP>(); | ||
RB.Identifier = motorN["Identifier"].InnerText; | ||
RB.axisPath = motorN["axis"].InnerText; | ||
RB.axis = GO.transform.FindChild(motorN["axis"].InnerText); | ||
RB.rotationAxis = getVector3(motorN["rotationAxis"].InnerText); | ||
RB.duration = float.Parse(motorN["duration"].InnerText); | ||
motors.Add(RB); | ||
break; | ||
case "Mover": | ||
MoverHP M = GO.AddComponent<MoverHP>(); | ||
M.Identifier = motorN["Identifier"].InnerText; | ||
M.axisPath = motorN["axis"].InnerText; | ||
M.axis = GO.transform.FindChild(motorN["axis"].InnerText); | ||
M.toPosition = getVector3(motorN["toPosition"].InnerText); | ||
M.duration = float.Parse(motorN["duration"].InnerText); | ||
motors.Add(M); | ||
break; | ||
case "MultipleRotations": | ||
MultipleRotationsHP MR = GO.AddComponent<MultipleRotationsHP>(); | ||
MR.Identifier = motorN["Identifier"].InnerText; | ||
MR.axisPath = motorN["MainAxis"].InnerText; | ||
XmlNodeList axisNs = motorN.SelectNodes("axis"); | ||
foreach (XmlNode axisN in axisNs) | ||
{ | ||
MR.AxissPath.Add(axisN.InnerText); | ||
} | ||
motors.Add(MR); | ||
break; | ||
case "PendulumRotator": | ||
PendulumRotatorHP PR = GO.AddComponent<PendulumRotatorHP>(); | ||
PR.Identifier = motorN["Identifier"].InnerText; | ||
PR.axisPath = motorN["axis"].InnerText; | ||
PR.axis = GO.transform.FindChild(motorN["axis"].InnerText); | ||
PR.maxSpeed = float.Parse(motorN["maxSpeed"].InnerText); | ||
PR.accelerationSpeed = float.Parse(motorN["accelerationSpeed"].InnerText); | ||
PR.rotationAxis = getVector3(motorN["rotationAxis"].InnerText); | ||
PR.angularFriction = float.Parse(motorN["angularFriction"].InnerText); | ||
PR.gravity = float.Parse(motorN["gravity"].InnerText); | ||
PR.pendulum = Boolean.Parse(motorN["pendulum"].InnerText); | ||
PR.armLength = float.Parse(motorN["armLength"].InnerText); | ||
motors.Add(PR); | ||
break; | ||
|
||
} | ||
} | ||
|
||
return motors; | ||
throw new NotImplementedException(); | ||
} | ||
public static List<Phase> LoadPhases(XmlNode ObjNode, GameObject GO) | ||
{ | ||
List<Phase> Phases = new List<Phase>(); | ||
|
||
foreach (XmlNode PhaseN in ObjNode.SelectSingleNode("Animation/phases").ChildNodes) | ||
{ | ||
|
||
Phase phase = GO.AddComponent<Phase>(); | ||
foreach (XmlNode EventN in PhaseN.SelectSingleNode("events").ChildNodes) | ||
{ | ||
switch (EventN.Name) | ||
{ | ||
case "Wait": | ||
Wait W = GO.AddComponent<Wait>(); | ||
W.seconds = float.Parse(EventN["Seconds"].InnerText); | ||
phase.Events.Add(W); | ||
break; | ||
case "StartRotator": | ||
StartRotator SR = GO.AddComponent<StartRotator>(); | ||
SR.identifierMotor = EventN["Identifier"].InnerText; | ||
phase.Events.Add(SR); | ||
break; | ||
case "SpinRotator": | ||
SpinRotater SpR = GO.AddComponent<SpinRotater>(); | ||
SpR.identifierMotor = EventN["Identifier"].InnerText; | ||
SpR.spin = Boolean.Parse(EventN["spin"].InnerText); | ||
SpR.spins = float.Parse(EventN["spins"].InnerText); | ||
phase.Events.Add(SpR); | ||
break; | ||
case "StopRotator": | ||
StopRotator StR = GO.AddComponent<StopRotator>(); | ||
StR.identifierMotor = EventN["Identifier"].InnerText; | ||
phase.Events.Add(StR); | ||
break; | ||
case "FromToRot": | ||
FromToRot FTR = GO.AddComponent<FromToRot>(); | ||
FTR.identifierMotor = EventN["Identifier"].InnerText; | ||
phase.Events.Add(FTR); | ||
break; | ||
case "ToFromRot": | ||
ToFromRot TFR = GO.AddComponent<ToFromRot>(); | ||
TFR.identifierMotor = EventN["Identifier"].InnerText; | ||
phase.Events.Add(TFR); | ||
break; | ||
case "FromToMove": | ||
FromToMove FTM = GO.AddComponent<FromToMove>(); | ||
FTM.identifierMotor = EventN["Identifier"].InnerText; | ||
phase.Events.Add(FTM); | ||
break; | ||
case "ToFromMove": | ||
ToFromMove TFM = GO.AddComponent<ToFromMove>(); | ||
TFM.identifierMotor = EventN["Identifier"].InnerText; | ||
phase.Events.Add(TFM); | ||
break; | ||
case "ApplyRotation": | ||
ApplyRotation AR = GO.AddComponent<ApplyRotation>(); | ||
AR.identifierMotor = EventN["Identifier"].InnerText; | ||
phase.Events.Add(AR); | ||
break; | ||
case "ChangePendulum": | ||
ChangePendulum CP = GO.AddComponent<ChangePendulum>(); | ||
CP.identifierMotor = EventN["Identifier"].InnerText; | ||
CP.Friction = float.Parse(EventN["Friction"].InnerText); | ||
CP.Pendulum = Boolean.Parse(EventN["Pendulum"].InnerText); | ||
phase.Events.Add(CP); | ||
break; | ||
default: | ||
Debug.Log("Couln't detect the right event called: " + EventN.Name); | ||
break; | ||
|
||
} | ||
} | ||
|
||
Phases.Add(phase); | ||
} | ||
return Phases; | ||
|
||
throw new NotImplementedException(); | ||
} | ||
|
||
public static Vector3 getVector3(string rString) | ||
{ | ||
string[] temp = rString.Substring(1, rString.Length - 2).Split(','); | ||
float x = float.Parse(temp[0]); | ||
float y = float.Parse(temp[1]); | ||
float z = float.Parse(temp[2]); | ||
Vector3 rValue = new Vector3(x, y, z); | ||
return rValue; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using Depender; | ||
using UnityEngine; | ||
|
||
namespace Custom_Scenery | ||
{ | ||
public class Main : IMod | ||
{ | ||
private GameObject _go; | ||
string name = "Could not load name"; | ||
string description = "Could not load description"; | ||
public void onEnabled() | ||
{ | ||
_go = new GameObject(); | ||
|
||
_go.AddComponent<ModLoader>(); | ||
|
||
_go.GetComponent<ModLoader>().Path = Path; | ||
|
||
_go.GetComponent<ModLoader>().Identifier = Identifier; | ||
|
||
_go.GetComponent<ModLoader>().LoadScenery(); | ||
|
||
name = _go.GetComponent<ModLoader>().modName; | ||
|
||
description = _go.GetComponent<ModLoader>().modDiscription; | ||
} | ||
|
||
public void onDisabled() | ||
{ | ||
Registar.UnRegister(); | ||
Object.Destroy(_go); | ||
} | ||
|
||
public string Name { get { return name; } } | ||
public string Description { get { return description; } } | ||
public string Path { get; set; } | ||
public string Identifier { get; set; } | ||
} | ||
} |
Oops, something went wrong.