public GameObject CreatePrefab()
    {
        GameObject gameObject = EntityTemplates.CreateSolidOreEntity(ElementID, null);
        Sublimates sublimates = gameObject.AddOrGet <Sublimates>();

        sublimates.spawnFXHash = SpawnFXHashes.BleachStoneEmissionBubbles;
        sublimates.info        = new Sublimates.Info(0.000200000009f, 0.00250000018f, 1.8f, 0.5f, SublimeElementID, byte.MaxValue, 0);
        return(gameObject);
    }
コード例 #2
0
    public GameObject CreatePrefab()
    {
        GameObject gameObject = EntityTemplates.CreateLiquidOreEntity(ElementID, null);
        Sublimates sublimates = gameObject.AddOrGet <Sublimates>();

        sublimates.spawnFXHash = SpawnFXHashes.ContaminatedOxygenBubble;
        sublimates.info        = new Sublimates.Info(4.00000026E-05f, 0.025f, 1.8f, 1f, SublimeElementID, byte.MaxValue, 0);
        return(gameObject);
    }
コード例 #3
0
        public GameObject CreatePrefab()
        {
            var entity = EntityTemplates.CreateLooseEntity(ID, Name, Desc, 1f, false,
                                                           Assets.GetAnim("palmeraberry_kanim"), "object", Grid.SceneLayer.Front,
                                                           EntityTemplates.CollisionShape.RECTANGLE, 0.77f, 0.48f, true);

            var foodEntity = EntityTemplates.ExtendEntityToFood(entity, new EdiblesManager.FoodInfo(ID, 0.0f, TUNING.FOOD.FOOD_QUALITY_AWFUL, 255.15f, 277.15f, TUNING.FOOD.SPOIL_TIME.SLOW, true));

            Sublimates sublimates = foodEntity.AddOrGet <Sublimates>();

            sublimates.spawnFXHash = SpawnFXHashes.OxygenEmissionBubbles;
            sublimates.info        = new Sublimates.Info(0.001f, 0f, 1.8f, 0.0f, SimHashes.Hydrogen);

            return(foodEntity);
        }
コード例 #4
0
 /// <summary>
 /// Spawns an FX object only if it is on screen.
 /// </summary>
 private static void SpawnFXIf(Game instance, SpawnFXHashes fx, Vector3 position,
                               float rotation, Sublimates caller)
 {
     if (caller != null && instance != null)
     {
         int cell = Grid.PosToCell(caller);
         // GetMyWorldId but with precomputed cell
         if (Grid.IsValidCell(cell))
         {
             byte id = Grid.WorldIdx[cell];
             Grid.GetVisibleExtents(out int minX, out int minY, out int maxX,
                                    out int maxY);
             Grid.CellToXY(cell, out int x, out int y);
             if (id != ClusterManager.INVALID_WORLD_IDX && ClusterManager.Instance.
                 activeWorldId == id && Grid.IsVisible(cell) && x >= minX &&
                 x <= maxX && y >= minY && y <= maxY)
             {
                 // Properly do the Z layer setting
                 position.z = Grid.GetLayerZ(Grid.SceneLayer.Front);
                 instance.SpawnFX(fx, position, rotation);
             }
         }
     }
 }