massive number of fixes, removed compilation error, logs, negative scale issues, serialization issues ETC

This commit is contained in:
2024-11-25 15:15:55 +01:00
parent 48d565f77e
commit 8d766ed470
48 changed files with 1442 additions and 2434 deletions

View File

@@ -34,11 +34,13 @@ namespace Beyond
{
public TreeState treeState;
public float health = 100;
public bool isEnabled = true;
public TreeStateData(TreeState treeState, float health)
public TreeStateData(TreeState treeState, float health, bool isEnabled)
{
this.treeState = treeState;
this.health = health;
this.isEnabled = isEnabled;
}
}
@@ -73,8 +75,8 @@ namespace Beyond
[SerializeField] private List<Renderer> woodRenderers, leavesRenderers;
private List<Material> woodMaterials = new(), leavesMaterials = new();
private string woodColorName = "BaseColor",
leavesColorName = "BaseColor";
private string woodColorName = "_BaseColor",
leavesColorName = "_BaseColor";
[SerializeField] public bItemListData items;
@@ -251,13 +253,17 @@ namespace Beyond
}
currentTreeState = treeState;
if (instant)
//TODO make sure that is enough to deal with saved state and disabled trees
if (gameObject.activeInHierarchy)
{
StartCoroutine(SetInstantTreeSizeCoroutine(animationValue, animationName, animLayer));
}
else
{
StartCoroutine(SetAnimationTreeCoroutine(animationValue, animationName, animLayer));
if (instant)
{
StartCoroutine(SetInstantTreeSizeCoroutine(animationValue, animationName, animLayer));
}
else
{
StartCoroutine(SetAnimationTreeCoroutine(animationValue, animationName, animLayer));
}
}
onStateChanged?.Invoke(currentTreeState);