Пример #1
0
    public void reenter()
    {
        this.GetComponent <Animator> ().SetTrigger("InventoryReentry");
        //this.GetComponent<Animator> ().SetBool ("InventoryOpen", true);
        targetY = y = showingY;
        Vector3 newPos = this.transform.localPosition;

        newPos.y = y;
        this.transform.localPosition = newPos;
        isOpen = true;
        delay  = 0.0f;
        uiInvRef.show();
        level.storeStringValue("ReentryCondition", "Inventory");

        level.storePlayerCoordinates();
    }
Пример #2
0
 public void clickOnPowerCircle()
 {
     fader._wa_fadeOut(this);
     this.isWaitingForActionToComplete = true;
     clickedItem = UIInventoryClickItem.powerCircle;
     levelRef.storeStringValue("ReturnLocation", levelRef.locationName);
     levelRef.storeStringValue("ReentryCondition", "Inventory");
     levelRef.storeIntValue("InventoryLevel", 0);
     levelRef.storePlayerCoordinates();
     //levelRef.storePhysicalCameraPosition ();
 }
Пример #3
0
 new void Update()
 {
     if (state == 0)
     {
         if (!isWaitingForActionToComplete)
         {
             level.storeBoolValue("PlayerMustMaterialize", true);
             level.storeStringValue("ReturnLocation", targetWorld);
             level.loadScene("TransWorldTunnel");
         }
     }
 }
Пример #4
0
    new void Update()
    {
        if (state == 0)
        {
            return;
        }

        if (state == 1)
        {
            if (isWaitingForActionToComplete)
            {
                return;
            }
            level.storeStringValue("GroundType", "");
            level.loadScene(destination);
        }
    }
Пример #5
0
 void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Player")
     {
         if (dataType == DataType.Bool)
         {
             levelController.storeBoolValue(variableName, boolValue);
         }
         if (dataType == DataType.String)
         {
             levelController.storeStringValue(variableName, stringValue);
         }
         if (dataType == DataType.Int)
         {
             levelController.storeIntValue(variableName, intValue);
         }
         if (dataType == DataType.Float)
         {
             levelController.storeFloatValue(variableName, floatValue);
         }
     }
 }
Пример #6
0
    // Update is called once per frame
    new void Update()
    {
        if (state == HUDCrackGlassState.cracking)
        {
            elapsedTime += Time.deltaTime;
            if (elapsedTime > nextTimeToCrack)
            {
                elapsedTime     = 0.0f;
                nextTimeToCrack = FloatRandom.floatRandomRange(minTimeToCrack, maxTimeToCrack);
                if (frame < crackedGlass.Length - 1)
                {
                    ++frame;
                    theImage.sprite = crackedGlass [frame];
                    levelController.playSound(crackAudio [frame]);
                }
                else
                {
                    state = HUDCrackGlassState.cracked;
                }
            }
        }

        if (state == HUDCrackGlassState.cracked)
        {
        }

        if (state == HUDCrackGlassState.changingActivity)
        {
            --waitFrames;
            if (waitFrames == 0)
            {
                ds.storeStringValue("ReturnLocation", levelController.locationName);
                levelController.storeStringValue("CurrentLevel", levelController.locationName);
                levelController.storePlayerCoordinates();
                SceneManager.LoadScene("Scenes/QA");
            }
        }
    }
    public void generateSequence()
    {
        int nButtons = button.Length;

        if (sequenceLength < 1)
        {
            return;
        }

        if (nButtons < 1)
        {
            return;
        }

        string seq        = "";
        int    prevRandom = -1;

        for (int i = 0; i < sequenceLength; ++i)
        {
            // make sure the same button is not chosen two times in a row
            int currentRandom = (Random.Range(0, nButtons - 1));
            while (currentRandom == prevRandom)
            {
                currentRandom = (Random.Range(0, nButtons - 1));
            }
            seq        = seq + currentRandom;
            prevRandom = currentRandom;
        }

        if (!simonSequenceVariable.Equals(""))
        {
            level.storeStringValue(simonSequenceVariable, seq);
        }

        generatedSequence = seq;
    }
Пример #8
0
 public void _wm_storeTVid()
 {
     level.storeStringValue("TVFerfuflosId", id);
     level.storeIntValue("TVFerfuflosAmount", amount);
 }
