Ejemplo n.º 1
0
    public void RespawnPlayers()
    {
        GameObject p1 = AtomicTags.FindAllByTag(playerTag.Value)[0];
        GameObject p2 = AtomicTags.FindAllByTag(playerTag.Value)[1];

        //!!!reset all in current cp pulled levers----------------------------------------------------------------------------------


        p1.GetComponent <Player_Movement>().ResetBuffs();
        p2.GetComponent <Player_Movement>().ResetBuffs();
        items.items[numActive + 1].Clear();


        transfer.InvokeEvent();        //unpull all levers

        //items.levers[numActive+1].Clear(); //reset list with in current cp pulled levers
        for (int i = 0; i <= numActive; i++)
        {
            if (hasBeenActivated[i])
            {
                currentSpawnPlayer1 = spawnPlayer1[i].position;
                currentSpawnPlayer2 = spawnPlayer2[i].position;
            }
        }

        p1.transform.position = currentSpawnPlayer1;
        p2.transform.position = currentSpawnPlayer2;
    }
Ejemplo n.º 2
0
    private void Start()
    {
        InitializeSpawnPoints();
        hasBeenActivated = new bool[GetComponentsInChildren <BoxCollider2D>().Length];
        //items.items.Clear();
        items.items  = new List <List <GameObject> >();
        items.levers = new List <List <GameObject> >();
        foreach (var VARIABLE in hasBeenActivated)
        {
            items.items.Add(new List <GameObject>());
            items.levers.Add(new List <GameObject>());
        }
        items.items.Add(new List <GameObject>());
        items.levers.Add(new List <GameObject>());

        //PotionsThatWillDisappear.items.Clear();
        PotionsThatWillDisappear.items = new List <List <GameObject> >();
        PotionsThatWillDisappear.items.Add(new List <GameObject>());
        PotionsThatWillDisappear.levers = new List <List <GameObject> >();
        PotionsThatWillDisappear.levers.Add(new List <GameObject>());

        GameObject p1 = AtomicTags.FindAllByTag(playerTag.Value)[0];
        GameObject p2 = AtomicTags.FindAllByTag(playerTag.Value)[1];

        currentSpawnPlayer1 = new Vector3(p1.transform.position.x, p1.transform.position.y, p1.transform.position.z);
        currentSpawnPlayer2 = new Vector3(p2.transform.position.x, p2.transform.position.y, p2.transform.position.z);

        //transfer.InvokeEvent();
    }
Ejemplo n.º 3
0
    private void Start()
    {
        StartPosition = transform.position;
        CameraSize    = Camera.main.orthographicSize;

        //find players
        Players = AtomicTags.FindAllByTag(PlayerTag.Value);
    }
Ejemplo n.º 4
0
 // Start is called before the first frame update
 void Start()
 {
     _light1GameObject   = AtomicTags.FindAllByTag(Lights.Value)[0];
     _light1             = _light1GameObject.GetComponent <Light2D>();
     _light2GameObject   = AtomicTags.FindAllByTag(Lights.Value)[1];
     _light2             = _light2GameObject.GetComponent <Light2D>();
     _bigLightGameObject = AtomicTags.FindByTag(BigLight.Value);
     _bLight             = _bigLightGameObject.GetComponent <Light2D>();
     Debug.Log("Bighlight:" + _bigLightGameObject + "   smallight1:" + _light1GameObject + "   smalllight2: " +
               _light2GameObject);
 }
Ejemplo n.º 5
0
    void Start()
    {
        var Players = AtomicTags.FindAllByTag(PlayerTag.Value);

        foreach (var player in Players)
        {
            if (!player.HasTag(_tags.Tags[1]))
            {
                OtherPlayer = player;
            }
        }
    }
Ejemplo n.º 6
0
/*	public void ResetDestructables()
 *      {
 *              if (eventActivateDestructables==null)
 *              {
 *                      return;
 *              }
 *              foreach (Action action in  eventActivateDestructables?.GetInvocationList() )
 *              {
 *                      eventActivateDestructables -= action;
 *              }
 *      }*/

    public void LoadScene()
    {
        //SceneManager.LoadScene(SceneManager.GetActiveScene().name);
        //don´t reload scene but reset Player
        //set all relevant variables back to normal values
        foreach (GameObject obj in AtomicTags.FindAllByTag(PlayerTag.Value))
        {
            obj.GetComponent <Player_Movement>().ResetBuffs();
        }


        //then invoke event
        InvokeEvent();
    }