Browse Source

Merge branch 'master' of https://bitbucket.org/JoshuaReason/irontoad

# Conflicts:
#	IronToad_UnityProject/Assets/Sound.meta~4053ea0ea1489f4604c1626fb0538989dd66037b.meta~927ced4c4317bc1f86f167c9b1594cec30b8e540.meta
master
Joshua Reason 7 years ago
parent
commit
f899781fca
6 changed files with 27 additions and 11 deletions
  1. +2
    -2
      IronToad_UnityProject/Assets/Scripts/Catapult.cs
  2. +21
    -5
      IronToad_UnityProject/Assets/Scripts/CustomSmoothFollow.cs
  3. +1
    -0
      IronToad_UnityProject/Assets/Scripts/HeavyObject.cs
  4. +0
    -1
      IronToad_UnityProject/Assets/Scripts/WaterController.cs
  5. +3
    -3
      IronToad_UnityProject/Assets/Sound.meta~4053ea0ea1489f4604c1626fb0538989dd66037b.meta~927ced4c4317bc1f86f167c9b1594cec30b8e540.meta
  6. BIN
      IronToad_UnityProject/Assets/_Scenes/GreyBox_Prototype.unity

+ 2
- 2
IronToad_UnityProject/Assets/Scripts/Catapult.cs View File

@ -43,7 +43,7 @@ public class Catapult : MonoBehaviour
public void searchlightStateChanged()
{
LeanTween.cancel(splineObjectTranslate.ObjectToManipulate.parent.gameObject, true);
LeanTween.cancel(splineObjectTranslate.ObjectToManipulate.gameObject, true);
if (Searchlight.state == Searchlight.SearchState.Chasing)
launchBoulder();
}
@ -57,7 +57,7 @@ public class Catapult : MonoBehaviour
}
isLaunching = true;
LeanTween.delayedCall(splineObjectTranslate.ObjectToManipulate.parent.gameObject, timeBetweenLaunches, ()=>{
LeanTween.delayedCall(splineObjectTranslate.ObjectToManipulate.gameObject, timeBetweenLaunches, ()=>{
if (Searchlight.state != Searchlight.SearchState.Chasing)
{
isLaunching = false;

+ 21
- 5
IronToad_UnityProject/Assets/Scripts/CustomSmoothFollow.cs View File

@ -35,6 +35,10 @@ public class CustomSmoothFollow : MonoBehaviour
bool isBlocked = false;
Vector3 wantedPos = new Vector3(wantedSide, wantedHeight, wantedDistance);
wantedPos = RotatePointAroundPivot(wantedPos, target.transform.position, offsetAngle);
RaycastHit hitInfo;
if (Physics.Raycast(wantedPos, target.position-wantedPos, out hitInfo, (target.position-wantedPos).magnitude * 2f))
{
@ -52,25 +56,37 @@ public class CustomSmoothFollow : MonoBehaviour
float currentDistance = transform.position.z;
float currentSide = transform.position.x;
// Damp the height
currentHeight = Mathf.Lerp(currentHeight, wantedHeight, damping.y * Time.deltaTime);
currentDistance = Mathf.Lerp(currentDistance, wantedDistance, damping.z * Time.deltaTime);
currentSide = Mathf.Lerp(currentSide, wantedSide, damping.x * Time.deltaTime);
currentHeight = Mathf.Lerp(currentHeight, wantedPos.y, damping.y * Time.deltaTime);
currentDistance = Mathf.Lerp(currentDistance, wantedPos.z, damping.z * Time.deltaTime);
currentSide = Mathf.Lerp(currentSide, wantedPos.x, damping.x * Time.deltaTime);
// Set the position of the camera on the x-z plane to:
// distance meters behind the target
transform.position = target.position;
// Set the height of the camera
transform.position = new Vector3(currentSide, currentHeight, currentDistance);
// Always look at the target
Vector3 lookTarget = target.position;
lookTarget.x = transform.position.x;
lookTarget.z = transform.position.z;
transform.LookAt(lookTarget);
transform.RotateAround(target.transform.position, Vector3.up,offsetAngle);
}
private Vector3 RotatePointAroundPivot(Vector3 point,Vector3 pivot,float angles ) {
Vector3 dir = point - pivot; // get point direction relative to pivot
dir = Quaternion.Euler(angles * Vector3.up) * dir; // rotate it
point = dir + pivot; // calculate rotated point
return point; // return it
}
}

+ 1
- 0
IronToad_UnityProject/Assets/Scripts/HeavyObject.cs View File

@ -9,6 +9,7 @@ public abstract class HeavyObject : WaterObject {
public float splashPower;
public override void OnWaterEnter(WaterController water) {
Debug.Log ("creating wave");
water.CreateWave (transform.position, splashRadius, splashPower);
}

+ 0
- 1
IronToad_UnityProject/Assets/Scripts/WaterController.cs View File

@ -53,7 +53,6 @@ public class WaterController : MonoBehaviour {
Collider[] colliders = Physics.OverlapSphere(point, radius);
foreach (Collider hit in colliders) {
Debug.Log(hit.name);
BuoyantObject hitScript = hit.gameObject.GetComponent<BuoyantObject>();
if (hitScript != null) {
Debug.DrawLine(point, hit.transform.position, Color.blue, 1);

+ 3
- 3
IronToad_UnityProject/Assets/Sound.meta~4053ea0ea1489f4604c1626fb0538989dd66037b.meta~927ced4c4317bc1f86f167c9b1594cec30b8e540.meta View File

@ -1,7 +1,7 @@
fileFormatVersion: 2
guid: 34a7022eb6fa687419f3deb70d1f2380
timeCreated: 1485043520
licenseType: Free
guid: 599e1530282487c46b63fa0f00f5c846
timeCreated: 1485039717
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:

BIN
IronToad_UnityProject/Assets/_Scenes/GreyBox_Prototype.unity View File


Loading…
Cancel
Save