Exemple #1
0
    public override void ExtractInterests(ChallengeStage stage)
    {
        ItemDatabase itemDatabase      = null;
        bool         extractionSuccess = false;

        base.ExtractInterests(stage);
        stageComponent = stage;
        if (stage != null)
        {
            itemDatabase = stage.GetItemDatabase();
            if (itemDatabase != null)
            {
                itemModel = itemDatabase.GetItemModel(itemCode);
                if ((itemModel != null) && stage.GetNodeStructurePosition(placementNodeID, ref itemPosition))
                {
                    itemPosition     += offsetWithinNode;
                    extractionSuccess = true;
                }
            }
        }
        if (!extractionSuccess)
        {
            stage        = null;
            itemModel    = null;
            itemPosition = Vector2.zero;
        }
    }
    public override void ExtractInterests(ChallengeStage stage)
    {
        ObstacleDatabase obstacleDatabase  = null;
        bool             extractionSuccess = false;

        base.ExtractInterests(stage);
        stageComponent = stage;
        if (stage != null)
        {
            obstacleDatabase = stage.GetObstacleDatabase();
            if (obstacleDatabase != null)
            {
                obstacleModel = obstacleDatabase.GetObstacleModel(obstacleCode);
                if ((obstacleModel != null) && stage.GetNodeStructurePosition(placementNodeID, ref obstaclePosition))
                {
                    obstaclePosition += offsetWithinNode;
                    extractionSuccess = true;
                }
            }
        }
        if (!extractionSuccess)
        {
            stage            = null;
            obstacleModel    = null;
            obstaclePosition = Vector2.zero;
        }
    }