@@ -864,7 +864,7 @@ Transform:
- {fileID: 884391735}
- {fileID: 2114570208}
m_Father: {fileID: 0}
m_RootOrder: 6
m_RootOrder: 7
--- !u!1001 &175423985
Prefab:
m_ObjectHideFlags: 0
@@ -1384,7 +1384,7 @@ Transform:
m_LocalScale: {x: 3.47870564, y: 3.47870445, z: 3.47870445}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 8
m_RootOrder: 9
--- !u!1 &348429771
GameObject:
m_ObjectHideFlags: 0
@@ -1679,7 +1679,7 @@ Transform:
- {fileID: 1960330689}
- {fileID: 1347767284}
m_Father: {fileID: 0}
m_RootOrder: 4
m_RootOrder: 5
--- !u!1001 &519530852
Prefab:
m_ObjectHideFlags: 0
@@ -2028,7 +2028,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
m_RootOrder: 4
--- !u!114 &573677396
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -2569,7 +2569,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 7
m_RootOrder: 8
--- !u!1001 &798664525
Prefab:
m_ObjectHideFlags: 0
@@ -2791,6 +2791,10 @@ Prefab:
propertyPath: instantiationId
value: 1
objectReference: {fileID: 0}
- target: {fileID: 11481608, guid: 80b7e2133e0395549bec4392464d6b26, type: 2}
propertyPath: ObservedComponents.Array.data[0]
value:
objectReference: {fileID: 1974818796}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 80b7e2133e0395549bec4392464d6b26, type: 2}
m_IsPrefabParent: 0
@@ -3412,7 +3416,7 @@ RectTransform:
m_RootOrder: 1
m_AnchorMin: {x: .5, y: .5}
m_AnchorMax: {x: .5, y: .5}
m_AnchoredPosition: {x: -511, y: -229}
m_AnchoredPosition: {x: -365.200012, y: -147}
m_SizeDelta: {x: 25, y: 25}
m_Pivot: {x: .5, y: .5}
--- !u!114 &1014122763
@@ -4972,7 +4976,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_RootOrder: 3
--- !u!4 &1448823038 stripped
Transform:
m_PrefabParentObject: {fileID: 422668, guid: 13fe67fbcd0371141988bba0eb7b320b, type: 2}
@@ -5167,7 +5171,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_RootOrder: 2
--- !u!114 &1523349513
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -5941,11 +5945,11 @@ Prefab:
m_Modifications:
- target: {fileID: 401380, guid: 7f47d610bd87c4743bda57a383761ba4, type: 2}
propertyPath: m_LocalPosition.x
value: -73.5999985
value: -74.9899979
objectReference: {fileID: 0}
- target: {fileID: 401380, guid: 7f47d610bd87c4743bda57a383761ba4, type: 2}
propertyPath: m_LocalPosition.y
value: 21.2999992
value: 21.9400005
objectReference: {fileID: 0}
- target: {fileID: 401380, guid: 7f47d610bd87c4743bda57a383761ba4, type: 2}
propertyPath: m_LocalPosition.z
@@ -5961,15 +5965,27 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 401380, guid: 7f47d610bd87c4743bda57a383761ba4, type: 2}
propertyPath: m_LocalRotation.z
value: .344628364
value: -.00956299901
objectReference: {fileID: 0}
- target: {fileID: 401380, guid: 7f47d610bd87c4743bda57a383761ba4, type: 2}
propertyPath: m_LocalRotation.w
value: .93873924
value: .999954343
objectReference: {fileID: 0}
- target: {fileID: 401380, guid: 7f47d610bd87c4743bda57a383761ba4, type: 2}
propertyPath: m_RootOrder
value: 9
value: 0
objectReference: {fileID: 0}
- target: {fileID: 401380, guid: 7f47d610bd87c4743bda57a383761ba4, type: 2}
propertyPath: m_LocalScale.x
value: 3.49464655
objectReference: {fileID: 0}
- target: {fileID: 401380, guid: 7f47d610bd87c4743bda57a383761ba4, type: 2}
propertyPath: m_LocalScale.y
value: 3.49464464
objectReference: {fileID: 0}
- target: {fileID: 21291256, guid: 7f47d610bd87c4743bda57a383761ba4, type: 2}
propertyPath: m_SortingOrder
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 7f47d610bd87c4743bda57a383761ba4, type: 2}
@@ -6486,6 +6502,12 @@ Transform:
m_Children: []
m_Father: {fileID: 37765517}
m_RootOrder: 7
--- !u!114 &1974818796 stripped
MonoBehaviour:
m_PrefabParentObject: {fileID: 11483510, guid: 80b7e2133e0395549bec4392464d6b26,
type: 2}
m_PrefabInternal: {fileID: 862032211}
m_Script: {fileID: 11500000, guid: 061519c9f18c2b846b9ab81a6f65b72b, type: 3}
--- !u!1 &1984454409
GameObject:
m_ObjectHideFlags: 0
@@ -6767,7 +6789,7 @@ Transform:
m_LocalScale: {x: 3.50329542, y: 3.50329542, z: 3.50329542}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 12
m_RootOrder: 13
--- !u!1 &2077712665
GameObject:
m_ObjectHideFlags: 0
@@ -6907,7 +6929,7 @@ RectTransform:
- {fileID: 37765517}
- {fileID: 1014122762}
m_Father: {fileID: 0}
m_RootOrder: 5
m_RootOrder: 6
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
@@ -44,8 +44,10 @@ public class Item : MonoBehaviour
[HideInInspector]
public UseItem UseFunc;
[HideInInspector]
public Vector3 Offset;
[HideInInspector]
public Vector3 posOffset;
[HideInInspector]
public Quaternion rotOffset;
[HideInInspector]
public Vector3 OriginalScale;
[HideInInspector]
public bool isBeingUsed;
@@ -71,7 +73,8 @@ void Start ()
switch(Name)
{
case "Shotgun":
Offset = new Vector3(-0.5599827f,-2.499903f,0);
posOffset = new Vector3(-0.5599827f,-1.499903f,0);
rotOffset = Quaternion.Euler(0, 0, 0);
UseFunc = FireShotgun;
break;
}
@@ -80,7 +83,8 @@ void Start ()
switch(Name)
{
case "Katana":
Offset = new Vector3(2.83f, -0.3200116f, 0);
posOffset = new Vector3(2.83f, -0.3200116f, 0);
rotOffset = Quaternion.Euler(0, 0, 0);
UseFunc = SwingSword;
break;
}
@@ -0,0 +1,72 @@
using UnityEngine;
using System.Collections;
using System;

