public RedDrone(float speed, float size, DroneColor color, float acceleration, Area area, float waitTime = 0.5f, bool synchronized = false, DroneType droneType = DroneType.FlyingOneWayDrone) : base(speed, size, color, droneType, null) { _area = area; MovementType = new PointToPointMovement(area, Size, acceleration, waitTime, synchronized); }
private void Awake() { if (heldObject == null) { Debug.LogError("Held object missing from " + gameObject.name); } else { heldObjRB = heldObject.GetComponent <Rigidbody>(); } if (holdPosTransform == null) { Debug.LogError("Hold position transform missing from " + gameObject.name); } pointToPoint = GetComponent <PointToPointMovement>(); if (pointToPoint == null) { Debug.LogError("Point to point movement missing from " + gameObject.name); } holdPosObjOffset = holdPosTransform.position - transform.position; baseYPos = transform.position.y; Rigidbody[] children = GetComponentsInChildren <Rigidbody>(); foreach (Rigidbody child in children) { if (child.gameObject == heldObject) { isHolding = true; } else { isHolding = false; } } }