private void Start() { if (!isServer) { return; } bangRay = new PlaneRay(gameObject.transform.position, direction) { Distance = RealDistance }; InitializeDistance(); RpcBangSimulate(gameObject, distance, duration); }
private Boolean ExistBarrier() { var position = gameObject.GetIntegerPosition().Set(Coordinate.Y, 0); var hitObjects = new PlaneRay(position, new Vector3(0, 0, 0.45f), Vector3.forward) { Distance = 0.9f }.Cast(); foreach (var hitElement in hitObjects) { var hitObject = hitElement.transform.gameObject.GetParent(); if (!hitObject.OneFrom(Player.tag, Bonus.tag, Enemy.tag)) { return(true); } } return(false); }
private Boolean CanResetTrigger() { var size = boxCollider.transform.localScale.z; var halfSize = size / 2; var centerPosition = gameObject.GetIntegerPosition(); var planeRay = new PlaneRay(centerPosition, new Vector3(0, 0, halfSize), Vector3.forward) { Distance = size, HalfLengthBox = halfSize }; foreach (var hitElement in planeRay.Cast()) { var hitObject = hitElement.transform.gameObject.GetParent(); if (hitObject.CompareTag(Player.tag)) { return(false); } } return(true); }