示例#1
0
 // Use this for initialization
 void Start()
 {
     GGUUII = (OnGUIs)(FindObjectOfType (typeof(OnGUIs)));
     int rand = Random.Range (1, 20);
     if (rand > 9)
         Destroy (this.gameObject);
     script = character.GetComponent<characterControllerScript> ();
     int randPrice = Random.Range (1, 4);
     switch (randPrice) {
     case 1:
     {
             price = 50;
             rare = 1;
             break;
     }
     case 2:
     {
             price = 100;
             rare = 2;
             break;
     }
     case 3:
     {
             price = 200;
             rare = 3;
             break;
     }
     }
     item = Random.Range (0, 11);
     //item = Random.Range (1, 5) * rare + Random.Range(0,3); // RARE - 1 (common) №1-10, RARE - 2 (rare) №11-20, RARE - 3 (unusial) № 21-30
     if (item > 10)
         item = 10;
     if (item == 0)
         item = 3;
 }
示例#2
0
 // Use this for initialization
 void Start()
 {
     this.gameObject.collider2D.enabled = false;
     loot = false;
     destroy = false;
     //GO = (CheckGoldEmpty)FindObjectOfType (typeof (CheckGoldEmpty));
     player = (characterControllerScript)FindObjectOfType (typeof(characterControllerScript));
 }
示例#3
0
 void Start()
 {
     playerSCR = (characterControllerScript)FindObjectOfType(typeof(characterControllerScript));
     spddmg    = playerSCR.spddmg;
     spddmg2   = playerSCR.spddmg2;
     spddmg3   = playerSCR.spddmg3;
     spddmg4   = playerSCR.spddmg4;
 }
示例#4
0
 // Use this for initialization
 void Start()
 {
     this.gameObject.collider2D.enabled = false;
     loot    = false;
     destroy = false;
     //GO = (CheckGoldEmpty)FindObjectOfType (typeof (CheckGoldEmpty));
     player = (characterControllerScript)FindObjectOfType(typeof(characterControllerScript));
 }
示例#5
0
    // Use this for initialization
    void OnGUI()
    {
        script = character.GetComponent<characterControllerScript>();
        hp = script.hp;
        maxhp = script.Maxhp;
        money = script.money;
        damage = script.Damage;
        attackspped = script.spddmg;
        kdturn = script.KDturn;

        //GUI.Box (new Rect (0, 0, 100, 20), "HP: "+ hp + "%");
        //GUI.Box (new Rect (0, 20, 100, 20), "Money: "+money+"$");
        GUI.TextArea (new Rect (Screen.width - 120, 20, 100, 30), money + " $",MONEYB);
        GUI.Box (new Rect (0, 40, 100, 20), "DMG: "+damage+"$");
        GUI.Box (new Rect (0, 60, 100, 20), "Attack speed: "+attackspped+"$");
        GUI.Box (new Rect (0, 80, 100, 20), "KD spin: "+kdturn+"$");
        GUI.TextArea (new Rect (Screen.width / 2, Screen.height - 45, 100, 20), hp + "/" + maxhp,HPB);
        if (price !=0)
            GUI.TextArea (new Rect (Screen.width/2-50, Screen.height/2-15, 100, 30), "Price of chest: " + price + "$",chestGUI);
        /*
        GUI.BeginGroup ( new Rect(100, 100, hp/maxhp*100*2.93f, 35)); //где 2.93 - ширина текстуры/100
        GUI.DrawTexture( new Rect(0, 0, 293, 50), hpbar);  //293 - ширина текстуры
        GUI.EndGroup();
        */
        if(script.allive==false)
        {
            // Make a background box
            GUI.Box(new Rect(Screen.width/2-100,Screen.height/2-45,200,60), "You are DEAD.");

            // Make the first button. If it is pressed, Application.Loadlevel (1) will be executed
            if(GUI.Button(new Rect(Screen.width/2-90,Screen.height/2-20,80,20), "Try Again!")) {
                Application.LoadLevel("Level_1");
            }

            // Make the second button.
            if(GUI.Button(new Rect(Screen.width/2,Screen.height/2-20,80,20), "Quit")) {
                Application.LoadLevel("Menu");
            }
        }
        if (exit) {
            Time.timeScale = 0;
            GUI.Box (new Rect (Screen.width / 2 - 100, Screen.height / 2 - 45, 200, 60), "You really want to quit?.");
            if (GUI.Button (new Rect (Screen.width / 2 - 90, Screen.height / 2 - 20, 80, 20), "NOOOOO")) {
                //Application.LoadLevel ("Level_1");
                Time.timeScale = 1;
                exit= false;
            }
            if (GUI.Button (new Rect (Screen.width / 2, Screen.height / 2 - 20, 80, 20), "Quit")) {
                Application.LoadLevel ("Menu");
                Time.timeScale = 1;
                exit= false;
            }
        }
    }
