public void GetAllNeededReferences()
 {
    if(inGameUIManager_Ref == null)
         inGameUIManager_Ref = InGameUIManager.GetInstance();
     if (bubbleManager_Ref == null)
         bubbleManager_Ref = BubbleManager.GetInstance();
 }
Beispiel #2
0
    public void StartNewGame()
    {
        if (isPlaying)
        {
            return;
        }

        if (scoreManager != null)
        {
            Destroy(scoreManager);
        }

        if (bubbleManager != null)
        {
            Destroy(bubbleManager);
        }

        if (timeManager != null)
        {
            Destroy(timeManager);
        }

        isPlaying     = true;
        scoreManager  = gameObject.AddComponent <ScoreManager>();
        bubbleManager = gameObject.AddComponent <BubbleManager>();
        timeManager   = gameObject.AddComponent <TimeManager>();
        gameMenu.Close();
    }
Beispiel #3
0
 public void Initialize()
 {
     if (RyseAgent.WithWalls)
     {
         PlanesManagerEngine = new PlanesManager();
     }
     StaticData.CurrentPausePlayGameMode = PlayPauseMode.PlayOnMode;
     RigidsManagerEngine    = new RigidsManager();
     CollisionManagerEngine = new CollisionManager();
     MouseRigidsAdderEngine = new MouseAdder();
     ResizeManagerEngine    = new MouseResizeManager();
     SpringsManagerEngine   = new SpringsManager();
     MouseManagerEngine     = new MouseManager();
     BubbleManagerEngine    = new BubbleManager();
     BasicBackGroundEngine  = new BasicBackGround();
     RocketsManagerEngine   = new RocketsManager();
     BlowerManagerEngine    = new BlowerManager();
     LiquidServiceEngine    = new LiquidService();
     //CatchableRopeManagerEngine = new CatchableRopeManager();
     RodsManagerEngine              = new RodsManager();
     RopeOfRodsManagerEngine        = new RopeOfRodsManager();
     RocketsCarrierManagerEngine    = new RocketsCarrierManager();
     TileSpringServiceManagerEngine = new TileSpringServiceManager();
     NotificationManagerEngine      = new NotificationManager();
     PrefCompsManager = new PreferredCompsManager();
     EntraManager     = new EntraManager();
     EntraPathManager = new EntraPathManager();
     //TestMe();
 }
Beispiel #4
0
 // Update is called once per frame
 void Update()
 {
     if (isReturning)
     {
         // Calculate the distance.
         if (Vector2.Distance(dockedPoint, transform.position) < 0.5f)
         {
             GetComponent <Rigidbody2D> ().velocity = Vector2.zero;
             transform.position = dockedPoint;
             // Destroy bubbles attached.
             int killCount = transform.childCount;
             foreach (Transform child in transform)
             {
                 // Check with the BubbleManager what object this is.
                 if (child.gameObject.GetComponent <BubbleScript> () != null)
                 {
                     // This is a bubble.
                     LevelManager.Instance.updateHealth();
                     BubbleManager.Instance.Bubbles.Remove(child.gameObject.GetComponent <BubbleScript>());
                 }
                 else if (child.gameObject.GetComponent <TreasureScript> () != null)
                 {
                     // Is a treasure.
                     pilot.Gold += child.gameObject.GetComponent <TreasureScript>().Value;
                     BubbleManager.Instance.Treasures.Remove(child.gameObject.GetComponent <TreasureScript>());
                 }
                 BubbleManager.Destroy(child.gameObject);
             }
             isFiring    = false;
             isReturning = false;
         }
     }
 }
