Browse Source

Fix prefab + script issue for inground trap

clean testing code + comments
Josh_Dev_branch
Claire Peta 5 years ago
parent
commit
35798a69d2
9 changed files with 45 additions and 89 deletions
  1. +33
    -33
      Assets/Prefabs/Traps/InGroundTrap.prefab
  2. +3
    -4
      Assets/Scripts/Traps/CannonShot.cs
  3. +3
    -8
      Assets/Scripts/Traps/ConveyorBelt.cs
  4. +0
    -11
      Assets/Scripts/Traps/CrushingBoulder.cs
  5. +1
    -11
      Assets/Scripts/Traps/CubeWithCrystals.cs
  6. +1
    -11
      Assets/Scripts/Traps/FloatingOnWater.cs
  7. +1
    -1
      Assets/Scripts/Traps/InGroundTrap.cs
  8. +1
    -1
      Assets/Scripts/Traps/InGroundTrap.cs.meta
  9. +2
    -9
      Assets/Scripts/Traps/ShootingCannon.cs

+ 33
- 33
Assets/Prefabs/Traps/InGroundTrap.prefab View File

@ -45,7 +45,7 @@ MonoBehaviour:
m_GameObject: {fileID: 3281312547625224785} m_GameObject: {fileID: 3281312547625224785}
m_Enabled: 1 m_Enabled: 1
m_EditorHideFlags: 0 m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 90d16cd20b1d52149ae6b3d4c15c79db, type: 3}
m_Script: {fileID: 11500000, guid: a1b0e7f03e96f154cb9c6ecd542406b7, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
--- !u!1001 &1063799847781320221 --- !u!1001 &1063799847781320221
@ -128,10 +128,6 @@ PrefabInstance:
m_Modification: m_Modification:
m_TransformParent: {fileID: 3280778023726093299} m_TransformParent: {fileID: 3280778023726093299}
m_Modifications: m_Modifications:
- target: {fileID: 1989401929107402, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3}
propertyPath: m_Name
value: FanceWooden2 (4)
objectReference: {fileID: 0}
- target: {fileID: 4004810153341632, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3} - target: {fileID: 4004810153341632, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
value: 0 value: 0
@ -176,6 +172,10 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 180 value: 180
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1989401929107402, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3}
propertyPath: m_Name
value: FanceWooden2 (4)
objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3}
--- !u!1001 &3281312546064687605 --- !u!1001 &3281312546064687605
@ -185,10 +185,6 @@ PrefabInstance:
m_Modification: m_Modification:
m_TransformParent: {fileID: 3281312547625224782} m_TransformParent: {fileID: 3281312547625224782}
m_Modifications: m_Modifications:
- target: {fileID: 1989401929107402, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3}
propertyPath: m_Name
value: FanceWooden2 (3)
objectReference: {fileID: 0}
- target: {fileID: 4004810153341632, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3} - target: {fileID: 4004810153341632, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
value: 0 value: 0
@ -237,6 +233,10 @@ PrefabInstance:
propertyPath: m_LocalScale.x propertyPath: m_LocalScale.x
value: 0.9 value: 0.9
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1989401929107402, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3}
propertyPath: m_Name
value: FanceWooden2 (3)
objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3}
--- !u!4 &3280778022459986741 stripped --- !u!4 &3280778022459986741 stripped
@ -252,10 +252,6 @@ PrefabInstance:
m_Modification: m_Modification:
m_TransformParent: {fileID: 3280778023471378434} m_TransformParent: {fileID: 3280778023471378434}
m_Modifications: m_Modifications:
- target: {fileID: 1989401929107402, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3}
propertyPath: m_Name
value: FanceWooden2 (4)
objectReference: {fileID: 0}
- target: {fileID: 4004810153341632, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3} - target: {fileID: 4004810153341632, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
value: 0 value: 0
@ -300,6 +296,10 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 180 value: 180
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1989401929107402, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3}
propertyPath: m_Name
value: FanceWooden2 (4)
objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3}
--- !u!1001 &3281312547073059897 --- !u!1001 &3281312547073059897
@ -309,10 +309,6 @@ PrefabInstance:
m_Modification: m_Modification:
m_TransformParent: {fileID: 3280778023765625369} m_TransformParent: {fileID: 3280778023765625369}
m_Modifications: m_Modifications:
- target: {fileID: 1989401929107402, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3}
propertyPath: m_Name
value: FanceWooden2 (4)
objectReference: {fileID: 0}
- target: {fileID: 4004810153341632, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3} - target: {fileID: 4004810153341632, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
value: 0 value: 0
@ -357,6 +353,10 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 180 value: 180
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1989401929107402, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3}
propertyPath: m_Name
value: FanceWooden2 (4)
objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3}
--- !u!1001 &3281312547210150594 --- !u!1001 &3281312547210150594
@ -366,10 +366,6 @@ PrefabInstance:
m_Modification: m_Modification:
m_TransformParent: {fileID: 3281312547625224782} m_TransformParent: {fileID: 3281312547625224782}
m_Modifications: m_Modifications:
- target: {fileID: 1989401929107402, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3}
propertyPath: m_Name
value: FanceWooden2 (4)
objectReference: {fileID: 0}
- target: {fileID: 4004810153341632, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3} - target: {fileID: 4004810153341632, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
value: -0.4 value: -0.4
@ -418,6 +414,10 @@ PrefabInstance:
propertyPath: m_LocalScale.x propertyPath: m_LocalScale.x
value: 0.90000045 value: 0.90000045
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1989401929107402, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3}
propertyPath: m_Name
value: FanceWooden2 (4)
objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3}
--- !u!4 &3280778023471378434 stripped --- !u!4 &3280778023471378434 stripped
@ -433,10 +433,6 @@ PrefabInstance:
m_Modification: m_Modification:
m_TransformParent: {fileID: 3280778022459986741} m_TransformParent: {fileID: 3280778022459986741}
m_Modifications: m_Modifications:
- target: {fileID: 1989401929107402, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3}
propertyPath: m_Name
value: FanceWooden2 (4)
objectReference: {fileID: 0}
- target: {fileID: 4004810153341632, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3} - target: {fileID: 4004810153341632, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
value: 0 value: 0
@ -481,6 +477,10 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 180 value: 180
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1989401929107402, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3}
propertyPath: m_Name
value: FanceWooden2 (4)
objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3}
--- !u!1001 &3281312547451467993 --- !u!1001 &3281312547451467993
@ -490,10 +490,6 @@ PrefabInstance:
m_Modification: m_Modification:
m_TransformParent: {fileID: 3281312547625224782} m_TransformParent: {fileID: 3281312547625224782}
m_Modifications: m_Modifications:
- target: {fileID: 1989401929107402, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3}
propertyPath: m_Name
value: FanceWooden2 (1)
objectReference: {fileID: 0}
- target: {fileID: 4004810153341632, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3} - target: {fileID: 4004810153341632, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
value: 0 value: 0
@ -542,6 +538,10 @@ PrefabInstance:
propertyPath: m_LocalScale.x propertyPath: m_LocalScale.x
value: 0.9 value: 0.9
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1989401929107402, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3}
propertyPath: m_Name
value: FanceWooden2 (1)
objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3}
--- !u!4 &3280778023765625369 stripped --- !u!4 &3280778023765625369 stripped
@ -557,10 +557,6 @@ PrefabInstance:
m_Modification: m_Modification:
m_TransformParent: {fileID: 3281312547625224782} m_TransformParent: {fileID: 3281312547625224782}
m_Modifications: m_Modifications:
- target: {fileID: 1989401929107402, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3}
propertyPath: m_Name
value: FanceWooden2 (2)
objectReference: {fileID: 0}
- target: {fileID: 4004810153341632, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3} - target: {fileID: 4004810153341632, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
value: 0.4 value: 0.4
@ -609,6 +605,10 @@ PrefabInstance:
propertyPath: m_LocalScale.x propertyPath: m_LocalScale.x
value: 0.90000045 value: 0.90000045
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1989401929107402, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3}
propertyPath: m_Name
value: FanceWooden2 (2)
objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 0247930279caa4341ab23ddd2d4b69f8, type: 3}
--- !u!4 &3280778023726093299 stripped --- !u!4 &3280778023726093299 stripped