Пример #9
0
    new void Update()
    {
        if (autopilotState == PlayerAutopilotState.idle)
        {
        }
        if (autopilotState == PlayerAutopilotState.seeking1)
        {
            if (!isWaitingForActionToComplete)
            {
                //hGlow.glow ();
                //player._wa_autopilotTo (this, this.transform.position - new Vector3 (0, 0, 5.02f));
                player.setOrientation(4);                 // looking back
                autopilotState = PlayerAutopilotState.seeking2;
            }
        }
        if (autopilotState == PlayerAutopilotState.seeking2)
        {
            if (!isWaitingForActionToComplete)
            {
                if (hGlow != null)
                {
                    hGlow.glow();
                }
                if (energyBurstPrefab != null)                   // if mirror is light mirror

                {
                    HeroReflection.GetComponent <Renderer> ().material.mainTexture = HeroImage;
                    HeroReflection.GetComponent <Renderer> ().enabled = true;
                    HeroReflection.GetComponent <TextureFader> ().fadeIn();
                    //camManager.moveRelative (new Vector3(0, -0.3f, 8.0f));
                    player.blockControls();
                    autopilotState = PlayerAutopilotState.waitingForBurst;
                    GameObject go = (GameObject)Instantiate(energyBurstPrefab, this.gameObject.transform.position, Quaternion.Euler(0, 0, 0));
                    energyBurst          = go.GetComponent <MirrorHeroEnergyBurst> ();
                    energyBurst.mirrorGO = this.gameObject;
                    energyBurst.playerGO = player.gameObject;
                    ParticleSystem s = go.GetComponent <ParticleSystem> ();
                    s.startColor = new Color(color.r, color.g, color.b, 1.0f);
                    energyBurst.initialize();
                    energyBurst._wm_go();
                    this.GetComponent <SphereCollider> ().center = Vector3.down * 200;
                    this.state           = MirrorState.deactivated;
                    this.interactEnabled = false;
                    deactivate();
                    substate = 0;
                    //animAux.Break (); not yet
                }

                else                   // if mirror is dark mirror
                {
                    player.blockControls();
                    spawnControl.callShadows(this.transform.position);
                    autopilotState = PlayerAutopilotState.seeking3;
                    elapsedTime    = 0.0f;
                }
            }
        }
        if (autopilotState == PlayerAutopilotState.waitingForBurst)
        {
            if (substate == 0)
            {
                if (energyBurst != null && energyBurst.state > 2)
                {
                    //player.unblockControls ();
                    Destroy(energyBurst.gameObject);
                    if (hGlow != null)
                    {
                        hGlow.glow();
                    }
                    camManager.moveToOriginalPosition();
                    HeroReflection.GetComponent <TextureFader> ().fadeOut();
                    //autopilotState = PlayerAutopilotState.idle;
                    ++substate;

                    elapsedTime = 0.0f;
                }
            }

            if (substate == 1)
            {
                elapsedTime += Time.deltaTime;
                if (elapsedTime > 2.0f)
                {
                    ++substate;
                    //HeroReflection.GetComponent<Renderer> ().enabled = false;
                    //this.GetComponent<SphereCollider> ().enabled = false;
                    animAux.Break();
                    string lvl = level.locationName.Substring(0, 6);
                    ds.storeBoolValue(lvl + MirrorColor + "MirrorDepleted", true);
                    //ds.storeBoolValue ("CurrentLevelHasHero" + HeroType, true);
                    ds.storeBoolValue("Has" + lvl + HeroType, true);
                    ds.storeBoolValue("Has" + lvl + HeroType + (indexHero - 1), true);
                    ds.storeIntValue("Has" + lvl + HeroType, indexHero - 1);
                    elapsedTime = 0.0f;
                }
            }
            if (substate == 2)
            {
                elapsedTime += Time.deltaTime;
                if (elapsedTime > 2.0f)
                {
                    if (NewHeroProgram != null)
                    {
                        NewHeroProgram.startProgram(0);
                    }
                    else
                    {
                        player.unblockControls();
                    }
                    autopilotState = PlayerAutopilotState.idle;
                    level.mcRef.saveGame(true);
                }
            }
        }
        if (autopilotState == PlayerAutopilotState.seeking3)
        {
            elapsedTime += Time.deltaTime;
            if (elapsedTime > 12.0f)
            {
                player.enterMirror();
                elapsedTime    = 0.0f;
                autopilotState = PlayerAutopilotState.seeking4;
            }
        }

        if (autopilotState == PlayerAutopilotState.seeking4)
        {
            elapsedTime += Time.deltaTime;
            if (elapsedTime > 1.9f && !grabbingFrame)
            {
                level.grabFrame();
                grabbingFrame = true;
            }
            if (elapsedTime > 2.0f)
            {
                level.storeStringValue("ReturnLocation", level.locationName);
                level.storeStringValue("CurrentMirror", level.locationName + "DarkMirrorActivated");
                level.storeStringValue("CurrentLevel", level.locationName);
                level.loadScene("WordFight");
            }
        }

        if (state == MirrorState.deactivated)
        {
            interactEnabled = false;
            glowMat.SetColor("_TintColor", new Color(0, 0, 0, 0));
        }

        if (state == MirrorState.activating)
        {
            elapsedTime += Time.deltaTime;
            if (elapsedTime > initialDelay)
            {
                state       = MirrorState.activated;
                elapsedTime = 0.0f;
            }
        }

        if (state == MirrorState.activated)
        {
            elapsedTime += Time.deltaTime;

            glowMat.SetColor("_TintColor", new Color(color.r, color.g, color.b, opacity * (1.0f + Mathf.Cos(tremoloAngle) / 12.0f)));

            tremoloAngle += tremoloAngleSpeed * Time.deltaTime;

            if (opacity < 0.19f)
            {
                opacity += opacitySpeed * Time.deltaTime;
            }

            light.intensity = 0.5f + 0.5f * Mathf.Sin(elapsedTime * angleSpeed);
            mat.SetColor("_EmissionColor", color * light.intensity / 8.0f);
        }
    }