示例#1
0
    // Use this for initialization
    void Start()
    {
        networkManager = GameObject.FindGameObjectWithTag("GameController").GetComponent <CommunicationBehaviour>();
        sparkGenerator = GameObject.Find("SparkGenerator");
        currHP         = totalHP;

        manabar       = GameObject.Find("PortalManaBar").GetComponent <Slider>();
        manabar.value = 0;

        behaviour = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameBehaviour>();
    }
示例#2
0
    // Use this for initialization
    void Start()
    {
        HP            = totalHP;
        communication = GameObject.FindGameObjectWithTag("GameController").GetComponent <CommunicationBehaviour>();
        behaviour     = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameBehaviour>();
        spawnPoints   = new Vector3[GameObject.FindGameObjectsWithTag("SpawnPoint").Length];
        for (int i = 1; i < spawnPoints.Length + 1; i++)
        {
            spawnPoints[i - 1] = GameObject.Find("Row" + i).transform.position;
        }
        cardLoot = GetComponent <AudioSource>();
        anim     = gameObject.GetComponent <Animator>();

        var pixperunit = gameObject.GetComponent <SpriteRenderer>().sprite.pixelsPerUnit;

        spriteHeight = gameObject.GetComponent <SpriteRenderer>().sprite.rect.height / pixperunit;
        spriteWidth  = gameObject.GetComponent <SpriteRenderer>().sprite.rect.width / pixperunit;
        cam          = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>();
        whratio      = Screen.width / (float)Screen.height;
    }