+ 3
- 4
Assets/Scripts/Traps/CannonShot.cs View File

@ -8,18 +8,17 @@ public class CannonShot : MonoBehaviour
public bool shootingRight; public bool shootingRight;
public ConnectedClients clientData; public ConnectedClients clientData;
GameObject player; GameObject player;
string charname = "Character";
string charname;
public List<string> Names; public List<string> Names;
Rigidbody rb; Rigidbody rb;
private void Start() private void Start()
{ {
Names.Add("Character");
rb = this.gameObject.GetComponent<Rigidbody>(); rb = this.gameObject.GetComponent<Rigidbody>();
/*for (int i = 0; i < clientData.AllClients.Count; i++)
for (int i = 0; i < clientData.AllClients.Count; i++)
{ {
Names.Add(clientData.AllClients[i].characterAnimal + "(Clone)"); Names.Add(clientData.AllClients[i].characterAnimal + "(Clone)");
}*/
}
} }
IEnumerator PushLeftCoroutine(float time) IEnumerator PushLeftCoroutine(float time)

+ 3
- 8
Assets/Scripts/Traps/ConveyorBelt.cs View File

@ -9,7 +9,7 @@ public class ConveyorBelt : MonoBehaviour
public ClientList clientData; public ClientList clientData;
bool characterOnBelt = false; bool characterOnBelt = false;
GameObject player; GameObject player;
string charname = "Character";
string charname;
public List<string> Names = new List<string>(); public List<string> Names = new List<string>();
public bool left; public bool left;
public bool forward; public bool forward;
@ -26,12 +26,7 @@ public class ConveyorBelt : MonoBehaviour
private void Update() private void Update()
{ {
//for testing purposes
if (triggeranimate == true)
{
Animate();
triggeranimate = false;
}
} }
@ -59,7 +54,7 @@ public class ConveyorBelt : MonoBehaviour
{ {
player.GetComponent<Character>().conveyorMoveBackward(Direction.Back, 1.0f); player.GetComponent<Character>().conveyorMoveBackward(Direction.Back, 1.0f);
} }
else if (left == true)
if (left == true)
{ {
player.GetComponent<Character>().conveyorMoveLeft(Direction.Left, 1.0f); player.GetComponent<Character>().conveyorMoveLeft(Direction.Left, 1.0f);
} }

