Exemplo n.º 1
0
        // Use this for initialization
        void Start()
        {
            //TODO 按钮没有手动赋值需要自动复制,所有都没做异常处理
            itemsPrice = new int[items.Length];
            mc         = MagicCore.Instance;
            //绑定item的响应函数
            ItemsSpawn();

            //
            skillPoint.onClick.AddListener(SkillPoint);
            skillPoint.GetComponentInChildren <Text>().text = "价格:" + 10;
            skillPointPrice = 10;

            skill.onClick.AddListener(delegate()
            {
                CostMoney(skillPrice);
                skill.interactable = false;
                skill.GetComponentInChildren <Text>().text = "已购买,无法再次购买";
                //测试代码
                skillsRoot.SetActive(true);
                skill.interactable = false;
                SkillSpawn(null);

                /*增加技能
                 * Skill s = new Skill();
                 * if(!mc.addSKill())
                 * {
                 *  //产生三个按钮
                 *  skillsRoot.SetActive(true);
                 *  skill.interactable = false;
                 * }
                 */

                //skill.gameObject.SetActive(false);
            });
            skill.GetComponentInChildren <Text>().text = "XX技能\n价格:" + 30;
            skillPrice = 30;

            ButtonCheck();
        }
Exemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        magic = MagicCore.Instance;
        pList = magic.getPoint();

        pointStatus();
        //判断状态,确定节点是否显示,以及其魔力值等
        if (magic.getPoint(int.Parse(this.tag)).MaxMagic == 0)
        {
            this.GetComponent <SpriteRenderer>().sprite = null;
        }
        else if (!magic.getPointBroked(int.Parse(this.tag)))
        {
            this.GetComponentInChildren <TextMesh>().text =
                magic.getPoint(int.Parse(this.tag)).magic + "/" + magic.getPoint(int.Parse(this.tag)).MaxMagic;
            this.GetComponent <SpriteRenderer>().sprite = oldSprite;
        }
        //节点颜色初始化
        this.GetComponent <SpriteRenderer>().color = toPointColor(magic.getPointColor(int.Parse(this.tag)));
        if (magic.isDefencer(int.Parse(this.tag)))
        {
            this.GetComponent <SpriteRenderer>().color = Color.gray;
        }
        //当前节点变大
        if (magic.getPos() == int.Parse(this.tag))
        {
            this.transform.localScale = new Vector3(5, 5, 0);
        }
        else
        {
            this.transform.localScale = new Vector3(3, 3, 0);
        }

        //空白处按右键,取消所有操作
        if (Input.GetMouseButton(1) && Clickcontrol.isDrag)
        {
            magic.RclickP(-1);
            Clickcontrol.isDrag = false;
        }
    }
Exemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     magic      = MagicCore.Instance;
     SkillPoint = this.GetComponent <Text>();
 }
Exemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     mc = MagicCore.Instance;
 }
