// Update is called once per frame void Update() { FlowerController fc = flowerBox.GetComponent <FlowerController>(); if (fc.IsGrowAnimationDone) { // make flower target if grow animation is done TargetManager.Instance.Target = flowerBox; // show edit canvas if (!editCanvas.activeSelf) { editCanvas.SetActive(true); Helper.TreeEnableRenderer(editCanvas); } // show color canvas if (!colorCanvas.activeSelf) { colorCanvas.SetActive(true); Helper.TreeEnableRenderer(colorCanvas); } } }
/// <summary> /// The continuous response of the flower once it has been tended to /// </summary> /// <param name="controller"></param> public abstract void UpdateFlower(FlowerController controller);
/// <summary> /// Initialisation for when the gardener tends to the flower /// Only exists to be inherited, thus the function is abstract /// </summary> /// <param name="controller"></param> public abstract void GardenerTendTo(FlowerController controller);
/// <summary> /// Initialisation for when the gardener tends to the flower /// Only exists to be inherited, thus the function is abstract /// FOR BAMBOO! /// all we is update the size level of the object in the game /// </summary> /// <param name="controller"></param> public override void GardenerTendTo(FlowerController controller) { controller.NextGoalSize += incrementPercentage; }
/// <summary> /// Initialisation code called from the FlowerController (the Monobehaviour referenced by this SciptableObject) /// to set up any necessary data /// OVERRIDEN FROM BASE CLASS "FlowerTemplate" /// </summary> /// <param name="controller"></param> public override void Init(FlowerController controller) { base.Init(controller); controller.NextGoalSize = nextGoalSize; }
//code for dealing with a flower public abstract void TendFlower(GardenerController gardener, FlowerController flower);
// Use this for initialization void Start() { flowerController = GetComponent <FlowerController>(); gameOfLife = GetComponent <GameOfLife>(); audioSource = GetComponent <AudioSource>(); }