public class NetworkTank : Photon.MonoBehaviour {

private Transform realBodyTransform;
private Transform realMainTurretTransform;
private Transform realSmallTurretTransform;

public Transform mainTurret;
public Transform smallTurret;
private Animator animator;
// Use this for initialization
void Start()
{
animator = GetComponent<Animator>();
realBodyTransform = this.transform;
realMainTurretTransform = this.mainTurret;
realSmallTurretTransform = this.smallTurret;
}

// Update is called once per frame
void Update()
{
if (photonView.isMine)
{
//do nothing
}
else
{
this.transform.position = Vector3.Lerp(this.transform.position, realBodyTransform.position, .2f);
this.transform.rotation = Quaternion.Lerp(this.transform.rotation, realBodyTransform.rotation, .2f);
mainTurret.rotation = Quaternion.Lerp(mainTurret.rotation, realMainTurretTransform.rotation, .2f);
smallTurret.rotation = Quaternion.Lerp(mainTurret.rotation, realSmallTurretTransform.rotation, .2f);
}
}

void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
{
if (stream.isWriting)
{
try
{
//this is our player. we need to send our actual position to the network
stream.SendNext(transform.position);
stream.SendNext(transform.rotation);
stream.SendNext(mainTurret.rotation);
stream.SendNext(smallTurret.rotation);
}
catch (NullReferenceException e)
{
Debug.LogError("Failed to send data");
}
}
else
{
try
{
//this is someone elses player. We need to recieve their position and update our version of that player
realBodyTransform.position = (Vector3)stream.ReceiveNext();
realBodyTransform.rotation = (Quaternion)stream.ReceiveNext();
realMainTurretTransform.rotation = (Quaternion)stream.ReceiveNext();
realSmallTurretTransform.rotation = (Quaternion)stream.ReceiveNext();
}
catch (NullReferenceException e)
{
Debug.LogError("Failed to recieve data");
}
}
}
}
@@ -107,8 +107,9 @@ void AssignItem(GameObject item)
Current.GetComponent<Item>().HasUser = true;
Current.GetComponent<Rigidbody2D>().fixedAngle = true;
Current.GetComponent<Transform>().rotation = /*Current.GetComponent<Item>().SetTran.rotation +*/ ArmNear.transform.rotation;
Current.transform.localPosition = Current.GetComponent<Item>().Offset;
}
Current.transform.localPosition = Current.GetComponent<Item>().posOffset;
Current.transform.rotation = Current.GetComponent<Item>().rotOffset;
}

