Exemple #1
0
 public override TileObjectInteractionResult PlayerEntered()
 {
     if (spikesDef.isRaised)
     {
         return(new TileObjectInteractionResult(TileObjectInteractionResultType.Kill));
     }
     return(TileObjectInteractionResult.Empty());
 }
Exemple #2
0
    public override TileObjectInteractionResult PlayerEntered()
    {
        if (teleportCycles == null || teleportCycles.Length <= _def.teleportCycleIdx)
        {
            Debug.LogError("teleportCycles not created??");
            return(TileObjectInteractionResult.Empty());
        }
        Vec2i teleportPos = Vec2i.Zero;
        int   thisTPIdx   = teleportCycles[_def.teleportCycleIdx].teleportList.IndexOf(this);

        if (thisTPIdx + 1 == teleportCycles[_def.teleportCycleIdx].teleportList.Count)
        {
            teleportPos = teleportCycles[_def.teleportCycleIdx].teleportList[0]._def.pos;
        }
        else
        {
            teleportPos = teleportCycles[_def.teleportCycleIdx].teleportList[thisTPIdx + 1]._def.pos;
        }
        return(new TileObjectInteractionResult(TileObjectInteractionResultType.Teleport, teleportPos));
    }
Exemple #3
0
 public virtual TileObjectInteractionResult PlayerEntered()
 {
     return(TileObjectInteractionResult.Empty());
 }