// Use this for initialization
    void Start()
    {
        shouts = new Image[numShouts];

        foreach (Transform t in transform)
        {
            if (t.name.Equals("shout1"))
            {
                shouts[0] = t.GetComponent <Image>();
            }

            if (t.name.Equals("shout2"))
            {
                shouts[1] = t.GetComponent <Image>();
            }

            if (t.name.Equals("shout3"))
            {
                shouts[2] = t.GetComponent <Image>();
            }

            if (t.name.Equals("damageMultiplier"))
            {
                damageMultiplier = t.GetComponent <Text>();
            }
        }

        //todo: read from attackManager
        if (damageMultiplier == null)
        {
            Debug.LogError("Error: no damage Multiplier Found");
        }

        shoutController = player.GetComponentInChildren <ShoutController>();
        if (shoutController == null)
        {
            Debug.LogError("Error: no shout controller attached to target player.");
        }

        attackManager = player.GetComponentInChildren <AttackManager>();
        if (attackManager == null)
        {
            Debug.LogError("Error: no attack manager attached to target player.");
        }
    }
Esempio n. 2
0
    // Use this for initialization
    void Start () {
		sc=this;
		ChooseCharacter();
		ClearRatingText();
	}