Beispiel #5
0
    void Start()
    {
        bulletManager = GetComponent <BulletManager>();
        bubbleManager = GetComponent <BubbleManager>();
        playerManager = GetComponent <PlayerManager>();

        canMove = true;
    }
 public override void Draw(GameTime gameTime)
 {
     GameRef.SpriteBatch.Begin();
     base.Draw(gameTime);
     ControlManager.Draw(GameRef.SpriteBatch);
     BubbleManager.Draw(GameRef.SpriteBatch);
     GameRef.SpriteBatch.End();
 }
    void awake()
    {
        if (Instance == null)
        {
            Instance = this;
        }

        DontDestroyOnLoad(gameObject);
    }
 public override void Update(GameTime gameTime)
 {
     if (InputHandler.LeftMousePressed())
     {
         BubbleManager.Create(new Vector2(InputHandler.MouseState.X, InputHandler.MouseState.Y));
     }
     ControlManager.Update(gameTime);
     base.Update(gameTime);
     BubbleManager.Update(gameTime);
 }
Beispiel #9
0
 public BubbleChainFinder(BubbleManager g)
 {
     generater = g;
     bloomList.Clear();
     testList.Clear();
     for (int i = 0; i < (int)BubbleObject.BubbleTypes.BubbleType_Max; i++)
     {
         allTypes.Add((BubbleObject.BubbleTypes)i);
     }
 }
Beispiel #10
0
 public override void Draw(GameTime gameTime)
 {
     GameRef.SpriteBatch.Begin();
     base.Draw(gameTime);
     ControlManager.Draw(GameRef.SpriteBatch);
     BubbleManager.Draw(GameRef.SpriteBatch);
     GameRef.SpriteBatch.DrawString(smallFont, "Fish eaten: " + player.fishEaten.ToString(), new Vector2(30, 30), Color.White);
     GameRef.SpriteBatch.End();
     player.Draw(GameRef.SpriteBatch);
     EnemyManager.Draw(GameRef.SpriteBatch);
 }
Beispiel #11
0
 void Awake()
 {
     if (bubbleManager_Ref == null)
     {
         bubbleManager_Ref = this;
     }
     else
     {
         Destroy(this);
     }
 }
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance == this)
     {
         Destroy(gameObject);
     }
 }
Beispiel #13
0
 public void setupGame()
 {
     gameRunning  = true;
     shakeDist    = new int[numPlayers];
     shakeDict[0] = calmMin + Random.Range(0, calmMax - calmMin);
     shakeDict[1] = slowMin + Random.Range(0, slowMax - slowMin);
     shakeDict[2] = fastMin + Random.Range(0, fastMax - fastMin);
     transform.GetChild(0).gameObject.SetActive(true);
     if (!bm)
     {
         bm = transform.GetChild(0).GetChild(1).GetComponent <BubbleManager>();
     }
 }
Beispiel #14
0
    public void BeginStun()
    {
        current_stun_time = total_stun_time;

        keep_dish_after_stun = false;
        stun_button_counter  = 0;

        bubble = BubbleManager.SpawnBubble(BubbleManager.Bubble.pushB,
                                           new Vector2(transform.position.x + 0.5f, transform.position.y + 0.3f),
                                           current_stun_time);

        StartCoroutine(TryToKeepDish(current_stun_time));
    }
Beispiel #15
0
    // Start is called before the first frame update
    void Start()
    {
        if (instance == null)
        {
            instance = this;
        }

        CurrentBubbleValue = CurrentBubble.GetComponent <BubbleScript>().SetRandomValue(BubbleScript.BubbleValue.Two, BubbleScript.BubbleValue.SixtyFour);
        NextBubbleValue    = NextBubble.GetComponent <BubbleScript>().SetRandomValue(BubbleScript.BubbleValue.Two, BubbleScript.BubbleValue.SixtyFour);


        SpawnBubbles();
    }
Beispiel #16
0
    public void Initialise(Vector3 position, Vector3 direction, string word, float duration, float popTime, BubbleManager bubbleManager)
    {
        transform.position = position;
        this.direction     = direction;
        this.word          = word;
        this.bubbleManager = bubbleManager;
        this.duration      = duration + intervalIncrease;
        this.popTime       = popTime + intervalIncrease / 2f;

        text.text = word;

        float scaleX = Math.Max(1, word.Length * 0.08f);

        cloud.transform.localScale = new Vector3(scaleX, 1, 1);
    }
