CaveworldFlora.Cluster.NotifySymbiosisClusterAdded C# (CSharp) Method

NotifySymbiosisClusterAdded() public method

public NotifySymbiosisClusterAdded ( Cluster symbiosisCluster ) : void
symbiosisCluster Cluster
return void
        public void NotifySymbiosisClusterAdded(Cluster symbiosisCluster)
        {
            this.symbiosisCluster = symbiosisCluster;
            symbiosisCluster.symbiosisCluster = this;
        }

Usage Example

示例#1
0
 public static ClusterPlant TryToSpawnNewSymbiosisCluster(Cluster cluster)
 {
     // Check there is not already a symbiosis cluster.
     if (cluster.symbiosisCluster == null)
     {
         foreach (IntVec3 cell in GenRadial.RadialCellsAround(cluster.Position, cluster.plantDef.clusterSpawnRadius, false).InRandomOrder())
         {
             if (cell.InBounds() == false)
             {
                 continue;
             }
             ClusterPlant plant = cell.GetFirstThing(cluster.plantDef) as ClusterPlant;
             if (plant != null)
             {
                 plant.Destroy();
                 ClusterPlant symbiosisPlant = Cluster.SpawnNewClusterAt(cell, cluster.plantDef.symbiosisPlantDefEvolution, cluster.plantDef.symbiosisPlantDefEvolution.clusterSizeRange.RandomInRange);
                 cluster.NotifySymbiosisClusterAdded(symbiosisPlant.cluster);
                 return(symbiosisPlant);
             }
         }
     }
     return(null);
 }
All Usage Examples Of CaveworldFlora.Cluster::NotifySymbiosisClusterAdded