Ejemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        //Debug.Log("Event script for room A initialized!");
        isActive = true;
        exitDoor = GameObject.FindWithTag("Exit_A").GetComponent <door_script>();


        player             = GameObject.FindObjectOfType(typeof(player_script)) as player_script;
        nextEventScript    = GameObject.FindObjectOfType(typeof(event_script_R1)) as event_script_R1;
        dialogManager      = GameObject.FindObjectOfType(typeof(dialog_script)) as dialog_script;
        victim             = GameObject.FindWithTag("Victim");
        playerCameraObject = GameObject.FindWithTag("MainCamera");
        victimCameraObject = GameObject.FindWithTag("Camera2");
        playerCamera       = playerCameraObject.GetComponent <Camera> ();
        victimCamera       = victimCameraObject.GetComponent <Camera> ();
        victimSprite       = victim.GetComponentInChildren(typeof(SpriteRenderer)) as SpriteRenderer;

        //Items Collider
        teddy      = GameObject.FindWithTag("my teddy").GetComponent <ColliderListener> ();
        wife       = GameObject.FindWithTag("my wife").GetComponent <ColliderListener> ();
        armchair   = GameObject.FindWithTag("my armchair").GetComponent <ColliderListener> ();
        basketball = GameObject.FindWithTag("my basketball").GetComponent <ColliderListener> ();

        audio = GameObject.Find("EventManager_Anfang");
    }
Ejemplo n.º 2
0
    void Start()
    {
        //Debug.Log("Event script for room 2 initialized!");
        exitDoor  = GameObject.FindWithTag("Exit_R2").GetComponent <door_script>();
        entryDoor = GameObject.FindWithTag("Entry_R2").GetComponent <door_script>();

        player          = GameObject.FindObjectOfType(typeof(player_script)) as player_script;
        nextEventScript = GameObject.FindObjectOfType(typeof(event_script_R3)) as event_script_R3;
        dialogManager   = GameObject.FindObjectOfType(typeof(dialog_script)) as dialog_script;
    }
Ejemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        //Debug.Log("Event script for room 1 initialized!");
        exitDoor  = GameObject.FindWithTag("Exit_R1").GetComponent <door_script>();
        entryDoor = GameObject.FindWithTag("Entry_R1").GetComponent <door_script>();

        player            = GameObject.FindObjectOfType(typeof(player_script)) as player_script;
        nextEventScript   = GameObject.FindObjectOfType(typeof(event_script_R2)) as event_script_R2;
        dialogManager     = GameObject.FindObjectOfType(typeof(dialog_script)) as dialog_script;
        beautifulPainting = GameObject.FindObjectOfType(typeof(bildchange_script)) as bildchange_script;
        scaryPainting     = GameObject.FindObjectOfType(typeof(bild_script)) as bild_script;
    }
Ejemplo n.º 4
0
    // Use this for initialization
    void Start()
    {
        //Debug.Log("Event script for room 5 initialized!");
        exitDoor  = GameObject.FindWithTag("Exit_R5").GetComponent <darkness_script>();
        entryDoor = GameObject.FindWithTag("Entry_R5").GetComponent <door_script>();

        player          = GameObject.FindObjectOfType(typeof(player_script)) as player_script;
        nextEventScript = GameObject.FindObjectOfType(typeof(event_script_P)) as event_script_P;
        dialogManager   = GameObject.FindObjectOfType(typeof(dialog_script)) as dialog_script;
        event1          = GameObject.FindWithTag("Event1").GetComponent <ColliderListener> ();
        event2          = GameObject.FindWithTag("Event2").GetComponent <ColliderListener> ();
        audio           = GameObject.Find("EventManager_R5");
    }
Ejemplo n.º 5
0
    // Use this for initialization
    void Start()
    {
        //Debug.Log("Event script for room 3 initialized!");
        exitDoor  = GameObject.FindWithTag("Exit_R3").GetComponent <door_script>();
        entryDoor = GameObject.FindWithTag("Entry_R3").GetComponent <door_script>();

        player          = GameObject.FindObjectOfType(typeof(player_script)) as player_script;
        nextEventScript = GameObject.FindObjectOfType(typeof(event_script_R4)) as event_script_R4;
        dialogManager   = GameObject.FindObjectOfType(typeof(dialog_script)) as dialog_script;
        event1          = GameObject.FindWithTag("Bridge_Start").GetComponent <ColliderListener> ();
        planken         = GameObject.FindWithTag("Panken");
        spieler         = GameObject.FindWithTag("Player");
        collider        = GameObject.FindGameObjectWithTag("Bridge").GetComponent <Collider2D>();

        //audio = GameObject.Find ("EventManager_Anfang");
    }
Ejemplo n.º 6
0
    // Use this for initialization
    void Start()
    {
        //Debug.Log("Event script for room 4 initialized!");
        exitDoor  = GameObject.FindWithTag("Exit_R4").GetComponent <door_script>();
        entryDoor = GameObject.FindWithTag("Entry_R4").GetComponent <door_script>();

        player          = GameObject.FindObjectOfType(typeof(player_script)) as player_script;
        nextEventScript = GameObject.FindObjectOfType(typeof(event_script_R5)) as event_script_R5;
        dialogManager   = GameObject.FindObjectOfType(typeof(dialog_script)) as dialog_script;

        mud                = GameObject.FindObjectOfType(typeof(mud_script)) as mud_script;
        mudSwitch          = GameObject.FindObjectOfType(typeof(switch_script)) as switch_script;
        colliderE          = GameObject.Find("Collider [R4] Lightning").GetComponent <PolygonCollider2D> ();
        defaultPlayerSpeed = player.getSpeed();
        mud.drain();

        audio = GameObject.Find("EventManager_R4");
    }
Ejemplo n.º 7
0
    // Use this for initialization
    void Start()
    {
        //Debug.Log("Event script for room P initialized!");


        player             = GameObject.FindObjectOfType(typeof(player_script)) as player_script;
        npc                = GameObject.FindObjectOfType(typeof(npc_script)) as npc_script;
        npc_object         = GameObject.FindWithTag("NPC");
        NPC2               = GameObject.FindWithTag("NPC2").GetComponentInChildren(typeof(SpriteRenderer)) as SpriteRenderer;
        walking            = npc_object.GetComponentInChildren(typeof(Animator)) as Animator;
        idle               = npc_object.GetComponentInChildren(typeof(SpriteRenderer)) as SpriteRenderer;
        dialogManager      = GameObject.FindObjectOfType(typeof(dialog_script)) as dialog_script;
        event1             = GameObject.FindWithTag("Entry_P").GetComponent <ColliderListener> ();
        playerCameraObject = GameObject.FindWithTag("MainCamera");
        npcCameraObject    = GameObject.FindWithTag("Camera3");
        playerCamera       = playerCameraObject.GetComponent <Camera> ();
        npcCamera          = npcCameraObject.GetComponent <Camera> ();
        npcSprite          = npc_object.GetComponentInChildren(typeof(SpriteRenderer)) as SpriteRenderer;
        npcAnimation       = npc_object.GetComponentInChildren(typeof(Animator)) as Animator;
    }
Ejemplo n.º 8
0
 void Start()
 {
     walking = GetComponentInChildren(typeof(Animator)) as Animator;
     idle    = GetComponentInChildren(typeof(SpriteRenderer)) as SpriteRenderer;
     dialog  = GameObject.FindObjectOfType(typeof(dialog_script)) as dialog_script;
 }