示例#6
0
 // Start is called before the first frame update
 void Start()
 {
     //initialize the variables
     playerInput      = GetComponent <playerRecorder>();
     objectController = GetComponent <characterControllerScript>();
     inputRec         = GetComponent <inputRecorder>();
     //Player starts as idle until their clicked on, prob change this later
     currentState  = state.Reset;
     timer         = 0;
     playbackTimer = 0;
 }
 void OnTriggerEnter2D(Collider2D other)
 {
     attacked = true;
     if (other.gameObject.tag == "Player")
     {
         if(attacked && allive && TimeToAttack)
         {
             EnSCR.audio.Play();
             playerSCR = other.GetComponent<characterControllerScript>();
             playerSCR.TakeDmg(dmg);
             attacked = false;
             EnSCR.attack = false;
         }
         //Debug.Log("WOW!");
     }
 }
 void OnTriggerEnter2D(Collider2D other)
 {
     attacked = true;
     if (other.gameObject.tag == "Player")
     {
         if (attacked && allive && TimeToAttack)
         {
             EnSCR.audio.Play();
             playerSCR = other.GetComponent <characterControllerScript>();
             playerSCR.TakeDmg(dmg);
             attacked     = false;
             EnSCR.attack = false;
         }
         //Debug.Log("WOW!");
     }
 }
示例#9
0
    // Use this for initialization
    void Start()
    {
        GGUUII = (OnGUIs)(FindObjectOfType(typeof(OnGUIs)));
        int rand = Random.Range(1, 20);

        if (rand > 9)
        {
            Destroy(this.gameObject);
        }
        script = character.GetComponent <characterControllerScript> ();
        int randPrice = Random.Range(1, 4);

        switch (randPrice)
        {
        case 1:
        {
            price = 50;
            rare  = 1;
            break;
        }

        case 2:
        {
            price = 100;
            rare  = 2;
            break;
        }

        case 3:
        {
            price = 200;
            rare  = 3;
            break;
        }
        }
        item = Random.Range(0, 11);
        //item = Random.Range (1, 5) * rare + Random.Range(0,3); // RARE - 1 (common) №1-10, RARE - 2 (rare) №11-20, RARE - 3 (unusial) № 21-30
        if (item > 10)
        {
            item = 10;
        }
        if (item == 0)
        {
            item = 3;
        }
    }
示例#10
0
    // Use this for initialization
    void Start()
    {
        lootableArcher  = true;
        lootArcher      = Random.Range(10, 18);
        camScriptArcher = (CameraSmooth)FindObjectOfType(typeof(CameraSmooth));
        characterControllerScript player = (characterControllerScript)FindObjectOfType(typeof(characterControllerScript));

        //+ on directorAI
        director = (CreatureDirector)FindObjectOfType(typeof(CreatureDirector));
        director.countCreature++;
        //
        playerTransformArcher = player.transform;
        playerscrArcher       = (characterControllerScript)FindObjectOfType(typeof(characterControllerScript));
        animArcher            = GetComponent <Animator>();
        scaleDespawn          = despawnT;
        alliveArcher          = true;
    }
