-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathSeedInstance.cs
More file actions
55 lines (49 loc) · 1.72 KB
/
SeedInstance.cs
File metadata and controls
55 lines (49 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#if (IL2CPPMELON || IL2CPPBEPINEX)
using S1Growing = Il2CppScheduleOne.Growing;
#elif (MONOMELON || MONOBEPINEX)
using S1Growing = ScheduleOne.Growing;
#endif
using UnityEngine;
using S1API.Internal.Utils;
namespace S1API.Growing
{
/// <summary>
/// Represents an instance of a functional seed in the world.
/// (Not just the definition — this is the physical object you interact with.)
/// </summary>
public class SeedInstance
{
/// <summary>
/// INTERNAL: Reference to the in-game FunctionalSeed object.
/// </summary>
internal readonly S1Growing.FunctionalSeed S1FunctionalSeed;
/// <summary>
/// INTERNAL: Creates a wrapper around the existing FunctionalSeed.
/// </summary>
/// <param name="functionalSeed">The FunctionalSeed object to wrap.</param>
internal SeedInstance(S1Growing.FunctionalSeed functionalSeed)
{
S1FunctionalSeed = functionalSeed;
}
/// <summary>
/// The underlying GameObject of this seed.
/// </summary>
private GameObject GameObject =>
S1FunctionalSeed.gameObject;
/// <summary>
/// Whether the seed currently has exited its vial.
/// </summary>
public bool HasExitedVial { get; private set; } = false;
/// <summary>
/// Force the seed to exit the vial manually.
/// </summary>
public void ForceExitVial()
{
if (S1FunctionalSeed.Vial != null)
{
S1FunctionalSeed.TriggerExit(S1FunctionalSeed.Vial.GetComponent<Collider>());
HasExitedVial = true;
}
}
}
}