private void Update()
    {
        if (Input.GetKeyDown(KeyCode.E))
        {
            Collider2D[] collider2DArray = Physics2D.OverlapCircleAll(playerTransform.position, 20f);
            Debug.Log(collider2DArray.Length);
            foreach (Collider2D collider2D in collider2DArray)
            {
                DoorAnims doorAnims = collider2D.GetComponent <DoorAnims>();
                if (doorAnims != null)
                {
                    doorAnims.OpenDoor();
                    //isOpen = true;
                }
            }

            /*
             * isOpen = !isOpen;
             * if (isOpen) {
             *  door.OpenDoor();
             * } else {
             *  door.CloseDoor();
             * }
             */
        }
    }
    private void Start()
    {
        FunctionTimer.Create(() => { entranceDoorAnims.SetColor(DoorAnims.ColorName.Green); }, 3.0f);
        FunctionTimer.Create(() => { entranceDoorAnims.OpenDoor(); }, 3.5f);

        CinematicBars.Show_Static(150f, .01f);
        FunctionTimer.Create(() => { CinematicBars.Show_Static(0f, .5f); }, 3f);
    }
Beispiel #3
0
    private void OnTriggerEnter(Collider other)
    {
        IShopCustomer shopCustomer = other.GetComponent <IShopCustomer>();

        if (shopCustomer != null)
        {
            nextDoor.OpenDoor();
            shop.Show(shopCustomer);
        }
    }
    private void OnTriggerEnter2D(Collider2D collider)
    {
        KeyHolder keyHolder = collider.GetComponent <KeyHolder>();

        if (keyHolder != null)
        {
            if (keyHolder.ContainsKey(keyType))
            {
                door.OpenDoor();
            }
        }
    }
    private void Start()
    {
        DoorAnims doorAnims = GetComponent <DoorAnims>();

        if (startOpen)
        {
            doorAnims.OpenDoor();
        }
        else
        {
            doorAnims.CloseDoor();
        }

        doorAnims.SetColor(doorColor);
    }
Beispiel #6
0
    private void Start()
    {
        Sound_Manager.Init();
        cameraFollow.Setup(GetCameraPosition, () => 60f, true, true);

        Vector3 pathfindingLowerLeft  = transform.Find("PathfindingLowerLeft").position;
        Vector3 pathfindingUpperRight = transform.Find("PathfindingUpperRight").position;

        gridPathfinding = new GridPathfinding(pathfindingLowerLeft, pathfindingUpperRight, 5f);
        gridPathfinding.RaycastWalkable(1 << GameAssets.i.wallLayer);
        //gridPathfinding.PrintMap(pfPathfindingWalkable, pfPathfindingUnWalkable);

        //Enemy enemy = Enemy.Create(player.GetPosition() + new Vector3(+60, 0));
        //enemy.EnemyMain.EnemyTargeting.SetGetTarget(() => player);

        uiWeapon.SetWeapon(player.GetWeapon());
        player.OnWeaponChanged += Player_OnWeaponChanged;

        FunctionTimer.Create(() => doorAnims.OpenDoor(), 3f);
    }
Beispiel #7
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     door.OpenDoor();
 }
 private void DoorOpenTrigger_OnPlayerTriggerEnter2D(object sender, System.EventArgs e)
 {
     doorAnims.SetColor(DoorAnims.ColorName.Green);
     doorAnims.OpenDoor();
     captureOnTriggerEnter2D.OnPlayerTriggerEnter2D -= DoorOpenTrigger_OnPlayerTriggerEnter2D;
 }
Beispiel #9
0
 public void OpenDoor()
 {
     doorAnims.OpenDoor();
 }
Beispiel #10
0
 private void BattleSystem_OnBattleOver(object sender, System.EventArgs e)
 {
     exitDoor.OpenDoor();
     exitDoor.SetColor(DoorAnims.ColorName.Green);
 }
Beispiel #11
0
 private void BattleSystem_onBattleOver(object sender, System.EventArgs e)
 {
     exitDoor.OpenDoor();
 }
Beispiel #12
0
 private void Start()
 {
     battleSystem.onBattleStarted += BattleSystem_OnBattleStarted;
     battleSystem.onBattleOver    += BattleSystem_onBattleOver;
     entryDoor.OpenDoor();
 }