本文整理汇总了C#中Layer.AddSubject方法的典型用法代码示例。如果您正苦于以下问题:C# Layer.AddSubject方法的具体用法?C# Layer.AddSubject怎么用?C# Layer.AddSubject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Layer
的用法示例。
在下文中一共展示了Layer.AddSubject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddObstacle
void AddObstacle(Layer layer, float posX, int stageObjectId, ItemDropManager itemDropManager, FSM parentFsm, bool lastMonster)
{
FieldInstance instance = null;
ObjectField objectField = TableLoader.GetTable<ObjectField>().Get(stageObjectId);
ObjectStage objectStage = TableLoader.GetTable<ObjectStage>().Get(stageObjectId);
if (objectStage.Type == E_StageObjectType.Monster)
{
ObjectMonster objectMonster = TableLoader.GetTable<ObjectMonster>().Get(objectStage.ObjectID);
if (objectMonster.MonsterType == E_MonsterType.Boss)
{
BossAlertTrigger alertTrigger = new BossAlertTrigger(parentFsm);
layer.AddSubject(alertTrigger, posX - Constants.Instance.Field.CameraWidth, 0);
AddFieldInstance(alertTrigger);
instance = new BossMonster(objectField, objectStage, itemDropManager, parentFsm);
}
else if (lastMonster)
{
instance = new LastMonster(objectField, objectStage, itemDropManager, parentFsm);
}
else
{
instance = new BattleObstacle(objectField, objectStage, itemDropManager, parentFsm);
}
}
else if (objectStage.Type == E_StageObjectType.Chest)
{
instance = new Chest(objectField, objectStage, itemDropManager, parentFsm);
}
else if (objectStage.Type == E_StageObjectType.EndPoint)
{
instance = new StageEndDoor(objectField, objectStage, itemDropManager, parentFsm);
}
else if (objectStage.Type == E_StageObjectType.Trap)
{
instance = new Trap(objectField, objectStage, itemDropManager, parentFsm);
}
else if (objectStage.Type == E_StageObjectType.Etc)
{
instance = new StageObject(objectField, objectStage, itemDropManager, parentFsm);
}
else
{
Assert.Fail("not implemented");
}
layer.AddSubject(instance, posX, 0);
AddFieldInstance(instance);
}
示例2: AddObstacle
void AddObstacle(Layer layer, float posX, int stageObjectId, FSM parentFsm)
{
FieldObject instance = null;
FieldObjectEntity objectField = TableLoader.GetTable<FieldObjectEntity>().Get(stageObjectId);
StageObjectEntity2 objectStage = TableLoader.GetTable<StageObjectEntity2>().Get(stageObjectId);
if (objectStage.stageObjectType == StageObjectType.Monster)
{
instance = new Monster(objectField, objectStage, parentFsm);
}
else
{
instance = new StageObject(objectField, objectStage, parentFsm);
}
layer.AddSubject(instance, posX, 0);
AddFieldInstance(instance);
}