Пример #1
0
    // Use this for initialization
    void Awake()
    {
        if (StaticRef == null) // if theres is not allerdaye a static ref makes this the static ref
        {
            DontDestroyOnLoad(gameObject);
            StaticRef = this;
        }
        else if (StaticRef != this) // is the allready is a ref , destory this
        {
            Destroy(this);
        }

        player = GameController_script.playerRef;

        sphereRadius = this.GetComponent<SphereCollider>();

        hat = GameObject.FindGameObjectWithTag("hat").transform;

        book = GameObject.FindGameObjectWithTag("book").transform;

        book_anim = book.GetComponentInChildren<Animator>();

        hat.gameObject.SetActive(true);

        book.gameObject.SetActive(false);

        haveHat = HatState.Yes;

        hatSpwanTarget = GameObject.FindGameObjectWithTag("hatSpawn").transform;
    }
Пример #2
0
    // Use this for initialization
    void Awake()
    {
        if (StaticRef == null) // if theres is not allerdaye a static ref makes this the static ref
        {
            DontDestroyOnLoad(gameObject);
            StaticRef = this;
        }
        else if (StaticRef != this) // is the allready is a ref , destory this
        {
            Destroy(this);
        }

        player = GameController_script.playerRef;

        sphereRadius = this.GetComponent <SphereCollider>();

        hat = GameObject.FindGameObjectWithTag("hat").transform;

        book = GameObject.FindGameObjectWithTag("book").transform;

        book_anim = book.GetComponentInChildren <Animator>();

        hat.gameObject.SetActive(true);

        book.gameObject.SetActive(false);

        haveHat = HatState.Yes;

        hatSpwanTarget = GameObject.FindGameObjectWithTag("hatSpawn").transform;
    }