Exemplo n.º 1
0
    private void InitializeTrapData()
    {
        triggerZone.enabled = data.trapBehaviour.enableTrigger;
        triggerZone.size    = data.triggerZoneSize;
        triggerZone.offset  = data.triggerZoneOffset;

        if (GameManager.Instance.CurrentGameState == GameManager.GameState.TrapShop)
        {
            spriteRenderer.sprite = data.buildModeSprite;
        }
        else
        {
            spriteRenderer.sprite = data.sprite;
        }

        if (trapBehaviourInstance != null)
        {
            trapBehaviourInstance.CleanUp();
            Destroy(trapBehaviourInstance);
        }

        if (data != nullData)
        {
            trapBehaviourInstance = Instantiate(data.trapBehaviour);
            trapBehaviourInstance.Initialize(transform, triggerZone);
        }
    }
Exemplo n.º 2
0
    void Start()
    {
        trig     = GameObject.Find("StoryElement").GetComponent <StoryTrigger>();
        triggers = GameObject.FindGameObjectsWithTag("storypad");

        abcTriggerGroup = GameObject.Find("ABCTriggerGroup").GetComponent <TriggerGroupBehaviour>();
        gate            = GameObject.Find("Gateway").GetComponent <GateBehavior>();
        targets         = GameObject.Find("Targets").GetComponent <TargetGroupBehavior>();
        trap            = GameObject.Find("TrapWall").GetComponent <TrapBehaviour>();

        // these are used to refer the index of each trigger
        abcTriggers = new char[] { 'A', 'B', 'C' };

        gate         = GameObject.Find("Gateway").GetComponent <GateBehavior>();
        targets      = GameObject.Find("Targets").GetComponent <TargetGroupBehavior>();
        nextRoom     = GameObject.Find("NextRoom").GetComponent <NextRoomBehaviour>();
        nextRoomDoor = GameObject.Find("NextRoomDoor").GetComponent <NextRoomDoorBehaviour>();


        bll = GameObject.Find("Ball").GetComponent <BallBehaviour>();

        print("bll " + bll);
        print("abc  " + abcTriggerGroup);

        tasktext.text = "Task: Hit a story panel."; // Set initial task text
    }
Exemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        plung    = GameObject.Find("plungerBase").GetComponent <PlungerBase> ();
        trap     = GameObject.Find("TrapWall").GetComponent <TrapBehaviour> ();
        ballBody = GameObject.Find("Ball").GetComponent <Rigidbody> ();

        Input.gyro.enabled = true;
        shakeActive        = false;
        originalPos        = transform.position;
    }