Exemplo n.º 1
0
            private void OnDestroy()
            {
                if (ButtonLower != null && !ButtonLower.IsDestroyed)
                {
                    ButtonLower.Kill();
                }

                if (ButtonUpper != null && !ButtonUpper.IsDestroyed)
                {
                    ButtonUpper.Kill();
                }

                if (Lift != null && !Lift.IsDestroyed)
                {
                    RecursiveKill(Lift);
                }
            }
Exemplo n.º 2
0
            private void CreateButtons()
            {
                Vector3 position = Lift.transform.TransformPoint(buttonLowerOffset);

                ButtonLower = GameManager.server.CreateEntity(BUTTON_PREFAB, position, Lift.transform.rotation * Quaternion.Euler(0f, 180f, 0f)) as PressButton;
                ButtonLower.enableSaving = false;
                ButtonLower.Spawn();

                ButtonLower.gameObject.AddComponent <ElevatorButton>().Register(this, true);

                position = Lift.transform.TransformPoint(buttonUpperOffset);

                ButtonUpper = GameManager.server.CreateEntity(BUTTON_PREFAB, position, Lift.transform.rotation * Quaternion.Euler(0f, -137.8f, 0f)) as PressButton;
                ButtonUpper.enableSaving = false;
                ButtonUpper.Spawn();

                ButtonUpper.gameObject.AddComponent <ElevatorButton>().Register(this, false);
            }