Example #1
0
    // Use this for initialization
    void Awake()
    {
        floor      = GameObject.Find("Floor").GetComponent <SpawnFloor>();
        m_queueEnd = m_queueFront;

        waypoints = transform.GetComponentsInChildren <Waypoint> ();
    }
Example #2
0
    // Start is called before the first frame update
    void Start()
    {
        player       = GameObject.FindGameObjectWithTag("FloorPlayer");
        FloorManager = transform.parent.gameObject;

        ManagerScript = (SpawnFloor)transform.parent.gameObject.GetComponent <SpawnFloor>();
        MoveSpeed     = ManagerScript.FloorMoveSpeed;

        despawnPoint = player.transform.GetChild(0).gameObject;
        transform.Translate(0f, 0f, -MoveSpeed * Time.deltaTime);
    }
Example #3
0
    private void SpawnFloor()
    {
        GameObject temp = (GameObject)Instantiate(floorPrefabs, new Vector3(0, 0, floorCount * floorLenght), Quaternion.identity);

        temp.transform.parent = transform;
        SpawnFloor floor = new SpawnFloor();

        floor.instantiated = temp;
        ins.Add(floor);
        floorCount++;
    }
Example #4
0
    void SetKinematic(bool newValue)
    {
        Component[] components = animator.GetComponentsInChildren(typeof(Rigidbody));

        foreach (Component c in components)
        {
            (c as Rigidbody).isKinematic = newValue;
        }

        floor = GameObject.Find("Floor").GetComponent <SpawnFloor> ();
    }
Example #5
0
 void OnLevelWasLoaded(int level)
 {
     if (level == 0)
     {
         StopAllCoroutines();
         gameObject.SetActive(false);
     }
     if (level == 1)
     {
         floor = GameObject.Find("Floor").GetComponent <SpawnFloor> ();
     }
 }
Example #6
0
 public void CallElevator(Elevator elevator)
 {
     if (HasCalledElevator == false)
     {
         Console.WriteLine("[Personnel]: " + Id + " has pressed button and called elevator to " + SpawnFloor.floorName);
         SpawnFloor.CallElevator(elevator);
         HasCalledElevator = true;
     }
     else
     {
         Console.WriteLine("[Personnel]: " + Id + " has already called elevator");
     }
 }
Example #7
0
    void Awake()
    {
        //rbs = gameObject.GetComponentsInChildren<Rigidbody>(); <-- doesn't work

        foreach (Rigidbody rb in rbs)
        {
            //rb.mass *= 8;
            rb.useGravity  = false;
            rb.isKinematic = true;
        }

        gameMan  = GameObject.Find("GameManager").GetComponent <GameManager>();
        audioMan = GameObject.Find("AudioManager").GetComponent <AudioManager>();
        aam      = gameMan.gameObject.GetComponent <AimAssistManager> ();
        ebm      = gameMan.gameObject.GetComponent <EnemyBallManager> ();

        floor            = GameObject.Find("Floor").GetComponent <SpawnFloor> ();
        player           = GameObject.Find("Player");
        playerPos        = player.transform.position;
        throwDestination = GameObject.Find("ThrowDestination").transform;
    }
Example #8
0
 public void LeaveFloor()
 {
     SpawnFloor.RemovePersonFromFloor(this);
 }