initial upload

This commit is contained in:
tom.hempel
2026-05-30 18:11:47 +02:00
commit 410e93f746
272 changed files with 178849 additions and 0 deletions

View File

@ -0,0 +1,35 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using static HeneGames.Airplane.SimpleAirPlaneController;
namespace HeneGames.Airplane
{
public class LandingArea : MonoBehaviour
{
[SerializeField] private Runway runway;
private void OnTriggerEnter(Collider other)
{
//Check if colliding object has airplane collider component
if (other.transform.TryGetComponent<SimpleAirPlaneCollider>(out SimpleAirPlaneCollider _airPlaneCollider))
{
//Calculate that the plane is coming from the right direction
Vector3 dirFromLandingAreaToPlayerPlane = (transform.position - _airPlaneCollider.transform.position).normalized;
float _directionFloat = Vector3.Dot(transform.forward, dirFromLandingAreaToPlayerPlane);
//If direction is right start landing
if (_directionFloat > 0.5f)
{
SimpleAirPlaneController _controller = _airPlaneCollider.controller;
runway.landingAdjuster.position = _controller.transform.position;
runway.AddAirplane(_controller);
_controller.airplaneState = AirplaneState.Landing;
_controller.AddLandingRunway(runway);
}
}
}
}
}