Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0

Plant Genes plugin?


Go to solution Solved by nivex,

Question

Hello community!

Can anybody help me to make a simple plugin for new Rust plants genetics manipulation?

For now I just use this dumb code for fast clones selection:

private void OnEntityBuilt(Planner planner, GameObject seed)
{
		var player = planner.GetOwnerPlayer();
		var imSeed = seed.GetComponent<GrowableEntity>();

		if (player == null || !player.IsAdmin)
		{
			return;
		}
			
		if (imSeed != null)
      	{
			NextTick(() =>
        {
        	imSeed.ChangeState(PlantProperties.State.Fruiting, false, false);
        });
}

Anybody knows how to make access to GrowableGene.Set(global::GrowableGenetics.GeneType geneType, bool firstSet = false) class ?

Edited by KanyT
Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 3
  • Solution
Posted (edited)

            for (int i = 0; i < imSeed.Genes.Genes.Length; i++)
            {
                imSeed.Genes.Genes[i].Set(GrowableGenetics.GeneType.Yield, true);
            }

 

Edited by nivex
  • Like 1
  • Thanks 1
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.