Skip to content

Commit

Permalink
Updated to v0.41
Browse files Browse the repository at this point in the history
  • Loading branch information
MadLittleMods committed Aug 6, 2014
1 parent 998049f commit e88d9f8
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 63 deletions.
Binary file added Builds/Radius-v0.41-MacOSXx86.zip
Binary file not shown.
Binary file added Builds/Radius-v0.41-Windowsx86.zip
Binary file not shown.
6 changes: 4 additions & 2 deletions Radius/Assets/Prefabs/Player.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 400002}
m_RootOrder: 0
--- !u!4 &400002
Transform:
m_ObjectHideFlags: 1
Expand All @@ -60,6 +61,7 @@ Transform:
m_Children:
- {fileID: 400000}
m_Father: {fileID: 0}
m_RootOrder: 0
--- !u!23 &2300000
Renderer:
m_ObjectHideFlags: 1
Expand All @@ -78,9 +80,8 @@ Renderer:
m_UseLightProbes: 0
m_LightProbeAnchor: {fileID: 0}
m_ScaleInLightmap: 1
m_SortingLayer: 0
m_SortingOrder: 0
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!33 &3300000
MeshFilter:
m_ObjectHideFlags: 1
Expand Down Expand Up @@ -123,6 +124,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
objectsToChangeTeamColor:
- {fileID: 100000}
characterDriver: {fileID: 11400000}
--- !u!114 &11400004
MonoBehaviour:
m_ObjectHideFlags: 1
Expand Down
59 changes: 12 additions & 47 deletions Radius/Assets/Scripts/TerritoryController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,40 +35,21 @@ public TerritoryActivityEventArgs(Player player, TerritoryData tData)
}

public delegate void TerritoryCapturedEventHandler(MonoBehaviour sender, TerritoryActivityEventArgs e);
public event TerritoryCapturedEventHandler OnTerritoryCaptured;
public event TerritoryCapturedEventHandler OnTerritoryCaptured = delegate { };

public delegate void TerritoryLostEventHandler(MonoBehaviour sender, TerritoryActivityEventArgs e);
public event TerritoryLostEventHandler OnTerritoryLost;
public event TerritoryLostEventHandler OnTerritoryLost = delegate { };

public delegate void TerritoryUpdatedEventHandler(MonoBehaviour sender, TerritoryData tData);
public event TerritoryUpdatedEventHandler OnTerritoryUpdated;
public event TerritoryUpdatedEventHandler OnTerritoryUpdated = delegate { };

public delegate void TerritoryEnteredEventHandler(MonoBehaviour sender, TerritoryActivityEventArgs e);
public event TerritoryEnteredEventHandler OnTerritoryEntered;
public event TerritoryEnteredEventHandler OnTerritoryEntered = delegate { };

public delegate void TerritoryExitedEventHandler(MonoBehaviour sender, TerritoryActivityEventArgs e);
public event TerritoryExitedEventHandler OnTerritoryExited;
public event TerritoryExitedEventHandler OnTerritoryExited = delegate { };


// Use this to trigger the event
protected virtual void ThisTerritoryCaptured(MonoBehaviour sender, TerritoryActivityEventArgs e)
{
TerritoryCapturedEventHandler handler = OnTerritoryCaptured;
if(handler != null)
{
handler(sender, e);
}
}

// Use this to trigger the event
protected virtual void ThisTerritoryLost(MonoBehaviour sender, TerritoryActivityEventArgs e)
{
TerritoryLostEventHandler handler = OnTerritoryLost;
if(handler != null)
{
handler(sender, e);
}
}

// Use this to trigger the event
private float lastUpdateEventTime = 0f;
Expand All @@ -91,24 +72,8 @@ protected virtual void ThisTerritoryUpdated(MonoBehaviour sender, TerritoryData
}
}

// Use this to trigger the event
protected virtual void ThisTerritoryEntered(MonoBehaviour sender, TerritoryActivityEventArgs e)
{
TerritoryEnteredEventHandler handler = OnTerritoryEntered;
if(handler != null)
{
handler(sender, e);
}
}
// Use this to trigger the event
protected virtual void ThisTerritoryExited(MonoBehaviour sender, TerritoryActivityEventArgs e)
{
TerritoryExitedEventHandler handler = OnTerritoryExited;
if(handler != null)
{
handler(sender, e);
}
}




public ExposedTrigger territoryTrigger; // The territory
Expand Down Expand Up @@ -190,7 +155,7 @@ void HandleCapturing() {
tDataLocked.Color = new ColorData(this.LockedCaptureState.ThisTeamToColor()).ToDictionary();
tDataLocked.LockedColor = new ColorData(this.LockedCaptureState.ThisTeamToColor()).ToDictionary();
tDataLocked.TempColor = new ColorData(this.LockedCaptureState.ThisTeamToColor()).ToDictionary();
this.ThisTerritoryCaptured(this, new TerritoryActivityEventArgs(this.LockedCaptureState, tDataLocked));
this.OnTerritoryCaptured(this, new TerritoryActivityEventArgs(this.LockedCaptureState, tDataLocked));

}
}
Expand All @@ -210,13 +175,13 @@ void HandleCapturing() {
if(this.LockedCaptureState != this.playerCapturing)
{
// Fire the event
Debug.Log("ThisTerritoryLost");
Debug.Log("OnTerritoryLost");
TerritoryData tDataUnlocked = new TerritoryData();
tDataUnlocked.Progress = this.CaptureProgress;
tDataUnlocked.Color = new ColorData(Player.TeamToColor(Player.Team.None)).ToDictionary();
tDataUnlocked.LockedColor = new ColorData(Player.TeamToColor(Player.Team.None)).ToDictionary();
tDataUnlocked.TempColor = new ColorData(this.playerCapturing.ThisTeamToColor()).ToDictionary();
this.ThisTerritoryLost(this, new TerritoryActivityEventArgs(this.LockedCaptureState, tDataUnlocked));
this.OnTerritoryLost(this, new TerritoryActivityEventArgs(this.LockedCaptureState, tDataUnlocked));
}
}