Beispiel #17
0
 public override void Update(GameTime gameTime)
 {
     if (InputHandler.LeftMousePressed())
     {
         BubbleManager.Create(new Vector2(InputHandler.MouseState.X, InputHandler.MouseState.Y));
     }
     ControlManager.Update(gameTime);
     base.Update(gameTime);
     BubbleManager.Update(gameTime);
     player.Update();
     EnemyManager.Update(player, StateManager, GameRef);
     if (player.Size > 3.05f)    //  if player is the largest fish (fish size = (1-2)+(0-1)+0.5f
     {
         StateManager.ChangeState(GameRef.WinnerScreen);
     }
 }
Beispiel #18
0
    private void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
        }
        else
        {
            Destroy(this.gameObject);
        }

        _gridManager = GetComponent <HexGridManager>();

        _bubbleSOs = Resources.LoadAll <BubbleSO>("SoAssets/RegularBubbles");
        //if (_bubbleSOs != null) Debug.Log(_bubbleSOs.Length);
    }
Beispiel #19
0
    private void Eat(GameObject bubbleeaten)
    {
        //Camera.main.GetComponent<GameManager>().MissedBubble();
        BubbleManager bm = bubbleeaten.GetComponent <BubbleManager>();

        if (!bm.popped)
        {
            AppManager.instance.PlayAudio("bite");
            ParticleSystem particle = bubbleeaten.GetComponent <ParticleSystem>();
            bm.content.SetActive(false);
            particle.Play();
            bubbleeaten.GetComponent <SpriteRenderer>().enabled = false;
            Destroy(bubbleeaten, particle.main.duration);
            bm.popped = true;
        }
    }
Beispiel #20
0
    void Start()
    {
        BubbleManager = GameObject.FindObjectOfType <BubbleManager>();

        UICanvas = GameObject.FindWithTag("Canvas").transform;
        Bubble   = gameObject;
        rt       = GetComponent <RectTransform>();

        GetChange();
        if (transform.parent.parent.parent.parent.parent.childCount > 1)
        {
            return;

            allocatieBlock = transform.parent.parent.parent.parent.parent.GetChild(1).transform;
            allocatieBlock.GetChild(1).GetComponent <Button>().onClick.AddListener(GetMultiplier);
            allocatieBlock.GetChild(2).GetComponent <Button>().onClick.AddListener(GetMultiplier);
        }
        GetMultiplier();
        DisplayWorldCorners();
    }
Beispiel #21
0
 public static void DestroyInstance()
 {
     instance = null;
 }
Beispiel #22
0
 private void Awake()
 {
     _instance = this;
     Events    = new List <GetForceLocation>();
     Forces    = new List <BubbleForce>();
 }
Beispiel #23
0
 public void Awake()
 {
     base.Awake();
     bubble            = BubbleObject.GetComponent <BubbleManager>();
     characterSkeleton = GameObject.FindGameObjectWithTag("Character").GetComponent <SkeletonAnimation>().skeleton;
 }
Beispiel #24
0
 void Awake()
 {
     manager            = GameObject.Find("Manager").GetComponent <Manager>();
     bubbleManager      = GameObject.Find("Bubbles").GetComponent <BubbleManager> ();
     rigidbodyComponent = this.GetComponent <Rigidbody2D> ();
 }