示例#11
0
    /// <summary>
    /// Начальная инициализация
    /// </summary>
    private void Start()
    {
        smoothtext = 1.0f;
        lootable   = true;
        loot       = Random.Range(7, 14);
        camScript  = (CameraSmooth)FindObjectOfType(typeof(CameraSmooth));
        characterControllerScript player = (characterControllerScript)FindObjectOfType(typeof(characterControllerScript));

        //+ on directorAI
        director = (CreatureDirector)FindObjectOfType(typeof(CreatureDirector));
        director.countCreature++;
        //
        playerTransform = player.transform;
        playerscr       = (characterControllerScript)FindObjectOfType(typeof(characterControllerScript));
        anim            = GetComponent <Animator>();
        allive          = true;
        scaleDespawn    = despawnT;
    }
示例#12
0
    void OnTriggerEnter2D(Collider2D other)
    {
        //DestroyObject (this);
        //Debug.Log ("boob bay");
        if (other.gameObject.tag == "Player")
        {
            hit    = true;
            player = other.GetComponent <characterControllerScript>();
            player.TakeDmg(3);
            //var shotTransform = Instantiate(boooom) as Transform;
            //shotTransform.position = transform.position;
            DestroyObject(gameObject, 0.01f);
        }
        if (other.gameObject.tag == "ground")
        {
            hit = true;


            DestroyObject(gameObject, 0.01f);
            //Destroy(this);
        }
    }
示例#13
0
 void Start()
 {
     player = (characterControllerScript)FindObjectOfType(typeof(characterControllerScript));
 }
示例#14
0
 // Use this for initialization
 void Start()
 {
     lootableArcher = true;
     lootArcher = Random.Range (10, 18);
     camScriptArcher = (CameraSmooth)FindObjectOfType (typeof(CameraSmooth));
     characterControllerScript player = (characterControllerScript)FindObjectOfType(typeof(characterControllerScript));
     //+ on directorAI
     director = (CreatureDirector)FindObjectOfType (typeof(CreatureDirector));
     director.countCreature++;
     //
     playerTransformArcher = player.transform;
     playerscrArcher = (characterControllerScript)FindObjectOfType(typeof(characterControllerScript));
     animArcher = GetComponent<Animator>();
     scaleDespawn = despawnT;
     alliveArcher = true;
 }
示例#15
0
 /// <summary>
 /// Начальная инициализация
 /// </summary>
 private void Start()
 {
     smoothtext = 1.0f;
     lootable = true;
     loot = Random.Range (7, 14);
     camScript = (CameraSmooth)FindObjectOfType (typeof(CameraSmooth));
     characterControllerScript player = (characterControllerScript)FindObjectOfType(typeof(characterControllerScript));
     //+ on directorAI
     director = (CreatureDirector)FindObjectOfType (typeof(CreatureDirector));
     director.countCreature++;
     //
     playerTransform = player.transform;
     playerscr = (characterControllerScript)FindObjectOfType(typeof(characterControllerScript));
     anim = GetComponent<Animator>();
     allive = true;
     scaleDespawn = despawnT;
 }
示例#16
0
 void Start()
 {
     playerSCR = (characterControllerScript)FindObjectOfType(typeof(characterControllerScript));
     spddmg = playerSCR.spddmg;
     spddmg2 = playerSCR.spddmg2;
     spddmg3 = playerSCR.spddmg3;
     spddmg4 = playerSCR.spddmg4;
 }
 void Start()
 {
     player = (characterControllerScript)FindObjectOfType(typeof(characterControllerScript));
 }
示例#18
0
 void Start()
 {
     player = playerGO.GetComponent <characterControllerScript> ();
 }
示例#19
0
 // Use this for initialization
 void Start()
 {
     info  = player.GetComponent <characterControllerScript> ();
     maxHP = (float)info.Maxhp;
     size  = this.transform.localScale;
 }
示例#20
0
 void Start()
 {
     player = playerGO.GetComponent<characterControllerScript> ();
 }
示例#21
0
 // Use this for initialization
 void Start()
 {
     info = player.GetComponent<characterControllerScript> ();
     maxHP = (float)info.Maxhp;
     size = this.transform.localScale;
 }