Expand Down Expand Up @@ -357,7 +322,7 @@ void TerritoryEnter(ExposedTrigger sender, ExposedTrigger.TriggerActivityEventAr
tData.Color = new ColorData(this.LockedCaptureState ? this.LockedCaptureState.ThisTeamToColor() : Player.TeamToColor(Player.Team.None)).ToDictionary();
tData.LockedColor = new ColorData(this.LockedCaptureState ? this.LockedCaptureState.ThisTeamToColor() : Player.TeamToColor(Player.Team.None)).ToDictionary();
tData.TempColor = new ColorData(this.tempCaptureState ? this.tempCaptureState.ThisTeamToColor() : Player.TeamToColor(Player.Team.None)).ToDictionary();
this.ThisTerritoryEntered(this, new TerritoryActivityEventArgs(player, tData));
this.OnTerritoryEntered(this, new TerritoryActivityEventArgs(player, tData));
}

void TerritoryExit(ExposedTrigger sender, ExposedTrigger.TriggerActivityEventArgs e)
Expand All @@ -380,7 +345,7 @@ void TerritoryExit(ExposedTrigger sender, ExposedTrigger.TriggerActivityEventArg
tData.Color = new ColorData(this.LockedCaptureState ? this.LockedCaptureState.ThisTeamToColor() : Player.TeamToColor(Player.Team.None)).ToDictionary();
tData.LockedColor = new ColorData(this.LockedCaptureState ? this.LockedCaptureState.ThisTeamToColor() : Player.TeamToColor(Player.Team.None)).ToDictionary();
tData.TempColor = new ColorData(this.tempCaptureState ? this.tempCaptureState.ThisTeamToColor() : Player.TeamToColor(Player.Team.None)).ToDictionary();
this.ThisTerritoryExited(this, new TerritoryActivityEventArgs(player, tData));
this.OnTerritoryExited(this, new TerritoryActivityEventArgs(player, tData));
}

}
2 changes: 1 addition & 1 deletion Radius/Assets/Scripts/Trigger/AdditiveTrigger.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* Radius: Complete Unity Reference Project
*
* Source: https://github.com/MadLittleMods/Radius
Expand Down
2 changes: 1 addition & 1 deletion Radius/Assets/Scripts/Trigger/ComplexTrigger.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* Radius: Complete Unity Reference Project
*
* Source: https://github.com/MadLittleMods/Radius
Expand Down
7 changes: 4 additions & 3 deletions Radius/Assets/Scripts/Trigger/ExposedTrigger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ public TriggerActivityEventArgs(GameObject go)
}

public delegate void ThisTriggerEnterEventHandler(ExposedTrigger sender, TriggerActivityEventArgs e);
public event ThisTriggerEnterEventHandler OnThisTriggerEnter;
public event ThisTriggerEnterEventHandler OnThisTriggerEnter = delegate { };

public delegate void ThisTriggerExitEventHandler(ExposedTrigger sender, TriggerActivityEventArgs e);
public event ThisTriggerExitEventHandler OnThisTriggerExit;
public event ThisTriggerExitEventHandler OnThisTriggerExit = delegate { };


// Use this to trigger the event
protected virtual void ThisTriggerEnter(ExposedTrigger sender, TriggerActivityEventArgs e)
Expand All @@ -40,7 +41,7 @@ protected virtual void ThisTriggerEnter(ExposedTrigger sender, TriggerActivityEv
handler(sender, e);
}
}

// Use this to trigger the event
protected virtual void ThisTriggerExit(ExposedTrigger sender, TriggerActivityEventArgs e)
{
Expand Down
11 changes: 3 additions & 8 deletions Radius/Radius.userprefs
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
<Properties>
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" PreferredExecutionTarget="MonoDevelop.Default" />
<MonoDevelop.Ide.Workbench ActiveDocument="Assets\Scripts\Player\CharacterDriver.cs">
<MonoDevelop.Ide.Workbench ActiveDocument="Assets\Scripts\Player\Player.cs">
<Files>
<File FileName="Assets\Scripts\UI\ServerBrowserUI.cs" Line="183" Column="5" />
<File FileName="Assets\Scripts\Managers\GameManager.cs" Line="1" Column="1" />
<File FileName="Assets\Scripts\UI\InGameUI.cs" Line="1" Column="1" />
<File FileName="Assets\Scripts\Player\CharacterDriver.cs" Line="102" Column="24" />
<File FileName="Assets\Scripts\Player\Player.cs" Line="1" Column="1" />
<File FileName="Assets\Scripts\Managers\PlayerManager.cs" Line="1" Column="1" />
<File FileName="Assets\Scripts\CharacterState.cs" Line="47" Column="2" />
<File FileName="Assets\Scripts\Player\Player.cs" Line="208" Column="15" />
<File FileName="Assets\Scripts\Player\CharacterDriver.cs" Line="1" Column="1" />
</Files>
</MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.DebuggingService.Breakpoints>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<label for="time-limit-input-id">Time Limit (secs):</label>
</div>
<div class="bd">
<input type="number" name="time-limit" min="-1" value="-1" id="time-limit-input-id"><span id="time-limit-input-id-extra-info"></span>
<input type="number" name="time-limit" min="-1" value="150" id="time-limit-input-id"><span id="time-limit-input-id-extra-info"></span>
</div>
</div>

Expand Down

0 comments on commit e88d9f8

Please sign in to comment.