Exemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     ps      = transform.GetComponent <PlaceSummoner>();
     gfStore = GameObject.Find("PlayerData").transform.GetComponent <GuardianStorage>();
     if (gfStore != null)
     {
         Transform         summoner = Instantiate(gfStore.SelectedSummoner, ps.SummonerA.position, ps.SummonerA.rotation) as Transform;
         CharacterProperty sp       = summoner.GetComponent <CharacterProperty>();
         sp.Summoner     = true;
         sp.InitPlayer   = 1;
         sp.Player       = 1;
         sp.summonCost   = 0;
         sp.death        = false;
         sp.TurnFinished = false;
         int num = gfStore.SelectedGFs.Count;
         if (num > 0)
         {
             sp.soldiers = new Transform[num];
             gfStore.SelectedGFs.CopyTo(sp.soldiers, 0);
             gfStore.SelectedGFs.Clear();
         }
         foreach (Transform gf in sp.soldiers)
         {
             CharacterProperty gfp = gf.GetComponent <CharacterProperty>();
             gfp.Summoner = false;
             gfp.death    = true;
         }
         summoner.parent = ps.SummonerA;
         Camera.mainCamera.GetComponent <RoundCounter>().SetPlayerChesses();
     }
 }
Exemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     ps = transform.GetComponent<PlaceSummoner>();
     gfStore = GameObject.Find("PlayerData").transform.GetComponent<GuardianStorage>();
     if(gfStore!=null){
         Transform summoner = Instantiate(gfStore.SelectedSummoner, ps.SummonerA.position,  ps.SummonerA.rotation) as Transform;
         CharacterProperty sp = summoner.GetComponent<CharacterProperty>();
         sp.Summoner = true;
         sp.InitPlayer = 1;
         sp.Player = 1;
         sp.summonCost = 0;
         sp.death = false;
         sp.TurnFinished = false;
         int num = gfStore.SelectedGFs.Count;
         if(num>0){
             sp.soldiers = new Transform[num];
             gfStore.SelectedGFs.CopyTo(sp.soldiers,0);
             gfStore.SelectedGFs.Clear();
         }
         foreach(Transform gf in sp.soldiers){
             CharacterProperty gfp = gf.GetComponent<CharacterProperty>();
             gfp.Summoner = false;
             gfp.death = true;
         }
         summoner.parent = ps.SummonerA;
         Camera.mainCamera.GetComponent<RoundCounter>().SetPlayerChesses();
     }
 }
Exemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        iconVault = transform.GetComponent <InfoUI>();
        pillars   = GameObject.Find("Pillars").transform;
        Rect zeroGFRect = new Rect(startX, startY, gfWidth, gfHeight);

        print("this is level, " + Application.loadedLevelName);
        playerData = GameObject.Find("PlayerData").transform;
        if (playerData != null)
        {
            guardians     = playerData.GetComponent <GuardianStorage>();
            dataLength    = guardians.Guardians.Count;
            guardianArray = new GuardianUIData[dataLength];
            skillArray    = new Transform[guardians.SkillVault.Count];
            guardians.SkillVault.CopyTo(skillArray, 0);
            skillRects = new Rect[guardians.SkillVault.Count];
            for (int i = 0; i < dataLength; i++)
            {
                Transform gf = guardians.Guardians[i] as Transform;
                guardianArray[i] = new GuardianUIData(gf);
                Rect gfRect = new Rect(startX + interWidth * i, startY, gfWidth, gfHeight);
                guardianArray[i].DragRect       = gfRect;
                guardianArray[i].OriginRect     = gfRect;
                guardianArray[i].TrueOriginRect = gfRect;
            }
            for (int i = 0; i < guardians.SkillVault.Count; i++)
            {
                skillRects[i] = new Rect(1080.0f, 140.0f + 26.0f * i, 168.0f, 20.0f);
            }
        }
        gStyle.alignment        = TextAnchor.MiddleCenter;
        gStyle.font             = StringStyle;
        gStyle.fontSize         = 20;
        gStyle.normal.textColor = Color.white;

        bStyle.alignment        = TextAnchor.UpperLeft;
        bStyle.font             = StringStyle;
        bStyle.fontSize         = 18;
        bStyle.normal.textColor = Color.white;

        cStyle.alignment        = TextAnchor.UpperLeft;
        cStyle.font             = StringStyle;
        cStyle.fontSize         = 16;
        cStyle.normal.textColor = new Color(0.75f, 0.75f, 0.75f, 1.0f);
        cStyle.wordWrap         = true;

        for (int i = 0; i < infoRects.Length; i++)
        {
            infoRects[i]   = new Rect(infoStartRect.x, infoStartRect.y + 28.0f * i, infoStartRect.width, infoStartRect.height);
            staticRects[i] = new Rect(176.0f, infoStartRect.y + 28.0f * i, 40.0f, 20.0f);
        }
        for (int i = 0; i < 5; i++)
        {
            passiveRects[i] = new Rect(156.0f + i * 22.0f, infoRects[8].y, 20.0f, 20.0f);
        }
    }
Exemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     gfStorage = GameObject.Find("PlayerData").transform.GetComponent<GuardianStorage>();
     int pillarNum = gfStorage.Guardians.Count;
     for(int i=0; i<transform.childCount; i++){
         ChangeMaterials(transform.GetChild(i), DarkPillar);
         transform.GetChild(i).collider.enabled = false;
     }
     for(int i=0; i<pillarNum; i++){
         ChangeMaterials(transform.GetChild(i), BrightPillar);
         transform.GetChild(i).collider.enabled = true;
     }
 }
Exemplo n.º 5
0
    // Use this for initialization
    void Start()
    {
        gfStorage = GameObject.Find("PlayerData").transform.GetComponent <GuardianStorage>();
        int pillarNum = gfStorage.Guardians.Count;

        for (int i = 0; i < transform.childCount; i++)
        {
            ChangeMaterials(transform.GetChild(i), DarkPillar);
            transform.GetChild(i).collider.enabled = false;
        }
        for (int i = 0; i < pillarNum; i++)
        {
            ChangeMaterials(transform.GetChild(i), BrightPillar);
            transform.GetChild(i).collider.enabled = true;
        }
    }
Exemplo n.º 6
0
    // Update is called once per frame
    void Update()
    {
        if (yellowTower.GetComponent <CharacterProperty>().death)
        {
            playerData.GetComponent <GuardianStorage>().AddingAward(stageAward);
            playerData = GameObject.Find("PlayerData").transform;
            GuardianStorage guardians = playerData.GetComponent <GuardianStorage>();

            foreach (Transform gf in guardians.Guardians)
            {
                print(gf);
            }

            Application.LoadLevel(StageToGo);
        }
    }
Exemplo n.º 7
0
    // Use this for initialization
    void Start()
    {
        iconVault = transform.GetComponent<InfoUI>();
        pillars = GameObject.Find("Pillars").transform;
        Rect zeroGFRect = new Rect(startX, startY, gfWidth, gfHeight);
        print("this is level, "+Application.loadedLevelName);
        playerData = GameObject.Find("PlayerData").transform;
        if(playerData!=null){
            guardians = playerData.GetComponent<GuardianStorage>();
            dataLength = guardians.Guardians.Count;
            guardianArray = new GuardianUIData[dataLength];
            skillArray = new Transform[guardians.SkillVault.Count];
            guardians.SkillVault.CopyTo(skillArray,0);
            skillRects = new Rect[guardians.SkillVault.Count];
            for(int i=0; i<dataLength; i++){
                Transform gf = guardians.Guardians[i] as Transform;
                guardianArray[i] = new GuardianUIData(gf);
                Rect gfRect = new Rect(startX+interWidth*i, startY, gfWidth, gfHeight);
                guardianArray[i].DragRect = gfRect;
                guardianArray[i].OriginRect = gfRect;
                guardianArray[i].TrueOriginRect = gfRect;
            }
            for(int i=0; i<guardians.SkillVault.Count; i++){
                skillRects[i] = new Rect(1080.0f, 140.0f+26.0f*i, 168.0f, 20.0f);
            }
        }
        gStyle.alignment = TextAnchor.MiddleCenter;
        gStyle.font = StringStyle;
        gStyle.fontSize = 20;
        gStyle.normal.textColor = Color.white;

        bStyle.alignment = TextAnchor.UpperLeft;
        bStyle.font = StringStyle;
        bStyle.fontSize = 18;
        bStyle.normal.textColor = Color.white;

        cStyle.alignment = TextAnchor.UpperLeft;
        cStyle.font = StringStyle;
        cStyle.fontSize = 16;
        cStyle.normal.textColor = new Color(0.75f,0.75f,0.75f,1.0f);
        cStyle.wordWrap = true;

        for(int i=0; i<infoRects.Length; i++){
            infoRects[i] = new Rect(infoStartRect.x, infoStartRect.y+28.0f*i, infoStartRect.width, infoStartRect.height);
            staticRects[i] = new Rect(176.0f, infoStartRect.y+28.0f*i, 40.0f, 20.0f);
        }
        for(int i=0; i<5; i++){
            passiveRects[i] = new Rect(156.0f+i*22.0f, infoRects[8].y, 20.0f, 20.0f);
        }
    }