// 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; }
// 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)); }
void Start() { playerSCR = (characterControllerScript)FindObjectOfType(typeof(characterControllerScript)); spddmg = playerSCR.spddmg; spddmg2 = playerSCR.spddmg2; spddmg3 = playerSCR.spddmg3; spddmg4 = playerSCR.spddmg4; }
// 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)); }
// 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; } } }
// 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!"); } }
// 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; } }
// 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; }
/// <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; }
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); } }
void Start() { player = (characterControllerScript)FindObjectOfType(typeof(characterControllerScript)); }
// 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; }
/// <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; }
void Start() { player = playerGO.GetComponent <characterControllerScript> (); }
// Use this for initialization void Start() { info = player.GetComponent <characterControllerScript> (); maxHP = (float)info.Maxhp; size = this.transform.localScale; }
void Start() { player = playerGO.GetComponent<characterControllerScript> (); }
// Use this for initialization void Start() { info = player.GetComponent<characterControllerScript> (); maxHP = (float)info.Maxhp; size = this.transform.localScale; }
// Use this for initialization void Start() { this.gameObject.collider2D.enabled = false; player = (characterControllerScript)FindObjectOfType(typeof(characterControllerScript)); heal = player.StacksItemsID [9] * 7; }
// 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; } } }
// Use this for initialization void Start() { this.gameObject.collider2D.enabled = false; player = (characterControllerScript)FindObjectOfType (typeof(characterControllerScript)); }
void Start() { timer = 0.3f; this.renderer.enabled = false; player = (characterControllerScript)FindObjectOfType(typeof(characterControllerScript)); }
// Use this for initialization void Start() { this.gameObject.collider2D.enabled = false; player = (characterControllerScript)FindObjectOfType (typeof(characterControllerScript)); heal = player.StacksItemsID [9] * 7; }
// Use this for initialization void Start() { this.gameObject.collider2D.enabled = false; player = (characterControllerScript)FindObjectOfType(typeof(characterControllerScript)); }