示例#22
0
 // Use this for initialization
 void Start()
 {
     this.gameObject.collider2D.enabled = false;
     player = (characterControllerScript)FindObjectOfType(typeof(characterControllerScript));
     heal   = player.StacksItemsID [9] * 7;
 }
示例#23
0
    // Use this for initialization
    void OnGUI()
    {
        script      = character.GetComponent <characterControllerScript>();
        hp          = script.hp;
        maxhp       = script.Maxhp;
        money       = script.money;
        damage      = script.Damage;
        attackspped = script.spddmg;
        kdturn      = script.KDturn;

        //GUI.Box (new Rect (0, 0, 100, 20), "HP: "+ hp + "%");
        //GUI.Box (new Rect (0, 20, 100, 20), "Money: "+money+"$");
        GUI.TextArea(new Rect(Screen.width - 120, 20, 100, 30), money + " $", MONEYB);
        GUI.Box(new Rect(0, 40, 100, 20), "DMG: " + damage + "$");
        GUI.Box(new Rect(0, 60, 100, 20), "Attack speed: " + attackspped + "$");
        GUI.Box(new Rect(0, 80, 100, 20), "KD spin: " + kdturn + "$");
        GUI.TextArea(new Rect(Screen.width / 2, Screen.height - 45, 100, 20), hp + "/" + maxhp, HPB);
        if (price != 0)
        {
            GUI.TextArea(new Rect(Screen.width / 2 - 50, Screen.height / 2 - 15, 100, 30), "Price of chest: " + price + "$", chestGUI);
        }

        /*
         * GUI.BeginGroup ( new Rect(100, 100, hp/maxhp*100*2.93f, 35)); //где 2.93 - ширина текстуры/100
         * GUI.DrawTexture( new Rect(0, 0, 293, 50), hpbar);  //293 - ширина текстуры
         * GUI.EndGroup();
         */
        if (script.allive == false)
        {
            // Make a background box
            GUI.Box(new Rect(Screen.width / 2 - 100, Screen.height / 2 - 45, 200, 60), "You are DEAD.");

            // Make the first button. If it is pressed, Application.Loadlevel (1) will be executed
            if (GUI.Button(new Rect(Screen.width / 2 - 90, Screen.height / 2 - 20, 80, 20), "Try Again!"))
            {
                Application.LoadLevel("Level_1");
            }

            // Make the second button.
            if (GUI.Button(new Rect(Screen.width / 2, Screen.height / 2 - 20, 80, 20), "Quit"))
            {
                Application.LoadLevel("Menu");
            }
        }
        if (exit)
        {
            Time.timeScale = 0;
            GUI.Box(new Rect(Screen.width / 2 - 100, Screen.height / 2 - 45, 200, 60), "You really want to quit?.");
            if (GUI.Button(new Rect(Screen.width / 2 - 90, Screen.height / 2 - 20, 80, 20), "NOOOOO"))
            {
                //Application.LoadLevel ("Level_1");
                Time.timeScale = 1;
                exit           = false;
            }
            if (GUI.Button(new Rect(Screen.width / 2, Screen.height / 2 - 20, 80, 20), "Quit"))
            {
                Application.LoadLevel("Menu");
                Time.timeScale = 1;
                exit           = false;
            }
        }
    }
示例#24
0
 // Use this for initialization
 void Start()
 {
     this.gameObject.collider2D.enabled = false;
     player = (characterControllerScript)FindObjectOfType (typeof(characterControllerScript));
 }
示例#25
0
 void Start()
 {
     timer = 0.3f;
     this.renderer.enabled = false;
     player = (characterControllerScript)FindObjectOfType(typeof(characterControllerScript));
 }
示例#26
0
 // Use this for initialization
 void Start()
 {
     this.gameObject.collider2D.enabled = false;
     player = (characterControllerScript)FindObjectOfType (typeof(characterControllerScript));
     heal = player.StacksItemsID [9] * 7;
 }
示例#27
0
 // Use this for initialization
 void Start()
 {
     this.gameObject.collider2D.enabled = false;
     player = (characterControllerScript)FindObjectOfType(typeof(characterControllerScript));
 }