Exemple #1
0
    void Start()
    {
        manager   = gameObject.GetComponent <mainManager> ();
        uimanager = gameObject.GetComponent <guiManager> ();
        generator = gameObject.GetComponent <enemyGenerator> ();


        if (GameObject.Find("missionCollector") != null)
        {
            logger = GameObject.Find("missionCollector").GetComponent <missionLog> ();
        }
        if (Comers != null)
        {
        }
        Comers           = GameObject.Find("comers").GetComponent <comersScript> ();
        deathmanager     = gameObject.transform.Find("deathController").GetComponent <deathControl> ();
        levelTime        = manager.levelTime;
        manager.isPaused = true;
        uimanager.startl();

        NGUITools.SetActive(points.gameObject, false);



        if (GoogleAnalytics.instance)
        {
            GoogleAnalytics.instance.LogScreen("Cat Game Menu");
        }
    }
 void Awake()
 {
     myBody            = GetComponent <Rigidbody2D>();
     GameMasterGo      = GameObject.Find("GameMaster");
     GuiManager        = GameMasterGo.GetComponent <guiManager>();
     GameSettings      = GameMasterGo.GetComponent <game_settings>();
     GameObjectHandler = GameMasterGo.GetComponent <GameObject_handler>();
 }
    void Awake()
    {
        GameMasterGo       = GameObject.Find("GameMaster");
        GuiManager         = GameMasterGo.GetComponent <guiManager>();
        GoHandler          = GameMasterGo.GetComponent <GameObject_handler>();
        GuiCanvasGo        = GuiManager.GuiCanvasGo;
        floatingTextPrefab = GuiManager.guiFloatingDamageTextPrefab;
        if (gameObject.layer == 8)
        {
            isPlayer = true;
        }

        myResistances = GetComponent <resistances>();
    }
Exemple #4
0
    IEnumerator OrderResult(PlateBehavior plate, bool success)
    {
        yield return(new WaitForSeconds(1));

        if (success)
        {
            Destroy(plate.gameObject);
            guiManager gui = FindObjectOfType <guiManager>();
            gui.UpdateOrderList();
        }
        else
        {
            Rigidbody plateBody = plate.GetComponent <Rigidbody>();
            plate.gameObject.layer = 12;
            plate.tag = "trash";
            plateBody.AddForce((Vector3.up - Vector3.forward) * 10, ForceMode.Impulse);
        }
    }
Exemple #5
0
    private void reloadOrderList()
    {
        List <SceneWrangler> wranglers = FindObjectsOfType <SceneWrangler>().ToList();

        foreach (SceneWrangler wrangler in wranglers)
        {
            if (wrangler.levelState == LevelLoadingProcess.Idle)
            {
                sceneWrangler = wrangler;
            }
        }


        print("reloading order list");
        armVictoryState = true;
        StageSettings_ld48 settings = (StageSettings_ld48)sceneWrangler.currentSceneContainer.stageSettings;

        orderQueue.Clear();
        activeOrderList.Clear();
        orderAddTimes.Clear();
        if (enforceTime)
        {
            foreach (Order order in settings.recipesOrders)
            {
                orderQueue.Enqueue(order);
            }
            activeOrderList.Add(orderQueue.Dequeue());
            orderAddTimes.Add(Time.time);
            lastAddTime = Time.time;
        }
        else
        {
            activeOrderList.AddRange(settings.recipesOrders);
        }

        guiManager gui = FindObjectOfType <guiManager>();

        gui.UpdateOrderList();
    }
 void Awake()
 {
     goHandler  = GetComponent <GameObject_handler>();
     GuiManager = GetComponent <guiManager>();
 }
Exemple #7
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Return))
        {
            _actualRit += _ritForInput;
        }

        _actualRit -= _ritMinusPerSecond * Time.deltaTime;

        //Debug.LogWarning(_actualRit);


        shoot            gc = (shoot)gameObject.GetComponent("shoot");
        guiManager       gm = (guiManager)Camera.mainCamera.GetComponent("guiManager");
        playerController pc = (playerController)gameObject.GetComponent("playerController");

        if (_actualRit < 20 && _actualRit > 6)
        {
            //print("1");
            gm.changeStatus(1);
            gc.disparo(disparos[0].factorCrecimiento, disparos[0].maxSize, disparos[0].coolDown);
            pc.setSpeed(2);
        }
        else if (_actualRit < 40 && _actualRit > 21)
        {
            //print("2");
            gm.changeStatus(2);
            gc.disparo(disparos[1].factorCrecimiento, disparos[1].maxSize, disparos[1].coolDown);
            pc.setSpeed(3);
        }
        else if (_actualRit < 55 && _actualRit > 41)
        {
            gm.changeStatus(3);
            gc.disparo(disparos[2].factorCrecimiento, disparos[2].maxSize, disparos[2].coolDown);
            //print("3");
            pc.setSpeed(4);
        }
        else if (_actualRit < 70 && _actualRit > 56)
        {
            gm.changeStatus(4);
            gc.disparo(disparos[3].factorCrecimiento, disparos[3].maxSize, disparos[3].coolDown);
            pc.setSpeed(5);
            //print("4");
        }
        else if (_actualRit < 85 && _actualRit > 71)
        {
            gm.changeStatus(5);
            gc.disparo(disparos[4].factorCrecimiento, disparos[4].maxSize, disparos[4].coolDown);
            pc.setSpeed(6);

            //print("5");
        }

        // muere por pocas pulsaciones
        if (_actualRit < _minRit)
        {
            //Aqui tb cargo lo de perder
            if (!_cheater)
            {
                Application.LoadLevel(3);
            }
        }

        // muerte por muchas pulsaciones
        if (_actualRit > _maxRit)
        {
            if (!_cheater)
            {
                Application.LoadLevel(3);
            }
            //Aqui tb cargo lo de perder
        }



        if (_inmune)
        {
            //print("Inmune = " + _inmune);
            _timeStamp += Time.deltaTime;
            if (_timeStamp > 0.25)
            {
                print("me han dao");
                ++_numParpadeos;
                _timeStamp = 0;
                gameObject.GetComponentInChildren <SkinnedMeshRenderer>().enabled = !gameObject.GetComponentInChildren <SkinnedMeshRenderer>().enabled;
            }
            if (_numParpadeos > _parpadeosTotal)
            {
                _numParpadeos = 0;
                _inmune       = false;
            }
        }
    }