Beispiel #1
0
    public void MakeDeadIsland(float timer)
    {
        if (dead_island.Equals(""))
        {
            dead_island = "Props/dead_island";
        }
        my_toy = null;
        block  = Peripheral.Instance.zoo.getObject(dead_island, true).GetComponent <dead_island>();
        Vector3 pos = this.transform.position;

        pos.z = 1.1f;
        float make_me = (timer > 0) ? timer : 10f;

        block.EnableMe(make_me, this);

        block.transform.position = pos;

        blocked = true;
    }
Beispiel #2
0
    void OnInput(bool is_click)
    {
        if (Central.Instance.getState() != GameState.InGame)
        {
            return;
        }

        //bool drag_mode = EagleEyes.Instance.floating_tower_scroll_driver.DragMode();
        bool drag_mode = Monitor.Instance.my_spyglass.isDisabledByDragButton();

        if (!drag_mode)
        {
            Monitor.Instance.my_spyglass.InitiateSpyglass();
        }

        if (block != null && block.gameObject.activeSelf == false)
        {
            block = null;
        }
        if (blocked && block == null && my_toy == null)
        {
            blocked = false;
        }

        if (drag_mode && blocked)
        {
            return;
        }

        if (my_toy != null)
        {
            if (onSelected != null)
            {
                onSelected(SelectedType.Island, parent.name);
            }
            return;
        }

        if (!drag_mode && blocked)
        {
            if (onSelected != null)
            {
                onSelected(SelectedType.Island, parent.name);
            }
            return;
        }



        Selected_toy = "";

        string selected = peripheral.getSelectedToy();

        if (is_click && onSelected != null)
        {
            onSelected(SelectedType.DirectIsland, parent.name);//when tapping an empty island, deselect everything else, only need bool is_click for mouse, not an issue for phone?
        }
        //  if (is_click && !blocked && selected != null) Noisemaker.Instance.Click(ClickType.Success);

        unitStats stats = Central.Instance.getToy(selected);

        if (stats == null)
        {
            //I DON'T KNOW
            //  if (is_click && onSelected != null) onSelected(SelectedType.DirectIsland, parent.name);//when tapping an empty island, deselect everything else, only need bool is_click for mouse, not an issue for phone?
            return;
        }



        if (stats.island_type != IslandType.Either && stats.island_type != island_type)
        {
            return;
        }

        if (selected != "")
        {
            Selected_toy = verify_toy_for_distance(selected);
        }

        if (drag_mode && onSelected != null)
        {
            onSelected(SelectedType.Island, parent.name);
        }
    }