Пример #1
0
 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);
 }
Пример #2
0
    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;
            }
        }
    }