Esempio n. 1
0
 private void FixedUpdate()
 {
     if (addValveSpawn != null)
     {
         attackerGame.spawnValve(addValveSpawn);
         myGame.spawnValve(addValveSpawn);
         targetGame.spawnValve(addValveSpawn);
         addValveSpawn = null;
     }
 }
    public void spawnValve(ValveSpawn _spawn)
    {
        GameObject newValve = Instantiate(this.availableActionables[_spawn.type]);

        if (newValve.CompareTag("waterdrop") && this.cracksOpen < this.maxCracksOpen)
        {
            cracksOpen++;
        }

        newValve.transform.parent = this.gameContainer.transform;

        newValve.transform.localPosition = new Vector3(_spawn.pos_x, 0.5f, 0);
        this.currentActionables.Add(newValve);
    }
    public void spawnValve(ValveSpawn _spawn)
    {
        GameObject newValve = Instantiate(this.availableActionables[_spawn.type]);

        if (newValve.CompareTag("waterdrop") && this.cracksOpen < this.maxCracksOpen)
        {
            cracksOpen++;
        }

        newValve.transform.parent = this.gameContainer.transform;

        Rigidbody2D rb = newValve.GetComponent <Rigidbody2D>();

        rb.velocity = new Vector3(0, -3, 0);

        newValve.transform.localPosition = new Vector3(_spawn.pos_x, height / 2, 0);

        this.currentActionables.Add(newValve);
    }
Esempio n. 4
0
    private static void SpawnValve(Message m)
    {
        ValveSpawn s = m.payload.ToObject <ValveSpawn>();

        PlayerLoaderController.addValveSpawn = s;
    }