98 Plants vs Zombies Ol_ Zombie Maze

Source: Internet
Author: User

Recently playing plants vs Zombie ol hit Zombie Maze, played a 700-point countdown first, rub ... As the saying goes, failure is a successful mother, so took a little time to write a small thing, I believe next time I will be able to take the first

The code is simple:

usingUnityengine;usingSystem.Collections;usingUnityengine.ui; Public classMyscript:monobehaviour {//Use this for initialization    voidStart () {}//Update is called once per frame    voidUpdate () {if(Input.getkeyup (Keycode.leftarrow)) {button_left ();//Call left        }        if(Input.getkeyup (Keycode.rightarrow)) {button_regith ();//invoke right-click        }        if(Input.getkeyup (keycode.space)) {foreach(Image Iinch_nimage) {i.getcomponent<Button> (). interactable =true; }        }    }     PublicImage _allimage;//Storing parent Objects     Publicimage[] _nimage;  Public voidButton_left () {_allimage.transform.rotate (0,0, -);//Rotate Parent Object_allimage.transform.localscale =NewVector3 (_allimage.transform.localscale.y, _allimage.transform.localscale.x, _allimage.transform.localscale.z);//long and wide interchange    }     Public voidButton_regith () {_allimage.transform.rotate (0,0, - -); _allimage.transform.localscale=NewVector3 (_allimage.transform.localscale.y, _allimage.transform.localscale.x, _allimage.transform.localscale.z    ); }     Public voidButton_initialize (intTemp//button Discoloration{_nimage[temp]. Getcomponent<Button> (). interactable =false; }     Public voidButton_enable ()//reset Button Color    {        foreach(Image Iinch_nimage) {i.getcomponent<Button> (). interactable =true; }    }     Public voidbutton_scene1 () {screen.setresolution ( the, -,false);//screen size is 1280,800, window    }     Public voidButton_scene2 () {screen.setresolution (640, -,false);//screen size is 640,400, window    }     Public voidButton_scene3 () {screen.setresolution (480, -,false);//screen size is 480,300, window    }     Public voidbutton_scene4 () {screen.setresolution ( the, $,false);//screen size is 320,200, window    }}

Project case: Link: http://pan.baidu.com/s/1mhvDVwW Password: qm5b

98 Plants vs Zombies Ol_ Zombie Maze

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.