Пример #1
0
    // Use this for initialization
    void Start()
    {
        FloatingTextManager.Initialise();
        //find the two spawners to acces scripts
        m_pieSpawner = GameObject.FindGameObjectWithTag("PieSpawner");
        m_pedSpawner = GameObject.FindGameObjectWithTag("PedSpawner");

        m_pieSplatSound = this.GetComponent <AudioSource>();

        //get the script and component references
        m_pieScript         = m_pieSpawner.GetComponent <PieScript>();
        m_gameManagerScript = m_pedSpawner.GetComponent <PieThrowManagerScript>();
        m_sr = gameObject.GetComponent <SpriteRenderer>();
        m_pieSpriteManager = gameObject.GetComponent <PieSpriteChanger> ();

        m_isHit = false;
    }
Пример #2
0
    void Start()
    {
        tempTime = respawnTime;

        pie = (GameObject)Instantiate(piePrefab, pieSpawnPosition, Quaternion.identity);
        //initialise the rays
        rayToTouch = new Ray(pie.transform.position, Vector3.zero);

        sr              = pie.GetComponent <SpriteRenderer>();
        managerScript   = gameManager.GetComponent <PieThrowManagerScript> ();
        pieAttackScript = pie.GetComponent <PieAttackScript> ();

        //get the square of maxstretch
        maxStretchSqr = maxStretch * maxStretch;

        hasLaunched = false;
        isReloading = false;
        isDestroyed = false;
    }