/* --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- */ public Personage(int level, RankOfPersonage rank, TypeOfPersonage type, int modelId, Vector3 position, int nameId = 3) : base(modelId, position, nameId) { isPlayer = this is Player; this.type = type; this.rank = rank; this.level = level; animationGroup = GroupOfAnimation.Create(this); Relationship = RelationshipOfPersonage.Neutral; loot = new Bag(isPlayer); if (isPlayer) { defaultTask = new PlayerMovementTask(); } else { defaultTask = new WalkToSpawnPointTask(); } currentTask = defaultTask; // !!! Ініціалізацію об'єктів здійснювати до методу LevelUp LevelUp(level); }
public void AssignToPath(Path path) { currentTask = new FollowPathTask(path); }
public void WalkToPoint(Path.Node node) { currentTask = new WalkToPointTask(node); }
public void WalkToPoint(float x, float y, float z, float radius = 1f) { currentTask = new WalkToPointTask(x, y, z, radius); }
public void WalkToPoint(Vector3 position, float radius = 1f) { currentTask = new WalkToPointTask(position, radius); }
public void ClearTask() { currentTask = defaultTask; }