void OnCollisionEnter2D(Collision2D c)
{
@@ -140,7 +140,7 @@ void UpdateBasicMovementInput()
//Change speed of animation based on speed
animator.speed = currentRunSpeed / regSpeed;
}

public void PlayerInVehicle(GameObject vehicle)
{
//tell player he is in tank and set things on and off depending on what needs to be
@@ -159,7 +159,7 @@ public void PlayerInVehicle(GameObject vehicle)
transform.localPosition = vehicle.GetComponentInParent<TankMovement>().playerInTankOffset;
transform.rotation = vehicle.transform.rotation;
}

public void PlayerOutVehicle()//GameObject vehicle
{
//tell player he is out of tank and set things on and off depending on what needs to be
@@ -1,7 +1,7 @@
using UnityEngine;
using System.Collections;

public class TankMovement : MonoBehaviour {
public class TankMovement : Photon.MonoBehaviour {

public bool xAxisEnabled = false;
public bool yAxisEnabled = false;
@@ -53,10 +53,12 @@ void Update ()
}
}

void NewDriver(GameObject player)
[RPC]
void NewDriver(string player)
{
tankIsManned = true;
player.GetComponentInParent<PlayerMovement>().PlayerInVehicle(transform.GetChild(0).gameObject);
GameObject newDriver = GameObject.Find(player);
newDriver.GetComponentInParent<PlayerMovement>().PlayerInVehicle(transform.GetChild(0).gameObject);
}

void OnGUI()
@@ -77,7 +79,8 @@ void OnTriggerStay2D(Collider2D col)
{
if (col.gameObject.GetComponentInParent<PlayerMovement>().currPlayerState != PlayerState.InTank)
{
NewDriver(col.gameObject);
NewDriver(col.gameObject.name);
//photonView.RPC("NewDriver", PhotonTargets.All, col.gameObject.name);
}
}
}
@@ -6,6 +6,7 @@ public class TankShoot : MonoBehaviour {
public Transform shellSpawn;
public float shellSpeed;
public ParticleSystem shootExplosion;
public GameObject tankShell;
public GameObject mainCannon;//need this so you can turn on the mouse follow script
public GameObject smallCannon;//need this so you can turn on the mouse follow script

@@ -23,30 +24,17 @@ void Update ()
{
if(Input.GetButtonDown("Fire1"))
{
ShootShell();
this.GetComponent<PhotonView>().RPC("ShootShell", PhotonTargets.All);
}
else if(Input.GetButtonDown("Fire2"))
{
ShootTurret();
}
}

[RPC]
void ShootShell()
{
GameObject shell= (GameObject) PhotonNetwork.Instantiate("Tank_Shell", shellSpawn.position, shellSpawn.rotation,0);
shell.GetComponent<Rigidbody2D>().AddForce(shellSpawn.right * shellSpeed);
ParticleSystem part= (ParticleSystem) Instantiate(shootExplosion, shellSpawn.position, shellSpawn.rotation);
part.transform.SetParent(shellSpawn);
part.Play();
GameObject shell = (GameObject)Instantiate(tankShell, shellSpawn.position, shellSpawn.rotation);
shell.GetComponent<Rigidbody2D>().AddForce(shellSpawn.right * shellSpeed);
ParticleSystem part = (ParticleSystem)Instantiate(shootExplosion, shellSpawn.position, shellSpawn.rotation);
part.transform.SetParent(shellSpawn);
part.Play();
}

void ShootTurret()
{
GameObject.Destroy((GameObject)GameObject.Instantiate(muzzleFlash, this.turretSpawn.position, Quaternion.identity), 1f);

GameObject bull = (GameObject)PhotonNetwork.Instantiate("Bullet", this.turretSpawn.position, turretSpawn.rotation, 0);
bull.GetComponent<Bullet> ().Damage = this.turretDamage;
bull.GetComponent<Rigidbody2D>().velocity = new Vector3(turretSpawn.right.x, turretSpawn.right.y, turretSpawn.right.z);
bull.GetComponent<Rigidbody2D>().velocity *= 60;
}
}
Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
@@ -16,63 +16,61 @@ Platform assembly: C:\Users\Thomas\Documents\GitHub\RobbyWillyRepo\MiniGame\Buil
Loading C:\Users\Thomas\Documents\GitHub\RobbyWillyRepo\MiniGame\Builds\alpha_1.0.2_Data\Managed\UnityEngine.UI.dll into Unity Child Domain
Platform assembly: C:\Users\Thomas\Documents\GitHub\RobbyWillyRepo\MiniGame\Builds\alpha_1.0.2_Data\Managed\Photon3Unity3D.dll (this message is harmless)
Loading C:\Users\Thomas\Documents\GitHub\RobbyWillyRepo\MiniGame\Builds\alpha_1.0.2_Data\Managed\Photon3Unity3D.dll into Unity Child Domain
- Completed reload, in 0.126 seconds
- Completed reload, in 0.138 seconds
desktop: 1920x1080 60Hz; virtual: 4800x1350 at 0,0
<RI> Initializing input.
<RI> Input initialized.
<RI> Initialized touch support.
Platform assembly: C:\Users\Thomas\Documents\GitHub\RobbyWillyRepo\MiniGame\Builds\alpha_1.0.2_Data\Managed\System.Core.dll (this message is harmless)
Platform assembly: C:\Users\Thomas\Documents\GitHub\RobbyWillyRepo\MiniGame\Builds\alpha_1.0.2_Data\Managed\System.dll (this message is harmless)
Unloading 4 Unused Serialized files (Serialized files now loaded: 0)
UnloadTime: 3.795574 ms
UnloadTime: 3.272148 ms
HDR and MultisampleAntiAliasing (in Forward Rendering Path) is not supported. This camera will render without HDR buffers. Disable Antialiasing in the Quality settings if you want to use HDR.

