Class TCastleMissile

Unit

Declaration

type TCastleMissile = class(TCastleBehavior)

Description

Missile that flies in the given direction TCastleTransform.Direction with the given MoveSpeed. On impact, it will hurt a living thing.

Missile may have also TCastleMissile if the missile can be destroyed in-flight (e.g. by other missile or short-range attack of TCastleMoveAttack). If the missile doesn't have TCastleMissile, it is indestructible.

Hierarchy

Overview

Methods

Protected function CanAttachToParent(const NewParent: TCastleTransform; out ReasonWhyCannot: String): Boolean; override;
Public constructor Create(AOwner: TComponent); override;

Properties

Published property Damage: TCastleDamage read FDamage;

Description

Methods

Protected function CanAttachToParent(const NewParent: TCastleTransform; out ReasonWhyCannot: String): Boolean; override;

This item has no description. Showing description inherited from TCastleBehavior.CanAttachToParent.

Check can this behavior be added to NewParent. When this returns False, it has to set also ReasonWhyCannot. When overriding this, you can use e.g. this code to make sure we are the only behavior of given class:

function TCastleBillboard.CanAttachToParent(const NewParent: TCastleTransform;
  out ReasonWhyCannot: String): Boolean;
begin
  Result := inherited;
  if not Result then Exit;

  if NewParent.FindBehavior(TCastleBillboard) <> nil then
  begin
    ReasonWhyCannot := 'Only one TCastleBillboard behavior can be added to a given TCastleTransform';
    Result := false;
  end;
end;

Public constructor Create(AOwner: TComponent); override;

This item has no description.

Properties

Published property Damage: TCastleDamage read FDamage;

Damage caused by the missile impact.


Generated by PasDoc 0.16.0-snapshot.