예제 #1
0
    void Start()
    {
        PersistenceKey = transform.position;

        _controller = GameObject.FindGameObjectWithTag(Tag.GameController)
                      .GetComponent <PersistenceController>();

        if (_controller.HasSavedData(this))
        {
            if ((ResetsOnGameStart &&
                 _controller.HasBeenLoaded.ContainsKey(this.PersistenceKey)) ||
                !ResetsOnGameStart)
            {
                _controller.Load(this);
            }
            else
            {
                _controller.NotifyLoad(this);
            }
        }

        gameObject.SetActive(Enabled);

        _isInitialized = true;
    }