Exemplo n.º 5
0
    // Update is called once per frame
    void Update()
    {
        magic = MagicCore.Instance;
        pList = magic.getPoint();



        //判断状态,确定节点是否显示,以及其魔力值等
        if (magic.getPoint(int.Parse(this.tag)).MaxMagic == 0)
        {
            this.GetComponent <SpriteRenderer>().sprite = null;
        }
        else if (!magic.getPointBroked(int.Parse(this.tag)))
        {
            this.transform.GetChild(0).GetComponent <TextMesh>().text =
                magic.getPoint(int.Parse(this.tag)).magic.ToString();
            if (magic.getPoint(int.Parse(this.tag)).isProtected)
            {
                this.transform.GetChild(0).GetComponent <TextMesh>().color = Color.blue;
            }
            else
            {
                this.transform.GetChild(0).GetComponent <TextMesh>().color = Color.white;
            }
            this.GetComponent <SpriteRenderer>().sprite = oldSprite;
        }

        pointStatus();

        //节点颜色初始化
        this.GetComponent <SpriteRenderer>().color = toPointColor(magic.getPointColor(int.Parse(this.tag)));
        if (magic.getPoint(int.Parse(this.tag)).isActivity)
        {
            if (magic.getPointColor(int.Parse(this.tag)) == PointColor.black)
            {
                this.transform.GetChild(1).localScale = new Vector3(0.05f, 0.05f, 0);
            }
            if (magic.getPointColor(int.Parse(this.tag)) == PointColor.blue)
            {
                this.transform.GetChild(2).localScale = new Vector3(0.05f, 0.05f, 0);
            }
            if (magic.getPointColor(int.Parse(this.tag)) == PointColor.red)
            {
                this.transform.GetChild(3).localScale = new Vector3(0.05f, 0.05f, 0);
            }
            if (magic.getPointColor(int.Parse(this.tag)) == PointColor.white)
            {
                this.transform.GetChild(4).localScale = new Vector3(0.05f, 0.05f, 0);
            }
            if (magic.getPointColor(int.Parse(this.tag)) == PointColor.yellow)
            {
                this.transform.GetChild(5).localScale = new Vector3(0.05f, 0.05f, 0);
            }
        }
        else
        {
            this.transform.GetChild(1).localScale = new Vector3(0, 0, 0);
            this.transform.GetChild(2).localScale = new Vector3(0, 0, 0);
            this.transform.GetChild(3).localScale = new Vector3(0, 0, 0);
            this.transform.GetChild(4).localScale = new Vector3(0, 0, 0);
            this.transform.GetChild(5).localScale = new Vector3(0, 0, 0);
        }
        if (magic.isDefencer(int.Parse(this.tag)))
        {
            this.GetComponent <SpriteRenderer>().color = Color.gray;
        }

        if (magic.getFlag() != ClickFlag.wait)
        {
            ////当前节点变大
            //if (magic.getPos() == int.Parse(this.tag))
            //    this.transform.localScale = new Vector3(3, 3, 0);
            //else
            //    this.transform.localScale = new Vector3(2, 2, 0);
        }

        //空白处按右键,取消所有操作
        if (Input.GetMouseButton(1) && Clickcontrol.isDrag)
        {
            magic.RclickP(-1);
            Clickcontrol.isDrag = false;
        }
    }
Exemplo n.º 6
0
    // Use this for initialization
    void Start()
    {
        magic = MagicCore.Instance;

        items = new List <ItemName>();
        buffs = new Dictionary <BuffName, int>();

        it = (ItemName)Random.Range(0, 13);
        while (magic.getItemHad(it))
        {
            it = (ItemName)Random.Range(0, 13);
        }
        sk = (SkillName)Random.Range(0, (int)SkillName.count);
        while (magic.getSKillHad(sk))
        {
            sk = (SkillName)Random.Range(0, (int)SkillName.count);
        }
        Ibuff               = magic.itemTool.getItem(it);
        sklist              = magic.skillTool.getSkill(sk);
        monster             = new Monster();
        mouse               = new mouseevent();
        lineGameObjectlist  = new List <GameObject>();
        pointGameObjectlist = new List <GameObject>();
        itemGameObjectlist  = new List <GameObject>();
        buffGameObjectlist  = new List <GameObject>();
        isDrag              = false;
        isAttacking         = false;
        isShow              = false;
        isDrop              = false;
        instance            = node;
        //四个结算物品
        overCount = 4;
        //buff个数
        buffCount = 0;
        InitializeMonsterDegreeList();
        if (MapMain.Instance.IsBoss())
        {
            InitializeMonster(MonsterType.Boss_TurnMan);
        }
        else
        {
            currentLevel = MapMain.Instance.CurrentLevel();
            MonsterMatch currentMatch = ChooseMonster();
            InitializeMonster(currentMatch.monster1);
            InitializeMonster(currentMatch.monster2);
            InitializeMonster(currentMatch.monster3);
        }


        // magic.addMonster(monster0.GetComponent<Monster>());
        magic.startTurn();

        //初始化节点位置
        InitPointPos();
        //初始化连线
        InitLine();
        //初始化花纹
        InitFigure();

        //初始化怪物
        Initmonster();
    }