Ejemplo n.º 1
0
    public override void Initialize()
    {
        base.Initialize();
        Transform spearman = null;

        foreach (Transform child in transform)
        {
            //Debug.Log(child.gameObject.name);
            if (child.gameObject.name.Equals("WK_heavy_infantry"))
            {
                spearman = transform.Find("WK_heavy_infantry");
            }
        }
        if (spearman == null)
        {
            Debug.Log("No HeavyInfantry");
            return;
        }
        var unitTexture = Resources.Load(KindomInfoHelper.getKindomInfobyNumber(PlayerNumber).SoilderTexturePath);

        Debug.Log(KindomInfoHelper.getKindomInfobyNumber(PlayerNumber).SoilderTexturePath);
        if (unitTexture == null)
        {
            Debug.Log("No Texture");
            return;
        }
        spearman.gameObject.GetComponentInChildren <Renderer>().material.mainTexture = unitTexture as Texture;
    }
Ejemplo n.º 2
0
 void Start()
 {
     GetKindomInfo = KindomInfoHelper.getKindomInfobyNumber(PlayerNumber);
 }