コード例 #1
0
ファイル: Plant.cs プロジェクト: Spydarlee/Plantasia
    // -------------------------------------------------------------------------------

    private void OnSeedCollected()
    {
        // Forget about that seed we produced
        SeedToBeCollected.OnSeedCollected -= OnSeedCollected;
        SeedToBeCollected = null;
        SaveGameManager.Instance.Save();

        if (mRemovePlantAfterSeedHarvested)
        {
            mPlanetoidOwner.RemovePlant(this);
            mRemovePlantAfterSeedHarvested = false;
            GameObjectPooler.Instance.ReturnToPool(gameObject);
            GameObjectPooler.Instance.ReturnToPool(mDirtDecalRenderer.gameObject);
        }
        else
        {
            // Reset the plant's growth!
            mBeingHarvested = false;
            mWilted         = 1.0f;
            SetNormalisdGrowth(0.0f, false);
        }
    }