+ 0
- 11
Assets/Scripts/Traps/CrushingBoulder.cs View File

@ -18,17 +18,6 @@ public class CrushingBoulder : MonoBehaviour
private void Update() private void Update()
{ {
counter.text = countdown.ToString(); counter.text = countdown.ToString();
//for testing purposes
if (triggeranimate == true)
{
Animate();
triggeranimate = false;
}
if (triggeranimate1 == true)
{
returnToPosition();
triggeranimate1 = false;
}
} }
IEnumerator FallRaiseCoroutine(float dropDistance) IEnumerator FallRaiseCoroutine(float dropDistance)

+ 1
- 11
Assets/Scripts/Traps/CubeWithCrystals.cs View File

@ -10,17 +10,7 @@ public class CubeWithCrystals : MonoBehaviour
private void Update() private void Update()
{ {
//for testing purposes
if (triggeranimate == true)
{
Animate();
triggeranimate = false;
}
if (triggeranimate1 == true)
{
returnToPosition();
triggeranimate1 = false;
}
} }
IEnumerator GrowCoroutine() IEnumerator GrowCoroutine()

+ 1
- 11
Assets/Scripts/Traps/FloatingOnWater.cs View File

@ -16,17 +16,7 @@ public class FloatingOnWater : MonoBehaviour
private void Update() private void Update()
{ {
//for testing purposes
if (triggeranimate == true)
{
Animate();
triggeranimate = false;
}
if (triggeranimate1 == true)
{
returnToPosition();
triggeranimate1 = false;
}
} }
private void Start() private void Start()

+ 1
- 1
Assets/Scripts/Traps/InGroundTrap.cs View File

@ -6,6 +6,6 @@ public class InGroundTrap : MonoBehaviour
{ {
public void Animate() public void Animate()
{ {
Debug.Log("abs");
Debug.Log("trap");
} }
} }

+ 1
- 1
Assets/Scripts/Traps/InGroundTrap.cs.meta View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 90d16cd20b1d52149ae6b3d4c15c79db
guid: a1b0e7f03e96f154cb9c6ecd542406b7
MonoImporter: MonoImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 2 serializedVersion: 2

+ 2
- 9
Assets/Scripts/Traps/ShootingCannon.cs View File

@ -21,18 +21,12 @@ public class ShootingCannon : MonoBehaviour
private void Update() private void Update()
{ {
counter.text = countdown.ToString(); counter.text = countdown.ToString();
//for testing purposes
if (triggeranimate == true)
{
Animate();
triggeranimate = false;
}
} }
public void Animate() public void Animate()
{ {
countdown--; countdown--;
// if (countdown == 0){
if (countdown == 0){
GameObject shot = Instantiate(shootingObject, spawnLocation.position, Quaternion.identity); GameObject shot = Instantiate(shootingObject, spawnLocation.position, Quaternion.identity);
if (shootingRight == true) if (shootingRight == true)
{ {
@ -43,7 +37,6 @@ public class ShootingCannon : MonoBehaviour
shot.GetComponent<Rigidbody>().AddForce(shot.transform.forward * 500); shot.GetComponent<Rigidbody>().AddForce(shot.transform.forward * 500);
} }
countdown = countdowntimer; countdown = countdowntimer;
//}
}
} }
} }

Loading…
Cancel
Save