using System.Collections; using System.Collections.Generic; using UnityEngine; using SiegeSong; namespace SiegeSong { public class Foot : MonoBehaviour { public bool Grounded; public bool Unstable; //public ActorPhysicsManager PhysicsManager; void OnCollisionEnter(Collision collision) { var isUnstable = true; if (collision.transform.gameObject.CompareTag("Water")) { Unstable = false; Grounded = false; } if (collision.transform.gameObject.CompareTag("Terrain")) { Unstable = false; Grounded = true; } if (collision.transform.gameObject.CompareTag("Floor")) { Unstable = false; Grounded = true; } Unstable = isUnstable; var ramp = collision.gameObject.GetComponent(); if (ramp != null) { //PhysicsManager.ActorMotor.FeetCollidingWithRamp = true; //PhysicsManager.ActorMotor.RampAngle = ramp.Angle; //PhysicsManager.ActorMotor.RampMagnitude = ramp.Magnitude; //Vector3.Distance(transform.position, ramp.StartPoint.position) //Vector3.Distance(transform.StartPoint.position, ramp.EndPoint.position) //Vector3.Distance(transform.position, ramp.EndPoint.position) } } void OnCollisionExit(Collision collision) { Unstable = false; if (collision.transform.gameObject.CompareTag("Water")) { Grounded = true; } if (collision.transform.gameObject.CompareTag("Terrain")) { Grounded = false; } if (collision.transform.gameObject.CompareTag("Floor")) { Grounded = false; } //if (collision.gameObject.GetComponent() != null) //{ // PhysicsManager.ActorMotor.FeetCollidingWithRamp = false; //} } void Start() { } void Update() { } } }