(Filename: Line: 2630)


Unloading 5 unused Assets to reduce memory usage. Loaded Objects now: 953.
Total: 0.583173 ms (FindLiveObjects: 0.104098 ms CreateObjectMapping: 0.052049 ms MarkObjects: 0.413829 ms DeleteObjects: 0.012462 ms)
Unloading 5 unused Assets to reduce memory usage. Loaded Objects now: 971.
Total: 0.402100 ms (FindLiveObjects: 0.087604 ms CreateObjectMapping: 0.029690 ms MarkObjects: 0.274542 ms DeleteObjects: 0.009530 ms)

Setting up 2 worker threads for Enlighten.
Thread -> id: 7388 -> priority: 1
Thread -> id: 7884 -> priority: 1
Thread -> id: 88f0 -> priority: 1
Thread -> id: 8830 -> priority: 1
Joined lobby

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebug.gen.cpp Line: 56)

Joined room

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebug.gen.cpp Line: 56)

Failed to send data
Joined lobby failed

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebug.gen.cpp Line: 56)

HIT

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebug.gen.cpp Line: 56)

HIT

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebug.gen.cpp Line: 56)

HIT

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebug.gen.cpp Line: 56)

HIT

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebug.gen.cpp Line: 56)

HIT
Joined room

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebug.gen.cpp Line: 56)

HIT
ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
at System.Collections.Generic.List`1[System.Object].get_Item (Int32 index) [0x00000] in <filename unknown>:0
at PhotonStream.ReceiveNext () [0x00000] in <filename unknown>:0
at NetworkCharacter.OnPhotonSerializeView (.PhotonStream stream, .PhotonMessageInfo info) [0x00000] in <filename unknown>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0
at PhotonView.ExecuteComponentOnSerialize (UnityEngine.Component component, .PhotonStream stream, .PhotonMessageInfo info) [0x00000] in <filename unknown>:0
at PhotonView.DeserializeComponent (UnityEngine.Component component, .PhotonStream stream, .PhotonMessageInfo info) [0x00000] in <filename unknown>:0
at PhotonView.DeserializeView (.PhotonStream stream, .PhotonMessageInfo info) [0x00000] in <filename unknown>:0
at NetworkingPeer.OnSerializeRead (ExitGames.Client.Photon.Hashtable data, .PhotonPlayer sender, Int32 networkTime, Int16 correctPrefix) [0x00000] in <filename unknown>:0
at NetworkingPeer.OnEvent (ExitGames.Client.Photon.EventData photonEvent) [0x00000] in <filename unknown>:0
at ExitGames.Client.Photon.PeerBase.DeserializeMessageAndCallback (System.Byte[] inBuff) [0x00000] in <filename unknown>:0
at ExitGames.Client.Photon.EnetPeer.DispatchIncomingCommands () [0x00000] in <filename unknown>:0
at ExitGames.Client.Photon.PhotonPeer.DispatchIncomingCommands () [0x00000] in <filename unknown>:0
at PhotonHandler.Update () [0x00000] in <filename unknown>:0

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebug.gen.cpp Line: 56)
(Filename: Line: -1)

HIT
Failed to 'network-remove' GameObject. Client is neither owner nor masterClient taking over for owner who left: View (0)2001 on Bandit(Clone)

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebug.gen.cpp Line: 56)

Binary file not shown.
Binary file not shown.
Binary file not shown.