Beispiel #25
0
        private static async void DoCommand(string command)
        {
            // Clean the input
            command = command.Trim();
            // Don't do anything if we have empty input
            if (command == "")
            {
                return;
            }

            // Split and handle command
            var args = SplitCommandLine(command).ToList();

            switch (args[0].ToLower())
            {
            case "help":
                PrintHelp();
                break;

            case "export-conversation":
                var bubbleGroupLocation = args[1];
                var jsonExportLocation  = args[2];
                BubbleGroupFactory.OutputBubblesInJsonFormat(bubbleGroupLocation, jsonExportLocation);
                break;

            case "register":
            {
                var service = ServiceManager.GetByName(args[1]);
                ServiceManager.Register(service);
                ServiceManager.RegisteredServicesDatabase.SaveAllRegistered();
                Console.WriteLine(service + " registered");
            }
            break;

            case "startall":
            {
                foreach (var service in ServiceManager.Registered)
                {
                    var unifiedService = service as UnifiedService;
                    if (unifiedService != null)
                    {
                        ServiceManager.StartUnified(unifiedService, null);
                    }
                    else
                    {
                        await ServiceManager.Start(service, true);
                    }
                    Console.WriteLine(service + " started");
                }
            }
            break;

            case "stop":
            {
                var service = ServiceManager.GetByName(args[1]);
                await ServiceManager.Abort(service);

                Console.WriteLine(service + " stopped");
            }
            break;

            case "start":
            {
                var service = ServiceManager.GetByName(args[1]);
                await ServiceManager.Start(service, true);

                Console.WriteLine(service + " started");
            }
            break;

            case "send":
            {
                var service    = ServiceManager.GetByName(args[1]);
                var address    = args[2];
                var message    = args[3];
                var textBubble = new TextBubble(Time.GetNowUnixTimestamp(), Bubble.BubbleDirection.Outgoing,
                                                address, null, false, service, message);
                await BubbleManager.Send(textBubble);

                Console.WriteLine(textBubble + " sent");
            }
            break;

            case "deploy-unregister":
            {
                var pluginName = args[1];
                var deployment = Settings.PluginDeployments.FirstOrDefault(x => x.Name.ToLower() == pluginName.ToLower());
                if (deployment != null)
                {
                    Settings.PluginDeployments.Remove(deployment);
                }
                MutableSettingsManager.Save(Settings);
                Console.WriteLine("Removed.");
            }
            break;

            case "deploy-register":
            {
                var pluginName = args[1];
                var path       = args[2].ToLower();
                if (Settings.PluginDeployments != null)
                {
                    var hasDeployment = Settings.PluginDeployments.FirstOrDefault(x => x.Name.ToLower() == pluginName.ToLower()) != null;
                    if (hasDeployment)
                    {
                        Console.WriteLine("Plugin has already been registered in deployment system.");
                        break;
                    }
                }
                if (Settings.PluginDeployments == null)
                {
                    Settings.PluginDeployments = new List <TerminalSettings.PluginDeployment>();
                }
                Settings.PluginDeployments.Add(new TerminalSettings.PluginDeployment
                    {
                        Name = pluginName,
                        Path = path,
                    });
                MutableSettingsManager.Save(Settings);
                Console.WriteLine("Plugin registered!");
            }
            break;

            case "deploy-clean":
            {
                var pluginName = args[1];
                var deployment = Settings.PluginDeployments.FirstOrDefault(x => x.Name.ToLower() == pluginName.ToLower());
                if (deployment != null)
                {
                    deployment.Assemblies = null;
                    MutableSettingsManager.Save(Settings);
                    Console.WriteLine("Cleaned assemblies.");
                }
                else
                {
                    Console.WriteLine("Could not find plugin deployment: " + pluginName);
                }
            }
            break;

            case "deploy":
            {
                var pluginName         = args[1];
                var deployment         = Settings.PluginDeployments.FirstOrDefault(x => x.Name.ToLower() == pluginName.ToLower());
                var oldAssemblies      = deployment.Assemblies ?? new List <TerminalSettings.PluginDeployment.Assembly>();
                var assembliesToDeploy = new List <TerminalSettings.PluginDeployment.Assembly>();
                var newAssemblies      = new List <TerminalSettings.PluginDeployment.Assembly>();
                var pluginManifest     = Path.Combine(deployment.Path, "PluginManifest.xml");
                if (!File.Exists(pluginManifest))
                {
                    Console.WriteLine("A plugin manifest file is needed!");
                    break;
                }
                foreach (var assemblyFile in Directory.EnumerateFiles(deployment.Path, "*.dll")
                         .Concat(new [] { pluginManifest }))
                {
                    var assemblyFileName = Path.GetFileName(assemblyFile);
                    if (PlatformManager.AndroidLinkedAssemblies.Contains(assemblyFileName))
                    {
                        continue;
                    }

                    var lastModified = File.GetLastWriteTime(assemblyFile);
                    var newAssembly  = new TerminalSettings.PluginDeployment.Assembly
                    {
                        Name     = assemblyFileName,
                        Modified = lastModified
                    };
                    newAssemblies.Add(newAssembly);

                    var oldAssembly = oldAssemblies.FirstOrDefault(x => x.Name == assemblyFileName);
                    if (oldAssembly == null)
                    {
                        assembliesToDeploy.Add(newAssembly);
                    }
                    else if (oldAssembly.Modified != lastModified)
                    {
                        assembliesToDeploy.Add(newAssembly);
                    }
                }
                deployment.Assemblies = newAssemblies;
                MutableSettingsManager.Save(Settings);
                var    devices = AdbHelper.Instance.GetDevices(AndroidDebugBridge.SocketAddress);
                Device selectedDevice;
                if (devices.Count > 1)
                {
                    Console.WriteLine("Please pick a device:");
                    var counter = 0;
                    foreach (var device in devices)
                    {
                        Console.WriteLine(counter++ + ") " + device.SerialNumber);
                    }
                    Console.Write("Selection: ");
                    var selection = int.Parse(Console.ReadLine().Trim());
                    selectedDevice = devices[selection];
                }
                else
                {
                    selectedDevice = devices.First();
                }
                var remotePath = "/sdcard/Disa/plugins/" + deployment.Name;
                if (!selectedDevice.FileSystem.Exists(remotePath))
                {
                    selectedDevice.FileSystem.MakeDirectory(remotePath);
                }
                foreach (var assemblyToDeploy in assembliesToDeploy)
                {
                    Console.WriteLine("Transferring " + assemblyToDeploy.Name + "...");
                    var remoteAssembly = remotePath + "/" + assemblyToDeploy.Name;
                    if (selectedDevice.FileSystem.Exists(remoteAssembly))
                    {
                        selectedDevice.FileSystem.Delete(remoteAssembly);
                    }
                    selectedDevice.SyncService.PushFile(Path.Combine(deployment.Path, assemblyToDeploy.Name),
                                                        remoteAssembly, new SyncServiceProgressMonitor());
                }
                Console.WriteLine("Plugin deployed! Restarting Disa...");
                selectedDevice.ExecuteShellCommand("am force-stop com.disa", new ShellOutputReceiver());
                Task.Delay(250).Wait();
                selectedDevice.ExecuteShellCommand("monkey -p com.disa -c android.intent.category.LAUNCHER 1", new ShellOutputReceiver());
                Console.WriteLine("Disa restarted!");
            }
            break;

            case "deploy-print-dependencies":
            {
                var pluginName = args[1];
                var deployment = Settings.PluginDeployments.FirstOrDefault(x => x.Name.ToLower() == pluginName.ToLower());
                foreach (var assemblyFile in Directory.EnumerateFiles(deployment.Path, "*.dll"))
                {
                    var assemblyFileName = Path.GetFileName(assemblyFile);
                    if (PlatformManager.AndroidLinkedAssemblies.Contains(assemblyFileName))
                    {
                        continue;
                    }
                    var module = ModuleDefinition.ReadModule(assemblyFile);
                    Console.WriteLine(assemblyFileName + ": ");
                    foreach (var referenceAssembly in module.AssemblyReferences)
                    {
                        Console.WriteLine("> " + referenceAssembly.FullName);
                    }
                }
            }
            break;

            default:
            {
                var service = ServiceManager.GetByName(args[0]);
                if (service != null)
                {
                    var terminal = service as ITerminal;
                    if (terminal != null)
                    {
                        try
                        {
                            terminal.DoCommand(args.GetRange(1, args.Count - 1).ToArray());
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine("Error in processing a service terminal command: " + ex);
                        }
                    }
                }
            }
            break;
            }
        }
Beispiel #26
0
 void Awake()
 {
     Instance = this;
 }
Beispiel #27
0
 void Awake()
 {
     if(mInst == null) mInst = this;
     animator = GetComponent<Animator>();
 }
Beispiel #28
0
 protected override void OnPrefabInit()
 {
     instance = this;
 }