Exemplo n.º 1
0
        public void SetMode(StaticObjectMode mode)
        {
            if (!objectInfo.mode[mode.index])
            {
                Debug.LogWarning("Failed to set mode '" + mode + "' of object " + name);
                return;
            }

            if (objectInfo.hasCollision[_mode.index])
            {
                CollisionMap.SetPassable(Iso.Snap(_iso.pos), objectInfo.sizeX, objectInfo.sizeY, true, gameObject);
            }
            if (objectInfo.hasCollision[mode.index])
            {
                CollisionMap.SetPassable(Iso.Snap(_iso.pos), objectInfo.sizeX, objectInfo.sizeY, false, gameObject);
            }

            _mode              = mode;
            _animationTime     = 0;
            _animationDuration = objectInfo.frameCount[_mode.index] * objectInfo.frameDuration[_mode.index];
        }
Exemplo n.º 2
0
 public static StaticObjectMode GetByToken(string token, StaticObjectMode defaultMode = null)
 {
     if (token == "NU")
     {
         return(Neutral);
     }
     if (token == "OP")
     {
         return(Operating);
     }
     if (token == "ON")
     {
         return(On);
     }
     if (token == "S1")
     {
         return(Special1);
     }
     if (token == "S2")
     {
         return(Special2);
     }
     if (token == "S3")
     {
         return(Special3);
     }
     if (token == "S4")
     {
         return(Special4);
     }
     if (token == "S5")
     {
         return(Special5);
     }
     return(defaultMode);
 }