Ejemplo n.º 1
0
    void OnMouseOver()
    {
        if (Input.GetMouseButtonDown(0))
        {
            if (startTime == 0.0F)
            {
                startTime = Time.time;
                print("time set");
            }

            isPressed = true;

            print("startTime: " + startTime + " pressDuration: " + pressDuration + " timePassed: " + timePassed);

            GuiBoxScript.showBox(true);

            ShowTextScript.setText(targetName + " angeklickt " + Time.time);



            // code for java connection
            AndroidJNIHelper.debug = true;
            AndroidJavaClass jc = new AndroidJavaClass("com.works.forme.BlankFragment");
            print("## knoblauch");
            jc.CallStatic("showAd");
        }


        if (Input.GetMouseButtonUp(0))
        {
            resetTimer();
        }
    }
Ejemplo n.º 2
0
    void mouseClicked()
    {
        print("## Story.cs: mouseClicked() method + " + SingletonData.Instance.globalStoryInDalogue);
        mGuiBox.showBox(true);
        // mGuiBox.setTextInBox("angezeigt!!!!");


        if (SingletonData.Instance.globalStoryInDalogue && mGuiBox.mStoryActionArrayList.Count > mArrayPos)           // is in bounds of the array
        {
            print("---> first if arr pos: " + mArrayPos);
            if (mGuiBox.mStoryActionArrayList[mArrayPos].StartsWith("_Action:"))                // has "action" keyword in it
            {
                print("Action Str: " + mGuiBox.mStoryActionArrayList[mArrayPos].Substring(8));

                mGuiBox.showBox(false);
                mDisplayGuiBox    = false;
                mActionHasStarted = true;
                SingletonData.Instance.globalClickWalkingIsDisabled = false;
                SingletonData.Instance.globalStoryInDalogue         = false;
                handleAction(mGuiBox.mStoryActionArrayList[mArrayPos].Substring(8));
                mArrayPos++;
            }
            else                 // is a normal text phrase
            {
                mGuiBox.showBox(true);
                print("NORMAL TEXT MODE");
                mGuiBox.setTextInBox(mGuiBox.mStoryActionArrayList[mArrayPos]);
                SingletonData.Instance.globalStoryInDalogue = true;
                mArrayPos++;
            }
        }
        else             // not in bounds of the array
        {
            mGuiBox.showBox(false);
            print("else block");
        }
    }
Ejemplo n.º 3
0
    void OnMouseOver()
    {
        if (SingletonData.Instance.globalClicksAllowed && Input.GetMouseButtonDown(0))
        {
            if (mStartTime == 0.0F)
            {
                mStartTime = Time.time;
                print("##ItemInteraction.cs: time set");
            }

            mIsPressed = true;

            //print ("##ItemInteraction.cs: startTime: " + mStartTime + " pressDuration: " + mPressDuration + " timePassed: " + mTimePassed);

            //print ("##ItemInteraction.cs: clicked once VIA THIS");

            mGuiBoxScript.showBox(true);
            // mShowTextScript.setText (mTargetName + " angeklickt " + Time.time);
            print("## ItemInteraction.cs : " + mTargetName + " angeklickt " + Time.time);


            switch (mTargetName)
            {
            case "BottlePane":
                print("##ItemInteraction.cs: BottlePane case");
                SingletonData.Instance.globalStoryBeerClicked = true;
                SingletonData.Instance.globalStoryInDalogue   = true;

                break;

            default:
                break;
            }
        }


        if (Input.GetMouseButtonUp(0))
        {
            resetTimer();
        }
    }
Ejemplo n.º 4
0
    // Use this for initialization
    void Start()
    {
        print("Story.cs start method");
        mTextControllerGO = GameObject.Find("TextController");

        mBeerFullGO  = GameObject.Find("BierflascheVoll");
        mBeerEmptyGO = GameObject.Find("BierflascheLeer");

        mBeerFullGO.SetActive(false);
        mBeerFullGO.GetComponent <SpriteRenderer> ().enabled = false;

        mBeerEmptyGO.SetActive(false);
        mBeerEmptyGO.GetComponent <SpriteRenderer> ().enabled = false;

        //mSpRendererBeerBootleFull = gameObject.GetComponent<SpriteRenderer> ().GetComponent<BierflascheVoll>(); // prepare sprite renderer

        SingletonData.Instance.globalClickWalkingIsDisabled = true;
        SingletonData.Instance.globalMouseHasBeenClicked    = false;
        SingletonData.Instance.globalStoryInDalogue         = true;

        mSingleton = new SingletonData();

        mGuiBox = mTextControllerGO.GetComponent <GuiBox> ();


        mGuiBox.mStoryActionArrayList.Add("Willkommen im Spiel. Das ist das Tutorial");
        mGuiBox.mStoryActionArrayList.Add("Suche den Kiosk um die mit der Bewegung vertraut zu machen!");
        mGuiBox.mStoryActionArrayList.Add("_Action:moveCinemaBars");
        mGuiBox.mStoryActionArrayList.Add("War doch falsch. Rechts gehts weiter.");
        mGuiBox.mStoryActionArrayList.Add("Duncan: Oh eine Flasch Bier. Die ist auch noch fast haltbar.");
        mGuiBox.mStoryActionArrayList.Add("_Action:activateWalking");
        mGuiBox.mStoryActionArrayList.Add("Duncan:\nDas ist der lezte Text 1");
        mGuiBox.mStoryActionArrayList.Add("Duncan:\nDas ist der lezte Text 2");
        mGuiBox.mStoryActionArrayList.Add("Duncan:\nDas ist der lezte Text 3");
        mGuiBox.mStoryActionArrayList.Add("Duncan:\nDas ist der lezte Text 4");
        mGuiBox.mStoryActionArrayList.Add("_Action:changeToScene0");


        mGuiBox.showBox(true);
    }
 public void SendFullNameToUnity(string aFullName)
 {
     mGuiBoxScript.showBox(true);
     mGuiBoxScript.setTextBox("Hallo, dein Name ist\n" + aFullName + "\nund du bist gerade ins Spiel gestartet.");
 }