void InitializeScripts() { //analytics = GameObject.Find("AnalyticsControl").GetComponent<AnalyticsControl>(); // ads = GameObject.Find("Ads").GetComponent<AdsControl>(); // notif = GameObject.Find("Notifications").GetComponent<NotificationControl>(); local = GameObject.Find("LocalDB").GetComponent <LocalDBControl>(); // server = GameObject.Find("ServerAPI").GetComponent<BestHttpControl>(); score = GameObject.Find("ScoreControl").GetComponent <ScoreControl>(); // gc = GameObject.Find("GameCenter").GetComponent<GameCenterControl>(); // fb = GameObject.Find("Facebook").GetComponent<FacebookControl>(); //conn = GameObject.Find("ConnectionChecker").GetComponent<ConnectionChecker>(); //lb = GameObject.Find("LeaderboardMaster").GetComponent<LeaderboardMaster>(); //ach = GameObject.Find("AchievementMaster").GetComponent<AchievementMaster>(); // shop = GameObject.Find("Shop").GetComponent<ShopControl>(); // inv = GameObject.Find("Inventory").GetComponent<Inventory>(); //device = GameObject.Find("Device").GetComponent<Device>(); ui = GameObject.Find("UIControl").GetComponent <UIControl>(); player = GameObject.Find("PlayerInfo").GetComponent <PlayerInfo>(); // gift = GameObject.Find("GiftControl").GetComponent<GiftControl>(); //sound = GameObject.Find ("SoundControl").GetComponent<SoundControl>(); //appRate = GameObject.Find("AppRate").GetComponent<AppRate>(); game = GameObject.Find("Game").GetComponent <Game>(); gameplay = GameObject.Find("Bat").GetComponent <Gameplay>(); bat = GameObject.Find("Bat").GetComponent <Player>(); // sonar = GameObject.Find ("Sonar").GetComponent<Sonar>(); // screenSonar = GameObject.Find ("HomeSonar").GetComponent<ScreenSonar>(); if (GameObject.Find("Tutorial")) { // tut = GameObject.Find ("Tutorial").GetComponent<Tutorial> (); } // recorded = GameObject.Find ("GameplayRecorder").GetComponent<RecordedGameplay>(); // ai = GameObject.Find ("Bat2").GetComponent<AIBat>(); builder = GameObject.Find("TunnelBuilder").GetComponent <TunnelBuilder1>(); destroyer = GameObject.Find("TileDestroyer").GetComponent <TileDestroyer>(); camShake = GameObject.Find("Main Camera").GetComponent <CameraControl>(); }
private void Awake() { destroyer = FindObjectOfType <TileDestroyer>(); }
public void Activate(float direction, Vector2 position, TileDestroyer tileDestroyer) { transform.position = position; transform.localScale = new Vector2(transform.localScale.x * direction, transform.localScale.y); rigidBody.velocity = new Vector2(speed * direction, 0f); }