Exemplo n.º 1
0
    public override void TASK_START()
    {
        base.startTask();


        if (!manager)
        {
            Start();
        }


        if (skip)
        {
            log.log("INFO	skip task	"+ name, 1);
            return;
        }


        destination = destinations.currentObject();
        source      = sources.currentObject();

        while (source != null && destination != null)
        {
            position = source.transform.position;
            rotation = source.transform.rotation;
            Debug.Log(destination.name.ToString());
            Debug.Log(source.name);


            source.transform.position = destination.transform.position;
            //log.log("TASK_ROTATE\t" + source.name + "\t" + this.GetType().Name + "\t" + source.transform.localEulerAngles.ToString("f1"),1);
            source.transform.localRotation = destination.transform.localRotation;
            //log.log("TASK_POSITION\t" + source.name + "\t" + this.GetType().Name + "\t" + source.transform.position.ToString("f1"),1);

            log.log("Object: \t" + source.name +
                    "\tPosition (xyz): \t" + source.transform.position.x + "\t" + source.transform.position.y + "\t" + source.transform.position.z +
                    "\tRotation (xyz): \t" + source.transform.eulerAngles.x + "\t" + source.transform.eulerAngles.y + "\t" + source.transform.eulerAngles.z
                    , 1);



            if (swap)
            {
                destination.transform.position      = position;
                destination.transform.localRotation = rotation;
            }

            destinations.incrementCurrent();
            destination = destinations.currentObject();

            sources.incrementCurrent();
            source = sources.currentObject();
        }
    }
Exemplo n.º 2
0
    public override void TASK_END()
    {
        base.endTask();
        hud.setMessage("");
        hud.SecondsToShow = hud.GeneralDuration;

        if (canIncrementLists)
        {
            if (objects)
            {
                objects.incrementCurrent();
                currentObject = objects.currentObject();
            }
            if (texts)
            {
                texts.incrementCurrent();
                currentText = texts.currentString();
            }
        }

        GameObject avatar     = manager.player.GetComponent <HUD>().Canvas as GameObject;
        Text       canvas     = avatar.GetComponent <Text>();
        string     nullstring = null;

        canvas.text = nullstring;
//            StartCoroutine(storesInactive());
        hud.showEverything();

        if (actionButtonOn)
        {
            // Reset and deactivate action button
            hud.actionButton.GetComponentInChildren <Text>().text = hud.actionButton.GetComponent <DefaultText>().defaultText;
            hud.actionButton.GetComponent <Button>().onClick.RemoveListener(hud.OnActionClick);
            hud.actionButton.SetActive(false);

            // make the cursor invisible
            Cursor.lockState = CursorLockMode.Confined;
            Cursor.visible   = false;
        }

        // If we turned movement off; turn it back on
        if (restrictMovement)
        {
            manager.player.GetComponent <CharacterController>().enabled            = true;
            manager.scaledPlayer.GetComponent <ThirdPersonCharacter>().immobilized = false;
        }
    }
Exemplo n.º 3
0
    public override void TASK_END()
    {
        base.endTask();
        //avatarController.stop();
        avatarLog.navLog = false;
        if (isScaled)
        {
            scaledAvatarLog.navLog = false;
        }

        if (canIncrementLists)
        {
            destinations.incrementCurrent();
        }
        current = destinations.currentObject();
        hud.setMessage("");
        hud.showScore = false;

        hud.SecondsToShow = hud.GeneralDuration;

        // Move hud back to center and reset
        hud.hudPanel.GetComponent <RectTransform>().anchorMin = new Vector2(0, 0);
        hud.hudPanel.GetComponent <RectTransform>().anchorMax = new Vector2(1, 1);
    }