Futile.AddStage C# (CSharp) Method

AddStage() public static method

public static AddStage ( FStage, stageToAdd ) : void
stageToAdd FStage,
return void
    public static void AddStage(FStage stageToAdd)
    {
        int stageIndex = _stages.IndexOf(stageToAdd);

        if(stageIndex == -1) //add it if it's not a stage
        {
            stageToAdd.HandleAddedToFutile();
            _stages.Add(stageToAdd);
            UpdateStageIndices();
        }
        else if(stageIndex != _stages.Count-1) //if stage is already in the stages, put it at the top of the stages if it's not already
        {
            _stages.RemoveAt(stageIndex);
            _stages.Add(stageToAdd);
            UpdateStageIndices();
        }
    }

Usage Example

Beispiel #1
0
 public override void Init()
 {
     SetStage(new FStage("LOGO"));
     Futile.AddStage(GetStage());
     SetPixelOffset(0, 0, Futile.screen.width, Futile.screen.height);
     tEditor = new LogoEditor(this);
 }
All Usage Examples Of Futile::AddStage